fix: Reload loan Table in Salary Slip when change Employee (#31525)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
Co-authored-by: bahaaabed <bahaa.9999.sh@gmail.com>
Co-authored-by: newhr1 <104132586+newhr1@users.noreply.github.com>
This commit is contained in:
Alaa Alsalehi
2022-07-28 10:52:07 +03:00
committed by GitHub
parent 0602848caa
commit a95c011a93

View File

@@ -1363,9 +1363,8 @@ class SalarySlip(TransactionBase):
self.total_interest_amount = 0 self.total_interest_amount = 0
self.total_principal_amount = 0 self.total_principal_amount = 0
if not self.get("loans"): self.set("loans", [])
for loan in self.get_loan_details(): for loan in self.get_loan_details():
amounts = calculate_amounts(loan.name, self.posting_date, "Regular Payment") amounts = calculate_amounts(loan.name, self.posting_date, "Regular Payment")
if amounts["interest_amount"] or amounts["payable_principal_amount"]: if amounts["interest_amount"] or amounts["payable_principal_amount"]: