Zen Cart Logo
Forums / All Other Contributions/Addons / VAT-mod for European companies

VAT-mod for European companies

Views: 114,578

Results 41 to 60 of 362
24 Jul 2006, 9:54 AM
#41
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

VAT-mod for European companies

Just a reminder: The latest version of the VAT-mod is 1.1 (look in the txt-file) and could be downloaded from here the file in the download section is still version 1.0, I've tried to upload it again...

Cheers!

28 Jul 2006, 9:06 AM
#42
pglock avatar

pglock

New Zenner

Join Date:
Jun 2006
Location:
UK
Posts:
65
Plugin Contributions:
0

Re: VAT-mod for European companies

Thnaks for the mod, this should make life easier when we are selling to other companies in the EU as we are just about to become VAT registered.

I set up the module as directed in the "Install_130.txt" file and it seems to work as described, though we don't have out VAT registration number yet so I can't try it out on a live transaction.

Last night I changed all of our products to tax class "VAT" and made modifications to the pricing so that the price including VAT should be at the price points (e.g. £9.95) we want rather than all over the place (e.g.£10.11). I have set "Admin -> Configuration ->My Store -> Display Prices with Tax" to "true" but none of the prices actually display with tax included to EU resident non-companies. The tax is added on checkout correctly.

Any ideas?

9 Aug 2006, 7:11 PM
#43
mrmarcus66 avatar

mrmarcus66

Zen Follower

Join Date:
Oct 2004
Location:
England
Posts:
109
Plugin Contributions:
0

Re: VAT-mod for European companies

I notice this mod uses the function file_get_contents. My host has disabled the fopen wrappers so I get the following error if I try to verify the VAT number.

Warning: file_get_contents(): URL file-access is disabled in the server configuration in /xxxxxxxx/xxxxxxxx/public_html/shop/includes/functions/functions_email.php on line 529

Warning: file_get_contents(http://www.europa.eu.int/comm/taxation_customs/vies/cgi-bin/viesquer?MS=EL&Lang=FR&VAT=999943280%29: failed to open stream: no suitable wrapper could be found in /xxxxxxxx/xxxxxxxx/public_html/shop/includes/functions/functions_email.php on line 529

without fopen wrappers you will not be able to use file_get_contents for web services requests. does anyone have a work around for this? (Other than change hosts :P)

9 Aug 2006, 11:48 PM
#44
mrmarcus66 avatar

mrmarcus66

Zen Follower

Join Date:
Oct 2004
Location:
England
Posts:
109
Plugin Contributions:
0

Re: VAT-mod for European companies

I replaced some of the code in the file "functions_email.php" to use cURL insted of the file_get_contents function. If you want to try to use this edit you can replace the code starting at line 522 ending 539 with the code you see below.

function zen_verif_tva($num_tva){
$num_tva=preg_replace('/ +/', "", $num_tva);
$prefix = substr($num_tva, 0, 2);
if (array_search($prefix, zen_get_tva_intracom_array() ) === false) {
return 'false';
}
$tva = substr($num_tva, 2);
// create a new curl resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, 'http://ec.europa.eu/taxation_customs/vies/cgi-bin/viesquer?MS=' . $prefix . '&Lang=FR&VAT=' . $tva);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

// grab URL and pass it to a string
$monfd = curl_exec($ch);

// close curl resource, and free up system resources
curl_close($ch);

if ( eregi("TVA non valide", $monfd) ) {
return 'false';
} elseif ( eregi("TVA valide", $monfd) ){
return 'true';
} else {
$myVerif = 'no_verif';
}
return $myVerif;
}

10 Aug 2006, 9:21 AM
#45
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: VAT-mod for European companies

That's handy.

Just a sidenote ... all the changes made to the functions_email.php in this mod .... should have been put into a separate file, in order to make impact on upgrades much simpler.
Since all the "changes" were really just the addition of some extra functions, they would be best placed into a new file at:
/includes/functions/extra_functions/tva_vat_lookup.php

It works fine as-is ... but would be more efficient done this other way.

10 Aug 2006, 3:51 PM
#46
remzi avatar

remzi

New Zenner

Join Date:
Aug 2006
Location:
Istanbul
Posts:
31
Plugin Contributions:
0

Re: VAT-mod for European companies

Thanks. Great job. But in Turkey we have VAT numbers and Tax office.Only VAT numder in not enough. Both of them is a must for commercial sales. Means: On the invoice we have to write both of them. Do yıu have any ide to write two seperate items .Shortly: I need TWO separete inputs. 1- VAT Number and 2-Tax Office
Any help
:no:

11 Aug 2006, 10:53 AM
#47
remzi avatar

remzi

New Zenner

Join Date:
Aug 2006
Location:
Istanbul
Posts:
31
Plugin Contributions:
0

Re: VAT-mod for European companies

High,
I have a problem. By check-out, I want change my adress . In the new form the VAT field is too small. Where can I change the the size of the VAT box for entry VAT number? The filed in the create account is OK. Only by changing / editing the adress, the new box is small!
Thanks

11 Aug 2006, 3:20 PM
#48
remzi avatar

remzi

New Zenner

Join Date:
Aug 2006
Location:
Istanbul
Posts:
31
Plugin Contributions:
0

Re: VAT-mod for European companies

Remzi:

High,
I have a problem. By check-out, I want change my adress . In the new form the VAT field is too small. Where can I change the the size of the VAT box for entry VAT number? The filed in the create account is OK. Only by changing / editing the adress, the new box is small!
Thanks
I added a picture . The same problem occures also by changing the invoice adress !

16 Aug 2006, 12:18 PM
#49
vike avatar

vike

New Zenner

Join Date:
May 2006
Location:
Göteborg
Posts:
17
Plugin Contributions:
0

Re: VAT-mod for European companies

DrByte:

Just a sidenote ... all the changes made to the functions_email.php in this mod .... should have been put into a separate file, in order to make impact on upgrades much simpler.
Since all the "changes" were really just the addition of some extra functions, they would be best placed into a new file at:
/includes/functions/extra_functions/tva_vat_lookup.php

It works fine as-is ... but would be more efficient done this other way.

we have been thinkin alot back and forth about that.. how to do with functions and additional files.. sometime in the begining we thought of not creaing to much new files and as aour modifications grew i guess we stuck to that thought.. but so thanks for pointing out the convention.. we will conform to your standard soon.. love standards - it makes stuff much easier in the future. thanks again. :)

16 Aug 2006, 12:34 PM
#50
vike avatar

vike

New Zenner

Join Date:
May 2006
Location:
Göteborg
Posts:
17
Plugin Contributions:
0

Re: VAT-mod for European companies

Remzi:

Thanks. Great job. But in Turkey we have VAT numbers and Tax office.Only VAT number is not enough. Both of them is a must for commercial sales. Means: On the invoice we have to write both of them. Do you have any ide to write two seperate items .Shortly: I need TWO separete inputs. 1- VAT Number and 2-Tax Office
Any help
:no:

what is the 'tax office' input for? how does it affect the tax? how do you want the mod to calculate with those two inputs and then with countries and such.. you probably must tell us some more about how the turkish vat-system/laws works.. and further since i gather you are not a member of the EU-VAT laws..
but besides that i can say im not sure how much work we are able to put into such country-specific matters.. sorry.. but again please feel free to let us know how your vat-laws works and maybe it is not too much work to be done..
i also wonder how the number-check is thought to be done and what server should be used..
thanks for shown intrest and good luck.. let us know..
/vike

17 Aug 2006, 8:45 AM
#51
remzi avatar

remzi

New Zenner

Join Date:
Aug 2006
Location:
Istanbul
Posts:
31
Plugin Contributions:
0

Re: VAT-mod for European companies

vike:

what is the 'tax office' input for? how does it affect the tax? how do you want the mod to calculate with those two inputs and then with countries and such.. you probably must tell us some more about how the turkish vat-system/laws works.. and further since i gather you are not a member of the EU-VAT laws..
but besides that i can say im not sure how much work we are able to put into such country-specific matters.. sorry.. but again please feel free to let us know how your vat-laws works and maybe it is not too much work to be done..
i also wonder how the number-check is thought to be done and what server should be used..
thanks for shown intrest and good luck.. let us know..
/vike

Thanks Vike,
Tax office is the name of the state-tax office, where the company is registered. For example my company has a tax office, which is GALATA (is a province in Istanbul) and the tax-number is 3445634900. Shortly: Tax office will be registered in the database with the tax-number for each customer. Both of them must be used together. The tax- office has NO effect to tax or to tax calcularion. Hope, ı could explain it. Thanks once more

17 Aug 2006, 10:17 PM
#52
pivey avatar

pivey

Zen Follower

Join Date:
Mar 2006
Posts:
192
Plugin Contributions:
0

Re: VAT-mod for European companies

Now, somebody PLEASE push me to the right direction.
All of the sudden I realized that (for example) a German tax number DE123456
and Country Italy or France let's you create the account :huh:
The MOD worked fine before...the only thing I changed was ....the server.

( I moved hosting provider)

Any thoughts how this can happen?

Dimi

21 Aug 2006, 10:12 AM
#53
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: VAT-mod for European companies

Does the mod check the VAT-number against the server? You can enable/disable it in the admin... If it's enabled and you still can create an account with a German VAT-number and country France or Italy, then we have a problem... Please get back to me.

15 Sep 2006, 11:33 PM
#54
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: VAT-mod for European companies

pivey:

Now, somebody PLEASE push me to the right direction.
All of the sudden I realized that (for example) a German tax number DE123456
and Country Italy or France let's you create the account :huh:
The MOD worked fine before...the only thing I changed was ....the server.

Now I find that the same thing is happing to my.. I'm not sure if it worked before, but I we tested it good... Can someon verify if it did work before. That is, you shouldn't be abl eto enter a German VAT number and choose Country France.

Any way, We're working a fix for this and a general update to the new 1.3.5 version of Zen Cart as well as using more of the override system...

We'll be back soon! In the mean while, if you use this mod, watch out for the malfunction that pivey described...

15 Sep 2006, 11:44 PM
#55
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: VAT-mod for European companies

Remzi:

I added a picture . The same problem occures also by changing the invoice adress !
Sorry for the delay!

If, you havn't fixed it... On line 44 it should read: ```

<?php echo zen_draw_input_field('tva_intracom', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_tva_intracom', '40') . ' id="tva_intracom"') . ' ' . (zen_not_null(ENTRY_TVA_INTRACOM_TEXT) ? '<span class="alert">' . ENTRY_TVA_INTRACOM_TEXT . '</span>': ''); ?>
16 Sep 2006, 12:09 AM
#56
pivey avatar

pivey

Zen Follower

Join Date:
Mar 2006
Posts:
192
Plugin Contributions:
0

Re: VAT-mod for European companies

Hi Beez,

it worked before...it was not possible to create an account with different country the VAT number belongs to. An alert returned to the customer. Was OK then..
I realized that since my upgrade to 1.3.02
Don't know if it is related to the upgrade....

20 Sep 2006, 12:22 PM
#57
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: VAT-mod for European companies

There is now a new version (1.2) for Zen Cart 1.3.5 out. I've uploaded it to the Downloads section, but in the meanwhile it can be downloaded from http://www.sweetfabrik.se/ZC/VAT-mod_135.zip

There were some major flaws in the previous version, making it possible to have a VAT number from Germany and country set to France. Please update to the new version as soon can. The new version should work on 1.3.0.2, but is not tested!

Most of the changes is in /includes/modules/pages/address_book_process/header_php.php, but be sure to do a full file comparison. We've also made a new function file, located in /includes/functions/extra_functions/functions_vatmod.php and /admin/includes/functions/extra_functions/functions_vatmod.php

We've also corrected a bug in the /includes/templates/YOUR_TEMPLATE/template/tpl_modules_address_book_details.php where the company name wouldn't show correctly.

Good luck! And please, report any bug in this thread...

21 Sep 2006, 10:33 AM
#58
djimmy avatar

djimmy

New Zenner

Join Date:
Sep 2006
Posts:
3
Plugin Contributions:
0

Re: VAT-mod for European companies

Hello,

I've installed the brand new version (1.2).
However I've a problem with taxes and shipping cost, witch are not considered in the total.
The shop is in France, there is 2 tax rates : 19.6 and 5.5%

Configuration :
Country : France.
Basis of product tax : Shipping
Basis of Shipping tax : Shipping
Display price with tax : true

Modules > Shipping :
Flat rate :
Shipping cost : 5 €
Taxe : 19.6 %
Tax basis : Shipping.

**Location / taxes **:
Country : France
Zones : all french "states"
Zones definitions : EU => France / All Zones.
Tax classe : Taxe 19.6 %
Taxe 5.5%

Tax Rates : Taxe 19.6 %
Taxe 5.5 %

**What's happening during the checkout : **
individual consummer (not professionnal) with french shipping address.

Example 1 :

In the basket :
1 Product 40.09 TTC (tva 5.5 %) -> tva 5.5 % = 2.09 €
1 Product 2.99 TTC (tva 19.6%) -> tva 19.6 % = 0.49 €

Sous-Total: €43,08 (ok)
shipping : €5,98 (ok, price includes 19.6% tax)
Tva 5.5%: €2,09 (ok)
Tva 19.6%: €0,49 (False, shipping tax are missing : 0.98 €)
Total : €48,08 (False,shipping tax are missing : 0.98 €)

Exemple 2 :

In the basket :
1 Pro****duct 2.99 TTC (tva 19.6 %) -> tva 19.6 % = 0.49 €

Sous total : 2.99 € (ok)
shipping: 5.98 € (ok, price includes 19.6% tax)
Tva 19.6 % : 0.49 (False, shipping tax are missing : 0.98 €)
Total : 7.99 (False, shipping tax are missing : 0.98 €)

Conclusion :
shipping Taxes seems not to be added. Before the module installation, that part was working

Sorry for my english, ask for explainations if some part are not clear

21 Sep 2006, 2:12 PM
#59
azrahn avatar

azrahn

Zen Follower

Join Date:
Jun 2006
Location:
Koh Samui
Posts:
120
Plugin Contributions:
0

Re: VAT-mod for European companies

Hi,

Is this module also for zencart 1.3.5 or only for previous versions?

Ronald.

21 Sep 2006, 4:26 PM
#60
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: VAT-mod for European companies

djimmy:

I've installed the brand new version (1.2).
Have you done a fresh install of 1.2? The latest version of Zen Cart is 1.3.5...

As for the VAT-mod, we started development for 1.2.7, but as of now we're only distributing a version to 1.3.5. All version before the latest is to be considered BETA-releases, due to bugs that makes them not working as they should.

My Power tip of the day would be to make a (an other) fresh install of Zen Cart 1.3.5 :)