fix: order status in Production Planning Report

This commit is contained in:
s-aga-r 2022-12-05 22:47:05 +05:30
parent 7cbb6c4de9
commit 632c08f7e0

View File

@ -49,7 +49,7 @@ class ProductionPlanReport(object):
parent.bom_no, parent.bom_no,
parent.fg_warehouse.as_("warehouse"), parent.fg_warehouse.as_("warehouse"),
) )
.where(parent.status.notin(["Completed", "Stopped"])) .where(parent.status.notin(["Completed", "Stopped", "Closed"]))
) )
if order_by == "Planned Start Date": if order_by == "Planned Start Date":
@ -79,10 +79,11 @@ class ProductionPlanReport(object):
query = query.where(child.parent.isin(self.filters.docnames)) query = query.where(child.parent.isin(self.filters.docnames))
if doctype == "Sales Order": if doctype == "Sales Order":
query = query.select( query = query.select(child.delivery_date, parent.base_grand_total,).where(
child.delivery_date, (child.stock_qty > child.produced_qty)
parent.base_grand_total, & (parent.per_delivered < 100.0)
).where((child.stock_qty > child.produced_qty) & (parent.per_delivered < 100.0)) & (parent.status.notin(["Completed", "Closed"]))
)
if order_by == "Delivery Date": if order_by == "Delivery Date":
query = query.orderby(child.delivery_date, order=Order.asc) query = query.orderby(child.delivery_date, order=Order.asc)
@ -91,7 +92,9 @@ class ProductionPlanReport(object):
elif doctype == "Material Request": elif doctype == "Material Request":
query = query.select(child.schedule_date,).where( query = query.select(child.schedule_date,).where(
(parent.per_ordered < 100) & (parent.material_request_type == "Manufacture") (parent.per_ordered < 100)
& (parent.material_request_type == "Manufacture")
& (parent.status != "Stopped")
) )
if order_by == "Required Date": if order_by == "Required Date":