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: