Skip to main content
jprainBPS
Participant
February 17, 2018
Question

Objective: To calculate Sales tax on an invoice.

  • February 17, 2018
  • 0 replies
  • 203 views

I have a list of taxable goods each with a price:

VehiclePrice 10,000.00

Delivery     90.00

Prep    195.00

Freight    110.00

DocFees    210.00

Total_Taxable_Items 10,605.00

I need Java PDFScript for sales tax at 6%. Is the one below correct?

var v1 = Number(this.getField("TotalTaxableItems").valueAsString);

event.value = (v1*.06); 

Next... if I wanted to allow for a variable Tax Rate percentage (different state taxes) would this script be correct? 
The objective would be to type in the Tax rate and have it calculate the correct amount.


var v1 = Number(this.getField("TotalTaxableItems").valueAsString);

var v2 = Number(this.getField("Tax_Rate").valueAsString); 

event.value = (v1*v2); 

This topic has been closed for replies.