From d2d73e6cb7049ee40fb3bab779e4aab94713d9f6 Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Wed, 28 Aug 2019 13:21:01 +0530 Subject: [PATCH] fix: prioritize empty over expired as batch status --- erpnext/stock/doctype/batch/batch_list.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/batch/batch_list.js b/erpnext/stock/doctype/batch/batch_list.js index 05bf37f0f4..d4f74c3a21 100644 --- a/erpnext/stock/doctype/batch/batch_list.js +++ b/erpnext/stock/doctype/batch/batch_list.js @@ -3,10 +3,10 @@ frappe.listview_settings['Batch'] = { get_indicator: (doc) => { if (doc.disabled) { return [__("Disabled"), "darkgrey", "disabled,=,1"]; - } else if (doc.expiry_date && frappe.datetime.get_diff(doc.expiry_date, frappe.datetime.nowdate()) <= 0) { - return [__("Expired"), "red", "expiry_date,not in,|expiry_date,<=,Today|batch_qty,>,0|disabled,=,0"] } else if (!doc.batch_qty) { return [__("Empty"), "darkgrey", "batch_qty,=,0|disabled,=,0"]; + } else if (doc.expiry_date && frappe.datetime.get_diff(doc.expiry_date, frappe.datetime.nowdate()) <= 0) { + return [__("Expired"), "red", "expiry_date,not in,|expiry_date,<=,Today|batch_qty,>,0|disabled,=,0"] } else { return [__("Active"), "green", "batch_qty,>,0|disabled,=,0"]; };