Is it okay if I use this code snippet?
gross_salary = gross_pay
ptkp_status = employee.status_ptkp
tax_tables = {
'A': [
(5400000, 0.00), (5650000, 0.0025), (5950000, 0.0050),
(6300000, 0.0075), (6750000, 0.01), (7500000, 0.0125),
(8550000, 0.015), (9650000, 0.0175), (10050000, 0.02),
(10350000, 0.0225), (10700000, 0.025), (11050000, 0.03),
(11600000, 0.035), (12500000, 0.04), (13750000, 0.05),
(15100000, 0.06), (16950000, 0.07), (19750000, 0.08),
(24150000, 0.09), (26450000, 0.10), (28000000, 0.11),
(30050000, 0.12), (32400000, 0.13), (35400000, 0.14),
(39100000, 0.15), (43850000, 0.16), (47800000, 0.17),
(51400000, 0.18), (56300000, 0.19), (62200000, 0.20),
(68600000, 0.21), (77500000, 0.22), (89000000, 0.23),
(103000000, 0.24), (125000000, 0.25), (157000000, 0.26),
(206000000, 0.27), (337000000, 0.28), (454000000, 0.29),
(550000000, 0.30), (695000000, 0.31), (910000000, 0.32),
(1400000000, 0.33), (float('inf'), 0.34)
],
'B': [
(6200000, 0.00), (6500000, 0.0025), (6850000, 0.0050),
(7300000, 0.0075), (9200000, 0.01), (10750000, 0.015),
(11250000, 0.02), (11600000, 0.025), (12600000, 0.03),
(13600000, 0.04), (14950000, 0.05), (16400000, 0.06),
(18450000, 0.07), (21850000, 0.08), (26000000, 0.09),
(27700000, 0.10), (29350000, 0.11), (31450000, 0.12),
(33950000, 0.13), (37100000, 0.14), (41100000, 0.15),
(45800000, 0.16), (49500000, 0.17), (53800000, 0.18),
(58500000, 0.19), (64000000, 0.20), (71000000, 0.21),
(80000000, 0.22), (93000000, 0.23), (109000000, 0.24),
(129000000, 0.25), (163000000, 0.26), (211000000, 0.27),
(374000000, 0.28), (459000000, 0.29), (555000000, 0.30),
(704000000, 0.31), (957000000, 0.32), (1405000000, 0.33),
(float('inf'), 0.34)
],
'C': [
(6600000, 0.00), (6950000, 0.0025), (7350000, 0.0050),
(7800000, 0.0075), (8850000, 0.01), (9800000, 0.0125),
(10950000, 0.015), (11200000, 0.0175), (12050000, 0.02),
(12950000, 0.03), (14150000, 0.04), (15550000, 0.05),
(17050000, 0.06), (19500000, 0.07), (22700000, 0.08),
(26600000, 0.09), (28100000, 0.10), (30100000, 0.11),
(32600000, 0.12), (35400000, 0.13), (38900000, 0.14),
(43000000, 0.15), (47400000, 0.16), (51200000, 0.17),
(55800000, 0.18), (60400000, 0.19), (66700000, 0.20),
(74500000, 0.21), (83200000, 0.22), (95600000, 0.23),
(110000000, 0.24), (134000000, 0.25), (169000000, 0.26),
(221000000, 0.27), (390000000, 0.28), (463000000, 0.29),
(561000000, 0.30), (709000000, 0.31), (965000000, 0.32),
(1419000000, 0.33), (float('inf'), 0.34)
]
}
ter_rate = 0.0
if ptkp_status in ['TK/0', 'TK/1', 'K/0']:
category = 'A'
elif ptkp_status in ['TK/2', 'TK/3', 'K/1', 'K/2']:
category = 'B'
elif ptkp_status == 'K/3':
category = 'C'
else:
return 0.0
for upper_bound, rate in tax_tables[category]:
if gross_salary <= upper_bound:
ter_rate = rate
break
return (gross_salary * ter_rate) * -1
On formula in Salary Component. This formula for my tax calculation has me quite confused in frappe