Post by rokdazone » Thu Oct 09, 2014 8:12 pm

There is a major issue with opencart that dates back at least to 1.5.x.

The problem is that taxes for order totals doesn't seem to get logged anywhere. When the customers places the order in checkout the tax is there.

When you later are viewing the order in admin the taxes just aren't there (because they aren't logged anywhere).
If you are developing some kind of integration to a business-system/SaaS-provider, this quickly become a nightmare as you will try to recalculcate the tax in in reverse based on customer address etc. etc.

In one/some of the OC 1.5.x releases i know there was a "order_total_tax" table, that now is removed again?

I have talked with a representative/employee at the Swedish tax office that claims that for this e-commerce system to apply correctly to swedish tax rules, the following things must be fixed.

Solution:

1. Tax must be logged separatly (on everything, not just products)
2. There must also be possible to apply tax to stuff like Vouchers, Coupons, Rewards etc. (all discounts). Yes, discounts might also require tax according to the swedish tax office.

What applies to the swedish tax office, could possible apply to tax office's in many other countries.

Many business-systems/SaaS-providers also require you to send in the tax in percent (and not the tax amount), like (6,12,25). So if a new field "tax_percent" existed everywhere where tax was logged, this would also greatly make things easier because then you would't need to calculate the percent (using the price, total, tax field).


Any thought's on this? Maybe i'm completely wrong about this and taxes get logged somewhere. However, any thought's on this is greatly appreciated, because i can't be the first to have noticed this.

OpenCart extension and templates developer. Working for Shine Webb AB in Sweden. Feel free to PM/contact me if you are in need of an extension or a template.


User avatar
Active Member

Posts

Joined
Mon Jan 02, 2012 3:24 pm
Location - Sweden

Post by Johnathan » Thu Oct 09, 2014 10:49 pm

Are you referring to the tax amount (e.g. $15.00) or the tax rate (e.g. 20%) being stored? Tax amounts are stored in the "order_total" table, with a code of "tax". You can filter them that way (and the admin panel does for reporting taxes).

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by rokdazone » Fri Oct 10, 2014 2:14 pm

But the row with the code of "tax" in table order_total is the total tax amount for the order. I must know the individual tax amount/percent for each logged fee in order_total. I think the best solution should be to log tax separatly, just as in table order_product. Do you know of any method/way to retrieve logged tax for a individual fee (payment fee/shipping)? Please let me now :)

What i'm really after is a method to retrieve the tax percent for each order total fee individually (on the admin side) so that when i sum the (products + taxes) with order total fees etc it should add up to the order total amount.

OpenCart extension and templates developer. Working for Shine Webb AB in Sweden. Feel free to PM/contact me if you are in need of an extension or a template.


User avatar
Active Member

Posts

Joined
Mon Jan 02, 2012 3:24 pm
Location - Sweden

Post by Johnathan » Sat Oct 11, 2014 10:39 pm

If you create different Tax Rates and Tax Classes to apply to the different areas (products, fees, shipping, etc.) then they'll each be logged separately in the "order_total" table. You could then pull them individually based on their title.

It's not a perfect solution, but it doesn't require modifying anything in OpenCart.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by rokdazone » Mon Oct 13, 2014 8:21 pm

So, if i have different Tax Rates and Tax Classes set on products, fees and shipping, the tax (for the individual fee) is logged separatly in the order_total table? I have to check that out.

EDIT: Just took a look in the model file for a random payment module (catalog/model/payment/amazon_checkout.php) and there are references there to a "order_total_tax" database table. However, there is no table with that name in the database (using oc 1.5.6.4), very strange indeed. So, it seems like somebody added support to log tax separatly, then changed his mind but forgot to remove code :)

OpenCart extension and templates developer. Working for Shine Webb AB in Sweden. Feel free to PM/contact me if you are in need of an extension or a template.


User avatar
Active Member

Posts

Joined
Mon Jan 02, 2012 3:24 pm
Location - Sweden
Who is online

Users browsing this forum: No registered users and 10 guests