fix: prioritize empty over expired as batch status
This commit is contained in:
parent
ba03853b2a
commit
d2d73e6cb7
@ -3,10 +3,10 @@ frappe.listview_settings['Batch'] = {
|
|||||||
get_indicator: (doc) => {
|
get_indicator: (doc) => {
|
||||||
if (doc.disabled) {
|
if (doc.disabled) {
|
||||||
return [__("Disabled"), "darkgrey", "disabled,=,1"];
|
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) {
|
} else if (!doc.batch_qty) {
|
||||||
return [__("Empty"), "darkgrey", "batch_qty,=,0|disabled,=,0"];
|
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 {
|
} else {
|
||||||
return [__("Active"), "green", "batch_qty,>,0|disabled,=,0"];
|
return [__("Active"), "green", "batch_qty,>,0|disabled,=,0"];
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user