feat: allow Sales Invoice as data source (#35855)

* feat: allow Sales Invoice as data source

* chore: linter
This commit is contained in:
Devin Slauenwhite 2023-06-24 03:01:16 -04:00 committed by GitHub
parent 2f638ae32a
commit 802c89ffb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,7 @@ frappe.query_reports["Exponential Smoothing Forecasting"] = {
"fieldname":"based_on_document", "fieldname":"based_on_document",
"label": __("Based On Document"), "label": __("Based On Document"),
"fieldtype": "Select", "fieldtype": "Select",
"options": ["Sales Order", "Delivery Note", "Quotation"], "options": ["Sales Order", "Sales Invoice", "Delivery Note", "Quotation"],
"default": "Sales Order", "default": "Sales Order",
"reqd": 1 "reqd": 1
}, },

View File

@ -99,7 +99,9 @@ class ForecastingReport(ExponentialSmoothingForecast):
parent = frappe.qb.DocType(self.doctype) parent = frappe.qb.DocType(self.doctype)
child = frappe.qb.DocType(self.child_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 = ( query = (
frappe.qb.from_(parent) frappe.qb.from_(parent)