fix: Make work order from production plan considering already ordered qty

This commit is contained in:
Nabin Hait 2019-02-12 17:38:37 +05:30
parent 1a7e438fb2
commit 1a3c27bbea

View File

@ -276,8 +276,8 @@ class ProductionPlan(Document):
item_dict[(d.item_code, d.material_request_item, d.warehouse)] = item_details
else:
item_details.update({
"qty":flt(item_dict.get((d.item_code, d.sales_order, d.warehouse),{})
.get("qty")) + flt(d.planned_qty)
"qty": flt(item_dict.get((d.item_code, d.sales_order, d.warehouse),{})
.get("qty")) + (flt(d.planned_qty) - flt(d.ordered_qty))
})
item_dict[(d.item_code, d.sales_order, d.warehouse)] = item_details