fix: Status in Report and filter query

This commit is contained in:
marination
2020-08-31 20:32:17 +05:30
parent ee56d0e0a9
commit bc6c4e864d
2 changed files with 16 additions and 16 deletions

View File

@@ -65,7 +65,7 @@ frappe.query_reports["Quoted Item Comparison"] = {
fieldname: "supplier_quotation", fieldname: "supplier_quotation",
default: "", default: "",
get_data: function(txt) { 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); reporter.make_default_supplier_dialog(report);
}, 'Tools'); }, 'Tools');
const status_message = `
<span class="indicator">
Valid till : &nbsp;&nbsp;
</span>
<span class="indicator orange">
Expires in a week or less
</span>
&nbsp;&nbsp;&nbsp;&nbsp;
<span class="indicator red">
Expires today / Already Expired
</span>`;
report.$status.html(status_message).show();
}, },
make_default_supplier_dialog: (report) => { make_default_supplier_dialog: (report) => {
// Get the name of the item to change // Get the name of the item to change

View File

@@ -17,8 +17,9 @@ def execute(filters=None):
columns = get_columns() columns = get_columns()
data, chart_data = prepare_data(supplier_quotation_data, filters) 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): def get_conditions(filters):
conditions = "" conditions = ""
@@ -208,3 +209,15 @@ def get_columns():
] ]
return columns return columns
def get_message():
return """<span class="indicator">
Valid till : &nbsp;&nbsp;
</span>
<span class="indicator orange">
Expires in a week or less
</span>
&nbsp;&nbsp;
<span class="indicator red">
Expires today / Already Expired
</span>"""