These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

User Override Calculation Problem

jimmyn
Registered: Nov 2 2010
Posts: 12

I have built a purchase order with Livecycle designer and i have a sales tax field. I use a simple calculate script that takes the balance field and multiplies it by a sales tax field that is a drop down box that the user can select from .0125 through .0925 to set his counties tax rate with.
 
The calculation works great. I used SalesTax.rawValue = Balance * Tax to get the correct amount into the sales tax field. However, i cannot get the form to allow a user to override the script. If a user has a certain portion of the purchase order that is taxable and the other portion is not, they need to have the ability to manually enter a different tax amount than the calculation script will come up with.
 
I have tried using the Calculated User can Override setting on the sales tax field and it will allow you to type in an amount, and then gives you the followup question, are you sure you want to do this. Then when you select yes, it reverts back to $0.00 liek the script is firing again.
 
I have scoured the boards, forums and blogs and cannot find out how to acheive my goal. Does anyone haev any suggestions?
 
Thanks for the help,
Jimmy

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
You need to make the tax field an Optional user override and not a caluculated read only.

George Kaiser

jimmyn
Registered: Nov 2 2010
Posts: 12
Hi George,

Thanks for the reply. I made the field a Calcualted User can Override and it still resets back to zero after you tab off of that field. I also tried user entered optional and still came up with the same setting.

Is there a script i can use that tells the form to not run the script if the user types a value into the field?

Thanks again for the help,
jimmy


jimmyn
Registered: Nov 2 2010
Posts: 12
Hi George,

Thanks for the reply. I made the field a Calcualted User can Override and it still resets back to zero after you tab off of that field. I also tried user entered optional and still came up with the same setting.

Is there a script i can use that tells the form to not run the script if the user types a value into the field?

Thanks again for the help,
jimmy


gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
When I use this method, I am prompted about making the change and the override amount remains until the form is reset.

George Kaiser

jimmyn
Registered: Nov 2 2010
Posts: 12
That is exactly what i am trying to accomplish, but for some reason it won't allow this to happen. It acts like it is refiring the script SalesTax.rawValue = Balance * Tax as soon as you hit enter, or tab.

I get the prompt about makign the change and i anwser yes allow the change, and then it reverts back to $0.00. Is there another way around this?
DaveyB
Registered: Dec 10 2010
Posts: 70
At what point is the sales tax calculated? This may sound like a silly question, but I suspect that your problem lies with the event that fires the script rather than the script itself.

Let's assume for a moment that you have 4 fields: total, tax-rate (dropdown), tax (calculated, editable), and grand total. Your tax calculation script should be set to the 'change' event of the total, and tax-rate fields, any change in either of these fields will recalculate the tax field. The value of the grand total should be calculated in the change events for the total and the tax fields. Do you have another event somewhere that fires off the script?

On consideration, the fact that you are having to script an exception for non-taxable items leads me to believe that this is a regular occurrence rather than an exception (I've been known to be wrong on assumptions! :D) If this is the case, then adding a simple checkbox alongside each item total (taxable? - default = checked) would help resolve the problem. You can now conditionally sum to two hidden fields (taxed and untaxed) and add these together to display in the total field. You then calculate the tax at the correct tax rate versus the hidden taxed field and add that to the total in order to arrive at the grand total. Now your customer doesn't need to pull out a calculator, they just have to uncheck the appropriate boxes!

Hope that helps!

DaveyB

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB

jimmyn
Registered: Nov 2 2010
Posts: 12
Davey,

Can i email you a copy of my purchase order so you can take a look at it and see what i am referring to? Having sales tax on only certain items is very rare for us. Normally all of the equipment purchased is non-taxable, or all of it is taxable. In very rare instances do we have both taxable and non taxable on one purchase order.

If i can email you a copy so you can see what i am referring to that would be great.

Thanks,
jimmy


gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
You can use Acrobat.com free of charge to host fles that are to be shared.

George Kaiser