Added in security deposit information to the lease view

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@86 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-10 08:58:43 +00:00
parent f8eb45a0b9
commit d60c9721ca
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'));
}
}

View File

@@ -57,8 +57,8 @@ $rows = array(array('ID', $lease['id']),
echo $this->element('table',
array('class' => 'item account detail',
'caption' => 'Account Detail',
array('class' => 'item lease detail',
'caption' => 'Lease Detail',
'rows' => $rows,
'column_class' => array('field', 'value')));
@@ -70,8 +70,11 @@ echo $this->element('table',
?>
<DIV CLASS="infobox">
<DIV CLASS="summary balance">
Account Balance: <?php echo FormatHelper::currency($balance); ?>
<DIV CLASS="summary grand deposit">
Security Deposit: <?php echo FormatHelper::currency($outstandingDeposit); ?>
</DIV>
<DIV CLASS="summary grand balance">
Balance: <?php echo FormatHelper::currency($outstandingBalance); ?>
</DIV>
</DIV>