Diverses corrections + mise à jour librairies Métier
This commit is contained in:
parent
069edd137e
commit
c8a80ddab9
@ -509,7 +509,8 @@ class Metier_Sfr
|
||||
}
|
||||
|
||||
//Aucun résultat, faire le calcul || donnée manquante
|
||||
else {
|
||||
if ( $this->ValNAF === null || $this->ValFJ === null || $this->ValInseeActif === null
|
||||
|| $this->ValInseeAge === null) {
|
||||
|
||||
//Identite - @todo : Gérer les erreurs techniques
|
||||
$identite = $classInsee->getIdentiteEntreprise($siren, 0, 0, false, false);
|
||||
@ -665,6 +666,7 @@ class Metier_Sfr
|
||||
$verif = array('NAF', 'FJ', 'InseeActif', 'InseeAge');
|
||||
foreach($verif as $val) {
|
||||
if ( $this->{'Val'.$val} === null ) {
|
||||
if ($this->debug) file_put_contents('sfr.log', "ERREUR = ".$val."\n", FILE_APPEND);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -911,7 +913,7 @@ class Metier_Sfr
|
||||
|
||||
public function getDateCalculIndiscore()
|
||||
{
|
||||
return $this->dateCalculIndiscore;
|
||||
return $this->ValDateCalculIndiscore;
|
||||
}
|
||||
|
||||
public function getValDebug()
|
||||
|
@ -606,7 +606,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
require_once realpath(dirname(__FILE__)).'/globalCommentaires.php';
|
||||
|
||||
$NIVEAU=$cycleClient; // 1, 2, 3 ou 5 Niveau de version des commentaires
|
||||
//set_time_limit(300);
|
||||
|
||||
$iDb = new WDB();
|
||||
$iRncs = new MRncs();
|
||||
|
@ -1118,11 +1118,11 @@ function rechercheAct($formR, $deb, $nbRep, $max)
|
||||
|
||||
$sphinxreturn = $sphinx->Query($Requete, $index);
|
||||
|
||||
/*
|
||||
/*
|
||||
file_put_contents('test.log', print_r($formR,1));
|
||||
file_put_contents('test.log', $sphinx->GetLastError()."\n", FILE_APPEND);
|
||||
file_put_contents('test.log', 'TEST='.print_r($sphinxreturn,1), FILE_APPEND);
|
||||
*/
|
||||
*/
|
||||
|
||||
$criteres = 'NPM';
|
||||
|
||||
@ -1135,9 +1135,9 @@ function rechercheAct($formR, $deb, $nbRep, $max)
|
||||
IF(l.dateUpdate>l.dateInsert,l.dateUpdate,l.dateInsert) AS date,
|
||||
|
||||
/*Participation*/
|
||||
CONCAT(e.siren, e.nic) AS siret,
|
||||
par.siren,
|
||||
e.nic,
|
||||
CONCAT(LPAD(e.siren,9,'000000000'), LPAD(e.nic,5,'00000')) AS siret,
|
||||
LPAD(par.siren,9,'000000000') AS siren,
|
||||
LPAD(e.nic,5,'00000') AS nic,
|
||||
e.siege,
|
||||
par.RS AS raisonSociale,
|
||||
/*sigle*/
|
||||
@ -1186,9 +1186,9 @@ function rechercheAct($formR, $deb, $nbRep, $max)
|
||||
IF(l.dateUpdate>l.dateInsert,l.dateUpdate,l.dateInsert) AS date,
|
||||
|
||||
/*Participation*/
|
||||
CONCAT(e.siren, e.nic) AS siret,
|
||||
par.siren,
|
||||
e.nic,
|
||||
CONCAT(LPAD(e.siren,9,'000000000'), LPAD(e.nic,5,'00000')) AS siret,
|
||||
LPAD(par.siren,9,'000000000') AS siren,
|
||||
LPAD(e.nic,5,'00000') AS nic,
|
||||
e.siege,
|
||||
par.RS AS raisonSociale,
|
||||
/*sigle*/
|
||||
|
@ -54,6 +54,8 @@ if( isset($opts->help) || count($opts->getOptions())==0 )
|
||||
exit;
|
||||
}
|
||||
|
||||
$strSelect="s.siren, s.actif, s.procol, s.indiScore, s.indiScore20, s.encours, s.indiScoreDate, scoreSolv, scoreConf, scoreDir, scoreZ, scoreCH, scoreAfdcc1, scoreAfdcc2, scoreAfdcc2note, scoreAltman, scoreAltmanCote, scoreCCF, situFi, infoNote, noteStruct, noteFin, tendance, nbModifs, s.dateUpdate, s.cs, s.csMoisMaj, s.csMoisFin";
|
||||
|
||||
$tabQueries = array(
|
||||
/* Bilans Asso déposé(s) */
|
||||
'bilansasso' => "SELECT $strSelect, 'bilansasso' as source FROM jo.scores_surveillance_tmp s, jo.asso_bilans b WHERE b.siren>1000 AND s.siren=b.siren AND b.dateInsert>s.dateUpdate AND s.procol NOT IN('P') GROUP BY siren",
|
||||
@ -161,8 +163,6 @@ if ( $opts->tout ) {
|
||||
$res = $db->query($query);
|
||||
}
|
||||
|
||||
$strSelect="s.siren, s.actif, s.procol, s.indiScore, s.indiScore20, s.encours, s.indiScoreDate, scoreSolv, scoreConf, scoreDir, scoreZ, scoreCH, scoreAfdcc1, scoreAfdcc2, scoreAfdcc2note, scoreAltman, scoreAltmanCote, scoreCCF, situFi, infoNote, noteStruct, noteFin, tendance, nbModifs, s.dateUpdate, s.cs, s.csMoisMaj, s.csMoisFin";
|
||||
|
||||
/**
|
||||
* Lancement du programme
|
||||
*/
|
||||
@ -195,7 +195,12 @@ foreach ($tabQueries as $declencheur=>$query)
|
||||
|
||||
echo date('Y/m/d - H:i:s') ." - Recherche par la source '$declencheur'...";
|
||||
|
||||
$res = $db->fetchAll($query);
|
||||
try {
|
||||
$res = $db->fetchAll($query);
|
||||
} catch(Zend_Db_Adapter_Exception $e) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
exit;
|
||||
}
|
||||
|
||||
$nbRows=count($res);
|
||||
echo date('Y/m/d - H:i:s') ." - Il y a $nbRows scores à recalculer par '$declencheur'...".PHP_EOL;
|
||||
|
@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
* Crontab
|
||||
* 0 20 * * 1-6 scores php /home/scores/batch/scripts/clients/SfrIndicateur.php --load --cron >> /home/scores/log/SfrIndicateur.log
|
||||
* 0 1 * * 1-6 scores php /home/scores/batch/scripts/clients/SfrIndicateur.php --evaluate --cron >> /home/scores/log/SfrIndicateur.log
|
||||
*/
|
||||
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_WARNING);
|
||||
//error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
|
||||
// Define path to application directory
|
||||
|
Loading…
x
Reference in New Issue
Block a user