openerp-expert-accounting team mailing list archive
-
openerp-expert-accounting team
-
Mailing list archive
-
Message #00023
Re: Trouble with accuracy and currency handling in the invoice process
Am Mittwoch 20 Januar 2010 09:20:40 schrieb Jan Verlaan - Veritos:
> OFBiz was in the same position we are now, I guess.
...snip
> If you need numbers which would be multiplied to arrive at the final
> result, you should preserve as many decimal places as possible. Ratios
> and unit costs, for example, should not be rounded. After the
> multiplication, you should round your final result.
>
for ratios and unit costs see
branch chricar_price_unit
We always store quantity and value (NEW field) in all records (stock_move) and
calculate value/quantity if display of price is needed
as both values are defined as numeric we think that rounding problems ( at
least caused by stored values) can be excluded.
My python knowledge is to limited to judge exactly what happens, but most sums
are SQL statements - select sum(value) - and should be so for performance
reasons (IMHO) so no prob here.
for initial calculation of SO/PO value we use
quantity * price / factor of price unit (new field) to get sufficient
precision and comply to specs of partners.
Example
gasoline is quoted in cents here, lets say 134¢/liter
so the value of 5.33 liters is
5.33 * 134 / 100 = 7.1422 - which is rounded to 7.14 as we uses 2 decimal
digits which is defined by price_accuracy = 2 - these 7.14 are stored and used
for all calculations.
--
Best Regards
ChriCar Beteiligungs- und Beratungs- GmbH
http://www.chricar.at/ChriCar/index.html
Dr. Ferdinand Gassauer
Official Tiny Partner
Follow ups
References