Jump to content

Champ tva intra obligatoire pour les pays de L'UE mais pas la france


Recommended Posts

Salut a tous,

 

Utilisant un thème non natif, je n'ai pas reussi a utiliser bien correctement le champ TVA intra (vat_number)

 

Hors j'ai besoin que ce champ soit obligatoire pour tous les clients de l'UE hors France.

 

Voici donc mon petit hack sur une 1.5, vos remarques et suggestions sont les bienvenus.

 

 Dans AddressController.php (ligne 163 sous $address->dni = null; )

 

AJOUTER :

 

/*###AJOUT TVA INTRA */
$tva_intra = Tools::getValue('vat_number');
$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',
//Slovenia
'RO' => 'RO',
//Romania
'BG' => 'BG'
//Bulgaria
);
if( array_key_exists(Country::getIsoById($address->id_country), $intracom_array) ) {
$this->errors[] = Tools::displayError('Numero TVA');
}
/*###FIN AJOUT TVA INTRA */

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...