diff --git a/l10n_us_ca_hr_payroll/data/rules.xml b/l10n_us_ca_hr_payroll/data/rules.xml index 9a31434f..c5e7d73c 100755 --- a/l10n_us_ca_hr_payroll/data/rules.xml +++ b/l10n_us_ca_hr_payroll/data/rules.xml @@ -15,7 +15,7 @@ ### rate = payslip.dict.get_rate('US_CA_UNEMP') -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) ytd = payslip.sum('WAGE_US_CA_UNEMP', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages remaining = rate.wage_limit_year - ytd @@ -62,7 +62,7 @@ if result_rate == 0.0: ### rate = payslip.dict.get_rate('US_CA_ETT') -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) ytd = payslip.sum('WAGE_US_CA_ETT', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages remaining = rate.wage_limit_year - ytd @@ -109,7 +109,7 @@ if result_rate == 0.0: ### rate = payslip.dict.get_rate('US_CA_SDI') -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) ytd = payslip.sum('WAGE_US_CA_SDI', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages remaining = rate.wage_limit_year - ytd @@ -154,7 +154,7 @@ if result_rate == 0.0: result = True code -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) wages = categories.GROSS allowances = contract.ca_de4_allowances additional_allowances = contract.ca_additional_allowances diff --git a/l10n_us_nc_hr_payroll/data/rules.xml b/l10n_us_nc_hr_payroll/data/rules.xml index 5771a59b..1885fe4c 100755 --- a/l10n_us_nc_hr_payroll/data/rules.xml +++ b/l10n_us_nc_hr_payroll/data/rules.xml @@ -13,7 +13,7 @@ code rate = payslip.dict.get_rate('US_NC_UNEMP') -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) ytd = payslip.sum('NC_UNEMP_WAGES_2018', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages remaining = rate.wage_limit_year - ytd diff --git a/l10n_us_nj_hr_payroll/data/rules.xml b/l10n_us_nj_hr_payroll/data/rules.xml index e0f90d6e..45b095dc 100755 --- a/l10n_us_nj_hr_payroll/data/rules.xml +++ b/l10n_us_nj_hr_payroll/data/rules.xml @@ -14,7 +14,7 @@ code ### -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) rate = payslip.dict.get_rate('ER_US_NJ_UNEMP') ytd = payslip.sum('WAGE_US_NJ_UNEMP', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages @@ -81,7 +81,7 @@ if result_rate == 0.0: code ### -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) rate = payslip.dict.get_rate('ER_US_NJ_SDI') ytd = payslip.sum('WAGE_US_NJ_SDI', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages @@ -147,7 +147,7 @@ if result_rate == 0.0: code ### -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) rate = payslip.dict.get_rate('ER_US_NJ_FLI') ytd = payslip.sum('WAGE_US_NJ_FLI', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages @@ -189,7 +189,7 @@ result = categories.BASIC code ### -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) rate = payslip.dict.get_rate('ER_US_NJ_WF') ytd = payslip.sum('WAGE_US_NJ_WF', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages diff --git a/l10n_us_oh_hr_payroll/data/rules.xml b/l10n_us_oh_hr_payroll/data/rules.xml index 372cbc54..56175d24 100755 --- a/l10n_us_oh_hr_payroll/data/rules.xml +++ b/l10n_us_oh_hr_payroll/data/rules.xml @@ -14,7 +14,7 @@ ### rate = payslip.dict.get_rate('US_OH_UNEMP') -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) ytd = payslip.sum('WAGE_US_OH_UNEMP', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages remaining = rate.wage_limit_year - ytd @@ -57,6 +57,7 @@ if result_rate == 0.0: result = True code +year = int(payslip.dict.date_to[:4]) wages = categories.GROSS allowances = contract.oh_income_allowances schedule_pay = contract.schedule_pay @@ -80,24 +81,44 @@ elif 'annually' == schedule_pay: else: raise Exception('Invalid schedule_pay="' + schedule_pay + '" for OH Income Withholding calculation') -# Algorithm from http://www.tax.ohio.gov/Portals/0/employer_withholding/August2015Rates/WTH_OptionalComputerFormula_073015.pdf -TW = (wages * PP) - (650 * allowances) -if TW <= 5000.0: - WD = ((TW * 0.005) / PP) * 1.112 -elif TW <= 10000.0: - WD = ((((TW - 5000.0) * 0.01) + 25.0) / PP) * 1.112 -elif TW <= 15000.0: - WD = ((((TW - 10000.0) * 0.02) + 75.0) / PP) * 1.112 -elif TW <= 20000.0: - WD = ((((TW - 15000.0) * 0.025) + 175.0) / PP) * 1.112 -elif TW <= 40000.0: - WD = ((((TW - 20000.0) * 0.03) + 300.0) / PP) * 1.112 -elif TW <= 80000.0: - WD = ((((TW - 40000.0) * 0.035) + 900.0) / PP) * 1.112 -elif TW <= 100000.0: - WD = ((((TW - 80000.0) * 0.04) + 2300.0) / PP) * 1.112 +# Algorithm from https://www.tax.ohio.gov/Portals/0/employer_withholding/2019%20tables/WTH_OptionalComputerFormula_2019.pdf +if year == 2018: + TW = (wages * PP) - (650 * allowances) + if TW <= 5000.0: + WD = ((TW * 0.005) / PP) * 1.112 + elif TW <= 10000.0: + WD = ((((TW - 5000.0) * 0.01) + 25.0) / PP) * 1.112 + elif TW <= 15000.0: + WD = ((((TW - 10000.0) * 0.02) + 75.0) / PP) * 1.112 + elif TW <= 20000.0: + WD = ((((TW - 15000.0) * 0.025) + 175.0) / PP) * 1.112 + elif TW <= 40000.0: + WD = ((((TW - 20000.0) * 0.03) + 300.0) / PP) * 1.112 + elif TW <= 80000.0: + WD = ((((TW - 40000.0) * 0.035) + 900.0) / PP) * 1.112 + elif TW <= 100000.0: + WD = ((((TW - 80000.0) * 0.04) + 2300.0) / PP) * 1.112 + else: + WD = ((((TW - 100000.0) * 0.05) + 3100.0) / PP) * 1.112 else: - WD = ((((TW - 100000.0) * 0.05) + 3100.0) / PP) * 1.112 + TW = (wages * PP) - (650 * allowances) + if TW <= 5000.0: + WD = ((TW * 0.005) / PP) * 1.112 + elif TW <= 10000.0: + WD = ((((TW - 5000.0) * 0.01) + 25.0) / PP) * 1.075 + elif TW <= 15000.0: + WD = ((((TW - 10000.0) * 0.02) + 75.0) / PP) * 1.075 + elif TW <= 20000.0: + WD = ((((TW - 15000.0) * 0.025) + 175.0) / PP) * 1.075 + elif TW <= 40000.0: + WD = ((((TW - 20000.0) * 0.03) + 300.0) / PP) * 1.075 + elif TW <= 80000.0: + WD = ((((TW - 40000.0) * 0.035) + 900.0) / PP) * 1.075 + elif TW <= 100000.0: + WD = ((((TW - 80000.0) * 0.04) + 2300.0) / PP) * 1.075 + else: + WD = ((((TW - 100000.0) * 0.05) + 3100.0) / PP) * 1.075 + result = -WD diff --git a/l10n_us_oh_hr_payroll/tests/test_us_oh_payslip_2019.py b/l10n_us_oh_hr_payroll/tests/test_us_oh_payslip_2019.py index ee597c5e..1687d654 100755 --- a/l10n_us_oh_hr_payroll/tests/test_us_oh_payslip_2019.py +++ b/l10n_us_oh_hr_payroll/tests/test_us_oh_payslip_2019.py @@ -17,7 +17,7 @@ class TestUsOhPayslip(TestUsPayslip): # For formula here # http://www.tax.ohio.gov/Portals/0/employer_withholding/August2015Rates/WTH_OptionalComputerFormula_073015.pdf tw = salary * 12 # = 60000 - wd = ((tw - 40000) * 0.035 + 900) / 12 * 1.112 + wd = ((tw - 40000) * 0.035 + 900) / 12 * 1.075 employee = self._createEmployee() diff --git a/l10n_us_pa_hr_payroll/data/rules.xml b/l10n_us_pa_hr_payroll/data/rules.xml index 8ea08781..3bdb8576 100755 --- a/l10n_us_pa_hr_payroll/data/rules.xml +++ b/l10n_us_pa_hr_payroll/data/rules.xml @@ -13,7 +13,7 @@ code ### -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) rate = payslip.dict.get_rate('ER_US_PA_UNEMP') ytd = payslip.sum('WAGE_ER_US_PA_UNEMP', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages diff --git a/l10n_us_tx_hr_payroll/data/rules.xml b/l10n_us_tx_hr_payroll/data/rules.xml index 9ea5b529..240ee79d 100755 --- a/l10n_us_tx_hr_payroll/data/rules.xml +++ b/l10n_us_tx_hr_payroll/data/rules.xml @@ -14,7 +14,7 @@ ### rate = payslip.dict.get_rate('US_TX_UNEMP') -year = int(payslip.dict.date_from[:4]) +year = int(payslip.dict.date_to[:4]) ytd = payslip.sum('WAGE_US_TX_UNEMP', str(year) + '-01-01', str(year+1) + '-01-01') ytd += contract.external_wages remaining = rate.wage_limit_year - ytd