summaryrefslogtreecommitdiff
path: root/sql/modules/Voucher.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/modules/Voucher.sql')
-rw-r--r--sql/modules/Voucher.sql4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/modules/Voucher.sql b/sql/modules/Voucher.sql
index b5dc76b1..f095b92a 100644
--- a/sql/modules/Voucher.sql
+++ b/sql/modules/Voucher.sql
@@ -290,8 +290,8 @@ BEGIN
-- Adjust AR/AP tables for payment and payment reversal vouchers
-- voucher_id is only set in acc_trans on payment/receipt vouchers and
-- their reversals. -CT
- update ar set paid = amount -
- (select sum(amount) * -1 from acc_trans
+ update ar set paid = amount +
+ (select sum(amount) from acc_trans
join chart ON (acc_trans.chart_id = chart.id)
where link = 'AR' AND trans_id = ar.id
AND (voucher_id IS NULL OR voucher_id NOT IN