From 09cb85da9f27fe1cf5aa7fa9dddd7b2d589c1e0c Mon Sep 17 00:00:00 2001 From: AadithPunathilBuildsuite Date: Thu, 1 Jan 2026 14:21:58 +0530 Subject: [PATCH] fix:update the or --- calicut_textiles/public/python/payroll_entry.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/calicut_textiles/public/python/payroll_entry.py b/calicut_textiles/public/python/payroll_entry.py index 1d944da..3aacbb7 100644 --- a/calicut_textiles/public/python/payroll_entry.py +++ b/calicut_textiles/public/python/payroll_entry.py @@ -255,11 +255,13 @@ def create_overtime(pe, employees, employee_map, checkin_map, holiday_map): total_ot_minutes += threshold + minutes(out_time - normal_end) # --------- LATE / EARLY (NON-HOLIDAY ONLY) --------- + total_late_minutes = 0 + total_early_minutes = 0 for row in rows: custom_late_coming_minutes = row.custom_late_coming_minutes if row.custom_late_coming_minutes else 0 custom_early_going_minutes = row.custom_early_going_minutes if row.custom_early_going_minutes else 0 if custom_late_coming_minutes > early_threshold: - total_early_minutes += int(custom_late_coming_minutes) + total_late_minutes += int(custom_late_coming_minutes) if custom_early_going_minutes > early_threshold: total_early_minutes += int(custom_early_going_minutes) # if in_time > normal_start_for_late: @@ -284,13 +286,13 @@ def create_overtime(pe, employees, employee_map, checkin_map, holiday_map): round(rate * total_ot_minutes, 2), ot_component ) - - if total_early_minutes > 0: + total_early_minutes_late = total_early_minutes + total_late_minutes + if total_early_minutes_late > 0: create_monthly_overtime( emp, pe.end_date, - total_early_minutes, - round(rate * total_early_minutes, 2), + total_early_minutes_late, + round(rate * total_early_minutes_late, 2), early_component )