From ca4117e652f9c651165d6dbc15d132256d316a9d Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Tue, 26 Mar 2019 16:03:00 +0530 Subject: [PATCH] feat: seting status and indicators on list view --- .../invoice_discounting_list.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js new file mode 100644 index 0000000000..a72023d8e1 --- /dev/null +++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js @@ -0,0 +1,21 @@ +frappe.listview_settings['Invoice Discounting'] = { + add_fields: ["status"], + get_indicator: function(doc) + { + if(doc.status == "Draft") { + return [__("Draft"), "red", "status,=,Draft"]; + } + else if(doc.status == "Sanctioned") { + return [__("Sanctioned"), "green", "status,=,Sanctioned"]; + } + else if(doc.status == "Disbursed") { + return [__("Disbursed"), "blue", "status,=,Disbursed"]; + } + else if(doc.status == "Settled") { + return [__("Settled"), "orange", "status,=,Settled"]; + } + else if(doc.status == "Canceled") { + return [__("Canceled"), "red", "status,=,Canceled"]; + } + } +}; \ No newline at end of file