Files
enterprise-addons/l10n_au_hr_payroll/tests/test_seniors_payslip.py
T

169 lines
6.0 KiB
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date
from odoo.tests import tagged
from .common import TestPayrollCommon
@tagged("post_install_l10n", "post_install", "-at_install", "l10n_au_hr_payroll")
class TestSeniorPayslip(TestPayrollCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.tax_treatment_category = 'S'
def test_senior_payslip_1(self):
employee, contract = self._create_employee(contract_info={
'employee': 'Test Employee',
'employment_basis_code': 'F',
'tfn_declaration': 'provided',
'tfn': '999999661',
'salary_sacrifice_superannuation': 200,
'salary_sacrifice_other': 100,
'workplace_giving_employee': 50,
'workplace_giving_employer': 50,
'wage_type': 'monthly',
'wage': 5000,
'casual_loading': 0,
'l10n_au_training_loan': False,
'l10n_au_tax_free_threshold': True,
'tax_treatment_option_seniors': 'S'})
self.assertEqual(employee.l10n_au_tax_treatment_code, 'SSXXXX')
self._test_payslip(
employee,
contract,
expected_worked_days=[
# (work_entry_type_id.id, number_of_day, number_of_hours, amount)
(self.work_entry_types['WORK100'].id, 23, 174.8, 5000),
],
expected_lines=[
# (code, total)
('BASIC', 5000),
('OTE', 6050),
('EXTRA', 200),
('SALARY.SACRIFICE.TOTAL', -350),
('ALW', 550),
('ALW.TAXFREE', 0),
('RTW', 300),
('SALARY.SACRIFICE.OTHER', -150),
('WORKPLACE.GIVING', -50),
('GROSS', 5650),
('WITHHOLD', -945),
('RTW.WITHHOLD', -96),
('MEDICARE', 0),
('WITHHOLD.TOTAL', -1041),
('NET', 4609),
('SUPER.CONTRIBUTION', 200),
('SUPER', 695.75),
],
input_lines=self.default_input_lines,
payslip_date_from=date(2024, 7, 1),
payslip_date_to=date(2024, 7, 31),
)
def test_senior_payslip_2(self):
employee, contract = self._create_employee(contract_info={
'employee': 'Test Employee',
'employment_basis_code': 'F',
'tfn_declaration': 'provided',
'tfn': '999999661',
'salary_sacrifice_superannuation': 200,
'salary_sacrifice_other': 100,
'workplace_giving_employee': 50,
'workplace_giving_employer': 50,
'wage_type': 'monthly',
'wage': 5000,
'casual_loading': 0,
'l10n_au_training_loan': True,
'l10n_au_tax_free_threshold': True,
'tax_treatment_option_seniors': 'M'})
self.assertEqual(employee.l10n_au_tax_treatment_code, 'SMSXXX')
self._test_payslip(
employee,
contract,
expected_worked_days=[
# (work_entry_type_id.id, number_of_day, number_of_hours, amount)
(self.work_entry_types['WORK100'].id, 23, 174.8, 5000),
],
expected_lines=[
# (code, total)
('BASIC', 5000),
('OTE', 6050),
('EXTRA', 200),
('SALARY.SACRIFICE.TOTAL', -350),
('ALW', 550),
('ALW.TAXFREE', 0),
('RTW', 300),
('SALARY.SACRIFICE.OTHER', -150),
('WORKPLACE.GIVING', -50),
('GROSS', 5650),
('WITHHOLD', -945),
('RTW.WITHHOLD', -96),
('WITHHOLD.STUDY', -143),
('MEDICARE', 0),
('WITHHOLD.TOTAL', -1184),
('NET', 4466),
('SUPER.CONTRIBUTION', 200),
('SUPER', 695.75),
],
input_lines=self.default_input_lines,
payslip_date_from=date(2024, 7, 1),
payslip_date_to=date(2024, 7, 31),
)
def test_senior_payslip_3(self):
employee, contract = self._create_employee(contract_info={
'employee': 'Test Employee',
'employment_basis_code': 'F',
'tfn_declaration': 'provided',
'tfn': '999999661',
'salary_sacrifice_superannuation': 200,
'salary_sacrifice_other': 100,
'workplace_giving_employee': 50,
'workplace_giving_employer': 50,
'wage_type': 'monthly',
'wage': 5000,
'casual_loading': 0,
'l10n_au_training_loan': False,
'l10n_au_tax_free_threshold': True,
'tax_treatment_option_seniors': 'I'})
self.assertEqual(employee.l10n_au_tax_treatment_code, 'SIXXXX')
self._test_payslip(
employee,
contract,
expected_worked_days=[
# (work_entry_type_id.id, number_of_day, number_of_hours, amount)
(self.work_entry_types['WORK100'].id, 23, 174.8, 5000),
],
expected_lines=[
# (code, total)
('BASIC', 5000),
('OTE', 6050),
('EXTRA', 200),
('SALARY.SACRIFICE.TOTAL', -350),
('ALW', 550),
('ALW.TAXFREE', 0),
('RTW', 300),
('SALARY.SACRIFICE.OTHER', -150),
('WORKPLACE.GIVING', -50),
('GROSS', 5650),
('WITHHOLD', -945),
('RTW.WITHHOLD', -96),
('MEDICARE', 0),
('WITHHOLD.TOTAL', -1041),
('NET', 4609),
('SUPER.CONTRIBUTION', 200),
('SUPER', 695.75),
],
input_lines=self.default_input_lines,
payslip_date_from=date(2024, 7, 1),
payslip_date_to=date(2024, 7, 31),
)