diff --git a/app.py b/app.py index 226d9e8..31ee42c 100644 --- a/app.py +++ b/app.py @@ -15,6 +15,7 @@ from dotenv import load_dotenv from logger_handler import AppLogger, log_user_activity, log_database_operations from single_checkin_calculator import SingleCheckInCalculator +from working_hours_calculator import WorkingHoursCalculator from payroll_excel_exporter import PayrollExcelExporter from enhanced_payroll_excel_exporter import EnhancedPayrollExcelExporter from time_attendance_import_service import TimeAttendanceImportService @@ -5265,7 +5266,7 @@ def payroll_dashboard(): # Calculate working hours if we have records if attendance_records: - calculator = SingleCheckInCalculator() + calculator = WorkingHoursCalculator() working_hours_data = calculator.calculate_all_employees_hours( start_date, end_date, attendance_records ) @@ -7417,7 +7418,7 @@ def export_time_attendance_excel(records, project_name_for_filename, date_range_ converted_records.append(converted_record) # Calculate working hours using SingleCheckInCalculator - calculator = SingleCheckInCalculator() + calculator = WorkingHoursCalculator() hours_data = calculator.calculate_all_employees_hours( datetime.combine(start_date, datetime.min.time()), datetime.combine(end_date, datetime.max.time()), diff --git a/enhanced_payroll_excel_exporter.py b/enhanced_payroll_excel_exporter.py index 4b3863a..204a3bd 100644 --- a/enhanced_payroll_excel_exporter.py +++ b/enhanced_payroll_excel_exporter.py @@ -12,7 +12,7 @@ from typing import List, Dict, Optional, Any from openpyxl import Workbook from openpyxl.styles import Font, PatternFill, Alignment, Border, Side from openpyxl.utils import get_column_letter -from single_checkin_calculator import SingleCheckInCalculator +from working_hours_calculator import WorkingHoursCalculator from logger_handler import log_database_operations @@ -93,7 +93,7 @@ class EnhancedPayrollExcelExporter: employee_names = self._get_employee_names(attendance_records) # Calculate working hours using enhanced calculator - calculator = SingleCheckInCalculator() + calculator = WorkingHoursCalculator() working_hours_data = calculator.calculate_all_employees_hours( start_date, end_date, attendance_records ) @@ -294,7 +294,7 @@ class EnhancedPayrollExcelExporter: employee_names = self._get_employee_names(attendance_records) # Calculate working hours - calculator = SingleCheckInCalculator() + calculator = WorkingHoursCalculator() working_hours_data = calculator.calculate_all_employees_hours( start_date, end_date, attendance_records ) diff --git a/payroll_excel_exporter.py b/payroll_excel_exporter.py index 4dc8679..98bc186 100644 --- a/payroll_excel_exporter.py +++ b/payroll_excel_exporter.py @@ -20,7 +20,7 @@ from typing import List, Dict, Any, Optional from openpyxl import Workbook from openpyxl.styles import Font, Alignment, PatternFill, Border, Side from openpyxl.utils import get_column_letter -from single_checkin_calculator import SingleCheckInCalculator +from working_hours_calculator import WorkingHoursCalculator from logger_handler import log_database_operations @@ -181,7 +181,7 @@ class PayrollExcelExporter: employee_names = self._get_employee_names(attendance_records) # Calculate working hours - calculator = SingleCheckInCalculator() + calculator = WorkingHoursCalculator() hours_data = calculator.calculate_all_employees_hours(start_date, end_date, attendance_records) # Create workbook @@ -417,7 +417,7 @@ class PayrollExcelExporter: employee_names = self._get_employee_names(attendance_records) # Calculate working hours - calculator = SingleCheckInCalculator() + calculator = WorkingHoursCalculator() hours_data = calculator.calculate_all_employees_hours(start_date, end_date, attendance_records) # Create workbook @@ -544,7 +544,7 @@ class PayrollExcelExporter: employee_names = self._get_employee_names(attendance_records) # Calculate working hours - calculator = SingleCheckInCalculator() + calculator = WorkingHoursCalculator() hours_data = calculator.calculate_all_employees_hours(start_date, end_date, attendance_records) # Create workbook with single sheet