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

make a Tax Form

Guest
Jan 05, 2017 Jan 05, 2017

I am trying to make a tax form into a fill in that will calculate. The problem I'm running into is that I have to make a custom calculation script and I've never done that before. Most of the forms i have to make are very simple.

Capture.JPG

line 1E (this is the line i'm putting the script in) shows (1A-1B+1C+1D)

Sometimes line 1C can be a loss (negative number) but when calculating the taxable income you cant use a loss, only zero or positive numbers.

So i believe i'd need an if/else statement something like

if 1C is < 0 then 1A-1B+0+1D

else 1A-1B+1C+1D

I just have no idea how to put it in as the custom calculation script.

I've read thru the forum but cant find anything dealing with this.

Thank you!

TOPICS
Acrobat SDK and JavaScript , Windows
637
Translate
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 , Jan 05, 2017 Jan 05, 2017

You'll need to use a custom calculation script to do that. Something like this:

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

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

var v3 = Number(this.getField("1C").valueAsString);

if (v3<0) v3 = 0;

var v4 = Number(this.getField("1D").valueAsString);

event.value = v1-v2+v3+v4;

Translate
Community Expert ,
Jan 05, 2017 Jan 05, 2017

You'll need to use a custom calculation script to do that. Something like this:

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

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

var v3 = Number(this.getField("1C").valueAsString);

if (v3<0) v3 = 0;

var v4 = Number(this.getField("1D").valueAsString);

event.value = v1-v2+v3+v4;

Translate
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
Guest
Jan 05, 2017 Jan 05, 2017
LATEST

OMG! I COULD KISS YOU! (or pay you if you prefer lol)

That worked perfectly! Thank you sooo much!

Translate
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