Support » Plugin: Calculated Fields Form » After evry 100000, -1500

  • Resolved sipan13

    (@sipan13)


    I am creating a monthly salary calculator. i need the following
    I need a net salary, after taxes.

    if the salary is up to 100,000, then I pay a tax of 1,500

    if the salary is up to 200,000, then I pay a tax of 3,000

    if the salary is up to 300,000, then I pay a tax of 4,500
    and so gave.

    but even if the salary is 1,000,000,000, the maximum tax I pay is 15,000

    how do i do it? Please help

    here is the full calculator i want. I want to collect a copy

    https://b24.am/salary-income-tax-calculator

    screenshot of the field I’m talking about

    https://prnt.sc/v620PgNKA8C6

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello,

    I’ll try to describe the process with a hypothetical example. Assuming the currency field is the fieldname1. And you want to emulate:

    >>>
    if the salary is up to 100,000, then I pay a tax of 1,500
    if the salary is up to 200,000, then I pay a tax of 3,000
    if the salary is up to 300,000, then I pay a tax of 4,500
    and so gave.
    but even if the salary is 1,000,000,000, the maximum tax I pay is 15,000

    You can insert a calculated field in the form, and enter the equation:

    (function(){
    if(fieldname1 <= 100000) return 1500;
    if(fieldname1 <= 200000) return 3000;
    if(fieldname1 <= 300000) return 4500;
    return 15000;
    })()

    Best regards.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.