Server Script Create for Profesional tax calculation how to do i tried not worked

Professional Tax Based on cumulative value of 6 Month Gross
To be deducted every month based on the slab that each employee crosses on that month
21,000 or less 0
Greater than 21,000 171
Greater than 30,000 428
Greater than 45,000 856
Greater than 60,000 1250
Example is given below
Gross Salary Prof Tax to be deducted
22000 171
44000 257
66000 822
How to build this logic ERP next frappe framework where to add script what script i want to add salary component i created professional tax add any formula or any i want to do?