• Resolved buptrick

    (@buptrick)


    Hello,
    First of all I want to thank you for your plugin.

    My problem is this: the worker has a “tax refund” on the wage calculation form. this changes every year. I added the ones for 2020 to the “Marital Status Information” field. But can there be an alternative choice for 2019 and 2018 to make a retrospective calculation?
    Thank you so much.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @buptrick

    I’ve visited your web page, and I see you have inserted a radio buttons field to select the year, so, I guess you have found the solution.

    Best regards.

    Thread Starter buptrick

    (@buptrick)

    Actually I couldn’t find a solution. The data in the form belongs to 2020. There must be 8 marital status information in 1 year. Likewise, if I entered 2019 to 2018, wouldn’t the form be too long?

    Thread Starter buptrick

    (@buptrick)

    for example;
    2020 TABLE 2019 TABLE
    Single 220.68 TL 191.85 TL
    Married, unemployed 264,82 TL 230.22 TL
    Married, unemployed, with 1 child 297,92 TL 259.00 TL
    Married, unemployed, with 2 children 331,03 TL 287.78 TL
    Married, unemployed, with 3 children 375,17 TL 326.15 TL
    Married, spouse working 220,68 TL 191.85 TL
    Married, spouse, 1 child 253,79 TL 220.63 TL
    Married, spouse working, with 2 children 286,89 TL 249.41 TL
    Married, spouse working, with 3 children 331.03 TL 287.78 TL
    Married, spouse working, with 4 children 353,09 TL 306.96 TL
    Married, spouse working, with 5 children 375,17 TL 326.15 TL

    Plugin Author codepeople

    (@codepeople)

    Hello @buptrick

    The equation requires some “if” conditional statements, and “IF” operations. I’ll try to describe the process with a hypothetical example:

    – Assuming the fieldname1 is a dropdown field with two options: 2020, and 2019
    – fieldname2 another dropdown field with the choices: Single and Married
    – fieldname3 dropdown field with the choices: unemployed and spouse working
    – fieldname4 dropdown field for children with the choices: 0, 1, 2, 3, 4, 5

    In this hypothetical case the equation can be implemented as follows (the equation is partial but give you the idea of its implementation):

    
    (function(){
        if(fieldname1 == 2020)
        {
            if(fieldname2 == 'Single') return 220.68;
            else
            {
                switch(fieldname4)
                {
                    case 0: return IF(fieldname3 == 'unemployed', 264.82, 220.68);
                    case 1: return IF(fieldname3 == 'unemployed', 297.92, 253.79);
                    case 2 return IF(fieldname3 == 'unemployed', 331.03, 286.89);
                    case 3: return IF(fieldname3 == 'unemployed', 375.17, 331.03);
                    case 4: if(fieldname3 == 'spouse working') return 353.09;
                }
            }
        }
        else
        {
            /** Repeat the process but this time with the values of 2019**/
        }
    })()
    

    Best regards.

    • This reply was modified 5 years ago by codepeople.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding value by years’ is closed to new replies.