summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-05-14 21:40:07 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-05-14 21:40:07 +0000
commit364c2bf3c0e76274dfaec45d9a5dd4343dd94194 (patch)
treed82c1143ba8f4567748a4c2bb8900d2c5e96ef74
parent3cc940ef3d67dcc2a717fa0bc5245dfd1c6a7271 (diff)
better approach to handling negative amounts on the fix.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@2145 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--sql/fixes/ar_ap_summary_fix_1.2.14.sql7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/fixes/ar_ap_summary_fix_1.2.14.sql b/sql/fixes/ar_ap_summary_fix_1.2.14.sql
index 2e20e3e3..e1c11d8d 100644
--- a/sql/fixes/ar_ap_summary_fix_1.2.14.sql
+++ b/sql/fixes/ar_ap_summary_fix_1.2.14.sql
@@ -13,12 +13,11 @@ SET netamount =
)
)
ELSE
- -1 *
(select sum(amount) from acc_trans
where trans_id = ap.id
AND ((chart_id IN
(select id from chart where link = 'AP')
- AND amount > 0)
+ AND amount < 0)
OR (chart_id IN
(select id from chart
where link like '%tax%')
@@ -44,12 +43,12 @@ SET netamount =
)
)
)
- ELSE
+ ELSE -1 *
(select sum(amount) from acc_trans
where trans_id = ar.id
AND ((chart_id IN (select id from chart
where link = 'AR')
- AND amount < 0)
+ AND amount > 0)
OR (chart_id IN
(select id from chart where link like '%tax%')
)