diff --git a/hrms/payroll/doctype/salary_slip/salary_slip.py b/hrms/payroll/doctype/salary_slip/salary_slip.py index e2819a6bc5..998e61d54a 100644 --- a/hrms/payroll/doctype/salary_slip/salary_slip.py +++ b/hrms/payroll/doctype/salary_slip/salary_slip.py @@ -780,6 +780,13 @@ def calculate_net_pay(self): if self.salary_structure: self.calculate_component_amounts("earnings") + + self.gross_pay = self.get_component_totals("earnings", depends_on_payment_days=1) + self.base_gross_pay = flt( + flt(self.gross_pay) * flt(self.exchange_rate), self.precision("base_gross_pay") + ) + + if self.salary_structure: self.calculate_component_amounts("deductions") deductions_abbr = [d.abbr for d in self.deductions] @@ -791,10 +798,6 @@ def calculate_net_pay(self): self.add_structure_component(d, "earnings") self.update_dependent_components_recursively("deductions", d.abbr) - self.gross_pay = self.get_component_totals("earnings", depends_on_payment_days=1) - self.base_gross_pay = flt( - flt(self.gross_pay) * flt(self.exchange_rate), self.precision("base_gross_pay") - ) set_loan_repayment(self) self.set_precision_for_component_amounts()