fusion parciel library enrichissement avec library

This commit is contained in:
benoitpotier 2017-04-03 10:44:37 +02:00
parent 0b5d5b4685
commit 7be909c101
3 changed files with 455 additions and 444 deletions

View File

@ -635,13 +635,13 @@ class Metier_Bodacc_MBodacc
{
$result = array();
$sql = "SELECT t.triId, t.triIdSup, i.CodeInsee, t.triCode, t.triType, t.triNom,
t.triCP, LPAD(t.triTel,10,0) AS triTel, LPAD(t.triFax,10,0) AS triFax, t.triWeb,
t.triMail, t.triSiret, t.triAdrNum, t.triAdrIndRep, t.triAdrTypeVoie, t.triAdrVoie,
t.triAdrComp, t.triVille, t.triStatut, t.triDateCessation, t.triCommentaire,
t.triNumGreffe
FROM jo.tribunaux t, jo.tribunauxInsee i
WHERE i.CodeInsee= :inseeCode AND i.triId=t.triId
$sql = "SELECT t.triId, t.triIdSup, i.CodeInsee, t.triCode, t.triType, t.triNom,
t.triCP, LPAD(t.triTel,10,0) AS triTel, LPAD(t.triFax,10,0) AS triFax, t.triWeb,
t.triMail, t.triSiret, t.triAdrNum, t.triAdrIndRep, t.triAdrTypeVoie, t.triAdrVoie,
t.triAdrComp, t.triVille, t.triStatut, t.triDateCessation, t.triCommentaire,
t.triNumGreffe
FROM jo.tribunaux t, jo.tribunauxInsee i
WHERE i.CodeInsee= :inseeCode AND i.triId=t.triId
ORDER BY t.triNumGreffe DESC, t.triId ASC";
$stmtNb = 0;
try {
@ -670,10 +670,10 @@ class Metier_Bodacc_MBodacc
{
$result = array();
$sql = "SELECT t.triId, t.triIdSup, t.triCode, t.triType, t.triNom, t.triCP,
LPAD(t.triTel,10,0) AS triTel, LPAD(t.triFax,10,0) AS triFax, t.triWeb, t.triMail,
t.triSiret, t.triAdrNum, t.triAdrIndRep, t.triAdrTypeVoie, t.triAdrVoie, t.triAdrComp,
t.triVille, t.triStatut, t.triDateCessation, t.triCommentaire, t.triNumGreffe
$sql = "SELECT t.triId, t.triIdSup, t.triCode, t.triType, t.triNom, t.triCP,
LPAD(t.triTel,10,0) AS triTel, LPAD(t.triFax,10,0) AS triFax, t.triWeb, t.triMail,
t.triSiret, t.triAdrNum, t.triAdrIndRep, t.triAdrTypeVoie, t.triAdrVoie, t.triAdrComp,
t.triVille, t.triStatut, t.triDateCessation, t.triCommentaire, t.triNumGreffe
FROM jo.tribunaux t WHERE t.triCP BETWEEN :dep1 AND :dep2 ORDER BY t.triType ASC";
$stmtNb = 0;
try {
@ -1226,7 +1226,7 @@ class Metier_Bodacc_MBodacc
continue;
}
try {
$stmt = $this->conn->query("SELECT prenom, genre, mixte, nbTot FROM npaipp.pp_prenoms
$stmt = $this->conn->query("SELECT prenom, genre, mixte, nbTot FROM npaipp.pp_prenoms
WHERE prenom='".addslashes($prenom)."' AND nbTot>100 ORDER BY nbTot DESC");
} catch (\Doctrine\DBAL\DBALException $e) {
continue;
@ -1268,7 +1268,7 @@ class Metier_Bodacc_MBodacc
{
$result = array();
$sql = "SELECT Bodacc_Code, Bodacc_Annee_Parution, Bodacc_Num, Num_Annonce, Tribunal_Dept, Tribunal_Code, Rubrique_Bodacc, length(annonce) as Long
$sql = "SELECT Bodacc_Code, Bodacc_Annee_Parution, Bodacc_Num, Num_Annonce, Tribunal_Dept, Tribunal_Code, Rubrique_Bodacc, length(annonce) as Long
FROM jo.bodacc WHERE Bodacc_Code=:code AND Bodacc_Annee_Parution=:annee AND Bodacc_Num=:num";
$stmtNb = 0;
try {
@ -1368,7 +1368,7 @@ class Metier_Bodacc_MBodacc
{
$result = array();
$sql = "SELECT id, dep, nomJal, siteWeb, email, adresse, cp, ville, tel, fax, parution, aboAnnuel, infos
$sql = "SELECT id, dep, nomJal, siteWeb, email, adresse, cp, ville, tel, fax, parution, aboAnnuel, infos
FROM jo.tabJAL WHERE dep = :dep";
$stmtNb = 0;
try {
@ -1464,9 +1464,9 @@ class Metier_Bodacc_MBodacc
}
}
} elseif ($activite == '' && ($fj < 7000 || $fj > 7999)) {
$sql = "SELECT 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
FROM historiques.entrep e, historiques.texte x
WHERE e.E1GSIR=:siren AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231 AND x.annonceTxt LIKE '%ctivit%'
$sql = "SELECT 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
FROM historiques.entrep e, historiques.texte x
WHERE e.E1GSIR=:siren AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231 AND x.annonceTxt LIKE '%ctivit%'
GROUP BY e.ANBASE ORDER BY e.DATE DESC";
$stmtNb = 0;
try {
@ -1508,6 +1508,6 @@ class Metier_Bodacc_MBodacc
$tabCjBodacc = include 'Metier/Bodacc/BodaccCJ.php';
$strFJ = strtoupper(trim(preg_replace('/[^a-z]/i', '', $strFJ)));
return $tabCjBodacc[$strFJ];
return isset($tabCjBodacc[$strFJ])?$tabCjBodacc[$strFJ]:'';
}
}

View File

@ -1482,7 +1482,7 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
'Capital' => $etab['capital'],
'CapitalDev' => $etab['capitalDev'],
'TrancheCA' => $etab['tca'],
'TrancheCALib' => self::$tabTCA[$etab['tca']],
'TrancheCALib' => isset(self::$tabTCA[$etab['tca']])?self::$tabTCA[$etab['tca']]:null,
'EffEnTr' => $etab['teff_entrep'],
'EffEnTrLib' => self::$tabEffectif[$etab['teff_entrep']],
'EffEtTr' => $etab['teff_etab'],
@ -5591,459 +5591,460 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
try {
$stmt = $this->conn->executeQuery($sql);
} catch (\Doctrine\DBAL\DBALException $e) {
if ($this->logger !== null) {
$this->logger->error($e->getMessage());
}
}
// --- Traitement des resultats
if ($stmt->rowCount() > 0) {
// --- Identite Light de l'entité
if ($this->Identite === null) {
$this->Identite = $this->getIdentiteLight($siren);
}
// --- Parcours des annonces
while ($ann = $stmt->fetch(\PDO::FETCH_ASSOC)) {
// --- Formatage bodacc
if ($ann['SourceTable'] == 'bodacc') {
$tabEven = explode(';', $ann['typeEven']);
$tabRetEven = array();
// --- Annonce rubrique insertion
if ($ann['typeAnnonce']!='Insertion') {
// --- Sélection des événements
// --- Traitement des resultats
if ($stmt->rowCount() > 0) {
// --- Identite Light de l'entité
if ($this->Identite === null) {
$this->Identite = $this->getIdentiteLight($siren);
}
// --- Parcours des annonces
while ($ann = $stmt->fetch(\PDO::FETCH_ASSOC)) {
// --- Formatage bodacc
if ($ann['SourceTable'] == 'bodacc') {
$tabEven = explode(';', $ann['typeEven']);
$tabRetEven = array();
// --- Annonce rubrique insertion
if ($ann['typeAnnonce']!='Insertion') {
// --- Sélection des événements
foreach ($tabEven as $even) {
if (intval($even) != 0) {
$tabRetEven[] = array(
'CodeEven' => $even,
'LibEven' => $this->iBodacc->getEvenement($even)
);
}
}
// Libellé générique
$tabRetEven[] = array(
'CodeEven' => '0000',
'LibEven' => $ann['typeAnnonce']." de l'annonce du ".
Metier_Util_Date::dateT('Y-m-d', 'd/m/Y', $ann['corrBodacc_Date_Parution'])
);
}
// --- Annonce autre rubrique
else {
if (trim($ann['typeEven'])!='') {
foreach ($tabEven as $even) {
if (intval($even) != 0) {
$tabRetEven[] = array(
'CodeEven' => $even,
'LibEven' => $this->iBodacc->getEvenement($even)
'CodeEven' => $even,
'LibEven' => $this->iBodacc->getEvenement($even)
);
}
}
// Libellé générique
// --- Detection plan
if ($this->AnnoncesLegalesVisu === false) {
$this->getAnnoncesLegalesPlan('bodacc', $this->Identite['FJ'], $ann);
}
} else {
switch ($ann['Rubrique']) {
case 'mmd': $codeEven='2313'; $libEven = "Modification(s) diverse(s)"; break;
case 'comptes': $codeEven='3999'; $libEven = "Dépôt des comptes"; break;
case 'creations': $codeEven='4999'; $libEven = "Création d'entreprise"; break;
case 'procol': $codeEven='1999'; $libEven = "Procédure collective"; break;
case 'radiations': $codeEven='6700'; $libEven = "Radiation"; break;
case 'ventes': $codeEven='5999'; $libEven = "Vente/Cession"; break;
default: $codeEven='0000'; $libEven = $ann['Rubrique']; break;
}
$tabRetEven[] = array(
'CodeEven' => '0000',
'LibEven' => $ann['typeAnnonce']." de l'annonce du ".
Metier_Util_Date::dateT('Y-m-d', 'd/m/Y', $ann['corrBodacc_Date_Parution'])
'CodeEven' => $codeEven,
'LibEven' => $libEven
);
}
// --- Annonce autre rubrique
else {
if (trim($ann['typeEven'])!='') {
foreach ($tabEven as $even) {
if (intval($even) != 0) {
$tabRetEven[] = array(
'CodeEven' => $even,
'LibEven' => $this->iBodacc->getEvenement($even)
);
}
}
// --- Detection plan
if ($this->AnnoncesLegalesVisu === false) {
$this->getAnnoncesLegalesPlan('bodacc', $this->Identite['FJ'], $ann);
}
} else {
switch ($ann['Rubrique']) {
case 'mmd': $codeEven='2313'; $libEven = "Modification(s) diverse(s)"; break;
case 'comptes': $codeEven='3999'; $libEven = "Dépôt des comptes"; break;
case 'creations': $codeEven='4999'; $libEven = "Création d'entreprise"; break;
case 'procol': $codeEven='1999'; $libEven = "Procédure collective"; break;
case 'radiations': $codeEven='6700'; $libEven = "Radiation"; break;
case 'ventes': $codeEven='5999'; $libEven = "Vente/Cession"; break;
default: $codeEven='0000'; $libEven = $ann['Rubrique']; break;
}
$tabRetEven[] = array(
'CodeEven' => $codeEven,
'LibEven' => $libEven
);
}
}
$dateCes = str_replace('-', '', $ann['dateCessationActivite'])*1;
$dateDeb = str_replace('-', '', $ann['dateDebutActivite'])*1;
$dateEff = str_replace('-', '', $ann['dateEffet'])*1;
if ($dateCes > 0) {
$dateEffet = $ann['dateCessationActivite'];
} elseif ($dateDeb > 0) {
$dateEffet = $ann['dateDebutActivite'];
} else {
$dateEffet = $ann['dateEffet'];
}
$adresseAnn = trim(preg_replace('/ +/', ' ', $ann['adresseSiege'].' '.$ann['codePostalSiege'].' '.$ann['villeSiege']));
if (strlen($adresse) <8) {
$adresseAnn = trim(preg_replace('/ +/', ' ', $ann['adresse'].' '.$ann['codePostal'].' '.$ann['ville']));
}
// --- Retour bodacc
$retFormat = array(
'id' => $ann['id'],
'BodaccCode' => 'BOD'.$ann['Bodacc_Code'],
'BodaccNum' => $ann['Bodacc_Num'],
'NumAnnonce' => $ann['Num_Annonce'],
'DateParution' => $ann['Bodacc_Date_Parution'],
'Departement' => $ann['Tribunal_Dept'],
'Tribunal' => $ann['triNom'],
'TribunalCode' => $ann['triCode'],
'TribunalSiret' => $ann['triSiret'],
'Rubrique' => $ann['Rubrique'],
'typeAnnonce' => $ann['typeAnnonce'],
'texteRectificatif' => $ann['corrTexteRectificatif'],
'dateEffet' => $dateEffet,
'dateJugement' => $ann['dateJugement'],
'dateFin' => $ann['dateFinObservation'],
'montantVente' => trim($ann['VenteMt'].' '.$ann['VenteDev']),
'libFJ' => $ann['FJ'],
'codFJ' => $this->iBodacc->getCodeFormeJur($ann['FJ']),
'capital' => $ann['Capital'],
'capitalDev' => $ann['CapitalDev'],
'raisonSociale' => $ann['raisonSociale'],
'nomCommercial' => $ann['nomCommercial'],
'sigle' => $ann['sigle'],
'adresse' => $adresseAnn,
'dateInsertionSD' => $ann['dateInsert'],
'evenements' => $tabRetEven,
'complement' => $ann['complement'],
'deleted' => $ann['deleted'],
'texteAnnonce' => $ann['annonce'],
);
$tabRet[] = $retFormat;
}
// --- Formattage Histo
elseif ($ann['SourceTable'] == 'histo') {
if ($ann['JAL']==1) {
$Bodacc_Code='BODA';
} elseif ($ann['JAL']==200) {
$Bodacc_Code='BODB';
}
// 4xxx
if ($ann['CODEVE']<20) {
$rub='creations';
}
// 5xxx
elseif ($ann['CODEVE']<=25) {
$rub='ventes';
}
// 2xxx
elseif ($ann['CODEVE']<40) {
$rub='mmd';
}
// 6xxx
elseif ($ann['CODEVE']<42) {
$rub='radiations';
}
// 2xxx
elseif ($ann['CODEVE']<50) {
$rub='mmd';
}
// 1xxx
elseif ($ann['CODEVE']<80) {
$rub='procol';
}
$tabEvens = array();
$newCodeEven = $this->HistoEvenConvert[$ann['CODEVE']];
if ($newCodeEven*1 == 2318) {
$tabNewEven = explode(';', $this->HistoRoleConvert[$ann['ROLE']]);
if (count($tabNewEven) > 0) {
foreach ($tabNewEven as $newCodeEven) {
$tabEvens[] = array(
'CodeEven' => $newCodeEven,
'LibEven' => $this->iBodacc->getEvenement($newCodeEven));
}
} else {
$dateCes = str_replace('-', '', $ann['dateCessationActivite'])*1;
$dateDeb = str_replace('-', '', $ann['dateDebutActivite'])*1;
$dateEff = str_replace('-', '', $ann['dateEffet'])*1;
if ($dateCes > 0) {
$dateEffet = $ann['dateCessationActivite'];
} elseif ($dateDeb > 0) {
$dateEffet = $ann['dateDebutActivite'];
} else {
$dateEffet = $ann['dateEffet'];
}
$adresseAnn = trim(preg_replace('/ +/', ' ', $ann['adresseSiege'].' '.$ann['codePostalSiege'].' '.$ann['villeSiege']));
if (strlen($adresse) <8) {
$adresseAnn = trim(preg_replace('/ +/', ' ', $ann['adresse'].' '.$ann['codePostal'].' '.$ann['ville']));
}
// --- Retour bodacc
$retFormat = array(
'id' => $ann['id'],
'BodaccCode' => 'BOD'.$ann['Bodacc_Code'],
'BodaccNum' => $ann['Bodacc_Num'],
'NumAnnonce' => $ann['Num_Annonce'],
'DateParution' => $ann['Bodacc_Date_Parution'],
'Departement' => $ann['Tribunal_Dept'],
'Tribunal' => $ann['triNom'],
'TribunalCode' => $ann['triCode'],
'TribunalSiret' => $ann['triSiret'],
'Rubrique' => $ann['Rubrique'],
'typeAnnonce' => $ann['typeAnnonce'],
'texteRectificatif' => $ann['corrTexteRectificatif'],
'dateEffet' => $dateEffet,
'dateJugement' => $ann['dateJugement'],
'dateFin' => $ann['dateFinObservation'],
'montantVente' => trim($ann['VenteMt'].' '.$ann['VenteDev']),
'libFJ' => $ann['FJ'],
'codFJ' => $this->iBodacc->getCodeFormeJur($ann['FJ']),
'capital' => $ann['Capital'],
'capitalDev' => $ann['CapitalDev'],
'raisonSociale' => $ann['raisonSociale'],
'nomCommercial' => $ann['nomCommercial'],
'sigle' => $ann['sigle'],
'adresse' => $adresseAnn,
'dateInsertionSD' => $ann['dateInsert'],
'evenements' => $tabRetEven,
'complement' => $ann['complement'],
'deleted' => $ann['deleted'],
'texteAnnonce' => $ann['annonce'],
);
$tabRet[] = $retFormat;
}
// --- Formattage Histo
elseif ($ann['SourceTable'] == 'histo') {
if ($ann['JAL']==1) {
$Bodacc_Code='BODA';
} elseif ($ann['JAL']==200) {
$Bodacc_Code='BODB';
}
// 4xxx
if ($ann['CODEVE']<20) {
$rub='creations';
}
// 5xxx
elseif ($ann['CODEVE']<=25) {
$rub='ventes';
}
// 2xxx
elseif ($ann['CODEVE']<40) {
$rub='mmd';
}
// 6xxx
elseif ($ann['CODEVE']<42) {
$rub='radiations';
}
// 2xxx
elseif ($ann['CODEVE']<50) {
$rub='mmd';
}
// 1xxx
elseif ($ann['CODEVE']<80) {
$rub='procol';
}
$tabEvens = array();
$newCodeEven = $this->HistoEvenConvert[$ann['CODEVE']];
if ($newCodeEven*1 == 2318) {
$tabNewEven = explode(';', $this->HistoRoleConvert[$ann['ROLE']]);
if (count($tabNewEven) > 0) {
foreach ($tabNewEven as $newCodeEven) {
$tabEvens[] = array(
'CodeEven' => $newCodeEven,
'LibEven' => $this->iBodacc->getEvenement($newCodeEven)
);
'LibEven' => $this->iBodacc->getEvenement($newCodeEven));
}
} else {
$tabEvens[] = array(
'CodeEven' => $newCodeEven,
'LibEven' => $this->iBodacc->getEvenement($newCodeEven)
);
// --- Detection plan
if ($this->AnnoncesLegalesVisu === false) {
$this->getAnnoncesLegalesPlan('histo', $this->Identite['FJ'], $ann);
}
}
// Recherche du capital et de la FJ dans le texte histo
if (($ann['CODEVE']>=10 && $ann['CODEVE']<20)
|| ($ann['CODEVE']>=30 && $ann['CODEVE']<42)
|| ($ann['CODEVE']>=51 && $ann['CODEVE']<80)) {
// Recherche du capital
if (preg_match('/Capital(?:.|)\:(.*)(eur.|f|livre)/Uis', $ann['annonceTxt'], $matches)) {
$capital=trim(strtr($matches[1], array(' '=>'', ',00 '=>'', '.00 '=>'')))*1;
if (substr(strtoupper($matches[2]), 0, 3)=='EUR') {
$capitalDev = 'EUR';
} elseif (substr(strtoupper($matches[2]), 0, 3)=='LIV') {
$capitalDev = 'GBP';
} else {
$capitalDev = 'FRF';
}
} else {
$capital=$capitalDev='';
}
// Recherche de la forme juridique
if (preg_match('/Forme(?:.|)\:(.*)(Capital|Adresse|Activit.|Administration|Commentaire)(?:.|)\:/Uisu', $ann['annonceTxt'], $matches)) {
$libFJ = trim($matches[1]);
}
}
// --- Retour histo
$retFormat = array(
'id' => -$ann['ANBASE'],
'BodaccCode' => $Bodacc_Code,
'BodaccNum' => $ann['NOBOD'],
'NumAnnonce' => $ann['NOANN'],
'DateParution' => substr($ann['DATE'], 0, 4).'-'.substr($ann['DATE'], 4, 2).'-'.substr($ann['DATE'], 6, 2),
'Departement' => $ann['DEPT'],
'Tribunal' => $this->iBodacc->getTribunalNom($ann['CODTRI']), //$ann['triNom'],
'TribunalSiret' => $this->iBodacc->getTribunalSiret($ann['CODTRI']),//$ann['triSiret'],
'Rubrique' => $rub,
'typeAnnonce' => 'Insertion',
'dateEffet' => substr($ann['DATE'], 0, 4).'-'.substr($ann['DATE'], 4, 2).'-'.substr($ann['DATE'], 6, 2),
'dateJugement' => substr($ann['DATE'], 0, 4).'-'.substr($ann['DATE'], 4, 2).'-'.substr($ann['DATE'], 6, 2),
'dateFin' => '',
'montantVente' => '',
'libFJ' => $libFJ,
'codFJ' => $this->iBodacc->getCodeFormeJur($libFJ),
'capital' => $capital,
'capitalDev' => $capitalDev,
'raisonSociale' => '',//$ann['raisonSociale'],
'nomCommercial' => '',//$ann['nomCommercial'],
'sigle' => '',//$ann['sigle'],
'adresse' => '',//$adresseAnn,
'dateInsertionSD' => '',
'evenements' => $tabEvens,
'texteAnnonce' => $ann['NOANN'].' - '.$ann['annonceTxt'],
);
$tabRet[] = $retFormat;
}
// --- Formattage Annonce
elseif ($ann['SourceTable'] == 'annonce') {
$rubriqueRet = '';
$tabInter = array(
'A' => 'Administrateur judiciaire',
'M' => 'Mandataire judiciaire',
'H' => 'Huissier',
'L' => 'Liquidateur',
'R' => 'Représentant des Créanciers',
'O' => 'Opposition',
'U' => 'Curateur',
'C' => 'Commissaire au plan',
'S' => 'Syndic',
'D' => 'Commissaire au concordat',
'T' => 'Conciliateur',
'V' => 'Avocat',
'N' => 'Notaire',
'J' => 'Juge Commissaire',
'K' => 'Juge Commissaire Suppléant',
} else {
$tabEvens[] = array(
'CodeEven' => $newCodeEven,
'LibEven' => $this->iBodacc->getEvenement($newCodeEven)
);
$dept = substr($ann['triCP'], 0, 2)*1;
$depotComptes = false;
if ($dept==97) {
$dept = substr($ann['triCP'], 0, 3)*1;
// --- Detection plan
if ($this->AnnoncesLegalesVisu === false) {
$this->getAnnoncesLegalesPlan('histo', $this->Identite['FJ'], $ann);
}
$adresse='';
/** Ajout des informations identitaires pour les annonces collecte avant Décembre 2008 **/
if (trim($ann['raisonSociale'])=='' || trim($ann['adresse'])==''
|| trim($ann['codePostal'])=='' || trim($ann['ville'])=='') {
$ann['raisonSociale'] = $this->Identite['Nom'];
$ann['adresse'] = $this->Identite['Adresse'];
$ann['codePostal'] = $this->Identite['CP'];
$ann['ville'] = $this->Identite['Ville'];
}
$adresse.= ucfirst(strtolower($ann['adresse'])).', ';
$adresse = trim(preg_replace('/^0+/', '', preg_replace('/ +/', ' ', $adresse)));
if (preg_match('/(3100|3200|3300|3999)/', $ann['typeEven'].';'.$ann['strEven'])) {
$depotComptes = true;
$strRCS = 'Siren : '. $ann['siren'] . '. ';
}
// Recherche du capital et de la FJ dans le texte histo
if (($ann['CODEVE']>=10 && $ann['CODEVE']<20)
|| ($ann['CODEVE']>=30 && $ann['CODEVE']<42)
|| ($ann['CODEVE']>=51 && $ann['CODEVE']<80)) {
// Recherche du capital
if (preg_match('/Capital(?:.|)\:(.*)(eur.|f|livre)/Uis', $ann['annonceTxt'], $matches)) {
$capital=trim(strtr($matches[1], array(' '=>'', ',00 '=>'', '.00 '=>'')))*1;
if (substr(strtoupper($matches[2]), 0, 3)=='EUR') {
$capitalDev = 'EUR';
} elseif (substr(strtoupper($matches[2]), 0, 3)=='LIV') {
$capitalDev = 'GBP';
} else {
$capitalDev = 'FRF';
}
} else {
$strRCS = $ann['siren'] . ' RCS '. ucfirst(strtolower(strtr($ann['triNom'], array('TGIcc '=>'', 'TGI '=>'', 'TC '=>'', 'TI '=>'', )))).'. ';
$capital=$capitalDev='';
}
// Recherche de la forme juridique
if (preg_match('/Forme(?:.|)\:(.*)(Capital|Adresse|Activit.|Administration|Commentaire)(?:.|)\:/Uisu', $ann['annonceTxt'], $matches)) {
$libFJ = trim($matches[1]);
}
$texteAnnonce = 'Date : '.strtolower(Metier_Util_Date::dateT('Y-m-d', 'd M Y', $ann['dateJugement'])).'. '.
$this->iBodacc->getEvenement($ann['typeEven']).'. '.
$strRCS . trim($ann['raisonSociale']).'. Adresse : '.
$adresse.' '.$ann['codePostal'].' '.$ann['ville'].'. ';
if (trim($ann['numero']) != '') {
$texteAnnonce.='Jugement Numéro : '.trim($ann['numero']).'. ';
}
if ($ann['dateCessationPaiement']*1 != 0) {
$texteAnnonce.='Cessation des paiements le '.strtolower(Metier_Util_Date::dateT('Y-m-d', 'd M Y', $ann['dateCessationPaiement'])).'. ';
}
for ($mandNum = 1; $mandNum < 5; $mandNum++) {
if (trim($ann['inter'.$mandNum.'type']) != ''
&& ($ann['inter'.$mandNum.'id']>0 || trim($ann['inter'.$mandNum.'nom']) != '')) {
$texteAnnonce.= $tabInter[$ann['inter'.$mandNum.'type']].' : '.$ann['inter'.$mandNum.'nom'];
if ($ann['inter'.$mandNum.'id'] != 0) {
$mandStmt = $this->conn->executeQuery(
"SELECT sirenGrp, sirenMand, tel, fax, email
FROM jo.tabMandataires WHERE id=".$ann['inter'.$mandNum.'id']);
$mand = $mandStmt->fetch(\PDO::FETCH_ASSOC);
if ($mand['sirenGrp'] != 0) {
$texteAnnonce.= ', Siren SCP '.$mand['sirenGrp'];
}
if ($mand['sirenMand'] != 0) {
$texteAnnonce.= ', Siren '.$mand['sirenMand'];
}
if ($mand['tel'] != '') {
$texteAnnonce.= ', Telephone '.$mand['tel'];
}
if ($mand['fax'] != '') {
$texteAnnonce.= ', Telecopie '.$mand['fax'];
}
if ($mand['email'] != '') {
$texteAnnonce.= ', E-mail : '.$mand['email'];
}
}
$texteAnnonce.= '. ';
}
}
if (trim($ann['nouvActivite']) != '') {
$texteAnnonce.= ' Activité : '.trim($ann['nouvActivite']).'. ';
}
if (trim($ann['nouvDir']) != '') {
$texteAnnonce.= ' Administration : '.trim($ann['nouvDir']).'. ';
}
if (trim($ann['nouvAdr']) != '') {
$texteAnnonce.= ' Nouvelle adresse : '.trim($ann['nouvAdr']).'. ';
}
if ($ann['nouvFJ']*1 > 0) {
$texteAnnonce.= ' Transformation de la société en '.$this->getLibelleFJ($ann['nouvFJ']).'. ';
}
if ($ann['dateEffetFinP']*1 != '') {
if ($depotComptes) {
$texteAnnonce.= ' Comptes annuels et rapports de l\'exercice clos le : '.
strtolower(Metier_Util_Date::dateT('Y-m-d', 'd M Y', $ann['dateEffetFinP'])).'. ';
} else {
$texteAnnonce.= ' Date d\'effet : '.
strtolower(Metier_Util_Date::dateT('Y-m-d', 'd M Y', $ann['dateEffetFinP'])).'. ';
}
}
if (trim($ann['complement']) != '') {
$texteAnnonce.= ' Observations : '.trim($ann['complement']).'.';
}
$tabRetEven = array();
$tabRetEven[] = array(
'CodeEven' => $ann['typeEven'],
'LibEven' => $this->iBodacc->getEvenement($ann['typeEven'])
);
if ($ann['typeEven']==2102 || $ann['typeEven']==2100) {
$capital = true;
} else {
$capital = false;
}
if (trim($ann['strEven']) != '') {
$tabEven = explode(';', $ann['strEven']);
foreach ($tabEven as $even) {
$tabRetEven[] = array(
'CodeEven' => $even,
'LibEven' => $this->iBodacc->getEvenement($even)
);
if ($even>=1000 && $even<2000) {
$rubriqueRet = 'procol';
} elseif ($even>=2000 && $even<3000) {
$rubriqueRet='mmd';
} elseif ($even>=3000 && $even<4000) {
$rubriqueRet = 'comptes';
} elseif ($even>=4000 && $even<5000) {
$rubriqueRet = 'creations';
} elseif ($even>=5000 && $even<6000) {
$rubriqueRet = 'ventes';
} elseif ($even>=6000 && $even<7000) {
$rubriqueRet = 'radiations';
}
if ($even==2102 || $even==2100) {
$capital = true;
}
}
}
// --- Detection plan
if ($this->AnnoncesLegalesVisu === false) {
$this->getAnnoncesLegalesPlan('annonce', $this->Identite['FJ'], $ann);
}
$strVente='';
$nouvCapital='';
if ($ann['montant']>0) {
if ($capital) {
$nouvCapital=$ann['montant'];
$texteAnnonce.=' Nouveau capital : '.trim($ann['montant']). ' euros';
if ($ann['actionsNb']>0) {
$texteAnnonce.=' divisé en '.$ann['actionsNb'].' actions de '. round($ann['montant']/$ann['actionsNb']). ' euros';
}
} elseif (!preg_match('/ pour un montant de /Uis', $ann['complement'])) {
$texteAnnonce.=' Montant : '.trim($ann['montant']). ' euros';
$strVente=trim($ann['montant']). ' EUR';
}
$texteAnnonce.='. ';
}
// On ne prend l'annonce saisie directement que si elle est plus volumineuse
if (trim($ann['annonce']) != '' && strlen(trim($ann['annonce']))>strlen($texteAnnonce)) {
$texteAnnonce=trim($ann['annonce']);
}
$texteAnnonce = preg_replace('/ +/', ' ', strtr($texteAnnonce, array('*'=>' ', '/'=>' ', '..'=>'.')));
if (str_replace('-', '', $ann['dateSource'])*1 != 0) {
$dateParution = $ann['dateSource'];
} else {
$dateParution = $ann['dateInsert'];
}
$retFormat = array(
'id' => '0.'.$ann['id'],
'BodaccCode' => $ann['source'].'-'.$ann['parutionIdJal'],
'BodaccNum' => $ann['parutionNum'],
'NumAnnonce' => 0,
'DateParution' => $dateParution,
'Departement' => $dept,
'Tribunal' => $ann['triNom'],
'TribunalSiret' => $ann['triSiret'],
'Rubrique' => $rubriqueRet,
'typeAnnonce' => 'insertion',
'dateEffet' => $ann['dateCessationPaiement'],
'dateJugement' => $ann['dateJugement'],
'dateFin' => $ann['dateEffetFinP'],
'montantVente' => $strVente,
'libFJ' => $ann['nouvFJ'],
'codFJ' => $this->iBodacc->getCodeFormeJur($ann['nouvFJ']),
'capital' => $nouvCapital,
'capitalDev' => 'EUR',
'raisonSociale' => $ann['raisonSociale'],
'nomCommercial' => '',
'sigle' => '',
'adresse' => $ann['nouvAdr'],
'dateInsertionSD' => $ann['dateInsert'],
'evenements' => $tabRetEven,
'texteAnnonce' => $texteAnnonce,
'complement' => $ann['complement'],
);
if ($depotComptes) {
$retFormat['dateEffet'] = $ann['dateEffetFinP'];
}
$tabRet[] = $retFormat;
}
} // --- Fin du parcours des annonces
// --- Effacement procol
if ($this->AnnoncesLegalesVisu === false) {
if ($this->getAnnoncesLegalesEffacement($siren, $rubrique, $tabRet) === true) {
return array();
}
// --- Retour histo
$retFormat = array(
'id' => -$ann['ANBASE'],
'BodaccCode' => $Bodacc_Code,
'BodaccNum' => $ann['NOBOD'],
'NumAnnonce' => $ann['NOANN'],
'DateParution' => substr($ann['DATE'], 0, 4).'-'.substr($ann['DATE'], 4, 2).'-'.substr($ann['DATE'], 6, 2),
'Departement' => $ann['DEPT'],
'Tribunal' => $this->iBodacc->getTribunalNom($ann['CODTRI']), //$ann['triNom'],
'TribunalSiret' => $this->iBodacc->getTribunalSiret($ann['CODTRI']),//$ann['triSiret'],
'Rubrique' => $rub,
'typeAnnonce' => 'Insertion',
'dateEffet' => substr($ann['DATE'], 0, 4).'-'.substr($ann['DATE'], 4, 2).'-'.substr($ann['DATE'], 6, 2),
'dateJugement' => substr($ann['DATE'], 0, 4).'-'.substr($ann['DATE'], 4, 2).'-'.substr($ann['DATE'], 6, 2),
'dateFin' => '',
'montantVente' => '',
'libFJ' => $libFJ,
'codFJ' => $this->iBodacc->getCodeFormeJur($libFJ),
'capital' => $capital,
'capitalDev' => $capitalDev,
'raisonSociale' => '',//$ann['raisonSociale'],
'nomCommercial' => '',//$ann['nomCommercial'],
'sigle' => '',//$ann['sigle'],
'adresse' => '',//$adresseAnn,
'dateInsertionSD' => '',
'evenements' => $tabEvens,
'texteAnnonce' => $ann['NOANN'].' - '.$ann['annonceTxt'],
);
$tabRet[] = $retFormat;
}
// --- Formattage Annonce
elseif ($ann['SourceTable'] == 'annonce') {
$rubriqueRet = '';
$tabInter = array(
'A' => 'Administrateur judiciaire',
'M' => 'Mandataire judiciaire',
'H' => 'Huissier',
'L' => 'Liquidateur',
'R' => 'Représentant des Créanciers',
'O' => 'Opposition',
'U' => 'Curateur',
'C' => 'Commissaire au plan',
'S' => 'Syndic',
'D' => 'Commissaire au concordat',
'T' => 'Conciliateur',
'V' => 'Avocat',
'N' => 'Notaire',
'J' => 'Juge Commissaire',
'K' => 'Juge Commissaire Suppléant',
);
$dept = substr($ann['triCP'], 0, 2)*1;
$depotComptes = false;
if ($dept==97) {
$dept = substr($ann['triCP'], 0, 3)*1;
}
$adresse='';
/** Ajout des informations identitaires pour les annonces collecte avant Décembre 2008 **/
if (trim($ann['raisonSociale'])=='' || trim($ann['adresse'])==''
|| trim($ann['codePostal'])=='' || trim($ann['ville'])=='') {
$ann['raisonSociale'] = $this->Identite['Nom'];
$ann['adresse'] = $this->Identite['Adresse'];
$ann['codePostal'] = $this->Identite['CP'];
$ann['ville'] = $this->Identite['Ville'];
}
$adresse.=ucfirst(strtolower($ann['adresse'])).', ';
$adresse=trim(preg_replace('/^0+/', '', preg_replace('/ +/', ' ', $adresse)));
if(!isset($ann['siren'])){$ann['siren']=null;}
if(!isset($ann['triNom'])){$ann['triNom']=null;}
if (preg_match('/(3100|3200|3300|3999)/', $ann['typeEven'].';'.$ann['strEven'])) {
$depotComptes = true;
$strRCS = 'Siren : '. $ann['siren'] . '. ';
} else {
$strRCS = $ann['siren'] . ' RCS '. ucfirst(strtolower(strtr($ann['triNom'], array('TGIcc '=>'', 'TGI '=>'', 'TC '=>'', 'TI '=>'', )))).'. ';
}
$texteAnnonce = 'Date : '.strtolower(Metier_Util_Date::dateT('Y-m-d', 'd M Y', $ann['dateJugement'])) .'. '. $this->iBodacc->getEvenement($ann['typeEven']).'. '.
$strRCS . trim($ann['raisonSociale']). '. Adresse : '. $adresse.' '.$ann['codePostal'].' '.$ann['ville'].'. ';
if (trim($ann['numero']) != '') {
$texteAnnonce.='Jugement Numéro : '.trim($ann['numero']).'. ';
}
if ($ann['dateCessationPaiement']*1 != 0) {
$texteAnnonce.='Cessation des paiements le '.strtolower(Metier_Util_Date::dateT('Y-m-d', 'd M Y', $ann['dateCessationPaiement'])).'. ';
}
for ($mandNum = 1; $mandNum < 5; $mandNum++) {
if (trim($ann['inter'.$mandNum.'type']) != ''
&& ($ann['inter'.$mandNum.'id']>0 || trim($ann['inter'.$mandNum.'nom']) != '')) {
$texteAnnonce.= $tabInter[$ann['inter'.$mandNum.'type']].' : '.$ann['inter'.$mandNum.'nom'];
if ($ann['inter'.$mandNum.'id'] != 0) {
$mandStmt = $this->conn->executeQuery("SELECT sirenGrp, sirenMand,
tel, fax, email FROM jo.tabMandataires
WHERE id=".$ann['inter'.$mandNum.'id']);
$mand = $mandStmt->fetch(\PDO::FETCH_ASSOC);
if ($mand['sirenGrp'] != 0) {
$texteAnnonce.= ', Siren SCP '.$mand['sirenGrp'];
}
if ($mand['sirenMand'] != 0) {
$texteAnnonce.= ', Siren '.$mand['sirenMand'];
}
if ($mand['tel'] != '') {
$texteAnnonce.= ', Telephone '.$mand['tel'];
}
if ($mand['fax'] != '') {
$texteAnnonce.= ', Telecopie '.$mand['fax'];
}
if ($mand['email'] != '') {
$texteAnnonce.= ', E-mail : '.$mand['email'];
}
}
$texteAnnonce.= '. ';
}
}
if (trim($ann['nouvActivite']) != '') {
$texteAnnonce.= ' Activité : '.trim($ann['nouvActivite']).'. ';
}
if (trim($ann['nouvDir']) != '') {
$texteAnnonce.= ' Administration : '.trim($ann['nouvDir']).'. ';
}
if (trim($ann['nouvAdr']) != '') {
$texteAnnonce.= ' Nouvelle adresse : '.trim($ann['nouvAdr']).'. ';
}
if ($ann['nouvFJ']*1 > 0) {
$texteAnnonce.= ' Transformation de la société en '.$this->getLibelleFJ($ann['nouvFJ']).'. ';
}
if ($ann['dateEffetFinP']*1 != '') {
if ($depotComptes) {
$texteAnnonce.= ' Comptes annuels et rapports de l\'exercice clos le : '.
strtolower(Metier_Util_Date::dateT('Y-m-d', 'd M Y', $ann['dateEffetFinP'])).'. ';
} else {
$texteAnnonce.= ' Date d\'effet : '.
strtolower(Metier_Util_Date::dateT('Y-m-d', 'd M Y', $ann['dateEffetFinP'])).'. ';
}
}
if (trim($ann['complement']) != '') {
$texteAnnonce.= ' Observations : '.trim($ann['complement']).'.';
}
$tabRetEven = array();
$tabRetEven[] = array(
'CodeEven' => $ann['typeEven'],
'LibEven' => $this->iBodacc->getEvenement($ann['typeEven'])
);
if ($ann['typeEven']==2102 || $ann['typeEven']==2100) {
$capital = true;
} else {
$capital = false;
}
if (trim($ann['strEven']) != '') {
$tabEven = explode(';', $ann['strEven']);
foreach ($tabEven as $even) {
$tabRetEven[] = array(
'CodeEven' => $even,
'LibEven' => $this->iBodacc->getEvenement($even)
);
if ($even>=1000 && $even<2000) {
$rubriqueRet = 'procol';
} elseif ($even>=2000 && $even<3000) {
$rubriqueRet='mmd';
} elseif ($even>=3000 && $even<4000) {
$rubriqueRet = 'comptes';
} elseif ($even>=4000 && $even<5000) {
$rubriqueRet = 'creations';
} elseif ($even>=5000 && $even<6000) {
$rubriqueRet = 'ventes';
} elseif ($even>=6000 && $even<7000) {
$rubriqueRet = 'radiations';
}
if ($even==2102 || $even==2100) {
$capital = true;
}
}
}
// --- Detection plan
if ($this->AnnoncesLegalesVisu === false) {
$this->getAnnoncesLegalesPlan('annonce', $this->Identite['FJ'], $ann);
}
$strVente='';
$nouvCapital='';
if ($ann['montant']>0) {
if ($capital) {
$nouvCapital=$ann['montant'];
$texteAnnonce.=' Nouveau capital : '.trim($ann['montant']). ' euros';
if ($ann['actionsNb']>0) {
$texteAnnonce.=' divisé en '.$ann['actionsNb'].' actions de '. round($ann['montant']/$ann['actionsNb']). ' euros';
}
} elseif (!preg_match('/ pour un montant de /Uis', $ann['complement'])) {
$texteAnnonce.=' Montant : '.trim($ann['montant']). ' euros';
$strVente=trim($ann['montant']). ' EUR';
}
$texteAnnonce.='. ';
}
// On ne prend l'annonce saisie directement que si elle est plus volumineuse
if (trim($ann['annonce']) != '' && strlen(trim($ann['annonce']))>strlen($texteAnnonce)) {
$texteAnnonce=trim($ann['annonce']);
}
$texteAnnonce = preg_replace('/ +/', ' ', strtr($texteAnnonce, array('*'=>' ', '/'=>' ', '..'=>'.')));
if (str_replace('-', '', $ann['dateSource'])*1 != 0) {
$dateParution = $ann['dateSource'];
} else {
$dateParution = $ann['dateInsert'];
}
$retFormat = array(
'id' => '0.'.$ann['id'],
'BodaccCode' => $ann['source'].'-'.$ann['parutionIdJal'],
'BodaccNum' => $ann['parutionNum'],
'NumAnnonce' => 0,
'DateParution' => $dateParution,
'Departement' => $dept,
'Tribunal' => $ann['triNom'],
'TribunalSiret' => $ann['triSiret'],
'Rubrique' => $rubriqueRet,
'typeAnnonce' => 'insertion',
'dateEffet' => $ann['dateCessationPaiement'],
'dateJugement' => $ann['dateJugement'],
'dateFin' => $ann['dateEffetFinP'],
'montantVente' => $strVente,
'libFJ' => $ann['nouvFJ'],
'codFJ' => $this->iBodacc->getCodeFormeJur($ann['nouvFJ']),
'capital' => $nouvCapital,
'capitalDev' => 'EUR',
'raisonSociale' => $ann['raisonSociale'],
'nomCommercial' => '',
'sigle' => '',
'adresse' => $ann['nouvAdr'],
'dateInsertionSD' => $ann['dateInsert'],
'evenements' => $tabRetEven,
'texteAnnonce' => $texteAnnonce,
'complement' => $ann['complement'],
);
if ($depotComptes) {
$retFormat['dateEffet'] = $ann['dateEffetFinP'];
}
$tabRet[] = $retFormat;
}
} // --- Fin du parcours des annonces
// --- Effacement procol
if ($this->AnnoncesLegalesVisu === false) {
if ($this->getAnnoncesLegalesEffacement($siren, $rubrique, $tabRet) === true) {
return array();
}
}
} catch (\Doctrine\DBAL\DBALException $e) {
if ($this->logger !== null) {
$this->logger->error($e->getMessage());
}
}

View File

@ -558,6 +558,16 @@ class Scores_Extract_Dict
'help' => "",
'columns' => array()
),
'nbContentieuxDE'=> array(
'lib' => 'Greffe Contentieux DE',
'help' => "Nbre de contentieux DE",
'columns' => array()
),
'nbContentieuxDF'=> array(
'lib' => 'Greffe Contentieux DF',
'help' => "Nbre de contentieux DF",
'columns' => array()
),
);
public function __construct()