Skip to main content
meaghank0819
Participant
October 26, 2017
Question

Variable Tax Rates

  • October 26, 2017
  • 1 reply
  • 252 views

I am working on creating a PDF Contract. We do business in three different states and the products we sell have variable tax rates on top of that. I want to create 1 contract that allows the user to select from a drop down the type of tax rate that should be calculated and run the script calculating the appropriate tax rate based on that selection.....

Example:
I sell apples, oranges, lemons and bananas in FL, CA & GA


In GA there is no State Tax on A, O or L, but there is a city Tax
In GA there is a State & City Tax on B

In CA there is state tax on O, L & B
In CA there is no tax on A

In FL there is no tax on any of our items

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
October 26, 2017

You can create a (hidden) text field for the tax rate with a custom calculation script that looks something like this:

event.value = "";

var state = this.getField("State").valueAsString;

var product = this.getField("Product").valueAsString;

if (state=="FL") event.value = 0;

else if (state=="GA") {

    if (product=="Apples") event.value = 0.14;

    else if (product=="Oranges" || product=="Lemons") event.value = 0;

    else if (product=="Bananas") event.value = 0.05;

} else if (state=="CA") {

     // etc.

}

Then you can use that Tax Rate field in the rest of your calculations.