mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
MIG l10n_us_mi_hr_payroll For Odoo 12.0 (fixed tests and validated rounding behavior)
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'category': 'Localization',
|
'category': 'Localization',
|
||||||
'depends': ['l10n_us_hr_payroll'],
|
'depends': ['l10n_us_hr_payroll'],
|
||||||
'version': '11.0.2019.0.0',
|
'version': '12.0.2019.0.0',
|
||||||
'description': """
|
'description': """
|
||||||
USA::Michigan Payroll Rules.
|
USA::Michigan Payroll Rules.
|
||||||
==================================
|
==================================
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<field name="amount_select">code</field>
|
<field name="amount_select">code</field>
|
||||||
<field name="amount_python_compute">
|
<field name="amount_python_compute">
|
||||||
rate = payslip.dict.get_rate('US_MI_UNEMP')
|
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 = payslip.sum('WAGE_US_MI_UNEMP', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||||
ytd += contract.external_wages
|
ytd += contract.external_wages
|
||||||
remaining = rate.wage_limit_year - ytd
|
remaining = rate.wage_limit_year - ytd
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class TestUsMIPayslip(TestUsPayslip):
|
|||||||
schedule_pay = 'weekly'
|
schedule_pay = 'weekly'
|
||||||
exemptions = 1
|
exemptions = 1
|
||||||
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
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()
|
employee = self._createEmployee()
|
||||||
contract = self._createContract(employee,
|
contract = self._createContract(employee,
|
||||||
@@ -100,7 +100,7 @@ class TestUsMIPayslip(TestUsPayslip):
|
|||||||
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
||||||
allowances = 2
|
allowances = 2
|
||||||
|
|
||||||
wh = -round((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
|
wh = -((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
|
||||||
|
|
||||||
employee = self._createEmployee()
|
employee = self._createEmployee()
|
||||||
contract = self._createContract(employee, salary, struct_id=self.ref(
|
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]
|
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
||||||
allowances = 1
|
allowances = 1
|
||||||
|
|
||||||
wh = -round((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
|
wh = -((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
|
||||||
|
|
||||||
employee = self._createEmployee()
|
employee = self._createEmployee()
|
||||||
contract = self._createContract(employee, salary, struct_id=self.ref(
|
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]
|
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
||||||
allowances = 1
|
allowances = 1
|
||||||
|
|
||||||
wh = -round((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
|
wh = -((salary - (allowance_amount * allowances)) * -self.MI_INC_TAX)
|
||||||
|
|
||||||
employee = self._createEmployee()
|
employee = self._createEmployee()
|
||||||
contract = self._createContract(employee, salary, struct_id=self.ref(
|
contract = self._createContract(employee, salary, struct_id=self.ref(
|
||||||
@@ -259,7 +259,7 @@ class TestUsMIPayslip(TestUsPayslip):
|
|||||||
additional_wh = 40.0
|
additional_wh = 40.0
|
||||||
allowances = 1
|
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()
|
employee = self._createEmployee()
|
||||||
contract = self._createContract(employee,
|
contract = self._createContract(employee,
|
||||||
|
|||||||
Reference in New Issue
Block a user