Primarly a cleanup checkin, although a couple minor bugfixes were included as well.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@82 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -107,23 +107,15 @@ class TransactionsController extends AppController {
|
||||
)
|
||||
);
|
||||
$transaction = $this->Transaction->read(null, $id);
|
||||
pr($transaction);
|
||||
$this->Transaction->Behaviors->detach('Containable');
|
||||
|
||||
$debit_amount = 0;
|
||||
$credit_amount = 0;
|
||||
foreach($transaction['LedgerEntry'] AS $entry) {
|
||||
$debit_amount += $entry['amount'];
|
||||
$credit_amount += $entry['amount'];
|
||||
}
|
||||
|
||||
/* $this->sidemenu_links[] = */
|
||||
/* array('name' => 'Operations', 'header' => true); */
|
||||
/* $this->sidemenu_links[] = */
|
||||
/* array('name' => 'Move-Out', 'url' => array('controller' => 'transactions', 'action' => 'move-out')); */
|
||||
// Figure out the transaction total
|
||||
$total = 0;
|
||||
foreach($transaction['LedgerEntry'] AS $entry)
|
||||
$total += $entry['amount'];
|
||||
|
||||
// OK, prepare to render.
|
||||
$title = 'Transaction #' . $transaction['Transaction']['id'];
|
||||
$this->set(compact('transaction', 'title',
|
||||
'debit_amount',
|
||||
'credit_amount'));
|
||||
$this->set(compact('transaction', 'title', 'total'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user