rounding in vtiger -- half_even vs. half_up
Dear vtiger devs, I need to know which php-function is called to round values in vtiger? As far as I know, php offers the following rounding methods out of the box:
- PHP_ROUND_HALF_UP
- PHP_ROUND_HALF_DOWN
- PHP_ROUND_HALF_EVEN
- PHP_ROUND_HALF_ODD
Analysing results, vtiger seems to call PHP_ROUND_HALF_EVEN by default (at least in invoice module). Unfortunately this is not documented nowhere. This matter is important because vtiger-extensions may make use of other php rounding methods. In fact well known PDFMaker Extension from its4you seems not to call HALF_EVEN but HALF_UP method. This - in some cases - leads to rounding difference between modules!!! If you confirm to use HALF_EVEN, i could ask its4you to switch to HALF_EVEN by default too to solve the issue (issue = one cent differences between printed invoice totals and vtiger invoice totals).
Aside: why are one cent diffences important/annoying? a) When you trac payments in vtiger and the customer paid what was demanded on paper/pdf invoice there might be a 1-cent gap. b) When you create "SEPA-Direct Debit" from whithin vtiger the customer is in many cases charged one cent less than demanded on attented paper/pdf invoice which means a non consistend bookkeeping.
Last but not least, you should document the default rounding mode - if not already done.
[A couple of days ago I created #773 (closed) which is already closed - as the issue was misdescribed there (thought of a bug then), i decided to create a new issue and not to reopen the previous one.]