AR Arkansas

This commit is contained in:
Jared Self
2021-01-07 11:42:57 -07:00
parent 33482ad3bd
commit e754b3aa2e
3 changed files with 69 additions and 105 deletions

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 TestUsARPayslip(TestUsPayslip):
# https://www.dfa.arkansas.gov/images/uploads/incomeTaxOffice/whformula.pdf Calculation based on this file.
AR_UNEMP_MAX_WAGE = 10000.00
AR_UNEMP = -3.2 / 100.0
AR_INC_TAX = -0.0535
def test_taxes_monthly(self):
salary = 2127.0
schedule_pay = 'monthly'
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('AR'),
state_income_tax_additional_withholding=0.0,
ar_ar4ec_sit_allowances=2.0,
state_income_tax_exempt=False,
schedule_pay='monthly')
self._log('2019 Arkansas tax first payslip weekly:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
# Not exempt from rule 1 or rule 2 - unemployment wages., and actual unemployment.
self.assertPayrollEqual(cats['ER_US_SUTA'], salary * self.AR_UNEMP)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_AR_UNEMP_wages = self.AR_UNEMP_MAX_WAGE - salary if (self.AR_UNEMP_MAX_WAGE - 2*salary < salary) else salary
# We reached the cap of 10000.0 in the first payslip.
self._log('2019 Arkansas 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_AR_UNEMP_wages * self.AR_UNEMP)
def test_additional_withholding(self):
salary = 5000.0
schedule_pay = 'monthly'
pay_periods = 12
allowances = 2
# TODO: comment on how it was calculated
test_ar_amt = 2598.60
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('AR'),
state_income_tax_additional_withholding=100.0,
ar_ar4ec_sit_allowances=2.0,
state_income_tax_exempt=False,
schedule_pay='monthly')
self._log('2019 Arkansas 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.AR_UNEMP)
# TODO: change to hand the test_ar_amt already be divided by pay periods
self.assertPayrollAlmostEqual(cats['EE_US_SIT'], -round(test_ar_amt / pay_periods) - 100)
process_payslip(payslip)

View File

@@ -0,0 +1,35 @@
# 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 TestUsARPayslip(TestUsPayslip):
# Taxes and Rates
AR_UNEMP_MAX_WAGE = 10000.0
AR_UNEMP = 3.2
def _test_sit(self, wage, exemptions, allowances, additional_withholding, schedule_pay, date_start, expected_withholding):
employee = self._createEmployee()
contract = self._createContract(employee,
wage=wage,
state_id=self.get_us_state('AR'),
state_income_tax_exempt=exemptions,
state_income_tax_additional_withholding=additional_withholding,
ar_ar4ec_sit_allowances=allowances,
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('AR', self.AR_UNEMP, date(2021, 1, 1), wage_base=self.AR_UNEMP_MAX_WAGE)
self._test_sit(5000.0, True, 0.0, 0, 'monthly', date(2021, 1, 1), 0.0)
self._test_sit(5000.0, False, 0.0, 0, 'monthly', date(2021, 1, 1), 220.0)
self._test_sit(700.0, False, 0.0, 150, 'weekly', date(2021, 1, 1), 175.0)
self._test_sit(7000.0, False, 2.0, 0, 'semi-monthly', date(2021, 1, 1), 395.0)
self._test_sit(3000.0, False, 1.0, 0, 'bi-weekly', date(2021, 1, 1), 141.0)