Modified table element algorithm to be cleaner and to handle multiple class types. Modified ledger listings to group the charges and associated payment rows with one color. Fixed summary balance data to come from the controller instead of being created in the view. Created an infobox to carry pertinent info in the top right of the view pages.

git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@43 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-05-30 20:07:24 +00:00
parent c041174b0c
commit 7fae1bcaad
6 changed files with 207 additions and 114 deletions

View File

@@ -142,7 +142,26 @@ class ContactsController extends AppController {
$contact = $this->Contact->read(null, $id);
$title = $contact['Contact']['display_name'];
$this->set(compact('contact', 'title'));
$outstanding_deposit = 0;
$outstanding_balance = 0;
foreach($contact['Lease'] AS $lease) {
foreach($lease['Charge'] AS $charge) {
$outstanding_balance += $charge['total'];
foreach ($charge['Receipt'] AS $receipt) {
$outstanding_balance -= $receipt['ChargesReceipt']['amount'];
// REVISIT <AP> 20090530:
// Using hardcoded value for security deposit...
// That can't be good!
if ($charge['charge_type_id'] == 1)
$outstanding_deposit += $receipt['ChargesReceipt']['amount'];
}
}
}
$this->set(compact('contact', 'title', 'mytstval',
'outstanding_balance',
'outstanding_deposit'));
}
}