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:
abijah
2009-06-10 09:10:09 +00:00
parent a0274b4d89
commit b78834f7d6

View File

@@ -169,6 +169,9 @@ class UnitsController extends AppController {
$lease['balance'] = $stats['Account']['Ledger']['balance']; $lease['balance'] = $stats['Account']['Ledger']['balance'];
} }
$outstanding_balance = 0;
$outstanding_deposit = 0;
if (isset($unit['CurrentLease']['id'])) {
// Figure out the outstanding balance of the current lease. // Figure out the outstanding balance of the current lease.
$stats = $this->Unit->stats($id); $stats = $this->Unit->stats($id);
$outstanding_balance = $outstanding_balance =
@@ -177,6 +180,7 @@ class UnitsController extends AppController {
// 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);