Skip to content

Commit 26787a2

Browse files
AyshaHakeemmergify[bot]
authored andcommitted
fix: inaccurate lwp calculation when partially paid leave exists
(cherry picked from commit 4892cef)
1 parent 2434ecf commit 26787a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hrms/payroll/doctype/salary_slip/salary_slip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ def calculate_lwp_or_ppl_based_on_leave_application(
653653

654654
for d in working_days_list:
655655
if self.relieving_date and d > self.relieving_date:
656-
continue
656+
break
657657

658658
leave = leaves.get(d)
659659

@@ -674,7 +674,7 @@ def calculate_lwp_or_ppl_based_on_leave_application(
674674

675675
if cint(leave.is_ppl):
676676
equivalent_lwp_count *= (
677-
fraction_of_daily_salary_per_leave if fraction_of_daily_salary_per_leave else 1
677+
(1 - fraction_of_daily_salary_per_leave) if fraction_of_daily_salary_per_leave else 1
678678
)
679679

680680
lwp += equivalent_lwp_count

0 commit comments

Comments
 (0)