summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/fixes/amount_blank_ap_transactions.sql4
1 files 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%')