I have setup two tax rule, different tax rate for two different country. With conditional action that checks the shipping country to apply the correct tax rate.

Works correctly at cart and checkout but the price shown on product view (site/catalog/...) is wrong.
The two conditional tax rules, are (1) 10% GST if shipped to Australia and (2) 15% GST if shipped to New Zealand
The product is configured to be sold at $280

At the product view, the GST is applied twice, i.e. 10% + 15%, making the price $350 (+25%) instead of $308 (+10% GST) or $322 (+15% GST).
Obviously, this is related to the fact that the system can't check the shipping country before the user enter the checkout page, therefore, it simply apply the tax twice.

How can I solve this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

a_c_m’s picture

I've just run into this same problem.

As i see it there are 2 problems, logged in and logged out users.

Logged in users, should be simple, as you will have an address for them (in most cases).

Logged out users have 2 solutions :

Simple solution : Shop just assumes the its own country
More complex solution : Shop uses a GEO-IP module to guess anon users country

Looking into this now.

a_c_m’s picture

Status: Active » Needs review
FileSize
7.1 KB

The attached patch,will try to get the current order (from the session or post request), or if it cant find it creates a fake order . The order is then used with the conditional action rules to remove rates that dont currently apply.

It will also have the added bonus of meaning it will only display the taxed price to people who are meant to see it.

lpalgarvio’s picture

subscribing

a_c_m’s picture

@LPCA - did you test the patch? did it work for you?

lpalgarvio’s picture

point me a link to a tool to apply the patch under windows and i'll do it :P
my web host doesn't have the patch or similar *nix commands.

lpalgarvio’s picture

found
http://drupal.org/node/23844
http://drupal.org/node/60116

C:\Program Files (x86)\Development\GnuWin32\bin\patch: **** malformed patch at line 196:

also retested on a centos box at work - same result, malformed patch at line 196

a_c_m’s picture

I can't see anything strange on line 196 ?

lines 195 -> 197

+    
+  return $rates;
+}
lpalgarvio’s picture

i used version 1.1 when patching

longwave’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
FileSize
8.98 KB

Patch attached against 6.x-1.x-dev, based on a_c_m's work but that repurposes the uc_vat_load_order_taxes() function to load appropriate taxes for all cases, which saves some code duplication. If feedback is positive I will commit this and make a new release.

@a_c_m: one thing I don't understand about your patch is where $_SESSION['user_country'] comes from, is this to do with an existing GeoIP module or something custom you use on your sites?

lpalgarvio’s picture

with the patch, the prices seem to show ok

but the cart contents at final checkout (option added by VAT) does not process.
the bar hangs.

a_c_m’s picture

@longwave - yes, i think it was some custom GEO-IP code, sorry.

longwave’s picture

FileSize
10.32 KB

Forgot to modify some additional files with the function changes; try again with this patch.

longwave’s picture

FileSize
10.43 KB

Rerolled against latest changes to HEAD.

lpalgarvio’s picture

seems to be working now :)

the totals however are confusing.

outputing my sample:

cart page:
-----------------------------------------------------
product 1 10,89€
product 1 10,89€
another fruit 25,41€

Subtotal excluding VAT: 39,00€
VAT PRT: 8,19€
Subtotal: 47,19€

checkout page with no billing/shipping address selected (defaulting to the first VAT/TAX):
-----------------------------------------------------
Qty Products Price excl. VAT VAT PRT Price
1× product 1 9,00€ 1,89€ 10,89€
1× product 1 9,00€ 1,89€ 10,89€
3× another fruit 21,00€ 4,41€ 25,41€
Subtotal: 39,00€ 8,19€ 47,19€
-----------------------------------------------------
Order total preview:
Subtotal: 47,19€
Subtotal excluding VAT: 39,00€
VAT PRT: 8,19€
Order total: 47,19€

checkout page with billing/shipping address selected:
-----------------------------------------------------
Qty Products Price excl. VAT VAT PRT Price
1× product 1 9,00€ 1,89€ 10,89€
1× product 1 9,00€ 1,89€ 10,89€
3× another fruit 21,00€ 4,41€ 25,41€
Subtotal: 39,00€ 8,19€ 47,19€
-----------------------------------------------------
Order total preview:
Subtotal: 47,19€
UPS: 10,00€
Subtotal excluding VAT: 49,00€
VAT PRT: 8,19€

Order total: 57,19€
-----------------------------------------------------

i think i would look better this way - this example bills in Portugal and ships to Spain, adding different VAT to both billing and shipping (previous outputs didn't had VAT on shipping):

Cart contents - replace "Price" with "Price incl. VAT", then it's fine ;)

Order total preview
Billing totals:
...Subtotal excl. VAT: 39,00€ ----------------------> billing subtotal without VAT (and without shipping)
...VAT PRT: 8,19€ ------------------------> the VAT part, 1.21 or 21% in PRT/Portugal (billing subtotal x 0.21)
...Subtotal incl. VAT: 47,19€ ----------------------> billing total with VAT (and without shipping) (billing subtotal x 1.21)

Shipping totals:
...UPS Shipping: 10,00€ --------------------------> shipping total (whatever values are fixed or calculated)
...VAT ESP: 1,80€ ---------------------------> the VAT part, 1.18 or 18% in ESP/Spain (shipping subtotal x 0.18)
...Shipping incl. VAT: 11,80€ ----------------------> shipping total with VAT (and without billing) (shipping subtotal x 1.18)

Order totals:
...Total excl. VAT: 49,00€ --------------------------> billing + shipping total without VAT
...VAT PRT: 8,19€ ---------------------------> the VAT from billing
...VAT ESP: 1,80€ ---------------------------> the VAT from shipping (replace with single field if same VAT)
...Total incl. VAT: 58,99€ --------------------------> billing + shipping total with VAT (the final price)

would work well with Fieldsets

Also, to avoid the problem of pre-selecting the first VAT, which is not always the intended VAT, i'd recommend this:
- optional integration with a Multiprice module (there's 4 or 5 of those), a Geo module (Location for example) or a Language module (selected language on l18n, harder to do)
- read the main VATs associated with the user (through defined shipping and billing addresses) from previous purchases

then it would be awesome :P

longwave’s picture

Committed the patch from #13.

@LPCA: all those feature requests are outside the scope of this issue, you may like to look at:

#487270: Display order total preview as table
#490654: Select country before entering ubercart first

The module already supports uc_multiprice to some extent. True multiple currency support is still not possible in Ubercart as far as I'm aware and I don't intend to add such support to uc_vat until there is a stable multicurrency release.

longwave’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

riddhi_uppal’s picture

Hi hdmp4.com,

How you have set the conditional action that it worked correctly in checkout pages. As we have the conditions in which we have added two products in cart and we need to check if the supplier country = NL then we have to charge vat otherwise we have to check the supplier count = customer country then do not charge vat.

Now if in cart 1st product satisfy 1st condition and 2nd product satisfy 2nd condition, for this we have write two conditions using uc-vat module.

We have run the loop of products in cart and return true and false. Now the logic is return vat rate and applying to both products in cart.

How to manage this?

ericwongcm’s picture

re: 19

Sorry, I don't fully understand what you mean...but my conditional action for tax is configured to check an order's shipping country.

FYI, I am also using
http://drupal.org/project/ip2country
http://drupal.org/project/uc_multiprice

lpalgarvio’s picture

+1

tahiticlic’s picture

.