mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-27 05:45:19 +00:00
feat: add status filter to Supplier Quotation Comparison report
This commit is contained in:
@@ -85,6 +85,17 @@ frappe.query_reports["Supplier Quotation Comparison"] = {
|
|||||||
],
|
],
|
||||||
default: __("Categorize by Supplier"),
|
default: __("Categorize by Supplier"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldname: "status",
|
||||||
|
label: __("Status"),
|
||||||
|
fieldtype: "Select",
|
||||||
|
options: [
|
||||||
|
{ label: "", value: "" },
|
||||||
|
{ label: __("Draft"), value: "Draft" },
|
||||||
|
{ label: __("Submitted"), value: "Submitted" },
|
||||||
|
],
|
||||||
|
default: "Submitted",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldtype: "Check",
|
fieldtype: "Check",
|
||||||
label: __("Include Expired"),
|
label: __("Include Expired"),
|
||||||
|
|||||||
@@ -58,13 +58,20 @@ def get_data(filters):
|
|||||||
)
|
)
|
||||||
.where(
|
.where(
|
||||||
(sq_item.parent == sq.name)
|
(sq_item.parent == sq.name)
|
||||||
& (sq_item.docstatus < 2)
|
|
||||||
& (sq.company == filters.get("company"))
|
& (sq.company == filters.get("company"))
|
||||||
& (sq.transaction_date.between(filters.get("from_date"), filters.get("to_date")))
|
& (sq.transaction_date.between(filters.get("from_date"), filters.get("to_date")))
|
||||||
)
|
)
|
||||||
.orderby(sq.transaction_date, sq_item.item_code)
|
.orderby(sq.transaction_date, sq_item.item_code)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# blank -> Draft + Submitted, else filter to the chosen docstatus
|
||||||
|
if filters.get("status") == "Draft":
|
||||||
|
query = query.where(sq_item.docstatus == 0)
|
||||||
|
elif filters.get("status") == "Submitted":
|
||||||
|
query = query.where(sq_item.docstatus == 1)
|
||||||
|
else:
|
||||||
|
query = query.where(sq_item.docstatus < 2)
|
||||||
|
|
||||||
if filters.get("item_code"):
|
if filters.get("item_code"):
|
||||||
query = query.where(sq_item.item_code == filters.get("item_code"))
|
query = query.where(sq_item.item_code == filters.get("item_code"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user