Merge pull request #2858 from expsa/Esraa-Ensan-hr-tasks

div by zero
This commit is contained in:
Esraa-Exp 2025-04-23 13:12:36 +02:00 committed by GitHub
commit 00f4e06043
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -224,7 +224,10 @@ class HrAttendanceReport(models.Model):
get_total_amount = attendance.employee_id.contract_id.total_allowance
if emp_calendar.is_full_day:
working_hours_per_week = emp_calendar.working_hours * emp_calendar.working_days
get_amount_per_hour = get_total_amount / working_hours_per_week
if working_hours_per_week != 0:
get_amount_per_hour = get_total_amount / working_hours_per_week
else:
get_amount_per_hour = 0
else:
get_amount_per_hour = get_total_amount / (
total_hours_for_two_shifts * emp_calendar.working_days)