diff --git a/library/WsScore/Entreprise/v0.8/Entreprise.php b/library/WsScore/Entreprise/v0.8/Entreprise.php index 5c6a7213..671eea86 100644 --- a/library/WsScore/Entreprise/v0.8/Entreprise.php +++ b/library/WsScore/Entreprise/v0.8/Entreprise.php @@ -1645,35 +1645,36 @@ class Entreprise extends WsScore if (is_array($anns)) { - foreach ($anns as $nb => $ann) - { + foreach ($anns as $nb => $ann) { if ($isList===true && $nb<$position) { continue; } $cpt++; if ($isList===true && $cpt>$nbRep) { break; } //@todo : Entites $entites = array(); - $detailM = new Application_Model_JoBodaccDetail(); - $sql = $detailM->select()->from($detailM, array( - 'LPAD(siren, 9, 000000000) AS siren', - 'LPAD(nic, 5, 00000) AS nic', - 'raisonSociale','adresse', 'codePostal', 'ville', 'typeEven') - )->where('id=?', $ann['id']); - $result = $detailM->fetchAll($sql); - if (count($result)>1) { - foreach ($result as $entity) { - $entite = new AnnonceEntite(); - $entite->siret = $entity->siren.$entity->nic; - $entite->raisonSociale = $entity->raisonSociale; + if (in_array($ann['BodaccCode'], array('BODA', 'BODB', 'BODC'))) { + $detailM = new Application_Model_JoBodaccDetail(); + $sql = $detailM->select()->from($detailM, array( + 'LPAD(siren, 9, 000000000) AS siren', + 'LPAD(nic, 5, 00000) AS nic', + 'raisonSociale','adresse', 'codePostal', 'ville', 'typeEven') + )->where('id=?', $ann['id']); + $result = $detailM->fetchAll($sql); + if (count($result)>1) { + foreach ($result as $entity) { + $entite = new AnnonceEntite(); + $entite->siret = $entity->siren.$entity->nic; + $entite->raisonSociale = $entity->raisonSociale; - $iBodacc = new MBodacc(); - $even = new AnnonceEvenement(); - $even->CodeEven = $entity->typeEven; - $even->LibEven = $iBodacc->getEvenement($entity->typeEven); + $iBodacc = new MBodacc(); + $even = new AnnonceEvenement(); + $even->CodeEven = $entity->typeEven; + $even->LibEven = $iBodacc->getEvenement($entity->typeEven); - $entite->event = $even; - $entites[] = $entite; - } + $entite->event = $even; + $entites[] = $entite; + } + } } //List events