Fixed problem with units that are vacant, and thus have no current lease.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@87 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -169,14 +169,18 @@ class UnitsController extends AppController {
|
|||||||
$lease['balance'] = $stats['Account']['Ledger']['balance'];
|
$lease['balance'] = $stats['Account']['Ledger']['balance'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Figure out the outstanding balance of the current lease.
|
$outstanding_balance = 0;
|
||||||
$stats = $this->Unit->stats($id);
|
$outstanding_deposit = 0;
|
||||||
$outstanding_balance =
|
if (isset($unit['CurrentLease']['id'])) {
|
||||||
$stats['CurrentLease']['Account']['Ledger']['balance'];
|
// Figure out the outstanding balance of the current lease.
|
||||||
|
$stats = $this->Unit->stats($id);
|
||||||
|
$outstanding_balance =
|
||||||
|
$stats['CurrentLease']['Account']['Ledger']['balance'];
|
||||||
|
|
||||||
// Figure out the total security deposit for the current lease.
|
// Figure out the total security deposit for the current lease.
|
||||||
$deposits = $this->Unit->Lease->findSecurityDeposits($unit['CurrentLease']['id']);
|
$deposits = $this->Unit->Lease->findSecurityDeposits($unit['CurrentLease']['id']);
|
||||||
$outstanding_deposit = $deposits['summary']['balance'];
|
$outstanding_deposit = $deposits['summary']['balance'];
|
||||||
|
}
|
||||||
|
|
||||||
$this->sidemenu_links[] =
|
$this->sidemenu_links[] =
|
||||||
array('name' => 'Operations', 'header' => true);
|
array('name' => 'Operations', 'header' => true);
|
||||||
|
|||||||
Reference in New Issue
Block a user