Compare commits
16 Commits
master
...
defaillanc
Author | SHA1 | Date | |
---|---|---|---|
|
2823d6b034 | ||
|
fa3dee27d5 | ||
|
3a2c27ede9 | ||
|
f9a25ce1bd | ||
|
7344aa8f92 | ||
|
72146ab2bb | ||
|
6a7b675218 | ||
|
1bfa016337 | ||
|
3459c20de9 | ||
|
75477ef4ba | ||
|
31cf43f77b | ||
|
25af813247 | ||
|
ee3209c6a7 | ||
|
b5bcb212e4 | ||
|
2ec4fe7aa7 | ||
|
d575ee9f84 |
@ -23,7 +23,7 @@ class Metier_Defaillance_Detect
|
||||
|
||||
/**
|
||||
* Actif RCS
|
||||
* @var unknown
|
||||
* @var int
|
||||
*/
|
||||
protected $RcsActif;
|
||||
|
||||
@ -34,7 +34,7 @@ class Metier_Defaillance_Detect
|
||||
protected $EtabActifNb;
|
||||
|
||||
/**
|
||||
* Rgsitre des métiers
|
||||
* Registre des métiers
|
||||
* @var int
|
||||
*/
|
||||
protected $NumRM;
|
||||
@ -45,6 +45,13 @@ class Metier_Defaillance_Detect
|
||||
*/
|
||||
protected $IsRCS;
|
||||
|
||||
/**
|
||||
* Date Radiation au Greffe
|
||||
* @var int
|
||||
* Date au format AAAAMMJJ
|
||||
*/
|
||||
protected $GreffeRadiationDate;
|
||||
|
||||
protected $Situation = '';
|
||||
protected $SituationDateStart;
|
||||
protected $SituationDateEnd;
|
||||
@ -63,11 +70,18 @@ class Metier_Defaillance_Detect
|
||||
protected $ProcolMaxYear = 12;
|
||||
|
||||
protected $Even;
|
||||
protected $EvenDateJugement;
|
||||
protected $EvenDate;
|
||||
protected $EvenTxt;
|
||||
protected $EvenDelete = 0;
|
||||
|
||||
protected $DateToday;
|
||||
protected $EvenIndex = 0;
|
||||
protected $EvenNb = 0;
|
||||
|
||||
/**
|
||||
* Date de référence (aujourd'hui la majorité du temps)
|
||||
* @var string
|
||||
*/
|
||||
protected $DateRef;
|
||||
|
||||
/**
|
||||
* Timeline des événements de défaillance
|
||||
@ -87,7 +101,7 @@ class Metier_Defaillance_Detect
|
||||
}
|
||||
|
||||
// Définir la date du jour
|
||||
$this->DateToday = date('Ymd');
|
||||
$this->DateRef = date('Ymd');
|
||||
|
||||
// Liste des événements au départ d'une procol
|
||||
$this->ListEvenProcol = include __DIR__ . '/EvenProcol.php';
|
||||
@ -105,41 +119,85 @@ class Metier_Defaillance_Detect
|
||||
$this->ListEvenProcolDelete = include __DIR__ . '/ProcolDelete.php';
|
||||
}
|
||||
|
||||
public function setEvenNb($val)
|
||||
{
|
||||
$this->EvenNb = $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Code Forme Juridique
|
||||
* @param string $val
|
||||
*/
|
||||
public function setFJ($val)
|
||||
{
|
||||
$this->FJ = $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date de cloture du bilan
|
||||
* @param int $val
|
||||
* Date au format AAAAMMJJ
|
||||
*/
|
||||
public function setBilanCloture($val)
|
||||
{
|
||||
$this->BilanCloture = $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insee Actif
|
||||
* @param int $val
|
||||
*/
|
||||
public function setInseeActif($val)
|
||||
{
|
||||
$this->InseeActif = $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* RCS Actif
|
||||
* @param int $val
|
||||
*/
|
||||
public function setRcsActif($val)
|
||||
{
|
||||
$this->RcsActif = $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Nombre d'etablissement Actif
|
||||
* @param int $val
|
||||
*/
|
||||
public function setEtabActif($val)
|
||||
{
|
||||
$this->EtabActifNb = $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Est présent au registre des métiers
|
||||
* @param int $val
|
||||
*/
|
||||
public function setRM($val)
|
||||
{
|
||||
$this->IsRM = $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Est présent au Greffe
|
||||
* @param int $val
|
||||
*/
|
||||
public function setGreffe($val)
|
||||
{
|
||||
$this->IsRCS = $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date de radiation au Greffe
|
||||
* @param string $date
|
||||
*/
|
||||
public function setGreffeRadiation($date)
|
||||
{
|
||||
$date = intval(str_replace('-', '', $date));
|
||||
$this->GreffeRadiationDate = $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la situation
|
||||
* @return string
|
||||
@ -206,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);
|
||||
@ -226,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();
|
||||
|
||||
@ -253,17 +312,24 @@ 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;
|
||||
if ($this->Situation == 'PL') {
|
||||
$dateEnd = $this->PlanDateEnd;
|
||||
}
|
||||
|
||||
// Enregistrement dans la timeline
|
||||
$this->Timeline[] = array(
|
||||
'Situation' => $this->Situation,
|
||||
'Even' => $this->Even,
|
||||
'DateStart' => $this->SituationDateStart,
|
||||
'DateEnd' => $this->SituationDateEnd,
|
||||
'DateEnd' => $dateEnd,
|
||||
);
|
||||
file_put_contents('procol.log', print_r($this->Timeline, 1)."\n", FILE_APPEND);
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', print_r($this->Timeline, 1)."\n", FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->debug) {
|
||||
|
@ -16,32 +16,32 @@ return array(
|
||||
'name' => 'PLAN',
|
||||
'value' => 'CONTINUE',
|
||||
'params' => 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' => '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
|
||||
// --- Period par defaut
|
||||
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' => 'DateToday'),
|
||||
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' => 'DateToday'),
|
||||
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' => 'DateToday'),
|
||||
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
|
||||
array('var' => 'BilanCloture', 'op' => 'MIN', 'value' => 'EvenDate'),
|
||||
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' => 'DateToday'),
|
||||
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'CL'),
|
||||
array('var' => 'BilanCloture', 'op' => 'MIN', 'value' => 'EvenDate'),
|
||||
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,22 @@ 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
|
||||
array(
|
||||
'name' => 'RADIATION-DATE',
|
||||
'value' => 'CONTINUE',
|
||||
'params' => array(
|
||||
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
|
||||
@ -286,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'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -44,7 +44,7 @@ return array(
|
||||
1201, //Conversion sauvegarde en Redressement Judiciaire
|
||||
1202, //Renouvellement de la période d'observation
|
||||
1203, //Avis de dépôt de l'état de collocation
|
||||
1204, //Avis de dépôt de l'état des créances
|
||||
//1204, //Avis de dépôt de l'état des créances
|
||||
1205, //Avis de dépôt de l'état des créances complémentaires nées après jugement d'ouverture
|
||||
1206, //Avis de dépôt de l'état des créances nées après jugement d'ouverture
|
||||
1207, //Règlements amiables
|
||||
@ -88,8 +88,8 @@ return array(
|
||||
1410, //Suite de jugement/règlement/liquidation
|
||||
1411, //Arrêt du plan de cession
|
||||
1412, //Arrêt du plan de cession partielle
|
||||
1413, //Arrêt du plan de continuation
|
||||
1414, //Arrêt du plan de redressement
|
||||
//1413, //Arrêt du plan de continuation
|
||||
//1414, //Arrêt du plan de redressement => Supprimer les éléments
|
||||
1415, //Prolongement du plan cession
|
||||
1416, //Jugement constatant la bonne exécution du plan
|
||||
1417, //Jugement d'extension de liquidation judiciaire
|
||||
|
@ -2655,17 +2655,17 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
'5510Z', // Hôtels et hébergement similaire
|
||||
'5520Z', // Hébergement touristique et autre hébergement de co
|
||||
'5530Z', // Terrains de camping et parcs pour caravanes ou véh
|
||||
'702A', // Location de logements
|
||||
'702A', // Location de logements
|
||||
'6820A', // Location de logements
|
||||
'6820B', // Location de terrains et d'autres biens immobiliers
|
||||
'551A', // Hôtels touristiques avec restaurant
|
||||
'551A', // Hôtels touristiques avec restaurant
|
||||
'5610A', // Restauration traditionnelle
|
||||
'741J', // Administration d'entreprises
|
||||
'741J', // Administration d'entreprises
|
||||
'7010Z', // Activités des sièges sociaux
|
||||
'552C', // Exploitation de terrains de camping
|
||||
'702C', // Location d'autres biens immobiliers
|
||||
'551C', // Hôtels touristiques sans restaurant
|
||||
'553A', // Restauration de type traditionnel
|
||||
'552C', // Exploitation de terrains de camping
|
||||
'702C', // Location d'autres biens immobiliers
|
||||
'551C', // Hôtels touristiques sans restaurant
|
||||
'553A', // Restauration de type traditionnel
|
||||
);
|
||||
if (in_array($tabInsee['APE_ENT'], $tabNafTourisme)
|
||||
|| in_array($tabInsee['APE_ETAB'], $tabNafTourisme)) {
|
||||
@ -2784,149 +2784,6 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
));
|
||||
}
|
||||
|
||||
// --- Situation Juridique
|
||||
if (intval($siren) > 100) {
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "=== Situation Juridique ===\n");
|
||||
}
|
||||
|
||||
$tabAnn = $this->getAnnoncesLegales($siren, 0, '', false, false);
|
||||
|
||||
if (count($tabAnn) > 0) {
|
||||
// Date de dernière mise à jour
|
||||
$tabDates = array();
|
||||
foreach ($tabAnn as $iAnn => $ann) {
|
||||
$tabDates[] = $ann['dateInsertionSD'];
|
||||
}
|
||||
rsort($tabDates);
|
||||
$tabRet['dateMajANN'] = Metier_Util_Date::dateT('Y-m-d', 'Y-m-d', $tabDates[0]);
|
||||
if ($tabRet['dateMajANN'] == '--') {
|
||||
$tabRet['dateMajANN'] = '';
|
||||
} else {
|
||||
$dateAnnLastCompare = DateTime::createFromFormat('Y-m-d', $tabRet['dateMajANN']);
|
||||
}
|
||||
|
||||
// Procol
|
||||
$tabProcol = $this->getAnnoncesLegales($siren, 0, 'P', false);
|
||||
if (count($tabProcol) > 0) {
|
||||
$tabDates = array();
|
||||
foreach ($tabProcol as $iProcol => $procol) {
|
||||
$tabDates[] = $procol['dateJugement'];
|
||||
}
|
||||
rsort($tabDates);
|
||||
$dateProcol = str_replace('-', '', $tabDates[0])*1;
|
||||
// Plan
|
||||
if ($this->dureePlan > 0 && date('Ymd') < $this->finPlan) {
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "Plan (PL) : ".$this->dureePlan."-".$this->finPlan."\n", FILE_APPEND);
|
||||
}
|
||||
$tabRet['SituationJuridique'] = 'PL';
|
||||
}
|
||||
// Plan révolu
|
||||
elseif ($this->dureePlan > 0 && date('Ymd') >= $this->finPlan) {
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "Plan revolu : ".$this->dureePlan."-".$this->finPlan."\n", FILE_APPEND);
|
||||
}
|
||||
$tabRet['SituationJuridique'] = '';
|
||||
}
|
||||
// Appel de jugement
|
||||
elseif ($this->appelJugement) {
|
||||
$tabRet['SituationJuridique'] = 'PA';
|
||||
}
|
||||
// Jugement de cloture après LJ
|
||||
elseif ($this->SituationCloture) {
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "Cloture (CL) "."\n", FILE_APPEND);
|
||||
}
|
||||
$tabRet['SituationJuridique'] = 'CL';
|
||||
}
|
||||
// En cours de procédure
|
||||
else {
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "Procol (P) "."\n", FILE_APPEND);
|
||||
}
|
||||
$tabRet['SituationJuridique'] = 'P';
|
||||
}
|
||||
|
||||
// RAZ SituationJuridique si cutoff plus récent que dernière procol
|
||||
try {
|
||||
$stmt = $this->conn->executeQuery("SELECT encours, scoreSolv, scoreDir, scoreConf,
|
||||
DATE(dateInsert)*1 AS dateInsert, DATE(dateUpdate)*1 AS dateUpdate
|
||||
FROM jo.scores_cutoff WHERE siren=$siren");
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$result = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
if ($result['scoreSolv'] > 0) {
|
||||
//Tri des dates de procol
|
||||
$tabDates = array();
|
||||
foreach ($tabProcol as $iProcol => $procol) {
|
||||
$tabDates[] = $procol['dateJugement'];
|
||||
}
|
||||
rsort($tabDates);
|
||||
$dateProcol = str_replace('-', '', $tabDates[0])*1;
|
||||
if ($result['dateUpdate'] > $result['dateInsert']) {
|
||||
$dateMaj = str_replace('-', '', $result['dateUpdate']);
|
||||
} else {
|
||||
$dateMaj = str_replace('-', '', $result['dateInsert']);
|
||||
}
|
||||
if ($dateProcol <= $dateMaj) {
|
||||
$tabRet['SituationJuridique'] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
if ($this->logger !== null) {
|
||||
$this->logger->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Absorption
|
||||
if ($identite['SituationJuridique'] == '') {
|
||||
$tabAnn = $this->getAnnoncesLegales($siren, 0, 'A', false);
|
||||
$nbAnn = count($tabAnn);
|
||||
if ($nbAnn > 0) {
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "DETECTION ABSORPTION\n", FILE_APPEND);
|
||||
}
|
||||
$dateAnn = $tabAnn[$nbAnn-1]['dateInsertionSD'];
|
||||
$dateAnnCompare = DateTime::createFromFormat('Y-m-d H:i:s', $dateAnn);
|
||||
$dateAnnCompare->add(new DateInterval('P364D'));
|
||||
if ($dateAnnCompare > $dateAnnLastCompare) {
|
||||
$tabRet['SituationJuridique'] = 'A';
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "Entreprise absorbée\n", FILE_APPEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Dissolution
|
||||
if ($identite['SituationJuridique'] == '') {
|
||||
$tabAnn = $this->getAnnoncesLegales($siren, 0, 'D', false);
|
||||
$nbAnn = count($tabAnn);
|
||||
if ($nbAnn > 0) {
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "DETECTION DISSOLUTION\n", FILE_APPEND);
|
||||
}
|
||||
$dateAnn = $tabAnn[$nbAnn-1]['dateInsertionSD'];
|
||||
$dateAnnCompare = DateTime::createFromFormat('Y-m-d H:i:s', $dateAnn);
|
||||
$dateAnnCompare->add(new DateInterval('P364D'));
|
||||
if ($dateAnnCompare > $dateAnnLastCompare) {
|
||||
$tabRet['SituationJuridique'] = 'D';
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "Entreprise dissolue\n", FILE_APPEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->debug) {
|
||||
file_put_contents('procol.log', "SituationJuridique = ".$tabRet['SituationJuridique']."\n", FILE_APPEND);
|
||||
}
|
||||
$timer['getAnnoncesLegales'] = microtime(true);
|
||||
} // Fin Situation Juridique
|
||||
|
||||
if (($tabInsee['CJ'] > 0 && $tabInsee['CJ'] < 20
|
||||
|| $tabInsee['CJ'] > 999 && $tabInsee['CJ'] < 2000) && $tabInsee['DIR_FCT']=='') {
|
||||
$tabRet['dir1Titre'] = self::$tabFct['PP'];
|
||||
@ -3415,34 +3272,34 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
if (strtoupper(trim($entrep['sigle'])) != strtoupper(trim($tabRet['Sigle']))) {
|
||||
$tabRet['sigleLong'] = strtoupper($entrep['sigle']);
|
||||
}
|
||||
$tabRet['dateImmat'] = $entrep['dateImma'];
|
||||
$tabRet['dateRad'] = $entrep['dateRad'];
|
||||
$tabRet['Capital'] = $entrep['capitalMontant']+($entrep['capitalCent']/100);
|
||||
$tabRet['CapitalDev'] = $entrep['capitalDevIso'];
|
||||
$tabRet['CapitalType'] = trim(strtoupper(substr($entrep['capitalType'], 0, 1)));
|
||||
$tabRet['dateImmat'] = $entrep['dateImma'];
|
||||
$tabRet['dateRad'] = $entrep['dateRad'];
|
||||
$tabRet['Capital'] = $entrep['capitalMontant']+($entrep['capitalCent']/100);
|
||||
$tabRet['CapitalDev'] = $entrep['capitalDevIso'];
|
||||
$tabRet['CapitalType'] = trim(strtoupper(substr($entrep['capitalType'], 0, 1)));
|
||||
|
||||
// Par défaut, la Forme juridique qui fait foie est celle de l'INPI
|
||||
$fjInpi = $entrep['cj']*1;
|
||||
if ($tabRet['FJ']*1 != $fjInpi && $fjInpi>0) {
|
||||
$tabRet['FJ2'] = $tabRet['FJ'];
|
||||
$tabRet['FJ2_Lib'] = $tabRet['FJ_lib'];
|
||||
$tabRet['FJ'] = $fjInpi;
|
||||
$tabRet['FJ_lib'] = $this->getLibelleFJ($fjInpi);
|
||||
$tabRet['FJ2'] = $tabRet['FJ'];
|
||||
$tabRet['FJ2_Lib'] = $tabRet['FJ_lib'];
|
||||
$tabRet['FJ'] = $fjInpi;
|
||||
$tabRet['FJ_lib'] = $this->getLibelleFJ($fjInpi);
|
||||
} else {
|
||||
$tabRet['FJ2'] = $tabRet['FJ'];
|
||||
$tabRet['FJ2_Lib'] = $tabRet['FJ_lib'];
|
||||
$tabRet['FJ2'] = $tabRet['FJ'];
|
||||
$tabRet['FJ2_Lib'] = $tabRet['FJ_lib'];
|
||||
}
|
||||
if ($fjInpi >= 1000 && $fjInpi < 2000) {
|
||||
$tabRet['dir1Titre'] = 'Personne physique';
|
||||
$tabRet['dir1Code'] = '1050';
|
||||
$tabRet['dir1Titre'] = 'Personne physique';
|
||||
$tabRet['dir1Code'] = '1050';
|
||||
$tabRet['dir1NomPrenom'] = strtoupper($entrep['nom']).' '.
|
||||
ucwords(strtolower($entrep['prenom']));
|
||||
$tabRet['dir1Nom'] = strtoupper($entrep['nom']);
|
||||
$tabRet['dir1Prenom'] = ucwords(strtolower($entrep['prenom']));
|
||||
$tabRet['dir1NomUsage'] = strtoupper($entrep['nomUsage']);
|
||||
$tabRet['dir1DateNaiss'] = $entrep['dateNaiss'];
|
||||
$tabRet['dir1LieuNaiss'] = $entrep['lieuNaiss'];
|
||||
$tabRet['dir1Genre'] = $entrep['sexe'];
|
||||
$tabRet['dir1Nom'] = strtoupper($entrep['nom']);
|
||||
$tabRet['dir1Prenom'] = ucwords(strtolower($entrep['prenom']));
|
||||
$tabRet['dir1NomUsage'] = strtoupper($entrep['nomUsage']);
|
||||
$tabRet['dir1DateNaiss'] = $entrep['dateNaiss'];
|
||||
$tabRet['dir1LieuNaiss'] = $entrep['lieuNaiss'];
|
||||
$tabRet['dir1Genre'] = $entrep['sexe'];
|
||||
}
|
||||
|
||||
if ($tabRet['DateMajRCS'] == '') {
|
||||
@ -3459,10 +3316,6 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
// On signal que l'entreprise est radié du RCS
|
||||
else {
|
||||
$tabRet['EntActiveRCS'] = 0;
|
||||
// On signal que l'entreprise est radié du RCS
|
||||
if ($tabRet['SituationJuridique'] == '') {
|
||||
$tabRet['SituationJuridique'] = 'RR';
|
||||
}
|
||||
}
|
||||
|
||||
// Spécificité EIRL
|
||||
@ -3592,10 +3445,6 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
// On signal que l'entreprise est radié du RCS
|
||||
else {
|
||||
$tabRet['EntActiveRCS'] = 0;
|
||||
// On signal que l'entreprise est radié du RCS
|
||||
if ($tabRet['SituationJuridique'] == '') {
|
||||
$tabRet['SituationJuridique'] = 'RR';
|
||||
}
|
||||
}
|
||||
|
||||
$tabRet['NomCommercial'] = $rmEntrep['nomCommercial'];
|
||||
@ -3615,24 +3464,25 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
$tabRet['dir1Code'] = '1050';
|
||||
}
|
||||
|
||||
if ($accesDist &&
|
||||
if ($accesDist
|
||||
// Département couvert par Infogreffe
|
||||
!in_array($tabRet['Dept'], array(57, 67, 68, 97, 98, 99)) &&
|
||||
&& !in_array($tabRet['Dept'], array(57, 67, 68, 97, 98, 99)) &&
|
||||
// Forme Juridique présente au greffe
|
||||
(in_array($tabInsee['CJ'], array(1100,1200,1300,1700,9900)) ||
|
||||
($tabInsee['CJ']>=3100 && $tabInsee['CJ']<=3299) ||
|
||||
($tabInsee['CJ']>=4100 && $tabInsee['CJ']<=4199) ||
|
||||
($tabInsee['CJ']>=5100 && $tabInsee['CJ']<=5899) ||
|
||||
($tabInsee['CJ']>=6100 && $tabInsee['CJ']<=6599) ||
|
||||
preg_match('/EIRL/', $nom) || preg_match('/EIRL/', $nom2) ||
|
||||
preg_match('/EIRL/', $tabRet['Sigle']) || preg_match('/EIRL/', $tabRet['Enseigne']) ||
|
||||
preg_match('/EIRL/', $tabRet['Adresse']) || preg_match('/EIRL/', $tabRet['Adresse2'])
|
||||
)
|
||||
&& ($tabInsee['CJ'] == 1700 || // Agents commerciaux (uniquement au Greffes RSAC)
|
||||
$tabRet['numRC'] == '' || // Numéro de RCS absent = Anomalie (<à3%)
|
||||
$tabRet['Tribunal'] == '' || // Tribunal absent = anomalie
|
||||
str_replace('-', '', $tabRet['dateImmat'])*1 == 0 || // Pas de date d'immat = anomalie (<à9%)
|
||||
($nbEtab*1 == 0 && str_replace('-', '', $tabRet['dateRad'])*1 == 0) // Inactif sans date de RAD
|
||||
(in_array($tabInsee['CJ'], array(1100, 1200, 1300, 1700, 9900))
|
||||
|| ($tabInsee['CJ']>=3100 && $tabInsee['CJ']<=3299)
|
||||
|| ($tabInsee['CJ']>=4100 && $tabInsee['CJ']<=4199)
|
||||
|| ($tabInsee['CJ']>=5100 && $tabInsee['CJ']<=5899)
|
||||
|| ($tabInsee['CJ']>=6100 && $tabInsee['CJ']<=6599)
|
||||
|| preg_match('/EIRL/', $nom) || preg_match('/EIRL/', $nom2)
|
||||
|| preg_match('/EIRL/', $tabRet['Sigle'])
|
||||
|| preg_match('/EIRL/', $tabRet['Enseigne'])
|
||||
|| preg_match('/EIRL/', $tabRet['Adresse'])
|
||||
|| preg_match('/EIRL/', $tabRet['Adresse2']) )
|
||||
&& ($tabInsee['CJ']==1700 || // Agents commerciaux (uniquement au Greffes RSAC)
|
||||
$tabRet['numRC']=='' || // Numéro de RCS absent = Anomalie (<à3%)
|
||||
$tabRet['Tribunal']=='' || // Tribunal absent = anomalie
|
||||
str_replace('-', '', $tabRet['dateImmat'])*1==0 || // Pas de date d'immat = anomalie (<à9%)
|
||||
($nbEtab*1 == 0 && str_replace('-', '', $tabRet['dateRad'])*1==0) // Inactif sans date de RAD
|
||||
)
|
||||
) {
|
||||
if ($this->debugtime) {
|
||||
@ -3645,7 +3495,7 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
$iRncs = new Metier_Partenaires_MRncs();
|
||||
|
||||
if ($this->debugtime) {
|
||||
$duree=round(microtime(1)-$tdeb, 3);
|
||||
$duree = round(microtime(1)-$tdeb, 3);
|
||||
file_put_contents(LOG_PATH.'/accesDistant.log', date('YmdHis').";$siren;MGreffes APRES ($duree s)\n", FILE_APPEND);
|
||||
}
|
||||
|
||||
@ -3659,12 +3509,11 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
if (str_replace('-', '', $tabRet['dateImmat'])*1 == 0) {
|
||||
$tabRet['dateImmat'] = $etabG['DateCreation'];
|
||||
}
|
||||
if (str_replace('-', '', $tabRet['dateRad'])*1 == 0) {
|
||||
$tabRet['dateRad'] = $etabG['DateRadiation'];
|
||||
if (str_replace('-', '', $tabRet['dateRad'])*1 > 0 && $tabRet['SituationJuridique'] == '') {
|
||||
$tabRet['SituationJuridique'] = 'RR';
|
||||
}
|
||||
|
||||
if (str_replace('-', '', $tabRet['dateRad'])*1==0) {
|
||||
$tabRet['dateRad'] = $etabG['DateRadiation'];
|
||||
}
|
||||
|
||||
if (preg_match('/[A-Z]/i', substr($tabRet['AutreId'], 2, 2)) || $tabRet['AutreId']=='') {
|
||||
$tabRet['AutreId'] = $etabG['NumRC2'];
|
||||
}
|
||||
@ -3677,9 +3526,6 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
$tabRad = $this->getAnnoncesLegales($siren, 0, 'R');
|
||||
// Il y a au moins une annonce de radiation au Bodacc
|
||||
if (count($tabRad) > 0) {
|
||||
if ($tabRet['SituationJuridique'] == '') {
|
||||
$tabRet['SituationJuridique'] = 'RP';
|
||||
}
|
||||
$dateEff = str_replace('-', '', $tabRad[0]['dateEffet'])*1;
|
||||
$dateJug = str_replace('-', '', $tabRad[0]['dateJugement'])*1;
|
||||
$datePar = str_replace('-', '', $tabRad[0]['DateParution'])*1;
|
||||
@ -3822,15 +3668,84 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
$timer['infosBoursieres'] = microtime(true);
|
||||
}
|
||||
|
||||
// --- Situation Juridique
|
||||
$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);
|
||||
if ($tabRet['numGreffe']*1 > 0) {
|
||||
$detect->setGreffe(1);
|
||||
}
|
||||
$detect->setRcsActif($tabRet['EntActiveRCS']);
|
||||
if (isset($entrep['numRM'])) {
|
||||
$detect->setRM(1);
|
||||
}
|
||||
$detect->setBilanCloture($tabRet['bilanDate']);
|
||||
if (isset($tabRet['dateRad'])) {
|
||||
$detect->setGreffeRadiation($tabRet['dateRad']);
|
||||
}
|
||||
if ($annoncesNb > 0) {
|
||||
// Parcours annonces
|
||||
$tabJugements = array();
|
||||
foreach ($annoncesList as $i => $ann) {
|
||||
$date = str_replace('-','', $ann['dateJugement']);
|
||||
if (intval($date) == 0) {
|
||||
$date = str_replace('-','', $ann['dateParution']);
|
||||
}
|
||||
if (!empty($date)) {
|
||||
$tabJugements[$date] = $ann;
|
||||
}
|
||||
}
|
||||
ksort($tabJugements);
|
||||
foreach ($tabJugements as $ann) {
|
||||
$annFormat = new stdClass();
|
||||
$date = str_replace('-', '', $ann['dateJugement']);
|
||||
if (intval($date) == 0) {
|
||||
$date = str_replace('-','', $ann['dateParution']);
|
||||
}
|
||||
$annFormat->date = $date;
|
||||
$annFormat->code = $ann['evenements'][0]['CodeEven'];
|
||||
$annFormat->txt = $ann['texteAnnonce'];
|
||||
|
||||
$detect->parse($annFormat);
|
||||
$situation = $detect->getSituation();
|
||||
|
||||
// Date de radiation
|
||||
if ($situation == 'RP') {
|
||||
$timeline = $detect->getTimeline();
|
||||
$last = end($timeline);
|
||||
$tabRet['dateRad'] = $last->DateStart;
|
||||
}
|
||||
}
|
||||
}
|
||||
$tabRet['SituationJuridique'] = $situation;
|
||||
// Fin Situation Juridique
|
||||
|
||||
// Date de dernière mise à jour
|
||||
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'] = '';
|
||||
}
|
||||
}
|
||||
$timer['getAnnoncesLegales'] = microtime(true);
|
||||
}
|
||||
|
||||
// Date de dernière mise à jour
|
||||
$lastMaj = str_replace('-', '', $tabRet['DateMajINSEE'])*1;
|
||||
if (str_replace('-', '', $tabRet['DateMajRCS'])*1 > $lastMaj) {
|
||||
$lastMaj = str_replace('-', '', $tabRet['DateMajRCS'])*1;
|
||||
}
|
||||
if (str_replace('-', '', $tabRet['bilanDateMaj'])*1>$lastMaj) {
|
||||
if (str_replace('-', '', $tabRet['bilanDateMaj'])*1 > $lastMaj) {
|
||||
$lastMaj = str_replace('-', '', $tabRet['bilanDateMaj'])*1;
|
||||
}
|
||||
if (str_replace('-', '', $tabRet['dateMajANN'])*1>$lastMaj) {
|
||||
if (str_replace('-', '', $tabRet['dateMajANN'])*1 > $lastMaj) {
|
||||
$lastMaj = str_replace('-', '', $tabRet['dateMajANN'])*1;
|
||||
}
|
||||
$tabRet['dateMajIdentite'] = Metier_Util_Date::dateT('Ymd', 'Y-m-d', $lastMaj);
|
||||
|
8075
library/Metier/Insee/MInsee.php.defaillance
Normal file
8075
library/Metier/Insee/MInsee.php.defaillance
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user