From 66b59fef2354422f4eb5218f4d304e070517b313 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Dec 2006 13:45:59 +0000 Subject: [PATCH] =?UTF-8?q?New:=20V=E9rification=20par=20web=20service=20d?= =?UTF-8?q?e=20la=20validit=E9=20du=20code=20tva=20intracommunautaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/html.form.class.php | 8 +- htdocs/langs/en_US/companies.lang | 6 + htdocs/langs/en_US/main.lang | 4 + htdocs/langs/fr_FR/admin.lang | 2 +- htdocs/langs/fr_FR/companies.lang | 6 + htdocs/langs/fr_FR/main.lang | 4 + htdocs/lib/functions.inc.php | 19 ++- htdocs/lib/lib_head.js | 17 +++ htdocs/soc.php | 89 ++++++++++---- htdocs/societe/checkvat/checkVatPopup.php | 138 ++++++++++++++++++++++ htdocs/societe/checkvat/checkVatPort.xml | 87 ++++++++++++++ htdocs/translate.class.php | 2 + htdocs/webservices/client.php | 4 +- 13 files changed, 348 insertions(+), 38 deletions(-) create mode 100644 htdocs/societe/checkvat/checkVatPopup.php create mode 100644 htdocs/societe/checkvat/checkVatPort.xml diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 27e881019c4..59cc4909f76 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -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) { diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 83cf3c5972f..7df1ac05b8a 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -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 %s 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 %s +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 diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 3abbca2179c..48ae6eceaa5 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -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 diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 0bf8633035e..7df9f0f211d 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -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:
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 dans le pays du vendeur. Fin de règle.
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:
Si vendeur non assujeti à TVA, TVA 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.
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. diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 8c560192ae5..0d068ef18b0 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -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 %s 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 %s +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 diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 22b65f61cf0..da307021aea 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -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 diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index f6759008846..5ce85be17b8 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -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; } diff --git a/htdocs/lib/lib_head.js b/htdocs/lib/lib_head.js index 0d67924bc18..3944009cb31 100644 --- a/htdocs/lib/lib_head.js +++ b/htdocs/lib/lib_head.js @@ -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; +} diff --git a/htdocs/soc.php b/htdocs/soc.php index c474331e586..db6439036fb 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -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 ''; - // TVA Intra - print '
'.$langs->trans('VATIntraShort').'
'; - print '
'; - print ''; - print ''; - print ' id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; - print '
'; - print ''; - - //print ''."\n"; - //print ''."\n"; - // Assujeti TVA $html = new Form($db); - print ''.$langs->trans('VATIsUsed').''; - $html->select_YesNo("1",'assujtva_value'); // Assujeti par défaut - print ''."\n"; - + print ''.$langs->trans('VATIsUsed').''; + $html->select_YesNo("1",'assujtva_value'); // Assujeti par défaut en creation + print ''; + + // Code TVA intra + if ($conf->use_javascript) + { + print "\n"; + print ''; + print "\n"; + } + print ''.$langs->trans('VATIntraShort').''; + print ''; + $s =''; + $s.=''; + $s.=' '; + if ($conf->use_javascript) + { + $s.=''.$langs->trans("VATIntraCheck").''; + print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + } + else + { + print $s.'id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + } + print ''; + print ''; + + print ''; print ''."\n"; @@ -643,11 +660,33 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') $form->select_YesNo($soc->tva_assuj,'assujtva_value'); print ''; - print ''.$langs->trans('VATIntraShort').''; - print ''; - print ''; - print ' id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; - print ''; + // Code TVA intra + if ($conf->use_javascript) + { + print "\n"; + print ''; + print "\n"; + } + print ''.$langs->trans('VATIntraShort').''; + print ''; + $s =''; + $s.=''; + $s.=' '; + if ($conf->use_javascript) + { + $s.=''.$langs->trans("VATIntraCheck").''; + print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + } + else + { + print $s.'id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + } + print ''; + print ''; print ''.$langs->trans("Capital").' '.$langs->trans("Currency".$conf->monnaie).''; diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php new file mode 100644 index 00000000000..4306fb482f6 --- /dev/null +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -0,0 +1,138 @@ + + * + * 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 ''; +print '
'; +print '
'; + +print_fiche_titre($langs->trans("VATIntraCheckableOnEUSite")); + + +if (! $_REQUEST["countryCode"]) +{ + print '
'; + print $langs->transnoentities("ErrorFieldRequired",$langs->trans("Country")).'
'; +} +elseif (! $_REQUEST["vatNumber"]) +{ + print '
'; + print $langs->transnoentities("ErrorFieldRequired",$langs->trans("VATIntraShort")).'
'; +} +else +{ + print ''.$langs->trans("Country").': '.$_REQUEST["countryCode"].'
'; + print ''.$langs->trans("VATIntraShort").': '.$_REQUEST["vatNumber"].'
'; + print '
'; + + // 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.'
'; +// print $soapclient->response.'
'; + + print ''.$langs->trans("Response").':
'; + + // Service indisponible + if (eregi('SERVICE_UNAVAILABLE',$result['faultstring'])) + { + print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; + } + elseif (eregi('TIMEOUT',$result['faultstring'])) + { + print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; + } + elseif (eregi('SERVER_BUSY',$result['faultstring'])) + { + print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; + } + // Syntaxe ko + elseif (eregi('INVALID_INPUT',$result['faultstring']) + || ($result['requestDate'] && ! $result['valid'])) + { + if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'
'; + print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("No").'
'; + } + else + { + // Syntaxe ok + if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'
'; + print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("Yes").'
'; + print $langs->trans("VATIntraValueIsValid").': '; + if (eregi('MS_UNAVAILABLE',$result['faultstring'])) + { + print ''.$langs->trans("ErrorVATCheckMS_UNAVAILABLE",$_REQUEST["countryCode"]).'
'; + } + else + { + if ($result['valid']) + { + print ''.$langs->trans("Yes").''; + print '
'; + print $langs->trans("Name").': '.$result['name'].'
'; + print $langs->trans("Address").': '.$result['address'].'
'; + } + else + { + print ''.$langs->trans("No").''; + print '
'; + } + } + } +} + +print '
'; +print $langs->trans("VATIntraManualCheck",$langs->trans("VATIntraCheckURL"),$langs->trans("VATIntraCheckURL")).'
'; +print '
'; +print '
'; + + + +llxFooter('$Date$ - $Revision$',0); +?> diff --git a/htdocs/societe/checkvat/checkVatPort.xml b/htdocs/societe/checkvat/checkVatPort.xml new file mode 100644 index 00000000000..c421ab37afc --- /dev/null +++ b/htdocs/societe/checkvat/checkVatPort.xml @@ -0,0 +1,87 @@ + + + +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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index d5cea4d25d5..f3c081c559a 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -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; diff --git a/htdocs/webservices/client.php b/htdocs/webservices/client.php index 40d286243dd..14be5ce3a35 100644 --- a/htdocs/webservices/client.php +++ b/htdocs/webservices/client.php @@ -60,7 +60,7 @@ echo "

Question

"; echo '

Function

'; echo $WS_METHOD; echo '

Request

'; -echo '
' . htmlspecialchars($client->request, ENT_QUOTES) . '
'; +echo '
' . htmlspecialchars($soapclient->request, ENT_QUOTES) . '
'; echo "

Réponse

"; echo '

Result

'; @@ -68,7 +68,7 @@ echo '
';
 print_r($result);
 echo '
'; echo '

Response

'; -echo '
' . htmlspecialchars($client->response, ENT_QUOTES) . '
'; +echo '
' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '
'; echo ''."\n";; echo ''."\n";;