From 802c89ffb33aa7ff8971a00db5a48c4b8ae737de Mon Sep 17 00:00:00 2001 From: Devin Slauenwhite Date: Sat, 24 Jun 2023 03:01:16 -0400 Subject: [PATCH] feat: allow Sales Invoice as data source (#35855) * feat: allow Sales Invoice as data source * chore: linter --- .../exponential_smoothing_forecasting.js | 2 +- .../exponential_smoothing_forecasting.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.js b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.js index 123a82a3882..a3f0d008772 100644 --- a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.js +++ b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.js @@ -30,7 +30,7 @@ frappe.query_reports["Exponential Smoothing Forecasting"] = { "fieldname":"based_on_document", "label": __("Based On Document"), "fieldtype": "Select", - "options": ["Sales Order", "Delivery Note", "Quotation"], + "options": ["Sales Order", "Sales Invoice", "Delivery Note", "Quotation"], "default": "Sales Order", "reqd": 1 }, diff --git a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py index d3bce831551..daef7f6cca7 100644 --- a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py +++ b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py @@ -99,7 +99,9 @@ class ForecastingReport(ExponentialSmoothingForecast): parent = frappe.qb.DocType(self.doctype) child = frappe.qb.DocType(self.child_doctype) - date_field = "posting_date" if self.doctype == "Delivery Note" else "transaction_date" + date_field = ( + "posting_date" if self.doctype in ("Delivery Note", "Sales Invoice") else "transaction_date" + ) query = ( frappe.qb.from_(parent)