Copy link to clipboard
Copied
Attached is a link to the photos of my invoice form. I have the following columns:
Q=QTY.
$=$
DISC1=DISCT.
SUB=SUBTOTAL
I would like the subtotal to accurately calculate from the corresponding row values. Essentially the calculation of (Q1*$1)-(DISC1/100) so that the discount column presents as 35% instead of .35 when I present it to clients.
Then, how do I code SUBTOTAL as empty when the corresponding rows are empty.
thank you! those articles in conjuction were perfect for my puzzle. I ended up with this:
event.value = (this.getField('Q1').value && this.getField('$1').value && this.getField('DISC1').value) ? ((this.getField('Q1').value*this.getField('$1').value)-(this.getField('DISC1').value/100)) : "";
Copy link to clipboard
Copied
is the link to the photos
Copy link to clipboard
Copied
This is a good starting point for this task: https://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations
Copy link to clipboard
Copied
I found that article on my search before posting, but I need a custom calculation script in order to get the SUB=empty if Q,$,and DISC are empty
Copy link to clipboard
Copied
You need a simple if-condition. See: https://acrobatusers.com/tutorials/conditional-execution
Copy link to clipboard
Copied
thank you! those articles in conjuction were perfect for my puzzle. I ended up with this:
event.value = (this.getField('Q1').value && this.getField('$1').value && this.getField('DISC1').value) ? ((this.getField('Q1').value*this.getField('$1').value)-(this.getField('DISC1').value/100)) : "";
Copy link to clipboard
Copied
Well done!
Copy link to clipboard
Copied
It is best not to ask "how to code" because it can be seen as just asking us to write your code for you. Most of us are more interested in giving you what you need to learn how to write your own.
Copy link to clipboard
Copied
I did take the articles that try67 sent to me, as per my request on "how to code" and I came up with a code that works perfectly
event.value = (this.getField('Q1').value && this.getField('$1').value && this.getField('DISC1').value) ? ((this.getField('Q1').value*this.getField('$1').value)-(this.getField('DISC1').value/100)) : "";
you've misinterpreted my intentions. I love finding the "why" behind the code, not just the "how"
Copy link to clipboard
Copied
not just the "what"**
excuse the typo! and thank you again for suggestions!