From 12a2b21465303b51110cdae94fe1c8c72d1e041a Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Wed, 19 Jun 2019 13:00:52 +0530 Subject: [PATCH] fix: track status for pending leaves --- .../hr/doctype/leave_allocation/leave_allocation_list.js | 7 +++---- erpnext/hr/doctype/leave_application/leave_application.py | 1 + erpnext/patches/v12_0/generate_leave_ledger_entries.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation_list.js b/erpnext/hr/doctype/leave_allocation/leave_allocation_list.js index 946b4f8492..3ea0e2403f 100644 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation_list.js +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation_list.js @@ -4,9 +4,8 @@ // render frappe.listview_settings['Leave Allocation'] = { get_indicator: function(doc) { - if(doc.status==="Expired") { - return [__("Expired"), "darkgrey", "status, =, Expired"]; - } + if(doc.status==="Expired") { + return [__("Expired"), "darkgrey", "status, =, Expired"]; + } }, - right_column: "grand_total" }; diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index f87f7d53ef..d08c9edb1f 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -496,6 +496,7 @@ def get_pending_leaves_for_period(employee, leave_type, from_date, to_date): "leave_type": leave_type, "from_date": ("<=", from_date), "to_date": (">=", to_date), + "status": "Open" }, fieldname=['SUM(total_leave_days)']) or flt(0) def get_remaining_leaves(allocation, leaves_taken, date, expiry): diff --git a/erpnext/patches/v12_0/generate_leave_ledger_entries.py b/erpnext/patches/v12_0/generate_leave_ledger_entries.py index 5b71c167b6..ffb2e3fba5 100644 --- a/erpnext/patches/v12_0/generate_leave_ledger_entries.py +++ b/erpnext/patches/v12_0/generate_leave_ledger_entries.py @@ -89,5 +89,5 @@ def get_leave_encashment_records(): encashment_date FROM `tabLeave Encashment` WHERE - AND docstatus=1 + docstatus=1 """, as_dict=1) \ No newline at end of file