Correction pour l'enrichissement

This commit is contained in:
Michael RICOIS 2014-12-09 18:16:57 +00:00
parent f703eed68c
commit cfff5a3d74
2 changed files with 13 additions and 10 deletions

View File

@ -77,8 +77,8 @@ class Enrichissement
'label' => 'Forme juridique',
'column' => 'libelle',
'table' => 'jo.tabFJur',
'cond' => 'jo.etablissements_act.cj = cj_libelle.code'
)
'cond' => 'jo.etablissements_act.cj = cjL.code'
)
),
'dirigeant' => array(
'label' => "Dirigeant",
@ -92,7 +92,8 @@ class Enrichissement
'label' => 'Dirigeant - Libelle Fonction',
'column' => 'libelle',
'table' => 'jo.bodacc_fonctions',
'cond' => 'jo.etablissements_act.dirFct = dirFct_libelle.codeFct')
'cond' => 'jo.etablissements_act.dirFct = dirigeantFctL.codeFct'
)
),
'dirigeantnaiss' => array(
'label' => "Dirigeant - Date de naissance",
@ -105,7 +106,8 @@ class Enrichissement
'label' => 'NAF Etablissement - Libelle',
'column' => 'libNaf5',
'table' => 'jo.tabNaf5',
'cond' => 'jo.etablissements_act.ape_etab = ape_etab_libNaf5.codNaf5')
'cond' => 'jo.etablissements_act.ape_etab = nafetablissementL.codNaf5'
)
),
'nafentreprise' => array(
'label' => "Code NAF Entreprise",
@ -114,7 +116,8 @@ class Enrichissement
'label' => 'NAF Entreprise - Libelle',
'column' => 'libNaf5',
'table' => 'jo.tabNaf5',
'cond' => 'jo.etablissements_act.ape_entrep = ape_entrep_libNaf5.codNaf5')
'cond' => 'jo.etablissements_act.ape_entrep = nafentrepriseL.codNaf5'
)
),
'effetablissement' => array(
'label' => "Effectif Etablissement",

View File

@ -140,10 +140,9 @@ foreach ( $dataProfil as $item ) {
}
//Ajouter le champ presentRcs
$columns = 'presentRcs';
$columns[] = 'presentRcs';
$tabEntete[] = 'presentRcs';
$tabEnteteLabel[] = 'RCS';
$sqlFrom .= ' presentRcs';
//Pour chaque identifiant traiter les données
$row = 0;
@ -167,7 +166,7 @@ $dateStart = date('YmdHms');
foreach ($identifiants as $siret )
{
$sql = $db->select()->from('jo.etablissements_act', $columns);
$sql = $db->select()->from('etablissements_act', $columns, 'jo');
$sql->where("siren='".substr($siret,0,9)."' AND nic='".substr($siret,9,5)."'");
if (count($joins)) {
foreach ( $joins as $join ) {
@ -176,12 +175,13 @@ foreach ($identifiants as $siret )
}
try {
$result = $db->fetchRow($sql);
$result = $db->fetchRow($sql, null, Zend_Db::FETCH_ASSOC);
$traite++;
} catch(Exception $e) {
echo $sql;
}
$tabData = $result->toArray();
$tabData = $result;
//Trier pour la sortie
$tabSortie = array();
foreach($tabEntete as $key) {