AZ Arizona todo: Income Tax not calculated

This commit is contained in:
Jared Self
2021-01-07 09:35:26 -07:00
parent 8b184e6fa3
commit 55babb7b3f
3 changed files with 40 additions and 82 deletions

View File

@@ -7,11 +7,8 @@
<field name="country_id" ref="base.us"/>
</record>
<data noupdate="1">
<record id="rule_parameter_us_az_suta_wage_base_2019" model="hr.rule.parameter.value">
<field name="parameter_value">7000.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_az_suta_wage_base"/>
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
</record>
<!-- page 7 https://des.az.gov/sites/default/files/legacy/dl/UIB-1240A.pdf?time=1610036751652-->
<!-- no change in 2021-->
<record id="rule_parameter_us_az_suta_wage_base_2020" model="hr.rule.parameter.value">
<field name="parameter_value">7000.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_az_suta_wage_base"/>
@@ -26,11 +23,8 @@
<field name="country_id" ref="base.us"/>
</record>
<data noupdate="1">
<record id="rule_parameter_us_az_suta_rate_2019" model="hr.rule.parameter.value">
<field name="parameter_value">2.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_az_suta_rate"/>
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
</record>
<!-- unchanged for 2021-->
<!-- https://des.az.gov/services/employment/unemployment-employer/employment-taxes-calculating-unemployment-taxes-->
<record id="rule_parameter_us_az_suta_rate_2020" model="hr.rule.parameter.value">
<field name="parameter_value">2.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_az_suta_rate"/>
@@ -38,6 +32,8 @@
</record>
</data>
<!-- todo: income tax https://azdor.gov/forms/individual/form-140-x-y-tables-->
<!-- Partners and Contribution Registers -->
<record id="res_partner_us_az_dor" model="res.partner">
<field name="name">US Arizona - Department of Economic Security (ADES) - Unemployment Tax</field>

View File

@@ -1,72 +0,0 @@
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from .common import TestUsPayslip, process_payslip
class TestUsAZPayslip(TestUsPayslip):
# TAXES AND RATES
AZ_UNEMP_MAX_WAGE = 7000.00
AZ_UNEMP = -(2.00 / 100.0)
def test_taxes_with_additional_wh(self):
salary = 15000.00
schedule_pay = 'weekly'
withholding_percentage = 5.1
percent_wh = (5.10 / 100) # 5.1%
additional_wh = 12.50
wh_to_test = -((percent_wh * salary) + additional_wh)
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('AZ'),
state_income_tax_additional_withholding=12.50,
az_a4_sit_withholding_percentage=withholding_percentage,
schedule_pay=schedule_pay)
self._log('2019 Arizona 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'], self.AZ_UNEMP_MAX_WAGE * self.AZ_UNEMP)
self.assertPayrollEqual(cats['EE_US_SIT'], wh_to_test)
process_payslip(payslip)
remaining_AZ_UNEMP_wages = 0.0 # We already reached max unemployment wages.
self._log('2019 Arizona tax second payslip weekly:')
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['ER_US_SUTA'], remaining_AZ_UNEMP_wages * self.AZ_UNEMP)
def test_taxes_monthly(self):
salary = 1000.00
schedule_pay = 'monthly'
withholding_percentage = 2.7
percent_wh = (2.70 / 100) # 2.7%
additional_wh = 0.0
wh_to_test = -((percent_wh * salary) + additional_wh)
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('AZ'),
state_income_tax_additional_withholding=0.0,
az_a4_sit_withholding_percentage=withholding_percentage,
schedule_pay=schedule_pay)
self._log('2019 Arizona 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'], salary * self.AZ_UNEMP)
self.assertPayrollEqual(cats['EE_US_SIT'], wh_to_test)
process_payslip(payslip)

View File

@@ -0,0 +1,34 @@
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from datetime import date, timedelta
from .common import TestUsPayslip
class TestUsAZPayslip(TestUsPayslip):
# Taxes and Rates
AZ_UNEMP_MAX_WAGE = 7000.0
AZ_UNEMP = 2.0
def _test_sit(self, wage, additional_withholding, withholding_percent, schedule_pay, date_start, expected_withholding):
employee = self._createEmployee()
contract = self._createContract(employee,
wage=wage,
state_id=self.get_us_state('AZ'),
state_income_tax_additional_withholding=additional_withholding,
az_a4_sit_withholding_percentage=withholding_percent,
schedule_pay=schedule_pay)
payslip = self._createPayslip(employee, date_start, date_start + timedelta(days=7))
payslip.compute_sheet()
cats = self._getCategories(payslip)
self._log('Computed period tax: ' + str(expected_withholding))
self.assertPayrollEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding)
def test_2021_taxes_example(self):
self._test_er_suta('AZ', self.AZ_UNEMP, date(2021, 1, 1), wage_base=self.AZ_UNEMP_MAX_WAGE)
self._test_sit(1000.0, 0.0, 2.70, 'monthly', date(2021, 1, 1), 27.0)
self._test_sit(1000.0, 10.0, 2.70, 'monthly', date(2021, 1, 1), 37.0)
self._test_sit(15000.0, 0.0, 3.60, 'weekly', date(2021, 1, 1), 540.0)
self._test_sit(8000.0, 0.0, 4.20, 'semi-monthly', date(2021, 1, 1), 336.0)
self._test_sit(8000.0, 0.0, 0.00, 'semi-monthly', date(2021, 1, 1), 0.0)