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) (#2626)

Co-authored-by: Asmita Hase <[email protected]>
Co-authored-by: Rucha Mahabal <[email protected]>
fix: create single leave ledger encashment entry for carry forwarding leave type (#2614)
  • Loading branch information
3 people authored Jan 13, 2025
1 parent 9d05b80 commit 5655bca
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 @@ -164,7 +164,9 @@ def create_leave_ledger_entry(self, submit=True):
return

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

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.encashable_days, from_date=to_date, to_date=to_date, is_carry_forward=0
)
Expand Down

0 comments on commit 5655bca

Please sign in to comment.