Files
enterprise-addons/l10n_pk_hr_payroll/models/hr_payslip.py
T

21 lines
612 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class HrPayslip(models.Model):
_inherit = "hr.payslip"
def _l10n_pk_get_tax(self, income):
self.ensure_one()
result = 0
tax_brackets = list(iter(self._rule_parameter('l10n_pk_tax_brackets')))
for i, (low, high, rate, fix) in enumerate(tax_brackets):
if income > low:
if income <= high:
result += rate * (income - low)
break
else:
result = fix
return result