Suppression type error sur la plupart des méthodes
This commit is contained in:
parent
117c2c5c22
commit
6d91baf9ac
@ -25,7 +25,7 @@ Type[] = "InseeReturn"
|
||||
Type[] = "InseeEven"
|
||||
Type[] = "TvaReturn"
|
||||
Type[] = "TribunauxReturn"
|
||||
Type[] = "TribunalNom"
|
||||
Type[] = "Tribunal"
|
||||
Type[] = "InfosRegReturn"
|
||||
Type[] = "InfosReg"
|
||||
Type[] = "InfosBourseReturn"
|
||||
@ -35,12 +35,10 @@ Type[] = "ListeBilansResult"
|
||||
Type[] = "ListeBilans"
|
||||
Type[] = "SetSurveillanceReturn"
|
||||
Type[] = "SurveillancesReturn"
|
||||
Type[] = "SurveillancesResult"
|
||||
Type[] = "SurveillancesFiltre"
|
||||
Type[] = "Surveillance"
|
||||
Type[] = "MandatairesReturn"
|
||||
Type[] = "Mandataire"
|
||||
Type[] = "SirenExistantReturn"
|
||||
Type[] = "BilanReturn"
|
||||
Type[] = "RechercheAnnonceReturn"
|
||||
Type[] = "RechercheAnnonceResult"
|
||||
@ -75,5 +73,4 @@ Type[] = "InfosIris"
|
||||
Type[] = "BanquesReturn"
|
||||
Type[] = "Banque"
|
||||
Type[] = "ListeCompetencesReturn"
|
||||
Type[] = "ListeCompetencesResult"
|
||||
Type[] = "Competence"
|
||||
|
@ -1575,13 +1575,11 @@ class TvaReturn
|
||||
|
||||
class TribunauxReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var TribunalNom[] */
|
||||
public $result;
|
||||
/** @var Tribunal[] */
|
||||
public $tribunaux;
|
||||
}
|
||||
|
||||
class TribunalNom
|
||||
class Tribunal
|
||||
{
|
||||
/** Code du tribunal
|
||||
* @var string
|
||||
@ -1595,8 +1593,6 @@ class TribunalNom
|
||||
|
||||
class InfosRegReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var InfosReg[] */
|
||||
public $result;
|
||||
}
|
||||
@ -1627,8 +1623,6 @@ class InfosReg
|
||||
|
||||
class InfosBourseReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var InfosBourse */
|
||||
public $result;
|
||||
}
|
||||
@ -1903,28 +1897,18 @@ class ListeBilans
|
||||
|
||||
class SetSurveillanceReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var int */
|
||||
/** @var bool */
|
||||
public $result;
|
||||
}
|
||||
|
||||
class SurveillancesReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var SurveillancesResult */
|
||||
public $result;
|
||||
}
|
||||
|
||||
class SurveillancesResult
|
||||
{
|
||||
/** @var int */
|
||||
public $nbReponses;
|
||||
/** @var int */
|
||||
public $nbReponsesTotal;
|
||||
/** @var Surveillance[] */
|
||||
public $liste;
|
||||
public $result;
|
||||
}
|
||||
|
||||
class SurveillancesFiltre
|
||||
@ -1999,8 +1983,6 @@ class Surveillance
|
||||
|
||||
class MandatairesReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var Mandataire[] */
|
||||
public $result;
|
||||
}
|
||||
@ -2013,20 +1995,8 @@ class Mandataire
|
||||
public $mand;
|
||||
}
|
||||
|
||||
class SirenExistantReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** Le siren existe en base S&D (true=OUI, false sinon)
|
||||
* @var bool
|
||||
*/
|
||||
public $result;
|
||||
}
|
||||
|
||||
class BilanReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var Bilan */
|
||||
public $result;
|
||||
}
|
||||
@ -2602,8 +2572,6 @@ class Rapport
|
||||
|
||||
class PrivilegesDetailReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var PrivilegesDetail[] */
|
||||
public $result;
|
||||
}
|
||||
@ -2753,8 +2721,6 @@ class PrivilegesDetail
|
||||
|
||||
class PrivilegesCumulReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var PrivilegesCumul[] */
|
||||
public $result;
|
||||
}
|
||||
@ -2851,8 +2817,6 @@ class InfosIris {
|
||||
|
||||
class BanquesReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var Banque[] */
|
||||
public $result;
|
||||
}
|
||||
@ -2876,19 +2840,11 @@ class Banque
|
||||
}
|
||||
|
||||
class ListeCompetencesReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var ListeCompetencesResult */
|
||||
public $result;
|
||||
}
|
||||
|
||||
class ListeCompetencesResult
|
||||
{
|
||||
/** @var int */
|
||||
public $nbReponses;
|
||||
/** @var Competence[] */
|
||||
public $liste;
|
||||
public $result;
|
||||
}
|
||||
|
||||
class Competence
|
||||
|
@ -1183,7 +1183,6 @@ class WsEntreprise extends WsScore
|
||||
//Initialisation
|
||||
if (empty($tabTypes)) $tabTypes = array();
|
||||
if (is_string($tabTypes)) $tabTypes = (array)$tabTypes;
|
||||
$error = new ErrorType();
|
||||
|
||||
$iBodacc = new MBodacc();
|
||||
debugLog('I',"Liste des tribunaux demandées",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
@ -1192,7 +1191,7 @@ class WsEntreprise extends WsScore
|
||||
$tabRet = array();
|
||||
if (count($tabTypes)==0) {
|
||||
foreach ($tabTmp as $i => $tribunal){
|
||||
$tri = new TribunalNom();
|
||||
$tri = new Tribunal();
|
||||
$tri->code = $i;
|
||||
$tri->nom = $tribunal['nom'];
|
||||
$tabRet[] = $tri;
|
||||
@ -1201,7 +1200,7 @@ class WsEntreprise extends WsScore
|
||||
foreach ($tabTmp as $i=>$tribunal){
|
||||
$type = substr($i,-1);
|
||||
if ( in_array($type, $tabTypes) ){
|
||||
$tri = new TribunalNom();
|
||||
$tri = new Tribunal();
|
||||
$tri->code = $i;
|
||||
$tri->nom = $tribunal['nom'];
|
||||
$tabRet[] = $tri;
|
||||
@ -1209,8 +1208,7 @@ class WsEntreprise extends WsScore
|
||||
}
|
||||
}
|
||||
$output = new TribunauxReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $tabRet;
|
||||
$output->tribunaux = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
|
||||
@ -1228,70 +1226,54 @@ class WsEntreprise extends WsScore
|
||||
//Initialisation
|
||||
if (empty($id)) $id = false;
|
||||
$tabRet = array();
|
||||
$error = new ErrorType();
|
||||
$siren = substr($siren,0,9);
|
||||
|
||||
debugLog('I',"Infos règlementées demandées pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
if ($siren*1==0)
|
||||
{
|
||||
if ($siren*1==0) {
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
$this->sendError('1010');
|
||||
}
|
||||
else
|
||||
$iBourse = new MBourse($siren);
|
||||
$anns = $iBourse->getInfosReg($siren, $id);
|
||||
//debugLog('W', print_r($entrep, true), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
if ( empty($anns) ){
|
||||
debugLog('W', "Aucune info règlementée pour le siren $siren", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1030');
|
||||
}
|
||||
|
||||
foreach ($anns as $nb=>$ann)
|
||||
{
|
||||
$iBourse = new MBourse($siren);
|
||||
$anns = $iBourse->getInfosReg($siren, $id);
|
||||
//debugLog('W', print_r($entrep, true), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
if ( empty($anns) )
|
||||
{
|
||||
debugLog('W', "Aucune info règlementée pour le siren $siren", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Aucune info réglementé pour le siren';
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($anns as $nb=>$ann)
|
||||
{
|
||||
//debugLog('I', "Siren/Siret $siren trouvé : ".$etab['Siren'].' '.$etab['Nic'].', '.$etab['Nom'] .', '.$etab['CP'].', '.$etab['Ville'], __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
if ($id == false){
|
||||
|
||||
$infos = new InfosReg();
|
||||
$infos->id = $ann['id'];
|
||||
$infos->source = $ann['source'];
|
||||
$infos->DateParution = $ann['DateParution']; //@todo : date
|
||||
$infos->raisonSociale = $ann['raisonSociale'];
|
||||
$infos->titre = $ann['titre'];
|
||||
$infos->pj = $ann['pj'];
|
||||
$infos->url = $ann['url'];
|
||||
$infos->dateInsertionSD = $ann['dateInsertionSD']; //@todo : date
|
||||
$tabRet[] = $infos;
|
||||
|
||||
} else {
|
||||
|
||||
$infos = new InfosReg();
|
||||
$infos->id = $ann['id'];
|
||||
$infos->source = $ann['source'];
|
||||
$infos->DateParution = $ann['DateParution']; //@todo : date
|
||||
$infos->raisonSociale = $ann['raisonSociale'];
|
||||
$infos->titre = $ann['titre'];
|
||||
$infos->communique = $ann['communique'];
|
||||
$infos->communiqueHtml = $ann['communiqueHtml'];
|
||||
$infos->pj = $ann['pj'];
|
||||
$infos->url = $ann['url'];
|
||||
$infos->dateInsertionSD = $ann['dateInsertionSD']; //@todo : date
|
||||
$tabRet[] = $infos;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
debugLog('I', 'Nb infos retournés = '. count($anns), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->wsLog('infosreg',$siren,$id);
|
||||
//debugLog('I', "Siren/Siret $siren trouvé : ".$etab['Siren'].' '.$etab['Nic'].', '.$etab['Nom'] .', '.$etab['CP'].', '.$etab['Ville'], __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
if ($id == false) {
|
||||
$infos = new InfosReg();
|
||||
$infos->id = $ann['id'];
|
||||
$infos->source = $ann['source'];
|
||||
$infos->DateParution = $ann['DateParution']; //@todo : date
|
||||
$infos->raisonSociale = $ann['raisonSociale'];
|
||||
$infos->titre = $ann['titre'];
|
||||
$infos->pj = $ann['pj'];
|
||||
$infos->url = $ann['url'];
|
||||
$infos->dateInsertionSD = $ann['dateInsertionSD']; //@todo : date
|
||||
$tabRet[] = $infos;
|
||||
} else {
|
||||
$infos = new InfosReg();
|
||||
$infos->id = $ann['id'];
|
||||
$infos->source = $ann['source'];
|
||||
$infos->DateParution = $ann['DateParution']; //@todo : date
|
||||
$infos->raisonSociale = $ann['raisonSociale'];
|
||||
$infos->titre = $ann['titre'];
|
||||
$infos->communique = $ann['communique'];
|
||||
$infos->communiqueHtml = $ann['communiqueHtml'];
|
||||
$infos->pj = $ann['pj'];
|
||||
$infos->url = $ann['url'];
|
||||
$infos->dateInsertionSD = $ann['dateInsertionSD']; //@todo : date
|
||||
$tabRet[] = $infos;
|
||||
}
|
||||
}
|
||||
debugLog('I', 'Nb infos retournés = '. count($anns), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->wsLog('infosreg',$siren,$id);
|
||||
$output = new InfosRegReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
@ -1310,74 +1292,65 @@ class WsEntreprise extends WsScore
|
||||
debugLog('I',"Infos bourse demandées pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$siren = substr($siren,0,9);
|
||||
|
||||
if ($siren*1==0){
|
||||
|
||||
if ($siren*1==0) {
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
|
||||
} else {
|
||||
|
||||
$iBourse = new MBourse($siren);
|
||||
$bourse = $iBourse->getInfosBourse($siren);
|
||||
//debugLog('W', print_r($entrep, true), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
if (empty($bourse))
|
||||
{
|
||||
debugLog('W', "Aucune info bourse pour le siren $siren", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = new InfosBourse();
|
||||
$result->Siren = $bourse['siren'];
|
||||
$result->RaisonSociale = prepareString($bourse['raisonSociale']);
|
||||
$result->Adresse = prepareString($bourse['adresse']);
|
||||
$result->Effectif = $bourse['effectif'];
|
||||
$result->CodeSicovam = $bourse['code_sicovam'];
|
||||
$result->CodeMnemo = $bourse['code_mnemo'];
|
||||
$result->CodeBloomberg = $bourse['code_bloomberg'];
|
||||
$result->CodeDatastream = $bourse['code_datastream'];
|
||||
$result->Isin = $bourse['code_isin'];
|
||||
$result->CodeRic = $bourse['code_ric'];
|
||||
$result->DateIntroduction = prepareString($bourse['dateIntroduction']); //@todo : date
|
||||
$result->DateDerAG = prepareString($bourse['dateDerAG']); //@todo : date
|
||||
$result->DateRadiation = prepareString($bourse['dateRadiation']); //@todo : date
|
||||
$result->AutreIsin = $bourse['autre_isin'];
|
||||
$result->EligibleSRD = $bourse['eligibleSRD'];
|
||||
$result->EligiblePEA = $bourse['eligiblePEA'];
|
||||
$result->Tel = $bourse['tel1'];
|
||||
$result->Tel2 = $bourse['tel2'];
|
||||
$result->Fax = $bourse['fax1'];
|
||||
$result->Fax2 = $bourse['fax2'];
|
||||
$result->Web = $bourse['web'];
|
||||
$result->Mail = $bourse['mail'];
|
||||
|
||||
$result->Marche = $bourse['marche'];
|
||||
$result->Description = $bourse['description'];
|
||||
$result->Secteur = $bourse['secteur'];
|
||||
$result->Activite = $bourse['activite'];
|
||||
$result->ActiviteDet = $bourse['activiteDet'];
|
||||
|
||||
$result->placeCotation = $bourse['placeCotation'];
|
||||
$result->nombreTitres = $bourse['nombreTitres'];
|
||||
$result->capitalisation = $bourse['close']*$bourse['nombreTitres'];
|
||||
$result->derCoursDate = $bourse['date']; //@todo : date
|
||||
$result->derCoursCloture = $bourse['close'];
|
||||
$result->derCoursOuverture = $bourse['open'];
|
||||
$result->derCoursPlusHaut = $bourse['high'];
|
||||
$result->derCoursPlusBas = $bourse['low'];
|
||||
|
||||
$result->derCoursVolume = $bourse['volume'];
|
||||
$result->coursMin = $bourse['coursMin'];
|
||||
$result->coursMoy = $bourse['coursMoy'];
|
||||
$result->coursMax = $bourse['coursMax'];
|
||||
|
||||
$this->wsLog('bourse',$siren,$id);
|
||||
}
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
$iBourse = new MBourse($siren);
|
||||
$bourse = $iBourse->getInfosBourse($siren);
|
||||
//debugLog('W', print_r($entrep, true), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
if (empty($bourse)) {
|
||||
debugLog('W', "Aucune info bourse pour le siren $siren", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
$result = new InfosBourse();
|
||||
$result->Siren = $bourse['siren'];
|
||||
$result->RaisonSociale = prepareString($bourse['raisonSociale']);
|
||||
$result->Adresse = prepareString($bourse['adresse']);
|
||||
$result->Effectif = $bourse['effectif'];
|
||||
$result->CodeSicovam = $bourse['code_sicovam'];
|
||||
$result->CodeMnemo = $bourse['code_mnemo'];
|
||||
$result->CodeBloomberg = $bourse['code_bloomberg'];
|
||||
$result->CodeDatastream = $bourse['code_datastream'];
|
||||
$result->Isin = $bourse['code_isin'];
|
||||
$result->CodeRic = $bourse['code_ric'];
|
||||
$result->DateIntroduction = prepareString($bourse['dateIntroduction']); //@todo : date
|
||||
$result->DateDerAG = prepareString($bourse['dateDerAG']); //@todo : date
|
||||
$result->DateRadiation = prepareString($bourse['dateRadiation']); //@todo : date
|
||||
$result->AutreIsin = $bourse['autre_isin'];
|
||||
$result->EligibleSRD = $bourse['eligibleSRD'];
|
||||
$result->EligiblePEA = $bourse['eligiblePEA'];
|
||||
$result->Tel = $bourse['tel1'];
|
||||
$result->Tel2 = $bourse['tel2'];
|
||||
$result->Fax = $bourse['fax1'];
|
||||
$result->Fax2 = $bourse['fax2'];
|
||||
$result->Web = $bourse['web'];
|
||||
$result->Mail = $bourse['mail'];
|
||||
|
||||
$result->Marche = $bourse['marche'];
|
||||
$result->Description = $bourse['description'];
|
||||
$result->Secteur = $bourse['secteur'];
|
||||
$result->Activite = $bourse['activite'];
|
||||
$result->ActiviteDet = $bourse['activiteDet'];
|
||||
|
||||
$result->placeCotation = $bourse['placeCotation'];
|
||||
$result->nombreTitres = $bourse['nombreTitres'];
|
||||
$result->capitalisation = $bourse['close']*$bourse['nombreTitres'];
|
||||
$result->derCoursDate = $bourse['date']; //@todo : date
|
||||
$result->derCoursCloture = $bourse['close'];
|
||||
$result->derCoursOuverture = $bourse['open'];
|
||||
$result->derCoursPlusHaut = $bourse['high'];
|
||||
$result->derCoursPlusBas = $bourse['low'];
|
||||
|
||||
$result->derCoursVolume = $bourse['volume'];
|
||||
$result->coursMin = $bourse['coursMin'];
|
||||
$result->coursMoy = $bourse['coursMoy'];
|
||||
$result->coursMax = $bourse['coursMax'];
|
||||
|
||||
$this->wsLog('bourse',$siren,$id);
|
||||
$output = new InfosBourseReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
return $output;
|
||||
}
|
||||
@ -1394,13 +1367,11 @@ class WsEntreprise extends WsScore
|
||||
$this->authenticate();
|
||||
//Initialisation
|
||||
if (empty($tabTypes)) $tabTypes = array('03','04');
|
||||
$error = new ErrorType();
|
||||
debugLog('I',"Liste des privilèges detail sur $siren ".print_r($tabTypes, true),__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$iPriv = new MPrivileges();
|
||||
$ret = $iPriv->getPrivilegesDetail($siren, $tabTypes); //@todo : date
|
||||
|
||||
// @todo : faire les détails privileges
|
||||
$output = new PrivilegesDetailReturn();
|
||||
$output->error = new ErrorType();
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
@ -1417,7 +1388,6 @@ class WsEntreprise extends WsScore
|
||||
$this->authenticate();
|
||||
//Initialisation
|
||||
if (empty($tabTypes)) $tabTypes = array('03','04');
|
||||
$error = new ErrorType();
|
||||
debugLog('I',"Liste des privilèges cumul sur $siren ".print_r($tabTypes, true),__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$iPriv = new MPrivileges();
|
||||
$ret = $iPriv->getPrivilegesCumul($siren, $tabTypes);
|
||||
@ -1456,7 +1426,6 @@ class WsEntreprise extends WsScore
|
||||
}
|
||||
|
||||
$output = new PrivilegesCumulReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
@ -1477,8 +1446,7 @@ class WsEntreprise extends WsScore
|
||||
{
|
||||
$this->authenticate();
|
||||
$source = strtolower($source);
|
||||
switch ($source)
|
||||
{
|
||||
switch ($source) {
|
||||
case 'insee':
|
||||
$this->permission('survinsee');
|
||||
break;
|
||||
@ -1507,7 +1475,6 @@ class WsEntreprise extends WsScore
|
||||
if (empty($ref)) $ref = '';
|
||||
if (empty($delete)) $delete = false;
|
||||
if (empty($encoursClient)) $encoursClient = false;
|
||||
$error = new ErrorType();
|
||||
$tabRet = array();
|
||||
$siren = substr($siret,0,9);
|
||||
$nic = substr($siret,9,5);
|
||||
@ -1517,14 +1484,13 @@ class WsEntreprise extends WsScore
|
||||
$tabIdentite = $iInsee->getIdentiteLight($siren, $nic);
|
||||
$iDb = new WDB();
|
||||
$login = $this->tabInfoUser['login'];
|
||||
switch ($source)
|
||||
{
|
||||
switch ($source) {
|
||||
case 'insee':
|
||||
case 'annonces':
|
||||
case 'bilans':
|
||||
case 'actes':
|
||||
case 'privileges':
|
||||
case 'dirigeants': $encoursClient=0; break;
|
||||
case 'dirigeants': $encoursClient=0; break;
|
||||
case 'score': $encoursClient=$encoursClient*1; break;
|
||||
default: $source='annonces'; break;
|
||||
}
|
||||
@ -1540,44 +1506,30 @@ class WsEntreprise extends WsScore
|
||||
'cp' => $tabIdentite['CP'],
|
||||
'ville' => $tabIdentite['Ville'],
|
||||
);
|
||||
if ($delete)
|
||||
{
|
||||
if ($delete) {
|
||||
$tabUpdate = array_merge(
|
||||
$tabUpdate,
|
||||
array('dateSuppr'=>date('Y-m-d'))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$tabUpdate = array_merge(
|
||||
$tabUpdate,
|
||||
array('dateAjout'=>date('Y-m-d'), 'dateSuppr'=>0)
|
||||
);
|
||||
}
|
||||
if ( $delete || !$iDb->insert('surveillances_site', $tabUpdate))
|
||||
{
|
||||
if ( $delete || !$iDb->insert('surveillances_site', $tabUpdate)) {
|
||||
/*@sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "debugSurv pour $login",
|
||||
"source='$source' AND login='$login' AND email='$email' AND siren=$siren AND nic=$nic AND ref='$ref'".EOL.
|
||||
print_r($tabUpdate,true).EOL
|
||||
);*/
|
||||
if (!$iDb->update('surveillances_site', $tabUpdate, "source='$source' AND login='$login' AND email='$email' AND siren=$siren AND nic=$nic AND ref='$ref'"))
|
||||
{
|
||||
$error->errnum = 76841;
|
||||
$error->errmsg = 'Mise a jour impossible';
|
||||
$result = 0;
|
||||
$this->sendError('1030');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 1;
|
||||
}
|
||||
$output = new SetSurveillanceReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
$output->result = true;
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1674,13 +1626,10 @@ class WsEntreprise extends WsScore
|
||||
$tabRet[] = $liste;
|
||||
}
|
||||
}
|
||||
$result = new SurveillancesResult();
|
||||
$result->nbReponses = count($tabRet);
|
||||
$result->nbReponsesTotal = $nbRepTot;
|
||||
$result->liste = $tabRet;
|
||||
$output = new SurveillancesReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
$output->nbReponses = count($tabRet);
|
||||
$output->nbReponsesTotal = $nbRepTot;
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
|
||||
@ -1699,7 +1648,6 @@ class WsEntreprise extends WsScore
|
||||
//Initialisation
|
||||
if (empty($type)) $type = array('A','M');
|
||||
if (empty($cpDep)) $cpDep = 0;
|
||||
$error = new ErrorType();
|
||||
$tabRet = array();
|
||||
|
||||
debugLog('I',"Recherche de Mandataires '$nom' (Dep=$cpDep)",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
@ -1716,7 +1664,6 @@ class WsEntreprise extends WsScore
|
||||
|
||||
}
|
||||
$output = new MandatairesReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
@ -1737,25 +1684,22 @@ class WsEntreprise extends WsScore
|
||||
//Initialisation
|
||||
if (empty($typeBilan)) { $typeBilan = 'N'; }
|
||||
if (empty($ref)) { $ref = ''; }
|
||||
$error = new ErrorType();
|
||||
|
||||
debugLog('I',"Bilan $millesime $typeBilan demandée pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
$tabRet = array();
|
||||
if (strlen($siren)<>9){
|
||||
debugLog('W', "Siren $siren incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
$this->sendError('1010');
|
||||
} elseif ($siren*1==0) {
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
} else {
|
||||
$millesime = WDate::dateT('Ymd','d/m/Y',$millesime);
|
||||
$mBil = new MBilans($siren);
|
||||
$tabBilan = $mBil->getBilan($millesime, $typeBilan, $ref, true);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
$millesime = WDate::dateT('Ymd','d/m/Y',$millesime);
|
||||
$mBil = new MBilans($siren);
|
||||
$tabBilan = $mBil->getBilan($millesime, $typeBilan, $ref, true);
|
||||
|
||||
$resultBilan = new Bilan();
|
||||
$tabPoste = array();
|
||||
foreach($tabBilan as $key => $value){
|
||||
@ -1773,7 +1717,6 @@ class WsEntreprise extends WsScore
|
||||
}
|
||||
$resultBilan->POSTES = $tabPoste;
|
||||
$output = new BilanReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $resultBilan;
|
||||
return $output;
|
||||
}
|
||||
@ -1788,90 +1731,72 @@ class WsEntreprise extends WsScore
|
||||
{
|
||||
$this->authenticate();
|
||||
//Initialisation
|
||||
$error = new ErrorType();
|
||||
$tabRet = array();
|
||||
debugLog('I',"Liste des Bilans demandée pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
if (strlen($siren)<>9) {
|
||||
debugLog('W', "Siren $siren incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
$this->sendError('1010');
|
||||
} elseif ($siren*1==0) {
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
} else {
|
||||
$mBil = new MBilans($siren);
|
||||
$tabBilans = $mBil->listeBilans(false);
|
||||
foreach($tabBilans as $bilan)
|
||||
{
|
||||
$element = new ListeBilans();
|
||||
$element->dateProvPartenaire = $bilan['dateProvPartenaire']; //@todo : date
|
||||
$element->dateInsert = $bilan['dateInsert']; //@todo : date
|
||||
$element->typeBilan = $bilan['typeBilan'];
|
||||
$element->dureeExercice = $bilan['dureeExercice'];
|
||||
$element->dateExercice = $bilan['dateExercice']; //@todo : date
|
||||
$element->millesime = $bilan['millesime'];
|
||||
$element->dateExercicePre = $bilan['dateExercicePre']; //@todo : date
|
||||
$element->dureeExercicePre = $bilan['dureeExercicePre'];
|
||||
$element->monnaie = $bilan['monnaie'];
|
||||
$element->source = $bilan['source'];
|
||||
$tabRet[] = $element;
|
||||
}
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
$mBil = new MBilans($siren);
|
||||
$tabBilans = $mBil->listeBilans(false);
|
||||
foreach($tabBilans as $bilan)
|
||||
{
|
||||
$element = new ListeBilans();
|
||||
$element->dateProvPartenaire = $bilan['dateProvPartenaire']; //@todo : date
|
||||
$element->dateInsert = $bilan['dateInsert']; //@todo : date
|
||||
$element->typeBilan = $bilan['typeBilan'];
|
||||
$element->dureeExercice = $bilan['dureeExercice'];
|
||||
$element->dateExercice = $bilan['dateExercice']; //@todo : date
|
||||
$element->millesime = $bilan['millesime'];
|
||||
$element->dateExercicePre = $bilan['dateExercicePre']; //@todo : date
|
||||
$element->dureeExercicePre = $bilan['dureeExercicePre'];
|
||||
$element->monnaie = $bilan['monnaie'];
|
||||
$element->source = $bilan['source'];
|
||||
$tabRet[] = $element;
|
||||
}
|
||||
|
||||
debugLog('I', 'Nb Bilans retournés = '. count($tabBilans), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$result = new ListeBilansResult();
|
||||
$result->nbReponses = count($tabRet);
|
||||
$result->liste = $tabRet;
|
||||
$output = new ListeBilansReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
$output->nbReponses = count($tabRet);
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie si un siren existe en base Scores & Décisions
|
||||
* @param string $siren Siren de l'entité
|
||||
* @return SirenExistantReturn
|
||||
* @return boolean
|
||||
*/
|
||||
public function isSirenExistant($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
|
||||
//Initialisation
|
||||
$error = new ErrorType();
|
||||
$tabRet = array();
|
||||
$siren = trim(substr($siren,0,9));
|
||||
$result = false;
|
||||
debugLog('I',"Siren existant demandée pour siren $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
if ($siren*1==0) {
|
||||
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
$iInsee = new MInsee();
|
||||
$entrep = $iInsee->sirenExiste($siren);
|
||||
if (empty($entrep)) {
|
||||
debugLog('W', "Siren $siren non présent en base", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$result = false;
|
||||
} else {
|
||||
|
||||
$iInsee = new MInsee();
|
||||
$entrep = $iInsee->sirenExiste($siren);
|
||||
if (empty($entrep)) {
|
||||
|
||||
debugLog('W', "Siren $siren non présent en base", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
|
||||
} else {
|
||||
|
||||
debugLog('I', "Siren $siren présent en base", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$result = true;
|
||||
|
||||
}
|
||||
debugLog('I', "Siren $siren présent en base", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$result = true;
|
||||
}
|
||||
$this->wsLog('sirenExiste',$siren);
|
||||
$output = new SirenExistantReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
return $output;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2220,8 +2145,6 @@ class WsEntreprise extends WsScore
|
||||
$this->authenticate();
|
||||
|
||||
//Initialisation
|
||||
$error = new ErrorType();
|
||||
|
||||
$iDb = new WDB('sdv1');
|
||||
$tabRet = array();
|
||||
debugLog('I',"Liste des banques demandée pour siren $siren",
|
||||
@ -2288,7 +2211,6 @@ class WsEntreprise extends WsScore
|
||||
$error->errmsg = 'Aucune relation bancaire en base';
|
||||
}
|
||||
$output = new BanquesReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
@ -2602,14 +2524,9 @@ class WsEntreprise extends WsScore
|
||||
}
|
||||
}
|
||||
$this->wsLog('competences',$siret,$type.'/'.$codeInsee);
|
||||
$result = new ListeCompetencesResult();
|
||||
$result->liste = $tabRet;
|
||||
$result->nbReponses = count($tabRet);
|
||||
$output = new ListeCompetencesReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
Zend_Registry::get('WsLogger')
|
||||
->info(__FUNCTION__.' - '.print_r($output, 1));
|
||||
$output->result = $tabRet;
|
||||
$output->nbReponses = count($tabRet);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user