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

VAT-mod for European companies

Views: 114,578

Results 221 to 240 of 362
26 May 2009, 11:11 AM
#221
bobanct avatar

bobanct

New Zenner

Join Date:
Feb 2009
Location:
England
Posts:
31
Plugin Contributions:
0

VAT-mod for European companies

Can anybody help me overcome this error with VatMod 138a V130

Parse error: syntax error, unexpected T_RETURN, expecting ')' in /home/netformi/public_html/store/admin/includes/functions/extra_functions/functions_vatmod.php on line 131

This is code in the file:

function zen_get_tva_intracom_array() {
$intracom_array = array('AT'=>'AT', //Austria
'BE'=>'BE', //Belgium
'DK'=>'DK', //Denmark
'FI'=>'FI', //Finland
'FR'=>'FR', //France
'FX'=>'FR', //France métropolitaine
'DE'=>'DE', //Germany
'GR'=>'EL', //Greece
'IE'=>'IE', //Irland
'IT'=>'IT', //Italy
'LU'=>'LU', //Luxembourg
'NL'=>'NL', //Netherlands
'PT'=>'PT', //Portugal
'ES'=>'ES', //Spain
'SE'=>'SE', //Sweden
'GB'=>'GB', //United Kingdom
'CY'=>'CY', //Cyprus
'EE'=>'EE', //Estonia
'HU'=>'HU', //Hungary
'LV'=>'LV', //Latvia
'LT'=>'LT', //Lithuania
'MT'=>'MT', //Malta
'PL'=>'PL', //Poland
'SK'=>'SK', //Slovakia
'CZ'=>'CZ', //Czech Republic
'SI'=>'SI',//Slovania
'RO'=>'RO', //Romania
'BG'=>'BG',//Bulgaria
return $intracom_array;)
}
?>

LINE 131 is return $intracom_array;)

26 May 2009, 11:38 AM
#222
agelec avatar

agelec

New Zenner

Join Date:
Mar 2009
Posts:
13
Plugin Contributions:
1

Re: VAT-mod for European companies

bobanct:

Can anybody help me overcome this error with VatMod 138a V130

Parse error: syntax error, unexpected T_RETURN, expecting ')' in /home/netformi/public_html/store/admin/includes/functions/extra_functions/functions_vatmod.php on line 131

This is code in the file:

function zen_get_tva_intracom_array() {
$intracom_array = array('AT'=>'AT', //Austria
'BE'=>'BE', //Belgium
'DK'=>'DK', //Denmark
'FI'=>'FI', //Finland
'FR'=>'FR', //France
'FX'=>'FR', //France métropolitaine
'DE'=>'DE', //Germany
'GR'=>'EL', //Greece
'IE'=>'IE', //Irland
'IT'=>'IT', //Italy
'LU'=>'LU', //Luxembourg
'NL'=>'NL', //Netherlands
'PT'=>'PT', //Portugal
'ES'=>'ES', //Spain
'SE'=>'SE', //Sweden
'GB'=>'GB', //United Kingdom
'CY'=>'CY', //Cyprus
'EE'=>'EE', //Estonia
'HU'=>'HU', //Hungary
'LV'=>'LV', //Latvia
'LT'=>'LT', //Lithuania
'MT'=>'MT', //Malta
'PL'=>'PL', //Poland
'SK'=>'SK', //Slovakia
'CZ'=>'CZ', //Czech Republic
'SI'=>'SI',//Slovania
'RO'=>'RO', //Romania
'BG'=>'BG',//Bulgaria
return $intracom_array;)
}
?>

LINE 131 is return $intracom_array;)

**
Correction The Error is**

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/netformi/public_html/store/admin/includes/functions/extra_functions/functions_vatmod.php on line 129

Code

function zen_get_tva_intracom_array() {
$intracom_array = array('AT'=>'AT',    //Austria
'BE'=>'BE',	//Belgium
'DK'=>'DK',	//Denmark
'FI'=>'FI',	//Finland
'FR'=>'FR',	//France
'FX'=>'FR',	//France métropolitaine
'DE'=>'DE',	//Germany
'GR'=>'EL',	//Greece
'IE'=>'IE',	//Irland
'IT'=>'IT',	//Italy
'LU'=>'LU',	//Luxembourg
'NL'=>'NL',	//Netherlands
'PT'=>'PT',	//Portugal
'ES'=>'ES',	//Spain
'SE'=>'SE',	//Sweden
'GB'=>'GB',	//United Kingdom
'CY'=>'CY',	//Cyprus
'EE'=>'EE',	//Estonia
'HU'=>'HU',	//Hungary
'LV'=>'LV',	//Latvia
'LT'=>'LT',	//Lithuania
'MT'=>'MT',	//Malta
'PL'=>'PL',	//Poland
'SK'=>'SK', //Slovakia
'CZ'=>'CZ',	//Czech Republic
'SI'=>'SI');//Slovania
'RO'=>'RO', //Romania   (LINE 129)
'BG'=>'BG'); //Bulgaria
return $intracom_array;
}

This error shows up when trying to enter the admin section of the store.

Andrew

26 May 2009, 11:54 AM
#223
agelec avatar

agelec

New Zenner

Join Date:
Mar 2009
Posts:
13
Plugin Contributions:
1

Re: VAT-mod for European companies

Fixed the above with this post. :smile:

a1m.Overlord:

Hey,

I just tried to install the mod and got a white screen too...

In my case the functions_vatmod.php is broken (in includes/... and admin/includes/...)

edit (from line 121 to end)

'CZ'=>'CZ', //Czech Republic
'SI'=>'SI');//Slovania
'RO'=>'RO', //Romania
'BG'=>'BG'); //Bulgaria
return $intracom_array;
}
?>

> 
> to
> ```php
'CZ'=>'CZ',	//Czech Republic
'SI'=>'SI', //Slovania
'RO'=>'RO', //Romania
'BG'=>'BG'); //Bulgaria
return $intracom_array;
}
?>

If I'm wrong and the array is broken with intend, please tell me ;)

MfG

30 May 2009, 3:59 PM
#224
plandon avatar

plandon

New Zenner

Join Date:
May 2009
Posts:
4
Plugin Contributions:
0

Re: VAT-mod for European companies

Hi,
I'm just starting a new zen 1.38a site. Looking at the install instructions for the VAT Mod there are references to catalog/includes......
Where do I find this "catalog" folder? Or do I have to create it?

regards
Peter Landon

30 May 2009, 5:05 PM
#225
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: VAT-mod for European companies

This is a great Mod and one I am very pleased to find - thanks to the tauthor and to all those who have helped 'shape' it to work brilliantly.

I do have a question for anybody who would like to take on this challenge:

It clashes with another very useful mod I have, namely the referral mod (where did you hear about us.....) The main problem is that despite merging a file here and there, one of the new files with the VAT mod is getting the better of me and the referral entry box on the create account page is not showing. I think it has something to do with tpl_modules_create_account.php.

Is there anybody who can help me combine these two fine mods so that they both work?

Many thanks

Rob

30 May 2009, 5:13 PM
#226
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: VAT-mod for European companies

Hi plandon

'catalog' simply refers to the directory you installed the main zencart files in.

For example..... public_html/ or public_html/store/, etc

Rob

30 May 2009, 6:49 PM
#227
plandon avatar

plandon

New Zenner

Join Date:
May 2009
Posts:
4
Plugin Contributions:
0

Re: VAT-mod for European companies

Thanks. I should have figured that one out!
A bigger problem - I'm running the German language install of 1.38a and when I try to run the SQL file in PHPadmin I get an error message - #1146 - Table 'fn2010.configuration_group' doesn't exist.
Running it through Zen Cart interface gives:"1136 Column count doesn't match value count at row 1
in:
[INSERT INTO zen_configuration_group VALUES (27, "VAT-Mod", "VAT-Mod options", 27, 1);]"

Any idea how to get round this?
regards
Peter

31 May 2009, 10:20 AM
#228
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: VAT-mod for European companies

Hi

Errr nope. Beyond my knowledge I am afraid. I am sure someone clever like Kim or whoever can sort this out quickly for you.

If I get any errors like this I usually try to run the sql querly again in 'bite sized chunks' to see if I can isolate the error - but that's my simpleton way of thinking.

Good luck

Rob

31 May 2009, 3:43 PM
#229
plandon avatar

plandon

New Zenner

Join Date:
May 2009
Posts:
4
Plugin Contributions:
0

Re: VAT-mod for European companies

It seems that there are more than just a couple of differences between the UK and German installs. I'll just have to put up with a less than ideal B2B system for the time being.
Thanks anyway.
regards
Peter

1 Jun 2009, 8:34 AM
#230
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: VAT-mod for European companies

robsnowden:

I am sure someone clever like Kim or whoever can sort this out quickly for you.As Kim will be tucked up in bed at the moment, I'm afraid you'll have to settle for whoever :wink:

plandon:

I'm running the German language install of 1.38a and when I try to run the SQL file in PHPadmin I get an error message - #1146 - Table 'fn2010.configuration_group' doesn't exist.
Running it through Zen Cart interface gives:"1136 Column count doesn't match value count at row 1
in:
[INSERT INTO zen_configuration_group VALUES (27, "VAT-Mod", "VAT-Mod options", 27, 1);]"The first error is because you're using a database prefix "zen_" about which phpMyAdmin knows nothing. However the Zen Cart SQL patch facility does, so you need to either edit the table names in the sql to iunclude your prefix, or run it via the SQL patch utility.

I'm not familiar with the German version, but I believe that it goes a little beyond mere linguistic variances and tweaks code and even (the 2nd error suggests) table structures. If you try the following through the phpMyAdmin you will hopefully fare better> INSERT INTO zen_configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (27, "VAT-Mod", "VAT-Mod options", 27, 1);

1 Jun 2009, 8:47 AM
#231
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: VAT-mod for European companies

You are clever too Kuroi and have indeed helped me out on many occassions - :)

No offence intended!

Rob

6 Jun 2009, 7:03 PM
#232
micromouse avatar

micromouse

New Zenner

Join Date:
Apr 2007
Location:
UK
Posts:
22
Plugin Contributions:
0

Re: VAT-mod for European companies

agelec:

Fixed the above with this post. :smile:
And this worked with me

Wayne

12 Jul 2009, 10:49 AM
#233
marksu avatar

marksu

Zen Follower

Join Date:
Nov 2007
Posts:
260
Plugin Contributions:
0

Re: VAT-mod for European companies

I got same problem at my store.
How can I make it calculate Gross and net correctly?

Module reguires to have 2 Taxable Goods settings EEC VAT Zone and local country (finland).
Both are set tax rate 22%. Problem seems it uses both tax rates in product edit form, therefore using tax 44%.

The quoted example takes 2 x 21% = 42%.

What is the fix?

amoros:

HI

Thanks for this great mod.

I installed it but my Gross prices in Admin do not compute properly. Her is my Tax config:

TAX CLASSES
1 tax class : VAT

ZONES DEFINITIONS
1st zone : Belgium
2nd zone: EU (European Union)

TAX RATES
*Tax rates 1: * Tax Class: VAT, Zone: EU, Tax Rate: 21%, Priority 1
*Tax rates 2: * Tax Class: VAT, Zone: EU, Tax Rate: 21%, Priority 2

Everything works fine at checkout and it works nicelly except for one important problem:

When I input Net Prices in Admin and choose VAT as Taxe rate, ZenCart compute 2x the VAT to calculate the Gross price.

for example: I input Net Price 100 and choose Tax Rate VAT (21%) it should compute a Gross price of 121, but instead it gives me a Gross Price of 142 !!

What can be wrong ? PLEASE HELP

My Config is as follow
Basis of Product Tax is Shipping
Basis of Shipping Tax is Shipping
Display Prices with Taxe is True
Display Prices with Taxes in Admin is True
Sales Tax Display is 1

24 Jul 2009, 2:56 PM
#234
jakesct avatar

jakesct

New Zenner

Join Date:
Jul 2009
Posts:
5
Plugin Contributions:
0

Re: VAT-mod for European companies

Hi, I have just installed your VAT Module, I actually have my store in South Africa though, How do I set it up so that it doesn't check the VAT number, I just want the client to fill it in.

I have changes in admin->VAT-mod "check VAT number" to false and "Miniumum Numbers" to 0

What else do I need to change, Thank you for your help.

31 Jul 2009, 5:04 PM
#235
jazznuts699 avatar

jazznuts699

New Zenner

Join Date:
Jul 2009
Posts:
72
Plugin Contributions:
0

Re: VAT-mod for European companies

JakesCT:

Hi, I have just installed your VAT Module, I actually have my store in South Africa though, How do I set it up so that it doesn't check the VAT number, I just want the client to fill it in.

I have changes in admin->VAT-mod "check VAT number" to false and "Miniumum Numbers" to 0

What else do I need to change, Thank you for your help.

that should be it -- i am currently testing this mod and with those 2 changed you mentioned the mod does not check the VAT#

4 Aug 2009, 4:29 PM
#236
jazznuts699 avatar

jazznuts699

New Zenner

Join Date:
Jul 2009
Posts:
72
Plugin Contributions:
0

Re: VAT-mod for European companies

agelec:

**
Correction The Error is**

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/netformi/public_html/store/admin/includes/functions/extra_functions/functions_vatmod.php on line 129

Code

function zen_get_tva_intracom_array() {
$intracom_array = array('AT'=>'AT', //Austria
'BE'=>'BE', //Belgium
'DK'=>'DK', //Denmark
'FI'=>'FI', //Finland
'FR'=>'FR', //France
'FX'=>'FR', //France métropolitaine
'DE'=>'DE', //Germany
'GR'=>'EL', //Greece
'IE'=>'IE', //Irland
'IT'=>'IT', //Italy
'LU'=>'LU', //Luxembourg
'NL'=>'NL', //Netherlands
'PT'=>'PT', //Portugal
'ES'=>'ES', //Spain
'SE'=>'SE', //Sweden
'GB'=>'GB', //United Kingdom
'CY'=>'CY', //Cyprus
'EE'=>'EE', //Estonia
'HU'=>'HU', //Hungary
'LV'=>'LV', //Latvia
'LT'=>'LT', //Lithuania
'MT'=>'MT', //Malta
'PL'=>'PL', //Poland
'SK'=>'SK', //Slovakia
'CZ'=>'CZ', //Czech Republic
'SI'=>'SI');//Slovania
'RO'=>'RO', //Romania (LINE 129)
'BG'=>'BG'); //Bulgaria
return $intracom_array;
}

> 
> This error shows up when trying to enter the admin section of the store.
> 
> Andrew


i had this error and i fixed it by removing the ');' from line 128 and replacing it with a ','.  

'CZ'=>'CZ', //Czech Republic
'SI'=>'SI',//Slovania
'RO'=>'RO', //Romania
'BG'=>'BG'); //Bulgaria
return $intracom_array;


looks like 2 extra countries were added after slovania :)
5 Aug 2009, 6:55 PM
#237
jazznuts699 avatar

jazznuts699

New Zenner

Join Date:
Jul 2009
Posts:
72
Plugin Contributions:
0

Re: VAT-mod for European companies

Hello -- i had some problems with this mod when using group disounts. I found that there was a problem with the group discount logic and vat tax.

I found this [post - http://www.zen-cart.com/forum/showthread.php?t=120341](http://www.zen-cart.com/forum/showthread.php?t=120341) which discussed the discount+tax problem and a possible solution (not related to the VAT mod). It looks like this problem propogates to the VAT mod. By modifying the code below i was able to get my discounts+vat to work properly.

This works in my version on zencart which is 1.3.8. please use at own risk -- create a backup of the files being modded before aplying this 'fix'. I am not a full time programmer thus i have not run this mod through X number of versions -- it works in my environment (php 5.2.5, apache 2.2.6, mysql 5.0.45, zen 1.3.8)

Please note in the 3rd file (ot_group_pricing.php) there is a line of code which is supposed to address group disounts which do not include shipping and tax to calculate the discount. I initially added this line in but it messed up the calculations. I was able to get the correct values by commenting this line out -- it works when i have both values to false in the group-disount mod.

I hope this helps someone as it definately helped me -- maybe if someone can test this thoroughly then it could be added to the next version of the VAT mod :).

in includes/classes/order.php

'subtotal' => 0,
'shipping_tax'=>0, //added per [url]http://www.zen-cart.com/forum/showthread.php?t=120341[/url]
'tax' => 0,
'total' => 0,

in includes/modules/order_total/ot_shipping.php

// TVA_INTRACOM REPLACE BEGIN  ..$calculated_tax = $shipping_tax_amount
          }
		}
		$calculated_tax = zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
		if($tva_tax){
		  $order->info['tax'] += $calculated_tax;
		  $order->info['tax_groups']["$shipping_tax_description"] += $calculated_tax;
		  $order->info['shipping_tax'] += $calculated_tax; //added as per [url]http://www.zen-cart.com/forum/showthread.php?t=120341[/url]
		  $order->info['total'] += $calculated_tax;
		}
          if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
        //}
// TVA_INTRACOM REPLACE END

in /includes/modules/order_total/ot_group_pricing.php

function get_order_total() {
   global  $order;
   $order_total_tax = $order->info['tax'];
   $order_total = $order->info['total'];
   if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost']; 
   if ($this->include_shipping != 'true') $order_total_tax -= $order->info['shipping_tax']; //added per [url]http://www.zen-cart.com/forum/showthread.php?t=120341[/url]
   if ($this->include_tax != 'true') $order_total -= $order->info['tax'];
   //if ($this->include_tax != "true" && $this->include_shipping != 'true') $order_total += $order->info['shipping_tax'];  //adding this did not work for me total was incorrect 
   $orderTotalFull = $order_total;
   $order_total = array('totalFull'=>$orderTotalFull, 'total'=>$order_total, 'tax'=>$order_total_tax);

   return $order_total;
 }

:clap:

27 Aug 2009, 3:59 PM
#238
jazznuts699 avatar

jazznuts699

New Zenner

Join Date:
Jul 2009
Posts:
72
Plugin Contributions:
0

Re: VAT-mod for European companies

Daniel21:

I think that I have found the solution:
Change the last lines of the file
zen-cart-v1.3.8a\includes\functions\extra_functions\functions_vatmod.php

from

if ($tva_intracom->fields['country_id'] === $store_country->fields['store_country']) {
return false;
} else {
return true;

to

if ($tva_intracom->fields['country_id'] === $store_country->fields['store_country']) {
return false;
} elseif ($tva_intracom->fields['tva_intracom'] === '') {
return false;
} else {
return true;

i wanted to make sure you do not miss the above fix (as i somehow did even though i went through all 24 pages) and install this into your VAT mod 1.3.0. the above makes sure that private parties in the EU are charged VAT tax. without this when selling in the EU only private parties in your home country are charged VAT tax (private parties outside of your home country in the EU are not charged VAT which is incorrect).

1 Sep 2009, 11:41 AM
#239
martyndw2005 avatar

martyndw2005

Zen Follower

Join Date:
Aug 2005
Posts:
70
Plugin Contributions:
0

Re: VAT-mod for European companies

I wish to thank jazznuts699 for providing the fix for the functions_vatmod which was a real problem upgrading to 1.3.8 with latest vat mod.

We installed the vat module around 18 months ago and its worked fine since however since upgrade to 1.3.8 all european customers are not being charged vat.

For example I am based in UK and get charged vat at checkout, all products i view on main website show price with and without vat. If I change my delivery address to spain, france etc it still calculates the correct vat. But all old or new european customers are not being charged vat.

If any customer in europe places an order all products show the same price for incl and excl vat i.e. £1.00 excl vat / £1.00 incl vat and no vat is charged at checkout - even if a new european country address is added to the account no vat is charged.

ADDED - just to clarify the vat module works fine and shows the vat correctly as it should, just not doing that with european customers.

Martyn

3 Sep 2009, 9:22 AM
#240
rayspike avatar

rayspike

New Zenner

Join Date:
Apr 2009
Posts:
25
Plugin Contributions:
0

Re: VAT-mod for European companies

RaySpike:

Solution is this:

find ```
// disable the module if the order only contains virtual products
if ($this->enabled == true) {
if ($order->content_type != 'physical') {
$this->enabled = false;
}
}

> 
> 
> and insert next code
> ```
// disable only when billingaddress has a correct VAT-Number
      $order_check = $db->Execute("select entry_tva_intracom
                             from " . TABLE_ADDRESS_BOOK . "
                             "); // TVA_INTRACOM
      if ($this->enabled == true) {
if (zen_not_null($order_check->fields['entry_tva_intracom'])) {
          $this->enabled = true;}
		  else {
		  $this->enabled = false;
        }
      }

So now people with a right VAT-Number in their Billing-Address can pay with COD, customers without a VAT-Number in their billing-address can't pay with COD.

Unfortunately is this for 100% correct. In this query it will look if the VAT-Number is in the address-book. Not especially for billing-address.

How can I do this, that is only for billing-address purpose?

Solution is this query (WHERE address_book_id = '" . (int)$_SESSION['billto'] . "'):

      $order_check = $db->Execute("select entry_tva_intracom
                             from " . TABLE_ADDRESS_BOOK . "
                             WHERE address_book_id = '" . (int)$_SESSION['billto'] . "'
                             "); // TVA_INTRACOM