find wrong vouchers

This commit is contained in:
Nabin Hait 2012-10-03 14:51:42 +05:30
parent 1f33e46e34
commit f84237642e

View File

@ -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'