Added stats summary to the top level for lease. For consistency, I want all stats to be summarized at the top.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@175 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-22 17:55:32 +00:00
parent 788cbde710
commit 3953e1dbf3
2 changed files with 6 additions and 1 deletions

View File

@@ -80,7 +80,7 @@ class LeasesController extends AppController {
// Get the balance on each lease.
foreach ($leases AS &$lease) {
$stats = $this->Lease->stats($lease['Lease']['id']);
$lease['Lease']['balance'] = $stats['Account']['Ledger']['balance'];
$lease['Lease']['balance'] = $stats['balance'];
}
return $leases;

View File

@@ -150,6 +150,11 @@ class Lease extends AppModel {
// Pull the stats from the account.
$stats['Account'] = $this->Account->stats($lease['Lease']['account_id']);
// Place a summary of the stats (one lease account in this case)
// at the top level for easy summarized access.
$this->statsMerge($stats, $stats['Account']['Ledger']);
return $stats;
}