Primarly a cleanup checkin, although a couple minor bugfixes were included as well.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@82 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-10 05:14:08 +00:00
parent 9f8d4fa9b2
commit 55b896a9f0
15 changed files with 151 additions and 519 deletions

View File

@@ -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'));
}
}