batch/library/Metier/Defaillance/DetectTable.php

336 lines
13 KiB
PHP
Raw Normal View History

2016-07-19 10:37:46 +02:00
<?php
/**
* Liste des situation juridiques
* RR : Radié du registre du commerce et des sociétés
* RP : Radiation publié
* PL : Plan en cours
* P : Procédure collective
* PA : Appel de jugement
* A : Absorbtion
* D : Dissolution
* CL : Cloture
*/
return array(
// --- Départ du plan
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' => 'Situation', 'op' => 'SET', 'value' => 'PL'),
),
),
// -- 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(
'name' => 'PLAN-DUREE-DEFAUT2',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'PlanPeriod', 'op' => 'MIN', 'value'=> 120),
array( 'var' => 'PlanPeriod', 'op' => 'SET', 'value' => 120),
),
),
// --- Period par default pour FJ spécifique
array(
'name' => 'PLAN-DUREE-FJ1',
'value' => 'CONTINUE',
'params' => 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
5631,5632,6532,
6533,6534,6535, // GAEC, GFA, Gpt Agricole Foncier
6597,6598,
)),
array( 'var' => 'PlanPeriod', 'op' => 'SET', 'value' => 180),
),
),
array(
'name' => 'PLAN-DUREE-FJ2',
'value' => 'CONTINUE',
'params' => 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
5631,5632,6532,
6533,6534,6535, // GAEC, GFA, Gpt Agricole Foncier
6597,6598,
)),
array( 'var' => 'PlanPeriod', 'op' => 'SET', 'value' => '180'),
),
),
// --- Elimination du plan
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(
'name' => 'PLAN-APPEL-JUGEMENT',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'PL'),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => array(
// @todo : appel de jugement
)),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'PA'),
),
),
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' => ''),
),
),
// --- Début de procol
array(
'name' => 'PROCOL-START',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'P'),
),
),
// --- Pas de mention de la procol
array(
'name' => 'PROCOL-EFFACEMENT-1',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 1),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
),
),
// --- Ne pas mentionner la procol si CJ=1xxx OU si actif et CJ!=9xxx et even de plus d'un mois
array(
'name' => 'PROCOL-EFFACEMENT-2.1',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
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(
'name' => 'PROCOL-EFFACEMENT-2.2',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
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
array(
'name' => 'PROCOL-EFFACEMENT-3',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
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
array(
'name' => 'PROCOL-EFFACEMENT-4',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 4),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'PA'),
),
),
// --- Procédure trop ancienne plus de 12 ans et actif
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' => ''),
),
),
// --- En Procol mais présence d'une annonce de cloture ou LJ avec Bilan publié ultérieurement
array(
'name' => 'PROCOL-CLOTURE-LJ-BILAN',
'value' => 'CONTINUE',
'params' => 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' => ''),
),
),
// --- En Procol mais présence d'une annonce LJ avec Bilan publié ultérieurement
array(
'name' => 'PROCOL-CLOTURE',
'value' => 'CONTINUE',
'params' => array(
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
array( 'var' => 'FJ', 'op' => 'EGAL' ),
//Si l'evenement procol de départ, précédent est
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(
1502,1503
)),
array( 'var' => 'BilanCloture', 'op' => 'MIN', 'value' => 'DateToday'),
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'CL'),
),
),
// Règle des FJ=1xxx
// --- Cutoff manuel
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' => ''),
),
),
// --- Absorbé
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'),
),
),
// --- Dissolution
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'),
),
),
// --- Dissolution mais bilan après événements
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' => ''),
),
),
// --- Radiation RM
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'),
),
),
// Situation = ''
// NumRM
// InseeActif = 0
// SituationJuridique = RR
// --- Radiation RCS
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'),
),
),
// Situation = ''
// NumGreffe
// InseeActif = 0
// SituationJuridique = RR
// --- Radiation Publié 1
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'),
),
),
// Situation = ''
// EtabActifNb = 0
// Even = ListEvenRadiation
// SituationJuridique = RP
// 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'),
),
),
// Situation = ''
// NumGreffe && InseeActif = 0
// Even = ListEvenRadiation
// SituationJuridique = RP
);