• Resolved buptrick

    (@buptrick)


    • 0 TL – 110,000 TL: 15%
    • 110,001 TL – 230,000 TL: 20%
    • 230,001 TL – 580,000 TL: 27%
    • 580,001 TL – 3,000,000 TL: 35%
    • Above 3,000,001 TL: 40%

    can you help me create a function?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter buptrick

    (@buptrick)

    (function(){


    if (fieldname2 <= 110000) return
    fieldname2 * 0.15

    if (fieldname2 <= 230000) return
    110000 * 0.15 + (fieldname2 - 110000) * 0.20

    if (fieldname2 <= 580000) return
    110000 * 0.15 + (230000 - 110000) * 0.20 + (fieldname2 - 230000) * 0.27

    if (fieldname2 <= 3000000) return
    110000 * 0.15 + (230000 - 110000) * 0.20 + (580000 - 230000) * 0.27 + (fieldname2 - 580000) * 0.35

    if (fieldname2 > 3000000) ;
    110000 * 0.15 + (230000 - 110000) * 0.20 + (580000 - 230000) * 0.27 + (3000000 - 580000) * 0.35 + (fieldname2 - 3000000) * 0.40


    })();
    Plugin Author codepeople

    (@codepeople)

    Hello @buptrick

    Thank you very much for using our plugin. Your equation is correct. However, by using the MAX operation, you can implement the equation in one line of code without “if” conditional statements. However, as I said, your equation is correct.

    The support service does not cover the implementation of the users’ projects. However, if you need someone to implement your project or equations, you can contact us via the plugin website. Contact Us

    Best regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Progressive Tax Calculation Function’ is closed to new replies.