From f84237642e2595b62c9646916bcf31d799a70e68 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 3 Oct 2012 14:51:42 +0530 Subject: [PATCH] find wrong vouchers --- patches/october_2012/find_wrong_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/october_2012/find_wrong_voucher.py b/patches/october_2012/find_wrong_voucher.py index ca612f3256c..189f2b6984a 100644 --- a/patches/october_2012/find_wrong_voucher.py +++ b/patches/october_2012/find_wrong_voucher.py @@ -2,7 +2,7 @@ def execute(): import webnotes from webnotes.utils import flt vouchers = webnotes.conn.sql(""" - select parent, parenttype, modified, sum(tax_amount) as tax from `tabPurchase Taxes and Charges` + select parent, parenttype, modified, sum(if(add_deduct_tax='Add', tax_amount, -tax_amount)) as tax from `tabPurchase Taxes and Charges` where modified >= '2012-07-12' and category in ('Total', 'Valuation and Total') and parenttype != 'Purchase Taxes and Charges Master'