After having disabled and enabled uc_vat I find that now VAT isn't added to the order total - so the "review order" page looks like this:
Subtotal: 20,00 Kr.
Handling: 8,00 Kr.
Order total: 24,00 Kr.
And I've selected that the VAT tax should apply to fees - but it doesn't either (it did before disabling it).
I don't see any VAT line item(s) - I'm pretty sure they were there before.
I'm almost certain it's due to the disableing/enableing.. I'll try to uninstall the module and then enableit again and see if it helps.
If you could point to places in uc_vat.module where you want me to get you debug info from (dpr($somevar) f.ex.) I'll gladly add this to help debug the issue.
Comments
Comment #1
klavs commentedIn further debugging - I added a drupal_set_message to check if it ever found a tax lineitem in uc_vat_line_item_tax - and it only finds the fee lineitem (handling).
Comment #2
longwaveI've disabled and re-enabled uc_vat several times on my test site and have not seen this issue. Are you absolutely sure nothing else has changed in your setup - for example, are your tax settings still configured correctly?
Comment #3
klavs commentedI think they are. I didn't notice it right away, so I might have "done something else" - but I don't know what.
The "odd" thing is that the items in the cart (and on the site) is shown with VAT added - and it also is in the line_item with the product.
I don't see any way that I could configure it to NOT include the VAT in the total - but still have VAT added to the product price - that would simply not make sense (as you can see the total is all wrong) - so I must have hit a bug somehow, so that it does this, which it should IMHO never do.
If you could hint me as to where it figures out if it needs to add the VAT line_item - because I think that's what's missing.
Comment #4
klavs commentedI found the problem (with help from longwave) - uc_vat didn't properly handle conditional actions, based on delivery_country - so it didn't add VAT in the checkout - when delivery_country wasn't set yet.
I've attached a patch, which fixes this, by setting a default country code (currently 208 - denmark) - we should add an option somewhere to select default country - perhaps in the countries list - or perhaps just as simple as a text field in VAT admin.
The patch also adds a uc_vat.ca.inc - which has the condition of determining if the delivery_country is inside EU (as of 2010).
This makes it a lot easier to setup a shop which is located in the EU - and has customers outside of the EU.
The patch also includes my i18 fixes from earlier, where I send variables to t() which is "frowned upon" - but as I can't find an "official" solution as to how to translate user-entered text - I see no other way. it works like a charm for me.
I'll be adding support for ip2cc ( to automaticly set the visitors country - and thus automaticly figureing out if they should be shown prices with or without VAT) later today - and will gladly add support for other ip->country modules - if asked.
Comment #5
klavs commentedI added ip2cc support - and set default country to '208' if the IP is within RFC1918 range (ie. local - invalid internet address).
Comment #6
a_c_m commentedThis looks really interesting!
Ideally, that default country should be a configurable entry (as you said), also it should set the location of both delivery and billing (as some sites will use one or the other).
If i get some time i will review it properly as a client is interested in this.
Comment #7
longwaveDefault country should probably be taken from the "store country" setting at /admin/store/settings/store/edit/contact
Need more time to review this but it looks very promising from what I've seen so far.
Comment #8
klavs commentedAFAIK vat is applied, based on the delivery country - not on the billing country. So to calculate if the price needs to have VAT applied - you may ONLY use the delivery country.
I have written a patch (based on others work, with a config option added) for ubercart - which automaticly checks "billing adress is same as delivery address) checkbox - so I don't bother 99% of my customers with having to check this :)
http://www.ubercart.org/project_issue/added_option_check_billing_address... - so perhaps I just see the problem because of that? AFAIK billing address will be set to same default country in checkout as delivery address is.
Comment #9
longwaveThe following new features have been committed to HEAD:
The AJAX cart contents pane must either be enabled at /admin/store/settings/checkout/edit/panes or by selecting "Show cart contents with VAT price columns at checkout" in the VAT settings.
I think this now makes the checkout pages fully compliant when VAT is excluded due to Conditional Actions rules, and hope to release uc_vat 6.x-1.1 once this has been tested a little more thoroughly.
I am wondering whether the ip2cc work should be included in uc_vat, or would be better off in a separate module. I think such a feature may be useful to all store owners to preset the user's country selection at checkout where possible.
Comment #10
a_c_m commentedAgreed, its own module would be fine for me. As the functionality could be useful without uc_vat, it should be its own module, or perhaps a patch / add on to http://drupal.org/project/ip2cc or one of its 6 alternatives :/ - i just trawled http://drupal.org/project/modules?page=1&filters=drupal_core:87%20tid:65... (list of all location tagged modules) and ip2cc is the most used, so probably a fair target.
Comment #11
klavs commentedI'm not quite sure, why there would need to be a module, to use a module? Especially when it only seems to waste lines.
The implementation of ip2cc in uc_vat is at max 10 lines - I see no benefit of putting that in a module.
If it's the ip RFC1918 test part - then that is probably already handled in ip2cc - I just didn't check how they did it - and if they don't - it should probably still be handled ip2cc - so uc_vat (and other users of ip2cc) know when an "invalid" ip for country lookup was used - so they can decide to use whatever they want (like uc_store_country ).
But that's just my 2 cents :)
Comment #12
longwaveI'm imagining a separate module called "uc_country_detect" or similar that can preselect the country dropdowns at checkout for all stores - whether or not they are running uc_vat. Automatic country detection shouldn't necessarily depend on the store having uc_vat installed.
Comment #13
klavs commentedI see what you mean. This requires there's some default place to set it, before an order object is created.. - where all modules happen to look. Or that you create a global order object immediately - if thats how it's "supposed" to be done.
the shipping quote "blob" could use it as well.
Comment #14
ar-jan commentedI'm using uc_vat 1.1, but I still have this issue. I must have misconfigured something, but I'm having trouble finding out what. The shopping cart shows prices incl. VAT, the delivery country is set during checkout, but the order review pane shows the total exluding VAT:
Subtotal: € 49,58
Standard delivery: € 4,20
Subtotal excluding VAT: € 53,78
VAT: € 10,22
Total: € 53,78
Any clues where to look?
Comment #15
ar-jan commentedRe #14, since I'm working on a new site, I did a new Drupal install with the same modules and configuration, and now the order total looks good.
But apparently under some conditions the problem persists. Could it have been because of modules I tested earlier? (e.g. uc_bulk_discount, uc_member_pricing)
Comment #16
longwaveClosing this issue, as features were committed a while back and the last bug report seems to have been solved.
The country detection issue should be continued at #490654: Select country before entering ubercart first.