Merge branch 'develop' into 'master'
Develop into master - confidentiel + autre See merge request !2
This commit is contained in:
commit
11618454d8
@ -208,7 +208,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
$level = Logger::DEBUG;
|
||||
} else {
|
||||
$level = Logger::INFO;
|
||||
$level = Logger::NOTICE;
|
||||
}
|
||||
$log->pushHandler(new StreamHandler($logFile), $level);
|
||||
$log->pushProcessor(new IntrospectionProcessor());
|
||||
|
@ -78,6 +78,7 @@ class ServiceController extends Zend_Controller_Action
|
||||
} else {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl';
|
||||
}
|
||||
$pathServiceUri = 'clients/'.$client.'/v'.$version;
|
||||
// --- On redéfini le nom du service
|
||||
$serviceClassName = 'Entreprise';
|
||||
$fichierWsdl = $clientClassName.'-'.$serviceClassName.'-'.$version.'.wsdl';
|
||||
@ -92,6 +93,7 @@ class ServiceController extends Zend_Controller_Action
|
||||
} else {
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl';
|
||||
}
|
||||
$pathServiceUri = $serviceName.'/v'.$version;
|
||||
$fichierWsdl = $serviceClassName.'-'.$version.'.wsdl';
|
||||
}
|
||||
|
||||
@ -104,6 +106,11 @@ class ServiceController extends Zend_Controller_Action
|
||||
// --- Get hostname - add compatibility with Reverse Proxy
|
||||
$hostName = $request->getHttpHost();
|
||||
$hostScheme = $request->getScheme();
|
||||
$http = new Zend_Controller_Request_Http();
|
||||
$proxyScheme = $http->getHeader('X-Forwarded-Proto');
|
||||
if ($proxyScheme == 'https') {
|
||||
$hostScheme = 'https';
|
||||
}
|
||||
$fichierWsdl = $hostName . '-' . $hostScheme . '-' . $fichierWsdl;
|
||||
$c = Zend_registry::get('config');
|
||||
$wsdlPath = $c->profil->path->shared . '/wsdl';
|
||||
@ -124,6 +131,10 @@ class ServiceController extends Zend_Controller_Action
|
||||
$wsdl->setBindingStyle(array('style' => 'document'));
|
||||
$wsdl->setClass($serviceClassName);
|
||||
|
||||
if ($hostScheme == 'https') {
|
||||
$wsdl->setUri($hostScheme.'://'.$hostName.'/'.$pathServiceUri);
|
||||
}
|
||||
|
||||
// --- Enregistrement du WSDL dans un fichier
|
||||
if (isset($_GET['wsdl-generate'])) {
|
||||
if (file_exists($wsdlPath . '/' . $fichierWsdl)) {
|
||||
@ -131,7 +142,6 @@ class ServiceController extends Zend_Controller_Action
|
||||
}
|
||||
$wsdl->dump($wsdlPath . '/' . $fichierWsdl);
|
||||
echo "Le fichier $fichierWsdl a été généré";
|
||||
|
||||
// --- Génération/Fourniture du wsdl
|
||||
} elseif (isset($_GET['wsdl']) && !file_exists($wsdlPath . '/' . $fichierWsdl)) {
|
||||
$wsdl->dump($wsdlPath . '/' . $fichierWsdl);
|
||||
|
@ -40,13 +40,12 @@ if (isset($opts->list)){
|
||||
|
||||
$types = array('bi', 'ac');
|
||||
|
||||
//Configuration FTP
|
||||
define ('ACTES_IGNUM_FTP_URL', '192.168.3.202');
|
||||
// Configuration FTP
|
||||
define ('ACTES_IGNUM_FTP_URL', 'ftp.scores-decisions.com');
|
||||
define ('ACTES_IGNUM_FTP_USER', 'mpc2500');
|
||||
define ('ACTES_IGNUM_FTP_PASS', 'passmpc78');
|
||||
define ('ACTES_IGNUM_LOCAL_DIR', $c->profil->path->shared.'/files/');
|
||||
|
||||
define ('PATH_DATA', $c->profil->infogreffe->storage->path);
|
||||
$pathIn = $c->profil->path->shared.'/files';
|
||||
|
||||
$report_email = $c->profil->mail->email->support;
|
||||
$report_subject = 'Traitement des actes '.date('Y-m-d H:i:s');
|
||||
@ -116,8 +115,8 @@ function sendMail($commande, $type){
|
||||
$message.= "Save paper - think before you print";
|
||||
$message.= "\n";
|
||||
|
||||
$headers = 'From: infoslegales@scores-decisions.com' . "\r\n" .
|
||||
'Reply-To: infoslegales@scores-decisions.com';
|
||||
$headers = 'From: support@scores-decisions.com' . "\r\n" .
|
||||
'Reply-To: support@scores-decisions.com';
|
||||
|
||||
if ( mail(strtolower($commande->email), $subject, utf8_decode($message), $headers) ){
|
||||
echo date ('Y/m/d - H:i:s').' - Un email a été envoyé à '.$commande->email." pour la commande ".$commande->id.".\n";
|
||||
@ -174,7 +173,12 @@ if (!$login_result) {
|
||||
echo date ('Y/m/d - H:i:s')." - ERREUR : Impossible de s'authentifier sur le serveur FTP (".ACTES_IGNUM_FTP_URL.")!\n";
|
||||
exit;
|
||||
}
|
||||
ftp_pasv($conn_id, true);
|
||||
$contents = ftp_nlist($conn_id, "*.pdf");
|
||||
if ($contents === false) {
|
||||
echo date ('Y/m/d - H:i:s')." - ERREUR : Impossible de se connecter au serveur FTP (".ACTES_IGNUM_FTP_URL.") !\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste de tout les fichiers disponible dans le repertoire
|
||||
@ -185,8 +189,7 @@ foreach ($contents as $filename){
|
||||
$indice = 0;
|
||||
$f = strtolower($filename);
|
||||
if (preg_match('/g-(ac|bi)-[0-9]+\.pdf/', $f)
|
||||
|| preg_match('/g-(ac|bi)-[0-9]+-[0-9]{1,2}\.pdf/', $f)){
|
||||
|
||||
|| preg_match('/g-(ac|bi)-[0-9]+-[0-9]{1,2}\.pdf/', $f)) {
|
||||
$part = substr(str_replace('.pdf', '', $f), 5);
|
||||
$p = strpos($part, '-');
|
||||
if ( $p === false ) {
|
||||
@ -200,7 +203,7 @@ foreach ($contents as $filename){
|
||||
}
|
||||
// Fichiers en anomalies
|
||||
else {
|
||||
if ($test){
|
||||
if ($test) {
|
||||
echo "Erreur : Anomalie fichier numérisé $filename\n";
|
||||
} else {
|
||||
$subject = "Erreur : Anomalie fichier numérisé";
|
||||
@ -226,12 +229,10 @@ krsort($tabFichiersFtp);
|
||||
*/
|
||||
$lastRef = '';
|
||||
$tabFichiersTemp = array();
|
||||
foreach($tabFichiersFtp as $k => $val)
|
||||
{
|
||||
|
||||
foreach($tabFichiersFtp as $k => $val) {
|
||||
$part = substr($k, 5);
|
||||
$p = strpos($part, '-');
|
||||
if ( $p === false ) {
|
||||
if ($p === false) {
|
||||
$ref = substr($k, 0, 5) . $part;
|
||||
} else {
|
||||
$ref = substr($k, 0, 5) . substr($part, 0, $p);
|
||||
@ -250,32 +251,25 @@ unset($tabFichiersTemp);
|
||||
* Pour chaque commande, test de la présence d'un fichier associé
|
||||
* Si le fichier correspond téléchargement du fichier
|
||||
*/
|
||||
foreach ( $tabCommandes as $ref => $commande ) {
|
||||
foreach ( $tabFichiers as $refAssocie => $fichier ) {
|
||||
|
||||
if ( $ref == $refAssocie ) {
|
||||
foreach ($tabCommandes as $ref => $commande) {
|
||||
foreach ($tabFichiers as $refAssocie => $fichier) {
|
||||
|
||||
if ($ref == $refAssocie) {
|
||||
echo date ('Y/m/d - H:i:s')." - Traitement de la commande $ref\n";
|
||||
|
||||
if ( $test ) {
|
||||
|
||||
if ($test) {
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier $fichier \n";
|
||||
|
||||
} else {
|
||||
|
||||
// Récupération du fichier depuis le FTP (s'il n'existe pas déjà)
|
||||
if ( !file_exists(ACTES_IGNUM_LOCAL_DIR.$fichier) ) {
|
||||
if (ftp_get($conn_id, ACTES_IGNUM_LOCAL_DIR.$fichier, $fichier, FTP_BINARY, 0)) {
|
||||
if (!file_exists($pathIn.'/'.$fichier)) {
|
||||
if (ftp_get($conn_id, $pathIn.'/'.$fichier, $fichier, FTP_BINARY, 0)) {
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier $fichier téléchargé depuis le serveur FTP.\n";
|
||||
} else {
|
||||
echo date ('Y/m/d - H:i:s')." - ERREUR : Impossible de télécharger le fichier $fichier !\n";
|
||||
}
|
||||
}
|
||||
|
||||
switch ( substr($ref,2,2) ) {
|
||||
|
||||
switch (substr($ref,2,2)) {
|
||||
case 'BI':
|
||||
|
||||
$infogreffe = new Metier_Infogreffe_DocBI();
|
||||
$infogreffe->setSiren($commande->siren);
|
||||
//Format date cloture
|
||||
@ -284,20 +278,18 @@ foreach ( $tabCommandes as $ref => $commande ) {
|
||||
substr($commande->bilanCloture,8,2);
|
||||
$path = $infogreffe->getFilePath($commande->bilanType, $dateCloture);
|
||||
$nomCible = $infogreffe->getFileName($commande->bilanType, $dateCloture);
|
||||
|
||||
$fileOut = PATH_DATA.'/'.$path.'/'.$nomCible;
|
||||
$fileOut = $c->profil->infogreffe->storage->path.'/'.$path.'/'.$nomCible;
|
||||
|
||||
$isFileOnStorage = false;
|
||||
|
||||
if (file_exists($fileOut)) {
|
||||
$isFileOnStorage = true;
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".ACTES_IGNUM_LOCAL_DIR.$fichier." déjà présent en ".$fileOut.".\n";
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".$pathIn.'/'.$fichier." déjà présent en ".$fileOut.".\n";
|
||||
} else {
|
||||
if (copy(ACTES_IGNUM_LOCAL_DIR.$fichier, $fileOut)) {
|
||||
if (copy($pathIn.'/'.$fichier, $fileOut)) {
|
||||
$isFileOnStorage = true;
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".ACTES_IGNUM_LOCAL_DIR.$fichier." déplacé en ".$fileOut.".\n";
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".$pathIn.'/'.$fichier." déplacé en ".$fileOut.".\n";
|
||||
} else {
|
||||
echo date ('Y/m/d - H:i:s')." ERREUR - Impossible de déplacer ".ACTES_IGNUM_LOCAL_DIR.$fichier." en ".$fileOut." !\n";
|
||||
echo date ('Y/m/d - H:i:s')." ERREUR - Impossible de déplacer ".$pathIn.'/'.$fichier." en ".$fileOut." !\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -359,19 +351,19 @@ foreach ( $tabCommandes as $ref => $commande ) {
|
||||
$options = $item->numGreffe . '-' . substr($item->numRC,0,2) . '-' . substr($item->numRC,2,1) . '-' . substr($item->numRC,3) . '-' . $item->num_depot;
|
||||
$nomCible = $infogreffe->getFileName($date, $commande->acteNum, $commande->acteType, $options);
|
||||
|
||||
$fileOut = PATH_DATA.'/'.$path.'/'.$nomCible;
|
||||
$fileOut = $c->profil->infogreffe->storage->path.'/'.$path.'/'.$nomCible;
|
||||
|
||||
$isFileOnStorage = false;
|
||||
|
||||
if (file_exists($fileOut)) {
|
||||
$isFileOnStorage = true;
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".ACTES_IGNUM_LOCAL_DIR.$fichier." déjà présent en ".$fileOut.".\n";
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".$pathIn.'/'.$fichier." déjà présent en ".$fileOut.".\n";
|
||||
} else {
|
||||
if (copy(ACTES_IGNUM_LOCAL_DIR.$fichier, $fileOut)) {
|
||||
if (copy($pathIn.'/'.$fichier, $fileOut)) {
|
||||
$isFileOnStorage = true;
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".ACTES_IGNUM_LOCAL_DIR.$fichier." déplacé en ".$fileOut.".\n";
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".$pathIn.'/'.$fichier." déplacé en ".$fileOut.".\n";
|
||||
} else {
|
||||
echo date ('Y/m/d - H:i:s')." ERREUR - Impossible de déplacer ".ACTES_IGNUM_LOCAL_DIR.$fichier." en ".$fileOut." !\n";
|
||||
echo date ('Y/m/d - H:i:s')." ERREUR - Impossible de déplacer ".$pathIn.'/'.$fichier." en ".$fileOut." !\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -397,8 +389,8 @@ foreach ( $tabCommandes as $ref => $commande ) {
|
||||
break;
|
||||
}
|
||||
|
||||
//Envoi du mail et Mise à jour de la commande
|
||||
if ( file_exists($fileOut) ) {
|
||||
// Envoi du mail et Mise à jour de la commande
|
||||
if (file_exists($fileOut)) {
|
||||
if ( $testMail ) {
|
||||
echo "Envoi fichier $nomCible ($ref) à ".$commande->email;
|
||||
} else {
|
||||
@ -440,6 +432,7 @@ if (empty($report_txt)) {
|
||||
|
||||
//Envoi du mail de rapport
|
||||
if (!$test && !$testMail){
|
||||
$headers = 'From: supportdev@scores-decisions.com';
|
||||
if (mail($report_email, $report_subject, utf8_decode($report_txt))){
|
||||
echo date ('Y/m/d - H:i:s')." - Rapport envoyé.\n";
|
||||
} else {
|
||||
|
@ -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
|
||||
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'])!='') {
|
||||
// --- 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)
|
||||
'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;
|
||||
}
|
||||
// Libellé générique
|
||||
$tabRetEven[] = array(
|
||||
'CodeEven' => $codeEven,
|
||||
'LibEven' => $libEven
|
||||
'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)
|
||||
);
|
||||
}
|
||||
}
|
||||
// --- 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']));
|
||||
$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';
|
||||
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();
|
||||
$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 {
|
||||
$tabEvens[] = array(
|
||||
'CodeEven' => $newCodeEven,
|
||||
'LibEven' => $this->iBodacc->getEvenement($newCodeEven));
|
||||
'LibEven' => $this->iBodacc->getEvenement($newCodeEven)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$tabEvens[] = array(
|
||||
'CodeEven' => $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);
|
||||
// --- 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';
|
||||
// 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 {
|
||||
$capitalDev = 'FRF';
|
||||
$capital=$capitalDev='';
|
||||
}
|
||||
} 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',
|
||||
);
|
||||
$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 (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'];
|
||||
// Recherche de la forme juridique
|
||||
if (preg_match('/Forme(?:.|)\:(.*)(Capital|Adresse|Activit.|Administration|Commentaire)(?:.|)\:/Uisu', $ann['annonceTxt'], $matches)) {
|
||||
$libFJ = trim($matches[1]);
|
||||
}
|
||||
}
|
||||
$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)
|
||||
// --- 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'],
|
||||
);
|
||||
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;
|
||||
}
|
||||
$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='';
|
||||
|
||||
// --- 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';
|
||||
/** 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'] . '. ';
|
||||
} else {
|
||||
$strRCS = $ann['siren'] . ' RCS '. ucfirst(strtolower(strtr($ann['triNom'], array('TGIcc '=>'', 'TGI '=>'', 'TC '=>'', 'TI '=>'', )))).'. ';
|
||||
}
|
||||
} 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 = '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'].'. ';
|
||||
|
||||
$texteAnnonce = preg_replace('/ +/', ' ', strtr($texteAnnonce, array('*'=>' ', '/'=>' ', '..'=>'.')));
|
||||
if (trim($ann['numero']) != '') {
|
||||
$texteAnnonce.='Jugement Numéro : '.trim($ann['numero']).'. ';
|
||||
}
|
||||
|
||||
if (str_replace('-', '', $ann['dateSource'])*1 != 0) {
|
||||
$dateParution = $ann['dateSource'];
|
||||
} else {
|
||||
$dateParution = $ann['dateInsert'];
|
||||
}
|
||||
if ($ann['dateCessationPaiement']*1 != 0) {
|
||||
$texteAnnonce.='Cessation des paiements le '.strtolower(Metier_Util_Date::dateT('Y-m-d', 'd M Y', $ann['dateCessationPaiement'])).'. ';
|
||||
}
|
||||
|
||||
$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'];
|
||||
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();
|
||||
}
|
||||
$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());
|
||||
}
|
||||
}
|
||||
|
||||
return $tabRet;
|
||||
|
@ -117,17 +117,17 @@ class Metier_Liens_Base
|
||||
->where('l.idPar = :id')->setParameter('id', $id)
|
||||
->orderBy('l.PDetention', 'DESC');
|
||||
|
||||
// Actif / Inactif
|
||||
if (null !== $actif) {
|
||||
if (false === $actif) {
|
||||
$qb->andWhere('l.actif = 0');
|
||||
} else {
|
||||
$qb->andWhere('l.actif = 1');
|
||||
}
|
||||
// Actif / Inactif
|
||||
if (null !== $actif) {
|
||||
if (false === $actif) {
|
||||
$qb->andWhere('l.actif = 0');
|
||||
} else {
|
||||
$qb->andWhere('l.actif = 1');
|
||||
}
|
||||
}
|
||||
|
||||
// Don't display deleted - anomaly
|
||||
$qb->andWhere("l.dateSuppr = '0000-00-00 00:00:00'");
|
||||
// Don't display deleted - anomaly
|
||||
$qb->andWhere("l.dateSuppr = '0000-00-00 00:00:00'");
|
||||
$stmt = $qb->execute();
|
||||
$liens = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
@ -208,8 +208,10 @@ class Metier_Liens_Base
|
||||
$sql = "SELECT LPAD(siren, 9, 0) AS siren FROM jo.liensRef WHERE id = :id";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('id', $this->idRef);
|
||||
$result = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
$siren = $result->siren;
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$result = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
$siren = $result->siren;
|
||||
}
|
||||
} else {
|
||||
$siren = $this->siren;
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ class Metier_Partenaires_MBilans
|
||||
* Nombre de bilans maximums retournés
|
||||
* @return array
|
||||
*/
|
||||
public function listeBilans($accesPartenaire = false, $nbMaxBilans = 0)
|
||||
public function listeBilans($accesPartenaire = false, $nbMaxBilans = 0, $idClient = 0)
|
||||
{
|
||||
$dateDerDepot = 0;
|
||||
$tabRet = $tabRet2 = $tabRet3 = $tabRet = array();
|
||||
@ -358,12 +358,21 @@ class Metier_Partenaires_MBilans
|
||||
if ($this->companyEvenDateStop !== null) {
|
||||
$where.= " AND dateExercice<'".$this->companyEvenDateStop."'";
|
||||
}
|
||||
|
||||
// --- Si c'est un client qui consulte, alors il ne peut voir que ses bilans confidentiels ou tous les bilans publiques.
|
||||
// --- 0 : consultation de l'application (calcul du score ...)
|
||||
// --- 1 : consultation d'un membre de scores et décisions
|
||||
// --- 147 : consultation d'un opérateur de l'arménie
|
||||
if ($idClient > 1 && $idClient != 147) {
|
||||
$where.= " AND (confidentiel_client = ".$idClient." OR confidentiel = 0)";
|
||||
}
|
||||
|
||||
$where.= " ORDER BY dateExercice DESC, CASE typeBilan WHEN 'N' THEN 1 WHEN 'S' THEN 2 ELSE 3 END";
|
||||
if ($nbMaxBilans > 0) {
|
||||
$where.= " LIMIT 0, $nbMaxBilans";
|
||||
}
|
||||
|
||||
$fields = "typeBilan, dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaieOrigine, dateInsert, partenaire";
|
||||
$fields = "typeBilan, dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaieOrigine, dateInsert, partenaire, confidentiel, confidentiel_client";
|
||||
$listeNb = 0;
|
||||
try {
|
||||
$listeSql = "SELECT $fields FROM jo.bilans WHERE $where";
|
||||
@ -391,6 +400,8 @@ class Metier_Partenaires_MBilans
|
||||
'dureeExercicePre' => $bil['dureeExercicePre'],
|
||||
'monnaie' => $bil['monnaieOrigine'],
|
||||
'source' => $bil['partenaire'],
|
||||
'confidentiel' => $bil['confidentiel'],
|
||||
'confidentielClient' => $bil['confidentiel_client'],
|
||||
);
|
||||
$tabTri[''.$bil['dateExercice'].'-'.$bil['typeBilan']] = $bil['typeBilan'].$millesime;
|
||||
}
|
||||
|
@ -9,8 +9,7 @@ if (defined('DEBUG') == false) {
|
||||
// --------------------------------------------------------------------------- //
|
||||
// databaseJO
|
||||
// --------------------------------------------------------------------------- //
|
||||
function databaseJO()
|
||||
{
|
||||
function databaseJO() {
|
||||
$db = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, 'jo');
|
||||
if (mysqli_connect_error()) {
|
||||
println('Ne peut pas se connecter a la base.');
|
||||
@ -23,8 +22,7 @@ function databaseJO()
|
||||
// --------------------------------------------------------------------------- //
|
||||
// println
|
||||
// --------------------------------------------------------------------------- //
|
||||
function println($ln = '')
|
||||
{
|
||||
function println($ln = '') {
|
||||
print $ln.'<br/>';
|
||||
}
|
||||
|
||||
@ -32,17 +30,11 @@ function println($ln = '')
|
||||
// debugln
|
||||
// --------------------------------------------------------------------------- //
|
||||
if (DEBUG) {
|
||||
function debugln($ln = '')
|
||||
{
|
||||
function debugln($ln = '') {
|
||||
print $ln.'<br/>';
|
||||
}
|
||||
} elseif (LOCAL) {
|
||||
function debugln($ln = '')
|
||||
{
|
||||
}
|
||||
} else {
|
||||
function debugln($ln = '')
|
||||
{
|
||||
function debugln($ln = '') {
|
||||
/*
|
||||
$fp = fopen(LOG_PATH.'/recherchesDebug.log', 'a');
|
||||
fwrite($fp, $ln."\n");
|
||||
|
@ -591,11 +591,11 @@ class Entreprise extends Scores_Ws_Server
|
||||
$tabAct = array();
|
||||
foreach ($tabA as $i=>$lien) {
|
||||
$liens = new Actionnaire();
|
||||
$liens->Pmin = $lien['PDetention'];
|
||||
$liens->MajMin = $lien['MajMin'];
|
||||
$liens->RaisonSociale = $lien['RS'];
|
||||
$liens->Pays = $lien['adresse_pays'];
|
||||
$liens->Siren = $lien['siren'];
|
||||
$liens->Pmin = $lien->PDetention;
|
||||
$liens->MajMin = $lien->MajMin;
|
||||
$liens->RaisonSociale = $lien->RS;
|
||||
$liens->Pays = $lien->adresse_pays;
|
||||
$liens->Siren = $lien->siren;
|
||||
$liens->Actif = 1;
|
||||
$tabAct[] = $liens;
|
||||
}
|
||||
@ -631,6 +631,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
|
||||
/** Y a t il eu des informations relatives à une cession ? **/
|
||||
$iGreffes = new Metier_Partenaires_MGreffes();
|
||||
$tabCes = $iGreffes->getInfosCessions($siren);
|
||||
if ($tabCes) {
|
||||
$identiteProcol->CessionJugeLib = $tabCes['cessJuge'];
|
||||
$identiteProcol->CessionJugeDate = $tabCes['cessDateJuge'];
|
||||
@ -911,14 +912,15 @@ class Entreprise extends Scores_Ws_Server
|
||||
$annsB=$iInsee->getAnnoncesBalo($siren);
|
||||
$annsA=$iInsee->getAnnoncesAsso($siren);
|
||||
$annsM=$iInsee->getAnnoncesBoamp($siren, $idAnn);
|
||||
} elseif ($filtre==1)
|
||||
$anns=$iInsee->getAnnoncesLegales($siren, $idAnn);
|
||||
elseif ($filtre==2)
|
||||
$annsB=$iInsee->getAnnoncesBalo($siren, $idAnn);
|
||||
elseif ($filtre==3)
|
||||
$annsA=$iInsee->getAnnoncesAsso($siren, $idAnn);
|
||||
elseif ($filtre==4)
|
||||
$annsM=$iInsee->getAnnoncesBoamp($siren, $idAnn);
|
||||
} elseif ($filtre==1) {
|
||||
$anns=$iInsee->getAnnoncesLegales($siren, $idAnn);
|
||||
} elseif ($filtre==2) {
|
||||
$annsB=$iInsee->getAnnoncesBalo($siren, $idAnn);
|
||||
} elseif ($filtre==3) {
|
||||
$annsA=$iInsee->getAnnoncesAsso($siren, $idAnn);
|
||||
} elseif ($filtre==4) {
|
||||
$annsM=$iInsee->getAnnoncesBoamp($siren, $idAnn);
|
||||
}
|
||||
|
||||
if (empty($anns) && empty($annsB) && empty($annsA) && empty($annsM))
|
||||
{
|
||||
@ -3335,7 +3337,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
if(!in_array($key, array('SIREN', 'DATE_FRAICHE_BILAN',
|
||||
'DATE_CLOTURE', 'DATE_CLOTURE_PRE', 'DUREE_MOIS',
|
||||
'DUREE_MOIS_PRE', 'MONNAIE', 'CONSOLIDE', 'MONNAIE_ORI',
|
||||
'MONNAIE_LIV_UNITE', 'SOURCE', 'devise'))){
|
||||
'MONNAIE_LIV_UNITE', 'SOURCE', 'devise', 'TOP_CONFIDENTIEL'))){
|
||||
$resultPoste = new BilanPoste();
|
||||
$resultPoste->id = $key;
|
||||
$resultPoste->val = $value;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -269,10 +269,10 @@ class Identite
|
||||
*/
|
||||
public $NbEtab;
|
||||
|
||||
/**
|
||||
* Numéro isin
|
||||
* @var string
|
||||
*/
|
||||
/**
|
||||
* Numéro isin
|
||||
* @var string
|
||||
*/
|
||||
public $Isin;
|
||||
|
||||
/**
|
||||
@ -2366,6 +2366,11 @@ class ListeBilans
|
||||
* @var int
|
||||
*/
|
||||
public $source;
|
||||
|
||||
/** Confidentialité du bilan (1 si confidentiel, 0 sinon)
|
||||
* @var int
|
||||
*/
|
||||
public $confidentiel;
|
||||
}
|
||||
|
||||
class SetSurveillanceReturn
|
||||
@ -2550,6 +2555,11 @@ class Bilan
|
||||
*/
|
||||
public $SOURCE;
|
||||
|
||||
/** Bilan confidentiel ou non
|
||||
* @var string
|
||||
*/
|
||||
public $TOP_CONFIDENTIEL;
|
||||
|
||||
/** Tableau de postes du bilan dans le formalisme associé au Type de bilan
|
||||
* @var BilanPoste[]
|
||||
*/
|
||||
|
@ -73,16 +73,16 @@ class Saisie extends Scores_Ws_Server
|
||||
$tabScores = $tabInfos['score'];
|
||||
|
||||
//Valider le code Isin
|
||||
if (strlen(trim($tabIdentite['isin']))) {
|
||||
$iBourse = new Metier_Partenaires_MBourse();
|
||||
if (!$iBourse->isIsin($tabIdentite['isin'])) {
|
||||
$error->errnum = 1;
|
||||
if (strlen(trim($tabIdentite['isin']))) {
|
||||
$iBourse = new Metier_Partenaires_MBourse();
|
||||
if (!$iBourse->isIsin($tabIdentite['isin'])) {
|
||||
$error->errnum = 1;
|
||||
$error->errmsg = 'Code Isin incorrect.';
|
||||
$output = new SetInfosEntrepReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
return $output;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
// Mise à jour de l'identité
|
||||
@ -1257,21 +1257,21 @@ class Saisie extends Scores_Ws_Server
|
||||
break;
|
||||
}
|
||||
|
||||
$iInsee = new Metier_Insee_MInsee();
|
||||
$iInsee = new Metier_Insee_MInsee();
|
||||
$entrep = $iInsee->getIdentiteLight($siren, $nic);
|
||||
if ( empty($entrep['id']) || intval($entrep['id'])==0 ) {
|
||||
$this->sendError('1020');
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'siren' => $siren,
|
||||
'nic' => $nic,
|
||||
'dateProvPartenaire'=> date('Y').date('m').date('d'),
|
||||
'typeTel' => $type,
|
||||
'infoTel' => $info,
|
||||
'telephone' => $value,
|
||||
'actif' => 1,
|
||||
'partenaire' => 175,
|
||||
$data = array(
|
||||
'siren' => $siren,
|
||||
'nic' => $nic,
|
||||
'dateProvPartenaire'=> date('Y').date('m').date('d'),
|
||||
'typeTel' => $type,
|
||||
'infoTel' => $info,
|
||||
'telephone' => $value,
|
||||
'actif' => 1,
|
||||
'partenaire' => 175,
|
||||
);
|
||||
|
||||
if ( $id === null ) {
|
||||
@ -1393,9 +1393,9 @@ class Saisie extends Scores_Ws_Server
|
||||
{
|
||||
$this->authenticate();
|
||||
|
||||
// --- Control input value
|
||||
if ( strlen($siren)!=9 ) {
|
||||
$this->sendError('1010');
|
||||
// --- Control input value
|
||||
if ( strlen($siren)!=9 ) {
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
$tabPostes = array();
|
||||
@ -1407,8 +1407,8 @@ class Saisie extends Scores_Ws_Server
|
||||
if (!preg_match('/[0-9]{8}/', $data->dateCloture)) {
|
||||
throw new SoapFault('MSG', "Erreur Date de cloture");
|
||||
}
|
||||
if ($data->dateCloturePre != 'AAAAMMJJ' && !preg_match('/[0-9]{8}/', $data->dateCloturePre)) {
|
||||
throw new SoapFault('MSG', "Erreur Date de cloture précédente");
|
||||
if ($data->dateCloturePre != 'AAAAMMJJ' && !preg_match('/[0-9]{8}/', $data->dateCloturePre)) {
|
||||
throw new SoapFault('MSG', "Erreur Date de cloture précédente");
|
||||
}
|
||||
if ($data->dateCloturePre == 'AAAAMMJJ') {
|
||||
$data->dateCloturePre = 0;
|
||||
@ -1450,21 +1450,21 @@ class Saisie extends Scores_Ws_Server
|
||||
}
|
||||
// --- Insertion dans la bdd
|
||||
else {
|
||||
|
||||
|
||||
try {
|
||||
$bilansM = new Application_Model_JoBilans();
|
||||
$sql = $bilansM->select()
|
||||
->where('siren=?', $siren)
|
||||
->where('dateExercice=?', $cloture)
|
||||
->where('typeBilan=?', $type);
|
||||
->where('typeBilan=?', $type);
|
||||
$row = $bilansM->fetchRow($sql);
|
||||
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient!=1) {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
} else {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
}
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
|
||||
$postesDiff = array();
|
||||
@ -1485,7 +1485,7 @@ class Saisie extends Scores_Ws_Server
|
||||
'unite' => $data->unite,
|
||||
'postes' => $data->postes,
|
||||
'partenaire' => 1,
|
||||
'confidentiel' => 0,
|
||||
'confidentiel' => 0,
|
||||
'dateInsert' => date('YmdHis'),
|
||||
);
|
||||
|
||||
@ -1493,10 +1493,10 @@ class Saisie extends Scores_Ws_Server
|
||||
try {
|
||||
$id = $bilansM->insert($dataToInsert);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient!=1) {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
} else {
|
||||
if ($this->User->idClient == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1512,10 +1512,10 @@ class Saisie extends Scores_Ws_Server
|
||||
try {
|
||||
$historiquesM->insert($backupData);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient!=1) {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
} else {
|
||||
if ($this->User->idClient == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1532,7 +1532,7 @@ class Saisie extends Scores_Ws_Server
|
||||
'unite' => $data->unite,
|
||||
'postes' => $data->postes,
|
||||
'partenaire' => 1,
|
||||
'confidentiel' => 0,
|
||||
'confidentiel' => 0,
|
||||
'dateInsert' => date('YmdHis'),
|
||||
);
|
||||
|
||||
@ -1540,10 +1540,10 @@ class Saisie extends Scores_Ws_Server
|
||||
try {
|
||||
$id = $bilansM->update($dataToUpdate, 'id = '.$row->id);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient!=1) {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
} else {
|
||||
if ($this->User->idClient == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1555,7 +1555,7 @@ class Saisie extends Scores_Ws_Server
|
||||
|
||||
// --- Save user
|
||||
$userM = new Application_Model_JoBilansUser();
|
||||
try {
|
||||
try {
|
||||
$userM->insert(array(
|
||||
'idUtilisateur' => $this->User->id,
|
||||
'login' => $this->User->login,
|
||||
@ -1564,13 +1564,13 @@ class Saisie extends Scores_Ws_Server
|
||||
'typeBilan' => $data->typeBilan,
|
||||
'dateAction' => date('YmdHis'),
|
||||
'postesDiff' => implode(';', $postesDiff),
|
||||
));
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient!=1) {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
} else {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
}
|
||||
));
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
|
||||
return $id;
|
||||
@ -1749,8 +1749,8 @@ class Saisie extends Scores_Ws_Server
|
||||
|
||||
if (strlen(trim($dataRef['isin']))) {
|
||||
$iBourse = new Metier_Partenaires_MBourse();
|
||||
if (!$iBourse->isIsin($dataRef['isin'])) {
|
||||
throw new SoapFault('ERR', 'Code Isin incorrect.');
|
||||
if (!$iBourse->isIsin($dataRef['isin'])) {
|
||||
throw new SoapFault('ERR', 'Code Isin incorrect.');
|
||||
}
|
||||
}
|
||||
|
||||
@ -2345,20 +2345,20 @@ class Saisie extends Scores_Ws_Server
|
||||
}
|
||||
if ($result) return true;
|
||||
}
|
||||
//Move active participations if TUP and Fusion selected
|
||||
elseif ($action=='tupfusion')
|
||||
{
|
||||
try {
|
||||
$result = $lienM->update(array('idAct'=>$id, 'idUpdate'=>$this->User->id),
|
||||
"idAct=$idLien AND actif=1 AND dateSuppr='0000-00-00 00:00:00'");
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient==1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
if ($result) return true;
|
||||
//Move active participations if TUP and Fusion selected
|
||||
elseif ($action=='tupfusion')
|
||||
{
|
||||
try {
|
||||
$result = $lienM->update(array('idAct'=>$id, 'idUpdate'=>$this->User->id),
|
||||
"idAct=$idLien AND actif=1 AND dateSuppr='0000-00-00 00:00:00'");
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient==1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
if ($result) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -2593,7 +2593,7 @@ class Saisie extends Scores_Ws_Server
|
||||
}
|
||||
return $result;
|
||||
|
||||
case 'edit':
|
||||
case 'edit':
|
||||
$tabRet['idUpdate'] = $userId;
|
||||
try {
|
||||
$result = $dirOp->update($tabRet, $where);
|
||||
|
@ -42,7 +42,7 @@ callInfo.inparams
|
||||
callInfo.inparams[0].name
|
||||
u'parameters'
|
||||
callInfo.inparams[0].type
|
||||
(u'http://wse.scores-decisions.com:8081/service', u'status')
|
||||
(u'http://hostname/service', u'status')
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
SELECT codNaf5 AS codNaf, libNaf5 AS libNaf
|
||||
FROM jo.tabNaf5
|
||||
UNION SELECT codNaf700 AS codNaf, libNaf700 AS libNaf
|
||||
FROM jo.tabNaf4
|
||||
ORDER BY codNaf
|
||||
SELECT codNaf5 AS codNaf, libNaf5 AS libNaf FROM jo.tabNaf5 WHERE LENGTH(codNaf5)=5
|
||||
UNION
|
||||
SELECT codNaf700 AS codNaf, libNaf700 AS libNaf FROM jo.tabNaf4 WHERE libNaf700!='' ORDER BY codNaf;
|
Loading…
Reference in New Issue
Block a user