Skip to content

Commit

Permalink
fix: correct bank entry calculation with deductions and prevent multi…
Browse files Browse the repository at this point in the history
…ple loan repayment deductions

(cherry picked from commit 3ce5890)
  • Loading branch information
Nihantra-Patel authored and mergify[bot] committed Oct 28, 2024
1 parent 0927f77 commit 4d93cfa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hrms/payroll/doctype/payroll_entry/payroll_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,11 @@ def make_bank_entry(self, for_withheld_salaries=False):

salary_slip_total -= salary_detail.amount

salary_slip_total -= flt(salary_detail.get("total_loan_repayment"))
total_loan_repayment = sum(
flt(slip.get("total_loan_repayment", 0))
for slip in {slip["name"]: slip for slip in salary_slips}.values()
)
salary_slip_total -= total_loan_repayment

bank_entry = None
if salary_slip_total > 0:
Expand Down

0 comments on commit 4d93cfa

Please sign in to comment.