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

VAT-mod for European companies

Views: 114,578

Results 321 to 340 of 362
24 Mar 2012, 5:54 PM
#321
wilorc avatar

wilorc

New Zenner

Join Date:
Sep 2009
Posts:
65
Plugin Contributions:
0

VAT-mod for European companies

I have cut 'n' pasted dimjoula's update for 1.3.9h (see here: http://www.zen-cart.com/forum/showthread.php?t=35744&page=31 ) into a fresh Zencart 1.5.0. Everything worked the same as 1.3.9h for me. I only have on mod installed (Ceon's Excellent Back In Stock notifications), and a template that just adds cosmetic changes. I have also tested this on a completely fresh 1.5.0 install with no changes (including DB), and it worked the same as 1.3.9h. Of course, other Zencart's may differ. I have updated the SQL install file so that it handles the new PCI compliance DB registration for modules.

Here is the link if anyone want to download and test:

http://www.wilorc.co.uk

** PLEASE REMEMBER: This is an unofficial release. It comes with no guarantees. Remember to back up your data and files. **

24 Mar 2012, 11:21 PM
#322
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

Re: VAT-mod for European companies

Thanks wilorc! I'll be trying this out on a test cart. Will post back how it goes. I'm busy with a number of other projects so I may not post back for a week or so.

27 Mar 2012, 2:50 AM
#323
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

Re: VAT-mod for European companies

wilorc:

I have cut 'n' pasted dimjoula's update for 1.3.9h (see here: http://www.zen-cart.com/forum/showthread.php?t=35744&page=31 ) into a fresh Zencart 1.5.0. Everything worked the same as 1.3.9h for me. I only have on mod installed (Ceon's Excellent Back In Stock notifications), and a template that just adds cosmetic changes. I have also tested this on a completely fresh 1.5.0 install with no changes (including DB), and it worked the same as 1.3.9h. Of course, other Zencart's may differ. I have updated the SQL install file so that it handles the new PCI compliance DB registration for modules.

Here is the link if anyone want to download and test:

http://www.wilorc.co.uk

** PLEASE REMEMBER: This is an unofficial release. It comes with no guarantees. Remember to back up your data and files. **

Couldn't wait so I found a small slot of time to try this out. The only problem I found (so far) is the admin/customers.php file was missing and was keeping the vat from showing in customer address info in admin. I used that file from a different package and that fixed the problem.

1 Apr 2012, 9:36 AM
#324
wilorc avatar

wilorc

New Zenner

Join Date:
Sep 2009
Posts:
65
Plugin Contributions:
0

Re: VAT-mod for European companies

Thanks buildingblocks for testing and spotting the missing admin/customers.php file. I have just released an updated version of this unofficial module. It's got the missing admin/customers.phpfile with merged changes from dimjoula'sprevious module, plus I have also modified includes/functions/functions_taxes.php so that VAT exempt EU customers do not see prices with VAT when they are logged into their accounts. VAT is also not displayed on the shipping page for VAT exempt EU customers.

You can download it here: http://www.wilorc.co.uk

5 Apr 2012, 9:00 AM
#325
wilorc avatar

wilorc

New Zenner

Join Date:
Sep 2009
Posts:
65
Plugin Contributions:
0

Re: VAT-mod for European companies

I have made a small, but important, change to:

/includes/functions/functions_taxes.php

On line 55 I've changed:

if ($entry_tva_intracom != "" and $zone_id != STORE_ZONE) {

To be:

if ($entry_tva_intracom != "" and $country_id != STORE_COUNTRY) {

This change will ensure that a VAT registered customer who is registered in the same country as the store does not get zero-rated prices.

7 Apr 2012, 2:09 PM
#326
wilorc avatar

wilorc

New Zenner

Join Date:
Sep 2009
Posts:
65
Plugin Contributions:
0

Re: VAT-mod for European companies

I've discovered that at least one country can no longer be checked with this VAT number checking module. The country is Spain, and there may be others. So I have verified that United Kingdom, Sweden, France, Netherlands, Germany, Belgium, Ireland, Bulgaria and Finland are working. The reason why some countries cannot be checked is because it is using an out-dated method of connecting to VIES. It is using a php function called file_get_contents(). Basically, it is just doing a glorified wget on the VIES website. The correct method to use is ** WSDL SOAP Interface**. I'm going to start work on changing this mod to use the SOAP interface, and it should be available soon.

8 Apr 2012, 11:36 PM
#327
wilorc avatar

wilorc

New Zenner

Join Date:
Sep 2009
Posts:
65
Plugin Contributions:
0

Re: VAT-mod for European companies

I've converted VAT Mod running on my site to use the WSDL SOAP Interface. I've tested and am now running live. All is working normally, and all EU country VAT numbers are being checked correctly. One proviso is that it requires the PHP soap extension to be installed and configured correctly (php.ini), otherwise it will completely break everything, i.e., zencart total screen white-out. For that reason I'm not going to add the new code to the download, but I'm happy to pass it on to anyone who wants it and understands about installing and configuring PHP extension modules.

8 Jun 2012, 8:32 AM
#328
earlofsandwich avatar

earlofsandwich

New Zenner

Join Date:
Jun 2012
Posts:
1
Plugin Contributions:
0

Re: VAT-mod for European companies

Unfortunately the links to both the 1.3.9 and 1.5 version seem to be no longer available. Would anyone be able to post working links please? Many thanks.

19 Jun 2012, 10:41 AM
#329
gerjan avatar

gerjan

New Zenner

Join Date:
Dec 2007
Posts:
74
Plugin Contributions:
0

Re: VAT-mod for European companies

wilorc:

You can download it here: http://www.wilorc.co.uk

Hi Wilorc, is your version still available somewhere? The link doesn't work anymore.

19 Jun 2012, 12:30 PM
#330
kevin_clark avatar

kevin_clark

New Zenner

Join Date:
Mar 2012
Posts:
2
Plugin Contributions:
0

Re: VAT-mod for European companies

I would like to be a third person requesting a new updated link to the 1.3.9 beta version that purportedly works in 1.5 too. Thanks!

19 Jun 2012, 12:56 PM
#331
kevin_clark avatar

kevin_clark

New Zenner

Join Date:
Mar 2012
Posts:
2
Plugin Contributions:
0

Re: VAT-mod for European companies

Wilroc - Just noticed your post numbered 327. I would greatly appreciate the mod utilizing SOAP to be able to query all countries. Also any other changes you made to the original Dimjoula beta version.
Thanks!

31 Jul 2012, 2:20 PM
#332
mattys avatar

mattys

Zen Follower

Join Date:
Sep 2006
Location:
North Devon, England, UK
Posts:
289
Plugin Contributions:
0

Re: VAT-mod for European companies

yeah, would def be good to get a copy of this modified version that should work on zen 1.5

18 Aug 2012, 5:57 PM
#333
wdkstudio avatar

wdkstudio

New Zenner

Join Date:
Jan 2007
Location:
Whitstable - UK
Posts:
48
Plugin Contributions:
0

Re: VAT-mod for European companies

The 1.5 version is now available at http://www.wilorc.co.uk. The download does NOT work for all Countries as outlined on earlier posts in this forum. However here is the code for the "zen_verif_tva" function in includes/functions/extra_functions/functions_vatmod.php:

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);

    $client = new SoapClient("<http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl>");

    if($client){
            $params = array('countryCode' => $prefix, 'vatNumber' => $tva);
            $r = $client->checkVat($params);
            if($r->valid == true){
                    return 'true';
            } else {
                    return 'false';
            }
    } else {
            return 'no_verif';
    }

}

PLEASE NOTE THE FOLLOWING: One proviso is that it requires the PHP soap extension to be installed and configured correctly (php.ini), otherwise it will completely break everything, i.e., zencart total screen white-out. For that reason I'm not going to add the new code to the download, but I'm happy to pass it on to anyone who wants it and understands about installing and configuring PHP extension modules. "

Is anyone able to make the changes to the necessary files and then post them back for everyone to use with necessary instructions?

I must stress this is NOT my work, other than chasing up the re-connection of the original download.
This could be very useful for many zen-cart european store owners / developers.

11 Sep 2012, 1:22 PM
#334
mattys avatar

mattys

Zen Follower

Join Date:
Sep 2006
Location:
North Devon, England, UK
Posts:
289
Plugin Contributions:
0

Re: VAT-mod for European companies

hi wdkstudio

I have a fresh install of zen v5 with this module installed on wampserver, php 5.3.8, can see 'vat' under 'configruation', i also have SOAP enabled, see attached. I replaced the zen_verif_tva code with code above (is this correct or does the above code go alongside existing zen_verif_tva code, not replace it??).

However, I am still getting the 'zencart total screen white-out', as you mentioned i might.

As far as I can see i have done everything correct, have you any idea of where i might be going wrong?

Advice appreciated.

Matt

12 Sep 2012, 7:52 AM
#336
mattys avatar

mattys

Zen Follower

Join Date:
Sep 2006
Location:
North Devon, England, UK
Posts:
289
Plugin Contributions:
0

Re: VAT-mod for European companies

hi wdkstudio

you did say 'One proviso is that it requires the PHP soap extension to be installed and configured correctly (php.ini), otherwise it will completely break everything, i.e., zencart total screen white-out.', and this is what I am experiencing, was just wandering if you could advise how i properly configure soap extension, as, from what you have said above, this is the issue. If the white screen of death is not because of soap, but because code i entered is wrong, it is a php issue.

Referring to my post above, do i just replace the zen_verif_tva code in includes/functions/extra_functions/functions_vatmod.php with the code above? a direct paste over, yes?

matt

13 Sep 2012, 6:40 AM
#337
wdkstudio avatar

wdkstudio

New Zenner

Join Date:
Jan 2007
Location:
Whitstable - UK
Posts:
48
Plugin Contributions:
0

Re: VAT-mod for European companies

Hi Matt

all I did was get the original download link re-enabled. I am working on a site where the VAT mod is required, but have not yet implemented this myself. I had hoped that there might be other people who wanted to use this mod that had more experience of using SOAP that might have come in with some imput.

You do have to replace the zen_verif_tva code in includes/functions/extra_functions/functions_vatmod.php with the code above. Yes, a direct paste over.

Sorry not to be more help.

wdkstudio

Anyhow, you do have to replace

13 Sep 2012, 7:58 AM
#338
mattys avatar

mattys

Zen Follower

Join Date:
Sep 2006
Location:
North Devon, England, UK
Posts:
289
Plugin Contributions:
0

Re: VAT-mod for European companies

ok, cool, thanks for sorting link

i have no experience with SOAP, but, am also working on a zen v1.5 which will need eu vat mod, so, will report back with progress...

7 Oct 2012, 10:06 PM
#339
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Re: VAT-mod for European companies

Soap is installed and activated on my server, but got white out with this modification, could you offer further guidance?

wdkstudio:

The 1.5 version is now available at http://www.wilorc.co.uk. The download does NOT work for all Countries as outlined on earlier posts in this forum. However here is the code for the "zen_verif_tva" function in includes/functions/extra_functions/functions_vatmod.php:

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);

    $client = new SoapClient("<http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl>");

    if($client){
            $params = array('countryCode' => $prefix, 'vatNumber' => $tva);
            $r = $client->checkVat($params);
            if($r->valid == true){
                    return 'true';
            } else {
                    return 'false';
            }
    } else {
            return 'no_verif';
    }

}

PLEASE NOTE THE FOLLOWING: One proviso is that it requires the PHP soap extension to be installed and configured correctly (php.ini), otherwise it will completely break everything, i.e., zencart total screen white-out. For that reason I'm not going to add the new code to the download, but I'm happy to pass it on to anyone who wants it and understands about installing and configuring PHP extension modules. "

Is anyone able to make the changes to the necessary files and then post them back for everyone to use with necessary instructions?

I must stress this is NOT my work, other than chasing up the re-connection of the original download.
This could be very useful for many zen-cart european store owners / developers.

12 Oct 2012, 8:04 AM
#340
stefjuuh avatar

stefjuuh

New Zenner

Join Date:
Apr 2011
Posts:
7
Plugin Contributions:
0

Re: VAT-mod for European companies

It works like heaven, only one thing: The TAX-number is not saved in the database. :(
Anyone has an idea where to start? I really have no idea where ZC gives the command to save in the database.

If I add the number in the back-end, everything works wonderfully. No tax is being calculated if there is a EU tax number active. :)
But my customers can't add their tax-number in the back-end..