Basic Salary 1 BASIC none code result = payslip.paid_amount Pension Contribution PENSION 50 none code result_rate = payslip._rule_parameter('l10n_pl_pension_employee_rate') already_taxed = payslip.search([ ('employee_id', '=', payslip.employee_id.id), ('state', 'in', ['paid', 'validated']), ('date_from', '>=', payslip.date_from + relativedelta(day=1, month=1)), ('date_to', '<=', payslip.date_from + relativedelta(day=31, months=-1)), ])._get_line_values(['BASIC'], compute_sum=True)['BASIC']['sum']['total'] cap = payslip._rule_parameter('l10n_pl_social_security_cap') if already_taxed > cap: result = categories['BASIC'] else: if cap - already_taxed < categories['BASIC']: result = categories['BASIC'] - (cap - already_taxed) else: result = categories['BASIC'] Pension Contribution (Employer) PENSION.EMPLOYER 50 none code result_rate = payslip._rule_parameter('l10n_pl_pension_employer_rate') already_taxed = payslip.search([ ('employee_id', '=', payslip.employee_id.id), ('state', 'in', ['paid', 'validated']), ('date_from', '>=', payslip.date_from + relativedelta(day=1, month=1)), ('date_to', '<=', payslip.date_from + relativedelta(day=31, months=-1)), ])._get_line_values(['BASIC'], compute_sum=True)['BASIC']['sum']['total'] cap = payslip._rule_parameter('l10n_pl_social_security_cap') if already_taxed > cap: result = categories['BASIC'] else: if cap - already_taxed < categories['BASIC']: result = categories['BASIC'] - (cap - already_taxed) else: result = categories['BASIC'] Disability Insurance Contribution DISABILITY 55 none code result_rate = payslip._rule_parameter('l10n_pl_disability_employee_rate') result = categories['BASIC'] Disability Insurance Contribution (Employer) DISABILITY.EMPLOYER 55 none code result_rate = payslip._rule_parameter('l10n_pl_disability_employer_rate') result = categories['BASIC'] Sickness Insurance Contribution SICKNESS 60 none code result_rate = payslip._rule_parameter('l10n_pl_sickness_employee_rate') result = categories['BASIC'] Accident Insurance Contribution (Employer) ACCIDENT.EMPLOYER 60 none code result_rate = payslip._rule_parameter('l10n_pl_accident_employer_rate') result = categories['BASIC'] Labour Fund and Solidarity Fund (Employer) LABOUR.EMPLOYER 65 none code result_rate = payslip._rule_parameter('l10n_pl_labour_employer_rate') result = categories['BASIC'] Social Security Total (Employee) SOCIAL.TOTAL 70 none code result = categories['SOCIAL'] Social Security Total (Employer) SOCIAL.TOTAL.EMPLOYER 70 none code result = categories['SOCIAL.EMPLOYER'] Taxable Salary 100 GROSS none code result = categories['BASIC'] + categories['ALW'] Standard Earning Costs STANDARD.EARNING 110 none code result = -payslip._rule_parameter('l10n_pl_standard_earning') Taxable Amount TAXABLE 115 none code result = categories['GROSS'] + result_rules['STANDARD.EARNING']['total'] Withholding Taxes TAX 150 none code taxable = categories['TAXABLE'] already_taxed = payslip.search([ ('employee_id', '=', payslip.employee_id.id), ('state', 'in', ['paid', 'validated']), ('date_from', '>=', payslip.date_from + relativedelta(day=1, month=1)), ('date_to', '<=', payslip.date_from + relativedelta(day=31, months=-1)), ])._get_line_values(['TAXABLE'], compute_sum=True)['TAXABLE']['sum']['total'] cap_low = payslip._rule_parameter('l10n_pl_withholding_tax_threshold_low') cap_high = payslip._rule_parameter('l10n_pl_withholding_tax_threshold_high') rate_low = payslip._rule_parameter('l10n_pl_withholding_tax_rate_low') rate_high = payslip._rule_parameter('l10n_pl_withholding_tax_rate_high') # Everything at 32% if already_taxed > cap_high: result = taxable result_rate = rate_high # Everything at 0% elif already_taxed + taxable < cap_low: result = taxable result_rate = 0 # Everything at 12% elif already_taxed >= cap_low and cap_low <= already_taxed + taxable <= cap_high: result = taxable result_rate = rate_low # Part exceeding cap_low taxed at 12% elif already_taxed <= cap_low and already_taxed + taxable <= cap_high: result = (already_taxed + taxable - cap_low) result_rate = rate_low # Part exceeding cap_high taxed at 32% + Part below cap_high taxed at 12% elif already_taxed >= cap_low and already_taxed + taxable >= cap_high: result = (already_taxed + taxable - cap_high) * rate_high / 100 + (cap_high - already_taxed) * rate_low / 100 Health Insurance Contributions HEALTH 160 none code result = categories['GROSS'] result_rate = payslip._rule_parameter('l10n_pl_health_employee_rate') Childcare relief CHILD 165 none code children = payslip.employee_id.children amounts = payslip._rule_parameter('l10n_pl_childcare_relief') if not children: result = 0 elif children == 1: result = amounts[0] elif children == 2: result = amounts[0] + amounts[1] elif children == 3: result = amounts[0] + amounts[1] + amounts[2] elif children >= 4: result = amounts[0] + amounts[1] + amounts[2] + (children - 3) * amounts[3] Attachment of Salary 174 ATTACH_SALARY python result = 'ATTACH_SALARY' in inputs code result = -inputs['ATTACH_SALARY'].amount result_name = inputs['ATTACH_SALARY'].name Assignment of Salary 174 ASSIG_SALARY python result = 'ASSIG_SALARY' in inputs code result = -inputs['ASSIG_SALARY'].amount result_name = inputs['ASSIG_SALARY'].name Child Support CHILD_SUPPORT code 174 python result = 'CHILD_SUPPORT' in inputs result = -inputs['CHILD_SUPPORT'].amount result_name = inputs['CHILD_SUPPORT'].name Deduction 198 DEDUCTION python result = 'DEDUCTION' in inputs code result = -inputs['DEDUCTION'].amount result_name = inputs['DEDUCTION'].name Reimbursement 199 REIMBURSEMENT python result = 'REIMBURSEMENT' in inputs code result = inputs['REIMBURSEMENT'].amount result_name = inputs['REIMBURSEMENT'].name Net Salary 200 NET none code result = categories['BASIC'] + categories['ALW'] + categories['DED']