The ability to round values in tenders is mainly required for reporting purposes so home owners don't see strange values with cents in them on a contract worth hundreds of thousands of dollars.
The tricky thing about rounding is that a group of line items that are rounded and added together to give a total value, can sometimes give a different total value than what a group of non-rounded line items added together give, so you must be careful. Also, there's the obvious fact that a rounded value = higher charge then a non rounded value if the rounding goes up instead of down.
Our settings allow users to apply rounding at the line item level and at the total tender level;
Level 1 = the option
Level 2 = the tender total
There are 2 values which must be entered into price functions for rounding to work.
1. RoundLine (name it anything)
2. RoundTotal (name it anything)
These can be set to any rounding setting
i.e. nearest $1, nearest $100, nearest $1000
Then there are 2 values which must be entered into validationentries to point to these 2 price functions:
Then a 3rd validation entry must be entered and linked to a option in fkidOther:
The option these are linked to in tblTenderOptions:
Rounding Fix / Price (name it anything)
If all of this is setup correctly, then the tender and the option selections will work as per the following;
- Every time a tender is created an option selection will be automatically added into the database only (not visible in the UI) and this will be the Rounding Fix. In the crLockedPriceSell field an amount will be added as a +/ - value
- In tblTenders there will be a value in the field crTotalExRoundedSellPrice and another in the field crTenderTotalPriceSell
- If you subtract the rTenderTotalPriceSell from the crTotalExRoundedSellPrice you will get the value in tblTenderOptionSelections >crLockedPriceSell
- NOTE #1 the other values in other fields for the rounding fix option selection should be ignored.
- NOTE #2 if there is a value in validation entries like the below, it can be ignored, it from an old version of the code and being added in a post deployment script. Should be stopped from version 3.12.3 onwards though.