Skip to content

Commit

Permalink
fix: salary slip cancellation with loan repayment (backport #1270) (#…
Browse files Browse the repository at this point in the history
…1271)

(cherry picked from commit 3e36b56)

Co-authored-by: Rucha Mahabal <[email protected]>
  • Loading branch information
mergify[bot] and ruchamahabal authored Jan 8, 2024
1 parent 60c099b commit 98702b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hrms/payroll/doctype/salary_slip/salary_slip_loan_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def make_loan_repayment_entry(doc: "SalarySlip"):
"Payroll Settings", "process_payroll_accounting_entry_based_on_employee"
)

for loan in doc.loans:
for loan in doc.get("loans", []):
if not loan.total_payment:
continue

Expand All @@ -128,7 +128,7 @@ def make_loan_repayment_entry(doc: "SalarySlip"):

@if_lending_app_installed
def cancel_loan_repayment_entry(doc: "SalarySlip"):
for loan in doc.loans:
for loan in doc.get("loans", []):
if loan.loan_repayment_entry:
repayment_entry = frappe.get_doc("Loan Repayment", loan.loan_repayment_entry)
repayment_entry.cancel()
Expand Down

0 comments on commit 98702b0

Please sign in to comment.