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:
@@ -9,8 +9,10 @@ class AccountsController extends AppController {
|
||||
(// Models
|
||||
'LedgerEntry' =>
|
||||
array('fields' =>
|
||||
array('SUM(IF(LedgerEntry.debit_ledger_id = CurrentLedger.id, LedgerEntry.amount, NULL)) AS debits',
|
||||
'SUM(IF(LedgerEntry.credit_ledger_id = CurrentLedger.id, LedgerEntry.amount, NULL)) AS credits',
|
||||
array('SUM(IF(LedgerEntry.debit_ledger_id = CurrentLedger.id,
|
||||
LedgerEntry.amount, NULL)) AS debits',
|
||||
'SUM(IF(LedgerEntry.credit_ledger_id = CurrentLedger.id,
|
||||
LedgerEntry.amount, NULL)) AS credits',
|
||||
"SUM(IF(Account.type IN ('ASSET', 'EXPENSE'),
|
||||
IF(LedgerEntry.debit_ledger_id = CurrentLedger.id, 1, -1),
|
||||
IF(LedgerEntry.credit_ledger_id = CurrentLedger.id, 1, -1)
|
||||
@@ -184,21 +186,9 @@ class AccountsController extends AppController {
|
||||
);
|
||||
$this->Account->Behaviors->detach('Containable');
|
||||
|
||||
// Simply debug stuff... testing.
|
||||
$cond = null;
|
||||
//$cond = array('Transaction.stamp >' => '2009-05-16');
|
||||
|
||||
// Get all ledger entries of the CURRENT ledger
|
||||
//$crap = $this->Account->findSecurityDeposits($id);
|
||||
//$crap = $this->Account->findAccountRelatedEntries($id, 8);
|
||||
//pr(array('crap', $crap));
|
||||
/* $this->autoRender = false; */
|
||||
/* return; */
|
||||
|
||||
// Get all ledger entries of the CURRENT ledger
|
||||
$account['CurrentLedger']['LedgerEntry']
|
||||
= $this->Account->findCurrentLedgerEntries($id, $cond);
|
||||
//pr(array('Account summary', $account));
|
||||
$entries = $this->Account->findLedgerEntries($id);
|
||||
$account['CurrentLedger']['LedgerEntry'] = $entries['Entries'];
|
||||
|
||||
// Summarize each ledger
|
||||
foreach($account['Ledger'] AS &$ledger)
|
||||
|
||||
Reference in New Issue
Block a user