VAT/GST: Overview

Posts: 89
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

These files are experimental. The code is meanwhile quite messy again, but after a lot of confusion I'd like to have a show case what an European cart should look like. Please test if it would fulfill your needs. This thread shall be the place to download the latest code + a link list where we discuss the details.

If Uber Tuber really would get a price module, things might look different, but for UC 1.x this is IMO the much easier way.

What is it about?

  • The base is atm Ubercart 1.5, the big zip contains all the patched files and a couple of contributions which are just modified regarding uc_currency_format().
  • Fix the rounding error for per item calculation
  • Already some changes at checkout / review - maybe we will need some configuration for it
  • Tax conditions have to be set up through WF_ng, on this base is decided when to show taxes
  • You will need at least one new role, B2B in the EU (but not from your country), as they are the only who don't need to see and pay taxes.

uc_vat_helpers contains atm just a block where all user can change the country for which to show the tax rates (defaults to the store location)

There is still quite a lot to do, e.g. weight quotes are still not always displayed correctly.

Install instructions see post #1
ubercart-bzr1304-EU-patches-0.3.tar.gz & uc_vat_helpers-1.x-02.tar.gz have additional install instructions in #8

Related threads (will be updated)

VAT/GST: The concept
VAT/GST: prices with 3 decimals
VAT/GST: HowTo get taxes per product into $order?
...

Other threads
Ubercart European VAT Compatibility
price international Tax Rules - please add

TIA for any feedback,

Al

AttachmentSize
ubercart-1.5eu-patches-0.1.tar.gz370.47 KB
uc_vat_helpers-1.x-0.1.tar.gz1.88 KB
ubercart-1.5eu-patches-0.2.tar.gz371.51 KB
ubercart-bzr1304-EU-patches-0.3.tar.gz376.71 KB
uc_vat_helpers-1.x-02.tar.gz3.14 KB
Posts: 89
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

Install Instructions:

  • You need Ubercart 1.5
  • copy over this install the files from ubercart-1.5eu-0.1.tar.gz, the directory structure is the same and contains also some price related contributions
  • copy uc_vat_helpers into the contrib directory
  • You require uc_taxes activated
  • configure your store as usual
  • at /admin/store/settings/store/edit/display setup the new options
    - Where to display taxes
    - Tax calculation mode
    - Display Subtotal excl. tax on Checkout (in EU mode "Show" is still broken, maybe we even don't need a configuration for it)
    For a real EU shop set all three to the second option
  • create a B2B role (for outside your country), tax rates & configure them at WF_ng
  • Create Products (Insert Price still w/o VAT!), test and provide feedback. Beside the Display VAT issues I am also interested if I messed up sth in the US mode...

Note: Discounts still do not support Attributes, this is an Discounts issue. There are also issues between Discounts and Taxes, so please take it more as a concept where Uber Tuber should go.

Posts: 7
Joined: 10/16/2008

Nice work, but theres still some work for those ugly special cases:
1) New customer without an account (role) who has a VAT number. (For buying quickly its (imho) recommended to automatically create an account) So the new buyer has to enter a VAT Number at checkout. Thats not the problem, there is a module which shows and stores VAT-Numbers per order.
The problem is to ignore the VAT if the seller is in EU and the customer is in eu but other country (and is a professional). B2B between EU-countries are VAT-free.

So if you can tell me how to configure or alter workflow ng with own events in checkout process, please tell me. I will post the finished solution here.

What I need:
- I dont want to work with workflow conditions.
- I want to use the (mymodified) VAT-number module (=> ill have an extra pane and a SQL-table for storing VAT-numbers and validation Eye-wink
- After VAT# Verification (which happens after first clicking "Review Order" there will set a notification on top which tells the customer that taxes are corrected for B2B.
=> The Billing information under payment (or better everywhere) now has to be without VAT.
After clicking "Review Order" again the customer is able to pay now the VAT-free price for B2B.

Short:
I want to know how to set VAT to 0% for new anonymous buyers during checkout.
-----
The Future Nice to have is to store VAT -numbers per user like its done with the other billing information for easier future buys.

Would be nice to read a suggestion

MfG
Passer

Posts: 89
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

Both Drupal as well as Ubercart are about flexibility. The price for it is sometime a little more configuration. In case of UC 1.x this means learn Workflow_ng. Maybe it is not too intuitive, but if you once understood it, the setup is done in minutes.

Configure taxes

  • Setup one or more tax rates (incl. for which content type it applies)
  • Create a new role B2B (outside your country)
  • Go to Workflow_ng, click on the left side on this tax rule
  • All you have to do is "Add a condition":
    - "User role(s)" => check NEGATE, "Select role(s)" B2B (outside your country)
    - The second rule which might be of interest is "Check an order's shipping country"

That's all, the business customer just has to have the role.

If you would come up with a usable solution regarding the VAT number issue, you can count on any support possible, e.g. for how to update the user role to B2B through WF_ng in case of successful verification Smiling

Just an idea btw: Probably it will be better to ask professional customers to register before checkout and do the verification there. But if you want to go through the regular checkout it should be possible to add a check box "I am a professional customer" to the Country Block (uc_vat_helpers) and override the anonymous role by a $_SESSION['role_b2b'] or sth like that.

Posts: 7
Joined: 10/16/2008

Yes, I know how to do this for already know users, but products are sold better if a user has not to sign up first.

So B2B has to work for not known users too.

So the only possible solution to do this automatically would be with VAT# at billing + verification and than the VAT Set to 0%.

Until I have an idea how to do this Ill try to update your pack with the ability to enter a VAT# at registering so that it is possible to auto assign verified users to a role which is tax free.

Ill post this when its done

PS.
The idea with overriding the anonymous role sounds interesting. Ill try this too

Posts: 89
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

I will extend the Country Block and the "live" tax calculation by the check box I described, so anybody can see prices without VAT (dependent on the country he selects).

I am really looking forward for your contrib. Maybe it's still too early, but you should know that there are countries in Europe with up to 4 such numbers - I know about the Czech Republic with 2 and Slovakia with 4 numbers... If you want to do this completely, you will also have some work Eye-wink

Posts: 69
Joined: 08/08/2007
Early adopter... addicted to alphas.Getting busy with the Ubercode.

This is great. I've tested it out and seems to work pretty well. I haven't had the chance to go over it solidly though. I'm in Australia, so I don't need to worry about multiple taxes/countries, etc. What I do need though is to label the prices as 'incl GST'. I don't mind doing some work myself to get this functionality working, but since you've done all this work, I figure I would get your opinion on the best way to do something like that and have it working well with your code.

Cheers,
Stephanie

Posts: 89
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

@Stephanie: This incl. VAT/GST stuff we also need, it will be soon done by my contrib. The term 'VAT' will be replaceable, so nothing to do for you there. From version 0.3 however I would be very happy to get more feedback by testers Eye-wink

I am pretty much sure we can skip at least the double configuration of 'tax calculate mode' and 'show taxes everywhere', IMO one forces the second, but maybe we need some 'what to show at checkout/orders' configuration.

customer.itpl.php: Please post details about your preferred structure, e.g. if you need for the ordered products a table with a column 'tax amount'. I'd like to offer some choice like customer.EU/AUS.itpl.php.

Posts: 89
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

v. 0.3 install instructions:

  • after updating the files run update.php
  • /admin/build/modules turn VAT/GST helpers off and on again, otherwise you don't get the configuration link
  • /admin/store/settings/vat_helpers contains instructions for
    - how to configure WF_ng
    - how to create a fake user to enable anonymous B2B checkout
  • /admin/store/settings/store/edit/display has new settings:
    - Display tax rate message with asteriks? (experimental - opinions welcome)
    - first live example of a multilingual Variable to translate and/or replace "VAT" by whatever you need (visible in the tax rate message)
  • The country block has now a checkbox 'I have a VAT number' for anonymous, which is verified/corrected at checkout

Order stuff is still not finished, add prices incl. VAT is thanks to a massive win crash also not ported from my old code, but a couple of bugs are gone and there are some new features like mostly correct behavior if 'Order has a particular shipping method' is setup. (Order total Preview & Shipping Calculation have still some issues, but review is ok)

Posts: 554
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Hi,

I finally take time to test the experimental VAT integration and I'm happy to see lots of good ideas, however, there are still some things that need work. Here is my feedback : (tested on 0.3)

  • Nice option to display tax rate message, but I would provide a non-javascript box. Just a html div to add to the display price, because it's far more simple to add a little JS function that show that div when you rollover the price than remove the JS stuff
  • You should remove the "Where to display tax option", it is directly dependant of the "Tax calculation mode" option. You cannot choose a per product tax calculation mode and display tax on checkout (Because it show the product with tax in the product page, and show the product excluding tax on the cart = totally non-sense). And you cannot set tax calculation on checkout and display the price including tax on the product page cause it brings $0 problem (and it's normal as tax don't exist yet on the product page)
    That's why I think the Tax calculation mode should define where the tax is displayed too.
  • When you set tax per product and display tax everywhere, the first subtotal on the checkout preview screen should be excluding tax cause it's a preview of an invoice and an invoice is calculated like that. Actually we have that :
    Subtotal : 15 (the subtotal include the tax)
    Shipping : 2
    Tax : 5
    Total : 17

    We should have that
    Subtotal : 10 (Subtotal should be excludin tax, even if the cart on the top of checkout page is including tax, so it need to alter the core subtotal calculation).
    Shipping : 2
    Tax : 5
    Total : 17
    You could add the option in the store setting to let the user choose, but I think the second way is always the better

  • I didn't see what the "Display Subtotal excl. tax on Checkout: " do...
  • Good idea to directly show the shipping quote including tax on the quote pane, but the line item is displayed excluding tax. It's strange. In addition, this should be an option.
  • To a more general rule, I think line item role is to be a preview of an invoice. On an invoice, you would have each line with price excluding taxes, then, a subtotal excluding tax, and then the total of the taxes that apply. That's why I would suggest to not display price including taxes on line items.
  • I saw you created some .eu invoices, but they seems not finished, I think it's a work in progress. I just would suggest to display products like that (cause it's required for per product tax calculation generally)

    Qty Product name Unit price excluding tax Tax rate Tax amount Unit price includin tax Total (unit inc.tax * qty)

  • On a per product calculation setting, it would be a nice addition to associate a tax array to the node object on hook_nodeapi() load case: This entry would include an array like that : array('VAT 1' => array('rate' => 5%, 'amount' => 2.95), 'VAT2' => array('rate' => 10%, 'amount' => 6.47)) etc...
    Basically, an array of all taxes rules that apply to the product containing the rate of the tax and the amount of the tax for 1 quantity of that product. This would allow easier customization for shop owner for example, custom the invoice. This would increase performances too to not be obliged to make a querry in the database to get a tax amount associated to a product, you would just get it in the node object.
  • I think that's all

But Great work !

zmove

Posts: 89
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

Hey zmove, thanks a lot for your feedback.

  1. It is raw CSS Smiling In version 0.4 (hopefully tomorrow ready) will be even an Opera bug gone. (On scrolling the page the pop up disappeared at the top)
  2. Agree, nobody will need such an option.
  3. Disagree - the difference is exactly about the question what is the price. US: excl. VAT, EU/AUS incl. VAT (if applied)
    Meanwhile I also worked on uc_vat_number and switching the preview pane between B2B/B2C & sell outside EU is possible (although there will be still some minor issues in 0.4)
  4. This option was an idea targeted to the before point, never finished, but we can add it if you really need the above described display.
  5. Take tomorrow a look on how the eu template is in 0.4, I think this way it makes sense.
  6. Both shipping and order preview was buggy, 0.4 will be better, just an issue between switching between B2B & B2C left
  7. You are right, the eu template was far from finished, 0.4 will have a working version
  8. The big work of the last days was adding the tax rate both to order products as well as all line items. Unfortunately this caused a couple of issues on the order edit page. The worst is solved now, we will see how much of the rest I manage until tomorrow.

Like mentioned I was working on uc_vat_number. Basically it looks good, but still some work left. Could you overtake this from tomorrow? I learned a lot the last weeks and I can tell you that there are a couple of questions left how to solve it for core...

Posts: 554
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Hi, thank you for your quick feedback. No problem, if new stuff is released, I will test it ASAP.

  1. Ok for Raw CSS, Good ! In fact, if it's easily modifiable, all is good. ^^
  2. Ok, we are agree on that point, letting this option will only confuse users and make things not working ^^
  3. For the third point, both opinion are viable, I made a quick brainstorming with our accountant that confirm that, for her, it's better to see subtotal excluding taxes and then, add the tax. But our society had a B2B business and a recent B2C business, so I think this is a rest of B2B activity. I saw a recent oscommerce install that works like you said, with a subtotal including tax and a tax amount just as information and not added to make the total including taxes.

    But I think both options would be available as both are viable and it's just an accountant/store owner preference. With just a checkbox option like "Display line items excluding taxes" in store setting, a store owner could configure easily the calculation behavior he want to see for line items. For sure, if he check this box, it apply to the subtotal, the shipping quote, and all line items, because it would be a non-sense to mix the way line items are calculated.

    If you don't have time to work on it, I can try to find it, I have a verrrrry close deadline ATM I will not be able to work on it before the middle of december, but as it's a critical option for me, I can try to spend some time on it, stay me informed if you plan to implement that option or not.

  4. This option could become the option described above
  5. Ok I will test
  6. Ok I will try both case and see how the issue could be resolved
  7. Hehe, 0.4 will have a lot of good things ^^
  8. I don't understand very well the relation between my last suggestion and your last point, don't had tome to look through the code to see how you managed the VAT in your work, but I think adding it in the hook_nodeapi would be a good option cause it's associated to the node object on node_load and this is exactly why this hook exists. I did it for attributes recently that was submitted to the latest 6.X dev version by lyle, and it works like a charm. In addition, if I remember well, ubercart use node_load to create a cart, an order, etc... so adding the taxes on the hook_nodeapi would make it available everywhere, without querying the database. And it could be easily modifiable/customizable by modules/invoices

I stay you informed on 0.4

Posts: 554
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

0.4 files are on another post or it's just a little in late ? Eye-wink

Posts: 8
Joined: 10/26/2008

I've been testing 0.3 for the past few hours.

I'm currently developing a shop for a photographer based in Australia, and the GST has been causing me lots of problems. I'm not sure if it's the tax itself or the lack of proper support for common tax systems in Ubercart. Either way it doesn't really matter, and I am very happy to have found this project!

Here are my comments:

1. My tax rate is getting applied to products and attributes on the product page and in the checkout process. It is however not being displayed in the shopping cart. There should be 2 more lines on the shopping cart, one that says "tax total" and another "total" so it would be"

Subtotal - $300
tax - $30
Total - $330

That way people from other countries can see that the tax doesn't apply to them.

2. All my dollar values seemed to have gotten muddled up, before where it was "$490" now it is "$490,-" - how can I remove the ",-"?

3. Tax rates are getting applied to shipping rules, but only on the summary page, not during the "calculate quote" process, ideally the tax would be applied to the shipping quote.

Do I need to create B2B role so the tax will/won't be applied to the cart and shipping quote depending on what country the customer is from. At the moment I haven';t created the b2b role as I'm not worried about showing customers the price incl tax during the order process.

thanks again for the great development work!

Posts: 5
Joined: 09/18/2008

from where did u get the version 0.3

venture into the unknown!

--

venture into the unknown!

Posts: 8
Joined: 10/26/2008

I realise now that I was using a custom uc_cart_view_table in my template php, added the vat/gst code from uc_cart.module and the shopping cart is now displaying prices with tax included.

As for the ",-" I was able to remove it be editing uc_store.module, line 1974 on version 0.3.

Download 0.3 from the first page, it's in the list of files.

Posts: 554
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Hi,

I worked on an implementation of the VAT Number in ubercart. Available for 6.x only.

See the project page here

This is a complete rework of the VAT Number module, and they are not compatible (and I don't plan to provide an upgrade feature, cause the first "official" release is the 6.x one).

I don't have to backport the new version, but I would be happy to officially commit it if somebody want to take this task.

I let european people test it and give me feedback, I prefer you use the drupal.org issue queue.

Posts: 4
Joined: 08/15/2008

hey, are your vat contributions views compatible?

I've hacked the product.module to get views display pricing with vat. Works nice so far, but I didn't have the time to make a real contribution out of it, yet. Would it be something for your European VAT contrib?

And I've also a hacked version of the quote.js to display the shipping quotes including vat in cart (estimated shipping cost) and checkout (calculate shipping cost).

Just hardcoded, as i said, but if someone is interested, just pm.

Posts: 554
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

You can upload your files and the community will do the rest. I think it's better that privately distribute them via PM system.

Posts: 1
Joined: 12/23/2008

I'm also keen on progress in this topic, and willing to add weight to the car(t).
Übercart is now at 5.x-1.6 whilst Al mentioned 1.5 as required, and no new files are released in this forum topic (although a 0.4 release is mentioned).
Can someone please post an update where matters are now? Much appreciated.