Prepare new release 2.8, issue #0002114

This commit is contained in:
Michael RICOIS 2015-05-28 13:19:28 +00:00
parent aef8f4d490
commit 9f2f33a6b8
10 changed files with 435 additions and 246 deletions

View File

@ -1,13 +1,14 @@
<?php <?php
// Generated by ZF's ./bin/classmap_generator.php // Generated by ZF's ./bin/classmap_generator.php
return array( return array(
'SdMetier_Graydon_Service' => dirname(__FILE__) . '//Graydon/Service.php', 'SdMetier_Graydon_Service' => dirname(__FILE__) . '//Graydon/Service.php',
'SdMetier_Infogreffe_DocAC' => dirname(__FILE__) . '//Infogreffe/DocAC.php', 'SdMetier_Infogreffe_DocAC' => dirname(__FILE__) . '//Infogreffe/DocAC.php',
'SdMetier_Infogreffe_DocBI' => dirname(__FILE__) . '//Infogreffe/DocBI.php', 'SdMetier_Infogreffe_DocBI' => dirname(__FILE__) . '//Infogreffe/DocBI.php',
'SdMetier_Infogreffe_DocST' => dirname(__FILE__) . '//Infogreffe/DocST.php', 'SdMetier_Infogreffe_DocST' => dirname(__FILE__) . '//Infogreffe/DocST.php',
'SdMetier_Infogreffe_Service' => dirname(__FILE__) . '//Infogreffe/Service.php', 'SdMetier_Infogreffe_Service' => dirname(__FILE__) . '//Infogreffe/Service.php',
'SdMetier_Scoring_Vars' => dirname(__FILE__) . '//Scoring/Vars.php', 'SdMetier_Intersud_Service' => dirname(__FILE__) . '//Intersud/Service.php',
'SdMetier_Search_Engine' => dirname(__FILE__) . '//Search/Engine.php', 'SdMetier_Rnvp_Detail' => dirname(__FILE__) . '//Rnvp/Detail.php',
'SdMetier_Sfr_Compile' => dirname(__FILE__) . '//Sfr/Compile.php', 'SdMetier_Search_Engine' => dirname(__FILE__) . '//Search/Engine.php',
'SdMetier_Sfr_Scoring' => dirname(__FILE__) . '//Sfr/Scoring.php', 'SdMetier_Sfr_Compile' => dirname(__FILE__) . '//Sfr/Compile.php',
'SdMetier_Sfr_Scoring' => dirname(__FILE__) . '//Sfr/Scoring.php',
); );

View File

@ -268,8 +268,7 @@ class Entreprise extends Scores_Ws_Server
$identite->DateMajANN = $entrep['dateMajANN']; //@todo : date $identite->DateMajANN = $entrep['dateMajANN']; //@todo : date
$identite->DateMajID = $entrep['dateMajIdentite']; //@todo : date $identite->DateMajID = $entrep['dateMajIdentite']; //@todo : date
if (preg_match('/NAF4/i', $this->User->pref)) if ( preg_match('/NAF4/i', $this->User->pref) ) {
{
$entrep2 = $iInsee->getNaf4($siren, $nic, $id); $entrep2 = $iInsee->getNaf4($siren, $nic, $id);
if ( $entrep2 !== false ) { if ( $entrep2 !== false ) {
$identite->Naf4Ent = $entrep2['apen4']; $identite->Naf4Ent = $entrep2['apen4'];
@ -279,7 +278,7 @@ class Entreprise extends Scores_Ws_Server
} }
} }
$this->wsLog('identite',$siret,$id); $this->wsLog('identite', $siret, $id);
return $identite; return $identite;
} }
@ -300,13 +299,13 @@ class Entreprise extends Scores_Ws_Server
} }
$db = Zend_Db_Table_Abstract::getDefaultAdapter(); $db = Zend_Db_Table_Abstract::getDefaultAdapter();
$output = new AvisRncs(); $output = new AvisRncs();
$iDb = new WDB(); $iDb = new WDB();
$rncs = new MRncs($iDb); $rncs = new MRncs($iDb);
//jo.etablissements => insee uniquement, rncs ? //jo.etablissements => insee uniquement, rncs ?
//Entreprise //Entreprise
$infosEtab = $rncs->getIdentiteEtab($siren); $infosEtab = $rncs->getIdentiteEtab($siren);
if ( $infosEtab === false ) { if ( $infosEtab === false ) {
@ -317,14 +316,14 @@ class Entreprise extends Scores_Ws_Server
$output->Sigle = $infosEtab['sigle']; $output->Sigle = $infosEtab['sigle'];
$output->Enseigne = $infosEtab['enseigne']; $output->Enseigne = $infosEtab['enseigne'];
$output->NomCommercial = $infosEtab['nomCommercial']; $output->NomCommercial = $infosEtab['nomCommercial'];
$output->Siren = $infosEtab['siren']; $output->Siren = $infosEtab['siren'];
$output->NumGest = $infosEtab['numRC']; $output->NumGest = $infosEtab['numRC'];
$output->RadiationDate = $infosEtab['dateRad']; $output->RadiationDate = $infosEtab['dateRad'];
$output->ImmatDate = $infosEtab['dateImma']; $output->ImmatDate = $infosEtab['dateImma'];
$output->NafCode = $infosEtab['nafEnt']; $output->NafCode = $infosEtab['nafEnt'];
$output->NafLabel = $infosEtab['nafEntLib']; $output->NafLabel = $infosEtab['nafEntLib'];
if (empty($infosEtab['dateRad']) || $infosEtab['dateRad'] = '0000-00-00') { if (empty($infosEtab['dateRad']) || $infosEtab['dateRad'] = '0000-00-00') {
$output->TribunalCode = $infosEtab['triCode']; //@todo $output->TribunalCode = $infosEtab['triCode']; //@todo
$output->TribunalLabel = $infosEtab['libGreffe']; // @todo $output->TribunalLabel = $infosEtab['libGreffe']; // @todo
@ -336,7 +335,7 @@ class Entreprise extends Scores_Ws_Server
$output->CapitalDev = $infosEtab['capitalDevIso']; $output->CapitalDev = $infosEtab['capitalDevIso'];
} }
$output->CapitalType = $infosEtab['capitalType']; $output->CapitalType = $infosEtab['capitalType'];
$output->SiegeAdresseNum = intval($infosEtab['adrNumVoie']); $output->SiegeAdresseNum = intval($infosEtab['adrNumVoie']);
$output->SiegeAdresseBtq = $infosEtab['adrIndRep']; $output->SiegeAdresseBtq = $infosEtab['adrIndRep'];
$output->SiegeAdresseVoieType = $infosEtab['adrTypeVoie'] ; $output->SiegeAdresseVoieType = $infosEtab['adrTypeVoie'] ;
@ -344,12 +343,12 @@ class Entreprise extends Scores_Ws_Server
$output->SiegeAdresseComp = $infosEtab['adrComp']; $output->SiegeAdresseComp = $infosEtab['adrComp'];
$output->SiegeAdresseCP = $infosEtab['cp']; $output->SiegeAdresseCP = $infosEtab['cp'];
$output->SiegeAdresseVille = $infosEtab['commune']; $output->SiegeAdresseVille = $infosEtab['commune'];
$output->DateMajRCS = $infosEtab['DateMajRCS']; $output->DateMajRCS = $infosEtab['DateMajRCS'];
//Durée de la société - impossible //Durée de la société - impossible
$output->DureeDate = ''; $output->DureeDate = '';
//Date du dernier bilan - MOIS/JOUR au pire chercher dans l'annonce //Date du dernier bilan - MOIS/JOUR au pire chercher dans l'annonce
try { try {
$bilanM = new Application_Model_JoBilans(); $bilanM = new Application_Model_JoBilans();
@ -363,18 +362,18 @@ class Entreprise extends Scores_Ws_Server
$output->CompteArretJour = substr($result->dateExercice,6,2); $output->CompteArretJour = substr($result->dateExercice,6,2);
} }
} catch(Zend_Db_Exception $e) {} } catch(Zend_Db_Exception $e) {}
//=> Avec l'adresse du premier siège //=> Avec l'adresse du premier siège
$output->ConstitutionTribunalCode = ''; $output->ConstitutionTribunalCode = '';
$output->ConstitutionTribunalLabel = ''; $output->ConstitutionTribunalLabel = '';
$iInsee = new MInsee($iDb); $iInsee = new MInsee($iDb);
$dirs = $iInsee->getDirigeants($siren, false); $dirs = $iInsee->getDirigeants($siren, false);
$liste = array(); $liste = array();
foreach ($dirs as $nb => $dir) foreach ($dirs as $nb => $dir)
{ {
$dirigeant = new AvisRncsAdmin(); $dirigeant = new AvisRncsAdmin();
$dirigeant->Code = $dir['Fonction']; $dirigeant->Code = $dir['Fonction'];
$dirigeant->Label = $dir['Titre']; $dirigeant->Label = $dir['Titre'];
$dirigeant->CompanyName = $dir['Societe']; $dirigeant->CompanyName = $dir['Societe'];
@ -389,23 +388,23 @@ class Entreprise extends Scores_Ws_Server
$liste[] = $dirigeant; $liste[] = $dirigeant;
} }
$output->Administration = $liste; $output->Administration = $liste;
$insee = $iInsee->getIdentiteEntreprise($siren); $insee = $iInsee->getIdentiteEntreprise($siren);
//Origine, code à transformer - getIdentiteEntreprise - insee //Origine, code à transformer - getIdentiteEntreprise - insee
$output->Origine = $insee['OrigineCreation']; $output->Origine = $insee['OrigineCreation'];
//Activité réelle - getIdentiteEntreprise - insee //Activité réelle - getIdentiteEntreprise - insee
$output->Activite = $insee['Activite']; $output->Activite = $insee['Activite'];
$output->BodaccActivite = $insee['Activite']; $output->BodaccActivite = $insee['Activite'];
//Date de création à l'insee - getIdentiteEntreprise - insee //Date de création à l'insee - getIdentiteEntreprise - insee
//@todo : Aller cherche dans les annonces bodacc création + acquisition //@todo : Aller cherche dans les annonces bodacc création + acquisition
$output->ActiviteDate = substr($insee['DateCreaEn'],0,4).'-'.substr($insee['DateCreaEn'],4,2).'-'.substr($insee['DateCreaEn'],6,2); $output->ActiviteDate = substr($insee['DateCreaEn'],0,4).'-'.substr($insee['DateCreaEn'],4,2).'-'.substr($insee['DateCreaEn'],6,2);
//Type d'exploitation - getIdentiteEntreprise - insee //Type d'exploitation - getIdentiteEntreprise - insee
$output->Exploitation = $insee['TypeExploitation']; $output->Exploitation = $insee['TypeExploitation'];
//Liste des jugements //Liste des jugements
$output->Evenements = array(); $output->Evenements = array();
$evens = $rncs->getListeJugements($siren); $evens = $rncs->getListeJugements($siren);
@ -414,7 +413,7 @@ class Entreprise extends Scores_Ws_Server
$output->Evenements[] = $even['dateEffet'] . ' - ' . $even['libEven']; $output->Evenements[] = $even['dateEffet'] . ' - ' . $even['libEven'];
} }
} }
//Liste des dépots //Liste des dépots
$output->Depots = array(); $output->Depots = array();
$infogreffe = new SdMetier_Infogreffe_DocAC($siren); $infogreffe = new SdMetier_Infogreffe_DocAC($siren);
@ -437,7 +436,7 @@ class Entreprise extends Scores_Ws_Server
$acte->infos[] = $infos['libDepot']; $acte->infos[] = $infos['libDepot'];
} }
} }
//Acte constitutif - Statut //Acte constitutif - Statut
//@todo : STATUTS CONSTITUTIFS //@todo : STATUTS CONSTITUTIFS
$date = substr($depot->ActeDate,0,4); $date = substr($depot->ActeDate,0,4);
@ -445,15 +444,15 @@ class Entreprise extends Scores_Ws_Server
$output->ConstitutionActeDate = $depot->ActeDate; $output->ConstitutionActeDate = $depot->ActeDate;
$output->ConstitutionDepotDate = $depot->DepotDate; $output->ConstitutionDepotDate = $depot->DepotDate;
} }
$i++; $i++;
if ($i < 4 || $i > count($depots)-4) { if ($i < 4 || $i > count($depots)-4) {
$output->Depots[] = $acte; $output->Depots[] = $acte;
} }
} }
} }
//Liste des établissements actifs au RNCS //Liste des établissements actifs au RNCS
$output->Etablissements = array(); $output->Etablissements = array();
$result = $iInsee->getEtablissements($siren, '', 0, 200, 200, 0, 1); $result = $iInsee->getEtablissements($siren, '', 0, 200, 200, 0, 1);
@ -464,7 +463,7 @@ class Entreprise extends Scores_Ws_Server
} }
} }
} }
$this->wsLog('avisrncs', $siren); $this->wsLog('avisrncs', $siren);
return $output; return $output;
@ -2763,7 +2762,7 @@ class Entreprise extends Scores_Ws_Server
$mRatios->setTrancheEffectif($efftr); $mRatios->setTrancheEffectif($efftr);
$tabRatios = $mRatios->calcul($tabBilan); $tabRatios = $mRatios->calcul($tabBilan);
} }
$nbRatios = count($tabRatios); $nbRatios = count($tabRatios);
debugLog('I',"Liste des Ratios demandée pour $siren après calculRatios ($nbRatios)",__LINE__,__FILE__, __FUNCTION__, __CLASS__); debugLog('I',"Liste des Ratios demandée pour $siren après calculRatios ($nbRatios)",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
@ -3073,7 +3072,7 @@ class Entreprise extends Scores_Ws_Server
return $output; return $output;
} else { } else {
$O = $this->searchNomAdr( $O = $this->searchNomAdr(
Scores_Locale_String::cleanstring($entCriteres->raisonSociale), Scores_Locale_String::cleanstring($entCriteres->raisonSociale),
Scores_Locale_String::cleanstring($entCriteres->adresse), Scores_Locale_String::cleanstring($entCriteres->adresse),
@ -3461,7 +3460,7 @@ class Entreprise extends Scores_Ws_Server
// --- Supprimer les éléments autres que chiffres dans le siret // --- Supprimer les éléments autres que chiffres dans le siret
$siret = preg_replace('/[^0-9]/', '', $siret); $siret = preg_replace('/[^0-9]/', '', $siret);
// --- Controle de la taille du siret/siren // --- Controle de la taille du siret/siren
if ( strlen($siret)!=14 && strlen($siret)!=9 ){ if ( strlen($siret)!=14 && strlen($siret)!=9 ){
debugLog('W', "Siren/Siret $siret incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__); debugLog('W', "Siren/Siret $siret incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
@ -3562,7 +3561,7 @@ class Entreprise extends Scores_Ws_Server
$nbReponses = 1; $nbReponses = 1;
$nbReponsesTotal = 1; $nbReponsesTotal = 1;
} }
else { else {
$iDb = new WDB(); $iDb = new WDB();
$iDb->insert('jo.siren_inexistants', array( $iDb->insert('jo.siren_inexistants', array(
@ -4634,7 +4633,7 @@ class Entreprise extends Scores_Ws_Server
$tabRatios = $mRatios->calcul($tabBilan); $tabRatios = $mRatios->calcul($tabBilan);
//file_put_contents('debug.log', print_r($tabRatios,1)); //file_put_contents('debug.log', print_r($tabRatios,1));
} }
$nbRatios = count($tabRatios); $nbRatios = count($tabRatios);
debugLog('I',"Liste des Ratios demandée pour $siren après calculRatios ($nbRatios)",__LINE__,__FILE__, __FUNCTION__, __CLASS__); debugLog('I',"Liste des Ratios demandée pour $siren après calculRatios ($nbRatios)",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
@ -4947,18 +4946,18 @@ class Entreprise extends Scores_Ws_Server
elseif ($cp>=99000) $dep=substr($cp,0,2); elseif ($cp>=99000) $dep=substr($cp,0,2);
elseif ($cp>=98000) $dep=substr($cp,0,3); elseif ($cp>=98000) $dep=substr($cp,0,3);
elseif ($cp>=97100 && $cp<97700) $dep=substr($cp,0,3); elseif ($cp>=97100 && $cp<97700) $dep=substr($cp,0,3);
if ($type=='pre') { if ($type=='pre') {
$iDb = new WDB(); $iDb = new WDB();
$tabTmp2 = $iDb->select('jo.villes', 'DEP, COM, AR, CT', 'codeInsee='.$codeInsee, false, MYSQL_ASSOC); $tabTmp2 = $iDb->select('jo.villes', 'DEP, COM, AR, CT', 'codeInsee='.$codeInsee, false, MYSQL_ASSOC);
$arrond = $tabTmp2[0]['AR']; $arrond = $tabTmp2[0]['AR'];
$tabTmp2 = $iDb->select('insee.insee_tabArrond', 'CHEFLIEU, ARTMAJ, NCC', "DEP='$dep' AND AR='$arrond'", false, MYSQL_ASSOC); $tabTmp2 = $iDb->select('insee.insee_tabArrond', 'CHEFLIEU, ARTMAJ, NCC', "DEP='$dep' AND AR='$arrond'", false, MYSQL_ASSOC);
$nomSousPref = trim(strtr($tabTmp2[0]['ARTMAJ'],array('('=>'',')'=>'',' '=>'', "'"=>'')).' '.$tabTmp2[0]['NCC']); $nomSousPref = trim(strtr($tabTmp2[0]['ARTMAJ'],array('('=>'',')'=>'',' '=>'', "'"=>'')).' '.$tabTmp2[0]['NCC']);
$tabTmp = $iBodacc->getTribunauxParDep($dep); $tabTmp = $iBodacc->getTribunauxParDep($dep);
foreach ($tabTmp as $i=>$tribunal) foreach ($tabTmp as $i=>$tribunal)
{ {
if ($tribunal['triType']=='A' || $tribunal['triType']=='B') if ($tribunal['triType']=='A' || $tribunal['triType']=='B')

View File

@ -48,7 +48,7 @@ class Entreprise extends Scores_Ws_Server
} }
$db = new WDB(); $db = new WDB();
$iInsee = new MInsee($db); $iInsee = new MInsee($db);
$entrep = $iInsee->getIdentiteEntreprise($siren, $nic, $id, $forceVerif); $entrep = $iInsee->getIdentiteEntreprise($siren, $nic, $id, $forceVerif);
if (empty($entrep) || empty($entrep['id']) ) { if (empty($entrep) || empty($entrep['id']) ) {
@ -109,7 +109,7 @@ class Entreprise extends Scores_Ws_Server
} }
$identite->AdresseDomEnt = $tabAdresseDomEnt; $identite->AdresseDomEnt = $tabAdresseDomEnt;
$identite->AdresseDomNb = $entrep['AdresseDomNb']; $identite->AdresseDomNb = $entrep['AdresseDomNb'];
// --- Indicateur Adresse RNVP // --- Indicateur Adresse RNVP
try { try {
$rnvpM = new Application_Model_VillesRnvpSources(); $rnvpM = new Application_Model_VillesRnvpSources();
@ -121,8 +121,8 @@ class Entreprise extends Scores_Ws_Server
$identite->AdresseRnvpCode = $rnvpResult->codeRetour; $identite->AdresseRnvpCode = $rnvpResult->codeRetour;
} }
} catch (Zend_Db_Exception $e) {} } catch (Zend_Db_Exception $e) {}
$identite->Civilite = $entrep['Civilite']; $identite->Civilite = $entrep['Civilite'];
$identite->NbEtab = $entrep['NbEtab']; $identite->NbEtab = $entrep['NbEtab'];
$identite->Tel = prepareString($entrep['Tel']); $identite->Tel = prepareString($entrep['Tel']);
@ -228,7 +228,7 @@ class Entreprise extends Scores_Ws_Server
$identite->Bilan->CAestime = $entrep['bilanFLestime']; $identite->Bilan->CAestime = $entrep['bilanFLestime'];
$identite->Bilan->Resultat = prepareString($entrep['bilanHN']); $identite->Bilan->Resultat = prepareString($entrep['bilanHN']);
$identite->Bilan->Effectif = $entrep['bilanYP']; $identite->Bilan->Effectif = $entrep['bilanYP'];
$iBourse = new MBourse($siren, $db); $iBourse = new MBourse($siren, $db);
$bourse = $iBourse->getInfosBourse($siren); $bourse = $iBourse->getInfosBourse($siren);
$identite->Bourse->placeCotation = $bourse['placeCotation']; $identite->Bourse->placeCotation = $bourse['placeCotation'];
@ -290,7 +290,7 @@ class Entreprise extends Scores_Ws_Server
$identite->Naf4EtabLib = prepareString($entrep2['apet4_lib']); $identite->Naf4EtabLib = prepareString($entrep2['apet4_lib']);
} }
} }
// --- Détermination du groupe - Tête de groupe // --- Détermination du groupe - Tête de groupe
if (!empty($siren)) { if (!empty($siren)) {
$lienM = new MLiens2($siren, 'siren'); $lienM = new MLiens2($siren, 'siren');
@ -315,7 +315,7 @@ class Entreprise extends Scores_Ws_Server
$sql = $countryM->select()->from($countryM, array('codPays3', 'libPays')); $sql = $countryM->select()->from($countryM, array('codPays3', 'libPays'));
$result = $countryM->fetchAll($sql); $result = $countryM->fetchAll($sql);
} catch (Zend_Db_Adapter_Exception $e) {} } catch (Zend_Db_Adapter_Exception $e) {}
$tabPays = array(); $tabPays = array();
if ( $result->count()>0 ) { if ( $result->count()>0 ) {
foreach ( $result as $item ) { foreach ( $result as $item ) {
@ -333,7 +333,7 @@ class Entreprise extends Scores_Ws_Server
} }
} }
} }
$this->wsLog('identite', $siret, $id); $this->wsLog('identite', $siret, $id);
@ -354,13 +354,13 @@ class Entreprise extends Scores_Ws_Server
if ( $len != 9 ) { if ( $len != 9 ) {
$this->sendError('1020'); $this->sendError('1020');
} }
$output = new AvisRncs(); $output = new AvisRncs();
$iDb = new WDB(); $iDb = new WDB();
$rncs = new MRncs($iDb); $rncs = new MRncs($iDb);
//jo.etablissements => insee uniquement, rncs ? //jo.etablissements => insee uniquement, rncs ?
//Entreprise //Entreprise
$infosEtab = $rncs->getIdentiteEtab($siren); $infosEtab = $rncs->getIdentiteEtab($siren);
if ( $infosEtab === false ) { if ( $infosEtab === false ) {
@ -371,14 +371,14 @@ class Entreprise extends Scores_Ws_Server
$output->Sigle = $infosEtab['sigle']; $output->Sigle = $infosEtab['sigle'];
$output->Enseigne = $infosEtab['enseigne']; $output->Enseigne = $infosEtab['enseigne'];
$output->NomCommercial = $infosEtab['nomCommercial']; $output->NomCommercial = $infosEtab['nomCommercial'];
$output->Siren = $infosEtab['siren']; $output->Siren = $infosEtab['siren'];
$output->NumGest = $infosEtab['numRC']; $output->NumGest = $infosEtab['numRC'];
$output->RadiationDate = $infosEtab['dateRad']; $output->RadiationDate = $infosEtab['dateRad'];
$output->ImmatDate = $infosEtab['dateImma']; $output->ImmatDate = $infosEtab['dateImma'];
$output->NafCode = $infosEtab['nafEnt']; $output->NafCode = $infosEtab['nafEnt'];
$output->NafLabel = $infosEtab['nafEntLib']; $output->NafLabel = $infosEtab['nafEntLib'];
if (empty($infosEtab['dateRad']) || $infosEtab['dateRad'] = '0000-00-00') { if (empty($infosEtab['dateRad']) || $infosEtab['dateRad'] = '0000-00-00') {
$output->TribunalCode = $infosEtab['triCode']; //@todo $output->TribunalCode = $infosEtab['triCode']; //@todo
$output->TribunalLabel = $infosEtab['libGreffe']; // @todo $output->TribunalLabel = $infosEtab['libGreffe']; // @todo
@ -390,7 +390,7 @@ class Entreprise extends Scores_Ws_Server
$output->CapitalDev = $infosEtab['capitalDevIso']; $output->CapitalDev = $infosEtab['capitalDevIso'];
} }
$output->CapitalType = $infosEtab['capitalType']; $output->CapitalType = $infosEtab['capitalType'];
$output->SiegeAdresseNum = intval($infosEtab['adrNumVoie']); $output->SiegeAdresseNum = intval($infosEtab['adrNumVoie']);
$output->SiegeAdresseBtq = $infosEtab['adrIndRep']; $output->SiegeAdresseBtq = $infosEtab['adrIndRep'];
$output->SiegeAdresseVoieType = $infosEtab['adrTypeVoie'] ; $output->SiegeAdresseVoieType = $infosEtab['adrTypeVoie'] ;
@ -398,12 +398,12 @@ class Entreprise extends Scores_Ws_Server
$output->SiegeAdresseComp = $infosEtab['adrComp']; $output->SiegeAdresseComp = $infosEtab['adrComp'];
$output->SiegeAdresseCP = $infosEtab['cp']; $output->SiegeAdresseCP = $infosEtab['cp'];
$output->SiegeAdresseVille = $infosEtab['commune']; $output->SiegeAdresseVille = $infosEtab['commune'];
$output->DateMajRCS = $infosEtab['DateMajRCS']; $output->DateMajRCS = $infosEtab['DateMajRCS'];
//Durée de la société - impossible //Durée de la société - impossible
$output->DureeDate = ''; $output->DureeDate = '';
//Date du dernier bilan - MOIS/JOUR au pire chercher dans l'annonce //Date du dernier bilan - MOIS/JOUR au pire chercher dans l'annonce
try { try {
$bilanM = new Application_Model_JoBilans(); $bilanM = new Application_Model_JoBilans();
@ -417,18 +417,18 @@ class Entreprise extends Scores_Ws_Server
$output->CompteArretJour = substr($result->dateExercice,6,2); $output->CompteArretJour = substr($result->dateExercice,6,2);
} }
} catch(Zend_Db_Exception $e) {} } catch(Zend_Db_Exception $e) {}
//=> Avec l'adresse du premier siège //=> Avec l'adresse du premier siège
$output->ConstitutionTribunalCode = ''; $output->ConstitutionTribunalCode = '';
$output->ConstitutionTribunalLabel = ''; $output->ConstitutionTribunalLabel = '';
$iInsee = new MInsee($iDb); $iInsee = new MInsee($iDb);
$dirs = $iInsee->getDirigeants($siren, false); $dirs = $iInsee->getDirigeants($siren, false);
$liste = array(); $liste = array();
foreach ($dirs as $nb => $dir) foreach ($dirs as $nb => $dir)
{ {
$dirigeant = new AvisRncsAdmin(); $dirigeant = new AvisRncsAdmin();
$dirigeant->Code = $dir['Fonction']; $dirigeant->Code = $dir['Fonction'];
$dirigeant->Label = $dir['Titre']; $dirigeant->Label = $dir['Titre'];
$dirigeant->CompanyName = $dir['Societe']; $dirigeant->CompanyName = $dir['Societe'];
@ -443,23 +443,23 @@ class Entreprise extends Scores_Ws_Server
$liste[] = $dirigeant; $liste[] = $dirigeant;
} }
$output->Administration = $liste; $output->Administration = $liste;
$insee = $iInsee->getIdentiteEntreprise($siren); $insee = $iInsee->getIdentiteEntreprise($siren);
//Origine, code à transformer - getIdentiteEntreprise - insee //Origine, code à transformer - getIdentiteEntreprise - insee
$output->Origine = $insee['OrigineCreation']; $output->Origine = $insee['OrigineCreation'];
//Activité réelle - getIdentiteEntreprise - insee //Activité réelle - getIdentiteEntreprise - insee
$output->Activite = $insee['Activite']; $output->Activite = $insee['Activite'];
$output->BodaccActivite = $insee['Activite']; $output->BodaccActivite = $insee['Activite'];
//Date de création à l'insee - getIdentiteEntreprise - insee //Date de création à l'insee - getIdentiteEntreprise - insee
//@todo : Aller cherche dans les annonces bodacc création + acquisition //@todo : Aller cherche dans les annonces bodacc création + acquisition
$output->ActiviteDate = substr($insee['DateCreaEn'],0,4).'-'.substr($insee['DateCreaEn'],4,2).'-'.substr($insee['DateCreaEn'],6,2); $output->ActiviteDate = substr($insee['DateCreaEn'],0,4).'-'.substr($insee['DateCreaEn'],4,2).'-'.substr($insee['DateCreaEn'],6,2);
//Type d'exploitation - getIdentiteEntreprise - insee //Type d'exploitation - getIdentiteEntreprise - insee
$output->Exploitation = $insee['TypeExploitation']; $output->Exploitation = $insee['TypeExploitation'];
//Liste des jugements //Liste des jugements
$output->Evenements = array(); $output->Evenements = array();
$evens = $rncs->getListeJugements($siren); $evens = $rncs->getListeJugements($siren);
@ -468,7 +468,7 @@ class Entreprise extends Scores_Ws_Server
$output->Evenements[] = $even['dateEffet'] . ' - ' . $even['libEven']; $output->Evenements[] = $even['dateEffet'] . ' - ' . $even['libEven'];
} }
} }
//Liste des dépots //Liste des dépots
$output->Depots = array(); $output->Depots = array();
$infogreffe = new SdMetier_Infogreffe_DocAC($siren); $infogreffe = new SdMetier_Infogreffe_DocAC($siren);
@ -491,7 +491,7 @@ class Entreprise extends Scores_Ws_Server
$acte->infos[] = $infos['libDepot']; $acte->infos[] = $infos['libDepot'];
} }
} }
//Acte constitutif - Statut //Acte constitutif - Statut
//@todo : STATUTS CONSTITUTIFS //@todo : STATUTS CONSTITUTIFS
$date = substr($depot->ActeDate,0,4); $date = substr($depot->ActeDate,0,4);
@ -499,15 +499,15 @@ class Entreprise extends Scores_Ws_Server
$output->ConstitutionActeDate = $depot->ActeDate; $output->ConstitutionActeDate = $depot->ActeDate;
$output->ConstitutionDepotDate = $depot->DepotDate; $output->ConstitutionDepotDate = $depot->DepotDate;
} }
$i++; $i++;
if ($i < 4 || $i > count($depots)-4) { if ($i < 4 || $i > count($depots)-4) {
$output->Depots[] = $acte; $output->Depots[] = $acte;
} }
} }
} }
//Liste des établissements actifs au RNCS //Liste des établissements actifs au RNCS
$output->Etablissements = array(); $output->Etablissements = array();
$result = $iInsee->getEtablissements($siren, '', 0, 200, 200, 0, 1); $result = $iInsee->getEtablissements($siren, '', 0, 200, 200, 0, 1);
@ -518,12 +518,12 @@ class Entreprise extends Scores_Ws_Server
} }
} }
} }
$this->wsLog('avisrncs', $siren); $this->wsLog('avisrncs', $siren);
return $output; return $output;
} }
/** /**
* RNVP * RNVP
* @param string $companyId * @param string $companyId
@ -538,8 +538,8 @@ class Entreprise extends Scores_Ws_Server
public function getRNVP($companyId, $type = null) public function getRNVP($companyId, $type = null)
{ {
$this->authenticate(); $this->authenticate();
$this->permission('RNVP'); //$this->permission('RNVP');
// --- Identifiant SD : source + id // --- Identifiant SD : source + id
if ($type === null) { if ($type === null) {
$source = substr($companyId,0,3); $source = substr($companyId,0,3);
@ -573,7 +573,7 @@ class Entreprise extends Scores_Ws_Server
else { else {
throw new SoapFault('ERR', 'type identifiant inconnu'); throw new SoapFault('ERR', 'type identifiant inconnu');
} }
// --- Formattage pour la sortie // --- Formattage pour la sortie
try { try {
$rnvpM = new Application_Model_VillesRnvpSources(); $rnvpM = new Application_Model_VillesRnvpSources();
@ -606,7 +606,7 @@ class Entreprise extends Scores_Ws_Server
if ($rnvpResult === null) { if ($rnvpResult === null) {
throw new SoapFault('MSG', "Aucun résultat"); throw new SoapFault('MSG', "Aucun résultat");
} }
$InfoRNVP = new Rnvp(); $InfoRNVP = new Rnvp();
$InfoRNVP->L1 = $rnvpResult->L1rnvp; $InfoRNVP->L1 = $rnvpResult->L1rnvp;
$InfoRNVP->L2 = $rnvpResult->L2rnvp; $InfoRNVP->L2 = $rnvpResult->L2rnvp;
@ -615,7 +615,7 @@ class Entreprise extends Scores_Ws_Server
$InfoRNVP->L5 = $rnvpResult->L5rnvp; $InfoRNVP->L5 = $rnvpResult->L5rnvp;
$InfoRNVP->L6 = $rnvpResult->L6rnvp; $InfoRNVP->L6 = $rnvpResult->L6rnvp;
$InfoRNVP->L7 = $rnvpResult->L7rnvp; $InfoRNVP->L7 = $rnvpResult->L7rnvp;
$InfoRNVP->ProcessDate = $rnvpResult->dateRetourRnvp; $InfoRNVP->ProcessDate = $rnvpResult->dateRetourRnvp;
$InfoRNVP->ProcessCode = $rnvpResult->codeRetour; $InfoRNVP->ProcessCode = $rnvpResult->codeRetour;
switch($rnvpResult->codeRetour) { switch($rnvpResult->codeRetour) {
@ -637,7 +637,7 @@ class Entreprise extends Scores_Ws_Server
} }
$InfoRNVP->QualityCode = $rnvpResult->CQadrs; $InfoRNVP->QualityCode = $rnvpResult->CQadrs;
$InfoRNVP->QualityLabel = ''; // Label CQadrs $InfoRNVP->QualityLabel = ''; // Label CQadrs
$InfoRNVP->GeoInseeCommune = $rnvpResult->Insee; $InfoRNVP->GeoInseeCommune = $rnvpResult->Insee;
$InfoRNVP->GeoHexavia = $rnvpResult->IdHexavia; $InfoRNVP->GeoHexavia = $rnvpResult->IdHexavia;
$InfoRNVP->GeoHexapost = $rnvpResult->IdHexaposte; $InfoRNVP->GeoHexapost = $rnvpResult->IdHexaposte;
@ -647,14 +647,14 @@ class Entreprise extends Scores_Ws_Server
$InfoRNVP->GeoIlot = $rnvpResult->Iris_Ilot99; $InfoRNVP->GeoIlot = $rnvpResult->Iris_Ilot99;
$InfoRNVP->GeoIris = $rnvpResult->Iris_CodeIris; $InfoRNVP->GeoIris = $rnvpResult->Iris_CodeIris;
$InfoRNVP->GeoCanton = $rnvpResult->Iris_Canton; $InfoRNVP->GeoCanton = $rnvpResult->Iris_Canton;
$InfoRNVP->DateInsert = $rnvpResult->dateInsert; $InfoRNVP->DateInsert = $rnvpResult->dateInsert;
$InfoRNVP->DateUpdate = $rnvpResult->dateUpdate; $InfoRNVP->DateUpdate = $rnvpResult->dateUpdate;
$this->wsLog('rnvp'); $this->wsLog('rnvp');
return $InfoRNVP; return $InfoRNVP;
} catch (Zend_Db_Exception $e) { } catch (Zend_Db_Exception $e) {
if ($this->User->idClient==1) { if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage()); throw new SoapFault('ERR', $e->getMessage());
@ -663,15 +663,15 @@ class Entreprise extends Scores_Ws_Server
} }
} }
} }
protected function getIndiScore() protected function getIndiScore()
{ {
//Identite Light => propre à la méthode //Identite Light => propre à la méthode
//Indiscore //Indiscore
//Text //Text
} }
protected function getReportStd() protected function getReportStd()
{ {
//Identite Light //Identite Light
@ -679,16 +679,16 @@ class Entreprise extends Scores_Ws_Server
//Indiscore //Indiscore
//Commentaires //Commentaires
} }
protected function getReportComment() protected function getReportComment()
{ {
//Commentaires suivant niveau enregistré dans le profil de l'utilisateur //Commentaires suivant niveau enregistré dans le profil de l'utilisateur
} }
protected function getValo(){} protected function getValo(){}
} }
?> ?>

View File

@ -233,13 +233,13 @@ class Identite
* @var int * @var int
*/ */
public $AdresseDomNb; public $AdresseDomNb;
/** /**
* Date du retour RNVP * Date du retour RNVP
* @var string * @var string
*/ */
public $AdresseRnvpDate; public $AdresseRnvpDate;
/** /**
* Indicateur Adresse RVNP (ND|KO|OK) * Indicateur Adresse RVNP (ND|KO|OK)
* @var string * @var string
@ -765,6 +765,36 @@ class Identite
* @var AutreSiret[] * @var AutreSiret[]
*/ */
public $AutreSiret; public $AutreSiret;
/**
*
* @var string
*/
public $GroupeId;
/**
*
* @var string
*/
public $GroupeName;
/**
*
* @var string
*/
public $GroupeIsin;
/**
*
* @var string
*/
public $GroupeCountryCode;
/**
*
* @var string
*/
public $GroupeCountryLabel;
} }
@ -801,6 +831,43 @@ class IdentiteBourse {
public $derCoursCloture; public $derCoursCloture;
} }
class InfosIris
{
/** Code Iris format court
* @var string
*/
public $codIris;
/** Code Iris format long (code commune Insee + code Iris)
* @var string
*/
public $codComIris;
/** Libellé de la zone Iris
* @var string
*/
public $libIris;
/** Libellé du type de la zone Iris
* @var string
*/
public $typIris;
/** Dernière évolution de la zone Iris
* @var string
*/
public $evoIris;
/** Code TRIRIS de l'Iris
* @var string
*/
public $trIris;
/** Code Grand Quartier de l'Iris
* @var string
*/
public $grdQuartier;
}
class IdentiteBilan class IdentiteBilan
{ {
@ -1332,97 +1399,97 @@ class Rnvp
* @var string * @var string
*/ */
public $L1; public $L1;
/** /**
* @var string * @var string
*/ */
public $L2; public $L2;
/** /**
* @var string * @var string
*/ */
public $L3; public $L3;
/** /**
* @var string * @var string
*/ */
public $L4; public $L4;
/** /**
* @var string * @var string
*/ */
public $L5; public $L5;
/** /**
* @var string * @var string
*/ */
public $L6; public $L6;
/** /**
* @var string * @var string
*/ */
public $L7; public $L7;
/** /**
* @var string * @var string
*/ */
public $ProcessDate; public $ProcessDate;
/** /**
* @var string * @var string
*/ */
public $ProcessCode; public $ProcessCode;
/** /**
* @var string * @var string
*/ */
public $ProcessLabel; public $ProcessLabel;
/** /**
* @var string * @var string
*/ */
public $QualityCode; public $QualityCode;
/** /**
* @var string * @var string
*/ */
public $QualityLabel; public $QualityLabel;
/** /**
* @var string * @var string
*/ */
public $GeoInseeCommune; public $GeoInseeCommune;
/** /**
* @var string * @var string
*/ */
public $GeoHexavia; public $GeoHexavia;
/** /**
* @var string * @var string
*/ */
public $GeoHexapost; public $GeoHexapost;
/** /**
* @var string * @var string
*/ */
public $GeoHexacle; public $GeoHexacle;
/** /**
* @var string * @var string
*/ */
public $GeoDepartement; public $GeoDepartement;
/** /**
* @var string * @var string
*/ */
public $GeoRivoliCode; public $GeoRivoliCode;
/** /**
* @var string * @var string
*/ */
public $GeoIlot; public $GeoIlot;
/** /**
* @var string * @var string
*/ */
@ -1432,12 +1499,12 @@ class Rnvp
* @var string * @var string
*/ */
public $GeoCanton; public $GeoCanton;
/** /**
* @var string * @var string
*/ */
public $DateInsert; public $DateInsert;
/** /**
* @var string * @var string
*/ */

View File

@ -28,10 +28,10 @@ class Gestion extends Scores_Ws_Server
$this->authIp = $ip; $this->authIp = $ip;
break; break;
} }
//Authentification des applications par login //Authentification des applications par login
$this->authenticate(); $this->authenticate();
//Enregistrement authentification OK //Enregistrement authentification OK
try { try {
$authLogM = new Application_Model_Sdv1UtilisateursAuthLog(); $authLogM = new Application_Model_Sdv1UtilisateursAuthLog();
@ -41,7 +41,7 @@ class Gestion extends Scores_Ws_Server
'ip' => $ip, 'ip' => $ip,
)); ));
} catch (Zend_Db_Exception $e) {} } catch (Zend_Db_Exception $e) {}
//Check App authorization - Find Service parameters //Check App authorization - Find Service parameters
$serviceM = new Application_Model_Sdv1ClientsServices(); $serviceM = new Application_Model_Sdv1ClientsServices();
@ -180,7 +180,7 @@ class Gestion extends Scores_Ws_Server
} }
} }
} }
/** /**
* Limite de temps * Limite de temps
*/ */
@ -467,6 +467,7 @@ class Gestion extends Scores_Ws_Server
$acces = new AccesDetails(); $acces = new AccesDetails();
$acces->Code = $item->Acces; $acces->Code = $item->Acces;
$acces->Label = $this->listeDroits[$item->Acces]; $acces->Label = $this->listeDroits[$item->Acces];
//@todo : ajouter Enable
$output->Acces[] = $acces; $output->Acces[] = $acces;
} }
} }
@ -1075,7 +1076,7 @@ class Gestion extends Scores_Ws_Server
} catch ( Zend_Db_Exception $e ) { } catch ( Zend_Db_Exception $e ) {
return false; return false;
} }
//Prepare data to insert //Prepare data to insert
foreach ($infos as $key => $value) { foreach ($infos as $key => $value) {
if (array_key_exists($key, $userData)) { if (array_key_exists($key, $userData)) {

View File

@ -2,4 +2,5 @@
return array( return array(
'BilanInput' => 'BilanInput', 'BilanInput' => 'BilanInput',
'PieceKbis' => 'PieceKbis', 'PieceKbis' => 'PieceKbis',
'Bilan' => 'Bilan',
); );

View File

@ -17,11 +17,11 @@ class Order extends Scores_Ws_Server
{ {
$this->authenticate(); $this->authenticate();
$this->permission('UPLOADBILAN'); $this->permission('UPLOADBILAN');
//Check siren //Check siren
$refCommande = uniqid(); $refCommande = uniqid();
$data = array( $data = array(
'refCommande' => $refCommande, 'refCommande' => $refCommande,
'siren' => $siren, 'siren' => $siren,
@ -75,7 +75,7 @@ class Order extends Scores_Ws_Server
return false; return false;
} }
/** /**
* Liste des commandes de saisie de bilan * Liste des commandes de saisie de bilan
* @param string $month * @param string $month
@ -91,17 +91,17 @@ class Order extends Scores_Ws_Server
} }
$dateStart = $month.'-01 00:00:00'; $dateStart = $month.'-01 00:00:00';
$dateEnd = $month.'-31 23:59:59'; $dateEnd = $month.'-31 23:59:59';
$list = array(); $list = array();
try { try {
$commandeM = new Application_Model_Sdv1OrderBilanInput(); $commandeM = new Application_Model_Sdv1OrderBilanInput();
$sql = $commandeM->select()->where('userId=?', $this->User->id); $sql = $commandeM->select()->where('userId=?', $this->User->id)->order('dateInsert DESC');
$result = $commandeM->fetchAll($sql); $result = $commandeM->fetchAll($sql);
if (count($result) > 0) { if (count($result) > 0) {
foreach($result as $item) { foreach($result as $item) {
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Siren = $item->siren; $cmd->Siren = $item->siren;
$cmd->BilanFileRecv = $item->bilanFileRecv; $cmd->BilanFileRecv = $item->bilanFileRecv;
$cmd->BilanCloture = $item->bilanCloture; $cmd->BilanCloture = $item->bilanCloture;
@ -120,7 +120,7 @@ class Order extends Scores_Ws_Server
throw new SoapFault('ERR', "Application error"); throw new SoapFault('ERR', "Application error");
} }
} }
return $list; return $list;
} }
@ -133,14 +133,14 @@ class Order extends Scores_Ws_Server
protected function getBilanInputDetail($ref) protected function getBilanInputDetail($ref)
{ {
$this->authenticate(); $this->authenticate();
try { try {
$commandeM = new Application_Model_Sdv1OrderBilanInput(); $commandeM = new Application_Model_Sdv1OrderBilanInput();
$sql = $commandeM->select()->where('userId=?', $this->User->id)->where('refCommande=?', $ref); $sql = $commandeM->select()->where('userId=?', $this->User->id)->where('refCommande=?', $ref);
$item = $commandeM->fetchRow($sql); $item = $commandeM->fetchRow($sql);
if ($item !== null) { if ($item !== null) {
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Siren = $item->siren; $cmd->Siren = $item->siren;
$cmd->BilanFileRecv = $item->bilanFileRecv; $cmd->BilanFileRecv = $item->bilanFileRecv;
$cmd->BilanCloture = $item->bilanCloture; $cmd->BilanCloture = $item->bilanCloture;
@ -158,10 +158,10 @@ class Order extends Scores_Ws_Server
throw new SoapFault('ERR', "Application error"); throw new SoapFault('ERR', "Application error");
} }
} }
return null; return null;
} }
/** /**
* Liste des commandes KBIS * Liste des commandes KBIS
* @param string $month * @param string $month
@ -177,17 +177,17 @@ class Order extends Scores_Ws_Server
} }
$dateStart = $month.'-01 00:00:00'; $dateStart = $month.'-01 00:00:00';
$dateEnd = $month.'-31 23:59:59'; $dateEnd = $month.'-31 23:59:59';
$list = array(); $list = array();
try { try {
$commandeM = new Application_Model_Sdv1GreffeCommandesKb(); $commandeM = new Application_Model_Sdv1GreffeCommandesKb();
$sql = $commandeM->select()->where('login=?', $this->User->login); $sql = $commandeM->select()->where('login=?', $this->User->login)->order('dateInsert DESC');
$result = $commandeM->fetchAll($sql); $result = $commandeM->fetchAll($sql);
if (count($result) > 0) { if (count($result) > 0) {
foreach($result as $item) { foreach($result as $item) {
$cmd = new PieceKbis(); $cmd = new PieceKbis();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->CompanyName = $item->raisonSociale; $cmd->CompanyName = $item->raisonSociale;
@ -204,10 +204,10 @@ class Order extends Scores_Ws_Server
throw new SoapFault('ERR', "Application error"); throw new SoapFault('ERR', "Application error");
} }
} }
return $list; return $list;
} }
/** /**
* Detail de la commande d'un KBIS * Detail de la commande d'un KBIS
* @param unknown $ref * @param unknown $ref
@ -217,14 +217,14 @@ class Order extends Scores_Ws_Server
protected function getKbisDetail($ref) protected function getKbisDetail($ref)
{ {
$this->authenticate(); $this->authenticate();
try { try {
$commandeM = new Application_Model_Sdv1GreffeCommandesKb(); $commandeM = new Application_Model_Sdv1GreffeCommandesKb();
$sql = $commandeM->select()->where('login=?', $this->User->login)->where('refCommande=?', $ref); $sql = $commandeM->select()->where('login=?', $this->User->login)->where('refCommande=?', $ref);
$item = $commandeM->fetchRow($sql); $item = $commandeM->fetchRow($sql);
if ($item !== null) { if ($item !== null) {
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->CompanyName = $item->raisonSociale; $cmd->CompanyName = $item->raisonSociale;
@ -240,14 +240,14 @@ class Order extends Scores_Ws_Server
throw new SoapFault('ERR', "Application error"); throw new SoapFault('ERR', "Application error");
} }
} }
return null; return null;
} }
protected function getKbisFile($ref) protected function getKbisFile($ref)
{ {
$this->authenticate(); $this->authenticate();
// --- Paramètres // --- Paramètres
$hostname = 'http://'.$_SERVER['SERVER_NAME']; $hostname = 'http://'.$_SERVER['SERVER_NAME'];
if ($_SERVER['SERVER_PORT']!='80'){ if ($_SERVER['SERVER_PORT']!='80'){
@ -256,18 +256,18 @@ class Order extends Scores_Ws_Server
$c = Zend_Registry::get('config'); $c = Zend_Registry::get('config');
$path = realpath($c->profil->path->secure).'/kbis'; $path = realpath($c->profil->path->secure).'/kbis';
$file = null; $file = null;
// --- Lecture des informations de la commande // --- Lecture des informations de la commande
try { try {
$commandeM = new Application_Model_Sdv1GreffeCommandesKb(); $commandeM = new Application_Model_Sdv1GreffeCommandesKb();
$sql = $commandeM->select()->where('login=?', $this->User->login)->where('refCommande=?', $ref); $sql = $commandeM->select()->where('login=?', $this->User->login)->where('refCommande=?', $ref);
$item = $commandeM->fetchRow($sql); $item = $commandeM->fetchRow($sql);
if ($item !== null) { if ($item !== null) {
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->CompanyName = $item->raisonSociale; $cmd->CompanyName = $item->raisonSociale;
@ -283,13 +283,19 @@ class Order extends Scores_Ws_Server
throw new SoapFault('ERR', "Application error"); throw new SoapFault('ERR', "Application error");
} }
} }
} }
protected function getActeList($month = null) /**
* Liste des commandes d'acte infogreffe
* @param string $month
* @throws SoapFault
* @return Acte[]
*/
public function getActeList($month = null)
{ {
$this->authenticate(); $this->authenticate();
@ -298,27 +304,25 @@ class Order extends Scores_Ws_Server
} }
$dateStart = $month.'-01 00:00:00'; $dateStart = $month.'-01 00:00:00';
$dateEnd = $month.'-31 23:59:59'; $dateEnd = $month.'-31 23:59:59';
$list = array(); $list = array();
try { try {
$commandeM = new Application_Model_Sdv1GreffeCommandesAc(); $commandeM = new Application_Model_Sdv1GreffeCommandesAc();
$sql = $commandeM->select()->where('login=?', $this->User->login); $sql = $commandeM->select()->where('login=?', $this->User->login)->order('dateInsert DESC');
$result = $commandeM->fetchAll($sql); $result = $commandeM->fetchAll($sql);
if (count($result) > 0) { if (count($result) > 0) {
foreach($result as $item) { foreach($result as $item) {
$cmd = new BilanInput(); $cmd = new Acte();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->DocLabel = ''; //@todo : Génére le libellé du document
//@todo : Génére le libellé du document $cmd->DocDepotNum = $item->depotNum;
$cmd->DocDepotNum; $cmd->DocDepotDate = $item->depotDate;
$cmd->DocDepotDate; $cmd->DocActeNum = $item->acteNum;
$cmd->DocActeNum; $cmd->DocActeType = $item->acteType;
$cmd->DocActeType; $cmd->DocActeDate = $item->acteDate;
$cmd->DocActeDate;
$cmd->CompanyName = $item->raisonSociale; $cmd->CompanyName = $item->raisonSociale;
$cmd->CompanySiren = $item->siren; $cmd->CompanySiren = $item->siren;
$cmd->DateInsert = $item->dateInsert; $cmd->DateInsert = $item->dateInsert;
@ -333,20 +337,20 @@ class Order extends Scores_Ws_Server
throw new SoapFault('ERR', "Application error"); throw new SoapFault('ERR', "Application error");
} }
} }
return $list; return $list;
} }
protected function getActeDetail($ref){} protected function getActeDetail($ref){}
protected function getActeFile($ref){} protected function getActeFile($ref){}
/** /**
* Liste des commandes de bilan infogreffe * Liste des commandes de bilan infogreffe
* @param string $month * @param string $month
* @throws SoapFault * @throws SoapFault
* @return multitype:BilanInput * @return Bilan[]
*/ */
protected function getBilanList($month = null) public function getBilanList($month = null)
{ {
$this->authenticate(); $this->authenticate();
@ -355,17 +359,17 @@ class Order extends Scores_Ws_Server
} }
$dateStart = $month.'-01 00:00:00'; $dateStart = $month.'-01 00:00:00';
$dateEnd = $month.'-31 23:59:59'; $dateEnd = $month.'-31 23:59:59';
$list = array(); $list = array();
try { try {
$commandeM = new Application_Model_Sdv1GreffeCommandesBi(); $commandeM = new Application_Model_Sdv1GreffeCommandesBi();
$sql = $commandeM->select()->where('login=?', $this->User->login); $sql = $commandeM->select()->where('login=?', $this->User->login)->order('dateInsert DESC');
$result = $commandeM->fetchAll($sql); $result = $commandeM->fetchAll($sql);
if (count($result) > 0) { if (count($result) > 0) {
foreach($result as $item) { foreach($result as $item) {
$cmd = new BilanInput(); $cmd = new Bilan();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->DocBilanCloture = $item->bilanCloture; $cmd->DocBilanCloture = $item->bilanCloture;
@ -384,10 +388,10 @@ class Order extends Scores_Ws_Server
throw new SoapFault('ERR', "Application error"); throw new SoapFault('ERR', "Application error");
} }
} }
return $list; return $list;
} }
/** /**
* Détail de la commande de bilan Infogreffe * Détail de la commande de bilan Infogreffe
* @param unknown $ref * @param unknown $ref
@ -397,14 +401,14 @@ class Order extends Scores_Ws_Server
protected function getBilanDetail($ref) protected function getBilanDetail($ref)
{ {
$this->authenticate(); $this->authenticate();
try { try {
$commandeM = new Application_Model_Sdv1GreffeCommandesKb(); $commandeM = new Application_Model_Sdv1GreffeCommandesKb();
$sql = $commandeM->select()->where('login=?', $this->User->login)->where('refCommande=?', $ref); $sql = $commandeM->select()->where('login=?', $this->User->login)->where('refCommande=?', $ref);
$item = $commandeM->fetchRow($sql); $item = $commandeM->fetchRow($sql);
if ($item !== null) { if ($item !== null) {
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->DocBilanCloture = $item->bilanCloture; $cmd->DocBilanCloture = $item->bilanCloture;
@ -422,19 +426,19 @@ class Order extends Scores_Ws_Server
throw new SoapFault('ERR', "Application error"); throw new SoapFault('ERR', "Application error");
} }
} }
return null; return null;
} }
protected function getBilanFile($ref){} protected function getBilanFile($ref){}
protected function setInvestigation() protected function setInvestigation()
{ {
$this->authenticate(); $this->authenticate();
$this->permission('enquetec'); $this->permission('enquetec');
//Table pour le stockage des demandes d'investigation //Table pour le stockage des demandes d'investigation
} }
} }

View File

@ -96,12 +96,12 @@ class Order extends Scores_Ws_Server
try { try {
$commandeM = new Application_Model_Sdv1OrderBilanInput(); $commandeM = new Application_Model_Sdv1OrderBilanInput();
$sql = $commandeM->select()->where('userId=?', $this->User->id); $sql = $commandeM->select()->where('userId=?', $this->User->id)->order('dateInsert DESC');
$result = $commandeM->fetchAll($sql); $result = $commandeM->fetchAll($sql);
if (count($result) > 0) { if (count($result) > 0) {
foreach($result as $item) { foreach($result as $item) {
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Siren = $item->siren; $cmd->Siren = $item->siren;
$cmd->BilanFileRecv = $item->bilanFileRecv; $cmd->BilanFileRecv = $item->bilanFileRecv;
$cmd->BilanCloture = $item->bilanCloture; $cmd->BilanCloture = $item->bilanCloture;
@ -140,7 +140,7 @@ class Order extends Scores_Ws_Server
$item = $commandeM->fetchRow($sql); $item = $commandeM->fetchRow($sql);
if ($item !== null) { if ($item !== null) {
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Siren = $item->siren; $cmd->Siren = $item->siren;
$cmd->BilanFileRecv = $item->bilanFileRecv; $cmd->BilanFileRecv = $item->bilanFileRecv;
$cmd->BilanCloture = $item->bilanCloture; $cmd->BilanCloture = $item->bilanCloture;
@ -182,12 +182,12 @@ class Order extends Scores_Ws_Server
try { try {
$commandeM = new Application_Model_Sdv1GreffeCommandesKb(); $commandeM = new Application_Model_Sdv1GreffeCommandesKb();
$sql = $commandeM->select()->where('login=?', $this->User->login); $sql = $commandeM->select()->where('login=?', $this->User->login)->order('dateInsert DESC');
$result = $commandeM->fetchAll($sql); $result = $commandeM->fetchAll($sql);
if (count($result) > 0) { if (count($result) > 0) {
foreach($result as $item) { foreach($result as $item) {
$cmd = new PieceKbis(); $cmd = new PieceKbis();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->CompanyName = $item->raisonSociale; $cmd->CompanyName = $item->raisonSociale;
@ -224,7 +224,7 @@ class Order extends Scores_Ws_Server
$item = $commandeM->fetchRow($sql); $item = $commandeM->fetchRow($sql);
if ($item !== null) { if ($item !== null) {
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->CompanyName = $item->raisonSociale; $cmd->CompanyName = $item->raisonSociale;
@ -267,7 +267,7 @@ class Order extends Scores_Ws_Server
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->CompanyName = $item->raisonSociale; $cmd->CompanyName = $item->raisonSociale;
@ -289,7 +289,13 @@ class Order extends Scores_Ws_Server
} }
protected function getActeList($month = null) /**
* Liste des commandes d'acte infogreffe
* @param string $month
* @throws SoapFault
* @return Acte[]
*/
public function getActeList($month = null)
{ {
$this->authenticate(); $this->authenticate();
@ -303,22 +309,20 @@ class Order extends Scores_Ws_Server
try { try {
$commandeM = new Application_Model_Sdv1GreffeCommandesAc(); $commandeM = new Application_Model_Sdv1GreffeCommandesAc();
$sql = $commandeM->select()->where('login=?', $this->User->login); $sql = $commandeM->select()->where('login=?', $this->User->login)->order('dateInsert DESC');
$result = $commandeM->fetchAll($sql); $result = $commandeM->fetchAll($sql);
if (count($result) > 0) { if (count($result) > 0) {
foreach($result as $item) { foreach($result as $item) {
$cmd = new BilanInput(); $cmd = new Acte();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->DocLabel = ''; //@todo : Génére le libellé du document
//@todo : Génére le libellé du document $cmd->DocDepotNum = $item->depotNum;
$cmd->DocDepotNum; $cmd->DocDepotDate = $item->depotDate;
$cmd->DocDepotDate; $cmd->DocActeNum = $item->acteNum;
$cmd->DocActeNum; $cmd->DocActeType = $item->acteType;
$cmd->DocActeType; $cmd->DocActeDate = $item->acteDate;
$cmd->DocActeDate;
$cmd->CompanyName = $item->raisonSociale; $cmd->CompanyName = $item->raisonSociale;
$cmd->CompanySiren = $item->siren; $cmd->CompanySiren = $item->siren;
$cmd->DateInsert = $item->dateInsert; $cmd->DateInsert = $item->dateInsert;
@ -344,9 +348,9 @@ class Order extends Scores_Ws_Server
* Liste des commandes de bilan infogreffe * Liste des commandes de bilan infogreffe
* @param string $month * @param string $month
* @throws SoapFault * @throws SoapFault
* @return multitype:BilanInput * @return Bilan[]
*/ */
protected function getBilanList($month = null) public function getBilanList($month = null)
{ {
$this->authenticate(); $this->authenticate();
@ -360,12 +364,12 @@ class Order extends Scores_Ws_Server
try { try {
$commandeM = new Application_Model_Sdv1GreffeCommandesBi(); $commandeM = new Application_Model_Sdv1GreffeCommandesBi();
$sql = $commandeM->select()->where('login=?', $this->User->login); $sql = $commandeM->select()->where('login=?', $this->User->login)->order('dateInsert DESC');
$result = $commandeM->fetchAll($sql); $result = $commandeM->fetchAll($sql);
if (count($result) > 0) { if (count($result) > 0) {
foreach($result as $item) { foreach($result as $item) {
$cmd = new BilanInput(); $cmd = new Bilan();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->DocBilanCloture = $item->bilanCloture; $cmd->DocBilanCloture = $item->bilanCloture;
@ -404,7 +408,7 @@ class Order extends Scores_Ws_Server
$item = $commandeM->fetchRow($sql); $item = $commandeM->fetchRow($sql);
if ($item !== null) { if ($item !== null) {
$cmd = new BilanInput(); $cmd = new BilanInput();
$cmd->Reference = $item->refCommande; $cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode; $cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError; $cmd->Error = $item->cmdError;
$cmd->DocBilanCloture = $item->bilanCloture; $cmd->DocBilanCloture = $item->bilanCloture;

View File

@ -5,42 +5,42 @@ class BilanInput
* @var string * @var string
*/ */
public $Reference; public $Reference;
/** /**
* @var string * @var string
*/ */
public $Siren; public $Siren;
/** /**
* @var string * @var string
*/ */
public $BilanFileRecv; public $BilanFileRecv;
/** /**
* @var string * @var string
*/ */
public $BilanCloture; public $BilanCloture;
/** /**
* @var string * @var string
*/ */
public $BilanType; public $BilanType;
/** /**
* @var string * @var string
*/ */
public $ErreurDate; public $ErreurDate;
/** /**
* @var string * @var string
*/ */
public $ErreurLabel; public $ErreurLabel;
/** /**
* @var string * @var string
*/ */
public $DateInsert; public $DateInsert;
/** /**
* @var string * @var string
*/ */
@ -49,37 +49,37 @@ class BilanInput
class PieceKbis class PieceKbis
{ {
/** /**
* @var string * @var string
*/ */
public $Reference; public $Reference;
/** /**
* @var string * @var string
*/ */
public $Mode; public $Mode;
/** /**
* @var string * @var string
*/ */
public $Error; public $Error;
/** /**
* @var string * @var string
*/ */
public $CompanyName; public $CompanyName;
/** /**
* @var string * @var string
*/ */
public $CompanySiren; public $CompanySiren;
/** /**
* @var string * @var string
*/ */
public $DateInsert; public $DateInsert;
/** /**
* @var string * @var string
*/ */
@ -92,42 +92,42 @@ class PieceBilan
* @var string * @var string
*/ */
public $Reference; public $Reference;
/** /**
* @var string * @var string
*/ */
public $Mode; public $Mode;
/** /**
* @var string * @var string
*/ */
public $Error; public $Error;
/** /**
* @var string * @var string
*/ */
public $DocBilanCloture; public $DocBilanCloture;
/** /**
* @var string * @var string
*/ */
public $DocBilanType; public $DocBilanType;
/** /**
* @var string * @var string
*/ */
public $CompanyName; public $CompanyName;
/** /**
* @var string * @var string
*/ */
public $CompanySiren; public $CompanySiren;
/** /**
* @var string * @var string
*/ */
public $DateInsert; public $DateInsert;
/** /**
* @var string * @var string
*/ */
@ -140,62 +140,172 @@ class PieceActe
* @var string * @var string
*/ */
public $Reference; public $Reference;
/** /**
* @var string * @var string
*/ */
public $Mode; public $Mode;
/** /**
* @var string * @var string
*/ */
public $Error; public $Error;
/** /**
* @var string * @var string
*/ */
public $DocDepotNum; public $DocDepotNum;
/** /**
* @var string * @var string
*/ */
public $DocDepotDate; public $DocDepotDate;
/** /**
* @var string * @var string
*/ */
public $DocActeNum; public $DocActeNum;
/** /**
* @var string * @var string
*/ */
public $DocActeType; public $DocActeType;
/** /**
* @var string * @var string
*/ */
public $DocActeDate; public $DocActeDate;
/** /**
* @var string * @var string
*/ */
public $CompanyName; public $CompanyName;
/** /**
* @var string * @var string
*/ */
public $CompanySiren; public $CompanySiren;
/** /**
* @var string * @var string
*/ */
public $DateInsert; public $DateInsert;
/** /**
* @var string * @var string
*/ */
public $DateEnvoi; public $DateEnvoi;
} }
class Bilan
{
/**
* @var string
*/
public $Reference;
/**
* @var string
*/
public $Mode;
/**
* @var string
*/
public $Error;
/**
* @var string
*/
public $DocBilanCloture;
/**
* @var string
*/
public $DocBilanType;
/**
* @var string
*/
public $CompanyName;
/**
* @var string
*/
public $CompanySiren;
/**
* @var string
*/
public $DateInsert;
/**
* @var string
*/
public $DateEnvoi;
}
class Acte
{
/**
* @var string
*/
public $Reference;
/**
* @var string
*/
public $Mode;
/**
* @var string
*/
public $Error;
/**
* @var string
*/
public $DocDepotNum;
/**
* @var string
*/
public $DocDepotDate;
/**
* @var string
*/
public $DocActeNum;
/**
* @var string
*/
public $DocActeType;
/**
* @var string
*/
public $DocActeDate;
/**
* @var string
*/
public $CompanyName;
/**
* @var string
*/
public $CompanySiren;
/**
* @var string
*/
public $DateInsert;
/**
* @var string
*/
public $DateEnvoi;
}

View File

@ -107,6 +107,8 @@ if ($opts->install)
// Generate cache file // Generate cache file
// genCache.php // genCache.php
passthru('php '.realpath(dirname(__FILE__)).'/genCache.php --generate Evenements');
// genCodeRatios.php // genCodeRatios.php
if ( substr(strtoupper(PHP_OS),0,3) != 'WIN' ) { if ( substr(strtoupper(PHP_OS),0,3) != 'WIN' ) {