Hi,

Sure hope you can help with this, I have been going around in circles.

I am having a problem with the way that Ofbiz calculates tax and order
totals.
 
>From what I can gather, the file
‘…/applications/accounting/config/arithmetic.properties’ controls the
rounding and digit length for the calculation of taxes & order totals.

I am starting to think the changes I make to the file are not being applied,
I say this because when I look at the ‘Unit Price’ in an order it shows
35.742, rather than 35.74. Which would tend to indicate that settings are
not being used because the number of decimal points in each of the settings
in ‘arithmetic.properties‘ are set to 2 digits. I have pasted in the
contents of the ‘arithmetic.properties‘ file below so you can have a look. I
have changed the ‘rounding’ to a different method to try to achieve the
correct figures.

There is only a disparity of +0.1 but, technically it is wrong. Ofbiz keeps
giving me a total of 91.05, but it should be 91.04. I am been given a hard
time about it...

Essentially;

Using Excel;
            US$   tax        p+tax
Product1        35.74     6.2545   41.995
Product2        35.74     6.2545   41.995
Shipping        6.00      1.050    7.050
Total         77.48       (3 digit)     
Tax           13.56       13.559        
------------------------
Grand Total     91.04     91.039        

Simply put, I think that the problem is a combination of two issues; 
(i). Ofbiz uses 3 digits, not 2 digits (I would like to use 2 digits). 
and 
(ii). Uses rounding ‘ROUND_HALF_UP’, I would tend to use ‘ROUND_HALF_DOWN’.
I think the ‘arithmetic.properties‘ file below, should do the trick. But it
doesn’t seem to being ‘applied’ to the calculation.


So I have two Questions;

1). (BIGGEST ISSUE) Do I have to ‘activate’ the ‘arithmetic.properties‘
file, and if so how do I do that? (All I have been doing is clearing the
cache and logging out then logging in again, as I had been told this is the
way to do it).
2). Do you see my point about 94.05 and 94.04, and the best way to make this
calculation?


---CONTENTS OF---

.../Ofbiz/trunk/applications/accounting/config/arithmetic.properties


#
# Arithmetic properties for configuring BigDecimal calculations  
#

# For setting decimal precision and rounding method of operations related to
invoices
invoice.decimals = 2
invoice.rounding = ROUND_HALF_DOWN

# For setting decimal precision and rounding method of operations related to
orders,
# such as shopping cart amounts and order amounts
order.decimals = 2
order.rounding = ROUND_HALF_DOWN

# For setting decimal precision and rounding method of operations related to
customer accounts
# such as Financial Accounts
finaccount.decimals = 2
finaccount.rounding = ROUND_HALF_DOWN

# Most companies would want their sales tax calculations ALWAYS to round up
(ie, 100.081 becomes 100.09)
# This could be ROUND_CEILING or ROUND_UP.  (The difference is that
ROUND_CEILING rounds towards positive infinity,
# ROUND_UP away from zero.  So, for 1.13, both ROUND_UP and ROUND_CEILING
will round to 1.2, but for -1.13,
# ROUND_UP gives you -1.2 and ROUND_CEILING -1.1.)
salestax.calc.decimals = 2
salestax.final.decimals = 2
salestax.rounding = ROUND_HALF_DOWN


 
Thanks & Regards,

Peter


________________________________________

On 05/04/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
Hi Scott,
 
 
Just strikes me that the file should be 'correct' for everyone. What would
be your guidance as to what the file should be?
 
Appreciate your fast responses this evening. It is 1:15am here in the UK
just can't stay awake any more.
 
  
Thanks & Regards,
 
Peter
 
 
 
________________________________________
From: Scott Gray [mailto: [EMAIL PROTECTED] 
Sent: 05 April 2007 01:16
To: [email protected]; [EMAIL PROTECTED]

Subject: Re: Inaccurate Calculation of Order
 
Here is the configuration file, you can change the settings to whatever you
want them to be:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/arit
hmetic.properties?view=markup 

>From the default settings, it looks like calculation takes place at 3 digits
then gets rounded up to 2 places.

Regards
Scott
On 05/04/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
Hi,


There must be something we are missing here. This can't be a bug, someone
would have noticed already. Especially something so fundimental.


Thanks & Regards,

Peter


-----Original Message----- 
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]
Sent: 05 April 2007 00:11
To: '[email protected] '
Subject: RE: Inaccurate Calculation of Order
Importance: High

Hi,


Whichever way I work it out the Order Entry system does seem to be slightly
out.


>From Excel...

                Price         tax 2 digits      tax 3 digits    tax 9 digits

Product 1       35.74           6.25          6.255
6.254500000
Product 2       35.74           6.25          6.255
6.254500000
shipping        6               1.05          1.050
1.050000000
Tax           13.56             13.56         13.56                 13.56

Total         91.04


The Order Manager came up with 91.05, I have screenshots if anyone is
interested.



Thanks & Regards,

Peter


-----Original Message-----
From: Adrian Crum [mailto:[EMAIL PROTECTED]
Sent: 04 April 2007 23:34
To: [email protected] 
Subject: Re: Inaccurate Calculation of Order

David,

I just calculated the tax on each line item accurate to 9 decimals, summed
the
taxes, and I still get a total tax of $13.559.


David E. Jones wrote: 

>
> Ummmm.... need more details. There are variations in rounding modes,
> precision rules etc.
>
> For example with VAT in pretty much ALL countries that use VAT you  must
> calculate line item tax amounts with 3 digits of precision, add  them 
> up, then round to 2 digits.
>
> -David
>
>
> On Apr 4, 2007, at 5:50 PM, <[EMAIL PROTECTED]> wrote:
>
>>
>>
>> Hi David, 
>>
>>
>> Thanks for responding.
>>
>> An excel spreadsheet that our account had verified.
>>
>>
>> Thanks & Regards,
>>
>> Peter 
>>
>>
>> -----Original Message-----
>> From: David E. Jones [mailto:[EMAIL PROTECTED]
>> Sent: 04 April 2007 22:39
>> To: [email protected]
>> Subject: Re: Inaccurate Calculation of Order
>> Importance: High
>>
>>
>> What do you mean by "traditional means" here? 
>>
>> -David
>>
>>
>> On Apr 4, 2007, at 5:15 PM, <[EMAIL PROTECTED]> < [EMAIL PROTECTED]> wrote:
>>
>>> Hi,
>>>
>>>
>>> Has anyone run into the problem of having Purchases not calculated
>>> accurately?
>>>
>>>
>>> These are the figures calculated by traditional means; 
>>> Product 1: 35.74
>>> Product 2: 35.74
>>> Shipping :  6.00
>>> Total    : 77.48
>>> Tax      : 13.56
>>> -----------------
>>> Total    : 91.04
>>>
>>> These are the figures calculated by Ofbiz Order Manager;
>>> Product 1: 35.74
>>> Product 2: 35.74
>>> Shipping :  6.00
>>> Total    : 77.48
>>> Tax      : 13.57
>>> -----------------
>>> Total    : 91.05
>>>
>>>
>>> There is a very slight difference of 1c. But the fact of the matter 
>>> is that
>>> the figure calculated by the system is very slightly incorrect.
>>> Struck me
>>> that the Tax maybe being calculated to 3 digits rather than 2 digits.
>>> 
>>> Does anyone know which file(s) control the calculation of the Tax,
>>> so I can
>>> check if it is 2 or 3 digits.
>>>
>>>
>>> Would appreciated any feedback. 
>>>
>>>
>>> Thanks & Regards,
>>>
>>> Peter
>>>
>>>
>>
>>
>
 
 
 


Reply via email to