From 0aca24c8a8797b392c177aec714c2f680b5098e9 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 12 May 2008 18:57:17 +0000 Subject: Final version of amount_blank_ap_transactions.sql fix git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@2135 4979c152-3d1c-0410-bac9-87ea11338e46 --- sql/fixes/amount_blank_ap_transactions.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/fixes/amount_blank_ap_transactions.sql b/sql/fixes/amount_blank_ap_transactions.sql index 924e0116..fa7ec4f2 100644 --- a/sql/fixes/amount_blank_ap_transactions.sql +++ b/sql/fixes/amount_blank_ap_transactions.sql @@ -16,8 +16,8 @@ WHERE netamount IS NULL; UPDATE ar SET netamount = -1 * (select sum(amount) from acc_trans - where trans_id = ap.id - AND ((chart_id IN (select id from chart where link = 'AP') + where trans_id = ar.id + AND ((chart_id IN (select id from chart where link = 'AR') AND amount < 0) OR (chart_id IN (select id from chart where link like '%tax%') -- cgit v1.2.3