From 0e7828151d4fc833b7231ca57f510f6a94ac9cd7 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Thu, 3 May 2018 11:02:40 +0200 Subject: [PATCH] [IMP] l10n_be_hr_payroll: Introduce a new 'Intellectual Property' advantage Intellectual property rights guarantee their holders a temporary and territorially restricted, exclusive exploitation of their intellectual property. This monopoly stimulates innovations that are indispensable for economic growth, but can go against the right of free competition which is indispensable for the free market economy. --- .../data/l10n_be_hr_payroll_data.xml | 72 ++++++++++++++++++- .../models/l10n_be_hr_payroll.py | 7 ++ .../views/l10n_be_hr_payroll_view.xml | 7 ++ 3 files changed, 85 insertions(+), 1 deletion(-) diff --git a/addons/l10n_be_hr_payroll/data/l10n_be_hr_payroll_data.xml b/addons/l10n_be_hr_payroll/data/l10n_be_hr_payroll_data.xml index 6920f154d9d..0a615069d47 100644 --- a/addons/l10n_be_hr_payroll/data/l10n_be_hr_payroll_data.xml +++ b/addons/l10n_be_hr_payroll/data/l10n_be_hr_payroll_data.xml @@ -84,6 +84,18 @@ SSC + + + IP. Part. + IP. PART + + + + + Total Gross + GROSSIP + + @@ -152,6 +164,33 @@ elif salary <= 2510.47: result = 213.48 - (0.2369 * (salary - 1609.47)) + + + Total Gross + 90 + GROSSIP + + python + result = bool(contract.ip) + code + result = categories.BASIC + categories.ALW + + + + + Intellectual Property + IP.PART + 91 + python + +result = bool(contract.ip) + + code + +result = - categories.GROSSIP * contract.ip_wage_rate / 100.0 + + + Special social cotisation @@ -500,6 +539,34 @@ result = -contract.car_atn result = bool(contract.representation_fees) result = contract.representation_fees + + + Intellectual Property + IP + code + 172 + python + result = bool(contract.ip) + result = categories.GROSSIP * contract.ip_wage_rate / 100.0 + + + + Intellectual Property Income Deduction + IP.DED + code + 173 + python + result = bool(contract.ip) + +tax_rate = 0.15 +ip_amount = categories.GROSSIP * contract.ip_wage_rate / 100.0 +if ip_amount >= 0.0 and ip_amount <= 15660: + tax_rate = tax_rate / 2.0 +elif ip_amount > 15660 and ip_amount <=31320: + tax_rate = tax_rate * 3.0 / 4.0 +result = -min(ip_amount * tax_rate, 11745) + + Net Supplement @@ -546,7 +613,10 @@ result = -contract.car_atn ref('hr_payroll_rules_suppl_net'), ref('hr_payroll_rules_retained_net'), ref('hr_salary_rule_pp_reduction_employees'), - + ref('hr_salary_rule_ip'), + ref('hr_salary_rule_ip_deduction'), + ref('hr_salary_rule_ip_part'), + ref('hr_salary_rule_gross_with_ip') ])]" name="rule_ids"/> diff --git a/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py b/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py index cf9901281c5..00a3af4d803 100644 --- a/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py +++ b/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py @@ -85,6 +85,13 @@ class HrContract(models.Model): eco_checks = fields.Monetary("Eco Vouchers", default=lambda self: self.get_attribute('eco_checks', 'default_value'), help="Yearly amount the employee receives in the form of eco vouchers.") + ip = fields.Boolean(default=False, track_visibility="onchange") + ip_wage_rate = fields.Float(string="IP percentage", help="Should be between 0 and 100 %") + + @api.constrains('ip_wage_rate') + def _check_ip_wage_rate(self): + if self.filtered(lambda contract: contract.ip_wage_rate < 0 or contract.ip_wage_rate > 100): + raise ValidationError(_('The IP rate on wage should be between 0 and 100')) @api.depends('holidays', 'wage', 'final_yearly_costs') def _compute_wage_with_holidays(self): diff --git a/addons/l10n_be_hr_payroll/views/l10n_be_hr_payroll_view.xml b/addons/l10n_be_hr_payroll/views/l10n_be_hr_payroll_view.xml index 4111ab06878..642a87ef3c5 100644 --- a/addons/l10n_be_hr_payroll/views/l10n_be_hr_payroll_view.xml +++ b/addons/l10n_be_hr_payroll/views/l10n_be_hr_payroll_view.xml @@ -117,6 +117,13 @@ + + +