Fix issue with leave balance calculation in end-of-service report

This commit is contained in:
younes 2025-05-27 15:37:36 +01:00
parent 4008c2d3a4
commit 2cb7bf479b
1 changed files with 8 additions and 8 deletions

View File

@ -661,14 +661,14 @@ class ReportTerminationPublic(models.AbstractModel):
data['total_rule']['total_salary'] += salary
data[emp.name]['rule'] = rules
data[emp.name]['total_salary'] = salary
if type == 'all' or type == 'leave':
if salary > 0:
amount_per_day = salary / 30
lave_price = leave_balance*amount_per_day
if 'lave_price' not in data['total_sum']:
data['total_sum']['lave_price'] = lave_price
else:
data['total_sum']['lave_price'] += lave_price
if type == 'all' or type == 'leave':
if salary > 0:
amount_per_day = salary / 30
lave_price = leave_balance*amount_per_day
if 'lave_price' not in data['total_sum']:
data['total_sum']['lave_price'] = lave_price
else:
data['total_sum']['lave_price'] += lave_price
data[emp.name]['leave_price'] = lave_price
key_list.append(emp.name)
data['total_sum']['ticket_price'] += ticket_price