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/site@360 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-21 10:23:52 +00:00
parent 5a16e497ad
commit f52fba96c1
25 changed files with 1159 additions and 980 deletions

View File

@@ -2,7 +2,7 @@
class AccountsController extends AppController {
var $uses = array('Account', 'DoubleEntry');
var $uses = array('Account', 'LedgerEntry');
var $sidemenu_links =
array(array('name' => 'Accounts', 'header' => true),
@@ -68,7 +68,7 @@ class AccountsController extends AppController {
array(// Models
'CurrentLedger' => array
(// Models
'DoubleEntry'
'LedgerEntry'
),
),
);
@@ -76,7 +76,7 @@ class AccountsController extends AppController {
function jqGridDataFields(&$params, &$model) {
return array_merge(array('Account.*'),
$this->Account->Ledger->DoubleEntry->debitCreditFields(true, 'DoubleEntry', 'CurrentLedger'));
$this->Account->Ledger->LedgerEntry->debitCreditFields(true, 'LedgerEntry', 'CurrentLedger'));
}
function jqGridDataConditions(&$params, &$model) {
@@ -166,7 +166,7 @@ class AccountsController extends AppController {
('Account' =>
array('fields' => array('name')),
'DoubleEntry' =>
'LedgerEntry' =>
array('fields' => array('id', 'amount'),
'MonetarySource' =>
@@ -181,7 +181,7 @@ class AccountsController extends AppController {
),
'fields' => false,
'conditions' => array(array('Ledger.id' => $ledger_id),
array('DoubleEntry.id IS NOT NULL'),
array('LedgerEntry.id IS NOT NULL'),
),
));
@@ -247,7 +247,7 @@ class AccountsController extends AppController {
// Get all ledger entries of the CURRENT ledger
$entries = $this->Account->ledgerEntries($id);
//pr(compact('entries'));
$account['CurrentLedger']['DoubleEntry'] = $entries;
$account['CurrentLedger']['LedgerEntry'] = $entries;
// Summarize each ledger
foreach($account['Ledger'] AS &$ledger)