Compare commits

...

48 Commits

Author SHA1 Message Date
abijah
4ed033b594 Brought in the latest database version
git-svn-id: file:///svn-source/pmgr/tags/v0.2.2@965 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-03-12 03:52:38 +00:00
abijah
4cd01cb254 Released as v0.2.2
git-svn-id: file:///svn-source/pmgr/tags/v0.2.2@964 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-03-12 03:49:34 +00:00
abijah
48631cffee Fixed a bug that was causing some lease charge_through_date fields to be NULL, which in turn caused additional charges to be added in error when assessing charges. The problem was that we were looking for statement entry charges that were not followed by other statement entries the next month. The intention was to locate rent charges that were not matched by a rent charge the following month, but we were looking for any type of statement entry. The presently visible problem was with a disbursement the next month on Lease #21, leaving NO last charge, not even just the wrong date. However, the issue could even be as simple as a Cleaning charge the next month, so we now filter not only for charges, but rent charges.
git-svn-id: file:///svn-source/pmgr/branches/v0.2_work@963 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-03-12 03:48:03 +00:00
abijah
0a594bb5a9 Merge in db changes from the v0.2.0 release
git-svn-id: file:///svn-source/pmgr/branches/v0.2_work@947 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-03-02 18:44:56 +00:00
abijah
b3d43d754b Fixed a bug with customer lease counts after editing the customer.
git-svn-id: file:///svn-source/pmgr/branches/v0.2_work@946 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-03-02 18:35:09 +00:00
abijah
a47d5d54b4 Fixed bug which was kicking us out of the dev/sandbox when editing a customer. Actually, seems like more of a workaround for a CakePHP bug, but it's not certain.
git-svn-id: file:///svn-source/pmgr/branches/v0.2_work@945 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-03-02 18:05:37 +00:00
abijah
8f5c3031fc Renamed the work branch, since it will be used for bugfix revs as well.
git-svn-id: file:///svn-source/pmgr/branches/v0.2_work@943 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-03-02 18:03:11 +00:00
abijah
83bfb8d32d As the database has grown, the statement entry page query has finally ground to a halt. The query was kludged as simple as possible, and it now operates much quicker. A cleaner solution would be nice...
git-svn-id: file:///svn-source/pmgr/branches/v0.2.0_work@936 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-03-02 03:10:54 +00:00
abijah
28817cea38 Removed buttons from the print media
git-svn-id: file:///svn-source/pmgr/branches/v0.2.0_work@914 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-01-15 01:27:44 +00:00
abijah
3dca204ac6 Added the Deposit row to all tenders, not just those that have been deposited. This helps avoid confusion when looking at a non-deposited tender, since one may be trying to figure out whether or not it has been deposited and yet not remember if this is the appropriate screen.
git-svn-id: file:///svn-source/pmgr/branches/v0.2.0_work@900 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-12-09 18:02:00 +00:00
abijah
2fb2e6f5aa Update todo to reflect newly implemented features.
git-svn-id: file:///svn-source/pmgr/branches/v0.2.0_work@875 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-09 23:53:39 +00:00
abijah
44def81c81 Merge in from v0.1.0
git-svn-id: file:///svn-source/pmgr/branches/v0.2.0_work@874 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-09 23:51:45 +00:00
abijah
03da3afb98 More things to do based on how it's been going at VSS
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@873 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-09 23:46:18 +00:00
abijah
3b885e2686 Fixed the problem of client side lease selection breaking the automated rent invoicing tools.
git-svn-id: file:///svn-source/pmgr/branches/v0.2.0_work@872 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-09 23:17:46 +00:00
abijah
e162d35d56 Added a more automated mechanism for adding multiple rent charges to an invoice. Also included is a proration tool. This needs more work though, since it relies on server side data from the lease. Selecting a new lease on the client side will cause this change to fail, and so we'll need to add a column for charged-through. Finally, error messages for invoice and receipt were improved slightly to better explain the error.
git-svn-id: file:///svn-source/pmgr/branches/v0.2.0_work@871 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-09 22:48:37 +00:00
abijah
3b3ed7a264 Branch to add minor enhancements to v0.1.0
git-svn-id: file:///svn-source/pmgr/branches/v0.2.0_work@870 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-09 19:58:50 +00:00
cron
3b5aa78a47 property_manager database backup as of 2009_10_09_0113
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@869 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-09 08:13:46 +00:00
cron
721faa129b property_manager database backup as of 2009_10_08_0117
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@868 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-08 08:18:30 +00:00
cron
78806de606 property_manager database backup as of 2009_10_06_0124
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@867 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-06 08:24:25 +00:00
cron
d4ea5eea1f property_manager database backup as of 2009_10_03_0123
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@866 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-03 08:24:03 +00:00
cron
9213c1c21d property_manager database backup as of 2009_10_02_0905
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@865 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-02 16:06:14 +00:00
abijah
9674812e78 Merge in from the v0.1.0 tag, which is a bit of a botch. The intention was to make the change to trunk, then re-label as v0.1.1. However, due to a mixup, this was put directly as the v0.1.0 tag. It isn't good, but the change is small enough we'll live with it this time.
git-svn-id: file:///svn-source/pmgr/trunk@864 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-02 15:54:00 +00:00
abijah
8bda7c2cb0 Added the updateLeaseCount call to the customer update function. Most of the time it will not be necessary, but the purpose of update() is to ensure the customer info is current, so we're obligated to call it.
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@863 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-02 15:40:54 +00:00
cron
375d63485c property_manager database backup as of 2009_10_02_0116
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@862 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-02 08:16:34 +00:00
cron
26045a3db7 property_manager database backup as of 2009_10_01_0103
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@861 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-10-01 08:03:28 +00:00
cron
04ac012754 property_manager database backup as of 2009_09_29_0120
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@860 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-29 08:20:23 +00:00
cron
e6f662f0a1 property_manager database backup as of 2009_09_26_0113
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@859 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-26 08:13:58 +00:00
cron
04b3c06cda property_manager database backup as of 2009_09_25_0129
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@858 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-25 08:30:15 +00:00
cron
24da6d75b5 property_manager database backup as of 2009_09_24_0120
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@857 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-24 08:20:57 +00:00
cron
542ae17afd property_manager database backup as of 2009_09_23_0114
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@856 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-23 08:14:54 +00:00
cron
97fffaa610 property_manager database backup as of 2009_09_20_0118
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@855 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-20 08:18:46 +00:00
cron
3eb5139b62 property_manager database backup as of 2009_09_19_0125
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@854 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-19 08:26:07 +00:00
cron
5245393a04 property_manager database backup as of 2009_09_18_0104
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@853 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-18 08:04:33 +00:00
cron
e59df1dffb property_manager database backup as of 2009_09_16_0122
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@852 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-16 08:23:11 +00:00
cron
61da97974b property_manager database backup as of 2009_09_15_0112
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@851 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-15 08:12:24 +00:00
cron
6482cfd4cc property_manager database backup as of 2009_09_14_1953
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@850 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-15 02:53:36 +00:00
abijah
c3e51a7a6b Tagging first official release: v0.1.0
git-svn-id: file:///svn-source/pmgr/tags/v0.1.0@849 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-15 02:47:55 +00:00
abijah
de069ef186 Updated the todo items
git-svn-id: file:///svn-source/pmgr/trunk@848 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-15 02:42:32 +00:00
abijah
5047abba6a Merge in from pre_0.1 branch
git-svn-id: file:///svn-source/pmgr/trunk@847 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-15 02:38:28 +00:00
abijah
4e8426fd79 Move the Charge Assessment link to the operations area, and updated the Transaction Destroy link to the admin menu and gave it a reasonable redirect instead of the view not found message (since it's no longer a dev function
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@846 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-15 02:32:56 +00:00
abijah
6630cdfcd6 Part of the final effort to bring the information current, ready to be live.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@845 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-15 02:30:20 +00:00
abijah
48d332f40f Part of the final effort to bring the information current, ready to be live.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@844 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-15 02:30:05 +00:00
abijah
3ede96dad9 Fixed the map titles on IE.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@843 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-14 17:03:56 +00:00
abijah
3e3dff31a8 I believe the bug Shirley has been seeing is finally fixed. The problem is that an extra comma at the end of a javascript object literal blows up in IE7. FF and IE8 both handle it fine, which is why we hadn't noticed. Hopefully, this change includes all areas which had the extra comma.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@842 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-07 17:04:34 +00:00
abijah
3642724b5e ajax logging is not working on site. The log message is now added as part of the post. However, it is added by using jQuery, so it may not work. Consequently, there is a default value to help narrow down the problem.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@841 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-07 05:30:08 +00:00
abijah
0ad68f4d6a Added util function to allow us to capture client side logging, and utilize it in the invoice view to find out why the app is not working on site. Also, since everything depends so heavily on jQuery, added an internal error if jQuery fails to load.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@840 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-06 15:32:41 +00:00
abijah
2628edfbdd Merge in single site support for both the sandbox and a development box as well.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@839 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-06 04:32:55 +00:00
abijah
2f3046294d Missed the transaction controller change as part of r835. Also, added check to see that customer/unit have been selected at movein.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@837 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-09-06 04:25:27 +00:00
22 changed files with 5007 additions and 352 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -45,7 +45,7 @@ Operations to be functional
X - Receive and record Money Orders
X - Receive and record Cash
X - Receive and record ACH Deposits
? - Reverse rent charges (early moveout on prepaid occupancy)
X - Reverse rent charges (early moveout on prepaid occupancy)
X - Handle NSF checks
X - Assess NSF Fees
X - Determine Lease Paid-Through status

View File

@@ -220,10 +220,6 @@ class AppController extends Controller {
$this->addSideMenuLink('Stmt Entries',
array('controller' => 'statement_entries', 'action' => 'index'), null,
'SITE', $this->admin_area);
$this->addSideMenuLink('Assess Charges',
array('controller' => 'leases', 'action' => 'assess_all'), null,
'SITE', $this->admin_area);
$this->addSideMenuLink('Un-Nuke',
'#', array('htmlAttributes' =>
@@ -250,6 +246,10 @@ class AppController extends Controller {
$this->addSideMenuLink('New Deposit',
array('controller' => 'tenders', 'action' => 'deposit'), null,
'SITE', $this->op_area);
if (!empty($this->params['admin']))
$this->addSideMenuLink('Assess Charges',
array('controller' => 'leases', 'action' => 'assess_all'), null,
'SITE', $this->op_area);
$url_components = array('plugin', 'controller', 'action', 'named');
if (devbox()) {

View File

@@ -32,15 +32,22 @@
*
*/
function sandbox() {
$r = Router::requestRoute();
return !empty($r[3]['sand_route']);
function _box($type) {
static $box = array('type' => null, 'test' => array());
if (!isset($box['type']) && !isset($box['test'][$type])) {
$r = Router::requestRoute();
/* if (!preg_match("/gridData/", $_SERVER['REQUEST_URI'])) { */
/* print("<PRE>Route:\n");print_r($r);print("\n</PRE>\n"); */
/* } */
$box['test'][$type] = !empty($r[3]["${type}_route"]);
if ($box['test'][$type])
$box['type'] = $type;
}
return $box['type'] == $type;
}
function devbox() {
$r = Router::requestRoute();
return !empty($r[3]['dev_route']);
}
function sandbox() { return _box('sand'); }
function devbox() { return _box('dev'); }
function server_request_var($var) {
if (preg_match("/^HTTP_ACCEPT|REMOTE_PORT/", $var))

View File

@@ -43,6 +43,16 @@ Router::connect('/sand',
array('sand_route' => true) + $default_path);
Router::connect('/sand/:controller/:action/*',
array('sand_route' => true, 'action' => null));
/* Unfortunately, for some reason we need an extra route to solve
* a bug with form generation. When $this->data is set by the
* controller, and a URL is generated by the FormHelper, this
* route is required to ensure the form action is correct. An
* example of a broken page is for /customers/edit/XX. It appears
* the page location uses the route above, it's only URL generation
* that seems to be broken.
*/
Router::connect('/sand/:controller/:action/:id/*',
array('sand_route' => true,'action' => null, 'id'=>null));
/*
* Route for developement functionality
@@ -51,5 +61,15 @@ Router::connect('/dev',
array('dev_route' => true) + $default_path);
Router::connect('/dev/:controller/:action/*',
array('dev_route' => true, 'action' => null));
/* Unfortunately, for some reason we need an extra route to solve
* a bug with form generation. When $this->data is set by the
* controller, and a URL is generated by the FormHelper, this
* route is required to ensure the form action is correct. An
* example of a broken page is for /customers/edit/XX. It appears
* the page location uses the route above, it's only URL generation
* that seems to be broken.
*/
Router::connect('/dev/:controller/:action/:id/*',
array('dev_route' => true,'action' => null, 'id'=>null));
?>

View File

@@ -2,6 +2,12 @@
class CustomersController extends AppController {
// DEBUG FUNCTION ONLY!
// Call without id to update ALL customers
function force_update($id = null) {
$this->Customer->update($id);
$this->redirect(array('action'=>'index'));
}
/**************************************************************************
**************************************************************************

View File

@@ -394,6 +394,10 @@ class LeasesController extends AppController {
$this->set(compact('default_late'));
if ($type === 'move-in') {
// Make sure we have a valid lease that we're moving in
if (empty($lease))
$this->redirect(array('action' => 'index'));
$movein = array();
$movein['time'] = strtotime($lease['Lease']['movein_date']);
$movein['effective_time'] = strtotime($lease['Lease']['movein_date']);

View File

@@ -47,7 +47,17 @@ class StatementEntriesController extends AppController {
if (!empty($params['post']['custom']['statement_entry_id'])) {
$link['ChargeEntry'] = array();
$link['DisbursementEntry'] = array();
// This query actually represents a union...
// Unpaid Charge/Surplus: ChargeID - NULL; DisbursementID - NULL
// Paid Charge/Refund: ChargeID - NULL; DisbursementID - !NULL
// Disbursement/Reversal: ChargeID - !NULL; DisbursementID - NULL
// <EMPTY SET>: ChargeID - !NULL; DisbursementID - !NULL
//
// The query is really slow unless we add the `id` condition to the join.
// A cleaner query would be nice, but we must work within the Cake framework.
$link['DisbursementEntry'] = array('conditions' =>
'`DisbursementEntry`.`id` = '
. $params['post']['custom']['statement_entry_id']);
}
return array('link' => $link);

View File

@@ -112,7 +112,7 @@ class TransactionsController extends AppController {
* - handles the creation of a charge invoice
*/
function postInvoice() {
function postInvoice($redirect = true) {
if (!$this->RequestHandler->isPost()) {
echo('<H2>THIS IS NOT A POST FOR SOME REASON</H2>');
return;
@@ -127,6 +127,17 @@ class TransactionsController extends AppController {
die("<H1>INVOICE FAILED</H1>");
}
if ($redirect) {
if (!empty($this->data['Customer']['id']))
$this->redirect(array('controller' => 'customers',
'action' => 'receipt',
$this->data['Customer']['id']));
else
$this->redirect(array('controller' => 'leases',
'action' => 'view',
$this->data['Lease']['id']));
}
$this->layout = null;
$this->autoLayout = false;
$this->autoRender = false;
@@ -140,7 +151,7 @@ class TransactionsController extends AppController {
* - handles the creation of a receipt
*/
function postReceipt() {
function postReceipt($redirect = true) {
if (!$this->RequestHandler->isPost()) {
echo('<H2>THIS IS NOT A POST FOR SOME REASON</H2>');
return;
@@ -164,6 +175,11 @@ class TransactionsController extends AppController {
die("<H1>RECEIPT FAILED</H1>");
}
if ($redirect)
$this->redirect(array('controller' => 'customers',
'action' => 'view',
$this->data['Customer']['id']));
$this->layout = null;
$this->autoLayout = false;
$this->autoRender = false;
@@ -377,9 +393,11 @@ class TransactionsController extends AppController {
* irreversibly destroys the data. It is not for normal use.
*/
function destroy($id = null) {
function destroy($id) {
$this->Transaction->id = $id;
$customer_id = $this->Transaction->field('customer_id');
$this->Transaction->destroy($id);
//$this->redirect(array('action' => 'index'));
$this->redirect(array('controller' => 'customers', 'action' => 'view', $customer_id));
}
@@ -423,7 +441,7 @@ class TransactionsController extends AppController {
"This may leave the database in an unstable state." .
" Do NOT do this unless you know what you're doing." .
" Proceed anyway?"),
'ACTION', $this->dev_area);
'ACTION', $this->admin_area);
// OK, prepare to render.
$title = 'Transaction #' . $transaction['Transaction']['id'];

View File

@@ -62,4 +62,15 @@ class UtilController extends AppController {
function rebuild_sandbox() { $this->rebuild_box('sand'); }
function rebuild_devbox() { $this->rebuild_box('dev'); }
/**************************************************************************
**************************************************************************
**************************************************************************
* function: logmsg
* - action to allow posting log message data
*/
function logmsg() {
}
}

View File

@@ -192,6 +192,13 @@ class Customer extends AppModel {
}
$id = $this->id;
// Appears that $this->save() "helpfully" choses to add in
// any missing data fields, populated with default values.
// So, after saving is complete, the fields 'lease_count',
// 'past_lease_count', and 'current_lease_count' have all
// been reset to zero. Gee, thanks Cake...
$this->update($id);
// Remove all associated Customer Contacts, as it ensures
// any entries deleted by the user actually get deleted
// in the system. We'll recreate the needed ones anyway.
@@ -247,10 +254,10 @@ class Customer extends AppModel {
return;
}
// REVISIT <AP>: 20090812
// updateLeaseCount is handled directly when needed.
// Should we simplify by just doing it anyway?
//$this->updateLeaseCount($id);
// updateLeaseCount is typically handled directly when needed.
// However, this function is used to _ensure_ customer info is
// current, so we're obligated to call it anyway.
$this->updateLeaseCount($id);
$current_leases =
$this->find('all',

View File

@@ -148,9 +148,11 @@ class Lease extends AppModel {
array('class' => 'StatementEntry',
'fields' => array(),
'conditions' => array
('SEx.effective_date = DATE_ADD(StatementEntry.through_date, INTERVAL 1 day)',
'SEx.lease_id = StatementEntry.lease_id',
('SEx.lease_id = StatementEntry.lease_id',
'SEx.type' => 'CHARGE',
'SEx.account_id' => $rent_account_id,
'SEx.reverse_transaction_id IS NULL',
'SEx.effective_date = DATE_ADD(StatementEntry.through_date, INTERVAL 1 day)',
),
),
),

View File

@@ -25,12 +25,12 @@ Configure::write('debug', '0');
beforeSubmit: verifyRequest, // pre-submit callback
success: showResponse, // post-submit callback
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postReceipt', 0)); ?>",
// other available options:
//clearForm: true, // clear all form fields after successful submit
//resetForm: true, // reset the form after successful submit
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postReceipt', 0)); ?>"
};
// bind form using 'ajaxForm'
@@ -48,24 +48,32 @@ function verifyRequest(formData, jqForm, options) {
if (formData[i]['name'] == "data[Customer][id]" &&
!(formData[i]['value'] > 0)) {
//$("#debug").append('<P>Missing Customer ID');
alert("Must select a customer first");
alert("Please select a customer first.");
return false;
}
if (formData[i]['name'] == "data[Transaction][stamp]" &&
formData[i]['value'] == '') {
//$("#debug").append('<P>Bad Stamp');
alert("Must enter a valid date stamp");
if (formData[i]['value'] != '')
alert(formData[i]['value'] + " is not valid date stamp. Please correct it.");
else
alert("Please enter a valid date stamp first.");
return false;
}
// Terrible way to accomplish this...
for (var j = 0; j < 20; ++j) {
if (formData[i]['name'] == "data[Entry]["+j+"][amount]" &&
!(formData[i]['value'] > 0)) {
if (formData[i]['name'] == "data[Entry]["+j+"][amount]") {
var val = formData[i]['value'].replace(/\$/,'');
//$("#debug").append('<P>Bad Amount');
alert("Must enter a valid amount");
return false;
if (!(val > 0)) {
if (formData[i]['value'] == '')
alert("Please enter an amount first.");
else
alert('"'+formData[i]['value']+'"' + " is not valid amount. Please correct it.");
return false;
}
}
}

View File

@@ -11,6 +11,7 @@ $cols['Signed'] = array('index' => 'Lease.lease_date', 'formatter' => 'dat
$cols['Move-In'] = array('index' => 'Lease.movein_date', 'formatter' => 'date');
$cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'date');
$cols['Closed'] = array('index' => 'Lease.close_date', 'formatter' => 'date');
$cols['Charge-Thru'] = array('index' => 'Lease.charge_through_date', 'formatter' => 'date');
$cols['Paid-Thru'] = array('index' => 'Lease.paid_through_date', 'formatter' => 'date');
$cols['Status'] = array('index' => 'status', 'formatter' => 'longenum');
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
@@ -18,7 +19,7 @@ $cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'com
if (!empty($this->params['action'])) {
if ($this->params['action'] === 'closed')
$grid->invalidFields(array('Paid-Thru', 'Status'));
$grid->invalidFields(array('Charge-Thru', 'Paid-Thru', 'Status'));
elseif ($this->params['action'] === 'active')
$grid->invalidFields(array('Closed'));
elseif ($this->params['action'] === 'delinquent')
@@ -32,4 +33,4 @@ $grid
->defaultFields(array('Lease'))
->searchFields(array('Customer', 'Unit'))
->render($this, isset($config) ? $config : null,
array_diff(array_keys($cols), array('Signed', 'Status', 'Comment')));
array_diff(array_keys($cols), array('Signed', 'Charge-Thru', 'Status', 'Comment')));

View File

@@ -74,9 +74,9 @@ jQuery(document).ready(function(){
jQuery("#sidemenu").accordion
({ fillSpace : true,
event : "click hoverintent",
animated : "bounceslide",
animated : "bounceslide"
JSCB
. (isset($active_section) ? "\tactive : $active_section,\n" : '') .
. (isset($active_section) ? ",\n\t active : $active_section\n" : '') .
<<<JSCB
});
}

View File

@@ -86,6 +86,18 @@
echo $javascript->link('pmgr') . "\n";
echo $scripts_for_layout . "\n";
?>
<?php if ($this->params['action'] !== 'INTERNAL_ERROR'): ?>
<script type="text/javascript"><!--
if (typeof(jQuery) == 'undefined') {
window.location.href =
"<?php echo $html->url(array('controller' => 'util',
'action' => 'INTERNAL_ERROR',
'jQuery NOT LOADED!')); ?>";
}
--></script>
<?php endif; ?>
</head>
<body>

View File

@@ -10,6 +10,7 @@ $customer = $lease['Customer'];
if (isset($lease['Lease']))
$lease = $lease['Lease'];
//pr(compact('unit', 'customer', 'lease', 'movein'));
/**********************************************************************
**********************************************************************
@@ -25,35 +26,28 @@ Configure::write('debug', '0');
<script type="text/javascript"><!--
var lease_charge_through;
// prepare the form when the DOM is ready
$(document).ready(function() {
$("#debug").append('doc ready1' + '<BR>');
var options = {
var options = {
target: '#output-debug', // target element(s) to be updated with server response
beforeSubmit: verifyRequest, // pre-submit callback
success: showResponse, // post-submit callback
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postInvoice', 0)); ?>",
// other available options:
//clearForm: true, // clear all form fields after successful submit
//resetForm: true, // reset the form after successful submit
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postInvoice', 0)); ?>"
};
if ($('#invoice-form').ajaxForm != null)
$("#debug").append('ajax present' + '<BR>');
else
$("#debug").append('ajax not present' + '<BR>');
// bind form using 'ajaxForm'
if ($('#invoice-form').ajaxForm != null) {
$("#debug").append('go ajax' + '<BR>');
$('#invoice-form').ajaxForm(options);
$("#debug").append('ajax set' + '<BR>');
}
else
$('#repeat, label[for=repeat]').remove();
// bind form using 'ajaxForm'
if ($('#invoice-form').ajaxForm != null)
$('#invoice-form').ajaxForm(options);
else
$('#repeat, label[for=repeat]').remove();
});
// pre-submit callback
@@ -71,19 +65,27 @@ function verifyRequest(formData, jqForm, options) {
if (formData[i]['name'] == "data[Transaction][stamp]" &&
formData[i]['value'] == '') {
//$("#debug").append('<P>Bad Stamp');
alert("Must enter a valid date stamp");
if (formData[i]['value'] != '')
alert(formData[i]['value'] + " is not valid date stamp. Please correct it.");
else
alert("Please enter a valid date stamp first.");
return false;
}
// Terrible way to accomplish this...
/* for (var j = 0; j < 20; ++j) { */
/* if (formData[i]['name'] == "data[Entry]["+j+"][amount]" && */
/* !(formData[i]['value'] > 0)) { */
/* //$("#debug").append('<P>Bad Amount'); */
/* alert("Must enter a valid amount"); */
/* return false; */
/* } */
/* } */
for (var j = 0; j < 20; ++j) {
if (formData[i]['name'] == "data[Entry]["+j+"][amount]") {
var val = formData[i]['value'].replace(/\$/,'');
//$("#debug").append('<P>Bad Amount');
if (!(val > 0)) {
if (formData[i]['value'] == '')
alert("Please enter an amount for Charge #"+j+", or remove the Charge completely.");
else
alert('"'+formData[i]['value']+'"' + " is not a valid amount for Charge #"+j+". Please correct it.");
return false;
}
}
}
}
//$("#debug").append('OK');
@@ -131,13 +133,11 @@ function showResponse(responseText, statusText) {
// Reset the form
function resetForm(nocharge) {
$("#debug").append('reset form: ' + nocharge + '<BR>');
$('#charge-entry-id').val(1);
$('#charges').html('');
if (!nocharge)
addChargeSource(false);
$("#debug").append('reset form done' + '<BR>');
}
@@ -153,6 +153,7 @@ function onRowSelect(grid_id, lease_id) {
$("#invoice-deposit").html($(grid_id).getCell(lease_id, 'Lease-deposit')
? $(grid_id).getCell(lease_id, 'Lease-deposit')
: '-');
lease_charge_through = $(grid_id).getCell(lease_id, 'Lease-charge_through_date')
// Hide the "no lease" message and show the current lease
$(".lease-selection-invalid").hide();
@@ -163,7 +164,6 @@ function onRowSelect(grid_id, lease_id) {
}
function onGridState(grid_id, state) {
$("#debug").append('on grid state: ' + grid_id + '; ' + state + '<BR>');
if (state == 'visible') {
$(".lease-selection-invalid").hide();
$(".lease-selection-valid").hide();
@@ -177,11 +177,81 @@ function onGridState(grid_id, state) {
$(".lease-selection-invalid").show();
}
}
$("#debug").append('on grid state done' + '<BR>');
}
function setNextRent(id) {
var chg_thru;
$('.ChargeForm').each( function(i) {
if ($('.ChargeFormThroughDate', this).attr('id') == 'Entry'+id+'ThroughDate')
return;
if ($('.ChargeFormAccount option:selected', this).val() == <?php echo $rentAccount ?>
&& $('.ChargeFormThroughDate', this).val()) {
var dt = new Date($('.ChargeFormThroughDate', this).val());
//$('#debug').append('Rent in ' + i + '; date ' + dt + '<BR>');
if (chg_thru == null || dt > chg_thru)
chg_thru = dt;
}
});
if (!chg_thru)
chg_thru = new Date(lease_charge_through);
if (chg_thru < dateEOM(chg_thru)) {
// Add a charge to finish out the month
datepickerSet('Entry'+id+'EffectiveDate', dateTomorrow(chg_thru));
datepickerSet('Entry'+id+'ThroughDate', dateEOM(chg_thru));
} else {
// Add a whole month's charge for next month
datepickerSet('Entry'+id+'EffectiveDate', dateNextBOM(chg_thru));
datepickerSet('Entry'+id+'ThroughDate', dateNextEOM(chg_thru));
}
// Now add in the amount owed based on the calculated
// effective and through dates.
prorate(id);
}
function prorate(id) {
var edt = datepickerGet('Entry'+id+'EffectiveDate');
var tdt = datepickerGet('Entry'+id+'ThroughDate');
var rent = $('#invoice-rent').html().replace(/\$/,'');
// Reset the comment. It might wipe out a user comment,
// but it's probably low risk/concern
$('#Entry'+id+'Comment').val('');
if (edt == null || tdt == null) {
alert('Can only prorate with both effective and through dates');
rent = 0;
}
else if (edt > tdt) {
alert('Effective date is later than the Through date');
rent = 0;
}
else if (tdt.getMonth() == edt.getMonth() + 1 &&
edt.getDate() == tdt.getDate() + 1) {
// appears to be anniversary billing, one full cycle
}
else if (edt.getTime() == dateBOM(edt).getTime() &&
tdt.getTime() == dateEOM(edt).getTime()) {
// appears to be one full month
}
else {
var one_day=1000*60*60*24;
var days = Math.ceil((tdt.getTime()-edt.getTime()+1)/(one_day));
var dim =
((edt.getMonth() == tdt.getMonth())
? dateEOM(edt).getDate() // prorated within the month.
: 30); // prorated across months.
rent *= days / dim;
$('#Entry'+id+'Comment').val('Rent proration: '+days+'/'+dim+' days');
}
$('#Entry'+id+'Amount').val(fmtCurrency(rent));
}
function addChargeSource(flash) {
$("#debug").append('add charge source' + '<BR>');
var id = $("#charge-entry-id").val();
addDiv('charge-entry-id', 'charge', 'charges', flash,
// HTML section
@@ -192,40 +262,42 @@ function addChargeSource(flash) {
echo FormatHelper::phpVarToJavascript
($this->element('form_table',
array('id' => 'Entry%{id}Form',
'class' => "item invoice ledger-entry entry",
'class' => "ChargeForm item invoice ledger-entry entry",
//'with_name_after' => ':',
'field_prefix' => 'Entry.%{id}',
'fields' => array
("account_id" => array('name' => 'Account',
'opts' =>
array('options' => $chargeAccounts,
array('class' => 'ChargeFormAccount',
'options' => $chargeAccounts,
'value' => $defaultAccount,
),
'between' => '<A HREF="#" ONCLICK="setNextRent(\'%{id}\'); return false;">Rent</A>',
),
"effective_date" => array('opts' =>
array('type' => 'text'),
array('class' => 'ChargeFormEffectiveDate',
'type' => 'text'),
'between' => '<A HREF="#" ONCLICK="datepickerBOM(\'TransactionStamp\',\'Entry%{id}EffectiveDate\'); return false;">BOM</A>',
),
"through_date" => array('opts' =>
array('type' => 'text'),
array('class' => 'ChargeFormThroughDate',
'type' => 'text'),
'between' => '<A HREF="#" ONCLICK="datepickerEOM(\'Entry%{id}EffectiveDate\',\'Entry%{id}ThroughDate\'); return false;">EOM</A>',
),
"amount" => array('opts' => array('class' => 'invoice amount')),
"comment" => array('opts' => array('size' => 50)),
"amount" => array('opts' => array('class' => 'ChargeFormAmount invoice amount'),
'between' => '<A HREF="#" ONCLICK="prorate(\'%{id}\'); return false;">Prorate</A>',
),
"comment" => array('opts' => array('class' => 'ChargeFormComment', 'size' => 50)),
),
))) . "+\n";
?>
'</FIELDSET>'
);
$("#debug").append('add div complete' + '<BR>');
$("#debug").append('add datepicker1' + '<BR>');
datepicker("Entry"+id+"EffectiveDate");
$("#debug").append('add datepicker2' + '<BR>');
datepicker("Entry"+id+"ThroughDate");
$("#debug").append('add charge source complete' + '<BR>');
return id;
}
@@ -251,7 +323,8 @@ if (empty($movein))
array('gridstate' =>
'onGridState("#"+$(this).attr("id"), gridstate)'),
),
'exclude' => array('Closed'),
'include' => array('Charge-Thru'),
'exclude' => array('Closed', 'Paid-Thru'),
'action' => 'active',
'nolinks' => true,
'limit' => 10,
@@ -348,90 +421,16 @@ Configure::write('debug', '0');
$('tr td:nth-child('+col+'), tr th:nth-child('+col+')', this).remove();
};
function addHidden(id, fld, name) {
$('#Entry'+id+fld).after
('<input type="hidden"' +
' name="data[Entry]['+id+']['+name+']"' +
' value="' + $('#Entry'+id+fld).val() + '">');
}
$(document).ready(function(){
$("#debug").append('doc ready2' + '<BR>');
datepicker('TransactionStamp');
$("#lease-id").val(0);
$("#invoice-lease").html("INTERNAL ERROR");
$("#invoice-unit").html("INTERNAL ERROR");
$("#invoice-customer").html("INTERNAL ERROR");
$("#invoice-rent").html("INTERNAL ERROR");
$("#invoice-late").html("INTERNAL ERROR");
$("#invoice-deposit").html("INTERNAL ERROR");
<?php if (empty($movein)): ?>
$("#debug").append('movein empty' + '<BR>');
resetForm();
datepickerNow('TransactionStamp');
<?php else: ?>
$("#debug").append('movein not empty' + '<BR>');
var id;
resetForm(true);
$("#TransactionStamp").attr('disabled', true);
$("#TransactionStamp").val("<?php echo date('m/d/Y', $movein['time']); ?>");
$('#TransactionStamp').after
('<input type="hidden"' +
' name="data[Transaction][stamp]"' +
' value="<?php echo date('m/d/Y', $movein['time']); ?>">');
$("#TransactionComment").val('Move-In Charges');
<?php if ($movein['deposit'] != 0): ?>
id = addChargeSource(false);
$('#Entry'+id+'Form').removeCol(2);
$('#Entry'+id+'Form input, #Entry'+id+'Form select').attr('disabled', true);
$('#Entry'+id+'EffectiveDate').val("<?php echo date('m/d/Y', $movein['effective_time']); ?>");
$('#Entry'+id+'EffectiveDate').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][effective_date]"' +
' value="<?php echo date('m/d/Y', $movein['effective_time']); ?>">');
$('#Entry'+id+'AccountId').val(<?php echo $securityDepositAccount; ?>);
$('#Entry'+id+'AccountId').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][account_id]"' +
' value="<?php echo $securityDepositAccount; ?>">');
$('#Entry'+id+'Amount').val("<?php echo FormatHelper::currency($movein['deposit']); ?>");
$('#Entry'+id+'Amount').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][amount]"' +
' value="<?php echo FormatHelper::currency($movein['deposit']); ?>">');
//$('#Entry'+id+'Comment').val('Move-In Security Deposit');
$('#Entry'+id+'Comment').removeAttr('disabled');
<?php endif; ?>
id = addChargeSource(false);
$('#Entry'+id+'Form').removeCol(2);
$('#Entry'+id+'Form input, #Entry'+id+'Form select').attr('disabled', true);
$('#Entry'+id+'EffectiveDate').val("<?php echo date('m/d/Y', $movein['effective_time']); ?>");
$('#Entry'+id+'EffectiveDate').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][effective_date]"' +
' value="<?php echo date('m/d/Y', $movein['effective_time']); ?>">');
$('#Entry'+id+'ThroughDate').val("<?php echo date('m/d/Y', $movein['through_time']); ?>");
$('#Entry'+id+'ThroughDate').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][through_date]"' +
' value="<?php echo date('m/d/Y', $movein['through_time']); ?>">');
$('#Entry'+id+'AccountId').val(<?php echo $rentAccount; ?>);
$('#Entry'+id+'AccountId').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][account_id]"' +
' value="<?php echo $rentAccount; ?>">');
$('#Entry'+id+'Amount').val("<?php echo FormatHelper::currency($movein['prorated_rent']); ?>");
$('#Entry'+id+'Amount').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][amount]"' +
' value="<?php echo FormatHelper::currency($movein['prorated_rent']); ?>">');
$('#Entry'+id+'Comment').val("<?php echo($movein['prorated'] ? 'Move-In Rent (Prorated)' : ''); ?>");
$('#Entry'+id+'Comment').removeAttr('disabled');
<?php endif; ?>
<?php if (isset($lease['id'])): ?>
$("#lease-id").val(<?php echo $lease['id']; ?>);
$("#invoice-lease").html("<?php echo '#'.$lease['number']; ?>");
@@ -440,6 +439,71 @@ Configure::write('debug', '0');
$("#invoice-rent").html("<?php echo FormatHelper::currency($lease['rent']); ?>");
$("#invoice-late").html("<?php echo FormatHelper::currency($defaultLate); ?>");
$("#invoice-deposit").html("<?php echo FormatHelper::currency($lease['deposit']); ?>");
lease_charge_through = <?php
if ($lease['charge_through_date'])
echo 'new Date("'.date('m/d/Y', strtotime($lease['charge_through_date'])).'")';
elseif ($lease['paid_through_date'])
echo 'new Date("'.date('m/d/Y', strtotime($lease['paid_through_date'])).'")';
else
echo 'dateYesterday("'.date('m/d/Y', strtotime($lease['movein_date'])).'")';
?>;
<?php else: ?>
$("#lease-id").val(0);
$("#invoice-lease").html("INTERNAL ERROR");
$("#invoice-unit").html("INTERNAL ERROR");
$("#invoice-customer").html("INTERNAL ERROR");
$("#invoice-rent").html("INTERNAL ERROR");
$("#invoice-late").html("INTERNAL ERROR");
$("#invoice-deposit").html("INTERNAL ERROR");
<?php endif; ?>
<?php if (empty($movein)): ?>
resetForm();
datepickerNow('TransactionStamp');
<?php else: ?>
var id;
resetForm(true);
$("#TransactionStamp").attr('disabled', true);
$("#TransactionStamp").val("<?php echo date('m/d/Y', $movein['time']); ?>");
$('#TransactionStamp').after
('<input type="hidden"' +
' name="data[Transaction][stamp]"' +
' value="' + $("#TransactionStamp").val() + '">');
$("#TransactionComment").val('Move-In Charges');
<?php if ($movein['deposit'] != 0): ?>
id = addChargeSource(false);
$('#Entry'+id+'Form').removeCol(2);
$('#Entry'+id+'Form input, #Entry'+id+'Form select').attr('disabled', true);
$('#Entry'+id+'EffectiveDate').val("<?php echo date('m/d/Y', $movein['effective_time']); ?>");
addHidden(id, 'EffectiveDate', 'effective_date');
$('#Entry'+id+'AccountId').val(<?php echo $securityDepositAccount; ?>);
addHidden(id, 'AccountId', 'account_id');
$('#Entry'+id+'Amount').val("<?php echo FormatHelper::currency($movein['deposit']); ?>");
addHidden(id, 'Amount', 'amount');
$('#Entry'+id+'Comment').removeAttr('disabled');
<?php endif; ?>
id = addChargeSource(false);
$('#Entry'+id+'Form').removeCol(2);
$('#Entry'+id+'Form input, #Entry'+id+'Form select').attr('disabled', true);
setNextRent(id);
addHidden(id, 'EffectiveDate', 'effective_date');
addHidden(id, 'ThroughDate', 'through_date');
addHidden(id, 'AccountId', 'account_id');
addHidden(id, 'Amount', 'amount');
$('#Entry'+id+'Comment').removeAttr('disabled');
<?php endif; ?>
<?php if (isset($lease['id'])): ?>
onGridState(null, 'hidden');
<?php else: ?>
onGridState(null, 'visible');

View File

@@ -6,6 +6,19 @@
{// for indentation purposes
// Go through each unit, adding a clickable region for the unit
foreach ($info['units'] AS $unit){
$title = ('Unit #' .
$unit['name'] .
(empty($unit['data']['CurrentLease']['id'])
? ''
: ('; ' .
/* 'Lease #' . */
/* $unit['data']['CurrentLease']['id'] . */
/* '; ' . */
$unit['data']['Customer']['name'] .
'; Paid Through ' .
$unit['data']['CurrentLease']['paid_through_date'])
));
echo(' <area shape="rect"' .
' coords="' .
$unit['left'] . ',' .
@@ -16,20 +29,8 @@
$html->url(array('controller' => 'units',
'action' => 'view',
$unit['id'])) .
'" alt="Unit #' .
$unit['name'] .
'" title="Unit #' .
$unit['name'] .
(empty($unit['data']['CurrentLease']['id'])
? ''
: ('; ' .
/* 'Lease #' . */
/* $unit['data']['CurrentLease']['id'] . */
/* '; ' . */
$unit['data']['Customer']['name'] .
'; Paid Through ' .
$unit['data']['CurrentLease']['paid_through_date'])
) .
'" alt="' . $title .
'" title="' . $title .
'">' . "\n");
}
}// for indentation purposes

View File

@@ -33,11 +33,13 @@ for ($i=1; $i<=4; ++$i)
if (!empty($ttype["data{$i}_name"]))
$rows[] = array($ttype["data{$i}_name"], $tender["data{$i}"]);
if (!empty($tender['deposit_transaction_id']))
$rows[] = array('Deposit', $html->link('#'.$tender['deposit_transaction_id'],
array('controller' => 'transactions',
'action' => 'deposit_slip',
$tender['deposit_transaction_id'])));
$rows[] = array('Deposit',
empty($tender['deposit_transaction_id'])
? "-"
: $html->link('#'.$tender['deposit_transaction_id'],
array('controller' => 'transactions',
'action' => 'deposit_slip',
$tender['deposit_transaction_id'])));
if (!empty($tender['nsf_transaction_id']))
$rows[] = array('NSF', $html->link('#'.$tender['nsf_transaction_id'],

View File

@@ -16,6 +16,14 @@ div#debug-kit-toolbar
{ display: none; }
/************************************************************
* Form inputs
*/
/* The "page N / M" input box... make it look like normal text */
input[type='button'], input[type='submit'], input[type='reset']
{ display: none; }
/************************************************************
* Grid display
*/

View File

@@ -67,7 +67,17 @@ function dump(element, limit, depth) {
if (props.length == 0)
return '';
return pad + '<ol><li>' + props.join("</li>\n" + pad + pad1 + "<li>") + "</li>\n" + pad + "</ol>";
if (typeof dump.dumpid == 'undefined')
dump.dumpid = 0;
++dump.dumpid;
return (pad
+ '<A HREF="#" ONCLICK="$(\'#dumpid-'+dump.dumpid+'\').toggle(); return false;">(hide members)</A><BR>'
+ '<ol id="dumpid-'+dump.dumpid+'" STYLE="padding-top:0; margin-top:0;">'
+ '<li>'
+ props.join("</li>\n" + pad + pad1 + '<li id="dumpid-'+dump.dumpid+'">')
+ "</li>\n"
+ pad + "</ol>");
}
function dump_window(element, limit) {
@@ -158,70 +168,103 @@ function datepicker(id) {
}
}
function datepickerNow(id, usetime) {
var now = new Date();
if ($("#"+id).datepicker != null) {
// datepicker seems to squash the time portion,
// so we have to pass in a copy of now instead.
$("#"+id).datepicker('setDate', new Date(now));
}
else {
$("#"+id).val(((now.getMonth()+1) < 10 ? '0' : '')
+ (now.getMonth()+1) + '/'
+ (now.getDate() < 10 ? '0' : '')
+ now.getDate() + '/'
+ now.getFullYear());
}
if (usetime == null)
usetime = true;
$("#"+id).val($("#"+id).val() +
(usetime
? (' '
+ (now.getHours() < 10 ? '0' : '')
+ now.getHours() + ':'
+ (now.getMinutes() < 10 ? '0' : '')
+ now.getMinutes())
: ''));
}
function datepickerSet(fromid, id, a, b) {
var dt;
if (fromid == null)
function datepickerGet(id) {
if (id == null)
dt = new Date();
else {
if ($("#"+id).datepicker != null)
dt = new Date($("#"+fromid).datepicker('getDate'));
else
dt = new Date($("#"+fromid).val());
if ($("#"+id).datepicker != null && $("#"+id).datepicker('getDate') != null)
dt = new Date($("#"+id).datepicker('getDate'));
else if ($("#"+id).val())
dt = new Date($("#"+id).val());
else
dt = null;
}
if (a != null)
dt.setDate(a);
if (b != null)
dt.setDate(b);
return dt;
}
if ($("#"+id).datepicker != null)
$("#"+id).datepicker('setDate', dt);
function datepickerStr(id) {
return dateStr(datepickerGet(id));
}
function datepickerSet(id, dt_or_str, usetime) {
if ($("#"+id).datepicker != null && $("#"+id).datepicker('getDate') != null) {
// datepicker seems to squash the time portion,
// so we have to pass in a copy of dt instead.
$("#"+id).datepicker('setDate', new Date(dt_or_str));
if (usetime)
$("#"+id).val($("#"+id).val() + ' ' + timeStr(dt_or_str));
}
else {
$("#"+id).val(((dt.getMonth()+1) < 10 ? '0' : '')
+ (dt.getMonth()+1) + '/'
+ (dt.getDate() < 10 ? '0' : '')
+ dt.getDate() + '/'
+ dt.getFullYear());
$("#"+id).val(dateStr(dt_or_str), usetime);
}
}
function datepickerBOM(fromid, id) {
datepickerSet(fromid, id, 1);
function datepickerNow(id, usetime) {
datepickerSet(id, new Date(), usetime == null ? true : usetime);
}
function datepickerEOM(fromid, id) {
datepickerSet(fromid, id, 32, 0);
function dateStr(dt_or_str, usetime) {
var dt = new Date(dt_or_str);
return (((dt.getMonth()+1) < 10 ? '0' : '')
+ (dt.getMonth()+1) + '/'
+ (dt.getDate() < 10 ? '0' : '')
+ dt.getDate() + '/'
+ dt.getFullYear()
+ (usetime ? ' ' + timeStr(dt) : ''));
}
function timeStr(dt_or_str) {
var dt = new Date(dt_or_str);
return ((dt.getHours() < 10 ? '0' : '')
+ dt.getHours() + ':'
+ (dt.getMinutes() < 10 ? '0' : '')
+ dt.getMinutes());
}
function dateAdd(dt_or_str, a, b, m, d) {
var dt = new Date(dt_or_str);
if (m != null) {
dt.setDate(1);
dt.setMonth(dt.getMonth() + m);
//$('#debug').append('set month ('+m+') ' + (dt.getMonth() + m) + '= ' + dt + '<BR>');
}
if (d != null) {
dt.setDate(dt.getDate() + d);
//$('#debug').append('set day ('+d+') ' + (dt.getDate() + d) + '= ' + dt + '<BR>');
}
if (a != null) {
dt.setDate(a);
//$('#debug').append('set date ('+a+') = ' + dt + '<BR>');
}
if (b != null) {
dt.setDate(b);
//$('#debug').append('set date ('+b+') = ' + dt + '<BR>');
}
return dt;
}
function dateYesterday(dt) { return dateAdd(dt,null,null,null,-1); }
function dateTomorrow(dt) { return dateAdd(dt,null,null,null,1); }
function dateBOM(dt) { return dateAdd(dt,1); }
function dateNextBOM(dt) { return dateAdd(dt,1,null,1); }
function dateEOM(dt) { return dateAdd(dt,32,0); }
function dateNextEOM(dt) { return dateAdd(dt,32,0,1); }
function datepickerBOM(fromid, id)
{ datepickerSet(id, dateBOM(datepickerGet(fromid))); }
function datepickerEOM(fromid, id)
{ datepickerSet(id, dateEOM(datepickerGet(fromid))); }
function datepickerNextBOM(fromid, id)
{ datepickerSet(id, dateNextBOM(datepickerGet(fromid))); }
function datepickerNextEOM(fromid, id)
{ datepickerSet(id, dateNextEOM(datepickerGet(fromid))); }
// REVISIT <AP>: 20090617
// I would rather use XML to pass from JS to PHP, but at the

View File

@@ -1,3 +1,9 @@
Reversing a rent charge is not considered as part of the
"charged-through" date on the lease. Consequently, the
reversal itself ensures the charge is fully "paid", and
the "paid-through" date is also out of whack.
Add NSF Fee to the NSF entry page (It's hardcoded right now
in Transaction to $35).
@@ -15,13 +21,6 @@ be closed and no more charges are possible. The other option
would just be a checkbox to say "close lease (no more charges)",
or let them clear it and have them close the lease manually.
Invoice
- Have some sort of rent-proration tool
- Have Rent automatically populate the Effective/Through
as well as rent (pro-rating if necessary). The dates
should take into account the customer charge through
date, as well as any other rents on the invoice.
Allow waiving a complete charge, even if it already has payments
applied (at the moment, we just can waive the charge balance).
@@ -52,11 +51,6 @@ Reduce the number of cached items. Figure out how to get Cake to
automatically make CONCAT(TenderType.name, ' #', Tender.id) part
of each returned query.
Implement, as part of the User model, a function to return the
security level. Have it be a static function, so that we don't
need to instantiate it, and right now, return a level based on
the route.
Add the opposite of the "collected" report, which provides a set of
checkboxes for the different incomes, and returns a list of where
the received monies were disbursed for the selected period.
@@ -193,3 +187,37 @@ Unit Size has no controller. Either remove the link from the
units grid, or implement the controller.
When performing a move-in, the receipt page is broken
when trying to enter a concession. javascript complains about
an invalid value, and the page is not submitted.
- Allegedly. I believe Shirley's browser was acting up
on her, and based on the logs, it seems that indeed
what ultimately worked just fine for a concession entry
was really the exact same page that was stuck. While
on the phone it was evident that here browser was
doing a javascript wig-out, and it wasn't related to
a slow internet connection.
Add invoice rent helpers
- monthly proration tool
- select from/to dates, and hit "prorate"
- charge through date
- enter charge through date, and the invoice
will automatically have charges for each month
from the current charge-through date to the
new charge-through date.
- charge N months
- enter number of months, and the invoice
will automatically have charges for each month
from the current charge-through date for N months
- next rent
- same as, or instead of, "charge N months", where
N is 1
Invoice
- Have some sort of rent-proration tool
- Have Rent automatically populate the Effective/Through
as well as rent (pro-rating if necessary). The dates
should take into account the customer charge through
date, as well as any other rents on the invoice.