Prise en compte du nombre d'événements et de la position lors du

parcours
This commit is contained in:
Michael RICOIS 2017-01-02 14:40:45 +01:00
parent ee3209c6a7
commit 25af813247
3 changed files with 120 additions and 103 deletions

View File

@ -34,7 +34,7 @@ class Metier_Defaillance_Detect
protected $EtabActifNb;
/**
* Rgsitre des métiers
* Registre des métiers
* @var int
*/
protected $NumRM;
@ -70,10 +70,17 @@ class Metier_Defaillance_Detect
protected $ProcolMaxYear = 12;
protected $Even;
protected $EvenDateJugement;
protected $EvenDate;
protected $EvenTxt;
protected $EvenDelete = 0;
protected $EvenIndex = 0;
protected $EvenNb = 0;
/**
* Date de référence (aujourd'hui la majorité du temps)
* @var string
*/
protected $DateRef;
/**
@ -112,6 +119,11 @@ class Metier_Defaillance_Detect
$this->ListEvenProcolDelete = include __DIR__ . '/ProcolDelete.php';
}
public function setEvenNb($val)
{
$this->EvenNb = $val;
}
/**
* Code Forme Juridique
* @param string $val
@ -252,8 +264,9 @@ class Metier_Defaillance_Detect
public function parse($ann)
{
$this->Even = $ann->code;
$this->EvenDateJugement = $ann->date;
$this->EvenDate = $ann->date;
$this->EvenTxt = $ann->txt;
$this->EvenIndex++;
if ($this->debug) {
file_put_contents('procol.log', "Annonce : ".$ann->date . '-' . $ann->code."\n", FILE_APPEND);
@ -272,7 +285,7 @@ class Metier_Defaillance_Detect
}
// --- Variable pour le plan
$this->PlanDateStart = $this->EvenDateJugement;
$this->PlanDateStart = $this->EvenDate;
$this->planPeriod($this->EvenTxt);
$this->planEnd();
@ -299,7 +312,7 @@ class Metier_Defaillance_Detect
$result = $this->params($rule['params']);
if ($result === true) {
// Defintion paramètres situation
$this->SituationDateStart = $this->EvenDateJugement;
$this->SituationDateStart = $this->EvenDate;
$this->situationEnd();
$dateEnd = $this->SituationDateEnd;

View File

@ -16,15 +16,15 @@ return array(
'name' => 'PLAN',
'value' => 'CONTINUE',
'params' => array(
//array( 'var' => 'PlanPeriod', 'op' => 'EGAL', 'value'=> array(0,120)),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => array(
//array('var' => 'PlanPeriod', 'op' => 'EGAL', 'value'=> array(0,120)),
array('var' => 'Even', 'op' => 'EGAL', 'value' => array(
1407, // Modification de plan
1409, // Modification du plan de continuation
1413, // Arrêt du plan de continuation
1414, // Arrêt du plan de redressement
1101, // Arrêt du plan de sauvegarde
)),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'PL'),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'PL'),
),
),
// --- Period par defaut
@ -32,16 +32,16 @@ return array(
'name' => 'PLAN-DUREE-DEFAUT1',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'PlanPeriod', 'op' => 'MAX', 'value'=> 1),
array( 'var' => 'PlanPeriod', 'op' => 'SET', 'value' => 120),
array('var' => 'PlanPeriod', 'op' => 'MAX', 'value'=> 1),
array('var' => 'PlanPeriod', 'op' => 'SET', 'value' => 120),
),
),
array(
'name' => 'PLAN-DUREE-DEFAUT2',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'PlanPeriod', 'op' => 'MIN', 'value'=> 120),
array( 'var' => 'PlanPeriod', 'op' => 'SET', 'value' => 120),
array('var' => 'PlanPeriod', 'op' => 'MIN', 'value'=> 120),
array('var' => 'PlanPeriod', 'op' => 'SET', 'value' => 120),
),
),
// --- Period par default pour FJ spécifique
@ -49,8 +49,8 @@ return array(
'name' => 'PLAN-DUREE-FJ1',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'PlanPeriod', 'op' => 'MAX', 'value'=> 1),
array( 'var' => 'FJ', 'op' => 'EGAL', 'value' => array(
array('var' => 'PlanPeriod', 'op' => 'MAX', 'value'=> 1),
array('var' => 'FJ', 'op' => 'EGAL', 'value' => array(
16,1600, // Exploitant agricole
63,6316,6317,6318, // Société coopérative agricole
5431,5432,5531,5532, // SMIA, SICA
@ -58,7 +58,7 @@ return array(
6533,6534,6535, // GAEC, GFA, Gpt Agricole Foncier
6597,6598,
)),
array( 'var' => 'PlanPeriod', 'op' => 'SET', 'value' => 180),
array('var' => 'PlanPeriod', 'op' => 'SET', 'value' => 180),
),
),
// --- Period par default pour FJ spécifique
@ -66,8 +66,8 @@ return array(
'name' => 'PLAN-DUREE-FJ2',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'PlanPeriod', 'op' => 'MIN', 'value'=> 120),
array( 'var' => 'FJ', 'op' => 'EGAL', 'value' => array(
array('var' => 'PlanPeriod', 'op' => 'MIN', 'value'=> 120),
array('var' => 'FJ', 'op' => 'EGAL', 'value' => array(
16,1600, // Exploitant agricole
63,6316,6317,6318, // Société coopérative agricole
5431,5432,5531,5532, // SMIA, SICA
@ -75,7 +75,7 @@ return array(
6533,6534,6535, // GAEC, GFA, Gpt Agricole Foncier
6597,6598,
)),
array( 'var' => 'PlanPeriod', 'op' => 'SET', 'value' => '180'),
array('var' => 'PlanPeriod', 'op' => 'SET', 'value' => '180'),
),
),
// --- Elimination du plan : période atteinte
@ -83,9 +83,9 @@ return array(
'name' => 'PLAN-PERIOD-ATTEINTE',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'PL'),
array( 'var' => 'PlanDateEnd', 'op' => 'MIN', 'value' => 'DateRef'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'PL'),
array('var' => 'PlanDateEnd', 'op' => 'MIN', 'value' => 'DateRef'),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- Elimination du plan : appel de jugement
@ -93,9 +93,9 @@ return array(
'name' => 'PLAN-APPEL-JUGEMENT',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'PL'),
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 4),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'PA'),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'PL'),
array('var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 4),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'PA'),
),
),
// --- Elimination du plan : cutoff
@ -103,10 +103,10 @@ return array(
'name' => 'PLAN-CUT-OFF',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'PL'),
array( 'var' => 'Cutoff', 'op' => 'EGAL', 'value' => true),
array( 'var' => 'ScoreSolv', 'op' => 'MIN', 'value' => 0),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'PL'),
array('var' => 'Cutoff', 'op' => 'EGAL', 'value' => true),
array('var' => 'ScoreSolv', 'op' => 'MIN', 'value' => 0),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- Début de procol
@ -114,8 +114,8 @@ return array(
'name' => 'PROCOL-START',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'P'),
array('var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'P'),
),
),
// --- Pas de mention de la procol
@ -123,9 +123,9 @@ return array(
'name' => 'PROCOL-EFFACEMENT-1',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 1),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array('var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 1),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- Ne pas mentionner la procol si CJ=1xxx
@ -133,11 +133,11 @@ return array(
'name' => 'PROCOL-EFFACEMENT-2.1',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 2),
array( 'var' => 'FJ', 'op' => 'MIN', 'value' => 1000),
array( 'var' => 'FJ', 'op' => 'MAX', 'value' => 1999),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array('var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 2),
array('var' => 'FJ', 'op' => 'MIN', 'value' => 1000),
array('var' => 'FJ', 'op' => 'MAX', 'value' => 1999),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- Ne pas mentionner la procol si actif et CJ!=9xxx et even de plus d'un mois
@ -145,12 +145,12 @@ return array(
'name' => 'PROCOL-EFFACEMENT-2.2',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 2),
array( 'var' => 'InseeActif', 'op' => 'EGAL', 'value' => 1),
array( 'var' => 'FJ', 'op' => 'MAX', 'value' => 9000),
array( 'var' => 'SituationNbMonthPast', 'op' => 'MIN', 'value' => 1),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array('var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 2),
array('var' => 'InseeActif', 'op' => 'EGAL', 'value' => 1),
array('var' => 'FJ', 'op' => 'MAX', 'value' => 9000),
array('var' => 'SituationNbMonthPast', 'op' => 'MIN', 'value' => 1),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- Pas Procol si actif RCS
@ -158,10 +158,10 @@ return array(
'name' => 'PROCOL-EFFACEMENT-3',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 3),
array( 'var' => 'RcsActif', 'op' => 'EGAL', 'value' => 1),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array('var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 3),
array('var' => 'RcsActif', 'op' => 'EGAL', 'value' => 1),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- Le dernier jugement est un appel => Procol Suspendu
@ -169,9 +169,9 @@ return array(
'name' => 'PROCOL-EFFACEMENT-4',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 4),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'PA'),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array('var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 4),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'PA'),
),
),
// --- Procédure trop ancienne plus de 12 ans et actif
@ -179,10 +179,10 @@ return array(
'name' => 'PROCOL-ANCIEN',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'InseeActif', 'op' => 'EGAL', 'value' => 1),
array( 'var' => 'SituationDateEnd', 'op' => 'MAX', 'value' => 'DateRef'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array('var' => 'InseeActif', 'op' => 'EGAL', 'value' => 1),
array('var' => 'SituationDateEnd', 'op' => 'MAX', 'value' => 'DateRef'),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- En Procol mais présence d'une annonce de cloture ou LJ avec Bilan publié ultérieurement
@ -190,13 +190,13 @@ return array(
'name' => 'PROCOL-CLOTURE-LJ-BILAN',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => array(
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array('var' => 'Even', 'op' => 'EGAL', 'value' => array(
1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1311,1312,1313,
1500,1501,1502,1503,1504
)),
array( 'var' => 'BilanCloture', 'op' => 'MIN', 'value' => 'DateRef'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'BilanCloture', 'op' => 'MIN', 'value' => 'DateRef'),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- En Procol mais présence d'une annonce LJ avec Bilan publié ultérieurement, uniquement FJ!=1xxx
@ -204,17 +204,17 @@ return array(
'name' => 'PROCOL-CLOTURE',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'FJ', 'op' => 'MIN', 'value' => 1999),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array('var' => 'FJ', 'op' => 'MIN', 'value' => 1999),
//Si l'evenement procol de départ, précédent est
array( 'var' => 'SituationLastEven', 'op' => 'EGAL', 'value' => array(
array('var' => 'SituationLastEven', 'op' => 'EGAL', 'value' => array(
1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1311,1312,1313,1314,1417
)),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => array(
array('var' => 'Even', 'op' => 'EGAL', 'value' => array(
1502,1503
)),
array( 'var' => 'BilanCloture', 'op' => 'MIN', 'value' => 'DateRef'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'CL'),
array('var' => 'BilanCloture', 'op' => 'MIN', 'value' => 'DateRef'),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'CL'),
),
),
// --- En procol mais cutoff manuel
@ -222,10 +222,10 @@ return array(
'name' => 'PROCOL-CUT-OFF',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'Cutoff', 'op' => 'EGAL', 'value' => true),
array( 'var' => 'ScoreSolv', 'op' => 'MIN', 'value' => 0),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array('var' => 'Cutoff', 'op' => 'EGAL', 'value' => true),
array('var' => 'ScoreSolv', 'op' => 'MIN', 'value' => 0),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- Absorbé ?? ICI uniquement lorsque Situation = ''
@ -233,9 +233,9 @@ return array(
'name' => 'ABSORPTION',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenAbsorption'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'A'),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array('var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenAbsorption'),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'A'),
),
),
// --- Dissolution ?? ICI uniquement lorsque Situation = ''
@ -243,9 +243,9 @@ return array(
'name' => 'DISSOLUTION',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenDissolution'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'D'),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array('var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenDissolution'),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'D'),
),
),
// --- Dissolution mais bilan après événements ?? ICI uniquement lorsque Situation = ''
@ -253,10 +253,10 @@ return array(
'name' => 'DISSOLUTION-AVEC-BILAN',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenDissolution'),
array( 'var' => 'BilanCloture', 'op' => 'MIN', 'value' => 'EvenDateJugement'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array('var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenDissolution'),
array('var' => 'BilanCloture', 'op' => 'MIN', 'value' => 'EvenDate'),
array('var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- Radiation RM
@ -264,10 +264,10 @@ return array(
'name' => 'RADIATION-RM',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array( 'var' => 'IsRM', 'op' => 'EGAL', 'value' => 1),
array( 'var' => 'InseeActif', 'op' => 'EGAL', 'value' => 0),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'RR'),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array('var' => 'IsRM', 'op' => 'EGAL', 'value' => 1),
array('var' => 'InseeActif', 'op' => 'EGAL', 'value' => 0),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'RR'),
),
),
// --- Radiation RCS
@ -275,10 +275,11 @@ return array(
'name' => 'RADIATION-RCS',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array( 'var' => 'IsRCS', 'op' => 'EGAL', 'value' => 1),
array( 'var' => 'InseeActif', 'op' => 'EGAL', 'value' => 0),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'RR'),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array('var' => 'IsRCS', 'op' => 'EGAL', 'value' => 1),
array('var' => 'InseeActif', 'op' => 'EGAL', 'value' => 0),
array('var' => 'EvenNb', 'op' => 'MIN', 'value' => 'EvenIndex'),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'RR'),
),
),
// --- Radiation RCS avec Date
@ -286,9 +287,10 @@ return array(
'name' => 'RADIATION-DATE',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array( 'var' => 'GreffeRadiationDate', 'op' => 'MIN', 'value' => 'EvenDateJugement'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'RR'),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array('var' => 'GreffeRadiationDate', 'op' => 'MIN', 'value' => 0),
array('var' => 'EvenNb', 'op' => 'MIN', 'value' => 'EvenIndex'),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'RR'),
),
),
// --- Radiation Publié 1
@ -296,22 +298,22 @@ return array(
'name' => 'RADIATION-PUB1',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenRadiation'),
array( 'var' => 'EtabActifNb', 'op' => 'EGAL', 'value' => 0),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'RP'),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array('var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenRadiation'),
array('var' => 'EtabActifNb', 'op' => 'EGAL', 'value' => 0),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'RP'),
),
),
// Radiation Publié 2
// --- Radiation Publié 2
array(
'name' => 'RADIATION-PUB2',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenRadiation'),
array( 'var' => 'InseeActif', 'op' => 'EGAL', 'value' => 0),
array( 'var' => 'IsRCS', 'op' => 'EGAL', 'value' => 1),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'RP'),
array('var' => 'Situation', 'op' => 'EGAL', 'value' => ''),
array('var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenRadiation'),
array('var' => 'InseeActif', 'op' => 'EGAL', 'value' => 0),
array('var' => 'IsRCS', 'op' => 'EGAL', 'value' => 1),
array('var' => 'Situation', 'op' => 'SET', 'value' => 'RP'),
),
),
);

View File

@ -3344,7 +3344,9 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
$situation = '';
if (intval($siren) > 100) {
$annoncesList = $this->getAnnoncesLegales($siren);
$annoncesNb = count($annoncesList);
$detect = new Metier_Defaillance_Detect();
$detect->setEvenNb($annoncesNb);
$detect->setFJ($tabInsee['CJ']);
$detect->setInseeActif($tabInsee['ACTIF']);
$detect->setEtabActif($nbEtab);
@ -3359,7 +3361,7 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
if (isset($tabRet['dateRad'])) {
$detect->setGreffeRadiation($tabRet['dateRad']);
}
if (count($annoncesList) > 0) {
if ($annoncesNb > 0) {
// Parcours annonces
$tabJugements = array();
foreach ($annoncesList as $i => $ann) {
@ -3400,8 +3402,8 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
// Fin Situation Juridique
// Date de dernière mise à jour
if (count($annonceList) > 0) {
$annonceLast = end($annonceList);
if ($annoncesNb > 0) {
$annonceLast = end($annoncesList);
$tabRet['dateMajANN'] = Metier_Util_Date::dateT('Y-m-d', 'Y-m-d', $annonceLast['dateInsertionSD']);
if ($tabRet['dateMajANN'] == '--') {
$tabRet['dateMajANN'] = '';