Ajout des NACEs

This commit is contained in:
Michael RICOIS 2013-09-11 13:40:45 +00:00
parent 62c0f08418
commit 6e7393aa22
2 changed files with 92 additions and 4 deletions

View File

@ -82,8 +82,14 @@ $tabDico = array(
),
'capital' => '',
'capitalDev' => '',
'ape_etab' => '',
'ape_entrep' => '',
'ape_etab' => array(
'sql' => '',
'table' => 'SELECT codNaf5 AS code, libNaf5 AS label FROM jo.tabNaf5',
),
'ape_entrep' => array(
'sql' => '',
'table' => 'SELECT codNaf5 AS code, libNaf5 AS label FROM jo.tabNaf5',
),
'SiretEnBase' => 'nic>0 as SiretEnBase',
),
'where' => ' WHERE siren=$siren AND nic=$nicV',
@ -247,6 +253,8 @@ $tabDico = array(
'SiretSuc',
'privilege',
'GPS',
'NaceEtab',
'NaceEnt',
),
'multiple' => array(
'actionnaires',
@ -954,6 +962,11 @@ function bilanNData($siren, $nic, $values = false)
$annee = 0;
$tabData = array();
$mBil = new MBilans($siren);
/*
* @todo : Pouvoir appeler la liste des bilans en fonction du TYPE, sans les chiffres
* jo.bilans => Liste mais postes dans chaine de caractère
* jo.bilans_postes => Liste + postes directement
*/
$tabBilans = $mBil->listeBilans(false, 9);
if (count($tabBilans)>0) {
$tabBi = findBilan($siren, $tabBilans, $annee);
@ -1541,6 +1554,55 @@ function GPSData($siren, $nic, $values = false)
return $tabData;
}
function NaceEtabEntete($values)
{
return array(
'NaceEtab',
'NaceEtabLib',
);
}
function NaceEtabData($siren, $nic, $values)
{
$tabData = array(
'NaceEtab' => '',
'NaceEtabLib' => '',
);
$iDb = new WDB('jo');
$result = $iDb->select('jo.etablissements e, jo.tabNaf5 n, insee.tabNace i',
"CONCAT(n.codNaf1, SUBSTRING(n.codNaf5,1,4)) AS codNace, i.libelleFR",
"siren=$siren AND nic=$nic AND n.codNaf5=e.ape_etab AND i.codNace=SUBSTRING(n.codNaf5,1,4)", false, MYSQL_ASSOC);
if (count($result)>0) {
$tabData['NaceEtab'] = $result[0]['codNace'];
$tabData['NaceEtabLib'] = $result[0]['libelleFR'];
}
return $tabData;
}
function NaceEntEntete()
{
return array(
'NaceEn',
'NaceEnLib',
);
}
function NaceEntData()
{
$tabData = array(
'NaceEn' => '',
'NaceEnLib' => '',
);
$iDb = new WDB('jo');
$result = $iDb->select('jo.etablissements e, jo.tabNaf5 n, insee.tabNace i',
"CONCAT(n.codNaf1, SUBSTRING(n.codNaf5,1,4)) AS codNace, i.libelleFR",
"siren=$siren AND nic=$nic AND n.codNaf5=e.ape_entrep AND i.codNace=SUBSTRING(n.codNaf5,1,4)", false, MYSQL_ASSOC);
if (count($result)>0) {
$tabData['NaceEn'] = $result[0]['codNace'];
$tabData['NaceEnLib'] = $result[0]['libelleFR'];
}
return $tabData;
}
function actionnairesEntete()
{
return array(
@ -1695,6 +1757,7 @@ function participationsMultiple($siren, $nic)
return $tabData;
}
/* == FUNCTION == */
/**

View File

@ -108,11 +108,36 @@ class Enrichissement
'lib' => "Devise du capital"
),
'ape_etab' => array(
'lib' => "NAF de l'établissement"
'lib' => "SD : NAF Etablissement",
'help' => "Code NAF 5 positions",
'columns' => array(
'ape_etab' => "SD : NAF Etablissement",
),
),
'ape_entrep' => array(
'lib' => "NAF de l'entreprise"
'lib' => "SD : NAF Entreprise",
'help' => "Code NAF 5 positions",
'columns' => array(
'ape_entrep' => "SD : NAF Entreprise",
),
),
'NaceEtab' => array(
'lib' => "SD : NACE Etablissement",
'help' => "",
'columns' => array(
'NaceEtab' => "SD : NACE Etablissement",
'NaceEtabLib' => "SD : NACE Etablissement",
),
),
'NaceEn' => array(
'lib' => "SD : NACE Entreprise",
'help' => "",
'columns' => array(
'NaceEn' => "SD : NACE Entreprise",
'NaceEnLib' => "SD : NACE Entreprise",
),
),
'SiretEnBase' => array(
'lib' => "Vérifier la présence en base du siren/siret"
),