Primarly a cleanup checkin, although a couple minor bugfixes were included as well.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@82 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-10 05:14:08 +00:00
parent 9f8d4fa9b2
commit 55b896a9f0
15 changed files with 151 additions and 519 deletions

View File

@@ -163,18 +163,19 @@ class UnitsController extends AppController {
$unit = $this->Unit->read(null, $id);
$this->Unit->Behaviors->detach('Containable');
pr($unit);
// Get the balance on each lease.
foreach ($unit['Lease'] AS &$lease) {
$stats = $this->Unit->Lease->stats($lease['id']);
$lease['balance'] = $stats['Account']['Ledger']['balance'];
}
// Figure out the outstanding balance of the current lease.
$stats = $this->Unit->stats($id);
$deposits = $this->Unit->Lease->findSecurityDeposits($unit['CurrentLease']['id']);
$outstanding_balance =
$stats['CurrentLease']['Account']['Ledger']['balance'];
//pr($stats);
$outstanding_balance = $stats['CurrentLease']['Account']['Ledger']['balance'];
// Figure out the total security deposit for the current lease.
$deposits = $this->Unit->Lease->findSecurityDeposits($unit['CurrentLease']['id']);
$outstanding_deposit = $deposits['summary']['balance'];
$this->sidemenu_links[] =
@@ -182,6 +183,7 @@ class UnitsController extends AppController {
$this->sidemenu_links[] =
array('name' => 'Move-Out', 'url' => array('controller' => 'units', 'action' => 'move-out'));
// Prepare to render.
$title = 'Unit ' . $unit['Unit']['name'];
$this->set(compact('unit', 'title',
'outstanding_balance',