Making progress. Much still to do, but there are hints of functionality finally returning so I'm snapshotting.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@360 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-21 10:23:52 +00:00
parent fd856323a5
commit 93ebc450fe
26 changed files with 1164 additions and 985 deletions

View File

@@ -64,31 +64,19 @@ class TransactionsController extends AppController {
('first',
array('contain' =>
array(// Models
'LedgerEntry' => array('fields' => array('LedgerEntry.id',
'LedgerEntry.amount',
'LedgerEntry.comment'),
//Models
'DebitLedger' => array
('fields' => array('DebitLedger.id', 'DebitLedger.sequence'),
'Account' => array
('fields' => array('Account.id', 'Account.name')),
),
'CreditLedger' => array
('fields' => array('CreditLedger.id', 'CreditLedger.sequence'),
'Account' => array
('fields' => array('Account.id', 'Account.name')),
),
),
'LedgerEntry' =>
array('fields' => array('LedgerEntry.id',
'LedgerEntry.amount',
'LedgerEntry.comment'),
),
),
'conditions' => array('Transaction.id' => $id),
));
// Figure out the transaction total
$total = 0;
foreach($transaction['LedgerEntry'] AS $entry)
$total += $entry['amount'];
/* // Figure out the transaction total */
/* $total = 0; */
/* foreach($transaction['LedgerEntry'] AS $entry) */
/* $total += $entry['amount']; */
// OK, prepare to render.
$title = 'Transaction #' . $transaction['Transaction']['id'];
@@ -145,6 +133,7 @@ class TransactionsController extends AppController {
}
pr($this->data);
if (!$this->Transaction->addReceipt($this->data,
$this->data['Customer']['id'],
(isset($this->data['Lease']['id'])