Skip to content

Commit

Permalink
fix: create single leave ledger encashment entry for carry forwarding…
Browse files Browse the repository at this point in the history
… leave type (backport #2614) (#2627)

Co-authored-by: Asmita Hase <[email protected]>
  • Loading branch information
mergify[bot] and asmitahase authored Jan 13, 2025
1 parent a148b29 commit 44acce7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hrms/hr/doctype/leave_encashment/leave_encashment.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ def create_leave_ledger_entry(self, submit=True):
return

to_date = leave_allocation.get("to_date")
if to_date < getdate():

can_expire = not frappe.db.get_value("Leave Type", self.leave_type, "is_carry_forward")
if to_date < getdate() and can_expire:
args = frappe._dict(
leaves=self.encashment_days, from_date=to_date, to_date=to_date, is_carry_forward=0
)
Expand Down

0 comments on commit 44acce7

Please sign in to comment.