Skip to content

Commit 52a52a5

Browse files
fix(gratuity): consider default amount
1 parent 289ee62 commit 52a52a5

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

hrms/payroll/doctype/gratuity/gratuity.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,11 @@ def get_total_component_amount(self) -> float:
264264
if not salary_slip:
265265
frappe.throw(_("No Salary Slip found for Employee: {0}").format(bold(self.employee)))
266266

267-
# consider full payment days for calculation as last month's salary slip
268-
# might have less payment days as per attendance, making it non-deterministic
269-
salary_slip.payment_days = salary_slip.total_working_days
270-
salary_slip.calculate_net_pay()
271-
272267
total_amount = 0
273268
component_found = False
274269
for row in salary_slip.earnings:
275270
if row.salary_component in applicable_earning_components:
276-
total_amount += flt(row.amount)
271+
total_amount += flt(row.default_amount)
277272
component_found = True
278273

279274
if not component_found:

0 commit comments

Comments
 (0)