Skip to main content
This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
May 30, 2024

We need to know the amount of the tax and the cost of the shipping…

Acrobate du PDF, InDesigner et Photoshopographe
Sama5C32
Sama5C32Author
Participant
May 31, 2024

This is an empty form. I am doing practice. There is no data for tax and shipping cost. 

Nesa Nurani
Community Expert
Community Expert
May 30, 2024

How is tax calculated, do you just enter amount manually?

Sama5C32
Sama5C32Author
Participant
May 31, 2024

Yes, I'll add tax manually.

Nesa Nurani
Community Expert
Community Expert
May 31, 2024

Try this as custom calculation script of "TOTALTOTAL" field:

var total = 0;
var tax = Number(this.getField("TOTALTAX").valueAsString);
var ship = Number(this.getField("TOTALSHIPPING").valueAsString);

for(var i=1; i<=7; i++){
var qty = Number(this.getField("QTY"+i).valueAsString);
var price = Number(this.getField("PRICE"+i).valueAsString);
var dsc = Number(this.getField("DISCOUNT"+i).valueAsString);
if (qty !== 0 && price !== 0) {
var itemTotal = qty * price * (1 - dsc);
this.getField("TOTAL" + i).value = itemTotal;
total += itemTotal;} 
else {
this.getField("TOTAL" + i).value = "";}}
event.value = (total*(1+tax))+ship;