Money Calculations

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Hello,

I was just looking at my sales numbers and everything seems just a little bit off. So I went into the calculations and realized that you incorporate some kind of rounding calculations during checkout.
I then noticed that you provide not 2 decimal place but an unusual and pointless 4 decimal places for product costs. Why do you accept input at  4 decimal places and then round off to (how many Places?)?
Why is this? After all when a customer is looking at a product they base their purchasing decision on the cost they see attach to the product. I myself would not like it if I buy product based on the displayed price and then get a different price when I checkout.
It doesn't help accounting either. If one thing has to be bang on correct it is the MONEY. Round weights, dimensions etc. but money has to retain bank practices.

I just went back to look at the rounding rules and am stunned. According to the options the store can be set up to either short the owner by $0.49 per dollar or rip the customer off $0.99 per dollar.
Is it just me or does that sound absolutely insane?

Am I wrong?
2 years ago
I am formally apologizing for the embedded anger in that post. A result of anger thrown at me from above...
I realize that rounding is common but that does not address my initial query of why the final numbers do not seem to add up (since we have the app set on default rounding and after running a few test orders, it seems to NOT round in any way). I have checked a few places(controllers) and would like to know where the final calculations are done to the order amounts before they are written to the db.
Does any one know the file that does the calculations?
2 years ago
I have the following fields in my order table;
Order[OrderSubtotalInclTax]
Order[OrderSubtotalExclTax]
Order[OrderSubTotalDiscountInclTax]
Order[OrderSubTotalDiscountExclTax]
Order[OrderShippingInclTax]
Order[OrderShippingExclTax]
Order[PaymentMethodAdditionalFeeInclTax]
Order[PaymentMethodAdditionalFeeExclTax]
Order[TaxRates]  
Order[OrderTax]  
Order[OrderDiscount]  
Order[OrderTotal]
I have went through my orders and have found a few that are off by mostly $4 but some more and some less.
My understanding is that the calculation is as follows (I don't charge tax so I omitted those fields) I've only included fields that <> 0.00 or Null. Most of the records prove this equation correct. Seemingly random records do not equate. I am at a loss. Are there any other fields that get used in the calculation of the order total? (looking for an amount of $4 for most wrong records!)

Order[OrderSubtotalInclTax] - Order[OrderSubTotalDiscountInclTax] + Order[OrderShippingInclTax] - Order[OrderDiscount]  = Order[OrderTotal]
Real example #1
$50.00Subtotal - $10discount + $11.38Shipping = $48.59
when should be $51.38

What am I missing?
2 years ago
Are you using multicurrency ?
Check your exchange rates
2 years ago
Hi Again,

Thanks so much for the help lately.

No I'm not using multi currency in fact the only currency in the db table is CND.

The fact that the miscalculation occurs periodically and seemingly random has me bewildered. I can't for the life of me locate the process, page, db. table etc. that is taking the money off the total. I download the order data via the download function provided in the admin area and nothing in the excel sheet could possibly result in that error. I have tried to add, subtract fields in every possible way but not even close to ending with the amt.

Slowly but surely going insane...lol.
2 years ago
So you mean Currency is CAD and the rate is 1
and the ExchangeRate.EcbExchange plugin is not enabled

What version nopCommerce are you using ?
2 years ago
Correct. Rate 1, Currency is CDN and no plugin installed.

I am using version 4.3.

I have cross checked products to see if any common ground existed - nothing
I have checked discounts to see if odd discounts were used - nothing
I have attempted to find some common cause or condition between the random orders and have come up empty.

I am beginning to think its a gremlin...been at this for hours. Have checked the SQL Db directly with SQL mgr and cannot see an oddity. Have check site activity and system log and nothing that I can see.
2 years ago
Another strange aspect is that the majority of errors amounts to$4.00 with the exception of very few that equal $2, $2.76, $745. But mostly $4.00 regardless of the order total.
2 years ago
So you have changed the code for Canadian dollars to CDN rather than CAD
Does one of your payment methods have an additional fee ?
2 years ago
That is just my habit, it shows CAD.
No fees charged. I am using check/COD payment method and simply receive e_Transfers.

I have DM  you with a direct look into the admin. I really appreciate your time.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.