Merge pull request #5555 from saurabh6790/stock_projected_qty

[fix] report Stock Projected Qty
This commit is contained in:
Rushabh Mehta 2016-06-27 17:08:39 +05:30 committed by GitHub
commit 35796683c1

View File

@ -66,11 +66,12 @@ def get_bin_list(filters):
lft, rgt = frappe.db.get_value("Warehouse", filters.warehouse, ["lft", "rgt"])
conditions.append(" exists (select name from `tabWarehouse` wh \
where wh.lft >= %s and wh.rgt <= %s and sle.warehouse = wh.name)"%(lft, rgt))
where wh.lft >= %s and wh.rgt <= %s and bin.warehouse = wh.name)"%(lft, rgt))
bin_list = frappe.db.sql("""select item_code, warehouse, actual_qty, planned_qty, indented_qty,
ordered_qty, reserved_qty, reserved_qty_for_production, projected_qty
from tabBin where %s order by item_code, warehouse """% " and ".join(conditions), as_dict=1,debug=1)
from tabBin bin {conditions} order by item_code, warehouse
""".format(conditions=" where " + " and ".join(conditions) if conditions else ""), as_dict=1)
return bin_list