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

New fields added to calculable field document

New Here ,
Apr 12, 2021 Apr 12, 2021

Copy link to clipboard

Copied

Hello! I came here a few months ago to ask for help setting up a form we use everyday at work. The field was set up with a tax exempt checkbox that removes the 7.5% tax from the subtotal, and with a payout checkbox that is not included in the tax amount.

 

Beginning this Wednesday, we are adding a fuel surcharge and credit card fee to our rating system. These changes should be comprehensive & final for the forseeable future, as there are no additional charges we will be adding anytime soon. The credit card fee will be 3%, and I've set up a checkbox that, when checked, should add 3% to the subtotal pre-tax (CC Fee should be taxed, unless tax exempt checkbox is checked). I have not attempted to add or alter any existing calculable fields to these new charge fields (Fuel Surcharge & CC Fee), as I'm not sure where or how the person who made these changes for me last time did this in the calculations.

 

Thank you so much for your time and expertise in helping out 'newbs' like me! You guys really are incredible.

 

Daniel

TOPICS
Create PDFs , How to , JavaScript , PDF forms

Views

774

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

correct answers 1 Correct answer

Community Expert , Apr 14, 2021 Apr 14, 2021

Votes

Translate

Translate
Community Expert ,
Apr 12, 2021 Apr 12, 2021

Copy link to clipboard

Copied

This article explains how to create a conditional calculation:

https://acrobatusers.com/tutorials/conditional-execution/

 

You can find an example file here:

https://www.pdfscripting.com/public/Free-Sample-PDF-Files-with-scripts.cfm

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
New Here ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

Thom,

 

I read that article when I was originally creating this form, and it is very involved for my expertise. I had originally used it to create the form, and posted only to ask for help in creating a tax exempt checkbox that would not apply tax to the subtotal. The person who responded helped me tremendously, but since they did the calculations somewhere that I'm not even seeing in the form properties, I'm not sure how to even access the existing modifications they made or to add in the checkbox for the 3% credit card fee pre-tax and fuel surcharge field pre-tax... 

 

Thank you for your prompt reply.

Votes

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
Community Expert ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

The conditional calculation is in the Total field. You can see where the checkbox is used to either include the tax, or clear the tax field. It's not very well written, so I've reformatted the code here so it's easier to see.

 

if(this.getField("Check1").value != "Off"){
	this.getField("TAX").value = 0;
	event.value = sub-dsc;
}else 
    event.value = (sub+tax)-dsc;

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
Community Expert ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

I changed some calculations,but not sure if got all steps correct, see how it works now and if it need to change something:

https://drive.google.com/uc?export=download&id=166Plu9yQZ-iSPPoP6Me-QRcFmQU48p1T 

 

Votes

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
New Here ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

Nesa,

 

Thank you so much for your help. Only a couple of changes are needed:

 

  1. The fuel surcharge is taxable income, so we'll need to include that in the tax calculation unless the account is checkmarked as tax exempt.
  2. The discount field appears to adjust the grand total, but skips the other fields in between. This whole calculation needs to run from the top left to the bottom right in order to work the way we need it to, and the only field that should not be taxed (regardless of account exemption status) is the payout field, which is already excluded from tax (wooo!).

 

Again -- thanks so much for your time and help on this. This type of thing is very necessary for our dispatchers but is way above my level of expertise.

Votes

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
Community Expert ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

Votes

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
New Here ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

LATEST

It's perfect. Thanks so much Nesa! 

Votes

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