2013-08-05 09:29:54 +00:00
|
|
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
|
|
|
# License: GNU General Public License v3. See license.txt
|
2013-05-23 12:11:52 +00:00
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import webnotes
|
|
|
|
from webnotes.utils import cint
|
|
|
|
|
|
|
|
def execute():
|
|
|
|
aii_enabled = cint(webnotes.conn.get_value("Global Defaults", None,
|
|
|
|
"auto_inventory_accounting"))
|
|
|
|
|
|
|
|
if aii_enabled:
|
|
|
|
webnotes.conn.sql("""update `tabGL Entry` gle set is_cancelled = 'Yes'
|
|
|
|
where voucher_type = 'Delivery Note'
|
|
|
|
and exists(select name from `tabDelivery Note`
|
|
|
|
where name = gle.voucher_no and docstatus = 2)""")
|