Fix: bug #29540 : check Vat Popup
This commit is contained in:
parent
e95ba9080f
commit
0ab9f39756
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -60,7 +60,14 @@ else
|
|||||||
|
|
||||||
// Set the WebService URL
|
// Set the WebService URL
|
||||||
dol_syslog("Create soapclient_nusoap for URL=".$WS_DOL_URL);
|
dol_syslog("Create soapclient_nusoap for URL=".$WS_DOL_URL);
|
||||||
$soapclient = new soapclient_nusoap($WS_DOL_URL);
|
$soapclient = new soapclient_nusoap($WS_DOL_URL.'?wsdl',true);
|
||||||
|
|
||||||
|
// Check for an error
|
||||||
|
$err = $soapclient->getError();
|
||||||
|
if ($err)
|
||||||
|
{
|
||||||
|
dol_syslog("Constructor error ".$WS_DOL_URL, LOG_ERR);
|
||||||
|
}
|
||||||
|
|
||||||
// Call the WebService and store its result in $result.
|
// Call the WebService and store its result in $result.
|
||||||
dol_syslog("Call method ".$WS_METHOD);
|
dol_syslog("Call method ".$WS_METHOD);
|
||||||
@ -92,6 +99,11 @@ else
|
|||||||
print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>';
|
print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>';
|
||||||
$messagetoshow=$soapclient->response;
|
$messagetoshow=$soapclient->response;
|
||||||
}
|
}
|
||||||
|
elseif ($result['faultstring'])
|
||||||
|
{
|
||||||
|
print '<font class="error">'.$langs->trans("Error").'</font><br>';
|
||||||
|
$messagetoshow=$result['faultstring'];
|
||||||
|
}
|
||||||
// Syntaxe ko
|
// Syntaxe ko
|
||||||
elseif (preg_match('/INVALID_INPUT/i',$result['faultstring'])
|
elseif (preg_match('/INVALID_INPUT/i',$result['faultstring'])
|
||||||
|| ($result['requestDate'] && ! $result['valid']))
|
|| ($result['requestDate'] && ! $result['valid']))
|
||||||
@ -113,7 +125,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($result['valid'])
|
if (! empty($result['valid']) && ($result['valid']==1 || $result['valid']=='true'))
|
||||||
{
|
{
|
||||||
print '<font class="ok">'.$langs->trans("Yes").'</font>';
|
print '<font class="ok">'.$langs->trans("Yes").'</font>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -123,10 +135,16 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<font class="error">'.$langs->trans("No").'</font>';
|
print '<font class="error">'.$langs->trans("No").'</font>';
|
||||||
print '<br>';
|
print '<br>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show log data into page
|
||||||
|
print "\n";
|
||||||
|
print '<!-- ';
|
||||||
|
var_dump($result);
|
||||||
|
print '-->';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -136,7 +154,8 @@ print '<center><input type="button" class="button" value="'.$langs->trans("Close
|
|||||||
|
|
||||||
if ($messagetoshow)
|
if ($messagetoshow)
|
||||||
{
|
{
|
||||||
print '<br><br>Error returned:<br>';
|
print '<br><br>';
|
||||||
|
print "\n".'Error returned:<br>';
|
||||||
print nl2br($messagetoshow);
|
print nl2br($messagetoshow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user