commit
1b26c6f02a
@ -8,6 +8,7 @@ def execute():
|
|||||||
cancelled_invoices = frappe.db.sql_list("""select name from `tabSales Invoice`
|
cancelled_invoices = frappe.db.sql_list("""select name from `tabSales Invoice`
|
||||||
where docstatus = 2 and ifnull(update_stock, 0) = 1""")
|
where docstatus = 2 and ifnull(update_stock, 0) = 1""")
|
||||||
|
|
||||||
frappe.db.sql("""delete from `tabGL Entry`
|
if cancelled_invoices:
|
||||||
where voucher_type = 'Sales Invoice' and voucher_no in (%s)"""
|
frappe.db.sql("""delete from `tabGL Entry`
|
||||||
% (', '.join(['%s']*len(cancelled_invoices))), tuple(cancelled_invoices))
|
where voucher_type = 'Sales Invoice' and voucher_no in (%s)"""
|
||||||
|
% (', '.join(['%s']*len(cancelled_invoices))), tuple(cancelled_invoices))
|
||||||
Loading…
x
Reference in New Issue
Block a user