Script to claculate PENALTY

I am using FormClac in an Adobe LifeCycle4 interactive form. I have included a copy of the form as an attachment.

The problem I am having deals with the calculation of Penalty. The penalty for late payment of the TAX Due is 10% of the TAX DUE or $10, whichever is greater. The penalty is applied unless the tax payment is remitted late. The form I am creating allow the taxpayer to calculate Penalty and Interest if they know the payment will be made after the deadline. Therefore the form has a checkbox to indicate the payment will be late. The taxpayer check the checkbox and enters the due date and the anticipated payment date. The form will then calculate the penalty, interest and the toal amount due if received on or before the anticipated date of payment.

The formula I am trying to use must consider the following logic:

1.If CHECKBOX1 is checked, a PENALTY and INTEREST must be calculated
2. If the PENALTY claculated is less than $10, the PENALTY is populated with $10.
3. If the PENALTY calucates to > $10, the PENALTY is populated with the calculated amount.
4. If CHECKBOX1 is checked, INTEREST must be calculated at the rate on the form.
5. The TOTAL DUE is to be calculated.

I have everything resolved except the issue of populateing the PENALTY. I can claculate the PENALTY if the CHECKBOX id checked, using the following statement:

 if (CheckBox1 == 1) then (NumericField2 * NumericField8) endif  

What can I add to this script to ensure that if the PENALTY calculates to less than $10, that amount is not entered into PENALTY but $10 is.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

try this :
 if (CheckBox1 == 1) then (NumericField2 * NumericField8>10?NumericField2 * NumericField8:10) endif  

Open in new window

or this :
 if (CheckBox1 == 1) then ((NumericField2 * NumericField8>10) && (NumericField2 * NumericField8) || 10) endif  

Open in new window

ergenbgrAuthor Commented:
Thanks leakim971. I tried both your suggested scripts and neither worked.

I have attached a Word document that show the Adobe error info.  If you have other script ideas after seeing the error message, please repost and I will try them.

Thanks again.

 var PenaltyMoreThan10 = NumericField2 * NumericField8>10
 if (CheckBox1 == 1 && PenaltyMoreThan10) then 
     NumericField2 * NumericField8

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ergenbgrAuthor Commented:
This script did it. I had to change the && to just one & and had to enter an open parenthesis in line three. I ran it with those changes and it worled. Thanks to leakim971 for this solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.