fix: salary slip attribute error (#24455)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
parent
d9c84dff0f
commit
4cef0f5983
@ -1103,10 +1103,10 @@ class SalarySlip(TransactionBase):
|
|||||||
self.calculate_total_for_salary_slip_based_on_timesheet()
|
self.calculate_total_for_salary_slip_based_on_timesheet()
|
||||||
else:
|
else:
|
||||||
self.total_deduction = 0.0
|
self.total_deduction = 0.0
|
||||||
if self.earnings:
|
if hasattr(self, "earnings"):
|
||||||
for earning in self.earnings:
|
for earning in self.earnings:
|
||||||
self.gross_pay += flt(earning.amount, earning.precision("amount"))
|
self.gross_pay += flt(earning.amount, earning.precision("amount"))
|
||||||
if self.deductions:
|
if hasattr(self, "deductions"):
|
||||||
for deduction in self.deductions:
|
for deduction in self.deductions:
|
||||||
self.total_deduction += flt(deduction.amount, deduction.precision("amount"))
|
self.total_deduction += flt(deduction.amount, deduction.precision("amount"))
|
||||||
self.net_pay = flt(self.gross_pay) - flt(self.total_deduction) - flt(self.total_loan_repayment)
|
self.net_pay = flt(self.gross_pay) - flt(self.total_deduction) - flt(self.total_loan_repayment)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user