MIG l10n_us_mi_hr_payroll For Odoo 12.0 (fixed tests and validated rounding behavior)

This commit is contained in:
Jared Kipe
2019-08-28 11:43:55 -07:00
parent 0abc1a2f2d
commit c01799a51f
3 changed files with 7 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
'license': 'AGPL-3',
'category': 'Localization',
'depends': ['l10n_us_hr_payroll'],
'version': '11.0.2019.0.0',
'version': '12.0.2019.0.0',
'description': """
USA::Michigan Payroll Rules.
==================================

View File

@@ -12,7 +12,7 @@
<field name="amount_select">code</field>
<field name="amount_python_compute">
rate = payslip.dict.get_rate('US_MI_UNEMP')
year = int(payslip.dict.date_to[:4])
year = payslip.dict.date_to.year
ytd = payslip.sum('WAGE_US_MI_UNEMP', str(year) + '-01-01', str(year+1) + '-01-01')
ytd += contract.external_wages
remaining = rate.wage_limit_year - ytd

View File

@@ -21,7 +21,7 @@ class TestUsMIPayslip(TestUsPayslip):
schedule_pay = 'weekly'
exemptions = 1
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
wh = -round((salary - (allowance_amount * exemptions)) * -self.MI_INC_TAX)
wh = -((salary - (allowance_amount * exemptions)) * -self.MI_INC_TAX)
employee = self._createEmployee()
contract = self._createContract(employee,
@@ -100,7 +100,7 @@ class TestUsMIPayslip(TestUsPayslip):
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
allowances = 2
wh = -round((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
wh = -((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
employee = self._createEmployee()
contract = self._createContract(employee, salary, struct_id=self.ref(
@@ -139,7 +139,7 @@ class TestUsMIPayslip(TestUsPayslip):
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
allowances = 1
wh = -round((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
wh = -((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
employee = self._createEmployee()
contract = self._createContract(employee, salary, struct_id=self.ref(
@@ -178,7 +178,7 @@ class TestUsMIPayslip(TestUsPayslip):
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
allowances = 1
wh = -round((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
wh = -((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
employee = self._createEmployee()
contract = self._createContract(employee, salary, struct_id=self.ref(
@@ -259,7 +259,7 @@ class TestUsMIPayslip(TestUsPayslip):
additional_wh = 40.0
allowances = 1
wh = -round(((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX) + additional_wh)
wh = -(((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX) + additional_wh)
employee = self._createEmployee()
contract = self._createContract(employee,