From d019edc89c888c9e9dda1b5e3d0d360f8121ae9d Mon Sep 17 00:00:00 2001 From: Aysha Date: Thu, 28 Nov 2024 13:08:05 +0530 Subject: [PATCH 1/2] fix: disable leave application against expired allocations --- hrms/hr/doctype/leave_application/leave_application.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hrms/hr/doctype/leave_application/leave_application.py b/hrms/hr/doctype/leave_application/leave_application.py index 2ffb45d54c..d2df12ac1b 100755 --- a/hrms/hr/doctype/leave_application/leave_application.py +++ b/hrms/hr/doctype/leave_application/leave_application.py @@ -953,7 +953,7 @@ def get_leave_allocation_records(employee, date, leave_type=None): & (Ledger.docstatus == 1) & (Ledger.transaction_type == "Leave Allocation") & (Ledger.employee == employee) - & (Ledger.is_expired == 0) + & (LeaveAllocation.expired == 0) & (Ledger.is_lwp == 0) & ( # newly allocated leave's end date is same as the leave allocation's to date From 7b5fe998b309ec87ad016be277d6ea0f5643aa43 Mon Sep 17 00:00:00 2001 From: Aysha Date: Tue, 14 Jan 2025 10:28:15 +0530 Subject: [PATCH 2/2] fix: leave balance calculation --- hrms/hr/doctype/leave_application/leave_application.py | 1 - 1 file changed, 1 deletion(-) diff --git a/hrms/hr/doctype/leave_application/leave_application.py b/hrms/hr/doctype/leave_application/leave_application.py index d2df12ac1b..bb4bbe702b 100755 --- a/hrms/hr/doctype/leave_application/leave_application.py +++ b/hrms/hr/doctype/leave_application/leave_application.py @@ -953,7 +953,6 @@ def get_leave_allocation_records(employee, date, leave_type=None): & (Ledger.docstatus == 1) & (Ledger.transaction_type == "Leave Allocation") & (Ledger.employee == employee) - & (LeaveAllocation.expired == 0) & (Ledger.is_lwp == 0) & ( # newly allocated leave's end date is same as the leave allocation's to date