mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Merge branch 'mig/12.0/l10n_us_hr_payroll__2020' into '12.0-test'
mig/12.0/l10n_us_hr_payroll__2020 into 12.0-test See merge request hibou-io/hibou-odoo/suite!294
This commit is contained in:
@@ -28,6 +28,7 @@ USA Payroll Rules.
|
|||||||
'data/federal/fed_941_fica_rules.xml',
|
'data/federal/fed_941_fica_rules.xml',
|
||||||
'data/federal/fed_941_fit_parameters.xml',
|
'data/federal/fed_941_fit_parameters.xml',
|
||||||
'data/federal/fed_941_fit_rules.xml',
|
'data/federal/fed_941_fit_rules.xml',
|
||||||
|
'data/state/ak_alaska.xml',
|
||||||
'data/state/ar_arkansas.xml',
|
'data/state/ar_arkansas.xml',
|
||||||
'data/state/az_arizona.xml',
|
'data/state/az_arizona.xml',
|
||||||
'data/state/fl_florida.xml',
|
'data/state/fl_florida.xml',
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
ref('hr_payroll_rule_ee_fed_941_fit'),
|
ref('hr_payroll_rule_ee_fed_941_fit'),
|
||||||
|
|
||||||
|
ref('hr_payroll_rule_er_us_ak_suta'),
|
||||||
|
ref('hr_payroll_rule_ee_us_ak_suta'),
|
||||||
|
|
||||||
ref('hr_payroll_rule_er_us_ar_suta'),
|
ref('hr_payroll_rule_er_us_ar_suta'),
|
||||||
ref('hr_payroll_rule_ee_us_ar_sit'),
|
ref('hr_payroll_rule_ee_us_ar_sit'),
|
||||||
|
|
||||||
|
|||||||
88
l10n_us_hr_payroll/data/state/ak_alaska.xml
Normal file
88
l10n_us_hr_payroll/data/state/ak_alaska.xml
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<!-- Wage Base -->
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="rule_parameter_us_ak_suta_wage_base_2019" model="hr.payroll.rate">
|
||||||
|
<field name="name">US AK Alaska SUTA Wage Base</field>
|
||||||
|
<field name="code">us_ak_suta_wage_base</field>
|
||||||
|
<field name="parameter_value">39900.00</field>
|
||||||
|
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
<record id="rule_parameter_us_ak_suta_wage_base_2020" model="hr.payroll.rate">
|
||||||
|
<field name="name">US AK Alaska SUTA Wage Base</field>
|
||||||
|
<field name="code">us_ak_suta_wage_base</field>
|
||||||
|
<field name="parameter_value">41500.00</field>
|
||||||
|
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<!-- Rate -->
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="rule_parameter_us_ak_suta_rate_2019" model="hr.payroll.rate">
|
||||||
|
<field name="name">US AK Alaska SUTA Rate</field>
|
||||||
|
<field name="code">us_ak_suta_rate</field>
|
||||||
|
<field name="parameter_value">1.780</field>
|
||||||
|
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
<record id="rule_parameter_us_ak_suta_rate_2020" model="hr.payroll.rate">
|
||||||
|
<field name="name">US AK Alaska SUTA Rate</field>
|
||||||
|
<field name="code">us_ak_suta_rate</field>
|
||||||
|
<field name="parameter_value">1.590</field>
|
||||||
|
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="rule_parameter_us_ak_suta_ee_rate_2019" model="hr.payroll.rate">
|
||||||
|
<field name="name">US AK Alaska SUTA Rate EE</field>
|
||||||
|
<field name="code">us_ak_suta_ee_rate</field>
|
||||||
|
<field name="parameter_value">0.500</field>
|
||||||
|
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
<record id="rule_parameter_us_ak_suta_ee_rate_2020" model="hr.payroll.rate">
|
||||||
|
<field name="name">US AK Alaska SUTA Rate EE</field>
|
||||||
|
<field name="code">us_ak_suta_ee_rate</field>
|
||||||
|
<field name="parameter_value">0.500</field>
|
||||||
|
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<!-- Partners and Contribution Registers -->
|
||||||
|
<record id="res_partner_us_ak_dor" model="res.partner">
|
||||||
|
<field name="name">US Alaska - Department of Labor and Workforce Development (ADLWD) - Unemployment Tax</field>
|
||||||
|
</record>
|
||||||
|
<record id="contrib_register_us_ak_dor" model="hr.contribution.register">
|
||||||
|
<field name="name">US Alaska - Department of Labor and Workforce Development (ADLWD) - Unemployment Tax</field>
|
||||||
|
<field name="partner_id" ref="res_partner_us_ak_dor"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- Categories -->
|
||||||
|
|
||||||
|
<!-- Rules -->
|
||||||
|
<record id="hr_payroll_rule_er_us_ak_suta" model="hr.salary.rule">
|
||||||
|
<field name="sequence" eval="450"/>
|
||||||
|
<field name="category_id" ref="hr_payroll_category_er_us_suta"/>
|
||||||
|
<field name="name">ER: US AK Alaska State Unemployment</field>
|
||||||
|
<field name="code">ER_US_AK_SUTA</field>
|
||||||
|
<field name="condition_select">python</field>
|
||||||
|
<field name="condition_python">result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_ak_suta_wage_base', rate='us_ak_suta_rate', state_code='AK')</field>
|
||||||
|
<field name="amount_select">code</field>
|
||||||
|
<field name="amount_python_compute">result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_ak_suta_wage_base', rate='us_ak_suta_rate', state_code='AK')</field>
|
||||||
|
<field name="register_id" ref="contrib_register_us_ak_dor"/>
|
||||||
|
<field name="appears_on_payslip" eval="False"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="hr_payroll_rule_ee_us_ak_suta" model="hr.salary.rule">
|
||||||
|
<field name="sequence" eval="195"/>
|
||||||
|
<field name="category_id" ref="hr_payroll_category_ee_us_suta"/>
|
||||||
|
<field name="name">EE: US AK Alaska State Unemployment (UC-2)</field>
|
||||||
|
<field name="code">EE_US_AK_SUTA</field>
|
||||||
|
<field name="condition_select">python</field>
|
||||||
|
<field name="condition_python">result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_ak_suta_wage_base', rate='us_ak_suta_ee_rate', state_code='AK')</field>
|
||||||
|
<field name="amount_select">code</field>
|
||||||
|
<field name="amount_python_compute">result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_ak_suta_wage_base', rate='us_ak_suta_ee_rate', state_code='AK')</field>
|
||||||
|
<field name="register_id" ref="contrib_register_us_ak_dor"/>
|
||||||
|
<field name="appears_on_payslip" eval="True"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -79,6 +79,11 @@ XMLIDS_TO_REMOVE_2020 = [
|
|||||||
'l10n_us_hr_payroll.hr_payroll_rules_futa_wages_2018',
|
'l10n_us_hr_payroll.hr_payroll_rules_futa_wages_2018',
|
||||||
'l10n_us_hr_payroll.hr_payroll_rules_fed_inc_withhold_2018_married',
|
'l10n_us_hr_payroll.hr_payroll_rules_fed_inc_withhold_2018_married',
|
||||||
# State
|
# State
|
||||||
|
'l10n_us_ak_hr_payroll.hr_payroll_ak_unemp_wages',
|
||||||
|
'l10n_us_ak_hr_payroll.hr_payroll_ak_unemp',
|
||||||
|
'l10n_us_ak_hr_payroll.hr_payroll_ak_unemp_ee',
|
||||||
|
'l10n_us_ak_hr_payroll.hr_payroll_rules_ak_unemp_wages',
|
||||||
|
|
||||||
'l10n_us_ar_hr_payroll.hr_payroll_ar_unemp_wages',
|
'l10n_us_ar_hr_payroll.hr_payroll_ar_unemp_wages',
|
||||||
'l10n_us_ar_hr_payroll.hr_payroll_ar_unemp',
|
'l10n_us_ar_hr_payroll.hr_payroll_ar_unemp',
|
||||||
'l10n_us_ar_hr_payroll.hr_payroll_ar_income_withhold',
|
'l10n_us_ar_hr_payroll.hr_payroll_ar_income_withhold',
|
||||||
@@ -208,6 +213,11 @@ XMLIDS_TO_RENAME_2020 = {
|
|||||||
'l10n_us_hr_payroll.hr_payroll_rules_fica_comp_m': 'l10n_us_hr_payroll.hr_payroll_rule_er_fed_941_m',
|
'l10n_us_hr_payroll.hr_payroll_rules_fica_comp_m': 'l10n_us_hr_payroll.hr_payroll_rule_er_fed_941_m',
|
||||||
'l10n_us_hr_payroll.hr_payroll_rules_fed_inc_withhold_2018_single': 'l10n_us_hr_payroll.hr_payroll_rule_ee_fed_941_fit',
|
'l10n_us_hr_payroll.hr_payroll_rules_fed_inc_withhold_2018_single': 'l10n_us_hr_payroll.hr_payroll_rule_ee_fed_941_fit',
|
||||||
# State
|
# State
|
||||||
|
'l10n_us_ak_hr_payroll.res_partner_ak_dlwd_unemp': 'l10n_us_hr_payroll.res_partner_us_ak_dor',
|
||||||
|
'l10n_us_ak_hr_payroll.contrib_register_ak_dlwd_unemp': 'l10n_us_hr_payroll.contrib_register_us_ak_dor',
|
||||||
|
'l10n_us_ak_hr_payroll.hr_payroll_rules_ak_unemp': 'l10n_us_hr_payroll.hr_payroll_rule_er_us_ak_suta',
|
||||||
|
'l10n_us_ak_hr_payroll.hr_payroll_rules_ak_unemp_ee': 'l10n_us_hr_payroll.hr_payroll_rule_ee_us_ak_sit',
|
||||||
|
|
||||||
'l10n_us_ar_hr_payroll.res_partner_ar_dws_unemp': 'l10n_us_hr_payroll.res_partner_us_ar_dor',
|
'l10n_us_ar_hr_payroll.res_partner_ar_dws_unemp': 'l10n_us_hr_payroll.res_partner_us_ar_dor',
|
||||||
'l10n_us_ar_hr_payroll.res_partner_ar_dfa_withhold': 'l10n_us_hr_payroll.res_partner_us_ar_dor_sit',
|
'l10n_us_ar_hr_payroll.res_partner_ar_dfa_withhold': 'l10n_us_hr_payroll.res_partner_us_ar_dor_sit',
|
||||||
'l10n_us_ar_hr_payroll.contrib_register_ar_dws_unemp': 'l10n_us_hr_payroll.contrib_register_us_ar_dor',
|
'l10n_us_ar_hr_payroll.contrib_register_ar_dws_unemp': 'l10n_us_hr_payroll.contrib_register_us_ar_dor',
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ from . import common
|
|||||||
from . import test_us_payslip_2019
|
from . import test_us_payslip_2019
|
||||||
from . import test_us_payslip_2020
|
from . import test_us_payslip_2020
|
||||||
|
|
||||||
|
from . import test_us_ak_alaska_payslip_2019
|
||||||
|
from . import test_us_ak_alaska_payslip_2020
|
||||||
|
|
||||||
from . import test_us_ar_arkansas_payslip_2019
|
from . import test_us_ar_arkansas_payslip_2019
|
||||||
from . import test_us_ar_arkansas_payslip_2020
|
from . import test_us_ar_arkansas_payslip_2020
|
||||||
|
|
||||||
|
|||||||
61
l10n_us_hr_payroll/tests/test_us_ak_alaska_payslip_2019.py
Normal file
61
l10n_us_hr_payroll/tests/test_us_ak_alaska_payslip_2019.py
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from .common import TestUsPayslip, process_payslip
|
||||||
|
|
||||||
|
|
||||||
|
class TestUsAKPayslip(TestUsPayslip):
|
||||||
|
# TAXES AND RATES
|
||||||
|
AK_UNEMP_MAX_WAGE = 39900.00
|
||||||
|
AK_UNEMP = -(1.780 / 100.0)
|
||||||
|
AK_UNEMP_EE = -(0.5 / 100.0)
|
||||||
|
|
||||||
|
def test_taxes_monthly_over_max(self):
|
||||||
|
salary = 50000.00
|
||||||
|
schedule_pay = 'monthly'
|
||||||
|
|
||||||
|
employee = self._createEmployee()
|
||||||
|
contract = self._createContract(employee,
|
||||||
|
wage=salary,
|
||||||
|
state_id=self.get_us_state('AK'),
|
||||||
|
state_income_tax_additional_withholding=0.0,
|
||||||
|
schedule_pay=schedule_pay)
|
||||||
|
|
||||||
|
self._log('2019 Alaska tax first payslip monthly:')
|
||||||
|
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
|
||||||
|
payslip.compute_sheet()
|
||||||
|
cats = self._getCategories(payslip)
|
||||||
|
|
||||||
|
self.assertPayrollEqual(cats['ER_US_SUTA'], self.AK_UNEMP_MAX_WAGE * self.AK_UNEMP)
|
||||||
|
self.assertPayrollEqual(cats['EE_US_SUTA'], self.AK_UNEMP_MAX_WAGE * self.AK_UNEMP_EE)
|
||||||
|
|
||||||
|
process_payslip(payslip)
|
||||||
|
|
||||||
|
remaining_ak_unemp_wages = 0.00 # We already reached the maximum wage for unemployment insurance.
|
||||||
|
|
||||||
|
self._log('2019 Alaska tax second payslip monthly:')
|
||||||
|
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
|
||||||
|
payslip.compute_sheet()
|
||||||
|
cats = self._getCategories(payslip)
|
||||||
|
|
||||||
|
self.assertPayrollEqual(cats['ER_US_SUTA'], remaining_ak_unemp_wages * self.AK_UNEMP) # 0
|
||||||
|
|
||||||
|
def test_taxes_weekly_under_max(self):
|
||||||
|
salary = 5000.00
|
||||||
|
schedule_pay = 'weekly'
|
||||||
|
|
||||||
|
employee = self._createEmployee()
|
||||||
|
contract = self._createContract(employee,
|
||||||
|
wage=salary,
|
||||||
|
state_id=self.get_us_state('AK'),
|
||||||
|
state_income_tax_additional_withholding=0.0,
|
||||||
|
schedule_pay=schedule_pay)
|
||||||
|
|
||||||
|
self._log('2019 Alaska tax first payslip weekly:')
|
||||||
|
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
|
||||||
|
payslip.compute_sheet()
|
||||||
|
cats = self._getCategories(payslip)
|
||||||
|
|
||||||
|
self.assertPayrollEqual(cats['ER_US_SUTA'], salary * self.AK_UNEMP)
|
||||||
|
self.assertPayrollEqual(cats['EE_US_SUTA'], salary * self.AK_UNEMP_EE)
|
||||||
|
|
||||||
|
process_payslip(payslip)
|
||||||
15
l10n_us_hr_payroll/tests/test_us_ak_alaska_payslip_2020.py
Normal file
15
l10n_us_hr_payroll/tests/test_us_ak_alaska_payslip_2020.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from datetime import date
|
||||||
|
from .common import TestUsPayslip
|
||||||
|
|
||||||
|
|
||||||
|
class TestUsAKPayslip(TestUsPayslip):
|
||||||
|
# TAXES AND RATES
|
||||||
|
AK_UNEMP_MAX_WAGE = 41500.00
|
||||||
|
AK_UNEMP = 1.590
|
||||||
|
AK_UNEMP_EE = 0.5
|
||||||
|
|
||||||
|
def test_2020_taxes(self):
|
||||||
|
self._test_er_suta('AK', self.AK_UNEMP, date(2020, 1, 1), wage_base=self.AK_UNEMP_MAX_WAGE)
|
||||||
|
self._test_ee_suta('AK', self.AK_UNEMP_EE, date(2020, 1, 1), wage_base=self.AK_UNEMP_MAX_WAGE)
|
||||||
Reference in New Issue
Block a user