mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 08:05:00 +00:00
fix: get unconsumed qty as per BOM qty
This commit is contained in:
@@ -2497,10 +2497,12 @@ class StockEntry(StockController):
|
||||
|
||||
wo_item_qty = item.transferred_qty or item.required_qty
|
||||
|
||||
wo_qty_consumed = flt(wo_item_qty) - flt(item.consumed_qty)
|
||||
wo_qty_unconsumed = flt(wo_item_qty) - flt(item.consumed_qty)
|
||||
wo_qty_to_produce = flt(work_order_qty) - flt(wo.produced_qty)
|
||||
bom_qty_per_unit = item.required_qty / wo.qty # per-unit BOM qty
|
||||
|
||||
req_qty_each = (wo_qty_consumed) / (wo_qty_to_produce or 1)
|
||||
req_qty_each = (wo_qty_unconsumed) / (wo_qty_to_produce or 1)
|
||||
req_qty_each = min(req_qty_each, bom_qty_per_unit)
|
||||
|
||||
qty = req_qty_each * flt(self.fg_completed_qty)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user