code review fix

This commit is contained in:
tundebabzy 2018-02-01 17:05:54 +01:00
parent a829d5a4d5
commit 5df64d84a1

View File

@ -22,10 +22,10 @@ def get_qty_in_stock(item_code, item_warehouse_field, warehouse=None):
stock_qty = frappe.db.sql("""select GREATEST(actual_qty - reserved_qty, 0) from tabBin where stock_qty = frappe.db.sql("""select GREATEST(actual_qty - reserved_qty, 0) from tabBin where
item_code=%s and warehouse=%s""", (item_code, warehouse)) item_code=%s and warehouse=%s""", (item_code, warehouse))
if stock_qty[0][0]: if stock_qty:
stock_qty = adjust_qty_for_expired_items(item_code, stock_qty, warehouse) stock_qty = adjust_qty_for_expired_items(item_code, stock_qty, warehouse)
if stock_qty[0][0]: if stock_qty:
in_stock = stock_qty[0][0] > 0 and 1 or 0 in_stock = stock_qty[0][0] > 0 and 1 or 0
if stock_qty: if stock_qty: