From 42fa2d10915374e22121930797eaaccd62c62b06 Mon Sep 17 00:00:00 2001 From: Michael Telahun Date: Fri, 17 Jun 2022 07:47:59 +0300 Subject: [PATCH 1/3] [FIX] payroll - revert change of leave hours/days to negative in #27 --- payroll/models/hr_payslip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/payroll/models/hr_payslip.py b/payroll/models/hr_payslip.py index d6a178b6d..c666e65d8 100644 --- a/payroll/models/hr_payslip.py +++ b/payroll/models/hr_payslip.py @@ -372,14 +372,14 @@ def get_worked_day_lines(self, contracts, date_from, date_to): "contract_id": contract.id, }, ) - current_leave_struct["number_of_hours"] -= hours + current_leave_struct["number_of_hours"] += hours work_hours = calendar.get_work_hours_count( tz.localize(datetime.combine(day, time.min)), tz.localize(datetime.combine(day, time.max)), compute_leaves=False, ) if work_hours: - current_leave_struct["number_of_days"] -= hours / work_hours + current_leave_struct["number_of_days"] += hours / work_hours # compute worked days work_data = contract.employee_id._get_work_days_data( From 34c4ff5becc54c53bb2e9212bb7267e60cf16a71 Mon Sep 17 00:00:00 2001 From: Michael Telahun Date: Fri, 17 Jun 2022 08:13:13 +0300 Subject: [PATCH 2/3] [FIX] payroll - revert move of data -> demo in #27 --- payroll/data/hr_payroll_data.xml | 72 ++++++++++++++++++++++++++++++++ payroll/demo/hr_payroll_demo.xml | 72 -------------------------------- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/payroll/data/hr_payroll_data.xml b/payroll/data/hr_payroll_data.xml index c3adfdd08..e6626ee85 100644 --- a/payroll/data/hr_payroll_data.xml +++ b/payroll/data/hr_payroll_data.xml @@ -1,6 +1,78 @@ + + Employees + + + + Basic + BASIC + + + Allowance + ALW + + + Gross + GROSS + + + Deduction + DED + + + Net + NET + + + Company Contribution + COMP + + + Basic Salary + + BASIC + + none + code + +result = contract.wage + + + + Gross + + GROSS + + none + code + +result = categories.BASIC + categories.ALW + + + + Net Salary + + NET + + none + code + +result = categories.BASIC + categories.ALW + categories.DED + + + + + + BASE + Base for new structures + + + Payroll diff --git a/payroll/demo/hr_payroll_demo.xml b/payroll/demo/hr_payroll_demo.xml index 4e987a1ab..5c89e7473 100644 --- a/payroll/demo/hr_payroll_demo.xml +++ b/payroll/demo/hr_payroll_demo.xml @@ -1,77 +1,5 @@ - - Employees - - - - Basic - BASIC - - - Allowance - ALW - - - Gross - GROSS - - - Deduction - DED - - - Net - NET - - - Company Contribution - COMP - - - Basic Salary - - BASIC - - none - code - -result = contract.wage - - - - Gross - - GROSS - - none - code - -result = categories.BASIC + categories.ALW - - - - Net Salary - - NET - - none - code - -result = categories.BASIC + categories.ALW + categories.DED - - - - - - BASE - Base for new structures - - - House Rent Allowance Register From 99076963a7b1c1693c9b13eebc057d0758ea3b6b Mon Sep 17 00:00:00 2001 From: Michael Telahun Date: Fri, 12 Aug 2022 11:34:27 +0300 Subject: [PATCH 3/3] Revert "[FIX] payroll - revert change of leave hours/days to negative in #27" This reverts commit 42fa2d10915374e22121930797eaaccd62c62b06. --- payroll/models/hr_payslip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/payroll/models/hr_payslip.py b/payroll/models/hr_payslip.py index c666e65d8..d6a178b6d 100644 --- a/payroll/models/hr_payslip.py +++ b/payroll/models/hr_payslip.py @@ -372,14 +372,14 @@ def get_worked_day_lines(self, contracts, date_from, date_to): "contract_id": contract.id, }, ) - current_leave_struct["number_of_hours"] += hours + current_leave_struct["number_of_hours"] -= hours work_hours = calendar.get_work_hours_count( tz.localize(datetime.combine(day, time.min)), tz.localize(datetime.combine(day, time.max)), compute_leaves=False, ) if work_hours: - current_leave_struct["number_of_days"] += hours / work_hours + current_leave_struct["number_of_days"] -= hours / work_hours # compute worked days work_data = contract.employee_id._get_work_days_data(