VAT number

Contrib type: 
Module
Status: 
Awaiting moderation
Compatibility: 
Ubercart Beta 4
Latest version: 
1.2

In europe, you have to provide your store VAT number on your invoices. In addition, if you sell to another professionnal people, theit VAT number have to be displayed in your invoices too.

1.2

Correct the compatibility problem with Ubercart Beta 5

1.1

Added the customer VAT number as a token, so, it's usable in invoice templates.

Module features

  • Add a "Store VAT number" in the store configuration (admin/store/settings/store/edit) in which you can fill the VAT number of your store
    Then you can use token to place your vat number where you want in your invoices
  • Ask for VAT number on checkout page for roles that have "Have to fill VAT number" access permission in the drupal controle access (admin/user/access)
    If checked for a specified role, a VAT pane will be displayed on the checkout pane. If displayed, the pane become required for people that have filled an european country in the billing information pane

Possible improvement

  • Provide a textarea in which store owner can set list of countries they want to make VAT number required
  • Check on dedicated website if the VAT number filled is valid

zmove

AttachmentSize
uc_vat_number1.2.zip3.03 KB

Re: VAT number

Unfortunately, [order-vat-number] does not resolve at all.

The token is listed as expected, but the table 'variable' in the database has "uc_store_vat_number" but no "uc_order_vat_number".

What am I missing?

Re: Re: VAT number

there are 2 types ofsaved VAT number :

  • Your, the one of your store you set on the store setting admin page, this is the VAT number that is stored in the variables table in the database
  • And the VAT number of your customer, that he fill on the checkout page via a VAT number pane. This VAT number is stored on the vat_number table in the database (dont remember the name exactly). This VAT number appear on the order pane. You can add both VAT number in the invoice using the token, that the only interest of token in my module.

I hope I have answer you.

zmove

Re: Re: Re: VAT number

Unfortunatly, [order-vat-number] doesn't seem to appear on the invoice, when added on customer.itpl.php. It does however shows on the overview in the store administration.
No problems at all with [store-vat-number] though.

Hi, I didn't remember but I

Hi,

I didn't remember but I had this problem when I set up my invoice. I didn't have time to see why the tokens didn't works, but you can use $order->vat_number and it works.

Altered VAT number

Hi zmove,

Played around with your module a little.
I added some rules so it would check (to my very limited knowledge) if VAT applies.
So far it just returns a lot of errors, which helped me to check the different options.

Checks now:
if (!in_array($form_values['panes']['delivery']['delivery_country'], $european_countries)) {
form_set_error('', t('Export to outside EU, VAT=0%'));
Export to outside the EU or not? No VAT

} elseif ($form_values['panes']['billing']['billing_company'] == '') {
form_set_error('', t('Individual, not company, VAT=normal'));
Not a company, pay VAT

} elseif ($form_values['panes']['delivery']['delivery_country'] == variable_get('uc_store_country', 840)) {
form_set_error('', t('Delivery to same country company, VAT=normal'));
Delivery not crossing borders -> pay tax

} elseif ($form_values['panes']['billing']['billing_country'] == variable_get('uc_store_country', 840)) {
form_set_error('', t('Billing to same country company, VAT=normal'));
Bill to same country company -> pay tax

Otherwise pay 0%

If more rules are needed, it should be quite easy to add.
Later is would make sense to assign a state/number to the different (no)tax types for storage/taxpapers en invoice.

Added SOAP VAT number check with the EU website.
Copied some code from the Oscommerce guys.
http://www.oscommerce.com/community/contributions,1848/category,all/sear...

Good luck

AttachmentSize
uc_vat_number.zip30.23 KB

code working with 1.0 version of UC

hi folks,
is anybody out there who made the contrib compatible with the actual 1.0 version of UC ?
thanks for your help !
cheers
carsten