Copy link to clipboard
Copied
Can someone tell me how to write a calculation script for this. Im adding my "Dental" field and "Health" to get the "Total", Then to the right, there are two fields for "6100" and "1150" (just accounting codes). Anyway, If the "Total" is $784.96 or something, how can i make the first $300 go in the "6100" field and the remaining balance go into the "1150 box? Thanks Guys!
Enter this code as the custom calculation script for "6100":
var cutoff = 784.96;
var total = Number(this.getField("Total").value);
if (total>cutoff) {
event.value = cutoff;
this.getField("1150").value = total-cutoff;
} else {
event.value = total;this.getField("1150").value = 0;
}
Copy link to clipboard
Copied
Can someone tell me how to write a calculation script for this. Im adding my "Dental" field and "Health" to get the "Total", Then to the right, there are two fields for "6100" and "1150" (just accounting codes). Anyway, If the "Total" is $784.96 or something, how can i make the first $300 go in the "6100" field and the remaining balance go into the "1150 box? Thanks Guys!
Enter this code as the custom calculation script for "6100":
var cutoff = 784.96;
var total = Number(this.getField("Total").value);
if (total>cutoff) {
event.value = cutoff;
this.getField("1150").value = total-cutoff;
} else {
event.value = total;this.getField("1150").value = 0;
}
Copy link to clipboard
Copied
Enter this code as the custom calculation script for "6100":
var cutoff = 784.96;
var total = Number(this.getField("Total").value);
if (total>cutoff) {
event.value = cutoff;
this.getField("1150").value = total-cutoff;
} else {
event.value = total;this.getField("1150").value = 0;
}
Copy link to clipboard
Copied
Worked!!! Thanks!!!!