Telephone + optimisation bdd
This commit is contained in:
parent
49a2b41735
commit
7268cf15b8
@ -132,7 +132,7 @@ $tabCtrl=array(
|
||||
'LU+LW+NH+NK=0L'=>'2054: Immos Total Général Brut fin ex. incohérent',
|
||||
'0L=BJ'=>'Immos Total Général Brut du 2054 <> BJ du 2050',*/
|
||||
),
|
||||
);
|
||||
);
|
||||
|
||||
$tabLibCodeCtrl=array(
|
||||
'_0'=>'-',
|
||||
@ -174,10 +174,11 @@ $tabLibCodeSaisie=array(
|
||||
class MBilans {
|
||||
|
||||
public $siren;
|
||||
|
||||
public $dernierExerciceDepose=0;
|
||||
|
||||
public $dernierExerciceDeposeLe=0;
|
||||
// public $rncs;
|
||||
public $igreffe;
|
||||
|
||||
private $tabBS2BN = array(
|
||||
//2033 ACTIF PASSIF
|
||||
'AH' => '010',
|
||||
@ -420,10 +421,22 @@ class MBilans {
|
||||
'YP' => '376',
|
||||
);
|
||||
|
||||
function __construct($siren) {
|
||||
$this->siren=$siren;
|
||||
//$this->rncs=new MRncsFlux();
|
||||
$this->igreffe=new MGreffes();
|
||||
protected $iDb;
|
||||
|
||||
/**
|
||||
* MBilans
|
||||
* @param string $siren
|
||||
* @param string $db
|
||||
*/
|
||||
public function __construct($siren, $db = null)
|
||||
{
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new WDB();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
|
||||
$this->siren = $siren;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -434,29 +447,29 @@ class MBilans {
|
||||
* Nombre de bilans maximums retournés
|
||||
* @return array
|
||||
*/
|
||||
function listeBilans($accesPartenaire=false, $nbMaxBilans=0)
|
||||
public function listeBilans($accesPartenaire=false, $nbMaxBilans=0)
|
||||
{
|
||||
$classWDate = new WDate();
|
||||
$classWDate = new WDate();
|
||||
$dateDerDepot = 0;
|
||||
$tabRet = $tabRet3 = array();
|
||||
|
||||
if ($nbMaxBilans>0) $limit="LIMIT 0, $nbMaxBilans";
|
||||
else $limit='';
|
||||
|
||||
$iDb2=new WDB();
|
||||
$ret=$iDb2->select( 'bilans',
|
||||
'typeBilan, dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaieOrigine, dateInsert, partenaire',
|
||||
"siren='$this->siren' ORDER BY dateExercice DESC $limit",false, MYSQL_ASSOC);
|
||||
$ret = $this->iDb->select(
|
||||
'bilans',
|
||||
'typeBilan, dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaieOrigine, dateInsert, partenaire',
|
||||
"siren='$this->siren' ORDER BY dateExercice DESC $limit",false, MYSQL_ASSOC);
|
||||
if ( count($ret)>0 ) {
|
||||
$dateDerExercice=$ret[0]['dateExercice']*1;
|
||||
}
|
||||
|
||||
//@sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "listeBilans sur $this->siren en base", print_r($ret, true));
|
||||
|
||||
$iDb = new WDB('jo');
|
||||
$ret2=$iDb->select( 'bodacc_detail',
|
||||
'Bodacc_Date_Parution, dateEffet, typeEven',
|
||||
"siren='$this->siren' AND Rubrique='comptes' ORDER BY dateEffet DESC",false, MYSQL_ASSOC);
|
||||
$ret2 = $this->iDb->select(
|
||||
'bodacc_detail',
|
||||
'Bodacc_Date_Parution, dateEffet, typeEven',
|
||||
"siren='$this->siren' AND Rubrique='comptes' ORDER BY dateEffet DESC",false, MYSQL_ASSOC);
|
||||
if ( count($ret2)>0 ) {
|
||||
$dateDerDepot=$classWDate->dateT('Y-m-d','Ymd',$ret2[0]['dateEffet'])*1;
|
||||
if ($dateDerDepot<>0) {
|
||||
@ -465,39 +478,11 @@ class MBilans {
|
||||
}
|
||||
}
|
||||
|
||||
if ($accesPartenaire)
|
||||
$tabRet=$tabRet2=$this->igreffe->getListeBilans($this->siren);
|
||||
else
|
||||
if ($accesPartenaire) {
|
||||
$iGreffe = new MGreffes();
|
||||
$tabRet=$tabRet2=$iGreffe->getListeBilans($this->siren);
|
||||
} else {
|
||||
$tabRet=$tabRet2=array();
|
||||
|
||||
if ($ENV=='PRD') { // A supprimer le jour ou on vire l'ancien serveur car curl plantait sur Infogreffe !!!
|
||||
$tabRefXml=$tabRefPdf=array();
|
||||
// Tableau des références de bilans XML Infogreffe
|
||||
foreach ($tabRet as $idxTmp=>$bilanTmp) {
|
||||
if ((substr($idxTmp,-4)*1)>(date(Y)-4))
|
||||
$tabRefXml[]=$bilanTmp['ref'];
|
||||
}
|
||||
|
||||
$tabImg=$this->igreffe->getBilansImages($this->siren);
|
||||
// Tableau des références de bilans PDF Infogreffe
|
||||
foreach ($tabImg as $idxTmp=>$bilanTmp) {
|
||||
if ($bilanTmp['annee']>(date(Y)-4))
|
||||
$tabRefPdf[]=$bilanTmp['ref'];
|
||||
}
|
||||
|
||||
$tabDiff=array_diff($tabRefPdf, $tabRefXml);
|
||||
if (count($tabDiff)>0) {
|
||||
$strMillesimes='';
|
||||
foreach ($tabDiff as $value) {
|
||||
$tabTmp=explode('-',$value);
|
||||
$strMillesimes.=$tabTmp[0].', ';
|
||||
}
|
||||
@sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "Bilans non saisit sur $this->siren pour $strMillesimes",
|
||||
'Différence :'.EOL.print_r($tabDiff,true) .EOL.
|
||||
'Liste XML:'.EOL.print_r($tabRefXml, true) .EOL.
|
||||
'Liste PDF:'.EOL.print_r($tabRefPdf,true) .EOL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$tabTri=array();
|
||||
@ -576,23 +561,23 @@ class MBilans {
|
||||
** @param $refPart string Référence du bilan chez le partenaire (si $accesPartenaire=true)
|
||||
** @param $accesPartenaire bool Accès autorisé aux partenaires distant si le bilan est absenr
|
||||
**/
|
||||
function getBilan($millesime='', $typeBilan='N', $refPart=0, $accesPartenaire=false)
|
||||
public function getBilan($millesime='', $typeBilan='N', $refPart=0, $accesPartenaire=false)
|
||||
{
|
||||
$classWDate = new WDate();
|
||||
|
||||
$millesimeDB=$classWDate->dateT('d/m/Y','Ymd',$millesime);
|
||||
$iDb2=new WDB();
|
||||
if ($accesPartenaire)
|
||||
// On ne veut pas de bilans "Téléchargés" directement sur Internet
|
||||
$strSansBilansWeb=' AND partenaire<>7 ';
|
||||
else
|
||||
$strSansBilansWeb='';
|
||||
|
||||
$ret=$iDb2->select('bilans', 'dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaie, typeBilan, monnaieOrigine, unite, postes, partenaire, id, confidentiel, dateInsert', "siren='$this->siren' AND typeBilan='$typeBilan' AND dateExercice='$millesimeDB' $strSansBilansWeb", true, MYSQL_ASSOC);
|
||||
$iGreffe = new MGreffes();
|
||||
$ret = $this->iDb->select('bilans', 'dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaie, typeBilan, monnaieOrigine, unite, postes, partenaire, id, confidentiel, dateInsert', "siren='$this->siren' AND typeBilan='$typeBilan' AND dateExercice='$millesimeDB' $strSansBilansWeb", true, MYSQL_ASSOC);
|
||||
$bilan=$ret[0];
|
||||
if (count($ret)==0 && $accesPartenaire) {
|
||||
if ($refPart=='' || $refPart==0) {
|
||||
$tabTmp=$this->igreffe->getListeBilans($this->siren);
|
||||
$tabTmp = $iGreffe->getListeBilans($this->siren);
|
||||
foreach ($tabTmp as $idx=>$bil) {
|
||||
$typeBil=substr($idx,0,1);
|
||||
$millBil=substr($idx,1,10);
|
||||
@ -603,7 +588,7 @@ class MBilans {
|
||||
}
|
||||
}
|
||||
|
||||
$tabBilan=$this->igreffe->getBilan($this->siren, $refPart);
|
||||
$tabBilan = $iGreffe->getBilan($this->siren, $refPart);
|
||||
|
||||
if ($tabBilan)
|
||||
{
|
||||
@ -1102,7 +1087,7 @@ class MBilans {
|
||||
* @param $bilanRS array Bilan au format réel simplifé (2033)
|
||||
* @return array Bilan au format réel Normal (2050)
|
||||
*/
|
||||
function bilanSimplifie2Normal($bilanRS)
|
||||
public function bilanSimplifie2Normal($bilanRS)
|
||||
{
|
||||
$bilanRN=array();
|
||||
foreach ($this->tabBS2BN as $posteRN => $formule) {
|
||||
@ -1158,4 +1143,4 @@ class MBilans {
|
||||
return $bilanRN;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -33,9 +33,11 @@ class MTel
|
||||
* Information contact
|
||||
* @param string $siret
|
||||
* @param string $nic
|
||||
* @return array();
|
||||
* @param boolean $last
|
||||
* @param int $actif
|
||||
* @return array Retourne une liste de téléphone
|
||||
*/
|
||||
public function getTel($siret, $nic=0)
|
||||
public function getTel($siret, $nic=0, $last=false, $actif=null)
|
||||
{
|
||||
$tabRet=array();
|
||||
|
||||
@ -46,6 +48,8 @@ class MTel
|
||||
$siren=$siret*1;
|
||||
}
|
||||
|
||||
if ($siren<1000) return $tabRet;
|
||||
|
||||
/** Si le siren est de taille < à 9, on ajoute des 0 significatifs **/
|
||||
if (strlen($siren)<=9) {
|
||||
$siren = str_pad($siren, 9, '0', STR_PAD_LEFT);
|
||||
@ -56,12 +60,15 @@ class MTel
|
||||
|
||||
$strNic='';
|
||||
if ($nic*1>0) $strNic="AND (nic=$nic OR nic=0)";
|
||||
$ret = $this->iDb->select(
|
||||
$strActif='';
|
||||
if ($actif==1) $strActif=" AND actif=1 ";
|
||||
elseif($actif==0) $strActif=" AND actif=0 ";
|
||||
$ret=$this->iDb->select(
|
||||
'telephonie',
|
||||
'siren, nic, dateProvPartenaire, typeTel, infoTel, LPAD(telephone,10,0) AS telephone, actif, partenaire, dateInsert',
|
||||
"siren=$siren $strNic", false, MYSQL_ASSOC);
|
||||
'siren,nic,dateProvPartenaire,typeTel,infoTel,LPAD(telephone,10,0) AS telephone,actif,partenaire,idUtilisateur,dateInsert,dateInsert*1 AS dateInsertYmd,dateConfPartenaire,partenaireConf,nbConf,idUpdate,dateUpdate,dateUpdate*1 AS dateUpdateYmd',
|
||||
"siren=$siren $strNic $strActif AND dateSuppr=0 ORDER BY typeTel ASC, nbConf DESC", false, MYSQL_ASSOC);
|
||||
|
||||
if ( count($ret)>0 ) {
|
||||
if (count($ret)>0) {
|
||||
|
||||
$this->enCache=true;
|
||||
foreach ($ret as $tabTel)
|
||||
@ -74,20 +81,36 @@ class MTel
|
||||
$infoTel=$tabTel['infoTel'];
|
||||
}
|
||||
|
||||
$tabRet[] = array(
|
||||
'siren' => $siren,
|
||||
'nic' => $tabTel['nic'],
|
||||
'typeTel' => $tabTel['typeTel'],
|
||||
'infoTel' => $infoTel,
|
||||
'telephone' => $tabTel['telephone'],
|
||||
'actif' => $tabTel['actif'],
|
||||
);
|
||||
if ($tabTel['partenaireConf']>0) $source=$tabTel['partenaireConf'];
|
||||
else $source=$tabTel['partenaire'];
|
||||
if ($tabTel['dateUpdateYmd']>$tabTel['dateInsertYmd']) $dateMAJ=$tabTel['dateUpdateYmd'];
|
||||
else $dateMAJ=$tabTel['dateInsertYmd'];
|
||||
|
||||
$tabR = array(
|
||||
'siren'=>$siren,
|
||||
'nic'=>$tabTel['nic'],
|
||||
'typeTel'=>$tabTel['typeTel'],
|
||||
'infoTel'=>$infoTel,
|
||||
'telephone'=>$tabTel['telephone'],
|
||||
'actif'=>$tabTel['actif'],
|
||||
'source'=>$source,
|
||||
'dateMAJ'=>$dateMAJ,
|
||||
);
|
||||
$tabRet[]=$tabR;
|
||||
if ($last) {
|
||||
if ($source==175 && !@isset($tabLast[$tabTel['typeTel']][1])) @$tabLast[$tabTel['typeTel']][1]=$tabR;
|
||||
elseif(($source==118 ||
|
||||
$source==250 ||
|
||||
$source==253) && !@isset($tabLast[$tabTel['typeTel']][2])) @$tabLast[$tabTel['typeTel']][2]=$tabR;
|
||||
elseif ($source<>2 && !@isset($tabLast[$tabTel['typeTel']][3])) @$tabLast[$tabTel['typeTel']][3]=$tabR;
|
||||
elseif ($source==2 && !@isset($tabLast[$tabTel['typeTel']][4])) @$tabLast[$tabTel['typeTel']][4]=$tabR;
|
||||
}
|
||||
}
|
||||
|
||||
} elseif ( $this->accesDistant ) {
|
||||
} elseif ($this->accesDistant) {
|
||||
|
||||
$this->enCache=false;
|
||||
$tabPost=array(
|
||||
$this->enCache=false;
|
||||
$tabPost = array(
|
||||
'p_ACTION'=>'',
|
||||
'p_ORDRE'=>'AfficheRes',
|
||||
'a_PAGE'=>'1',
|
||||
@ -246,6 +269,14 @@ class MTel
|
||||
}
|
||||
}
|
||||
|
||||
if ($last) {
|
||||
$tabRet=array();
|
||||
foreach($tabLast as $typeTel=>$tabPriorite) {
|
||||
ksort($tabPriorite);
|
||||
$tabRet[]=current($tabPriorite);
|
||||
}
|
||||
}
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,6 @@ class Enrichissement
|
||||
'NaceEnLib' => "SD : NACE Entreprise",
|
||||
),
|
||||
),
|
||||
|
||||
'SiretEnBase' => array(
|
||||
'lib' => "Vérifier la présence en base du siren/siret"
|
||||
),
|
||||
@ -529,6 +528,11 @@ class Enrichissement
|
||||
'precis' => "Précision du géocodage (de 0=non géocodé à 8/9=géocodage à l'adresse)",
|
||||
)
|
||||
),
|
||||
'TelOrder' => array(
|
||||
'lib' => 'Telephone priorisé',
|
||||
'help' => "",
|
||||
'columns' => array()
|
||||
),
|
||||
);
|
||||
|
||||
public function __construct(){}
|
||||
|
@ -254,6 +254,7 @@ $tabDico = array(
|
||||
'GPS',
|
||||
'NaceEtab',
|
||||
'NaceEnt',
|
||||
'TelOrder'
|
||||
),
|
||||
'multiple' => array(
|
||||
'actionnaires',
|
||||
@ -968,11 +969,12 @@ function bilanNEntete($values)
|
||||
}
|
||||
function bilanNData($siren, $nic, $values = false)
|
||||
{
|
||||
require_once 'Metier/partenaires/classMBilans.php';
|
||||
global $iDb;
|
||||
require_once 'Metier/partenaires/classMBilans.php';
|
||||
$tabPostes = explode(',', $values);
|
||||
$annee = 0;
|
||||
$tabData = array();
|
||||
$mBil = new MBilans($siren);
|
||||
$mBil = new MBilans($siren, $iDb);
|
||||
/*
|
||||
* @todo : Pouvoir appeler la liste des bilans en fonction du TYPE, sans les chiffres
|
||||
* jo.bilans => Liste mais postes dans chaine de caractère
|
||||
@ -1012,11 +1014,12 @@ function bilanN1Entete($values)
|
||||
}
|
||||
function bilanN1Data($siren, $nic, $values = false)
|
||||
{
|
||||
require_once 'Metier/partenaires/classMBilans.php';
|
||||
global $iDb;
|
||||
require_once 'Metier/partenaires/classMBilans.php';
|
||||
$tabPostes = explode(',', $values);
|
||||
$annee = 1;
|
||||
$tabData = array();
|
||||
$mBil = new MBilans($siren);
|
||||
$mBil = new MBilans($siren, $iDb);
|
||||
$tabBilans = $mBil->listeBilans(false, 9);
|
||||
if (count($tabBilans)>0) {
|
||||
$tabBi = findBilan($siren, $tabBilans, $annee);
|
||||
@ -1051,11 +1054,12 @@ function bilanN2Entete($values)
|
||||
}
|
||||
function bilanN2Data($siren, $nic, $values = false)
|
||||
{
|
||||
require_once 'Metier/partenaires/classMBilans.php';
|
||||
global $iDb;
|
||||
require_once 'Metier/partenaires/classMBilans.php';
|
||||
$tabPostes = explode(',', $values);
|
||||
$annee = 2;
|
||||
$tabData = array();
|
||||
$mBil = new MBilans($siren);
|
||||
$mBil = new MBilans($siren, $iDb);
|
||||
$tabBilans = $mBil->listeBilans(false, 9);
|
||||
if (count($tabBilans)>0) {
|
||||
$tabBi = findBilan($siren, $tabBilans, $annee);
|
||||
@ -1074,8 +1078,9 @@ function bilanN2Data($siren, $nic, $values = false)
|
||||
|
||||
function findBilan($siren, $tabBilans, $position = 0)
|
||||
{
|
||||
require_once 'Metier/partenaires/classMBilans.php';
|
||||
$mBil = new MBilans($siren);
|
||||
global $iDb;
|
||||
require_once 'Metier/partenaires/classMBilans.php';
|
||||
$mBil = new MBilans($siren, $iDb);
|
||||
//Trier et Supprimer les bilans consolidés
|
||||
$tabBilN = $tabBilS = array();
|
||||
foreach ($tabBilans as $typeMil => $bilan) {
|
||||
@ -1097,174 +1102,12 @@ function findBilan($siren, $tabBilans, $position = 0)
|
||||
$countBilan++;
|
||||
}
|
||||
if ($tabBi['CONSOLIDE'] == 'S'){
|
||||
$bilanT = bilanSimplifie2Normal($tabBi);
|
||||
$bilanT = $mBil->bilanSimplifie2Normal($tabBi);
|
||||
$tabBi = $tabBi + $bilanT;
|
||||
}
|
||||
return $tabBi;
|
||||
}
|
||||
|
||||
|
||||
function bilanSimplifie2Normal($bilanRS)
|
||||
{
|
||||
$tabBS2BN = array(
|
||||
'AH'=>'010',
|
||||
'AI'=>'012',
|
||||
'AI1'=>'013',
|
||||
'AJ'=>'014',
|
||||
'AK'=>'016',
|
||||
'AK1'=>'017',
|
||||
'AT'=>'028',
|
||||
'AU'=>'030',
|
||||
'AU1'=>'031',
|
||||
'BH'=>'040',
|
||||
'BI'=>'042',
|
||||
'BI1'=>'043',
|
||||
'BJ'=>'044',
|
||||
'BK'=>'048',
|
||||
'BK1'=>'049',
|
||||
'BL'=>'050',
|
||||
'BM'=>'052',
|
||||
'BM1'=>'053',
|
||||
'BT'=>'060',
|
||||
'BU'=>'062',
|
||||
'BU1'=>'063',
|
||||
'BV'=>'064',
|
||||
'BW'=>'066',
|
||||
'BW1'=>'067',
|
||||
'BX'=>'068',
|
||||
'BY'=>'070',
|
||||
'BY1'=>'071',
|
||||
'BZ'=>'072',
|
||||
'CA'=>'074',
|
||||
'CA1'=>'075',
|
||||
'CD'=>'080',
|
||||
'CE'=>'082',
|
||||
'CE1'=>'083',
|
||||
'CF'=>'084',
|
||||
'CG'=>'086',
|
||||
'CG1'=>'087',
|
||||
'CH'=>'092',
|
||||
'CI'=>'094',
|
||||
'CI1'=>'095',
|
||||
'CJ'=>'096',
|
||||
'CK'=>'098',
|
||||
'CK1'=>'099',
|
||||
'CO'=>'110',
|
||||
'1A'=>'112',
|
||||
'1A1'=>'113',
|
||||
'DA'=>'120',
|
||||
'DC'=>'124',
|
||||
'DD'=>'126',
|
||||
'DF'=>'130',
|
||||
'DG'=>'132',
|
||||
'DH'=>'134',
|
||||
'DI'=>'136',
|
||||
'DK'=>'140',
|
||||
'DL'=>'142',
|
||||
'DR'=>'154',
|
||||
'DP'=>'154',
|
||||
'DU'=>'156',
|
||||
'DV'=>'169',
|
||||
'DW'=>'164',
|
||||
'DX'=>'166',
|
||||
'EA'=>'172-169',
|
||||
'EB'=>'174',
|
||||
'EC'=>'176',
|
||||
'EE'=>'180',
|
||||
'EH'=>'156-195',
|
||||
'FA'=>'210-209',
|
||||
'FB'=>'209',
|
||||
'FC'=>'210',
|
||||
'FD'=>'214-215',
|
||||
'FE'=>'215',
|
||||
'FF'=>'214',
|
||||
'FH'=>'217',
|
||||
'FI'=>'218',
|
||||
'FK'=>'209+215+217',
|
||||
'FL'=>'210+214+218',
|
||||
'FM'=>'222',
|
||||
'FN'=>'224',
|
||||
'FO'=>'226',
|
||||
'FQ'=>'230',
|
||||
'FR'=>'232',
|
||||
'FS'=>'234',
|
||||
'FT'=>'236',
|
||||
'FU'=>'238',
|
||||
'FV'=>'240',
|
||||
'FW'=>'242',
|
||||
'FX'=>'244',
|
||||
'FY'=>'250',
|
||||
'FZ'=>'252',
|
||||
'GA'=>'254',
|
||||
'GE'=>'262',
|
||||
'GF'=>'264',
|
||||
'GG'=>'270',
|
||||
'GP'=>'280',
|
||||
'GU'=>'294',
|
||||
'GW'=>'270+280+294',
|
||||
'HD'=>'290',
|
||||
'HH'=>'300',
|
||||
'HI'=>'290-300',
|
||||
'HK'=>'306',
|
||||
'HL'=>'232+280+290',
|
||||
'HM'=>'264+294+300+306',
|
||||
'HN'=>'310',
|
||||
'YY'=>'374',
|
||||
'YZ'=>'378',
|
||||
'YP'=>'376',
|
||||
);
|
||||
|
||||
$bilanRN=array();
|
||||
foreach ($tabBS2BN as $posteRN => $formule) {
|
||||
if (preg_match('/\+|\-/', $formule)) {
|
||||
$tabTmp=preg_split('/\+|\-/', $formule, -1, PREG_SPLIT_OFFSET_CAPTURE);
|
||||
//$bilanRN[$posteRN]=0;
|
||||
$scalc='';
|
||||
foreach ($tabTmp as $i=>$tab) {
|
||||
if ($i==0) {
|
||||
$bilanRN[$posteRN]=$bilanRS[$tab[0]];
|
||||
$scalc.=$bilanRS[$tab[0]];
|
||||
}
|
||||
else {
|
||||
$signe=$formule[$tab[1]-1];
|
||||
$scalc.=$signe;
|
||||
if ($signe=='+') $bilanRN[$posteRN]+=$bilanRS[$tab[0]];
|
||||
elseif ($signe=='-') $bilanRN[$posteRN]-=$bilanRS[$tab[0]];
|
||||
$scalc.=$bilanRS[$tab[0]];
|
||||
}
|
||||
}
|
||||
$bilanRN[$posteRN]=$bilanRN[$posteRN];
|
||||
}
|
||||
else $bilanRN[$posteRN]=$bilanRS[$formule];
|
||||
}
|
||||
if ($bilanRS['240']<>0) {
|
||||
$bilanRN['BL']=$bilanRS['050'];
|
||||
$bilanRN['BM']=$bilanRS['052'];
|
||||
} else {
|
||||
$bilanRN['BN']=$bilanRS['050'];
|
||||
$bilanRN['BO']=$bilanRS['052'];
|
||||
}
|
||||
|
||||
if ($bilanRS['070']<>0 || $bilanRS['074']<>0 || $bilanRS['052']<>0 || $bilanRS['062']<>0)
|
||||
$bilanRN['GC']=$bilanRS['256'];
|
||||
elseif ($bilanRS['070']==0 && $bilanRS['074']==0 && $bilanRS['052']==0 && $bilanRS['062']==0 && $bilanRS['254']<>0)
|
||||
$bilanRN['GD']=$bilanRS['256'];
|
||||
|
||||
if ($bilanRS['584']<>0) {
|
||||
$bilanRN['HB']=$bilanRS['584'];
|
||||
$bilanRN['HA']=$bilanRS['290']-$bilanRS['584'];
|
||||
} else
|
||||
$bilanRN['HA']=$bilanRS['290'];
|
||||
|
||||
if ($bilanRS['582']<>0) {
|
||||
$bilanRN['HF']=$bilanRS['582'];
|
||||
$bilanRN['HE']=$bilanRS['582']-$bilanRS['300'];
|
||||
} else
|
||||
$bilanRN['HE']=$bilanRS['300'];
|
||||
|
||||
return $bilanRN;
|
||||
}
|
||||
|
||||
function annoncesEntete($values)
|
||||
{
|
||||
if ($values!==false) {
|
||||
@ -1599,7 +1442,7 @@ function NaceEntEntete()
|
||||
'NaceEnLib',
|
||||
);
|
||||
}
|
||||
function NaceEntData()
|
||||
function NaceEntData($siren, $nic, $values)
|
||||
{
|
||||
global $iDb;
|
||||
$tabData = array(
|
||||
@ -1616,6 +1459,36 @@ function NaceEntData()
|
||||
return $tabData;
|
||||
}
|
||||
|
||||
function TelOrderEntete()
|
||||
{
|
||||
return array(
|
||||
'TelOrderTypeTel',
|
||||
'TelOrderInfoTel',
|
||||
'TelOrderTelephone',
|
||||
'TelOderSource',
|
||||
'TelOrderDate',
|
||||
);
|
||||
}
|
||||
function TelOrderData($siren, $nic, $values)
|
||||
{
|
||||
require_once 'Metier/partenaires/classMTel.php';
|
||||
|
||||
$c = new MTel();
|
||||
$result = $c->getTel($siren, 0, true, 1);
|
||||
if ( count($result)>0 ) {
|
||||
$element = array(
|
||||
'TelOrderTypeTel' => $result['typeTel'],
|
||||
'TelOrderInfoTel' => $result['infoTel'],
|
||||
'TelOrderTelephone' => $result['telephone'],
|
||||
'TelOderSource' => $result['source'],
|
||||
'TelOrderDate' => $result['dateMAJ'],
|
||||
);
|
||||
|
||||
$tabData[] = $element;
|
||||
}
|
||||
|
||||
return $tabData;
|
||||
}
|
||||
|
||||
function actionnairesEntete()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user