From 20c44878533e830a706a4d5f60a507a62d01038f Mon Sep 17 00:00:00 2001 From: Ninad1306 Date: Mon, 24 Feb 2025 12:42:05 +0530 Subject: [PATCH] fix(report): allow `Closed` purchase orders to be visible (cherry picked from commit 3b2879d3a1e81fd71cc34fa68543411b67ade36a) # Conflicts: # erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.js --- .../purchase_order_analysis.js | 13 ++++++++++++- .../purchase_order_analysis.py | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.js b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.js index 58657da9168..3fe5bbdcb81 100644 --- a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.js +++ b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.js @@ -52,9 +52,20 @@ frappe.query_reports["Purchase Order Analysis"] = { label: __("Status"), fieldtype: "MultiSelectList", width: "80", - options: ["To Pay", "To Bill", "To Receive", "To Receive and Bill", "Completed"], + options: ["To Pay", "To Bill", "To Receive", "To Receive and Bill", "Completed", "Closed"], get_data: function (txt) { +<<<<<<< HEAD let status = ["To Bill", "To Receive", "To Receive and Bill", "Completed"]; +======= + let status = [ + "To Pay", + "To Bill", + "To Receive", + "To Receive and Bill", + "Completed", + "Closed", + ]; +>>>>>>> 3b2879d3a1 (fix(report): allow `Closed` purchase orders to be visible) let options = []; for (let option of status) { options.push({ diff --git a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py index f583ce3e6c8..3efb9b021a9 100644 --- a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py +++ b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py @@ -70,7 +70,7 @@ def get_data(filters): po.company, po_item.name, ) - .where((po_item.parent == po.name) & (po.status.notin(("Stopped", "Closed"))) & (po.docstatus == 1)) + .where((po_item.parent == po.name) & (po.status.notin(("Stopped", "On Hold"))) & (po.docstatus == 1)) .groupby(po_item.name) .orderby(po.transaction_date) )