Added in security deposit information to the lease view

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@86 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-10 08:58:43 +00:00
parent 970b2ad202
commit a0274b4d89
2 changed files with 15 additions and 6 deletions

View File

@@ -143,10 +143,16 @@ class LeasesController extends AppController {
// Obtain the overall lease balance
$this->Lease->statsMerge($lease['Lease'],
array('stats' => $this->Lease->stats($id)));
$balance = $lease['Lease']['stats']['Account']['Ledger']['balance'];
$outstanding_balance = $lease['Lease']['stats']['Account']['Ledger']['balance'];
// Determine the lease security deposit
$deposits = $this->Lease->findSecurityDeposits($lease['Lease']['id']);
$outstanding_deposit = $deposits['summary']['balance'];
// Prepare to render
$title = 'Lease: #' . $lease['Lease']['id'];
$this->set(compact('lease', 'title', 'balance'));
$this->set(compact('lease', 'title',
'outstanding_deposit',
'outstanding_balance'));
}
}