- Add a new column SIRET 
- "Type d'établissement" : Replace 1 by "Siège" and 0 by "Secondaire" is done
- Add a new columns "Dirigeant - Code Fonction" and "Dirigeants - Libelle Fonction"
- Add a new columns "Libelle NAF Etablissement" and "Libelle NAF Entreprise"
This commit is contained in:
Michael RICOIS 2013-11-19 14:02:05 +00:00
parent 82b21d631d
commit 7e439446d4
3 changed files with 29 additions and 4 deletions

View File

@ -270,10 +270,13 @@ class ComptageController extends Zend_Controller_Action
$extractLabel[] = $item['label'];
}
}
$db = Zend_Db_Table::getDefaultAdapter();
$sql = $db->select()->from('jo.etablissements_act', $extractSql);
$sql = $db->select()
->from(array('jo_act' => 'jo.etablissements_act'), $extractSql)
->joinLeft(array('jo_fonctions' => 'jo.bodacc_fonctions'), 'jo_fonctions.codeFct=jo_act.dirFct','libelle')
->joinLeft(array('jo_etab_tabNaf5' => 'jo.tabNaf5'), 'jo_etab_tabNaf5.codNaf5=jo_act.ape_etab','libNaf5')
->joinLeft(array('jo_entrep_tabNaf5' => 'jo.tabNaf5'), 'jo_entrep_tabNaf5.codNaf5=jo_act.ape_entrep','libNaf5En');
$i = 0;
$where = '';
foreach($sirets as $siret) {
@ -283,9 +286,11 @@ class ComptageController extends Zend_Controller_Action
$where.= "(siren='".substr($siret,0,9)."' AND nic='".substr($siret,9,5)."')";
$i++;
}
$sql->where($where);
$result = $db->fetchAll($sql);
$liste = array();
foreach ($result as $l => $line) {
$tmp = array();

View File

@ -23,4 +23,5 @@ $this->translate('Présence de participations');
$this->translate('Valider');
$this->translate('Réinitialiser les critères entreprises');
$this->translate('à');
$this->translate('Scores & Décisions SAS');
?>

View File

@ -151,6 +151,10 @@ class Enrichissement
* @var array
*/
protected $fields = array(
'siret' => array(
'label' => "SIRET",
'sql' => 'CONCAT(siren, nic) as siret',
),
'siege' => array(
'label' => "Type d'établissement",
'column' => 'siege'
@ -221,9 +225,14 @@ class Enrichissement
'sql' => "CONCAT_WS(' ', dirCiv, dirNom, dirPrenom) AS dirigeant",
),
'dirigeantFct' => array(
'label' => "Dirigeant - Fonction",
'label' => "Dirigeant - Code Fonction",
'column' => 'dirFct',
),
'dirigeantLibFct' => array(
'label' => "Dirigeant - Libelle Fonction",
'column' => 'libelle',
'sql' => "jo_fonctions.libelle",
),
'dirigeantnaiss' => array(
'label' => "Dirigeant - Date de naissance",
'column' => 'dirDateNaiss'
@ -232,10 +241,20 @@ class Enrichissement
'label' => "Code NAF Etablissement",
'column' => 'ape_etab'
),
'libNaf5_etab' => array(
'label' => "Libelle NAF Etablissement",
'column' => 'ape_etab',
'sql' => "jo_etab_tabNaf5.libNaf5",
),
'nafentreprise' => array(
'label' => "Code NAF Entreprise",
'column' => 'ape_entrep'
),
'libNaf5_entrep' => array(
'label' => "Libelle NAF Entreprise",
'column' => 'ape_entrep',
'sql' => "jo_entrep_tabNaf5.libNaf5En",
),
'effetablissement' => array(
'label' => "Effectif Etablissement",
'column' => 'eff_etab'