diff --git a/l10n_us_hr_payroll_401k/__init__.py b/l10n_us_hr_payroll_401k/__init__.py deleted file mode 100644 index 09434554..00000000 --- a/l10n_us_hr_payroll_401k/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from . import models diff --git a/l10n_us_hr_payroll_401k/__manifest__.py b/l10n_us_hr_payroll_401k/__manifest__.py deleted file mode 100644 index 525e3cca..00000000 --- a/l10n_us_hr_payroll_401k/__manifest__.py +++ /dev/null @@ -1,25 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -{ - 'name': 'USA - 401K Payroll', - 'author': 'Hibou Corp. ', - 'version': '15.0.1.0.0', - 'category': 'Payroll', - 'depends': [ - 'l10n_us_hr_payroll', - ], - 'description': """ -* Adds fields to HR Contract for amount or percentage to withhold for retirement savings. -* Adds rules to withhold and have a company match. - """, - - 'data': [ - 'data/payroll.xml', - 'views/contract_views.xml', - 'views/payroll_views.xml', - ], - 'demo': [ - ], - 'auto_install': False, - 'license': 'OPL-1', -} diff --git a/l10n_us_hr_payroll_401k/data/payroll.xml b/l10n_us_hr_payroll_401k/data/payroll.xml deleted file mode 100644 index 24b7e10c..00000000 --- a/l10n_us_hr_payroll_401k/data/payroll.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - IRA Provider - 1 - - - - - Employee 401K Contribution Limit - ee_401k_contribution_limit - - - - 19500.0 - - - - - - Employee 401K Catch-up - ee_401k_catchup - - - - 6500.0 - - - - - - Employer 401K Contribution Limit - er_401k_contribution_limit - - - - 37500.0 - - - - - - Employer 401K Match (%) - er_401k_match_percent - - - - - 0.0 - - - - - - - - EE: 401K Traditional - EE_IRA - - - - EE: 401K Roth - EE_IRA_ROTH - - - - - ER: 401K Contribution - ER_IRA - - - - - - - - - EE: 401K - EE_IRA - python - result = ee_401k(contract.ira_amount, contract.ira_rate, payslip, categories, worked_days, inputs) - code - result = ee_401k(contract.ira_amount, contract.ira_rate, payslip, categories, worked_days, inputs) - - - - - - - - - EE: 401K Roth - EE_IRA_ROTH - python - result = ee_401k(contract.ira_roth_amount, contract.ira_roth_rate, payslip, categories, worked_days, inputs) - code - result = ee_401k(contract.ira_roth_amount, contract.ira_roth_rate, payslip, categories, worked_days, inputs) - - - - - - - - - ER: 401K Match - ER_IRA_MATCH - python - result = er_401k_match(categories.BASIC, payslip, categories, worked_days, inputs) - code - result = er_401k_match(categories.BASIC, payslip, categories, worked_days, inputs) - - - - - - \ No newline at end of file diff --git a/l10n_us_hr_payroll_401k/i18n/es.po b/l10n_us_hr_payroll_401k/i18n/es.po deleted file mode 100644 index 0bac0541..00000000 --- a/l10n_us_hr_payroll_401k/i18n/es.po +++ /dev/null @@ -1,102 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * l10n_us_hr_payroll_401k -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.0+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-12 01:34+0000\n" -"PO-Revision-Date: 2021-10-12 01:34+0000\n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: l10n_us_hr_payroll_401k -#: model_terms:ir.ui.view,arch_db:l10n_us_hr_payroll_401k.hr_contract_view_form_inherit -msgid "401K" -msgstr "401K" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model.fields,field_description:l10n_us_hr_payroll_401k.field_hr_contract__ira_rate -msgid "401K Contribution (%)" -msgstr "Contribución (%) de 401K" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model.fields,field_description:l10n_us_hr_payroll_401k.field_hr_contract__ira_amount -msgid "401K Contribution Amount" -msgstr "Monto de Contribución de 401K" - -#. module: l10n_us_hr_payroll_401k -#: model:hr.salary.rule,name:l10n_us_hr_payroll_401k.rule_ee_ira -msgid "EE: 401K" -msgstr "EE: 401K" - -#. module: l10n_us_hr_payroll_401k -#: model:hr.salary.rule,name:l10n_us_hr_payroll_401k.rule_ee_ira_roth -#: model:hr.salary.rule.category,name:l10n_us_hr_payroll_401k.category_ee_401k_roth -msgid "EE: 401K Roth" -msgstr "EE: 401K Roth" - -#. module: l10n_us_hr_payroll_401k -#: model:hr.salary.rule.category,name:l10n_us_hr_payroll_401k.category_ee_401k_traditional -msgid "EE: 401K Traditional" -msgstr "EE: 401K Tradicional" - -#. module: l10n_us_hr_payroll_401k -#: model:hr.salary.rule.category,name:l10n_us_hr_payroll_401k.category_er_401k -msgid "ER: 401K Contribution" -msgstr "ER: 401K Contribución" - -#. module: l10n_us_hr_payroll_401k -#: model:hr.salary.rule,name:l10n_us_hr_payroll_401k.rule_er_ira -msgid "ER: 401K Match" -msgstr "ER: 401K Aportación Paralela" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model,name:l10n_us_hr_payroll_401k.model_hr_contract -msgid "Employee Contract" -msgstr "Contrato del empleado" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model,name:l10n_us_hr_payroll_401k.model_hr_payslip -msgid "Pay Slip" -msgstr "Recibo de nómina" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model.fields,help:l10n_us_hr_payroll_401k.field_hr_contract__ira_roth_amount -msgid "Post-Tax Contribution Amount" -msgstr "Monto de contribución tras impuestos" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model.fields,help:l10n_us_hr_payroll_401k.field_hr_contract__ira_roth_rate -msgid "Post-Tax Contribution Percentage" -msgstr "Porcentaje de contribución tras impuestos" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model.fields,help:l10n_us_hr_payroll_401k.field_hr_contract__ira_amount -msgid "Pre-Tax (traditional) Contribution Amount" -msgstr "Monto de contribución pre impuestos (tradicional)" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model.fields,help:l10n_us_hr_payroll_401k.field_hr_contract__ira_rate -msgid "Pre-Tax (traditional) Contribution Percentage" -msgstr "Porcentaje de contribución pre impuestos (Tradicional)" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model.fields,field_description:l10n_us_hr_payroll_401k.field_hr_contract__ira_roth_rate -msgid "Roth 401K Contribution (%)" -msgstr "Contribución (%) de Roth 401K" - -#. module: l10n_us_hr_payroll_401k -#: model:ir.model.fields,field_description:l10n_us_hr_payroll_401k.field_hr_contract__ira_roth_amount -msgid "Roth 401K Contribution Amount" -msgstr "Monto de Contribución de Roth 401K" - -#. module: l10n_us_hr_payroll_401k -#: model_terms:ir.ui.view,arch_db:l10n_us_hr_payroll_401k.hr_rule_parameter_view_search_inherit -msgid "US Payroll 401k" -msgstr "Nómina de EE.UU 401K" diff --git a/l10n_us_hr_payroll_401k/migrations/13.0.0.0.1/pre-migration.py b/l10n_us_hr_payroll_401k/migrations/13.0.0.0.1/pre-migration.py deleted file mode 100644 index 0d6b8ea7..00000000 --- a/l10n_us_hr_payroll_401k/migrations/13.0.0.0.1/pre-migration.py +++ /dev/null @@ -1,22 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -import odoo - - -def migrate(cr, version): - """ - Salary Rules can be archived by Odoo S.A. during migration. - This leaves them archived after the migration, and even un-archiving them - is not enough because they will then be pointed to a "migrated" structure. - """ - env = odoo.api.Environment(cr, odoo.SUPERUSER_ID, {}) - xml_refs = env['ir.model.data'].search([ - ('module', '=', 'l10n_us_hr_payroll_401k'), - ('model', '=', 'hr.salary.rule'), - ]) - # I don't know why Odoo makes these non-updatable... - xml_refs.write({'noupdate': False}) - - rule_ids = xml_refs.mapped('res_id') - rules = env['hr.salary.rule'].browse(rule_ids) - rules.write({'active': True}) diff --git a/l10n_us_hr_payroll_401k/models/__init__.py b/l10n_us_hr_payroll_401k/models/__init__.py deleted file mode 100644 index 33d3566a..00000000 --- a/l10n_us_hr_payroll_401k/models/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from . import contract -from . import payslip -from . import update diff --git a/l10n_us_hr_payroll_401k/models/contract.py b/l10n_us_hr_payroll_401k/models/contract.py deleted file mode 100644 index 5ce008a9..00000000 --- a/l10n_us_hr_payroll_401k/models/contract.py +++ /dev/null @@ -1,21 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from odoo import fields, models - - -class HRContract(models.Model): - _inherit = 'hr.contract' - - ira_amount = fields.Float(string="401K Contribution Amount", - help="Pre-Tax (traditional) Contribution Amount") - ira_rate = fields.Float(string="401K Contribution (%)", - help="Pre-Tax (traditional) Contribution Percentage") - ira_roth_amount = fields.Float(string="Roth 401K Contribution Amount", - help="Post-Tax Contribution Amount") - ira_roth_rate = fields.Float(string="Roth 401K Contribution (%)", - help="Post-Tax Contribution Percentage") - - def company_401k_match_percent(self, payslip): - # payslip is payslip rule's current payslip browse object - # Override if you have employee, payslip, or contract differences. - return payslip.rule_parameter('er_401k_match_percent') diff --git a/l10n_us_hr_payroll_401k/models/payslip.py b/l10n_us_hr_payroll_401k/models/payslip.py deleted file mode 100644 index fc596777..00000000 --- a/l10n_us_hr_payroll_401k/models/payslip.py +++ /dev/null @@ -1,83 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from datetime import date -from odoo import fields, models - - -def ee_401k(amount, rate, payslip, categories, worked_days, inputs): - MAX = payslip.rule_parameter('ee_401k_contribution_limit') - if payslip.dict.ira_period_age() >= 50: - MAX += payslip.rule_parameter('ee_401k_catchup') - wages = categories.BASIC - year = payslip.date_to.year - next_year = str(year + 1) - from_ = str(year) + '-01-01' - to = next_year + '-01-01' - ytd = payslip.sum_category('EE_IRA', from_, to) - ytd += payslip.sum_category('EE_IRA_ROTH', from_, to) - remaining = MAX + ytd - if remaining <= 0.0: - result = 0 - else: - result = -amount - result -= (wages * rate) / 100.0 - if remaining + result <= 0.0: - result = -remaining - return result - - -def er_401k_match(wages, payslip, categories, worked_days, inputs): - MAX = payslip.rule_parameter('er_401k_contribution_limit') - employee_contrib = -(categories.EE_IRA + categories.EE_IRA_ROTH) - - year = payslip.date_to.year - next_year = str(year + 1) - from_ = str(year) + '-01-01' - to = next_year + '-01-01' - ytd = payslip.sum_category('ER_IRA', from_, to) - - rate = payslip.contract_id.company_401k_match_percent(payslip) - wages_match = (wages * rate) / 100.0 - if employee_contrib <= wages_match: - result = employee_contrib - else: - result = wages_match - remaining = MAX - ytd - if remaining <= 0.0: - result = 0 - else: - if remaining - result < 0.0: - result = remaining - return -result - - -class HRPayslip(models.Model): - _inherit = 'hr.payslip' - - def _age_on_date(self, birthday, cutoff): - if isinstance(cutoff, str): - try: - cutoff = fields.Date.from_string(cutoff) - except: - cutoff = None - if cutoff is None: - # Dec. 31st in calendar year - cutoff = date(self.date_to.year, 12, 31) - if not birthday: - return -1 - years = cutoff.year - birthday.year - if birthday.month > cutoff.month or (birthday.month == cutoff.month and birthday.day > cutoff.day): - years -= 1 - return years - - def ira_period_age(self, cutoff=None): - birthday = self.employee_id.birthday - return self._age_on_date(birthday, cutoff) - - def _get_base_local_dict(self): - res = super()._get_base_local_dict() - res.update({ - 'ee_401k': ee_401k, - 'er_401k_match': er_401k_match, - }) - return res diff --git a/l10n_us_hr_payroll_401k/models/update.py b/l10n_us_hr_payroll_401k/models/update.py deleted file mode 100644 index a83ca8ff..00000000 --- a/l10n_us_hr_payroll_401k/models/update.py +++ /dev/null @@ -1,13 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from odoo import api, models - - -class PublisherWarrantyContract(models.AbstractModel): - _inherit = 'publisher_warranty.contract' - - @api.model - def hibou_payroll_modules_to_update(self): - res = super().hibou_payroll_modules_to_update() - res.append('l10n_us_hr_payroll_401k') - return res diff --git a/l10n_us_hr_payroll_401k/tests/__init__.py b/l10n_us_hr_payroll_401k/tests/__init__.py deleted file mode 100644 index 61e587fa..00000000 --- a/l10n_us_hr_payroll_401k/tests/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -# Moved to l10n_us_hr_payroll_401k_params diff --git a/l10n_us_hr_payroll_401k/views/contract_views.xml b/l10n_us_hr_payroll_401k/views/contract_views.xml deleted file mode 100644 index a2a2bd25..00000000 --- a/l10n_us_hr_payroll_401k/views/contract_views.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - hr.contract.form.inherit - hr.contract - - - - - - - - - - - - - - \ No newline at end of file diff --git a/l10n_us_hr_payroll_401k/views/payroll_views.xml b/l10n_us_hr_payroll_401k/views/payroll_views.xml deleted file mode 100644 index d89d89f9..00000000 --- a/l10n_us_hr_payroll_401k/views/payroll_views.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - hr.rule.parameter.search.inherit - hr.rule.parameter - - - - - - - - - \ No newline at end of file