mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 05:04:52 +01:00
fix: incorrect planned qty in PP
(cherry picked from commit a8ebc94a36)
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
@@ -236,9 +236,10 @@ class ProductionPlan(Document):
|
|||||||
so_item.parent,
|
so_item.parent,
|
||||||
so_item.item_code,
|
so_item.item_code,
|
||||||
so_item.warehouse,
|
so_item.warehouse,
|
||||||
(
|
so_item.qty,
|
||||||
(so_item.qty - so_item.work_order_qty - so_item.delivered_qty) * so_item.conversion_factor
|
so_item.work_order_qty,
|
||||||
).as_("pending_qty"),
|
so_item.delivered_qty,
|
||||||
|
so_item.conversion_factor,
|
||||||
so_item.description,
|
so_item.description,
|
||||||
so_item.name,
|
so_item.name,
|
||||||
so_item.bom_no,
|
so_item.bom_no,
|
||||||
@@ -261,6 +262,11 @@ class ProductionPlan(Document):
|
|||||||
|
|
||||||
items = items_query.run(as_dict=True)
|
items = items_query.run(as_dict=True)
|
||||||
|
|
||||||
|
for item in items:
|
||||||
|
item.pending_qty = (
|
||||||
|
flt(item.qty) - max(item.work_order_qty, item.delivered_qty, 0) * item.conversion_factor
|
||||||
|
)
|
||||||
|
|
||||||
pi = frappe.qb.DocType("Packed Item")
|
pi = frappe.qb.DocType("Packed Item")
|
||||||
|
|
||||||
packed_items_query = (
|
packed_items_query = (
|
||||||
|
|||||||
Reference in New Issue
Block a user