mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
refactor: Used object to get payment request status indicator
This commit is contained in:
@@ -1,21 +1,16 @@
|
|||||||
|
const INDICATORS = {
|
||||||
|
"Partially Paid": "orange",
|
||||||
|
Cancelled: "red",
|
||||||
|
Draft: "gray",
|
||||||
|
Failed: "red",
|
||||||
|
Initiated: "green",
|
||||||
|
Paid: "blue",
|
||||||
|
Requested: "green",
|
||||||
|
};
|
||||||
|
|
||||||
frappe.listview_settings["Payment Request"] = {
|
frappe.listview_settings["Payment Request"] = {
|
||||||
add_fields: ["status"],
|
add_fields: ["status"],
|
||||||
get_indicator: function (doc) {
|
get_indicator: function (doc) {
|
||||||
if (doc.status == "Draft") {
|
return [__(doc.status), INDICATORS[doc.status] || "gray", `status,=,${doc.status}`];
|
||||||
return [__("Draft"), "gray", "status,=,Draft"];
|
|
||||||
}
|
|
||||||
if (doc.status == "Requested") {
|
|
||||||
return [__("Requested"), "green", "status,=,Requested"];
|
|
||||||
} else if (doc.status == "Initiated") {
|
|
||||||
return [__("Initiated"), "green", "status,=,Initiated"];
|
|
||||||
} else if (doc.status == "Partially Paid") {
|
|
||||||
return [__("Partially Paid"), "orange", "status,=,Partially Paid"];
|
|
||||||
} else if (doc.status == "Paid") {
|
|
||||||
return [__("Paid"), "blue", "status,=,Paid"];
|
|
||||||
} else if (doc.status == "Failed") {
|
|
||||||
return [__("Failed"), "red", "status,=,Failed"];
|
|
||||||
} else if (doc.status == "Cancelled") {
|
|
||||||
return [__("Cancelled"), "red", "status,=,Cancelled"];
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user