VAT number

Contrib type: 
Module
Status: 
Complete and working
Moderation: 
Awaiting moderation

Downloads

Compatibility: 
Ubercart 1.x
Compatibility: 
Ubercart 2.x

The module is now officially supported on drupal.org. See the project page.

The release only support Ubercart 6.x branch, because I don't have anymore 5.x shop, and don't have extra time to work on a release I don't use.

If somebody want to backport it, I will be happy to commit it. Use the drupal issue queue for that.

The attached file is the old 5.x version that is completely different from the official version, I let it here for people that would need it for 5.x.

PreviewAttachmentSize
uc_vat_number1.2.zip3.03 KB
gabble's picture
Offline
Joined: 04/08/2008
Juice: 54
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?

zmove's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 1193
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

CreaMind's picture
Offline
Joined: 04/17/2008
Juice: 7
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.

zmove's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 1193
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.

splash112@drupal.org's picture
Offline
Joined: 03/31/2008
Juice: 413
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.zip 30.23 KB
elephantiX@drupal.org's picture
Offline
Joined: 06/05/2008
Juice: 49
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

leflores's picture
Offline
Joined: 12/12/2007
Juice: 61
Possibility to add Vat number pane to ORDER EDIT PAGE

It would be very useful that the pane could be added to the Order Edit Page:

/admin/store/orders/xxxx/edit

This page is used to add orders by hand.

Thanks in advance,
Luis

zmove's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 1193
New 6.x version

I posted a new version of the VAT Number module on drupal.org (see the original post).

It is completely different from the 5.x release attached to that post and greatly improved.

evidente's picture
Offline
Joined: 01/19/2009
Juice: 25
Re: New 6.x version

where should I submit bugs I've found? Here or in the official project issue tracker?

ñull@drupal.org's picture
Offline
Joined: 01/26/2009
Juice: 134
Re: Hi, I didn't remember but I

When I put $order->vat_number in the template, I get a blank. If I put the token, then it is not replaced.

ñull@drupal.org's picture
Offline
Joined: 01/26/2009
Juice: 134
Spanish VAT registration number

The Spanish VAT registration number is the same as the TAX registration number. Legally correct invoices have both the tax number of the client and the store, if they hava a VAT registration or not. This means that for all Spanish clients of a Spanish shop the TAX registration number is obligatory, Is there a way to patch this module to cater for this situation (exception)? How? Both for this and the token bug I am willing to donate something toward a solution.

A. Kopetzky's picture
Offline
Joined: 03/16/2009
Juice: 8
not working on drupal 6.10

just wanted to mention that ur module doesn't work on drupal 6.10. can u pls upgrade?

studiob's picture
Offline
Joined: 01/08/2009
Juice: 7
order-vat-number token error addressed.

After a bit of debugging I addressed the problem with the order-vat-number token.
Hope this helps
[edit]
someone already addressed it with a patch (exactly same changes I made on this package).

AttachmentSize
uc_vat_number.tar.gz 8.66 KB
Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 315
Re: VAT number

Fatal error: Call to undefined method soapclient::checkVat() in /home/newtech/public_html/newsite/modules/uc_vat_number/uc_vat_number.module on line 212

Hi,I am getting this error if i add vat number and submit a form.
Dose any one know about how to fix this?

Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 315
Re: Re: VAT number

Any idea?

ñull@drupal.org's picture
Offline
Joined: 01/26/2009
Juice: 134
install php5_soap

Either install php_soap or php5_soap on your server or include nu_soap classes: http://sourceforge.net/projects/nusoap/

Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 315
Hi, Error was shown after

Hi,
Error was shown after installing the soap module.

Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 315
Re: Hi, Error was shown after

Any idea?

splash112@drupal.org's picture
Offline
Joined: 03/31/2008
Juice: 413
Re: Re: Hi, Error was shown after

restart php?

CoolCow's picture
Offline
Joined: 05/20/2009
Juice: 10
Bug in javascript

Hi,

I'm using your module for a dutch (Belgium) shopping site.

I've come across a small issue that makes the VAT Number field always invisible when you select Belgium.

In the country array you have prefixing zero's for these countries: Autriche(040), Belgique (056)

Just remove the zero's and it works.

I also improved your code so it works a little faster. See the attachment.

AttachmentSize
uc_vat_number.js_.txt 1.21 KB
ciobulus's picture
Offline
Joined: 12/14/2009
Juice: 25
How can i create more info fields, vat number is great

Vat number is great but some shops need more than that, like bank account number and bank chamber of commerce reg number etc. Is there a way to create more fields just like vat number and new tokens for the new fields? Thank you.

ñull@drupal.org's picture
Offline
Joined: 01/26/2009
Juice: 134
another way to do it

For some this module is may be sufficient. Great advantage is that the number is kept with the address data.