From 9cc92a0c563f3a13fe2dcc0777a2fc0206562343 Mon Sep 17 00:00:00 2001 From: Bakry Date: Sun, 21 Sep 2025 10:27:14 +0300 Subject: [PATCH] fix payroll if duration 0 in month 31 days --- odex25_hr/exp_payroll_custom/models/hr_advance_payslip.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/odex25_hr/exp_payroll_custom/models/hr_advance_payslip.py b/odex25_hr/exp_payroll_custom/models/hr_advance_payslip.py index e54d0bcf3..6356490a1 100644 --- a/odex25_hr/exp_payroll_custom/models/hr_advance_payslip.py +++ b/odex25_hr/exp_payroll_custom/models/hr_advance_payslip.py @@ -2562,6 +2562,8 @@ class HrPayslipRun(models.Model): elif month_range > 30 and contract_end_date.day > 30: duration = relativedelta(contract_end_date, contract_start_date).days + if duration == 0: + duration = duration + 1 elif month_range == 28 and contract_end_date.day == 28: duration = relativedelta(contract_end_date, contract_start_date).days + 3 @@ -2791,6 +2793,8 @@ class HrPayslipRun(models.Model): duration = relativedelta(contract_end_date, contract_start_date).days + 1 elif month_range > 30 and contract_end_date.day > 30: duration = relativedelta(contract_end_date, contract_start_date).days + if duration == 0: + duration = duration + 1 elif month_range == 28 and contract_end_date.day == 28: duration = relativedelta(contract_end_date, contract_start_date).days + 3 elif month_range == 29 and contract_end_date.day == 29: