Objective: To calculate Sales tax on an invoice.

New Here ,
Feb 16, 2018

Copy link to clipboard

Copied

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); 

TOPICS
Acrobat SDK and JavaScript, Windows

Views

116

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Objective: To calculate Sales tax on an invoice.

New Here ,
Feb 16, 2018

Copy link to clipboard

Copied

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); 

TOPICS
Acrobat SDK and JavaScript, Windows

Views

117

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 16, 2018 0

Have something to add?

Join the conversation