Skip to main content
Participant
June 30, 2023
Answered

Taxable vs Tax Exempt

  • June 30, 2023
  • 1 reply
  • 759 views

Need to add a field or check box where the sales tax calculated can be overridden if a customer is tax-exempt. Currently, the sales tax is calculated using the value is the sum of SalesTaxRate x subtotal. This creates a problem when a customer is tax-exempt. If anyone can help me figure this out, it would be greatly appreciated.

 

Thanks!

This topic has been closed for replies.
Correct answer Critzer

Nesa,

Woohooo!!!! Thank you for your assistance. I corrected the formula to end with

event.value = 0; 

It works! Thank you so much!

1 reply

Nesa Nurani
Community Expert
Community Expert
June 30, 2023

See if this works for you:

add checkbox and give it name "tax-exempt", then use this as custom calculation script of field where you show result:

var tax = Number(this.getField("SalesTaxRate").valueAsString);
var sub = Number(this.getField("subtotal").valueAsString);
var checkTax = this.getField("tax-exempt").valueAsString;
if(checkTax === "Off")
event.value = tax*sub;
else
event.value = sub;

 

CritzerAuthor
Participant
June 30, 2023

Tried and did not succeed.

 

Added a checkbox, and added custom calculation, but when selected it shows the subtotal instead of 0 for tax-exempt, and then the grand total is adding the subtotal plus the tax-exempt field.

 

Taxable - Works Great

Subtotal 25.00

Tax 1.81

Grand Total 26.81

 

Non-Taxable outcome

Subtotal  25.00

Selected Check Box for Tax-Exempt

Tax 25.00

Grand Total 50.00

 

 

CritzerAuthorCorrect answer
Participant
June 30, 2023

Nesa,

Woohooo!!!! Thank you for your assistance. I corrected the formula to end with

event.value = 0; 

It works! Thank you so much!