50% payment error

Hi i am trying to figure out the 50% payment calculation that brings the account balance up to 90% or 95% depending on the payment stage beforehand, which is dictated by project type.

This calculation is for the 'suggested payment amount' for this payment stage (50% of gross value)

if the project type is "supply and fit 2023" it needs to calculate 50% of the gross, but the total that should bring the account up to is 95% paid.

the "supply and fit" project type - is the same but 90% paid, when including the 50% payment we are discussing.

i seem to be having parenthesis issues again Disappointed

ifElse(
equal($pr_project_type_c,"supply and fit 2023"),
greaterThan(
$pr_total_paid_c,
multiply($pr_payment_gross_value_c,.95)
)
,"0",
ifElse(
greaterThan($pr_total_paid_c,multiply($pr_payment_gross_value_c,.45)),
subtract(multiply($pr_payment_gross_value_c,.95),$pr_total_paid_c),

ifElse(
equal($pr_project_type_c,"Supply and Fit"),
greaterThan($pr_total_paid_c,
multiply($pr_payment_gross_value_c,.9)
,"0",)


ifElse(
greaterThan($pr_total_paid_c,multiply($pr_payment_gross_value_c,.4)),
subtract(multiply($pr_payment_gross_value_c,.9),$pr_total_paid_c)

)
)
)

)

  • I'm not sure I fully understood the requirements and the percentages don't seem to make sense for me, anyway, find below a possible formula for your needs:

    ifElse(
        and(
            equal($pr_project_type_c,"supply and fit 2023"),
            greaterThan($pr_total_paid_c,multiply($pr_payment_gross_value_c,0.45))
        ),
        subtract(multiply($pr_payment_gross_value_c,0.95),$pr_total_paid_c),
        ifElse(
            and(
                equal($pr_project_type_c,"Supply and Fit"),
                greaterThan($pr_total_paid_c,multiply($pr_payment_gross_value_c,0.4)),
            ),
            subtract(multiply($pr_payment_gross_value_c,0.9),$pr_total_paid_c),
            0
        )
    )

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Damn this doesnt seem to achieve what we are looking for! Thank you though!