Bug fix for matching ledger entry to double entry

git-svn-id: file:///svn-source/pmgr/branches/surplus_account_20090815@572 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-16 00:49:21 +00:00
parent 4125d7ba16
commit a9c3c40053
2 changed files with 2 additions and 2 deletions

View File

@@ -197,7 +197,7 @@ class LedgerEntriesController extends AppController {
else
$entry['MatchingEntry'] = $entry['DebitEntry'][0];
if (empty($entry['DebitDoubleEntry']))
if (empty($entry['DebitDoubleEntry']['id']))
$entry['DoubleEntry'] = $entry['CreditDoubleEntry'];
else
$entry['DoubleEntry'] = $entry['DebitDoubleEntry'];

View File

@@ -13,7 +13,7 @@ class LedgerEntry extends AppModel {
),
'DebitDoubleEntry' => array(
'className' => 'DoubleEntry',
'foreignKey' => 'credit_entry_id',
'foreignKey' => 'debit_entry_id',
'dependent' => true,
),
'CreditDoubleEntry' => array(