• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Objective: To calculate Sales tax on an invoice.

New Here ,
Feb 16, 2018 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

175

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
community guidelines
no replies

Have something to add?

Join the conversation