Read it if you can ! ;)

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

Hi,

I'm very happy to see that the European case will be a major point for the next Ubercart releases Eye-wink. I spent a lot of time to think about the best way to implement the European needs and I think, now, I have a pretty strong opinion about the question.

As Ryan said, and I'm totally agree, it's not just a VAT number concern. Provide a Store VAT number (set up in the store setting) and a customer VAT number (set up in the checkout page via a checkout pane) as my VAT contrib do is just anecdotic. There is a price display issue too.

So the ideal "European Friendly" module would merge 2 modules : VAT contrib and Add tax to product price contrib but ATM, this 2 modules need a lot of work to be usable by most users.

See below what the module should do in a perfect world :

The VAT module

This module have to know 2 informations about the user :

  • His status (individual or professionnel)
  • His country (in European Union or not)

If the status is professionnal and the country is in European Union, the store have to show a required VAT number field. To make these conditions, I think workflow is a good solution. As the module already provide a "check the customer delivery address", it would provide a "check the customer billing address". In addition, the country select list is multiple, so it's easy to check all european countries in one rules.

I would add that, for usability, that the VAT number should not be in a separate pane. It should be in the customer billing information pane, and appear or disapear if the customer change his country for an european country or not. As you have to use javascript to make the condition (because the country is not asked before the checkout pane) I think it can be done using javascript too. (see the screenshot 1)

For the condition about the user status, I think the best way to dissociate an individual customer than a professionnal is to create 2 different roles in drupal, it's what I done for my Kalys gastronomie website There are a lot of advantages to make it via roles :

See in my screenshot that the company field become required if the user role is professionnal, so it means the core can provide optional/required field depending on user role

  • Its drupal core, so there are a lot of modules that extend functionnalities (example, ask different information depending on the role on registration, separate individual and professionnal statistics in google analytics, create coupons just for a selected role etc...)
  • Its easy to add a condition in workflow to check the user role, some actions to gives roles etc...
  • more, more, more...

And the module would provide 2 token for the invoice :

  • One to show the store VAT number
  • One to display the customer VAT number

One cool feature would be to check if the VAT number is correct on a European database, I know it's doable because there is one module for osCommerce that do it. the store admin would be able to choose if he want this option or not

The display price module

In an european store, all individual (all over the world) have to pay the VAT. For professionnals, only the professionnal of the country of the store pay the VAT, the others don't pay it. So you need to know 2 informations about your customer when showing price

  • His status (professionnal or individual)
  • His country (the same than the store or not)

As it's impossible to know the country of the customer before the checkout page, you cannot check the second condition on a product page but you can show both prices (with a bigger price includng VAT, because it's the more important). A cool feature would be to let the choice to the user, to show single price or both. If single price is checked, the store show price including VAT to individuals and price excluding VAT to professionnal.

The "including VAT" or "excluding VAT" have to be specified near the price to not confuse the user, so the module have to implement a kind of suffix after all prices.

In addition, the prices have to be managed excluding prices, because all calculation on product (example discount) are made on excluding price. Adding the tax to the price is only for display.

So to resume, in europe, it's better to show prices including prices to the user, but you have to manage them excluding price. One problem I encounter when I developped the add tax to product price contrib was that Ubercart calculate the subtotal by adding, for each product, the product price * quantity. So, as I wanted a subtotal excluding tax, I had to make a reverse calculation te remove the tax I added on sell price on the checkout page, which could bring some rounding problems. I think core have to change some things (don't know what) to make that more extensible.

Another things is that, the subtotal have to be displayed like that on the invoice :
- Subtotal excluding tax
- Shipping quote excluding tax
- Discount (if one) applied on the subtotal excluding price
- Total excluding price
- Tax
- Total including price

But this is already possible with the Lyle addition to show the Total excluding price before the tax if a tax is displayed (Thank you Lyle Eye-wink)

VoilĂ , I wish my post is complete enough.

About my work on that module, I'm not opposed to that, but maybe not as the main maintainer. Maybe as a co-maintainer or a consultate, because It's not my work, I'm not sponsored to only work on that so I don't often have the time for that. I could work on the 2 modules I develop because it was a need of a customer, now it's done, I'm on another project that don't need it ATM so I don't have much time to spend on it (and on my free time I'm developping a website for my eve online corporation ^^).

So maybe as a co maintainer or a consultate, I'm ok.

AttachmentSize
screenshot1.png37.04 KB
Ubercart European VAT Compatibility By: Ryan (67 replies) Tue, 05/06/2008 - 13:35