Diverses corrections

This commit is contained in:
Michael RICOIS 2012-01-30 21:09:14 +00:00
parent c1514c0cd0
commit 1b45991ab2
3 changed files with 20 additions and 35 deletions

View File

@ -6,7 +6,7 @@ defined('APPLICATION_PATH')
// Define application environment // Define application environment
defined('APPLICATION_ENV') defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));
// Ensure library/ is on include_path // Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array( set_include_path(implode(PATH_SEPARATOR, array(
@ -407,7 +407,7 @@ if ($opts->id) {
} }
foreach($tabIdentifiant as $item) foreach($tabIdentifiant as $item)
{ {
echo "Ligne $row+1\n"; echo "Ligne ".($row+1)."\n";
$siretValide = false; $siretValide = false;
$sirenValide = false; $sirenValide = false;
@ -700,15 +700,13 @@ function bilanNEntete($values)
function bilanNData($siren, $nic, $values = false) function bilanNData($siren, $nic, $values = false)
{ {
require_once 'Metier/partenaires/classMBilans.php'; require_once 'Metier/partenaires/classMBilans.php';
$tabPostes = explode(',', $values); $tabPostes = explode(',', $values);
$annee = 0; $annee = 0;
$tabData = array(); $tabData = array();
$mBil = new MBilans($siren); $mBil = new MBilans($siren);
$tabBilans = $mBil->listeBilans(false, 9); $tabBilans = $mBil->listeBilans(false, 9);
print_r($tabBilans);
if (count($tabBilans)>0) { if (count($tabBilans)>0) {
$tabBi = findBilan($tabBilans, $annee); $tabBi = findBilan($siren, $tabBilans, $annee);
$tabData['bilanNdateCloture'] = $tabBi['DATE_CLOTURE']; $tabData['bilanNdateCloture'] = $tabBi['DATE_CLOTURE'];
$tabData['bilanNdureeMois'] = $tabBi['DUREE_MOIS']; $tabData['bilanNdureeMois'] = $tabBi['DUREE_MOIS'];
if (count($tabPostes)>0) { if (count($tabPostes)>0) {
@ -742,13 +740,12 @@ function bilanN1Data($siren, $nic, $values = false)
{ {
require_once 'Metier/partenaires/classMBilans.php'; require_once 'Metier/partenaires/classMBilans.php';
$tabPostes = explode(',', $values); $tabPostes = explode(',', $values);
$annee = 1; $annee = 1;
$tabData = array(); $tabData = array();
$mBil = new MBilans($siren); $mBil = new MBilans($siren);
$tabBilans = $mBil->listeBilans(false, 9); $tabBilans = $mBil->listeBilans(false, 9);
if (count($tabBilans)>0) { if (count($tabBilans)>0) {
$tabBi = findBilan($tabBilans, $annee); $tabBi = findBilan($siren, $tabBilans, $annee);
$tabData['bilanNdateCloture'] = $tabBi['DATE_CLOTURE']; $tabData['bilanNdateCloture'] = $tabBi['DATE_CLOTURE'];
$tabData['bilanNdureeMois'] = $tabBi['DUREE_MOIS']; $tabData['bilanNdureeMois'] = $tabBi['DUREE_MOIS'];
if (count($tabPostes)>0) { if (count($tabPostes)>0) {
@ -782,13 +779,12 @@ function bilanN2Data($siren, $nic, $values = false)
{ {
require_once 'Metier/partenaires/classMBilans.php'; require_once 'Metier/partenaires/classMBilans.php';
$tabPostes = explode(',', $values); $tabPostes = explode(',', $values);
$annee = 2; $annee = 2;
$tabData = array(); $tabData = array();
$mBil = new MBilans($siren); $mBil = new MBilans($siren);
$tabBilans = $mBil->listeBilans(false, 9); $tabBilans = $mBil->listeBilans(false, 9);
if (count($tabBilans)>0) { if (count($tabBilans)>0) {
$tabBi = findBilan($tabBilans, $annee); $tabBi = findBilan($siren, $tabBilans, $annee);
$tabData['bilanNdateCloture'] = $tabBi['DATE_CLOTURE']; $tabData['bilanNdateCloture'] = $tabBi['DATE_CLOTURE'];
$tabData['bilanNdureeMois'] = $tabBi['DUREE_MOIS']; $tabData['bilanNdureeMois'] = $tabBi['DUREE_MOIS'];
if (count($tabPostes)>0) { if (count($tabPostes)>0) {
@ -802,16 +798,19 @@ function bilanN2Data($siren, $nic, $values = false)
return $tabData; return $tabData;
} }
function findBilan($tabBilans, $position = 0) function findBilan($siren, $tabBilans, $position = 0)
{ {
require_once 'Metier/partenaires/classMBilans.php';
$mBil = new MBilans($siren);
//Trier et Supprimer les bilans consolidés //Trier et Supprimer les bilans consolidés
$tabBilN = $tabBilS = array(); $tabBilN = $tabBilS = array();
foreach ($tabBilans as $typeMil => $bilan) { foreach ($tabBilans as $typeMil => $bilan) {
$annee = substr($typeMil,1); $temp = $mBil->getBilan(substr($typeMil,1), substr($typeMil,0,1));
if (substr($typeMil,0,1)=='N'){ $annee = $bilan['millesime'];
$tabBilN[$annee] = $mBil->getBilan(substr($typeMil,1), substr($typeMil,0,1)); if (substr($typeMil,0,1)=='N') {
} elseif (substr($typeMil,0,1)=='S'){ $tabBilN[$annee] = $temp;
$tabBilS[$annee] = $mBil->getBilan(substr($typeMil,1), substr($typeMil,0,1)); } elseif (substr($typeMil,0,1)=='S') {
$tabBilS[$annee] = $temp;
} }
} }
$tabBil = $tabBilN + $tabBilS; //On comble les trous par des bilans simplifié $tabBil = $tabBilN + $tabBilS; //On comble les trous par des bilans simplifié

View File

@ -1,23 +1,8 @@
<?php <?php
define('BODACC_LOCAL_DIR', '/home/data/bodacc/');
define('JAL_LOCAL_DIR', '/home/data/jal/');
define('HUGIN_LOCAL_DIR', '/home/data/infosreg/hugin/');
define('ACTUSNEWS_LOCAL_DIR', '/home/data/infosreg/actusnews/');
define('DIRELEASE_LOCAL_DIR', '/home/data/infosreg/direlease/');
define('LESECHOS_LOCAL_DIR', '/home/data/infosreg/lesechos/');
/** Paramètres du FTP de BusinessWire : Communiqués de presse **/
define('BUSINESSWIRE_LOCAL_DIR_INCOMING', '/home/data/ftp/businesswire/');
define('BUSINESSWIRE_LOCAL_DIR', '/home/data/infosreg/businesswire/');
/** Dossiers locaux pour les documents a telecharger (PDF kbis, marques, etc...) **/ /** Dossiers locaux pour les documents a telecharger (PDF kbis, marques, etc...) **/
define('DOC_WEB_LOCAL', realpath('d:/www/dataws/').'/'); define('DOC_WEB_LOCAL', realpath('d:/www/dataenrichissement/').'/');
define('DOC_WEB_URL', '/data/'); define('DOC_WEB_URL', '/data/');
/** LOGGING **/ /** LOGGING **/
define('LOG_PATH', realpath('d:/www/dataws/log/')); define('LOG_PATH', realpath('d:/www/dataenrichissement/log/'));

View File

@ -20,7 +20,8 @@ class WDB {
if ($database=='') $this->database=MYSQL_DEFAULT_DB; if ($database=='') $this->database=MYSQL_DEFAULT_DB;
else $this->database=$database; else $this->database=$database;
if (defined(MYSQL_PORT)) $this->host = $this->host.':'.MYSQL_PORT; //if (defined(MYSQL_PORT)) $this->host = $this->host.':'.MYSQL_PORT;
$this->host = $this->host.':53336';
$this->con_id = mysql_connect($this->host, $this->user, $this->password); $this->con_id = mysql_connect($this->host, $this->user, $this->password);
if (!($this->con_id === false)) { if (!($this->con_id === false)) {