fix: Get MRs that are yet to be received but fully ordered in Report

- Remove incorrect query clause that only check if ordered qty < 100
- MR should be visible in report until fully received (cycle complete)
This commit is contained in:
marination 2022-02-25 12:10:11 +05:30
parent 4d8d4acec4
commit d3b0ca30c6

View File

@ -18,10 +18,10 @@ def execute(filters=None):
columns = get_columns(filters)
conditions = get_conditions(filters)
#get queried data
# get queried data
data = get_data(filters, conditions)
#prepare data for report and chart views
# prepare data for report and chart views
data, chart_data = prepare_data(data, filters)
return columns, data, None, chart_data
@ -74,10 +74,9 @@ def get_data(filters, conditions):
and mr.material_request_type = "Purchase"
and mr.docstatus = 1
and mr.status != "Stopped"
and mr.per_received < 100
{conditions}
group by mr.name, mr_item.item_code
having
sum(ifnull(mr_item.ordered_qty, 0)) < sum(ifnull(mr_item.stock_qty, 0))
order by mr.transaction_date, mr.schedule_date""".format(conditions=conditions), as_dict=1)
return data