From 1e794414571d7fed0c323af29914b419ac9f8b1c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 3 Oct 2012 16:31:45 +0530 Subject: [PATCH] fix wrong vouchers due to Valuation charges --- patches/october_2012/fix_wrong_vouchers.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/patches/october_2012/fix_wrong_vouchers.py b/patches/october_2012/fix_wrong_vouchers.py index ce47ff7dad8..f7ff2b416bb 100644 --- a/patches/october_2012/fix_wrong_vouchers.py +++ b/patches/october_2012/fix_wrong_vouchers.py @@ -31,8 +31,13 @@ def execute(): webnotes.conn.sql(""" update `tab%s` set - total_tax = %s, other_charges_added = %s, other_charges_deducted = %s, - grand_total = net_tatal + other_charges_added - other_charges_deducted, + total_tax = %s, + other_charges_added = %s, + other_charges_added_import = other_charges_added / conversion_rate, + other_charges_deducted = %s, + other_charges_deducted_import = other_charges_deducted / conversion_rate, + grand_total = net_total + other_charges_added - other_charges_deducted, + grand_total_import = grand_total / conversion_rate, total_amount_to_pay = grand_total - total_tds_on_voucher, outstanding_amount = total_amount_to_pay - total_advance where @@ -48,6 +53,12 @@ def execute(): obj.make_gl_entries() else: - webnotes.conn.sql("""update `tab%s` - set total_tax = %s, grand_total = net_tatal + total_tax - where name = %s""" % (d[1], '%s', '%s'), (correct_total_tax, d['parent'])) \ No newline at end of file + webnotes.conn.sql(""" + update `tab%s` + set + total_tax = %s, + grand_total = net_total + total_tax, + grand_total_import = grand_total / conversion_rate + where + name = %s + """ % (d[1], '%s', '%s'), (correct_total_tax, d['parent'])) \ No newline at end of file