diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-11-22 22:59:56 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-11-22 22:59:56 +0000 |
commit | 44e66497c837e9218e9460873623495d1cf31bca (patch) | |
tree | 4ce80373c183c76a09af40ede28bd4d827283127 /sql/modules/Voucher.sql | |
parent | 4119461903f06f70dde3a184af1244d7543dd7d0 (diff) |
Correcting bad join which caused payable batches not to show up in batch details
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2416 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql/modules/Voucher.sql')
-rw-r--r-- | sql/modules/Voucher.sql | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/modules/Voucher.sql b/sql/modules/Voucher.sql index 6ae6a5e2..b6ac7be9 100644 --- a/sql/modules/Voucher.sql +++ b/sql/modules/Voucher.sql @@ -57,7 +57,9 @@ BEGIN a.amount, a.transdate, 'Payable' FROM voucher v JOIN ap a ON (v.trans_id = a.id) - JOIN entity e ON (a.entity_id = e.id) + JOIN entity_credit_account eca + ON (eca.id = a.entity_credit_account) + JOIN entity e ON (eca.entity_id = e.id) WHERE v.batch_id = in_batch_id AND v.batch_class = (select id from batch_class WHERE class = 'ap') @@ -67,7 +69,9 @@ BEGIN a.amount, a.transdate, 'Receivable' FROM voucher v JOIN ar a ON (v.trans_id = a.id) - JOIN entity e ON (a.entity_id = e.id) + JOIN entity_credit_account eca + ON (eca.id = a.entity_credit_account) + JOIN entity e ON (eca.entity_id = e.id) WHERE v.batch_id = in_batch_id AND v.batch_class = (select id from batch_class WHERE class = 'ar') |