Skip to content

Commit

Permalink
fix: add list view settings for Gratuity
Browse files Browse the repository at this point in the history
(cherry picked from commit 79b0aed)

# Conflicts:
#	erpnext/payroll/doctype/gratuity/gratuity.json
  • Loading branch information
ruchamahabal authored and mergify[bot] committed May 27, 2022
1 parent b5d6687 commit e4426ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
9 changes: 6 additions & 3 deletions erpnext/payroll/doctype/gratuity/gratuity.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@
"fieldtype": "Select",
"in_list_view": 1,
"label": "Status",
"options": "Draft\nUnpaid\nPaid",
"read_only": 1,
"reqd": 1
"options": "Draft\nUnpaid\nPaid\nSubmitted\nCancelled",
"read_only": 1
},
{
"depends_on": "eval: doc.pay_via_salary_slip == 0",
Expand Down Expand Up @@ -196,7 +195,11 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
<<<<<<< HEAD
"modified": "2020-11-02 18:21:11.971488",
=======
"modified": "2022-05-27 13:56:14.349183",
>>>>>>> 79b0aede00 (fix: add list view settings for Gratuity)
"modified_by": "Administrator",
"module": "Payroll",
"name": "Gratuity",
Expand Down
12 changes: 12 additions & 0 deletions erpnext/payroll/doctype/gratuity/gratuity_list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
frappe.listview_settings["Gratuity"] = {
get_indicator: function(doc) {
let status_color = {
"Draft": "red",
"Submitted": "blue",
"Cancelled": "red",
"Paid": "green",
"Unpaid": "orange",
};
return [__(doc.status), status_color[doc.status], "status,=,"+doc.status];
}
};

0 comments on commit e4426ad

Please sign in to comment.