fix: Status in Report and filter query
This commit is contained in:
parent
ee56d0e0a9
commit
bc6c4e864d
@ -65,7 +65,7 @@ frappe.query_reports["Quoted Item Comparison"] = {
|
||||
fieldname: "supplier_quotation",
|
||||
default: "",
|
||||
get_data: function(txt) {
|
||||
return frappe.db.get_link_options('Supplier Quotation', txt);
|
||||
return frappe.db.get_link_options('Supplier Quotation', txt, {'docstatus': ["<", 2]});
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -110,19 +110,6 @@ frappe.query_reports["Quoted Item Comparison"] = {
|
||||
reporter.make_default_supplier_dialog(report);
|
||||
}, 'Tools');
|
||||
|
||||
const status_message = `
|
||||
<span class="indicator">
|
||||
Valid till :
|
||||
</span>
|
||||
<span class="indicator orange">
|
||||
Expires in a week or less
|
||||
</span>
|
||||
|
||||
<span class="indicator red">
|
||||
Expires today / Already Expired
|
||||
</span>`;
|
||||
report.$status.html(status_message).show();
|
||||
|
||||
},
|
||||
make_default_supplier_dialog: (report) => {
|
||||
// Get the name of the item to change
|
||||
|
@ -17,8 +17,9 @@ def execute(filters=None):
|
||||
columns = get_columns()
|
||||
|
||||
data, chart_data = prepare_data(supplier_quotation_data, filters)
|
||||
message = get_message()
|
||||
|
||||
return columns, data, None, chart_data
|
||||
return columns, data, message, chart_data
|
||||
|
||||
def get_conditions(filters):
|
||||
conditions = ""
|
||||
@ -207,4 +208,16 @@ def get_columns():
|
||||
}
|
||||
]
|
||||
|
||||
return columns
|
||||
return columns
|
||||
|
||||
def get_message():
|
||||
return """<span class="indicator">
|
||||
Valid till :
|
||||
</span>
|
||||
<span class="indicator orange">
|
||||
Expires in a week or less
|
||||
</span>
|
||||
|
||||
<span class="indicator red">
|
||||
Expires today / Already Expired
|
||||
</span>"""
|
Loading…
x
Reference in New Issue
Block a user