Added a ledger listing to the Lease view page, which was otherwise quite empty.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@168 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -107,7 +107,7 @@ class LeasesController extends AppController {
|
|||||||
array(// Models
|
array(// Models
|
||||||
'LeaseType',
|
'LeaseType',
|
||||||
'Unit',
|
'Unit',
|
||||||
'Account' => array('Ledger'),
|
'Account' => array('CurrentLedger'),
|
||||||
'Customer',
|
'Customer',
|
||||||
),
|
),
|
||||||
'conditions' => array(array('Lease.id' => $id)),
|
'conditions' => array(array('Lease.id' => $id)),
|
||||||
@@ -128,6 +128,10 @@ class LeasesController extends AppController {
|
|||||||
$deposits = $this->Lease->findSecurityDeposits($lease['Lease']['id']);
|
$deposits = $this->Lease->findSecurityDeposits($lease['Lease']['id']);
|
||||||
$outstanding_deposit = $deposits['summary']['balance'];
|
$outstanding_deposit = $deposits['summary']['balance'];
|
||||||
|
|
||||||
|
// Move the Leder stats into our alias 'CurrentLedger'
|
||||||
|
$lease['Account']['CurrentLedger'] += $lease['Account']['Ledger'];
|
||||||
|
unset($lease['Account']['Ledger']);
|
||||||
|
|
||||||
// Prepare to render
|
// Prepare to render
|
||||||
$title = 'Lease: #' . $lease['Lease']['id'];
|
$title = 'Lease: #' . $lease['Lease']['id'];
|
||||||
$this->set(compact('lease', 'title',
|
$this->set(compact('lease', 'title',
|
||||||
|
|||||||
@@ -79,6 +79,16 @@ echo '</div>' . "\n";
|
|||||||
echo '<div CLASS="detail supporting">' . "\n";
|
echo '<div CLASS="detail supporting">' . "\n";
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* Current Ledger
|
||||||
|
*/
|
||||||
|
|
||||||
|
echo $this->element('ledger_entries',
|
||||||
|
array('caption' => "Current Ledger: (#{$account['id']}-{$account['CurrentLedger']['sequence']})",
|
||||||
|
'ledger_id' => $account['CurrentLedger']['id'],
|
||||||
|
'account_type' => $account['type'],
|
||||||
|
));
|
||||||
|
|
||||||
/* End "detail supporting" div */
|
/* End "detail supporting" div */
|
||||||
echo '</div>' . "\n";
|
echo '</div>' . "\n";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user