Skip to content

Commit

Permalink
fix: avoid rounding if not an earned leave
Browse files Browse the repository at this point in the history
  • Loading branch information
rtdany10 committed Feb 15, 2023
1 parent f29d6e2 commit 24989f4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ def get_pro_rated_leaves(self, date_of_joining, leave_details, new_leaves_alloca

# no need to prorate if employee joined before the leave period
if not new_leaves_allocated or getdate(date_of_joining) <= getdate(self.effective_from):
if not leave_details.is_earned_leave:
return new_leaves_allocated
return round_earned_leaves(new_leaves_allocated, leave_details.rounding)

# for earned leave, pro-rata period ends on the last day of the month
Expand Down

0 comments on commit 24989f4

Please sign in to comment.