Maj script test
This commit is contained in:
commit
e91835db68
@ -2415,6 +2415,7 @@ class MInsee
|
||||
$sql = $db->select()
|
||||
->from('rncs_modifs', array('valeur'), 'jo')
|
||||
->where('champs = ?', 'capitalMontant')
|
||||
->where('siren = ? ', $siren)
|
||||
->where('flux < ?', $date)
|
||||
->order('flux DESC')->limit(1);
|
||||
$result = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
|
||||
@ -2424,6 +2425,7 @@ class MInsee
|
||||
}
|
||||
|
||||
// --- Situation Juridique
|
||||
$identite['SituationJuridique'] = '';
|
||||
$tabProcol = $this->getAnnoncesLegales($siren, 0, 'P', false);
|
||||
if ( count($tabProcol) > 0 ) {
|
||||
$tabDates = array();
|
||||
@ -2448,9 +2450,9 @@ class MInsee
|
||||
$identite['SituationJuridique'] = 'P';
|
||||
}
|
||||
} elseif (count($this->getAnnoncesLegales($siren, 0, 'A', false)) > 0) {
|
||||
$tabRet['SituationJuridique'] = 'A';
|
||||
$identite['SituationJuridique'] = 'A';
|
||||
} elseif (count($this->getAnnoncesLegales($siren, 0, 'D', false)) > 0) {
|
||||
$tabRet['SituationJuridique'] = 'D';
|
||||
$identite['SituationJuridique'] = 'D';
|
||||
}
|
||||
// Fin Situation Juridique
|
||||
|
||||
@ -3973,17 +3975,15 @@ class MInsee
|
||||
* @param boolean $histo
|
||||
* @return array
|
||||
*/
|
||||
function getDirigeants($siren, $histo = true)
|
||||
public function getDirigeants($siren, $histo = true)
|
||||
{
|
||||
$siren=$siren*1;
|
||||
$siren = intval($siren);
|
||||
$tabRet = array();
|
||||
|
||||
$classWDate = new WDate();
|
||||
|
||||
if ($histo)
|
||||
{
|
||||
$bodacc=$this->iDb->select(
|
||||
'jo.bodacc_dirigeants d, jo.bodacc_detail b, jo.bodacc_fonctions f',
|
||||
if ($histo) {
|
||||
|
||||
$bodacc = $this->iDb->select('jo.bodacc_dirigeants d, jo.bodacc_detail b, jo.bodacc_fonctions f',
|
||||
'd.num, d.dateEffet, d.Rubrique, d.fonction, d.dirSiren, d.rs, d.nom, d.prenom, d.nomUsage, d.depart, d.dateInsert, f.libelle',
|
||||
"b.SIREN=$siren AND b.id=d.id AND b.typeEven NOT BETWEEN 5000 AND 5700 AND b.typeEven NOT BETWEEN 2700 AND 2900 AND d.fonction=f.codeFct GROUP BY d.fonction, d.rs, d.nom, d.prenom ORDER BY d.dateInsert DESC, d.dateEffet DESC, d.fonction DESC", true, MYSQL_ASSOC);
|
||||
if (count($bodacc)>0) {
|
||||
@ -4006,18 +4006,14 @@ class MInsee
|
||||
}
|
||||
}
|
||||
|
||||
$bodaccHisto=$this->iDb->select(
|
||||
'historiques.entrep e, historiques.texte x',
|
||||
$bodaccHisto = $this->iDb->select('historiques.entrep e, historiques.texte x',
|
||||
'e.ANBASE, e.NOBOD, e.CODTRI, e.JAL, e.DATE, e.CODEVE, e.SSCODE, e.DEPT, e.NOANN, e.ROLE, e.SIREN, e.E1GSIR, e.E1GNIC, x.annonceNum, x.annonceTxt',
|
||||
"e.E1GSIR=$siren AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20050101 AND x.annonceTxt LIKE '%Administration%' GROUP BY e.ANBASE ORDER BY e.DATE DESC", true, MYSQL_ASSOC);
|
||||
"e.E1GSIR=$siren AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19960101 AND 20050101 AND x.annonceTxt LIKE '%Administration%' GROUP BY e.ANBASE ORDER BY e.DATE DESC", true, MYSQL_ASSOC);
|
||||
if (count($bodaccHisto)>0) {
|
||||
foreach ($bodaccHisto as $ann) {
|
||||
|
||||
if ($ann['DATE']<19960101 && $ann['E1GSIR']<>$ann['SIREN']) continue;
|
||||
|
||||
if ( ($ann['CODEVE']<20) ||
|
||||
($ann['CODEVE']>=30 && $ann['CODEVE']<42) ||
|
||||
($ann['CODEVE']>=51 && $ann['CODEVE']<80) ) {
|
||||
($ann['CODEVE']>=30 && $ann['CODEVE']<42) || ($ann['CODEVE']>=51 && $ann['CODEVE']<80) ) {
|
||||
if (preg_match('/Administration(?:.|)\:(.*)(?:Adresse.*|Commentaires?|Activit(?:e|é)|Etablissement principal|Date d\'effet|Date.de.d.but d.activit.)(?:.|)\:/Uisu', $ann['annonceTxt'], $matches)) {
|
||||
$iDir=0;
|
||||
$tabAdministration = $this->iBodacc->getDirigeants($matches[1]);
|
||||
@ -4195,7 +4191,6 @@ class MInsee
|
||||
}
|
||||
|
||||
if (count($tabRet)==0) {
|
||||
|
||||
if ($tabIdentite['FJ']*1>1000 && $tabIdentite['FJ']*1<2000) {
|
||||
$tabTmp=explode(' ', $tabIdentite['Nom']);
|
||||
$nom=$prenom='';
|
||||
@ -4216,7 +4211,7 @@ class MInsee
|
||||
|
||||
$tabRet[] = array(
|
||||
'Titre' => 'Personne physique',
|
||||
'Societe' =>'',//utf8_encode($dir['Societe']),
|
||||
'Societe' => '',
|
||||
'Civilite' => $civilite,
|
||||
'Nom' => trim($nom),
|
||||
'Prenom' => trim($prenom),
|
||||
@ -5351,7 +5346,6 @@ class MInsee
|
||||
$sqlHistoWhere = "e.E1GSIR=$siren";
|
||||
$sqlHistoWhere.= $sqlHistoRubrique;
|
||||
$sqlHistoWhere.= " AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231";
|
||||
/*$sqlHistoWhere.= " AND e.E1GSIR=e.SIREN";*/
|
||||
$sqlHistoWhere.= " GROUP BY e.ANBASE ORDER BY e.DATE DESC";
|
||||
$sqlHisto = $this->getAnnoncesLegalesHisto()." WHERE ".$sqlHistoWhere;
|
||||
}
|
||||
|
@ -1215,8 +1215,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$timer['ratiosecteur']=microtime(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$timer['regression']=microtime(true);
|
||||
|
||||
/** Détection fine de l'état de fermeture éventuel à l'INSEE **/
|
||||
@ -2494,15 +2492,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
}
|
||||
}
|
||||
|
||||
/** Grand Groupe **/
|
||||
$tabTmp=$iDb->select('jo.surveillances_site', 'count(*) as nb',
|
||||
"login IN ('dgfipb', 'dgfipc', 'dgfipifu1', 'dgfipifu10', 'dgfipifu11', 'dgfipifu12', 'dgfipifu13', 'dgfipifu14', 'dgfipifu2', 'dgfipifu3', 'dgfipifu4', 'dgfipifu5', 'dgfipifu6', 'dgfipifu7', 'dgfipifu8', 'dgfipifu9') AND siren=$siren AND dateSuppr=0",
|
||||
INDISCORE_DEBUG, MYSQL_ASSOC);
|
||||
$timer['GrandGroupe'] = microtime(true);
|
||||
$tabTmp=$tabTmp[0];
|
||||
if ($tabTmp['nb']>0) $GRANDGROUPE=true;
|
||||
else $GRANDGROUPE=false;
|
||||
|
||||
/** Affichage des informations de paiement dans le score **/
|
||||
$COTEOK_MMAA=$IMPAYE_MMAA=$PRIVILEGES_MMAA=$RISQUEGROUPE_MMAA='';
|
||||
$DEFAUT_MMAA=$LCASSUR_MMAA=$RISQUEIMPAYE_MMAA=$CSFACTO_MMAA='';
|
||||
@ -3020,6 +3009,15 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
//Si NIVEAU avec generation des commentaires
|
||||
if ($genereComment)
|
||||
{
|
||||
// --- Grand Groupe
|
||||
$tabTmp=$iDb->select('jo.surveillances_site', 'count(*) as nb',
|
||||
"login IN ('dgfipb', 'dgfipc', 'dgfipifu1', 'dgfipifu10', 'dgfipifu11', 'dgfipifu12', 'dgfipifu13', 'dgfipifu14', 'dgfipifu2', 'dgfipifu3', 'dgfipifu4', 'dgfipifu5', 'dgfipifu6', 'dgfipifu7', 'dgfipifu8', 'dgfipifu9') AND siren=$siren AND dateSuppr=0",
|
||||
INDISCORE_DEBUG, MYSQL_ASSOC);
|
||||
$timer['GrandGroupe'] = microtime(true);
|
||||
$tabTmp=$tabTmp[0];
|
||||
if ($tabTmp['nb']>0) $GRANDGROUPE=true;
|
||||
else $GRANDGROUPE=false;
|
||||
|
||||
// NBNIC
|
||||
$tabTmp = $iDb->select('jo.etablissements', 'MAX(NIC) as NBNIC', "SIREN=$SIREN", INDISCORE_DEBUG, MYSQL_ASSOC);
|
||||
$NBNIC = $tabTmp[0]['NBNIC'];
|
||||
|
@ -27,6 +27,12 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
*/
|
||||
protected $companyAnnonces;
|
||||
|
||||
/**
|
||||
* Liste des bilans
|
||||
* @var array
|
||||
*/
|
||||
protected $companyBilans;
|
||||
|
||||
/**
|
||||
* Date de fin de recherche des événements AAAAMMJJ
|
||||
* Envoyer cette date à toutes les méthodes
|
||||
@ -75,6 +81,8 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
|
||||
public function injectIdentite(){}
|
||||
|
||||
public function injectBilans(){}
|
||||
|
||||
/**
|
||||
* Return the history of previous stored IndiScores on the companies
|
||||
* @param string $siren
|
||||
@ -1108,10 +1116,7 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
|
||||
$this->CABILAN=$this->R[6];
|
||||
|
||||
/**
|
||||
* Tableau des ratios secteurs
|
||||
* Requete BDD
|
||||
*/
|
||||
// Ratios Secteur en fonction des dernières années de bilans
|
||||
$this->MARCHE=$this->MARCHEp=$this->MARCHEVOL=$this->MARCHEPART=$this->MARCHEPARTp=$this->MARCHEPARTEVOL='';
|
||||
$this->MARCHESAL=$this->MARCHESALp=$this->MARCHENBENT=$this->MARCHENBENTp='';
|
||||
$tabRatiosSecteurs=$Rtot=array();
|
||||
@ -1637,7 +1642,7 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
}
|
||||
|
||||
// Annonces BODACC Poursuite de l'activité malgré la perte de plus de la moitié du capital social
|
||||
$tabDepotCpt = $iInsee->annoncesFilter($this->CompanyAnnonces, array(2314,2319));
|
||||
$tabDepotCpt = $iInsee->annoncesFilter($companyAnnonces, array(2314,2319));
|
||||
if (is_array($tabDepotCpt) && count($tabDepotCpt)>0){
|
||||
foreach ($tabDepotCpt as $iDep=>$depot) {
|
||||
$this->ANNONCEPOURSDATE= $this->ANNONCEDISSONONDATE= $depot['DateParution'];
|
||||
@ -2355,8 +2360,7 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
$this->DIR_NB=$this->NBDIRLIENS=$this->NBDIRSCI=$this->NBDIRSCIADR=0;
|
||||
//@sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "Indiscore sur $siren : Dirigeants", print_r($dirs, true));
|
||||
if (count($dirs) > 0 ) {
|
||||
foreach ($dirs as $nb => $dir)
|
||||
{
|
||||
foreach ($dirs as $nb => $dir) {
|
||||
if ($dir['Ancien']==0 && preg_match('/G.rant|Personne|Pr.sident|Directeur|Repr.sentant/Uisu', $dir['Titre'])) {
|
||||
$this->DIR_NB++;
|
||||
if ($this->DIR_NB==1) {
|
||||
@ -2371,7 +2375,7 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
$this->DIR2_TYPE='PP';
|
||||
}
|
||||
|
||||
$activeRechercheDir = true;
|
||||
$activeRechercheDir = false;
|
||||
if ($activeRechercheDir){
|
||||
$tabDir = $iInsee->rechercheDir($dir['Nom'], $dir['Prenom'], '', $dir['NaissDate'], '', 0, 200, 200);
|
||||
$tabDir = $tabDir['reponses'];
|
||||
@ -2460,13 +2464,12 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
}
|
||||
$timer['traitementDirigeants'] = microtime(true);
|
||||
|
||||
/** On vérifie s'il y a un cuteoff
|
||||
* @todo Attention, si modif après dateInsert/dateUpdate (procol, impayé, etc...) ne plus
|
||||
* prendre en compte le cuteoff
|
||||
*
|
||||
**/
|
||||
// --- Cut Off
|
||||
$this->ENQUETE='';
|
||||
$tabTmp=$iDb->select('jo.scores_cutoff', 'encours, scoreSolv, scoreDir, scoreConf, DATE(dateInsert)*1 AS dateInsert, DATE(dateUpdate)*1 AS dateUpdate', "siren=$siren", $this->debug, MYSQL_ASSOC);
|
||||
if ($this->companyEvenDateStop === null) {
|
||||
$tabTmp = $iDb->select('jo.scores_cutoff',
|
||||
'encours, scoreSolv, scoreDir, scoreConf, DATE(dateInsert)*1 AS dateInsert, DATE(dateUpdate)*1 AS dateUpdate',
|
||||
"siren=$siren", $this->debug, MYSQL_ASSOC);
|
||||
$timer['scores_cutoff'] = microtime(true);
|
||||
if (isset($tabTmp[0]['encours'])) {
|
||||
if($tabTmp[0]['dateUpdate']>$tabTmp[0]['dateInsert']) {
|
||||
@ -2489,15 +2492,7 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Grand Groupe **/
|
||||
$tabTmp=$iDb->select('jo.surveillances_site', 'count(*) as nb',
|
||||
"login IN ('dgfipb', 'dgfipc', 'dgfipifu1', 'dgfipifu10', 'dgfipifu11', 'dgfipifu12', 'dgfipifu13', 'dgfipifu14', 'dgfipifu2', 'dgfipifu3', 'dgfipifu4', 'dgfipifu5', 'dgfipifu6', 'dgfipifu7', 'dgfipifu8', 'dgfipifu9') AND siren=$siren AND dateSuppr=0",
|
||||
$this->debug, MYSQL_ASSOC);
|
||||
$timer['GrandGroupe'] = microtime(true);
|
||||
$tabTmp=$tabTmp[0];
|
||||
if ($tabTmp['nb']>0) $this->GRANDGROUPE=true;
|
||||
else $this->GRANDGROUPE=false;
|
||||
}
|
||||
|
||||
/** Affichage des informations de paiement dans le score **/
|
||||
$this->COTEOK_MMAA=$this->IMPAYE_MMAA=$this->PRIVILEGES_MMAA=$this->RISQUEGROUPE_MMAA='';
|
||||
@ -2692,9 +2687,6 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
else $noteSolvMax=56;
|
||||
}
|
||||
|
||||
//ICI//
|
||||
//$noteSolvabilite
|
||||
|
||||
if ($tabIdentite['SituationJuridique']=='PL') {
|
||||
$this->SCOREDIRI-=20;
|
||||
$this->SCORECONF+=10;
|
||||
@ -2707,51 +2699,43 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
if ($noteSolvabilite>$noteSolvMax) $noteSolvabilite=$noteSolvMax;
|
||||
$timer['privileges']=microtime(true);
|
||||
|
||||
/**/
|
||||
$MODIFDERDATE=$MODIFINSEEDATE;
|
||||
// Rcs
|
||||
if ($MODIFRNCSDATE>$MODIFDERDATE) $MODIFDERDATE=$MODIFRNCSDATE;
|
||||
// Annonces
|
||||
if ($ANNONCEDERDATE>$MODIFDERDATE) $MODIFDERDATE=$ANNONCEDERDATE;
|
||||
// Bilans
|
||||
/** @todo if ($MODIFBILDATE>$MODIFDERDATE) $MODIFDERDATE=$MODIFBILDATE;**/
|
||||
// Paiements
|
||||
if ($this->MODIFPAIDATE>$this->MODIFDERDATE) $this->MODIFDERDATE=$this->MODIFPAIDATE;
|
||||
|
||||
/** Commentaire Dirigeance **/
|
||||
if ($this->SCOREDIRI>=70)
|
||||
$analyseDir='L\'étude de la dirigeance ne relève aucun problème.';
|
||||
elseif ($this->SCOREDIRI>=40)
|
||||
$analyseDir='L\'étude de la dirigeance retient notre attention.';
|
||||
elseif ($this->SCOREDIRI>0)
|
||||
$analyseDir='L\'étude de la dirigeance attire toute notre attention.';
|
||||
else {
|
||||
$analyseDir='L\'étude de la dirigeance révèle des anomalies.';
|
||||
// --- Commentaire Dirigeance
|
||||
if ($this->SCOREDIRI>=70) {
|
||||
$analyseDir="L'étude de la dirigeance ne relève aucun problème.";
|
||||
} elseif ($this->SCOREDIRI>=40) {
|
||||
$analyseDir="L'étude de la dirigeance retient notre attention.";
|
||||
} elseif ($this->SCOREDIRI>0) {
|
||||
$analyseDir="L'étude de la dirigeance attire toute notre attention.";
|
||||
} else {
|
||||
$analyseDir="L'étude de la dirigeance révèle des anomalies.";
|
||||
$this->SCOREDIRI=0;
|
||||
}
|
||||
|
||||
/** Commentaire Conformité **/
|
||||
// --- Commentaire Conformité
|
||||
if ($tabIdentite['SituationJuridique']=='P') {
|
||||
$noteSolvabilite = $this->SCORECONF = $this->SCOREDIRI = 0;
|
||||
$analyseConf='L\'entreprise est en procédure collective';
|
||||
$analyseConf = "L'entreprise est en procédure collective";
|
||||
} elseif ($tabIdentite['SituationJuridique']=='D') {
|
||||
$noteSolvabilite = $this->SCORECONF = $this->SCOREDIRI = 0;
|
||||
$analyseConf='L\'entreprise est dissoute';
|
||||
$analyseConf = "L'entreprise est dissoute";
|
||||
} elseif ($tabIdentite['Actif']==0) {
|
||||
$noteSolvabilite = $this->SCORECONF = $this->SCOREDIRI = 0;
|
||||
$analyseConf='L\'entreprise n\'est pas en activité';
|
||||
} elseif ($this->SCORECONF>=70)
|
||||
$analyseConf='L\'analyse de la conformité est correcte.';
|
||||
elseif ($this->SCORECONF>=40)
|
||||
$analyseConf='L\'analyse de la conformité est acceptable.';
|
||||
elseif ($this->SCORECONF>0)
|
||||
$analyseConf='L\'analyse de la conformité est sensible.';
|
||||
else {
|
||||
$analyseConf='L\'analyse de la conformité est très sensible.';
|
||||
$analyseConf = "L'entreprise n'est pas en activité";
|
||||
} elseif ($this->SCORECONF>=70) {
|
||||
$analyseConf = "L'analyse de la conformité est correcte.";
|
||||
} elseif ($this->SCORECONF>=40) {
|
||||
$analyseConf = "L'analyse de la conformité est acceptable.";
|
||||
} elseif ($this->SCORECONF>0) {
|
||||
$analyseConf = "L'analyse de la conformité est sensible.";
|
||||
} else {
|
||||
$analyseConf = "L'analyse de la conformité est très sensible.";
|
||||
$this->SCORECONF = 0;
|
||||
}
|
||||
|
||||
/** Commentaire Solvabilité **/
|
||||
// --- Commentaire Solvabilité
|
||||
if ($noteFin>0) $noteSolv=($noteStructure+$noteFin)/2;
|
||||
else $noteSolv=($noteStructure+$noteFin)/5;
|
||||
if ($noteSolv>=15) $analyseSolv = 'Excellente';
|
||||
@ -2762,14 +2746,7 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
else $analyseSolv = 'Inquiétante';
|
||||
if ($noteSolvabilite>=40 && $analyseSolv=='Inquiétante') $analyseSolv = 'Correcte';
|
||||
|
||||
/** CA Moyen par salarié pour un secteur donné
|
||||
**/
|
||||
/*$tabTmp=$iDb->select('jo.ratios_secteurs', 'id, naf5, annee, SUM(montant), SUM(nombre), SUM(montant)/SUM(nombre) AS moyenne', "naf5='$naf' AND id=267 AND ANNEE>(SELECT MAX(annee) FROM ratios_secteurs WHERE naf5='$naf' AND id=267)-2 GROUP BY id, naf5", true, MYSQL_ASSOC);
|
||||
$caSecteur=round($tabTmp[0]['moyenne']*1000);
|
||||
// Encours moyen secteur * nb salariés
|
||||
if ($this->EFFECTIF>0) $this->CAESTIME=$caSecteur*$this->EFFECTIF;
|
||||
else $this->CAESTIME=$caSecteur;
|
||||
*/
|
||||
/** CA Moyen par salarié pour un secteur donné **/
|
||||
$this->CAESTIME = $iInsee->getCAnafEffectif($naf, $this->EFFECTIF);
|
||||
|
||||
if ($this->CABILAN>0) $this->CABIOUES=$this->CABILAN;
|
||||
@ -2958,8 +2935,7 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
}
|
||||
if ($tendance=='') $tendance='Stable';
|
||||
|
||||
/** Avis à 3 ans
|
||||
**/
|
||||
/** Avis à 3 ans **/
|
||||
if ($noteSolvabilite>=50) {
|
||||
if ($valeurCCF>2160) $this->AVIS3ANS=true;
|
||||
elseif($valeurCCF>0 && $valeurCCF<2160) $this->AVIS3ANS=false;
|
||||
@ -3007,9 +2983,18 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
|
||||
$timer['encours']=microtime(true);
|
||||
|
||||
//Si NIVEAU avec generation des commentaires
|
||||
// --- Si NIVEAU avec generation des commentaires
|
||||
if ($genereComment)
|
||||
{
|
||||
// --- Grand Groupe
|
||||
$tabTmp=$iDb->select('jo.surveillances_site', 'count(*) as nb',
|
||||
"login IN ('dgfipb', 'dgfipc', 'dgfipifu1', 'dgfipifu10', 'dgfipifu11', 'dgfipifu12', 'dgfipifu13', 'dgfipifu14', 'dgfipifu2', 'dgfipifu3', 'dgfipifu4', 'dgfipifu5', 'dgfipifu6', 'dgfipifu7', 'dgfipifu8', 'dgfipifu9') AND siren=$siren AND dateSuppr=0",
|
||||
$this->debug, MYSQL_ASSOC);
|
||||
$timer['GrandGroupe'] = microtime(true);
|
||||
$tabTmp=$tabTmp[0];
|
||||
if ($tabTmp['nb']>0) $this->GRANDGROUPE = true;
|
||||
else $this->GRANDGROUPE = false;
|
||||
|
||||
// NBNIC
|
||||
$tabTmp = $iDb->select('jo.etablissements', 'MAX(NIC) as NBNIC', "SIREN=$this->SIREN", $this->debug, MYSQL_ASSOC);
|
||||
$this->NBNIC = $tabTmp[0]['NBNIC'];
|
||||
@ -3965,5 +3950,28 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcul des éléments SCORE - EVALUATION
|
||||
* Paramètres en ENTREE
|
||||
* - Identite
|
||||
* - Annonces Legales
|
||||
* - Bilans
|
||||
*
|
||||
* Paramètres en SORTIE
|
||||
* - Définir une structure de données
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function calcul()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function comment(){}
|
||||
|
||||
|
||||
protected function save(){}
|
||||
|
||||
}
|
||||
?>
|
@ -1,111 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once 'Metier/partenaires/classMPrivileges.php';
|
||||
require_once 'Metier/partenaires/classMMarques.php';
|
||||
require_once 'Metier/partenaires/classMLiens2.php';
|
||||
require_once 'Metier/scores/classMRegression.php';
|
||||
require_once 'Metier/scores/classMSolvabilite.php';
|
||||
require_once 'Metier/scores/classMRatios.php';
|
||||
|
||||
/**
|
||||
* Injection SdMetier_Scoring_Vars
|
||||
*
|
||||
* $this->getVars(name)
|
||||
* $this->setVars(name)
|
||||
* $this->operation(name)
|
||||
*
|
||||
* Les variables doivents être déclarées public pour un accès direct $this->Vars->{var name}
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Injection SdMetier_Scoring_Formule_{version}
|
||||
* Auto-generated class avec
|
||||
* - appel à vars
|
||||
* - appel à operation
|
||||
*
|
||||
* function calc => effectue les opérations de calcul
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Injection SdMetier_Scoring_Comment_{version}
|
||||
* Doit récupérer le contexte de toutes les variables pour générer les commentaires
|
||||
* - Récupération des données d'initialisation
|
||||
* - Récupération du contexte de calcul
|
||||
* - Récupération de Vars
|
||||
* - Formattage
|
||||
*/
|
||||
|
||||
class SdMetier_Scoring_Calcul
|
||||
{
|
||||
|
||||
protected $Vars = null;
|
||||
protected $Formule = null;
|
||||
protected $Comment = null;
|
||||
|
||||
protected $version = '414';
|
||||
protected $niveau = '2';
|
||||
protected $debug = false;
|
||||
protected $db = null;
|
||||
|
||||
public function __construct($siren, $type = 'score', $sourceModif = 'jour')
|
||||
{
|
||||
// --- Commence par une initialisation des variables dans le dictionnaire
|
||||
$this->Vars = new SdMetier_Scoring_Vars();
|
||||
}
|
||||
|
||||
public function setDebug($debug = false)
|
||||
{
|
||||
$this->debug = $debug;
|
||||
}
|
||||
|
||||
public function setDb($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
public function getVars()
|
||||
{
|
||||
return $this->Vars;
|
||||
}
|
||||
|
||||
public function setFormule(SdMetier_Scoring_Formule_Interface $formule)
|
||||
{
|
||||
$this->Formule = $formule;
|
||||
}
|
||||
|
||||
public function setComment(SdMetier_Scoring_Comment_Interface $comment)
|
||||
{
|
||||
$this->Comment = $comment;
|
||||
}
|
||||
|
||||
|
||||
public function exec($comment = false)
|
||||
{
|
||||
// --- Execution des calculs du score
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// --- Commentaires activés
|
||||
if ( $comment === true ) {
|
||||
|
||||
// --- Chargement si nécessaires des commentaires
|
||||
if ( $this->Comment === null ) {
|
||||
|
||||
}
|
||||
|
||||
// --- Chargement si nécessaire des formules
|
||||
if ( $this->Formule === null ) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -8,13 +8,13 @@ $dateStopIn = '2015-10-01';
|
||||
'341762573',
|
||||
);*/
|
||||
|
||||
$options = getopt("f:");
|
||||
$file = basename($options['f'], '.csv');
|
||||
|
||||
$companies = array();
|
||||
$row = 1;
|
||||
if (($handle = fopen("liste-01.csv", "r")) !== false) {
|
||||
if (($handle = fopen(__DIR__.'/'.$file.'.csv', "r")) !== false) {
|
||||
while (($data = fgetcsv($handle, 0, ",")) !== false) {
|
||||
if ($row == 1) {
|
||||
continue;
|
||||
}
|
||||
$row++;
|
||||
$companies[] = $data[0];
|
||||
}
|
||||
@ -49,7 +49,7 @@ require_once 'Metier/partenaires/classMBanques.php';
|
||||
require_once 'Metier/insee/classMInsee.php';
|
||||
|
||||
|
||||
$fp = fopen('retour-'.date('YmdHis').'.csv', 'w');
|
||||
$fp = fopen($file.'-'.date('YmdHis').'.csv', 'w');
|
||||
$delimiter = ',';
|
||||
$fileHeader = array(
|
||||
'siren',
|
||||
@ -66,6 +66,7 @@ $fileHeader = array(
|
||||
);
|
||||
fputcsv($fp, $fileHeader, $delimiter, '"');
|
||||
|
||||
$cpt = 1;
|
||||
foreach ($companies as $item)
|
||||
{
|
||||
// --- Date de création de l'entreprise
|
||||
@ -83,7 +84,7 @@ foreach ($companies as $item)
|
||||
}
|
||||
|
||||
// DateImma
|
||||
if ($dateCreaEn === null) {
|
||||
if ($dateCreaEnSet === null) {
|
||||
$sql = $db->select()->from('rncs_entrep', array('dateImma'), 'jo')
|
||||
->where('siren=?', $item)->limit(1);
|
||||
$result = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
|
||||
@ -146,6 +147,7 @@ foreach ($companies as $item)
|
||||
// date +1
|
||||
$dateCalcul->addMonth(1);
|
||||
}
|
||||
$cpt++;
|
||||
}
|
||||
|
||||
fclose($fp);
|
@ -2,14 +2,14 @@
|
||||
<?php
|
||||
// --- Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(__DIR__ . '/../../application'));
|
||||
|| define('APPLICATION_PATH', realpath(__DIR__ . '/../application'));
|
||||
|
||||
// --- Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
// --- Composer autoload
|
||||
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
|
||||
require_once realpath(__DIR__ . '/../vendor/autoload.php');
|
||||
|
||||
// --- Create application, bootstrap, and run
|
||||
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
|
||||
|
Loading…
Reference in New Issue
Block a user