brotherton-erpnext/patches/december_2012/repost_projected_qty.py
2013-11-20 13:00:28 +05:30

8 lines
355 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
def execute():
import webnotes
webnotes.conn.sql("""update `tabBin`
set projected_qty = ifnull(actual_qty, 0) + ifnull(indented_qty, 0) +
ifnull(ordered_qty, 0) + ifnull(planned_qty, 0) - ifnull(reserved_qty, 0)""")