Skip to content

Commit

Permalink
revert(Salary Slip): calculate gross pay before deductions
Browse files Browse the repository at this point in the history
  • Loading branch information
krantheman committed Aug 16, 2024
1 parent 915915f commit 3b6041a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions hrms/payroll/doctype/salary_slip/salary_slip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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()
Expand Down

0 comments on commit 3b6041a

Please sign in to comment.