New: Vrification par web service de la validit du code tva intracommunautaire

This commit is contained in:
Laurent Destailleur 2006-12-16 13:45:59 +00:00
parent 0cdd21a26f
commit 66b59fef23
13 changed files with 348 additions and 38 deletions

View File

@ -62,12 +62,12 @@ class Form
/**
\brief Affiche un texte avec picto help qui affiche un tooltip
\param text Texte à afficher
\param htmltooltip Contenu html du tooltip
\brief Affiche un texte avec picto help qui affiche un tooltip
\param text Texte à afficher
\param htmltooltip Contenu html du tooltip
\param direction 1=Le picto est après, -1=le picto est avant
\param usehelpcursor 1=Utilise curseur help, 0=Curseur par defaut
\param string Code html du texte.picto
\return string Code html du texte,picto
*/
function textwithhelp($text,$htmltext,$direction=1,$usehelpcursor=1)
{

View File

@ -76,6 +76,8 @@ ProfId4PT=Conservatory
TVAIntra=Intracommunautary VAT
VATIntraShort=Intra-communautary VAT code
VATIntraVeryShort=VAT Intra-comm.
VATIntraSyntaxIsValid=Syntax is valid
VATIntraValueIsValid=Value is valid
ProspectCustomer=Prospect / Customer
Prospect=Prospect
CustomerCard=Customer Card
@ -135,8 +137,12 @@ Capital=Capital
CapitalOf=Capital of %s
EditCompany=Edit company
ThisUserIsNot=This user is not a prospect, customer nor supplier
VATIntraCheck=Check
VATIntraCheckDesc=The link <b>%s</b> allows to ask the european VAT checker service. An external internet access from server is required for this service to work.
VATIntraCheckURL=http://europa.eu.int/comm/taxation_customs/vies/fr/vieshome.htm
VATIntraCheckableOnEUSite=Check Intracomunnautary VAT on European commision site
VATIntraManualCheck=You can also check manually from european web site <a href="%s" target="_new">%s</a>
ErrorVATCheckMS_UNAVAILABLE=Check not possible. Check service is not provided by the member state (%s).
NorProspectNorCustomer=Nor prospect, nor customer
JuridicalStatus=Juridical status
Staff=Staff

View File

@ -26,6 +26,7 @@ ErrorRecordIsUsedByChild=Failed to delete this record. This record is used by at
ErrorWrongValue=Wrong value
ErrorWrongValueForParameterX=Wrong value for parameter %s
ErrorNoRequestInError=No request in error
ErrorServiceUnavailableTryLater=Service not available or busy for the moment. Try again later.
SeeAbove=See above
HomeArea=Home area
LastConnexion=Last connexion
@ -343,6 +344,9 @@ ExpandAll=Expand all
UndoExpandAll=Undo expand
Reason=Raison
FeatureNotYetSupported=Feature not yet supported
CloseWindow=Close window
Question=Question
Response=Response
# Countries
CountryFR=France
CountryBE=Belgium

View File

@ -314,7 +314,7 @@ VATReceivedOnly=Taux special non factur
VATManagement=Gestion TVA
VATIsUsed=Assujéti à TVA
VATIsNotUsed=Non assujéti à TVA
VATIsUsedDesc=Le taux de TVA proposé par défaut lors de la création de propale, facture, commande, etc répond à la règle standard suivante:<br>Si le (pays vendeur = pays acheteur) alors la TVA par défaut=TVA du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par défaut=0 (La TVA doit être payé par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu autre que transport neuf alors la TVA par défaut=TVA du produit dans le pays du vendeur. Fin de règle.<br>Sinon la TVA proposée par défaut=0. Fin de règle.
VATIsUsedDesc=Le taux de TVA proposé par défaut lors de la création de propale, facture, commande, etc répond à la règle standard suivante:<br>Si vendeur non assujeti à TVA, TVA par défaut=0. Fin de règle.<br>Si le (pays vendeur = pays acheteur) alors TVA par défaut=TVA du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par défaut=0 (La TVA doit être payé par acheteur au centre d'impots de son pays et non au vendeur). Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et acheteur = particulier ou entreprise sans num TVA intra alors TVA par défaut=TVA du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et acheteur = entreprise avec num TVA intra alors TVA par défaut=0. Fin de règle.<br>Sinon TVA proposée par défaut=0. Fin de règle.<br>
VATIsNotUsedDesc=Le taux de TVA proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés.
VATIsUsedExampleFR=En France, il s'agit des sociétés ou organismes ayant choisi un régime fiscale réel (Réel simplifié ou Réel normal), régime dans lequel la TVA est déclarée.
VATIsNotUsedExampleFR=En France, il s'agit des associations ne déclarant pas de TVA ou sociétés, organismes ou professions libérales ayant choisi le régime fiscal micro entreprise (TVA en franchise) et payant une TVA en franchise sans faire de déclaration de TVA. Ce choix fait de plus apparaitre la mention "TVA non applicable - art-293B du CGI" sur les factures.

View File

@ -76,6 +76,8 @@ ProfId4PT=Conservatory
TVAIntra=Numéro de TVA Intracommunautaire
VATIntraShort=N° TVA Intra-communautaire
VATIntraVeryShort=TVA Intra-comm.
VATIntraSyntaxIsValid=Syntaxe valide
VATIntraValueIsValid=Valeure valide
ProspectCustomer=Prospect / Client
Prospect=Prospect
CustomerCard=Fiche Client
@ -135,8 +137,12 @@ Capital=Capital
CapitalOf=Capital de %s
EditCompany=Modification société
ThisUserIsNot=Cet utilisateur n'est ni un prospect, ni un client, ni un fournisseur
VATIntraCheck=Vérifier
VATIntraCheckDesc=Le lien <b>%s</b> permet d'interroger le service européen de contrôle des numéro de TVA intracommunautaire. Un accès au monde internet exterieur depuis le serveur est requis pour que ce service fonctionne.
VATIntraCheckURL=http://europa.eu.int/comm/taxation_customs/vies/fr/vieshome.htm
VATIntraCheckableOnEUSite=Vérifier sur le site de la Commission Européenne
VATIntraManualCheck=Vous pouvez aussi vérifier manuellement via le site européen <a href="%s" target="_new">%s</a>
ErrorVATCheckMS_UNAVAILABLE=Vérification impossible. Le service de vérification n'est pas fourni par ce pays membre (%s).
NorProspectNorCustomer=Ni client, ni prospect
JuridicalStatus=Forme juridique
Staff=Effectif

View File

@ -26,6 +26,7 @@ ErrorRecordIsUsedByChild=Impossible de supprimer cet enregistrement. Ce dernier
ErrorWrongValue=Valeur incorrecte
ErrorWrongValueForParameterX=Valeur incorrecte pour le paramètre %s
ErrorNoRequestInError=Aucune requete en erreur
ErrorServiceUnavailableTryLater=Service non disponible ou saturé actuellement. Réessayer plus tard.
SeeAbove=Voir ci-dessus
HomeArea=Espace accueil
LastConnexion=Dernière connexion
@ -345,6 +346,9 @@ ExpandAll=Tout d
UndoExpandAll=Annuler déroulement
Reason=Raison
FeatureNotYetSupported=Fonctionnalité pas encore supportée
CloseWindow=Fermer fenêtre
Question=Question
Response=Réponse
# Countries
CountryFR=France
CountryBE=Belgique

View File

@ -1832,10 +1832,11 @@ function price2num($amount)
/**
* \brief Fonction qui renvoie la tva d'une ligne (en fonction du vendeur, acheteur et taux du produit)
* \remarks Si vendeur non assujeti à TVA, TVA par défaut=0. Fin de règle.
* Si le (pays vendeur = pays acheteur) alors la TVA par défaut=TVA du produit vendu. Fin de règle.
* Si vendeur et acheteur dans Communauté européenne et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par défaut=0 (La TVA doit être payé par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de règle.
* Si vendeur et acheteur dans Communauté européenne et bien vendu autre que transport neuf alors la TVA par défaut=TVA du produit vendu. Fin de règle.
* Sinon la TVA proposée par défaut=0. Fin de règle.
* Si le (pays vendeur = pays acheteur) alors TVA par défaut=TVA du produit vendu. Fin de règle.
* Si vendeur et acheteur dans Communauté européenne et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par défaut=0 (La TVA doit être payé par acheteur au centre d'impots de son pays et non au vendeur). Fin de règle.
* Si vendeur et acheteur dans Communauté européenne et acheteur = particulier ou entreprise sans num TVA intra alors TVA par défaut=TVA du produit vendu. Fin de règle.
* Si vendeur et acheteur dans Communauté européenne et acheteur = entreprise avec num TVA intra alors TVA par défaut=0. Fin de règle.
* Sinon TVA proposée par défaut=0. Fin de règle.
* \param societe_vendeuse Objet société vendeuse
* \param societe_acheteuse Objet société acheteuse
* \param taux_produit Taux par defaut du produit vendu
@ -1860,12 +1861,18 @@ function get_default_tva($societe_vendeuse, $societe_acheteuse, $taux_produit)
// Si vendeur et acheteur dans Communauté européenne et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par défaut=0 (La TVA doit être payé par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de règle.
// Non géré
// Si vendeur et acheteur dans Communauté européenne et bien vendu autre que transport neuf alors la TVA par défaut=TVA du produit vendu. Fin de règle.
if (is_object($societe_acheteuse) && ($societe_vendeuse->isInEEC() && $societe_acheteuse->isInEEC()) && $societe_acheteuse->tva_assuj == 1)
// Si vendeur et acheteur dans Communauté européenne et acheteur = particulier ou entreprise sans num TVA intra alors TVA par défaut=TVA du produit vendu. Fin de règle.
if (is_object($societe_acheteuse) && ($societe_vendeuse->isInEEC() && $societe_acheteuse->isInEEC()) && ! $societe_acheteuse->tva_intra)
{
return $taux_produit;
}
// Si vendeur et acheteur dans Communauté européenne et acheteur = entreprise avec num TVA intra alors TVA par défaut=0. Fin de règle.
if (is_object($societe_acheteuse) && ($societe_vendeuse->isInEEC() && $societe_acheteuse->isInEEC()) && $societe_acheteuse->tva_intra)
{
return 0;
}
// Sinon la TVA proposée par défaut=0. Fin de règle.
return 0;
}

View File

@ -738,3 +738,20 @@ function parseDate(val) {
// Fonction pour champ saisie en mode ajax
function publish_selvalue(obj) { $(obj.name).value = obj.options[obj.selectedIndex].value; }
/*=================================================================
Purpose: affiche popup
Input: url,title
==================================================================*/
function newpopup(url,title) {
var argv = newpopup.arguments;
var argc = newpopup.arguments.length;
tmp=url;
var l = (argc > 2) ? argv[2] : 600;
var h = (argc > 3) ? argv[3] : 400;
var wfeatures="directories=0,menubar=0,status=0,resizable=0,scrollbars=1,toolbar=0,width="+l+",height="+h+",left=" + eval("(screen.width - l)/2") + ",top=" + eval("(screen.height - h)/2");
fen=window.open(tmp,title,wfeatures);
return false;
}

View File

@ -24,10 +24,10 @@
*/
/**
\file htdocs/soc.php
\ingroup societe
\brief Onglet societe d'une societe
\version $Revision$
* \file htdocs/soc.php
* \ingroup societe
* \brief Onglet societe d'une societe
* \version $Revision$
*/
require("pre.inc.php");
@ -411,24 +411,41 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id);
print '</td></tr>';
// TVA Intra
print '<tr><td nowrap><div id="particulier4" class="visible">'.$langs->trans('VATIntraShort').'</div></td><td colspan="3">';
print '<div id="particulier5" class="visible">';
print '<input type="text" name="tva_intra_code" size="3" maxlength="2" value="'.$soc->tva_intra_code.'">';
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">';
print ' <a href="'.$langs->transcountry("VATIntraCheckURL",$soc->id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
print '</div>';
print '</td></tr>';
//print '</div>'."\n";
//print '</div>'."\n";
// Assujeti TVA
$html = new Form($db);
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
$html->select_YesNo("1",'assujtva_value'); // Assujeti par défaut
print '</td></tr>'."\n";
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td>';
$html->select_YesNo("1",'assujtva_value'); // Assujeti par défaut en creation
print '</td>';
// Code TVA intra
if ($conf->use_javascript)
{
print "\n";
print '<script language="JavaScript" type="text/javascript">';
print "function CheckVAT(a,b) {\n";
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?countryCode='+a+'&vatNumber='+b,'".$langs->trans("VATIntraCheckableOnEUSite")."',500,230);\n";
print "}\n";
print '</script>';
print "\n";
}
print '<td nowrap="nowrap">'.$langs->trans('VATIntraShort').'</td>';
print '<td nowrap="nowrap">';
$s ='<input type="text" class="flat" name="tva_intra_code" size="1" maxlength="2" value="'.$soc->tva_intra_code.'">';
$s.='<input type="text" class="flat" name="tva_intra_num" size="12" maxlength="18" value="'.$soc->tva_intra_num.'">';
$s.=' ';
if ($conf->use_javascript)
{
$s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra_code.value,document.formsoc.tva_intra_num.value);" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.$langs->trans("VATIntraCheck").'</a>';
print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
}
else
{
print $s.'<a href="'.$langs->transcountry("VATIntraCheckURL",$soc->id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
}
print '</td>';
print '</tr>';
print '<tr><td colspan="4" align="center">';
print '<input type="submit" class="button" value="'.$langs->trans('AddThirdParty').'"></td></tr>'."\n";
@ -643,11 +660,33 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
$form->select_YesNo($soc->tva_assuj,'assujtva_value');
print '</td>';
print '<td nowrap="nowrap">'.$langs->trans('VATIntraShort').'</td><td>';
print '<input type="text" name="tva_intra_code" size="3" maxlength="2" value="'.$soc->tva_intra_code.'">';
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">';
print ' <a href="'.$langs->transcountry("VATIntraCheckURL",$soc->id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
print '</td></tr>';
// Code TVA intra
if ($conf->use_javascript)
{
print "\n";
print '<script language="JavaScript" type="text/javascript">';
print "function CheckVAT(a,b) {\n";
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?countryCode='+a+'&vatNumber='+b,'".$langs->trans("VATIntraCheckableOnEUSite")."',500,230);\n";
print "}\n";
print '</script>';
print "\n";
}
print '<td nowrap="nowrap">'.$langs->trans('VATIntraShort').'</td>';
print '<td nowrap="nowrap">';
$s ='<input type="text" class="flat" name="tva_intra_code" size="1" maxlength="2" value="'.$soc->tva_intra_code.'">';
$s.='<input type="text" class="flat" name="tva_intra_num" size="12" maxlength="18" value="'.$soc->tva_intra_num.'">';
$s.=' ';
if ($conf->use_javascript)
{
$s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra_code.value,document.formsoc.tva_intra_num.value);" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.$langs->trans("VATIntraCheck").'</a>';
print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
}
else
{
print $s.'<a href="'.$langs->transcountry("VATIntraCheckURL",$soc->id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
}
print '</td>';
print '</tr>';
print '<tr><td>'.$langs->trans("Capital").'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$soc->capital.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';

View File

@ -0,0 +1,138 @@
<?php
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/
/**
* \file htdocs/societe/checkvat/checkVatPopup.php
* \ingroup societe
* \brief Onglet societe d'une societe
* \version $Revision$
*/
require ("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/includes/nusoap/lib/nusoap.php");
$langs->load("companies");
$WS_DOL_URL='http://ec.europa.eu/taxation_customs/vies/api/checkVatPort';
$WS_METHOD = 'checkVat';
top_htmlhead("", $langs->trans("VATIntraCheckableOnEUSite"), "");
print '<body style="margin: 10px">';
print '<div>';
print '<div>';
print_fiche_titre($langs->trans("VATIntraCheckableOnEUSite"));
if (! $_REQUEST["countryCode"])
{
print '<br>';
print $langs->transnoentities("ErrorFieldRequired",$langs->trans("Country")).'<br>';
}
elseif (! $_REQUEST["vatNumber"])
{
print '<br>';
print $langs->transnoentities("ErrorFieldRequired",$langs->trans("VATIntraShort")).'<br>';
}
else
{
print '<b>'.$langs->trans("Country").'</b>: '.$_REQUEST["countryCode"].'<br>';
print '<b>'.$langs->trans("VATIntraShort").'</b>: '.$_REQUEST["vatNumber"].'<br>';
print '<br>';
// Set the parameters to send to the WebService
$parameters = array("countryCode" => $_REQUEST["countryCode"],
"vatNumber" => $_REQUEST["vatNumber"]);
// Set the WebService URL
dolibarr_syslog("Create soapclient for URL=".$WS_DOL_URL);
$soapclient = new soapclient($WS_DOL_URL);
// Call the WebService and store its result in $result.
dolibarr_syslog("Call method ".$WS_METHOD);
$result = $soapclient->call($WS_METHOD,$parameters);
// print "x".$result['valid']."i";
// print_r($result);
// print $soapclient->request.'<br>';
// print $soapclient->response.'<br>';
print '<b>'.$langs->trans("Response").'</b>:<br>';
// Service indisponible
if (eregi('SERVICE_UNAVAILABLE',$result['faultstring']))
{
print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>';
}
elseif (eregi('TIMEOUT',$result['faultstring']))
{
print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>';
}
elseif (eregi('SERVER_BUSY',$result['faultstring']))
{
print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>';
}
// Syntaxe ko
elseif (eregi('INVALID_INPUT',$result['faultstring'])
|| ($result['requestDate'] && ! $result['valid']))
{
if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'<br>';
print $langs->trans("VATIntraSyntaxIsValid").': <font class="error">'.$langs->trans("No").'</font><br>';
}
else
{
// Syntaxe ok
if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'<br>';
print $langs->trans("VATIntraSyntaxIsValid").': <font class="ok">'.$langs->trans("Yes").'</font><br>';
print $langs->trans("VATIntraValueIsValid").': ';
if (eregi('MS_UNAVAILABLE',$result['faultstring']))
{
print '<font class="error">'.$langs->trans("ErrorVATCheckMS_UNAVAILABLE",$_REQUEST["countryCode"]).'</font><br>';
}
else
{
if ($result['valid'])
{
print '<font class="ok">'.$langs->trans("Yes").'</font>';
print '<br>';
print $langs->trans("Name").': '.$result['name'].'<br>';
print $langs->trans("Address").': '.$result['address'].'<br>';
}
else
{
print '<font class="error">'.$langs->trans("No").'</font>';
print '<br>';
}
}
}
}
print '<br>';
print $langs->trans("VATIntraManualCheck",$langs->trans("VATIntraCheckURL"),$langs->trans("VATIntraCheckURL")).'<br>';
print '<br>';
print '<center><input type="button" value="'.$langs->trans("CloseWindow").'" onclick="javascript: window.close()"></center>';
llxFooter('$Date$ - $Revision$',0);
?>

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:ec.europa.eu:taxud:vies:services:checkVat" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:ec.europa.eu:taxud:vies:services:checkVat" xmlns:intf="urn:ec.europa.eu:taxud:vies:services:checkVat" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:ec.europa.eu:taxud:vies:services:checkVat:types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<documentation>
Specific disclaimer for this service
-----------------------------------------
The objective of this Internet site is to allow persons involved in the intra-Community supply of goods or of services to obtain confirmation of the validity of the VAT identification number of any specified person, in accordance to article 27 of Council Regulation (EC) No. 1798/2003 of 7 October 2003.
Any other use and any extraction and use of the data which is not in conformity with the objective of this site is strictly forbidden.
Any retransmission of the contents of this site, whether for a commercial purpose or otherwise, as well as any more general use other than as far as is necessary to support the activity of a legitimate user (for example: to draw up their own invoices) is expressly forbidden. In addition, any copying or reproduction of the contents of this site is strictly forbidden.
The European Commission maintains this website to enhance the access by taxable persons making intra-Community supplies to verification of their customers VAT identification numbers. Our goal is to supply instantaneous and accurate information.
However the Commission accepts no responsibility or liability whatsoever with regard to the information obtained using this site. This information:
- is obtained from Member States databases over which the Commission services have no control and for which the Commission assumes no responsibility; it is the responsibility of the Member States to keep their databases complete, accurate and up to date;
- is not professional or legal advice (if you need specific advice, you should always consult a suitably qualified professional);
- does not in itself give a right to exempt intra-Community supplies from Value Added Tax;
- does not change any obligations imposed on taxable persons in relation to intra-Community supplies.
It is our goal to minimise disruption caused by technical errors. However some data or information on our site may have been created or structured in files or formats which are not error-free and we cannot guarantee that our service will not be interrupted or otherwise affected by such problems. The Commission accepts no responsibility with regard to such problems incurred as a result of using this site or any linked external sites.
This disclaimer is not intended to limit the liability of the Commission in contravention of any requirements laid down in applicable national law nor to exclude its liability for matters which may not be excluded under that law.
Usage:
The countryCode input parameter must follow the pattern [A-Z]{2}
The vatNumber input parameter must follow the [0-9A-Za-z\+\*\.]{2,12}
In case of problem, the returned FaultString can take the following specific values:
- INVALID_INPUT: The provided CountryCode is invalid or the VAT number is empty;
- SERVICE_UNAVAILABLE: The SOAP service is unavailable, try again later;
- MS_UNAVAILABLE: The Member State service is unavailable, try again later or with another Member State;
- TIMEOUT: The Member State service could not be reach in time, try again later or with another Member State;
- SERVER_BUSY: The service can't process your request. Try again latter.
</documentation>
<wsdl:types>
<schema targetNamespace="urn:ec.europa.eu:taxud:vies:services:checkVat:types" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="checkVat">
<complexType>
<sequence>
<element name="countryCode" type="xsd:string"/>
<element name="vatNumber" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="checkVatResponse">
<complexType>
<sequence>
<element name="countryCode" type="xsd:string"/>
<element name="vatNumber" type="xsd:string"/>
<element name="requestDate" type="xsd:date"/>
<element name="valid" type="xsd:boolean"/>
<element name="name" type="xsd:string"/>
<element name="address" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="checkVatRequest">
<wsdl:part element="tns1:checkVat" name="parameters"/>
</wsdl:message>
<wsdl:message name="checkVatResponse">
<wsdl:part element="tns1:checkVatResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="checkVatPortType">
<wsdl:operation name="checkVat">
<wsdl:input message="impl:checkVatRequest" name="checkVatRequest"/>
<wsdl:output message="impl:checkVatResponse" name="checkVatResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="checkVatPortSoapBinding" type="impl:checkVatPortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="checkVat">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="checkVatRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="checkVatResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="checkVatService">
<wsdl:port binding="impl:checkVatPortSoapBinding" name="checkVatPort">
<wsdlsoap:address location="http://ec.europa.eu/taxation_customs/vies/api/checkVatPort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -231,11 +231,13 @@ class Translate {
// On remplace les tags HTML par __xx__ pour eviter traduction par htmlentities
$newstr=ereg_replace('<','__lt__',$str);
$newstr=ereg_replace('>','__gt__',$newstr);
$newstr=ereg_replace('"','__quot__',$newstr);
// Cryptage en html de la chaine
$newstr=htmlentities($newstr);
// On restaure les tags HTML
$newstr=ereg_replace('__lt__','<',$newstr);
$newstr=ereg_replace('__gt__','>',$newstr);
$newstr=ereg_replace('__quot__','"',$newstr);
return $newstr;
}
return $key;

View File

@ -60,7 +60,7 @@ echo "<h2>Question</h2>";
echo '<h4>Function</h4>';
echo $WS_METHOD;
echo '<h4>Request</h4>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<pre>' . htmlspecialchars($soapclient->request, ENT_QUOTES) . '</pre>';
echo "<h2>Réponse</h2>";
echo '<h4>Result</h4>';
@ -68,7 +68,7 @@ echo '<pre>';
print_r($result);
echo '</pre>';
echo '<h4>Response</h4>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>';
echo '</body>'."\n";;
echo '</html>'."\n";;