fix wrong vouchers due to Valuation charges
This commit is contained in:
parent
1e79441457
commit
c09de35ba5
@ -5,7 +5,7 @@ def execute():
|
||||
|
||||
vouchers = webnotes.conn.sql("""
|
||||
select
|
||||
parent, parenttype, modified,
|
||||
parent, parenttype, modified, docstatus,
|
||||
sum(if(category in ('Valuation and Total', 'Total') and add_deduct_tax='Add',
|
||||
tax_amount, 0)) as tax_added,
|
||||
sum(if(category in ('Valuation and Total', 'Total') and add_deduct_tax='Deduct',
|
||||
@ -46,6 +46,7 @@ def execute():
|
||||
(correct_total_tax, d['tax_added'], d['tax_ded'], d['parent']))
|
||||
|
||||
# post gl entry
|
||||
if d['docstatus'] == 1:
|
||||
webnotes.conn.sql("""update `tabGL Entry` set is_cancelled = 'No'
|
||||
where voucher_type = %s and voucher_no = %s""",
|
||||
(d['parenttype'], d['parent']))
|
||||
|
Loading…
Reference in New Issue
Block a user