fix: Ordered and Reserved Qty for Production not getting fetched in Items

This commit is contained in:
Rucha Mahabal 2021-03-26 11:50:54 +05:30
parent 28a885a3a9
commit d74ff72527
2 changed files with 4 additions and 2 deletions

View File

@ -251,7 +251,8 @@ frappe.ui.form.on('Production Plan', {
get_items_for_material_requests: function(frm, warehouses) {
const set_fields = ['actual_qty', 'item_code','item_name', 'description', 'uom', 'from_warehouse',
'min_order_qty', 'quantity', 'sales_order', 'warehouse', 'projected_qty', 'material_request_type'];
'min_order_qty', 'quantity', 'sales_order', 'warehouse', 'projected_qty', 'ordered_qty',
'reserved_qty_for_production', 'material_request_type'];
frappe.call({
method: "erpnext.manufacturing.doctype.production_plan.production_plan.get_items_for_material_requests",

View File

@ -625,7 +625,8 @@ def get_bin_details(row, company, for_warehouse=None, all_warehouse=False):
""".format(lft, rgt, company)
return frappe.db.sql(""" select ifnull(sum(projected_qty),0) as projected_qty,
ifnull(sum(actual_qty),0) as actual_qty, warehouse from `tabBin`
ifnull(sum(actual_qty),0) as actual_qty, ifnull(sum(ordered_qty),0) as ordered_qty,
ifnull(sum(reserved_qty_for_production),0) as reserved_qty_for_production, warehouse from `tabBin`
where item_code = %(item_code)s {conditions}
group by item_code, warehouse
""".format(conditions=conditions), { "item_code": row['item_code'] }, as_dict=1)