Calculation issue

  • SparkRehab
    Asked on March 10, 2015 at 9:47 AM

    Hi:

    I have an invoice form.  I offer a series of services and they are delivered at a set pay rate.  When some one enters the number of hours or km driven for these services and a pay rate the calculation is correct and good.

    However, one type of service called "Treatment Costs" is not based on a set pay rate, but rather on the price to purchase a product.  As an example a book for $18.87.  

    Problem is that the rate of pay is part of the calculation but if I add a box to insert a price it is not part of the calculation and missed in the total for the invoice.   If I insert all possible prices between $0.01 to $100.00 the box would be huge and I expect would not hold that many amounts.

    Is there a way to add another box(es) into the calculation.  For example a box for $ and one for cents which combine to give a final price and add to the calculation.  Or can I put a 1000 lines in a drop down box?

    There must be a simple solution and you likely have an idea on how to do this.

     

    Thank you

     

    Doug

  • SparkRehab
    Replied on March 10, 2015 at 6:00 PM

    Hi:  The form at http://www.sparkrehab.com/example.html is now how I would like it except for one small issue:

    Client 1 - 9 fit nicely but 10 - 25 I can not get to align as do the first ones.  

    If you can fix that or tell me how I would appreciate it.  

    However the main issue is getting the $ Value "Cost of Therapy" to add a value to the calculation box.  Only one amount  (Length of Service x Rate of Pay) or (Length of Service x $ Value Cost of Therapy will be calculated at one time.  

    Your help is really appreciated.

     

    Doug

  • Welvin Support Team Lead
    Replied on March 10, 2015 at 6:59 PM

    Hi Doug,

    For the alignment of the field, I've moved it to a new thread. Here's the link: https://www.jotform.com/answers/530766. We will look at it separately.

    For the main issue, I'm sorry, but I can't think of an easiest way to accomplish this rather than doing this conditionally.

    https://www.jotform.com/help/268-How-to-Insert-Text-or-Mathematical-Caculation-into-a-field-using-a-Condition

    Check this cloned version of your form: http://www.jotformpro.com/form/50687067330961. Fill the client 1 section and you will notice the following:

    a. If the 'Type of Service' field is equal to "Cost of Therapy", the "Client 1 Total" will only calculate the "Length of Service x $ Value "Cost of Therapy"

    Calculation issue Image 1 Screenshot 30

     

    b. If the 'Type of Service' field is NOT equal to "Cost of Therapy", the "Client 1 Total" will only calculate the "Length of Service x Pay Rate"

    Calculation issue Image 2 Screenshot 41

     

    Repeat this method for the rest of the fields. Let us know if you need further assistance about this matter.

    Thanks

  • SparkRehab
    Replied on March 12, 2015 at 10:01 AM

    Hi:  At http://www.weebly.com/weebly/main.php is the form now that I have changed the 4 first clients using conditions.  I renamed some boxes simply to make identification easier in the process of applying conditions.

     

    One minor problem.  When I insert

    If "Type of Service" is equal to "Cost of Therapy - Purchase"

    Insert {Length of Service 1}{Cost of Therapy - Purchase 1} into calculation 1

    and then

    If "Type of Service " is not equal to "Cost of Therapy - Purchase"

    Insert {Length of Service 1}{Pay Rate 1} into calculation 1

    the the first equation allows both to work.  So if I input Type of service is "Cost of Therapy - Product" I can enter either a "Pay Rate 1" and get an answer or a "Cost of Therapy" value and get an answer.

    Is there any way of making it so if Cost of Therapy - Purchase is selected you can not get a calculation if by mistake you input a pay rate?

    If you go to the example and input you will see what I mean.  You can iput both and they calculation changes back and forth.

    Sorry top keep bothering you

    Last time I hope.

     

    Doug

     

  • Welvin Support Team Lead
    Replied on March 12, 2015 at 11:15 AM

    Hi Doug,

    You can simply add another conditional logic to hide "Pay Rate" field and show "$ Value Cost of Therapy" field if "Cost of Therapy" is selected in the 'Type of Service' field.

    Calculation issue Image 1 Screenshot 30

    Please check back my form: http://www.jotformpro.com/form/50687067330961 to see the changes.

    Then to clear the values when an option is hidden, you have to "enable" it in the Preferences > Advance settings:

    Calculation issue Image 2 Screenshot 41

    Thanks