Payroll Issue - Tax and Payslip

Hello,

As per Mauritian Payroll Rule, an employee should receive 13 payslips in a year (for e.g pay period: 01 July 2023 till 30 June 2024). Employee will receive 1 payslip with EOY Bonus and deductions related to the EOY Bonus and at the end of same month the latter will receive normal payslip containing his salary details:

Number of work days = 26 per month excluding Sundays

Tax Rules (Yearly amounts for 13 month for the defined 12 month period (01 July 2023 till 30 June 2024)):

Amount From Amount To Tax Rate (%)
0 390000 0
390001 430000 2
430001 470000 4
470001 530000 6
530001 590000 8
590001 890000 10
890001 1190000 12
1190001 1490000 14
1490001 1890000 16
1890001 2390000 18
2390001 > 20

Note that we are using the standard ERPNEXT and no customization has been done on the system.

Salary structure is defined and assigned to employee

Generating salary for Employee in ERPNEXT, we see that tax is wrongly calculated. Correct tax value should be 1442, but erpnext is providing 1133

Manual calculation is as follows:

Tax Rate Amount From Amount To Bracket Sum Bracket (Chargeable Income - bracket Amount) >0 Tax Amount
390000 0 0 30000 30000.00 21500 0
430000 0.02 30000 33076.92308 3076.92 3076.92 18423.0769230769 61.538
470000 0.04 33076.92308 36153.84615 3076.92 6153.85 15346.1538461538 123.077
530000 0.06 36153.84615 40769.23077 4615.38 10769.23 10730.7692307692 276.923
590000 0.08 40769.23077 45384.61538 4615.38 15384.62 6115.3846153846 369.231
890000 0.1 45384.61538 68461.53846 23076.92 38461.54 -16961.5384615385 611.538
1190000 0.12 68461.53846 91538.46154 23076.92 61538.46
1490000 0.14 91538.46154 114615.3846 23076.92 84615.38
1890000 0.16 114615.3846 145384.6154 30769.23 115384.62
2390000 0.18 145384.6154 183846.1538 38461.54 153846.15
> 0.2 183846.1538
Total Tax - PAYE 1442.308

Concerns:

1. How can we achieve the correct tax value
2. When leave without pay is introduced, the tax value gets even worse
3. How to generate 2 payslips in one month for each employee (1 Payslip for EOY Bonus and other is normal Payslip)