problem with calculating total fees and deducting exceptions
- February 28, 2024
- 1 reply
- 3104 views
It is quite possible there is a simpler way to do what I am needing help with, but I will describe my issue as best as possible, with how I currently have it, and then explain my issues. I'm not fluent in writing scripts, but if it is explained, I could probably grasp the concept... My querying efforts on this form have not been locating something for me yet.
I have a form for requesting rentals and I want it to calculate a total at the end, so the renter knows how much to pay. There are a few variables to throw in though. I have been sucessful at implementing check boxes for the different rooms (4 in total) and having a number associated to each check box which will then add the sum of all check boxes to display at the bottom "Total Rent" text field. I have an additional check box for the entire building which is a different fee, and if I check that box, it will add it to the total. There is a mandatory damage deposit fee for this rental which I currently have a checkbox for. I have this checkbox automatically checked and is read only, so cannot be unchecked. I have defined the value of this checkbox for the deposit which automatically adds its value to the "Total Rent" text field. Lastly, there is a mandatory fee that gets calculated hourly at $25/hour and there is a minimum charge of $50. Essentially, the first 2 hours are paid by the renter regardless of renting for less than that amount of time. I have two text fields set up right now for this, one for "Hours" and one for "Host Fee". Right now, I have a default value of 2 in "Hours" and I have a calculation set up to calculate a total in the text field "Host Fee" as the value in "Hours" * $25. This will calculate correctly if I change the value in "Hours". As it presents right now, when you open the form, you would see a default "Total Rent" of $350 (deposit + host fee minimum).
First issue: I have the additional option to rent the whole building for a different fee (discounted from total of all individual rooms). Can I script something to say "IF" check box "Entire" is checked, it will uncheck boxes "Room1" "Room2" "Room3" and "Room4", and if someone checks one of the individual rooms, it will uncheck "Entire"? This way someone could check off however they wanted with it still calculating the rate correctly. right now, I would have to uncheck the 4 rooms in order to not have them calculate in the total.
Second Issue: We have a mandatory fee as mentioned above. This fee does not apply to certain persons, so they are exempt from paying it. Can I set something up whereby I have a checkbox set up with the question "are you exempt from this fee?", call the checkbox "Exempt", and if you check that, it will clear the values from the "Host Fee" so it does not add that calculation into the "Total Rent" text field?
Maybe overall there is a better way to implement this whole solution and I am all ears to that!
the attachment is just a screenshot of the part of the form I am talking about.
Thank you for any help!!!
