I have a tax document that needs to compare 2 numbers, the amount of tax and the amount of payments made.
If the the tax amount is larger than the payment amount, I need to have that number (the difference of the 2 numbers) show up in one field (taxdue). And I need to make the second field (overpayment) blank or a zero.
If the payment amount is larger than the tax amount, I need to have the difference show up in the second field (overpayment) and the first field (taxdue) needs to be blank or zero.
after reading a couple of posts, i think I need something like this.
var v1 = +getField("tax").value;
var v2 = +getField("payment").value;
//need some kind of calculation here I think to determine difference.
// then can compare the 2 numbers
if (v1 > v2) event.value("taxdue") = difference and event.value("overpayment")=0;
else if (v1 === v2) event.value('taxdue") = 0 and event.value("overpayment")=0
else if (v1 < v2) event.value("overpayment") = difference and event.value(:taxdue")=0
can you help me
thanks
And the following custom calculation script for the refund/overpayment field:
George Kaiser