Following the update code from server
This commit is contained in:
parent
d481c4f5d4
commit
db29799b8b
@ -24,6 +24,7 @@ $tabTypeAsso=array(
|
||||
'_666'=>array('even'=>8090,'type'=>'Suppression', 'forme'=>'FON','lib'=>'FONDATION/DISSOLUTION/ANNULATION'),
|
||||
'_201'=>array('even'=>8079,'type'=>'Insertion', 'forme'=>'ASL','lib'=>'ASL/MODIFICATION'),
|
||||
'_202'=>array('even'=>8079,'type'=>'Rectificatif', 'forme'=>'ASL','lib'=>'ASL/MODIFICATION/RECTIFICATIF'),
|
||||
'_203'=>array('even'=>8079,'type'=>'Suppression', 'forme'=>'ASL','lib'=>'ASL/MODIFICATION/ANNULATION'),
|
||||
'_301'=>array('even'=>8090,'type'=>'Insertion', 'forme'=>'ASL','lib'=>'ASL/DISSOLUTION'),
|
||||
'_302'=>array('even'=>8090,'type'=>'Rectificatif', 'forme'=>'ASL','lib'=>'ASL/DISSOLUTION/RECTIFICATIF'),
|
||||
'_303'=>array('even'=>8090,'type'=>'Suppression', 'forme'=>'ASL','lib'=>'ASL/DISSOLUTION/ANNULATION'),
|
||||
@ -784,7 +785,7 @@ class MBodacc
|
||||
' DU MANS'=>' LE MANS',
|
||||
' DU CREUSOT'=>' LE CREUSOT',
|
||||
' DU HAVRE'=>' LE HAVRE',
|
||||
' DU '=>' ', 'PUY'=>'PUY EN VELAY',
|
||||
' DU '=>' ', 'PUY'=>'PUY EN VELAY', 'LE PUY EN VELAY'=>'PUY EN VELAY',
|
||||
'ALÈS'=>'ALES',
|
||||
'.'=>' ',
|
||||
)
|
||||
@ -822,6 +823,8 @@ class MBodacc
|
||||
return $code;
|
||||
elseif ( $dep==975 && $libelleDuTribunal=='TGI SAINT PIERRE')
|
||||
return $code;
|
||||
elseif ( $dep==70 && $libelleDuTribunal=='TC VESOUL')
|
||||
return $code;
|
||||
|
||||
elseif ( ($dep==95 || $dep==975) &&
|
||||
($libelleDuTribunal=='TRIBUNAL PREMIERE INSTANCE SAINT PIERRE ET MIQUELON' || $libelleDuTribunal=='TPI SAINT PIERRE ET MIQUELON')
|
||||
@ -1048,6 +1051,12 @@ class MBodacc
|
||||
} else
|
||||
die("Cas non gérée pour cette structure de noms : '$noms'");
|
||||
/** @todo Il manque le cas de repr par pour le STE ??? **/
|
||||
if (preg_match('/(en fonction le)|(modification le)/Ui', $nom)) {
|
||||
echo "Je remplace le nom du dirigeant BODACC '$nom' par ";
|
||||
$nom=preg_replace('/\s+en fonction le.*$/','', $nom);
|
||||
$nom=preg_replace('/\s+modification le.*$/','', $nom);
|
||||
echo "'$nom'".EOL;
|
||||
}
|
||||
$tabRet[]=array('fonction'=>$numFonction, 'rs'=>trim(str_replace(',','',$raisonSociale)), 'nom'=>$nom, 'prenom'=>$prenom, 'nomUsage'=>$usage, 'depart'=>$oldFonction);
|
||||
}
|
||||
}
|
||||
|
@ -2266,9 +2266,8 @@ class MInsee
|
||||
|
||||
/** Informations INSEE **/
|
||||
if ($siren>100) {
|
||||
$insee=$this->iDb->select(
|
||||
'insee.identite',
|
||||
'ACTIF%10 AS ACTIF, actifEco%10 AS actifEco, NOM, NOM2, SIGLE, ENSEIGNE, ADR_NUMVOIE, ADR_BTQ, ADR_TYPVOIE, ADR_LIBVOIE, ADR_LIBCOM, ADR_CP, ADR_COMP, ADR_DISTSP, PAYS, DCREN, SIEGE, AUXILT, SAISONAT, CJ, CIVILITE, NBETAB, APE_ENT, APE_ETAB, PROCOL, PROCOL_TYPE, PROCOL_DATE, CAPITAL, EFF_ENT, NUMRC, TEL, FAX, DIR_FCT, DIR_IDEN, DIR_DATEN, DIR_LIEUN, CAPITAL_DATE, CAPITAL_DEV, DCRET, TEFF_ENT, ADR_DEP, ADR_COM, TCA, TCAEXP, EFF_ET, TEFF_ET, CODEVOIE, DATE_MAJ, APRM, ACTIVNAT, ORIGINE, MODET, EXPLET, LIEUACT, ACTISURF, DEFET, MODEN, PRODPART, EXPLEN, MONOREG, REGIMP, MONOACT, DEFEN, DEFET, IDENTITE_PRE',
|
||||
$insee = $this->iDb->select('insee.identite',
|
||||
'ACTIF%10 AS ACTIF, actifEco%10 AS actifEco, NOM, NOM2, SIGLE, ENSEIGNE, ADR_NUMVOIE, ADR_BTQ, ADR_TYPVOIE, ADR_LIBVOIE, ADR_LIBCOM, ADR_CP, ADR_COMP, ADR_DISTSP, PAYS, DCREN, SIEGE, AUXILT, SAISONAT, CJ, CIVILITE, NBETAB, APE_ENT, APE_ETAB, PROCOL, PROCOL_TYPE, PROCOL_DATE, CAPITAL, EFF_ENT, NUMRC, TEL, FAX, DIR_FCT, DIR_IDEN, DIR_DATEN, DIR_LIEUN, CAPITAL_DATE, CAPITAL_DEV, DCRET, TEFF_ENT, ADR_DEP, ADR_COM, TCA, TCAEXP, EFF_ET, TEFF_ET, CODEVOIE, DATE_MAJ, APRM, ACTIVNAT, ORIGINE, MODET, EXPLET, LIEUACT, ACTISURF, DEFET, MODEN, PRODPART, EXPLEN, MONOREG, REGIMP, MONOACT, DEFEN, DEFET, IDENTITE_PRE, insL1_NOMEN, insL2_COMP, insL3_CADR, insL4_VOIE, insL5_DISP, insL6_POST, insL7_ETRG, dateMajRNVP, insCATEGORIE, insIND_PUBLIPO, RPET, ARRONET, CTONET, DU, TU, UU, TCD, ZEMET, ESAANN, ESAAPEN, DREACTET, AMINTRET, DREACTEN, AMINTREN, NOMEN_LONG, CEDEX, EPCI, NOM_COM, NATETAB, PRODET, PRODEN',
|
||||
"SIREN=$siren $strNic ORDER BY SIEGE DESC, ACTIF DESC LIMIT 0,1",false,MYSQL_ASSOC);
|
||||
if (count($insee)>0) {
|
||||
$tabInsee=$insee[0];
|
||||
@ -2277,6 +2276,12 @@ class MInsee
|
||||
$tabInsee['RECME']=$tabNotice['insRECME'];
|
||||
// On force l'indicateur "actifEco" à 0 si l'établissement est juridiquement inactif
|
||||
if ($tabInsee['ACTIF']*1==0) $tabInsee['actifEco']=0;
|
||||
if (trim($tabInsee['CODEVOIE'])=='') {
|
||||
$codeCommune=$tabInsee['ADR_DEP'].sprintf("%03s",$tabInsee['ADR_COM']);
|
||||
//echo $codeCommune.','.$tabInsee['ADR_TYPVOIE'].','.$tabInsee['ADR_LIBVOIE'].EOL;
|
||||
$tabInsee['CODEVOIE']=$this->getCodeVoieRivoli($codeCommune, $tabInsee['ADR_TYPVOIE'], $tabInsee['ADR_LIBVOIE']);
|
||||
//echo $tabInsee['CODEVOIE'].EOL;
|
||||
}
|
||||
} else {
|
||||
// Siren absent de l'Insee
|
||||
$tabInsee = array(
|
||||
@ -2730,7 +2735,42 @@ class MInsee
|
||||
'APRM'=>$tabInsee['APRM'],
|
||||
'APRM_Lib'=>$this->getLibelleNafa($tabInsee['APRM']),
|
||||
'AutreSiret'=>$tabAssoc,
|
||||
// MODET,
|
||||
|
||||
'L1_NOMEN'=>$tabInsee['insL1_NOMEN'], // Nom ou raison sociale de l'entreprise pour l'adressage
|
||||
'L2_COMP'=> $tabInsee['insL2_COMP'], // Complément de nom de l'entreprise pour l'adressage
|
||||
'L3_CADR'=> $tabInsee['insL3_CADR'], // Complément d'adresse pour l.adressage
|
||||
'L4_VOIE'=> $tabInsee['insL4_VOIE'], // Numéro et libellé dans la voie
|
||||
'L5_DISP'=> $tabInsee['insL5_DISP'], // Distribution spéciale
|
||||
'L6_POST'=> $tabInsee['insL6_POST'], // Ligne d'acheminement postal pour l'adressage
|
||||
'L7_ETRG'=> $tabInsee['insL7_ETRG'], // Libellé du pays pour les adresses à l'étranger
|
||||
'IND_PUBLIPO'=> $tabInsee['insIND_PUBLIPO'], // Indicateur du champ de publipostage
|
||||
'dateMajRNVP'=>$tabInsee['dateMajRNVP'],
|
||||
'RNVP_Niveau'=>0,
|
||||
|
||||
'RPET'=> $tabInsee['RPET'], //
|
||||
'ARRONET'=> $tabInsee['ARRONET'], //
|
||||
'CTONET'=> $tabInsee['CTONET'], //
|
||||
'DU'=> $tabInsee['DU'], //
|
||||
'TU'=> $tabInsee['TU'], //
|
||||
'UU'=> $tabInsee['UU'], //
|
||||
'TCD'=> $tabInsee['TCD'], //
|
||||
'ZEMET'=> $tabInsee['ZEMET'], //
|
||||
'ESAANN'=> $tabInsee['ESAANN'], //
|
||||
'ESAAPEN'=> $tabInsee['ESAAPEN'], //
|
||||
|
||||
'DREACTET'=> $tabInsee['DREACTET'], //
|
||||
'AMINTRET'=> $tabInsee['AMINTRET'], //
|
||||
'DREACTEN'=> $tabInsee['DREACTEN'], //
|
||||
'AMINTREN'=> $tabInsee['AMINTREN'], //
|
||||
|
||||
'CATEGORIE'=> $tabInsee['insCATEGORIE'], // Catégorie d'entreprise
|
||||
'NOMEN_LONG'=> $tabInsee['NOMEN_LONG'], // Nom ou raison sociale de l'entreprise
|
||||
'PRODET'=> $tabInsee['PRODET'],
|
||||
'PRODEN'=> $tabInsee['PRODEN'],
|
||||
'NATETAB'=> $tabInsee['NATETAB'],
|
||||
'CEDEX'=> $tabInsee['CEDEX'],
|
||||
'EPCI'=> $tabInsee['EPCI'],
|
||||
// MODET,
|
||||
);
|
||||
|
||||
/** Estimation du Chiffre d'affaires **/
|
||||
@ -2940,6 +2980,8 @@ class MInsee
|
||||
if ($tmp[0]['insCIVILITE']==1) $tabRet['dir1Genre']='M';
|
||||
elseif ($tmp[0]['insCIVILITE']==2) $tabRet['dir1Genre']='F';
|
||||
else $tabRet['dir1Genre']='';
|
||||
|
||||
$entrep['sexe']=$tabRet['dir1Genre'];
|
||||
unset($tmp);
|
||||
}
|
||||
|
||||
@ -5635,6 +5677,16 @@ class MInsee
|
||||
insEAEAPET, insEAESEC1T, insEAESEC2T, insEAEANN, insEAEAPEN, insEAESEC1N, insEAESEC2N, insEAESEC3N,
|
||||
insEAESEC4N, dateNotice',
|
||||
"insSIREN=$siren AND insNIC=$nic ORDER BY dateNotice DESC LIMIT 0,1", false, MYSQL_ASSOC);
|
||||
|
||||
if (count($tabTmp)==0)
|
||||
$tabTmp=$this->iDb->select('insee.insee_even',
|
||||
"insSIREN, insNIC, insL4_VOIE, insL6_POST, insRPET, insDEPCOMEN, insRPEN, insARRONET, insCTONET, insTCD,
|
||||
insZEMET, insDU, insTU, insUU, insAMINTRET, insAMINTREN, insVMAJ, insVMAJ1, insVMAJ2, insVMAJ3,
|
||||
'' AS insRECME, '' AS insEAEANT, '' AS insEAEAPET, '' AS insEAESEC1T, '' AS insEAESEC2T,
|
||||
insESAANN AS insEAEANN, insESAPEN AS insEAEAPEN, insESASEC1N AS insEAESEC1N, insESASEC2N AS insEAESEC2N,
|
||||
insESASEC3N AS insEAESEC3N, insESASEC4N AS insEAESEC4N, dateInsert AS dateNotice",
|
||||
"insSIREN=$siren AND insNIC=$nic ORDER BY dateInsert DESC LIMIT 0,1", false, MYSQL_ASSOC);
|
||||
|
||||
return $tabTmp[0];
|
||||
}
|
||||
|
||||
@ -6480,6 +6532,34 @@ class MInsee
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $codeCommune
|
||||
* @param unknown $adrTypVoie
|
||||
* @param unknown $adrLibVoie
|
||||
* @return string|Ambigous <string, multitype:>
|
||||
*/
|
||||
public function getCodeVoieRivoli($codeCommune, $adrTypVoie, $adrLibVoie)
|
||||
{
|
||||
$codeVoie='';
|
||||
$adrLibVoie2=addslashes($adrLibVoie);
|
||||
$tDeb=microtime(1);
|
||||
$ret=$this->iDb->select('insee.fantoirVoi', "codComInsee, idVoieCom, cleRivoli, voieNature, voieLib, 1 AS score",
|
||||
"codComInsee='$codeCommune' AND voieNature='$adrTypVoie' AND voieLib='$adrLibVoie2'",false, MYSQL_ASSOC);
|
||||
$nbRet = count($ret);
|
||||
if ($nbRet == 0) {
|
||||
return ''; //'Aucune correspondance Rivoli'.EOL;
|
||||
} else {
|
||||
foreach($ret as $i=>$iRet) {
|
||||
if ($iRet['voieNature'] == $adrTypVoie && $iRet['voieLib'] == $adrLibVoie) {
|
||||
$codeVoie=$iRet['idVoieCom'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $codeVoie;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information de l'événement précédent associé
|
||||
* @param string $siren
|
||||
|
@ -293,6 +293,225 @@ class MAmabis
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Corriger les adresses présentes dans CEDEXA (toutes les lignes)
|
||||
* @todo Ligne 3, acheter HEXALIGNE3
|
||||
*/
|
||||
function normaliseAdresse($adrL1, $adrL2, $adrL3, $adrL4, $adrL5, $adrL6, $adrL7='', $norme=38) {
|
||||
if ($norme<>32 && $norme<>38) {
|
||||
return 'La norme doit être 32 ou 38 caractères (38 par défaut)'.EOL;
|
||||
}
|
||||
|
||||
$iInsee=new MInsee();
|
||||
$iDb=new WDB('villes');
|
||||
$adrL=array();
|
||||
$adrL[1]=$adrL1=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL1)))));
|
||||
$adrL[2]=$adrL2=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL2)))));
|
||||
$adrL[3]=$adrL3=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL3)))));
|
||||
$adrL[4]=$adrL4=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL4)))));
|
||||
$adrL[5]=$adrL5=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL5)))));
|
||||
$adrL[6]=$adrL6=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL6)))));
|
||||
$adrL[7]=$adrL7=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL7)))));
|
||||
if ($adrL7<>'' || $adrL7<>'FRANCE' || $adrL7<>'MONACO')
|
||||
$tabLen=$tabMaxLen=array();
|
||||
$tabLen[1]=strlen($adrL1); if ($tabLen[1]>$norme) $tabMaxLen[]=1;
|
||||
$tabLen[2]=strlen($adrL2); if ($tabLen[2]>$norme) $tabMaxLen[]=2;
|
||||
$tabLen[3]=strlen($adrL3); if ($tabLen[3]>$norme) $tabMaxLen[]=3;
|
||||
$tabLen[4]=strlen($adrL4); if ($tabLen[4]>$norme) $tabMaxLen[]=4;
|
||||
$tabLen[5]=strlen($adrL5); if ($tabLen[5]>$norme) $tabMaxLen[]=5;
|
||||
$tabLen[6]=strlen($adrL6); if ($tabLen[6]>$norme) $tabMaxLen[]=6;
|
||||
$tabLen[7]=strlen($adrL7); if ($tabLen[7]>$norme) $tabMaxLen[]=7;
|
||||
if (count($tabMaxLen)>0) {
|
||||
//print_r($tabLen);
|
||||
foreach($tabMaxLen as $j) {
|
||||
echo "La ligne n°$j fait ".$tabLen[$j]." caractères : '".$adrL[$j]."'".EOL;
|
||||
}
|
||||
if ($j>1) die("Une des lignes fait plus de $norme caractères !".EOL);
|
||||
return "Une des lignes fait plus de $norme caractères !".EOL;
|
||||
}
|
||||
|
||||
$L1=$adrL1;
|
||||
$L2=$adrL2;
|
||||
|
||||
// Ligne 3, acheter HEXALIGNE3
|
||||
$L3=$adrL3;
|
||||
|
||||
// Ligne 5 et 7 par défaut
|
||||
$L7=$adrL7;
|
||||
$L5=$adrL5;
|
||||
|
||||
// Ligne 6 : CP + Localité
|
||||
$idAdr56=false;
|
||||
$tabAdr56k=$tabAdr56L=array();
|
||||
$cp=substr(trim($adrL6),0,5);
|
||||
$cp2=substr($cp,0,2);
|
||||
$ville=trim(strtr(substr($adrL6,5),array(' SAINT '=>' ST ',' SAINTE '=>' STE ')));
|
||||
$ret=$iDb->select( 'hexaviaVilles',
|
||||
"idAdr56, codeInseeCom, libCom$norme, codeInseeGlobal, indPluridis, libLigne5n$norme, indRoudis, codePostal, libLigne6n$norme, codeInseePre, codeMaj$norme, dateMaj$norme, MATCH (codePostal, libCom38) AGAINST ('$cp $ville' IN NATURAL LANGUAGE MODE) AS score",
|
||||
"(MATCH (codePostal, libCom38) AGAINST ('$cp $ville' IN NATURAL LANGUAGE MODE) OR MATCH (codePostal, libCom38) AGAINST ('$cp2 $ville' IN NATURAL LANGUAGE MODE)) /*OR codePostal='$cp' AND libCom$norme='$ville'*/",false, MYSQL_ASSOC);
|
||||
$nbRet=count($ret);
|
||||
if ($nbRet==0) return 'Aucune correspondance CP VILLE'.EOL;
|
||||
else {
|
||||
foreach($ret as $i=>$iRet) {
|
||||
//echo "je compare '$cp' avec '".$iRet['codePostal']."' et '$ville' avec '".$iRet["libCom$norme"]."' (".$iRet['idAdr56'].")".EOL;
|
||||
if (($iRet['codePostal']==$cp || substr($iRet['codePostal'],0,2)==$cp2) && ($iRet["libCom$norme"]==$ville || preg_replace('/ 0/', ' ',$iRet["libCom$norme"])==$ville) || (strpos($iRet["libCom$norme"],$ville)>0 && $nbRet==1)) {
|
||||
$idAdr56=$iRet['idAdr56'];
|
||||
$dateMajHexavia=$iRet["dateMaj$norme"];
|
||||
$hexaViaComCod=$iRet['codeInseeCom'];
|
||||
$hexaViaComLib=$iRet["libCom$norme"];
|
||||
$hexaViaCP=$iRet['codePostal'];
|
||||
$L5=$iRet["libLigne5n$norme"];
|
||||
$L6=$iRet['codePostal'].' '.$iRet["libLigne6n$norme"];
|
||||
$L7='';
|
||||
$tabAdr56k[]=$idAdr56;
|
||||
$tabAdr56L['_'.$idAdr56]=array('L5'=>$L5,'L6'=>$L6,'L7'=>$L7,);
|
||||
//break;
|
||||
}
|
||||
}
|
||||
if (!$idAdr56) {
|
||||
//print_r($ret);
|
||||
//die('Plusieurs correspondances CP VILLE'.EOL);
|
||||
return 'Plusieurs correspondances CP VILLE'.EOL;
|
||||
}
|
||||
}
|
||||
|
||||
/*if (count($ret)>1) {
|
||||
print_r($ret);
|
||||
die('Plusieurs correspondances CP VILLE'.EOL);
|
||||
return 'Plusieurs correspondances CP VILLE'.EOL;
|
||||
}
|
||||
elseif (count($ret)==1) {
|
||||
$ret=$ret[0];
|
||||
$idAdr56=$ret['idAdr56'];
|
||||
$L5=$ret["libLigne5n$norme"];
|
||||
$L6=$ret['codePostal'].' '.$ret["libLigne6n$norme"];
|
||||
$L7='';
|
||||
}*/
|
||||
|
||||
// Ligne 4 :
|
||||
$matriculeHexavia=false;
|
||||
if(preg_match('/(^(\d{0,4})\s?([a-z]{0,1}))\s(.*)$/i', $adrL4, $matches)) {
|
||||
$numVoieRep=$matches[1];
|
||||
$numVoie=$matches[2];
|
||||
$indRep=$matches[3];
|
||||
$libVoie=$matches[4];
|
||||
$libVoie5=substr($libVoie,0,5);
|
||||
$tabAdr=$iInsee->structureVoie($libVoie);
|
||||
$typeVoie=@$tabAdr['typeVoie'];
|
||||
preg_match('/([a-z\d]{1,20})$/i', $libVoie, $matches2);
|
||||
$derMot=$matches2[1];
|
||||
$derMot5=substr($derMot,0,5);
|
||||
//print_r($matches);
|
||||
//die($derMot);
|
||||
//foreach($tabAdr56 as $k=>$tabAdr56) //=array('idAdr56'=>$idAdr56,'L5'=>$L5,'L6'=>$L6,'L7'=>$L7,);
|
||||
$strAdr56=implode("','", $tabAdr56k);
|
||||
$ret=$iDb->select( 'hexaviaVoies',
|
||||
"idAdr56, codeVoie, derElemVoie, libVoie$norme, typeVoie, descLibVoie, indStand$norme, indScind, indHomo, codePostal, codeRoudis, codeMaj$norme, dateMaj$norme
|
||||
numImpMin, numImpMinExt, numImpMax, numImpMaxExt, numPairMin, numPairMinExt, numPairMax, numPairMaxExt, MATCH (libVoie38) AGAINST ('$libVoie' IN NATURAL LANGUAGE MODE) AS score",
|
||||
// "idAdr56='$idAdr56' AND (MATCH (libVoie38) AGAINST ('$libVoie' IN NATURAL LANGUAGE MODE) OR libVoie38 LIKE '$libVoie5%' OR derElemVoie LIKE '$libVoie5%')/*AND typeVoie='$typeVoie' AND derElemVoie='$derMot'*/",false, MYSQL_ASSOC);
|
||||
"idAdr56 IN ('$strAdr56') AND (MATCH (libVoie38) AGAINST ('$libVoie' IN NATURAL LANGUAGE MODE) OR libVoie38 LIKE '$libVoie5%' OR derElemVoie LIKE '$libVoie5%')/*AND typeVoie='$typeVoie' AND derElemVoie='$derMot'*/",false, MYSQL_ASSOC);
|
||||
$nbRet=count($ret);
|
||||
if ($nbRet==0) {
|
||||
// Vérifier si la commune à des voies normées 98816
|
||||
$ret=$iDb->select( 'hexaviaVoies', "codeVoie", "idAdr56 IN('$strAdr56')",false, MYSQL_ASSOC);
|
||||
$nbVoiesCom=count($ret);
|
||||
if (count($ret)==0) {
|
||||
return "Aucune Voie recensée dans cette commune ('$strAdr56') !".EOL;
|
||||
}
|
||||
return "Aucune correspondance Voie pour '$adrL4', '$libVoie' ($nbVoiesCom voies dans la commune #$idAdr56)".EOL;
|
||||
}
|
||||
else {
|
||||
foreach($ret as $i=>$iRet) {
|
||||
//echo "je compare '$libVoie' avec '".$iRet["libVoie$norme"]."'".EOL;
|
||||
if ($iRet["libVoie$norme"]==$libVoie || $iRet['derElemVoie']==$derMot || /*substr($iRet["libVoie$norme"],0,5)==$libVoie5 || */substr($iRet['derElemVoie'],0,5)==$derMot5) {
|
||||
$tabAdr=$iInsee->structureVoie($libVoie);
|
||||
if ($tabAdr['typeVoie']<>$iRet['typeVoie'] && $nbRet>1) continue;
|
||||
$idAdr56=$iRet['idAdr56'];
|
||||
$L4=preg_replace('/\s+/', ' ', trim($numVoie.' '.$indRep.' '.$iRet["libVoie$norme"]));
|
||||
$L4=preg_replace('/^0+/','',$L4);
|
||||
$hexaViaVoie=$iRet["libVoie$norme"];
|
||||
if (strlen($L4)>$norme) return "Taille de la ligne 4 générée en sortie plus longue que $norme !".EOL;
|
||||
$matriculeHexavia=$iRet['codeVoie'];
|
||||
$codeRoudis=$iRet['codeRoudis'];
|
||||
$L5=$tabAdr56L['_'.$idAdr56]['L5'];
|
||||
$L6=$tabAdr56L['_'.$idAdr56]['L6'];
|
||||
$L7=$tabAdr56L['_'.$idAdr56]['L7'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$matriculeHexavia) {
|
||||
//print_r($ret);
|
||||
// die("Plusieurs correspondances Voies pour $adrL4 $adrL6 dans cette commune ('$strAdr56') !".EOL);
|
||||
return 'Plusieurs correspondances Voies'.EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (count($ret)==0) {
|
||||
// Vérifier si la commune à des voies normées 98816
|
||||
$ret=$iDb->select( 'hexaviaVoies', "codeVoie", "idAdr56='$idAdr56'",false, MYSQL_ASSOC);
|
||||
if (count($ret)==0) {
|
||||
return 'Aucune Voie recensée dans cette commune !'.EOL;
|
||||
}
|
||||
return 'Aucune correspondance Voie'.EOL;
|
||||
}
|
||||
elseif (count($ret)>1) {
|
||||
print_r($ret);
|
||||
$tabAdr=$iInsee->structureVoie($libVoie);
|
||||
print_r($tabAdr);
|
||||
return 'Plusieurs correspondances Voies'.EOL;
|
||||
}
|
||||
elseif (count($ret)==1) {
|
||||
$ret=$ret[0];
|
||||
$L4=preg_replace('/\s+/', ' ', trim($numVoie.' '.$indRep.' '.$ret["libVoie$norme"]));
|
||||
if (strlen($L4)>$norme) return "Taille de la ligne 4 générée en sortie plus longue que $norme !".EOL;
|
||||
$matriculeHexavia=$ret['codeVoie'];
|
||||
$codeRoudis=$ret['codeRoudis'];
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$tabAdr=array(
|
||||
'L1'=>$L1,
|
||||
'L2'=>$L2,
|
||||
'L3'=>$L3,
|
||||
'L4'=>$L4,
|
||||
'L5'=>$L5,
|
||||
'L6'=>$L6,
|
||||
'L7'=>$L7,
|
||||
'HexaviaDateRef'=>$dateMajHexavia,
|
||||
'HexaviaComCod'=>$hexaViaComCod,
|
||||
'HexaviaComLib'=>$hexaViaComLib,
|
||||
'HexaviaCP'=>$hexaViaCP,
|
||||
'HexaVia56'=>$idAdr56,
|
||||
'HexaViaVoie'=>$hexaViaVoie,
|
||||
'HexaViaMat'=>$matriculeHexavia,
|
||||
'RoudisId'=>$codeRoudis);
|
||||
return $tabAdr;
|
||||
/*
|
||||
if ($adresseNum=='' && $adresseBtq=='' && $adresseVoie=='' && $adresseRue=='' && $cp=='' && $ville=='')
|
||||
return false;
|
||||
|
||||
$tabAdr=$this->structureVoie($adresseNum.' '.$adresseBtq.' '.$adresseVoie.' '.$adresseRue);
|
||||
$num=$tabAdr['num']*1;
|
||||
if ($num==0) return false;
|
||||
$indRep=trim($tabAdr['indRep']);
|
||||
$typeVoie=trim($tabAdr['typeVoie']);
|
||||
$libVoie=trim(substr($tabAdr['libVoie'],-5));
|
||||
|
||||
$strAdrActive='';
|
||||
if ($active) {
|
||||
$strAdrActive.=" AND (enActif=1 OR etActif=1) AND nbEntrep>30 AND pasEntrepDom=0 AND siren>1000 ";
|
||||
}
|
||||
$tabTmp=$this->iDb->select('tabAdrDom',
|
||||
'id, siren, nic, enActif, etActif, procol, nom, nom2, sigle, enseigne, adrNum, adrBtq, adrTypVoie, adrLibVoie, ville, cp, adrComp, adrDistSp, cj, apen, apet, nbEntrep, dateInsert, dateUpdate',
|
||||
"adrNum=$num AND adrBtq='$indRep' AND adrTypVoie LIKE '%$typeVoie%' AND adrLibVoie LIKE '%$libVoie%' AND cp=$cp $strAdrActive GROUP BY siren ORDER BY enActif DESC, nbEntrep DESC", false, MYSQL_ASSOC);
|
||||
if (count($tabTmp)>0) {
|
||||
return $tabTmp;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@ -145,12 +145,12 @@ class MBourse
|
||||
$timer['infosBoursieres-getCodeIsin']=microtime(true);
|
||||
$tabRet=array();
|
||||
if ($isin<>'') {
|
||||
$tabRes=$iDb->select( 'bourse_isin b, bourse_cours c',
|
||||
'siren, raisonSociale, adresse, effectif, code_sicovam, code_mnemo, code_bloomberg, code_datastream, code_isin, logo, code_ric, '.
|
||||
'dateIntroduction, dateDerAG, dateRadiation, autre_isin, eligibleSRD, eligiblePEA, nombreTitres, tel1, tel2, fax1, fax2, web, mail, '.
|
||||
'marche, placeCotation, description, secteur, activite, activiteDet, dirigeants, actionnaires, chiffresTrim, '.
|
||||
'c.autre, c.`date`, c.`heure`, c.`open` , c.`high` , c.`low` , c.`close` , c.`volume`',
|
||||
"code_isin='$isin' /*OR siren=$siren)*/ AND b.code_isin=c.isin AND c.autre IN('','e','f','g','m','s','u') ORDER BY c.`date` DESC, c.`heure` DESC LIMIT 0,1", false, MYSQL_ASSOC);
|
||||
$tabRes=$iDb->select( 'bourse_isin b, bourse_cours c',
|
||||
'siren, raisonSociale, adresse, effectif, code_sicovam, code_mnemo, code_bloomberg, code_datastream, code_isin, logo, code_ric, '.
|
||||
'dateIntroduction, dateDerAG, dateRadiation, autre_isin, eligibleSRD, eligiblePEA, nombreTitres, tel1, tel2, fax1, fax2, web, mail, '.
|
||||
'marche, placeCotation, description, secteur, activite, activiteDet, dirigeants, actionnaires, chiffresTrim, '.
|
||||
'c.autre, c.`date`, c.`heure`, c.`open` , c.`high` , c.`low` , c.`close` , c.`volume`',
|
||||
"code_isin='$isin' /*OR siren=$siren)*/ AND b.code_isin=c.isin AND c.autre IN('','e','f','g','m','s','u') ORDER BY c.`date` DESC, c.`heure` DESC LIMIT 0,1", false, MYSQL_ASSOC);
|
||||
|
||||
$tabRet=$tabRes[0];
|
||||
$timer['infosBoursieres-infosIsin']=microtime(true);
|
||||
|
@ -3694,6 +3694,8 @@ function getListeActes($siren) {
|
||||
'mode_diffusion' => implode(',',$tabVecteurs),
|
||||
'decision_nature' => utf8_decode($acte_nature),
|
||||
'decision_libelle' => utf8_decode($acte_decision),
|
||||
'actif' => 1,
|
||||
'dateInsert' => date('YmdHis'),
|
||||
);
|
||||
@$iDb->insert('greffes_actes', $tabInsert);
|
||||
//@sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "classMGreffes::Debug getListeActes($siren)", print_r($tabInsert,true).mysql_error()) ;
|
||||
|
@ -287,6 +287,9 @@ une erreur sur cette notice">Signalez une erreur sur cette notice</a></p>
|
||||
if (preg_match('/<div><p style="color\:red;"><strong>(.*)<\/strong><\/p>/Uis', $body, $matches))
|
||||
$tabMarque['infoMarque']=trim(utf8_decode($matches[1]));
|
||||
|
||||
if (preg_match('/<strong>Date de dépôt \/ Enregistrement<\/strong>(.*)<\/p>/Uis', $body, $matches))
|
||||
$tabMarque['dateDepot']=trim(utf8_decode(strtr($matches[1],array('Â '=>' ',':'=>' '))));
|
||||
|
||||
if (preg_match("/<div class=\"images\"><p><u><strong>(.*)<\/strong><\/u><\/p><img src='Typo3_INPI_Marques\/getImg\?doc=(.*)' alt='(.*)' class='null'\/><\/div>/Uis", $body, $matches)) {
|
||||
$tabMarque['periMarque']=trim(utf8_decode($matches[1]));
|
||||
$tabMarque['idObjetImg']=trim($matches[2]);
|
||||
@ -298,13 +301,40 @@ une erreur sur cette notice">Signalez une erreur sur cette notice</a></p>
|
||||
if ($page['code']==200) {
|
||||
$ext=trim('.'.strtr(preg_replace('/^image\//','',preg_replace('/;.*/','',$page['header']['Content-Type'])),array('?'=>'')));
|
||||
//die("'".DOC_WEB_LOCAL.'marques/'.$tabMarque['numeroMarque'].$ext."'");
|
||||
$fp=@fopen(DOC_WEB_LOCAL.'marques/'.$tabMarque['numeroMarque'].$ext, 'a');
|
||||
// Gestion des dossiers
|
||||
$annee=substr($tabMarque['dateDepot'],0,4);
|
||||
$dateDepotYMD=str_replace('-','',$tabMarque['dateDepot']);
|
||||
$dossierCible=DOC_WEB_LOCAL."marques/$annee/$dateDepotYMD/";
|
||||
@mkdir(DOC_WEB_LOCAL."marques/$annee");
|
||||
@mkdir($dossierCible);
|
||||
// Gestion de l'image
|
||||
$fp=@fopen($dossierCible.$tabMarque['numeroMarque'].$ext, 'a');
|
||||
/* echo $dossierCible.$tabMarque['numeroMarque'].$ext;
|
||||
echo "\t".filesize($dossierCible.$tabMarque['numeroMarque'].$ext).' octets';*/
|
||||
@fwrite($fp, $page['body']);
|
||||
@fclose($fp);
|
||||
$tabMarque['fileName']=$tabMarque['numeroMarque'].$ext;
|
||||
|
||||
if ($tabMarque['nomMarque']=='' || $tabMarque['nomMarque']==' ')
|
||||
$tabMarque['typeMarque']='Figurative';
|
||||
else
|
||||
$tabMarque['typeMarque']='Semi-Figurative';
|
||||
/*
|
||||
Une marque verbale
|
||||
composée d'un ou plusieurs termes qui peuvent s'écrire ou se prononcer,
|
||||
c'est à dire par exemple un nom de naissance ou patronymique (par exemple : Guy Degrenne), une dénomination arbitraire créée de toutes pièces (par exemple : Yoplait) , un mot détourné de son sens, un slogan (par exemple : Parce que vous le valez bien)
|
||||
|
||||
Une marque semi-figurative
|
||||
marque associant un terme verbal et un visuel.
|
||||
Elle peut également être qualifiée de marque complexe.
|
||||
|
||||
Une marque figurative
|
||||
marque composée uniquement dun visuel, cest à dire un signe qui ne s'adresse quà lil (par exemple : le crocodile Lacoste)
|
||||
*/
|
||||
}
|
||||
//die();
|
||||
}
|
||||
}
|
||||
} else
|
||||
$tabMarque['typeMarque']='Verbale';
|
||||
|
||||
if (preg_match('/<p><strong>Produits et services<\/strong><\/p>(.*)<\/ul><\/p>/Uis', $body, $matches)) {
|
||||
$tabClasses=array();
|
||||
@ -400,8 +430,17 @@ une erreur sur cette notice">Signalez une erreur sur cette notice</a></p>
|
||||
//die();
|
||||
$ret=$this->iDb->insert('marques', $tabInsert);
|
||||
if (!$ret && mysql_errno()<>1062) {
|
||||
echo "Erreur 'marques' : ".mysql_error().EOL;
|
||||
die();
|
||||
//echo "Erreur INSERT 'marques' : ".mysql_error().EOL;
|
||||
//die();
|
||||
} elseif (mysql_errno()==1062) {
|
||||
unset($tabInsert['dateInsert']);
|
||||
if (!$this->iDb->update('marques', $tabInsert, "numeroMarque='".$tabMarque['numeroMarque']."' AND rayonMarque='".$tabMarque['rayonMarque']."'", false)) {
|
||||
//echo "Erreur UPDATE 'marques' : ".mysql_error().EOL;
|
||||
//die();
|
||||
}
|
||||
$ret=$this->iDb->select('marques', 'id', "numeroMarque='".$tabMarque['numeroMarque']."' AND rayonMarque='".$tabMarque['rayonMarque']."'", false, MYSQL_ASSOC);
|
||||
$ret=$ret[0]['id'];
|
||||
$updateTodo=true;
|
||||
}
|
||||
|
||||
// Insertion du détail des classes
|
||||
@ -418,6 +457,9 @@ une erreur sur cette notice">Signalez une erreur sur cette notice</a></p>
|
||||
print_r($tabInsert);
|
||||
print_r($tabMarque['classes']);
|
||||
die("Erreur 'marques_classes' : ".mysql_error().EOL);
|
||||
} elseif ($updateTodo && mysql_errno()==1062) {
|
||||
unset($tabInsert['dateInsert']);
|
||||
$this->iDb->update('marques_classes', $tabInsert, "id=$ret AND id2=$i", false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -435,6 +477,9 @@ une erreur sur cette notice">Signalez une erreur sur cette notice</a></p>
|
||||
print_r($tabInsert);
|
||||
print_r($tabMarque['pays']);
|
||||
die("Erreur 'marques_pays' : ".mysql_error().EOL);
|
||||
} elseif ($updateTodo && mysql_errno()==1062) {
|
||||
unset($tabInsert['dateInsert']);
|
||||
$this->iDb->update('marques_pays', $tabInsert, "id=$ret AND id2=$i", false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -452,6 +497,9 @@ une erreur sur cette notice">Signalez une erreur sur cette notice</a></p>
|
||||
print_r($tabInsert);
|
||||
print_r($tabMarque['priorite']);
|
||||
die("Erreur 'marques_priorite' : ".mysql_error().EOL);
|
||||
} elseif ($updateTodo && mysql_errno()==1062) {
|
||||
unset($tabInsert['dateInsert']);
|
||||
$this->iDb->update('marques_priorite', $tabInsert, "id=$ret AND id2=$i", false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,6 +515,9 @@ une erreur sur cette notice">Signalez une erreur sur cette notice</a></p>
|
||||
print_r($tabInsert);
|
||||
print_r($tabMarque['historique']);
|
||||
die("Erreur 'marques_histo' : ".mysql_error().EOL);
|
||||
} elseif ($updateTodo && mysql_errno()==1062) {
|
||||
unset($tabInsert['dateInsert']);
|
||||
$this->iDb->update('marques_classes', $tabInsert, "id=$ret AND id2=$i", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,227 +1,752 @@
|
||||
<?
|
||||
/** Ratios pour les collectivités **/
|
||||
global $tabZones2Ratios;
|
||||
<?php
|
||||
$tva=20.0;
|
||||
|
||||
/** Tableau de conversion des communes **/
|
||||
$tabZones2Ratios=array(
|
||||
'R01a'=>'R[801]',
|
||||
'R01b'=>'Rh[801]',
|
||||
'R01c'=>'Rs[801]',
|
||||
'R02a'=>'R[802]',
|
||||
'R02b'=>'Rh[802]',
|
||||
'R02c'=>'Rs[802]',
|
||||
'R02d'=>'Rq[802]',
|
||||
'R02e'=>'Rt[802]',
|
||||
'R03a'=>'R[803]',
|
||||
'R03b'=>'Rh[803]',
|
||||
'R03c'=>'Rs[803]',
|
||||
'R03d'=>'Rq[803]',
|
||||
'R03e'=>'Rt[803]',
|
||||
'R04a'=>'R[804]',
|
||||
'R04b'=>'Rh[804]',
|
||||
'R04c'=>'Rs[804]',
|
||||
'R04d'=>'Rq[804]',
|
||||
'R04e'=>'Rt[804]',
|
||||
'R05a'=>'R[805]',
|
||||
'R05b'=>'Rh[805]',
|
||||
'R05c'=>'Rs[805]',
|
||||
'R06a'=>'R[806]',
|
||||
'R06b'=>'Rh[806]',
|
||||
'R06c'=>'Rs[806]',
|
||||
'R06d'=>'Rq[806]',
|
||||
'R06e'=>'Rt[806]',
|
||||
'R07a'=>'R[807]',
|
||||
'R07b'=>'Rh[807]',
|
||||
'R07c'=>'Rs[807]',
|
||||
'R07d'=>'Rq[807]',
|
||||
'R07e'=>'Rt[807]',
|
||||
'R08a'=>'R[808]',
|
||||
'R08b'=>'Rh[808]',
|
||||
'R08c'=>'Rs[808]',
|
||||
'R08d'=>'Rq[808]',
|
||||
'R08e'=>'Rt[808]',
|
||||
'R09a'=>'R[809]',
|
||||
'R09b'=>'Rh[809]',
|
||||
'R09c'=>'Rs[809]',
|
||||
'R09d'=>'Rq[809]',
|
||||
'R09e'=>'Rt[809]',
|
||||
'R10a'=>'R[810]',
|
||||
'R10b'=>'Rh[810]',
|
||||
'R10c'=>'Rs[810]',
|
||||
'R10d'=>'Rq[810]',
|
||||
'R10e'=>'Rt[810]',
|
||||
'R11a'=>'R[811]',
|
||||
'R11b'=>'Rh[811]',
|
||||
'R11c'=>'Rs[811]',
|
||||
'R12a'=>'R[812]',
|
||||
'R12b'=>'Rh[812]',
|
||||
'R12c'=>'Rs[812]',
|
||||
'R13a'=>'R[813]',
|
||||
'R13b'=>'Rh[813]',
|
||||
'R13c'=>'Rs[813]',
|
||||
'R13d'=>'Rq[813]',
|
||||
'R13e'=>'Rt[813]',
|
||||
'R14a'=>'R[814]',
|
||||
'R14b'=>'Rh[814]',
|
||||
'R14c'=>'Rs[814]',
|
||||
'R14d'=>'Rq[814]',
|
||||
'R14e'=>'Rt[814]',
|
||||
'R15a'=>'R[815]',
|
||||
'R15b'=>'Rh[815]',
|
||||
'R15c'=>'Rs[815]',
|
||||
'R15d'=>'Rq[815]',
|
||||
'R15e'=>'Rt[815]',
|
||||
'R16a'=>'R[816]',
|
||||
'R16b'=>'Rh[816]',
|
||||
'R16c'=>'Rs[816]',
|
||||
'R16d'=>'Rq[816]',
|
||||
'R16e'=>'Rt[816]',
|
||||
'R17a'=>'R[817]',
|
||||
'R17b'=>'Rh[817]',
|
||||
'R17c'=>'Rs[817]',
|
||||
'R18a'=>'R[818]',
|
||||
'R18b'=>'Rh[818]',
|
||||
'R18c'=>'Rs[818]',
|
||||
'R18d'=>'Rq[818]',
|
||||
'R18e'=>'Rt[818]',
|
||||
'R19a'=>'R[819]',
|
||||
'R19b'=>'Rh[819]',
|
||||
'R19c'=>'Rs[819]',
|
||||
'R19d'=>'Rq[819]',
|
||||
'R19e'=>'Rt[819]',
|
||||
'R20a'=>'R[820]',
|
||||
'R20b'=>'Rh[820]',
|
||||
'R20c'=>'Rs[820]',
|
||||
'R20d'=>'Rq[820]',
|
||||
'R20e'=>'Rt[820]',
|
||||
'R21a'=>'R[821]',
|
||||
'R21b'=>'Rh[821]',
|
||||
'R21c'=>'Rs[821]',
|
||||
'R21d'=>'Rq[821]',
|
||||
'R21e'=>'Rt[821]',
|
||||
'R22a'=>'R[822]',
|
||||
'R22b'=>'Rh[822]',
|
||||
'R22c'=>'Rs[822]',
|
||||
'R23a'=>'R[823]',
|
||||
'R23b'=>'Rh[823]',
|
||||
'R23c'=>'Rs[823]',
|
||||
'R24a'=>'R[824]',
|
||||
'R24b'=>'Rh[824]',
|
||||
'R24c'=>'Rs[824]',
|
||||
'R25a'=>'R[825]',
|
||||
'R25b'=>'Rh[825]',
|
||||
'R25c'=>'Rs[825]',
|
||||
'R26a'=>'R[826]',
|
||||
'R26b'=>'Rh[826]',
|
||||
'R26c'=>'Rs[826]',
|
||||
'R26d'=>'Rq[826]',
|
||||
'R26e'=>'Rt[826]',
|
||||
'R27a'=>'R[827]',
|
||||
'R27b'=>'Rh[827]',
|
||||
'R27c'=>'Rs[827]',
|
||||
'R27d'=>'Rq[827]',
|
||||
'R27e'=>'Rt[827]',
|
||||
'R28a'=>'R[828]',
|
||||
'R28b'=>'Rh[828]',
|
||||
'R28c'=>'Rs[828]',
|
||||
'R28d'=>'Rq[828]',
|
||||
'R28e'=>'Rt[828]',
|
||||
'R29a'=>'R[829]',
|
||||
'R29b'=>'Rh[829]',
|
||||
'R29c'=>'Rs[829]',
|
||||
'R29d'=>'Rq[829]',
|
||||
'R29e'=>'Rt[829]',
|
||||
'R30a'=>'R[830]',
|
||||
'R30b'=>'Rh[830]',
|
||||
'R30c'=>'Rs[830]',
|
||||
'R30d'=>'Rq[830]',
|
||||
'R30e'=>'Rt[830]',
|
||||
'R31a'=>'R[843]',
|
||||
'R31b'=>'Rh[843]',
|
||||
'R31c'=>'Rs[843]',
|
||||
'R31d'=>'Rq[843]',
|
||||
'R31e'=>'Rt[843]',
|
||||
'R32a'=>'R[831]',
|
||||
'R32b'=>'Rh[831]',
|
||||
'R32c'=>'Rs[831]',
|
||||
'R33a'=>'R[832]',
|
||||
'R33b'=>'Rh[832]',
|
||||
'R33c'=>'Rs[832]',
|
||||
'R33d'=>'R[845]',
|
||||
'R33e'=>'Rh[845]',
|
||||
'R33f'=>'Rs[845]',
|
||||
'R34a'=>'R[833]',
|
||||
'R34b'=>'Rh[833]',
|
||||
'R34c'=>'Rs[833]',
|
||||
'R34d'=>'R[846]',
|
||||
'R34e'=>'Rh[846]',
|
||||
'R34f'=>'Rs[846]',
|
||||
'R35a'=>'R[834]',
|
||||
'R35b'=>'Rh[834]',
|
||||
'R35c'=>'Rs[834]',
|
||||
'R35d'=>'R[847]',
|
||||
'R35e'=>'Rh[847]',
|
||||
'R35f'=>'Rs[847]',
|
||||
'R36a'=>'R[835]',
|
||||
'R36b'=>'Rh[835]',
|
||||
'R36c'=>'Rs[835]',
|
||||
'R36d'=>'R[849]',
|
||||
'R36e'=>'Rh[849]',
|
||||
'R36f'=>'Rs[849]',
|
||||
'R37a'=>'R[844]',
|
||||
'R37b'=>'Rh[844]',
|
||||
'R37c'=>'Rs[844]',
|
||||
'R37d'=>'R[848]',
|
||||
'R37e'=>'Rh[848]',
|
||||
'R37f'=>'Rs[848]',
|
||||
'R38a'=>'R[836]',
|
||||
'R38b'=>'Rh[836]',
|
||||
'R38c'=>'Rs[836]',
|
||||
'R38d'=>'Rq[836]',
|
||||
'R38e'=>'Rt[836]',
|
||||
'R39a'=>'R[837]',
|
||||
'R39b'=>'Rh[837]',
|
||||
'R39c'=>'Rs[837]',
|
||||
'R39d'=>'Rq[837]',
|
||||
'R39e'=>'Rt[837]',
|
||||
'R40a'=>'R[838]',
|
||||
'R40b'=>'Rh[838]',
|
||||
'R40c'=>'Rs[838]',
|
||||
'R40d'=>'Rq[838]',
|
||||
'R40e'=>'Rt[838]',
|
||||
'R41a'=>'R[842]',
|
||||
'R41b'=>'Rh[842]',
|
||||
'R41c'=>'Rs[842]',
|
||||
'R41d'=>'Rq[842]',
|
||||
'R41e'=>'Rt[842]',
|
||||
'R42a'=>'R[839]',
|
||||
'R42b'=>'Rh[839]',
|
||||
'R42c'=>'Rs[839]',
|
||||
'R42d'=>'Rq[839]',
|
||||
'R42e'=>'Rt[839]',
|
||||
'R43a'=>'R[840]',
|
||||
'R43b'=>'Rh[840]',
|
||||
'R43c'=>'Rs[840]',
|
||||
'R43d'=>'Rq[840]',
|
||||
'R43e'=>'Rt[840]',
|
||||
'R44a'=>'R[841]',
|
||||
'R44b'=>'Rh[841]',
|
||||
'R44c'=>'Rs[841]',
|
||||
);
|
||||
/** Donne le taux d'inflation pour une année donnée **/
|
||||
function getInflation($annee) {
|
||||
$tabInfla = include __DIR__ . '/Variables/CacheTabInfla.php';
|
||||
if (isset($tabInfla[$annee])) return $tabInfla[$annee];
|
||||
}
|
||||
/** Donne le taux de rendement des actions pour une année donnée **/
|
||||
function getTxRendement($annee) {
|
||||
$tabTxRendObli = include __DIR__ . '/Variables/CacheTabRendObli.php';
|
||||
if (isset($tabTxRendObli[$annee])) return $tabInfla[$annee];
|
||||
}
|
||||
|
||||
|
||||
/** Conversion des zones pour les collectivités **/
|
||||
function convertZones($codeR, $zonesDB) {
|
||||
global $tabZones2Ratios;
|
||||
foreach($tabZones2Ratios as $oldR=>$newR) {
|
||||
if (preg_match('/(\D+)\[(\d+)\]/Uis', $newR, $matches) && $matches[1]==$codeR) {
|
||||
$iRatio=$matches[2];
|
||||
if ($codeR=='R')
|
||||
$ret[$iRatio]=$zonesDB[$oldR]*1000;
|
||||
else
|
||||
$ret[$iRatio]=$zonesDB[$oldR];
|
||||
}
|
||||
function calculRatios($tabBilans, $tabIdentite, $accesPartenaire) {
|
||||
global $tva, $mBil, $efftr;
|
||||
$numBil=0;
|
||||
$numBilType=array();
|
||||
$nbRatiosMax = 5;
|
||||
foreach ($tabBilans as $millesime => $bil)
|
||||
{
|
||||
$tabTmp = $mBil->getBilan(substr($millesime,-10), substr($millesime,0,1), @$bil['ref'], $accesPartenaire);
|
||||
$numBilType[substr($millesime,0,1)]++;
|
||||
if (substr($millesime,0,1)=='S') {
|
||||
if ($numBilType['S']>$nbRatiosMax) continue;
|
||||
$tabTmp2=$mBil->bilanSimplifie2Normal($tabTmp);
|
||||
$tabBilan[$numBil]=array_merge($tabTmp2, $tabTmp);
|
||||
} elseif (substr($millesime,0,1)=='N') {
|
||||
if ($numBilType['N']>$nbRatiosMax) continue;
|
||||
$tabBilan[$numBil]=$tabTmp;
|
||||
} elseif (substr($millesime,0,1)=='C') {
|
||||
if ($numBilType['C']>$nbRatiosMax) continue;
|
||||
$tabBilan[$numBil]=$tabTmp;
|
||||
} elseif (substr($millesime,0,1)=='A') {
|
||||
if ($numBilType['A']>$nbRatiosMax) continue;
|
||||
$tabBilan[$numBil]=$tabTmp;
|
||||
//return(array());
|
||||
} elseif (substr($millesime,0,1)=='B') {
|
||||
if ($numBilType['B']>$nbRatiosMax) continue;
|
||||
$tabBilan[$numBil]=$tabTmp;
|
||||
//return(array());
|
||||
}
|
||||
return $ret;
|
||||
unset($tabTmp); unset($tabTmp2);
|
||||
if ($numBil>10) break;
|
||||
$p=$tabBilan[$numBil];
|
||||
$nm=$p['DUREE_MOIS'];
|
||||
$nmp=$p['DUREE_MOIS_PRE'];
|
||||
$R=array();
|
||||
$R[0]=0;
|
||||
if (!isset($R[0])) $R[0]='NS';
|
||||
$R[1]=$p['FJ'];
|
||||
if (!isset($R[1])) $R[1]='NS';
|
||||
$R[2]=($p['FJ']*12)/$nm;if ($R[2]<0) $R[2]=0;
|
||||
if (!isset($R[2])) $R[2]='NS';
|
||||
$R[3]=$p['FK'];
|
||||
if (!isset($R[3])) $R[3]='NS';
|
||||
$R[4]=($p['FK']*12)/$nm;if ($R[4]<0) $R[4]=0;
|
||||
if (!isset($R[4])) $R[4]='NS';
|
||||
$R[5]=$p['FL'];
|
||||
if (!isset($R[5])) $R[5]='NS';
|
||||
$R[6]=($p['FL']*12)/$nm;if ($R[6]<0) $R[6]=0;
|
||||
if (!isset($R[6])) $R[6]='NS';
|
||||
$R[7]=$p['GW'];
|
||||
if (!isset($R[7])) $R[7]='NS';
|
||||
$R[8]=($p['GW']*12)/$nm;
|
||||
if (!isset($R[8])) $R[8]='NS';
|
||||
$R[10]=$p['HN'];
|
||||
if (!isset($R[10])) $R[10]='NS';
|
||||
$R[11]=($p['HN']*12)/$nm;
|
||||
if (!isset($R[11])) $R[11]='NS';
|
||||
$R[12]=$p['HI'];
|
||||
if (!isset($R[12])) $R[12]='NS';
|
||||
$R[13]=($p['HI']*12)/$nm;
|
||||
if (!isset($R[13])) $R[13]='NS';
|
||||
$R[14]=$p['GV'];
|
||||
if (!isset($R[14])) $R[14]='NS';
|
||||
$R[15]=($p['GV']*12)/$nm;
|
||||
if (!isset($R[15])) $R[15]='NS';
|
||||
$R[16]=$p['GG'];
|
||||
if (!isset($R[16])) $R[16]='NS';
|
||||
$R[17]=($p['GG']*12)/$nm;
|
||||
if (!isset($R[17])) $R[17]='NS';
|
||||
$R[18]=$p['DL'];
|
||||
if (!isset($R[18])) $R[18]='NS';
|
||||
$R[19]=($p['DL']*12)/$nm;
|
||||
if (!isset($R[19])) $R[19]='NS';
|
||||
$R[20]=$p['GR'];
|
||||
if (!isset($R[20])) $R[20]='NS';
|
||||
$R[21]=($p['GR']*12)/$nm;
|
||||
if (!isset($R[21])) $R[21]='NS';
|
||||
$R[22]=$p['EE'];
|
||||
if (!isset($R[22])) $R[22]='NS';
|
||||
$R[23]=($p['EE']*12)/$nm;
|
||||
if (!isset($R[23])) $R[23]='NS';
|
||||
$R[24]=$p['YP'];if ($R[24]==0) $R[24]=$efftr;
|
||||
if (!isset($R[24])) $R[24]='NS';
|
||||
$R[25]=($p['FK']*100)/$p['FL'];if ($R[25]<0) $R[25]=0;
|
||||
if (!isset($R[25])) $R[25]='NS';
|
||||
$R[30]=$p['AF'];
|
||||
if (!isset($R[30])) $R[30]='NS';
|
||||
$R[31]=$p['AN'];
|
||||
if (!isset($R[31])) $R[31]='NS';
|
||||
$R[32]=$p['EC'];
|
||||
if (!isset($R[32])) $R[32]='NS';
|
||||
$R[33]=$p['DR'];
|
||||
if (!isset($R[33])) $R[33]='NS';
|
||||
$R[51]=$p['AB']+$p['AD']+$p['AF']+$p['AH']+$p['AJ']+$p['AL']-$p['AC']-$p['AE']-$p['AG']-$p['AI']-$p['AK']-$p['AM'];
|
||||
if (!isset($R[51])) $R[51]='NS';
|
||||
$R[52]=$p['AN']+ $p['AP']+ $p['AR']+ $p['AT']+ $p['AV']+ $p['AX']- $p['AO']- $p['AQ']- $p['AS']- $p['AU']- $p['AW']- $p['AY'];
|
||||
if (!isset($R[52])) $R[52]='NS';
|
||||
$R[53]=$p['CS']+ $p['CU']+ $p['BB']+ $p['BD']+ $p['BF']+ $p['BH']- $p['CT']- $p['CV']- $p['BC']- $p['BE']- $p['BG']- $p['BI'];
|
||||
if (!isset($R[53])) $R[53]='NS';
|
||||
$R[59]=$R[51]+$R[52]+$R[53];
|
||||
if (!isset($R[59])) $R[59]='NS';
|
||||
$R[60]=$p['BL']+ $p['BN']+ $p['BP']+ $p['BR']+ $p['BT']- $p['BM']- $p['BO']- $p['BQ']- $p['BS']- $p['BU'];
|
||||
if (!isset($R[60])) $R[60]='NS';
|
||||
$R[61]=$p['BX']-$p['DW']+$p['YS']-$p['BY'];
|
||||
if (!isset($R[61])) $R[61]='NS';
|
||||
$R[62]=$p['BZ']+ $p['CB']+ $p['CH']- $p['CA']- $p['CC']- $p['CI'];
|
||||
if (!isset($R[62])) $R[62]='NS';
|
||||
$R[63]=$p['CD']+$p['CF']-$p['CE']-$p['CG'];
|
||||
if (!isset($R[63])) $R[63]='NS';
|
||||
$R[64]=($R[63]*12)/$nm;
|
||||
if (!isset($R[64])) $R[64]='NS';
|
||||
$R[65]=$R[61]+$R[62];
|
||||
if (!isset($R[65])) $R[65]='NS';
|
||||
$R[67]=($R[59]*12)/$nm;
|
||||
if (!isset($R[67])) $R[67]='NS';
|
||||
$R[69]=$R[60]+$R[61]+$R[62]+$R[63];
|
||||
if (!isset($R[69])) $R[69]='NS';
|
||||
$R[70]=$p['DL']+$p['DO']-$p['AA']-($p['CL']+$p['CM']+$p['CN'])+$p['ED'];
|
||||
if (!isset($R[70])) $R[70]='NS';
|
||||
$R[71]=$p['DR'];
|
||||
if (!isset($R[71])) $R[71]='NS';
|
||||
$R[72]=$p['VI'];
|
||||
if (!isset($R[72])) $R[72]='NS';
|
||||
$R[73]=$p['DW']+$p['DX']+$p['DY']+$p['DZ']+$p['EA']+$p['EH'];
|
||||
if (!isset($R[73])) $R[73]='NS';
|
||||
$R[74]=$p['DK'];
|
||||
if (!isset($R[74])) $R[74]='NS';
|
||||
$R[79]=$R[70]+$R[71]+$R[72];
|
||||
if (!isset($R[79])) $R[79]='NS';
|
||||
$R[80]=$p['DS']+$p['DT']+$p['DU']+$p['DV']-$p['EH']-$p['VI'];if ($R[80]<0) $R[80]=0;
|
||||
if (!isset($R[80])) $R[80]='NS';
|
||||
$R[81]=$p['VG1']+$p['VH1'];
|
||||
if (!isset($R[81])) $R[81]='NS';
|
||||
$R[82]=$R[70];if ($R[82]<0) $R[82]=0;
|
||||
if (!isset($R[82])) $R[82]='NS';
|
||||
$R[83]=$p['DS']+$p['DT']+$p['DU']+$p['DV']-$p['EH']-$p['VI'];if ($R[83]<0) $R[83]=0;
|
||||
if (!isset($R[83])) $R[83]='NS';
|
||||
$R[84]=$p['DX']- $p['BV']+ $p['BW'];
|
||||
if (!isset($R[84])) $R[84]='NS';
|
||||
$R[85]=$p['DY'];
|
||||
if (!isset($R[85])) $R[85]='NS';
|
||||
$R[86]=$p['DZ']+ $p['EA']+ $p['EB']+ $R[80];
|
||||
if (!isset($R[86])) $R[86]='NS';
|
||||
$R[87]=$p['YS']+ $p['EH'];
|
||||
if (!isset($R[87])) $R[87]='NS';
|
||||
$R[88]=$p['DW']+ $p['DY']+ $p['EH']+ $p['DZ']+ $p['EA']+ $p['EB']+ $p['YS'];
|
||||
if (!isset($R[88])) $R[88]='NS';
|
||||
$R[89]=$p['DS']+ $p['DT']+ $p['DU']+ $p['DV']- $p['EH']- $p['VI'];
|
||||
if (!isset($R[89])) $R[89]='NS';
|
||||
$R[90]=$R[83]+$R[84]+$R[85]+$R[86]+$R[87];
|
||||
if (!isset($R[90])) $R[90]='NS';
|
||||
$R[91]=$p['DL']+$p['DO']+$p['DR']+$p['VI']-$p['DJ']-$p['DK']-$p['AA'];
|
||||
if (!isset($R[91])) $R[91]='NS';
|
||||
$R[92]=($p['DL']+$p['DO']+$p['DR']+$p['VI']-$p['DJ']-$p['DK']-$p['AA'])/$p['EE'];
|
||||
if (!isset($R[92])) $R[92]='NS';
|
||||
$R[93]=($R[69]*12)/$nm;
|
||||
if (!isset($R[93])) $R[93]='NS';
|
||||
$R[101]=$p['FL'];
|
||||
if (!isset($R[101])) $R[101]='NS';
|
||||
$R[102]=$p['FS']+ $p['FU'];
|
||||
if (!isset($R[102])) $R[102]='NS';
|
||||
$R[110]=$R[101]-$p['FS'] -$p['FT'];
|
||||
if (!isset($R[110])) $R[110]='NS';
|
||||
$R[111]=$p['FF']+$p['FI'];
|
||||
if (!isset($R[111])) $R[111]='NS';
|
||||
$R[112]=$p['FM']+ $p['FN'];
|
||||
if (!isset($R[112])) $R[112]='NS';
|
||||
$R[120]=$R[111]+$R[112];
|
||||
if (!isset($R[120])) $R[120]='NS';
|
||||
$R[121]=$p['FT']+ $p['FV'];
|
||||
if (!isset($R[121])) $R[121]='NS';
|
||||
$R[122]=$R[101]+$R[112]-$R[102]-$R[121];
|
||||
if (!isset($R[122])) $R[122]='NS';
|
||||
$R[123]=$p['FW']- $p['HP']- $p['HQ'];
|
||||
if (!isset($R[123])) $R[123]='NS';
|
||||
$R[124]=($R[120]*12)/$nm;
|
||||
if (!isset($R[124])) $R[124]='NS';
|
||||
$R[130]=$R[122]-$R[123];
|
||||
if (!isset($R[130])) $R[130]='NS';
|
||||
$R[131]=$p['FO'];
|
||||
if (!isset($R[131])) $R[131]='NS';
|
||||
$R[132]=$p['FY']+$p['FZ'];
|
||||
if (!isset($R[132])) $R[132]='NS';
|
||||
$R[133]=$p['FX'];
|
||||
if (!isset($R[133])) $R[133]='NS';
|
||||
$R[140]=$R[130]-$R[132]-$R[133]+$R[131];
|
||||
if (!isset($R[140])) $R[140]='NS';
|
||||
$R[141]=$p['FQ'];
|
||||
if (!isset($R[141])) $R[141]='NS';
|
||||
$R[142]=$p['GE'];
|
||||
if (!isset($R[142])) $R[142]='NS';
|
||||
$R[143]=$p['FP'];
|
||||
if (!isset($R[143])) $R[143]='NS';
|
||||
$R[144]=($p['HP']+ $p['HQ'])*0.7;
|
||||
if (!isset($R[144])) $R[144]='NS';
|
||||
$R[145]=$p['GA']+ $p['GB']+ $p['GC']+ $p['GD']+$R[144];
|
||||
if (!isset($R[145])) $R[145]='NS';
|
||||
$R[146]=($R[140]*12)/$nm;
|
||||
if (!isset($R[146])) $R[146]='NS';
|
||||
$R[150]=$R[140]+$R[141]-$R[142]+$R[143]-$R[145];
|
||||
if (!isset($R[150])) $R[150]='NS';
|
||||
$R[151]=$p['GP'];
|
||||
if (!isset($R[151])) $R[151]='NS';
|
||||
$R[152]=($p['HP']+ $p['HQ'])*0.3;
|
||||
if (!isset($R[152])) $R[152]='NS';
|
||||
$R[153]=$p['GU']+$R[152];
|
||||
if (!isset($R[153])) $R[153]='NS';
|
||||
$R[160]=$R[151]-$R[153];
|
||||
if (!isset($R[160])) $R[160]='NS';
|
||||
$R[161]=$p['GH']- $p['GI'];
|
||||
if (!isset($R[161])) $R[161]='NS';
|
||||
$R[170]=$R[150]+$R[161]+$R[151]-$R[153];
|
||||
if (!isset($R[170])) $R[170]='NS';
|
||||
$R[171]=$p['HD'];
|
||||
if (!isset($R[171])) $R[171]='NS';
|
||||
$R[172]=$p['HH'];
|
||||
if (!isset($R[172])) $R[172]='NS';
|
||||
$R[180]=$R[171]-$R[172];
|
||||
if (!isset($R[180])) $R[180]='NS';
|
||||
$R[181]=$p['HK'];
|
||||
if (!isset($R[181])) $R[181]='NS';
|
||||
$R[182]=$p['HJ'];
|
||||
if (!isset($R[182])) $R[182]='NS';
|
||||
$R[199]=$R[170]+$R[171]-$R[172]-$R[181]-$R[182];
|
||||
if (!isset($R[199])) $R[199]='NS';
|
||||
$R[201]=$p['DL']+ $p['DO']+ $p['DR']+ $p['VI']- $p['AA'];
|
||||
if (!isset($R[201])) $R[201]='NS';
|
||||
$R[202]=$R[201]+$R[80];
|
||||
if (!isset($R[202])) $R[202]='NS';
|
||||
$R[203]=$p['YY'];if ($R[203]==0) $R[203]=(($p['FJ']*$tva)/100);
|
||||
if (!isset($R[203])) $R[203]='NS';
|
||||
$R[204]=(($R[203]+$R[5])*12/$nm)/360;if ($R[204]<0) $R[204]=0;
|
||||
if (!isset($R[204])) $R[204]='NS';
|
||||
$R[205]=($p['FS']-$p['FT']+$p['FU']-$p['FV']+$p['FW'])*$tva/100;
|
||||
if (!isset($R[205])) $R[205]='NS';
|
||||
$R[206]=$p['YZ'];if ($R[206]==0) $R[206]=$R[205];
|
||||
if (!isset($R[206])) $R[206]='NS';
|
||||
$R[207]=((($p['FS']- $p['FT']+ $p['FU']- $p['FV']+ $p['FW'])+ ($R[206]))*12/$nm)/360;if ($R[207]<0) $R[207]=0;
|
||||
if (!isset($R[207])) $R[207]='NS';
|
||||
$R[208]=($R[5]*100)/$p['EE'];
|
||||
if (!isset($R[208])) $R[208]='NS';
|
||||
$R[209]=$p['HP']+$p['HQ']-$p['GR'];
|
||||
if (!isset($R[209])) $R[209]='NS';
|
||||
$R[210]=$p['BX']-$p['BY']+$p['YS'];
|
||||
if (!isset($R[210])) $R[210]='NS';
|
||||
$R[211]=($R[210]*100)/$p['EE'];
|
||||
if (!isset($R[211])) $R[211]='NS';
|
||||
$R[212]=($R[84]*100)/$p['EE'];
|
||||
if (!isset($R[212])) $R[212]='NS';
|
||||
$R[213]=$p['BL']-$p['BM'];
|
||||
if (!isset($R[213])) $R[213]='NS';
|
||||
$R[214]=($R[213]*100)/$p['EE'];
|
||||
if (!isset($R[214])) $R[214]='NS';
|
||||
$R[215]=$p['BN']-$p['BO'];
|
||||
if (!isset($R[215])) $R[215]='NS';
|
||||
$R[216]=($R[215]*100)/$p['EE'];
|
||||
if (!isset($R[216])) $R[216]='NS';
|
||||
$R[217]=$p['BP']-$p['BQ'];
|
||||
if (!isset($R[217])) $R[217]='NS';
|
||||
$R[218]=($R[217]*100)/$p['EE'];
|
||||
if (!isset($R[218])) $R[218]='NS';
|
||||
$R[219]=$p['BR']-$p['BS'];
|
||||
if (!isset($R[219])) $R[219]='NS';
|
||||
$R[220]=($R[219]*100)/$p['EE'];
|
||||
if (!isset($R[220])) $R[220]='NS';
|
||||
$R[221]=$p['BT']-$p['BU'];
|
||||
if (!isset($R[221])) $R[221]='NS';
|
||||
$R[222]=($R[221]*100)/$p['EE'];
|
||||
if (!isset($R[222])) $R[222]='NS';
|
||||
$R[223]=$R[79]+$R[80]-$R[59];
|
||||
if (!isset($R[223])) $R[223]='NS';
|
||||
$R[224]=$p['CJ']-$p['CK']-$p['CH']+$p['CI']-$p['DW']-$p['DX']-$p['DY']-$p['DZ']-$p['EA']-$p['EH'];
|
||||
if (!isset($R[224])) $R[224]='NS';
|
||||
$R[225]=$R[60]+$R[61]+$R[62]-$R[84]-$R[85]-$R[86];
|
||||
if (!isset($R[225])) $R[225]='NS';
|
||||
$R[226]=$R[223]-$R[225];
|
||||
if (!isset($R[226])) $R[226]='NS';
|
||||
$R[227]=$p['YS'];
|
||||
if (!isset($R[227])) $R[227]='NS';
|
||||
$R[228]=($R[79]*12)/$nm;
|
||||
if (!isset($R[228])) $R[228]='NS';
|
||||
$R[229]=$p['FY']+$p['FZ'];
|
||||
if (!isset($R[229])) $R[229]='NS';
|
||||
$R[230]=abs($R[223]);
|
||||
if (!isset($R[230])) $R[230]='NS';
|
||||
$R[231]=$R[202]- $p['BJ']+ $p['BK']+ $p['ED']- $p['CL']- $p['CM']- $p['CN'];
|
||||
if (!isset($R[231])) $R[231]='NS';
|
||||
$R[232]=$p['CJ']- $p['CK']+ $p['YS']- $p['CF']- $p['CD']+ $p['CE']+$p['CG']- $p['DW']- $p['DX']- $p['DY']- $p['DZ']- $p['EA']- $p['EB'];
|
||||
if (!isset($R[232])) $R[232]='NS';
|
||||
$R[233]=$p['HN']+ $p['HF']+ $p['HG']- $p['HB']- $p['HC']+ $p['GQ']- $p['GM']+ $p['GA']+ $p['GB']+ $p['GC']+ $p['GD']- $p['FP'];
|
||||
if (!isset($R[233])) $R[233]='NS';
|
||||
$R[234]=($R[231]*100)/$R[232];
|
||||
if (!isset($R[234])) $R[234]='NS';
|
||||
$R[235]=($R[231])*12/$nm;
|
||||
if (!isset($R[235])) $R[235]='NS';
|
||||
$R[236]=($R[232])*12/$nm;
|
||||
if (!isset($R[236])) $R[236]='NS';
|
||||
$R[237]=($R[202]*100)/$R[59];
|
||||
if (!isset($R[237])) $R[237]='NS';
|
||||
$R[238]=($R[235]*360)/$R[6];
|
||||
if (!isset($R[238])) $R[238]='NS';
|
||||
$R[239]=($R[70]*100)/$p['EC'];
|
||||
if (!isset($R[239])) $R[239]='NS';
|
||||
$R[240]=($R[70]*100)/abs($R[202]);if ($R[240]<0) $R[240]=0;
|
||||
if (!isset($R[240])) $R[240]='NS';
|
||||
$R[241]=($p['EC']/($R[70]))*100;
|
||||
if (!isset($R[241])) $R[241]='NS';
|
||||
$R[242]=(($p['GR']+$R[152])*100)/$R[140];if ($R[242]<-200) $R[242]=-200;
|
||||
if (!isset($R[242])) $R[242]='NS';
|
||||
$R[243]=($R[81]*100)/($R[79]+$R[90]);
|
||||
if (!isset($R[243])) $R[243]='NS';
|
||||
$R[244]=($R[89]*100)/$R[70];
|
||||
if (!isset($R[244])) $R[244]='NS';
|
||||
$R[245]=($R[153]*100)/$p['EC'];
|
||||
if (!isset($R[245])) $R[245]='NS';
|
||||
$R[246]=($R[153]*100)/$R[140];
|
||||
if (!isset($R[246])) $R[246]='NS';
|
||||
$R[247]=($R[80]+$p['YQ']+$p['YR'])/$R[233];
|
||||
if (!isset($R[247])) $R[247]='NS';
|
||||
$R[248]=$R[84]*100/$R[60];
|
||||
if (!isset($R[248])) $R[248]='NS';
|
||||
$R[249]=$R[231]-$R[232];
|
||||
if (!isset($R[249])) $R[249]='NS';
|
||||
$R[250]=($R[63]*100)/$R[88];
|
||||
if (!isset($R[250])) $R[250]='NS';
|
||||
$R[251]=(($p['CJ']- $p['CK']- $p['CH']+ $p['CL'])*100/$R[88]);
|
||||
if (!isset($R[251])) $R[251]='NS';
|
||||
$R[252]=($R[63]+$R[61])*100/$R[88];
|
||||
if (!isset($R[252])) $R[252]='NS';
|
||||
$R[253]=($p['CJ']-$p['CK']-$p['CH']+$p['CL'])*100/$R[73];
|
||||
if (!isset($R[253])) $R[253]='NS';
|
||||
$R[254]=$p['AO']+$p['AQ']+$p['AS']+$p['AU']+$p['AW']+$p['AY'];
|
||||
if (!isset($R[254])) $R[254]='NS';
|
||||
$R[261]=$R[124]/$R[24];
|
||||
if (!isset($R[261])) $R[261]='NS';
|
||||
$R[262]=($R[140]*100/$p['EE']);
|
||||
if (!isset($R[262])) $R[262]='NS';
|
||||
$R[263]=($p['HN']*100/$R[70]);
|
||||
if (!isset($R[263])) $R[263]='NS';
|
||||
$R[264]=($p['HN']*100/($p['FL']+ $p['FO']));
|
||||
if (!isset($R[264])) $R[264]='NS';
|
||||
$R[265]=((($R[233]*12)/$nm)*100)/$R[202];
|
||||
if (!isset($R[265])) $R[265]='NS';
|
||||
$R[266]=($R[233]*100)/$R[130];
|
||||
if (!isset($R[266])) $R[266]='NS';
|
||||
$R[267]=$R[6]/$R[24];
|
||||
if (!isset($R[267])) $R[267]='NS';
|
||||
$R[268]=($R[140]*100)/($p['FL']+$p['FO']);
|
||||
if (!isset($R[268])) $R[268]='NS';
|
||||
$R[269]=($R[130]*100)/($R[51]+$R[52]);
|
||||
if (!isset($R[269])) $R[269]='NS';
|
||||
$R[271]=($p['FL']+$p['FO'])*100/$p['EE'];
|
||||
if (!isset($R[271])) $R[271]='NS';
|
||||
$R[272]=((($p['FU']- $p['FV'])*12)/$nm)/360;
|
||||
if (!isset($R[272])) $R[272]='NS';
|
||||
$R[273]=($p['BL']- $p['BM'])/$R[272];if ($R[273]<0) $R[273]=0;if ($R[273]>730) $R[273]=730;
|
||||
if (!isset($R[273])) $R[273]='NS';
|
||||
$R[274]=(($p['FS']- $p['FT'])*12/$nm)/360;if ($R[274]<0) $R[274]=0;
|
||||
if (!isset($R[274])) $R[274]='NS';
|
||||
$R[275]=($p['BT']- $p['BU'])/$R[274];if ($R[275]<0) $R[275]=0;if ($R[275]>730) $R[275]=730;
|
||||
if (!isset($R[275])) $R[275]='NS';
|
||||
$R[276]=((($p['FL']+$p['FM']+$p['FN'])*12)/$nm)/360;if ($R[276]<0) $R[276]=0;
|
||||
if (!isset($R[276])) $R[276]='NS';
|
||||
$R[277]=(($p['BR']-$p['BS'])+($p['BN']- $p['BO'])+($p['BP']- $p['BQ'])- $p['DW'])/$R[276];if ($R[277]<0) $R[277]=0;if ($R[277]>730) $R[277]=730;
|
||||
if (!isset($R[277])) $R[277]='NS';
|
||||
$R[278]=(($p['BX']-$p['BY']+ $p['YS'])/$R[204]);if ($R[278]<0) $R[278]=0;if ($R[278]>730) $R[278]=730;
|
||||
if (!isset($R[278])) $R[278]='NS';
|
||||
$R[279]=($p['DX']-$p['BV'])/$R[207];if ($R[279]<0) $R[279]=0;if ($R[279]>730) $R[279]=730;
|
||||
if (!isset($R[279])) $R[279]='NS';
|
||||
$R[280]=(($p['AO']+ $p['AQ']+ $p['AS']+ $p['AU']+ $p['AW']+ $p['AY'])/($p['AN']+ $p['AP']+ $p['AR']+ $p['AT']+ $p['AV']+ $p['AX']))*100;
|
||||
if (!isset($R[280])) $R[280]='NS';
|
||||
$R[281]=(($p['FY']+ $p['FZ'])/$R[130])*100;
|
||||
if (!isset($R[281])) $R[281]='NS';
|
||||
$R[282]=(($p['GA']+$p['GB'])*100)/$R[130];
|
||||
if (!isset($R[282])) $R[282]='NS';
|
||||
$R[283]=(($p['HN'])*100)/$R[130];
|
||||
if (!isset($R[283])) $R[283]='NS';
|
||||
$R[284]=($R[153]*100)/$R[130];
|
||||
if (!isset($R[284])) $R[284]='NS';
|
||||
$R[285]=(($p['HK']+$p['FX'])*100)/$R[130];
|
||||
if (!isset($R[285])) $R[285]='NS';
|
||||
$R[286]=($R[6])/360;if ($R[286]<0) $R[286]=0;
|
||||
if (!isset($R[286])) $R[286]='NS';
|
||||
$R[297]=$R[215]/$R[286];
|
||||
if (!isset($R[297])) $R[297]='NS';
|
||||
$R[298]=$R[217]/$R[286];
|
||||
if (!isset($R[298])) $R[298]='NS';
|
||||
$R[299]=$R[219]/$R[286];
|
||||
if (!isset($R[299])) $R[299]='NS';
|
||||
$R[300]=($p['YS']*100)/abs($R[226]);
|
||||
if (!isset($R[300])) $R[300]='NS';
|
||||
$R[301]=($R[140]*12)/$nm;
|
||||
if (!isset($R[301])) $R[301]='NS';
|
||||
$R[302]=$p['IJ'];
|
||||
if (!isset($R[302])) $R[302]='NS';
|
||||
$R[303]=$p['JH'];
|
||||
if (!isset($R[303])) $R[303]='NS';
|
||||
$R[304]=$p['ZR'];
|
||||
if (!isset($R[304])) $R[304]='NS';
|
||||
$R[305]=$R[70]+$R[88]+$R[89]-$R[226];
|
||||
if (!isset($R[305])) $R[305]='NS';
|
||||
$R[306]=($R[6]*(100-getInflation(substr($millesime,-4))))/100;
|
||||
if (!isset($R[306])) $R[306]='NS';
|
||||
$R[307]=($R[140]*100)/$R[130];
|
||||
if (!isset($R[307])) $R[307]='NS';
|
||||
$R[308]=(($p['CJ']-$p['CK']-$p['CH']+$p['CL'])/$R[88]);
|
||||
if (!isset($R[308])) $R[308]='NS';
|
||||
$R[309]=$p['CB'];
|
||||
if (!isset($R[309])) $R[309]='NS';
|
||||
$R[310]=(($p['BJ']-$p['AN'])*100)/$p['EE'];
|
||||
if (!isset($R[310])) $R[310]='NS';
|
||||
$R[311]=$p['AN']+$p['AP'];
|
||||
if (!isset($R[311])) $R[311]='NS';
|
||||
$R[312]=$p['AH'];
|
||||
if (!isset($R[312])) $R[312]='NS';
|
||||
$R[313]=$R[10]*100/$p['EE'];
|
||||
if (!isset($R[313])) $R[313]='NS';
|
||||
$R[314]=$R[311]*100/$p['EE'];
|
||||
if (!isset($R[314])) $R[314]='NS';
|
||||
$R[315]=(($p['YT']+$p['YU'])*12)/$nm ;
|
||||
if (!isset($R[315])) $R[315]='NS';
|
||||
$R[316]=($p['YT']+$p['YU'])*100/($p['FY']+$p['FZ']);
|
||||
if (!isset($R[316])) $R[316]='NS';
|
||||
$R[317]=$p['CP'];
|
||||
if (!isset($R[317])) $R[317]='NS';
|
||||
$R[318]=(($R[170]-$R[181])*12)/$nm;
|
||||
if (!isset($R[318])) $R[318]='NS';
|
||||
$R[321]=(($R[199]-$R[171]+$R[172]+$p['GA'])*12)/$nm;
|
||||
if (!isset($R[321])) $R[321]='NS';
|
||||
$R[330]=$p['FZ']/$p['FY'];
|
||||
if (!isset($R[330])) $R[330]='NS';
|
||||
$R[331]=$p['FY']/$p['YP'];
|
||||
if (!isset($R[331])) $R[331]='NS';
|
||||
$R[500]=$p['EE']*0.15;
|
||||
if (!isset($R[500])) $R[500]='NS';
|
||||
$R[501]=($p['CS']+$p['CU'])*100/($p['BJ']-$p['AN']);
|
||||
if (!isset($R[501])) $R[501]='NS';
|
||||
$R[502]=($p['CV']+$p['BC'])*100/($p['CS']+$p['CU']);
|
||||
if (!isset($R[502])) $R[502]='NS';
|
||||
$R[503]=$R[233]*100/$R[5];
|
||||
if (!isset($R[503])) $R[503]='NS';
|
||||
$R[504]=((($p['FL']+$p['FM']+$p['FN'])*12)/$nm);if ($R[504]<0) $R[504]=0;
|
||||
if (!isset($R[504])) $R[504]='NS';
|
||||
$R[505]=(($R[130]*12)/$nm)*100/$R[6];
|
||||
if (!isset($R[505])) $R[505]='NS';
|
||||
$R[506]=(($R[140]*12)/$nm)*100/$R[6];
|
||||
if (!isset($R[506])) $R[506]='NS';
|
||||
$R[507]=($R[17]*100)/$R[6];
|
||||
if (!isset($R[507])) $R[507]='NS';
|
||||
$R[508]=(($R[170]*12)/$nm)*100/$R[6];
|
||||
if (!isset($R[508])) $R[508]='NS';
|
||||
$R[509]=($R[11]*100)/$R[6];
|
||||
if (!isset($R[509])) $R[509]='NS';
|
||||
$R[510]=($R[70]*100)/$R[22];
|
||||
if (!isset($R[510])) $R[510]='NS';
|
||||
$R[511]=($R[70]+$R[72])*100/($R[79]+$R[90]);
|
||||
if (!isset($R[511])) $R[511]='NS';
|
||||
$R[512]=$R[226]/$R[286];
|
||||
if (!isset($R[512])) $R[512]='NS';
|
||||
$R[513]=(($p['HN']- $p['HI']- $p['FO']- $p['FP'])*12)/$nm;
|
||||
if (!isset($R[513])) $R[513]='NS';
|
||||
$R[514]=($R[513]*100)/$R[6];
|
||||
if (!isset($R[514])) $R[514]='NS';
|
||||
$R[515]=($p['HN']-$p['HI']-$p['FO']-$p['FP']);
|
||||
if (!isset($R[515])) $R[515]='NS';
|
||||
$R[516]=($R[513]-$R[11])*100/$R[11];
|
||||
if (!isset($R[516])) $R[516]='NS';
|
||||
$R[517]=($R[233]*100)/($p['BJ']-$p['AN']);
|
||||
if (!isset($R[517])) $R[517]='NS';
|
||||
$R[518]=($R[233]*100)/$R[80];
|
||||
if (!isset($R[518])) $R[518]='NS';
|
||||
$R[519]=($R[80]*100)/$R[22];
|
||||
if (!isset($R[519])) $R[519]='NS';
|
||||
$R[520]=($R[153]*100)/$R[5];
|
||||
if (!isset($R[520])) $R[520]='NS';
|
||||
$R[521]=($R[226]+$p['CS']-$p['CT']+$p['CU']-$p['CV']+$p['BB']-$p['BC']+$R[210])/(($R[102]+$R[121]+$R[123]+$R[132]+$R[133]+$R[142])/360);
|
||||
if (!isset($R[521])) $R[521]='NS';
|
||||
$R[522]=($R[16]*100)/$R[22];
|
||||
if (!isset($R[522])) $R[522]='NS';
|
||||
$R[523]=($R[10]*100)/$R[70];
|
||||
if (!isset($R[523])) $R[523]='NS';
|
||||
$R[524]=($R[52]*100)/$R[22];
|
||||
if (!isset($R[524])) $R[524]='NS';
|
||||
$R[525]=($R[60]*100)/$R[22];
|
||||
if (!isset($R[525])) $R[525]='NS';
|
||||
$R[526]=($R[63]*100)/$R[22];
|
||||
if (!isset($R[526])) $R[526]='NS';
|
||||
$R[527]=($R[202]*100)/$R[22];
|
||||
if (!isset($R[527])) $R[527]='NS';
|
||||
$R[528]=($R[110]*100)/$R[5];
|
||||
if (!isset($R[528])) $R[528]='NS';
|
||||
$R[529]=($p['ZE']*12)/$nm;
|
||||
if (!isset($R[529])) $R[529]='NS';
|
||||
$R[530]=(($R[153]+$R[170])*100)/$R[153];
|
||||
if (!isset($R[530])) $R[530]='NS';
|
||||
$R[531]=(($R[153]+$R[170]+$p['XQ'])*100)/($R[153]+$p['XQ']);
|
||||
if (!isset($R[531])) $R[531]='NS';
|
||||
$R[532]=($R[52]*100)/($p['BJ']-$p['AN']);
|
||||
if (!isset($R[532])) $R[532]='NS';
|
||||
$R[533]=($R[53]*100)/$R[22];
|
||||
if (!isset($R[533])) $R[533]='NS';
|
||||
$R[534]=($R[1]*100)/$R[5];
|
||||
if (!isset($R[534])) $R[534]='NS';
|
||||
$R[535]=($p['ZE']*100)/$R[70];
|
||||
if (!isset($R[535])) $R[535]='NS';
|
||||
$R[538]=($R[233]*100)/$R[305];
|
||||
if (!isset($R[538])) $R[538]='NS';
|
||||
$R[540]=($R[233]*100)/$R[202];
|
||||
if (!isset($R[540])) $R[540]='NS';
|
||||
$R[542]=($R[16]*100)/$R[153];
|
||||
if (!isset($R[542])) $R[542]='NS';
|
||||
$R[543]=($R[10]*100)/($R[70]+$R[72]);
|
||||
if (!isset($R[543])) $R[543]='NS';
|
||||
$R[544]=(($R[130]*12)/$nm)/$R[24];
|
||||
if (!isset($R[544])) $R[544]='NS';
|
||||
$R[545]=$R[515]-$R[10];
|
||||
if (!isset($R[545])) $R[545]='NS';
|
||||
$R[546]=$R[22]-$R[231]-$R[202];
|
||||
if (!isset($R[546])) $R[546]='NS';
|
||||
$R[547]=$p['CJ']-$p['CK'];
|
||||
if (!isset($R[547])) $R[547]='NS';
|
||||
$R[548]=$R[22]-$R[547];
|
||||
if (!isset($R[548])) $R[548]='NS';
|
||||
$R[549]=$p['DB'];
|
||||
if (!isset($R[549])) $R[549]='NS';
|
||||
$R[550]=$p['DC'];
|
||||
if (!isset($R[550])) $R[550]='NS';
|
||||
$R[551]=$p['DH'];
|
||||
if (!isset($R[551])) $R[551]='NS';
|
||||
$R[552]=$R[549]+$R[550]+$R[551];
|
||||
if (!isset($R[552])) $R[552]='NS';
|
||||
$R[553]=$R[145]-$R[144];
|
||||
if (!isset($R[553])) $R[553]='NS';
|
||||
$R[554]=($R[51]*100)/$R[22];
|
||||
if (!isset($R[554])) $R[554]='NS';
|
||||
$R[555]=($R[151]*100)/$R[53];
|
||||
if (!isset($R[555])) $R[555]='NS';
|
||||
$R[556]=($R[62]*100)/$R[22];
|
||||
if (!isset($R[556])) $R[556]='NS';
|
||||
$R[558]=$R[547]-$R[63]-$R[60]-$R[223];
|
||||
if (!isset($R[558])) $R[558]='NS';
|
||||
$R[559]=abs($R[223]);
|
||||
if (!isset($R[559])) $R[559]='NS';
|
||||
$R[560]=abs($R[63]);
|
||||
if (!isset($R[560])) $R[560]='NS';
|
||||
$R[561]=$R[5]+$p['FQ']+$p['FO'];
|
||||
if (!isset($R[561])) $R[561]='NS';
|
||||
$R[562]=($p['BX']+$p['BV']-$p['BW'])+($p['YS'])+($p['CN'])+($p['CH']-$p['CI']);
|
||||
if (!isset($R[562])) $R[562]='NS';
|
||||
$R[563]=$R[561]-$R[562];
|
||||
if (!isset($R[563])) $R[563]='NS';
|
||||
$R[564]=$p['FW']+$p['FX']+$p['FY']+$p['FZ']+$p['GE'];
|
||||
if (!isset($R[564])) $R[564]='NS';
|
||||
$R[565]=$p['DX']+$p['DW']+$p['EB']+$p['ED'];
|
||||
if (!isset($R[565])) $R[565]='NS';
|
||||
$R[566]=$R[564]-$R[565];
|
||||
if (!isset($R[566])) $R[566]='NS';
|
||||
$R[567]=$R[563]-$R[566];
|
||||
if (!isset($R[567])) $R[567]='NS';
|
||||
$R[568]=$p['GL']+$p['GN']-$p['GS']+$p['HA']-$p['HE'];
|
||||
if (!isset($R[568])) $R[568]='NS';
|
||||
$R[569]=$p['GR'];
|
||||
if (!isset($R[569])) $R[569]='NS';
|
||||
$R[570]=$p['HK']+$p['DY1']-$p['DY'];
|
||||
if (!isset($R[570])) $R[570]='NS';
|
||||
$R[571]=$p['HJ'];
|
||||
if (!isset($R[571])) $R[571]='NS';
|
||||
$R[572]=$p['ZE'];
|
||||
if (!isset($R[572])) $R[572]='NS';
|
||||
$R[573]=$R[567]+$R[568]-$R[569]-$R[570]-$R[571]-$R[572];
|
||||
if (!isset($R[573])) $R[573]='NS';
|
||||
$R[574]=$p['LP']+$p['KF'];
|
||||
if (!isset($R[574])) $R[574]='NS';
|
||||
$R[575]=$p['LS'];
|
||||
if (!isset($R[575])) $R[575]='NS';
|
||||
$R[576]=$p['KF'];
|
||||
if (!isset($R[576])) $R[576]='NS';
|
||||
$R[577]=$p['DJ'];
|
||||
if (!isset($R[577])) $R[577]='NS';
|
||||
$R[578]=$p['DZ']-$p['DZ1'];
|
||||
if (!isset($R[578])) $R[578]='NS';
|
||||
$R[579]=$p['NG'];
|
||||
if (!isset($R[579])) $R[579]='NS';
|
||||
$R[580]=$R[574]+$R[575]+$R[576]-$R[577]-$R[578]-$R[579];
|
||||
if (!isset($R[580])) $R[580]='NS';
|
||||
$R[581]=$p['AA']-$p['AA1'];
|
||||
if (!isset($R[581])) $R[581]='NS';
|
||||
$R[582]=$p['CC1']-$p['CC2'];
|
||||
if (!isset($R[582])) $R[582]='NS';
|
||||
$R[583]=$R[581]-$R[582];
|
||||
if (!isset($R[583])) $R[583]='NS';
|
||||
$R[584]=$p['VJ']+$p['GR'];
|
||||
if (!isset($R[584])) $R[584]='NS';
|
||||
$R[585]=$p['VK']+($p['HP']+$p['HQ'])+$p['GR1'];
|
||||
if (!isset($R[585])) $R[585]='NS';
|
||||
$R[586]=($R[584]-$R[585]);
|
||||
if (!isset($R[586])) $R[586]='NS';
|
||||
$R[587]=$p['EH']-$p['EH1'];
|
||||
if (!isset($R[587])) $R[587]='NS';
|
||||
$R[588]=$p['YS']-$p['YS1'];
|
||||
if (!isset($R[588])) $R[588]='NS';
|
||||
$R[589]=$R[587]+$R[588];
|
||||
if (!isset($R[589])) $R[589]='NS';
|
||||
$R[590]=$R[583]+$R[586]+$R[589];
|
||||
if (!isset($R[590])) $R[590]='NS';
|
||||
$R[591]=$p['CG']-$p['CG2'];
|
||||
if (!isset($R[591])) $R[591]='NS';
|
||||
$R[592]=$p['CE']-$p['CE2'];
|
||||
if (!isset($R[592])) $R[592]='NS';
|
||||
$R[593]=$R[573]-$R[580]+$R[590];
|
||||
if (!isset($R[593])) $R[593]='NS';
|
||||
$R[594]=($R[22]-$R[59]-$R[223]);
|
||||
if (!isset($R[594])) $R[594]='NS';
|
||||
$R[595]=($R[22]-$R[79]-$R[80]-$R[230]);
|
||||
if (!isset($R[595])) $R[595]='NS';
|
||||
$R[596]=$p['EE']-$R[79]-$R[89]-$R[84];
|
||||
if (!isset($R[596])) $R[596]='NS';
|
||||
$R[597]=$p['EE']-$R[65]-$R[60]-$R[59];
|
||||
if (!isset($R[597])) $R[597]='NS';
|
||||
$R[701]=$p['BP3'];
|
||||
if (!isset($R[701])) $R[701]='NS';
|
||||
$R[702]=$p['BR3'];
|
||||
if (!isset($R[702])) $R[702]='NS';
|
||||
$R[703]=$p['BP8'];
|
||||
if (!isset($R[703])) $R[703]='NS';
|
||||
$R[704]=$p['BP3'];
|
||||
if (!isset($R[704])) $R[704]='NS';
|
||||
$R[705]=($p['BA1']-$p['BP1'])*12/$nm;
|
||||
if (!isset($R[705])) $R[705]='NS';
|
||||
$R[706]=($p['BA2']-$p['BP2'])*12/$nm;
|
||||
if (!isset($R[706])) $R[706]='NS';
|
||||
$R[707]=($p['BR1']*12)/$nm;
|
||||
if (!isset($R[707])) $R[707]='NS';
|
||||
$R[708]=($p['BR2']*12)/$nm;
|
||||
if (!isset($R[708])) $R[708]='NS';
|
||||
$R[710]=$p['BP3']+$p['BP4']+$p['BP5']+$p['BP7']+$p['BP8']-($p['BP8']*0.07);
|
||||
if (!isset($R[710])) $R[710]='NS';
|
||||
$R[711]=$p['BP6'];if ($R[711]>0) $R[711]=0;
|
||||
if (!isset($R[711])) $R[711]='NS';
|
||||
$R[712]=($R[710]*12)/$nm;
|
||||
if (!isset($R[712])) $R[712]='NS';
|
||||
$R[713]=($R[711]*12)/$nm;
|
||||
if (!isset($R[713])) $R[713]='NS';
|
||||
$R[715]=0;
|
||||
if (!isset($R[715])) $R[715]='NS';
|
||||
$R[716]=($p['BP1']+$p['BP2']-$p['BA1']-$p['BA2'])/($R[710]*12.5);
|
||||
if (!isset($R[716])) $R[716]='NS';
|
||||
$R[720]=($p['BP1']+$p['BP2']-$p['BA1']+($p['BA1']*0.20)-$p['BA2']+($p['BA2']*0.025));
|
||||
if (!isset($R[720])) $R[720]='NS';
|
||||
$R[721]=($R[720]*12)/$nm;
|
||||
if (!isset($R[721])) $R[721]='NS';
|
||||
$R[722]=($R[712]*100)/$R[721];
|
||||
if (!isset($R[722])) $R[722]='NS';
|
||||
$R[723]=($R[712]+$R[713])*100/$R[721];
|
||||
if (!isset($R[723])) $R[723]='NS';
|
||||
$R[724]=$R[721]*0.08;
|
||||
if (!isset($R[724])) $R[724]='NS';
|
||||
$R[730]=$p['BR3']/$R[710];
|
||||
if (!isset($R[730])) $R[730]='NS';
|
||||
$R[731]=$p['BR3']/($R[710]+$R[711]);
|
||||
if (!isset($R[731])) $R[731]='NS';
|
||||
$R[732]=$p['BR3']/$p['BA3'];
|
||||
if (!isset($R[732])) $R[732]='NS';
|
||||
$R[740]=($p['BA1']-($p['BA1']*0.2)+$p['BA2']-($p['BA2']*0.025)-($R[710]*0.15))*100/($R[710]*8);
|
||||
if (!isset($R[740])) $R[740]='NS';
|
||||
$R[741]=($p['BA1']-($p['BA1']*0.2)+$p['BA2']-($p['BA2']*0.025)-(($R[710]+$R[711])*0.15))*100/(($R[710]+$R[711])*8);
|
||||
if (!isset($R[741])) $R[741]='NS';
|
||||
$R[742]=0;
|
||||
if (!isset($R[742])) $R[742]='NS';
|
||||
$R[751]=$p['AP1'];
|
||||
if (!isset($R[751])) $R[751]='NS';
|
||||
$R[752]=$p['AP2'];
|
||||
if (!isset($R[752])) $R[752]='NS';
|
||||
$R[753]=$p['AR3'];
|
||||
if (!isset($R[753])) $R[753]='NS';
|
||||
$R[757]=($p['AR1']*12)/$nm;
|
||||
if (!isset($R[757])) $R[757]='NS';
|
||||
$R[758]=($p['AR2']*12)/$nm;
|
||||
if (!isset($R[758])) $R[758]='NS';
|
||||
$R[761]=($p['AP1']*12)/$nm;
|
||||
if (!isset($R[761])) $R[761]='NS';
|
||||
$R[762]=($p['AP2']*12)/$nm;
|
||||
if (!isset($R[762])) $R[762]='NS';
|
||||
$R[770]=($R[761]*100)/$R[762];
|
||||
if (!isset($R[770])) $R[770]='NS';
|
||||
$R[771]=($p['AP1']*100)/$p['AR1'];
|
||||
if (!isset($R[771])) $R[771]='NS';
|
||||
$R[772]=($p['AP1']*100)/$p['AR2'];
|
||||
if (!isset($R[772])) $R[772]='NS';
|
||||
$R[780]=($p['AR4']*100)/$p['AP1'];
|
||||
if (!isset($R[780])) $R[780]='NS';
|
||||
$R[781]=($p['AR4']*100)/$p['AR1'];
|
||||
if (!isset($R[781])) $R[781]='NS';
|
||||
$R[782]=($p['AR4']*100)/$p['AA2'];
|
||||
if (!isset($R[782])) $R[782]='NS';
|
||||
$R[783]=($p['AR4']*100)/($p['AP1']-$p['AR4']);
|
||||
if (!isset($R[783])) $R[783]='NS';
|
||||
$R[784]=($p['AR2']*100)/$p['AR1'];
|
||||
if (!isset($R[784])) $R[784]='NS';
|
||||
$R[791]=($p['AA1']*100)/$p['AP1'];
|
||||
if (!isset($R[791])) $R[791]='NS';
|
||||
$R[792]=($p['AA1']*100)/$p['AP2'];
|
||||
if (!isset($R[792])) $R[792]='NS';
|
||||
$R[333]=($R[233]*12)/$nm;
|
||||
if (!isset($R[333])) $R[333]='NS';
|
||||
|
||||
$tabRatios[$numBil]=$R;
|
||||
$numBil++;
|
||||
}
|
||||
?>
|
||||
|
||||
for($i=0; $i<$numBil; $i++) {
|
||||
$tabRatios[$i][319]=($tabRatios[$i][318]+$tabRatios[$i+1][318]+$tabRatios[$i+2][318])/3; }
|
||||
|
||||
for($i=0; $i<$numBil; $i++) {
|
||||
$tabRatios[$i][320]=($tabRatios[$i][11]+$tabRatios[$i+1][11]+$tabRatios[$i+2][11])/3; }
|
||||
|
||||
for($i=0; $i<$numBil; $i++) {
|
||||
$tabRatios[$i][322]=($tabRatios[$i][321]+$tabRatios[$i+1][321]+$tabRatios[$i+2][321])/3; }
|
||||
|
||||
for($i=0; $i<$numBil; $i++) {
|
||||
$tabRatios[$i][536]=($tabRatios[$i][306]+$tabRatios[$i+1][306]+$tabRatios[$i+2][306])/3; }
|
||||
|
||||
for($i=0; $i<$numBil; $i++) {
|
||||
$tabRatios[$i][537]=($tabRatios[$i][503]+$tabRatios[$i+1][503]+$tabRatios[$i+2][503])/3; }
|
||||
|
||||
for($i=0; $i<$numBil; $i++) {
|
||||
$tabRatios[$i][539]=($tabRatios[$i][538]+$tabRatios[$i+1][538]+$tabRatios[$i+2][538])/3; }
|
||||
|
||||
for($i=0; $i<$numBil; $i++) {
|
||||
$tabRatios[$i][541]=($tabRatios[$i][540]+$tabRatios[$i+1][540]+$tabRatios[$i+2][540])/3; }
|
||||
|
||||
for($i=0; $i<$numBil; $i++) {
|
||||
$tabRatios[$i][557]=($tabRatios[$i][265]+$tabRatios[$i+1][265]+$tabRatios[$i+2][265])/3; }
|
||||
|
||||
for($i=0; $i<$numBil; $i++) {
|
||||
$tabRatios[$i][598]=($tabRatios[$i][529]+$tabRatios[$i+1][529]+$tabRatios[$i+2][529])/3; }
|
||||
|
||||
return $tabRatios;
|
||||
}
|
||||
|
@ -1,16 +1,11 @@
|
||||
<?php
|
||||
|
||||
require_once 'Metier/partenaires/classMPrivileges.php';
|
||||
|
||||
require_once 'Metier/partenaires/classMMarques.php';
|
||||
|
||||
require_once 'Metier/scores/classMRegression.php';
|
||||
|
||||
require_once 'Metier/partenaires/classMLiens2.php';
|
||||
|
||||
require_once 'Metier/scores/classMSolvabilite.php';
|
||||
|
||||
require_once 'Metier/scores/Variables/configMRatios.php';
|
||||
require_once 'Metier/scores/classMRatios.php';
|
||||
|
||||
define('INDISCORE_DEBUG', false);
|
||||
|
||||
@ -596,7 +591,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
global $tabFormules;
|
||||
global $tabFormulesRatios;
|
||||
global $mBil;
|
||||
global $tabBilan;
|
||||
global $efftr;
|
||||
global $tabRatiosInfos;
|
||||
|
||||
@ -625,7 +619,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
* Récupération des informations identitaire
|
||||
*/
|
||||
$tabIdentite=$iInsee->getIdentiteEntreprise($siren, $nic, 0, false, $accesDist);
|
||||
$tabBilan=array();
|
||||
$timer['identite']=microtime(true);
|
||||
|
||||
if (empty($tabIdentite)) {
|
||||
@ -645,15 +638,15 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$classWdate = new WDate();
|
||||
|
||||
//Initialisation tabFormules depuis le cache
|
||||
$tabVariables = include realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'Variables/CacheTabVariables.php';
|
||||
$tabFormules = include realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'Variables/CacheTabFormules.php';
|
||||
$tabVariables = include __DIR__ . '/Variables/CacheTabVariables.php';
|
||||
$tabFormules = include __DIR__ . '/Variables/CacheTabFormules.php';
|
||||
$tabFormulesRatios = array();
|
||||
foreach ($tabFormules as $tmpFormule) {
|
||||
$tabFormulesRatios[$tmpFormule['id']] = $tmpFormule;
|
||||
$tabRatiosInfos[$tmpFormule['id']]=array('unite' => $tmpFormule['unite']);
|
||||
}
|
||||
|
||||
$tabRatiosSecteurs = $tabBilansR = $tabRatios2 = $tabRatiosEvol = array();
|
||||
$tabRatiosSecteurs = $tabRatios2 = $tabRatiosEvol = array();
|
||||
|
||||
$NIC=substr($tabIdentite['SiretSiege'],-5);
|
||||
$SIREN=$siren;
|
||||
@ -933,49 +926,41 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$DCREN_AA=substr($dateCrea,0,4);
|
||||
$AGE=$classWdate->nbMoisEntre($dateCrea, date('Ymd'));
|
||||
|
||||
/** Elements provenant des ratios :
|
||||
** @todo Problème sur les comptes consolides avec R et Rs **
|
||||
$i2=0;
|
||||
foreach ($tabRatios as $i=>$Rtmp) {
|
||||
if ( ($tabBilan[$i]['CONSOLIDE']=='S'&&isset($tabRatios[$i+1])&&($tabBilan[$i+1]['CONSOLIDE']=='S'||($tabBilan[$i+1]['CONSOLIDE']=='N'&&$tabBilan[$i+1]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])))
|
||||
|| ($tabBilan[$i]['CONSOLIDE']=='N'&&isset($tabRatios[$i+1])&&($tabBilan[$i+1]['CONSOLIDE']=='N'||($tabBilan[$i+1]['CONSOLIDE']=='S'&&$tabBilan[$i+1]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])))
|
||||
)
|
||||
$i2++;
|
||||
// $Rmont=(($R[$Ridx]-$tabRatios[$i+1][$Ridx])*100)/abs($tabRatios[$i+1][$Ridx]);
|
||||
elseif ( ($tabBilan[$i]['CONSOLIDE']=='S'&&isset($tabRatios[$i+1])&&($tabBilan[$i+2]['CONSOLIDE']=='S'||($tabBilan[$i+2]['CONSOLIDE']=='N'&&$tabBilan[$i+2]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])))
|
||||
|| ($tabBilan[$i]['CONSOLIDE']=='N'&&isset($tabRatios[$i+1])&&($tabBilan[$i+2]['CONSOLIDE']=='N'||($tabBilan[$i+2]['CONSOLIDE']=='S'&&$tabBilan[$i+2]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])))
|
||||
$i2=$i2+2;
|
||||
$i2++
|
||||
}
|
||||
*/
|
||||
|
||||
$tabBilan = $tabBil = array();
|
||||
/**
|
||||
* Bilan - Liste des bilans
|
||||
*/
|
||||
$mBil = new MBilans($siren, $iDb);
|
||||
$tabBilans = $mBil->listeBilans($accesDist);
|
||||
$NBBILAN = count($tabBilans);
|
||||
if ($NBBILAN > 0)
|
||||
{
|
||||
/**
|
||||
* Postes des bilans
|
||||
*/
|
||||
foreach ($tabBilans as $millesime => $item)
|
||||
{
|
||||
if(in_array($item['typeBilan'], array('S', 'N')))
|
||||
{
|
||||
$tabBilan[] = $mBil->getBilan(substr($millesime,-10), substr($millesime,0,1), '');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcul des ratios
|
||||
*/
|
||||
$tabBilan=$tabBil=array();
|
||||
if ($NBBILAN>0) $tabRatios = calculRatios($tabBilans, $tabIdentite, $accesDist);
|
||||
/**
|
||||
* Calcul des ratios
|
||||
*/
|
||||
$tabRatios = calculRatios($tabBilans, $tabIdentite, $accesDist);
|
||||
}
|
||||
$timer['ratios']=microtime(true);
|
||||
|
||||
// Tableau des années de bilans
|
||||
$tabAnnees=array();
|
||||
$tabAnnees = array();
|
||||
// Tableau d'infos sur les bilans
|
||||
$i2=0;
|
||||
if (count($tabRatios)>0) {
|
||||
foreach ($tabRatios as $i=>$Rtmp) {
|
||||
$tabBilansR[$i]=array(
|
||||
'dateCloture' => $tabBilan[$i]['DATE_CLOTURE'],
|
||||
'duree' => $tabBilan[$i]['DUREE_MOIS'],
|
||||
'devise' => $tabBilan[$i]['MONNAIE'],
|
||||
'type' => $tabBilan[$i]['CONSOLIDE'],
|
||||
'unite' => 'U',
|
||||
);
|
||||
if (count($tabRatios)>0)
|
||||
{
|
||||
foreach ($tabRatios as $i=>$Rtmp)
|
||||
{
|
||||
if (substr($tabBilan[$i]['DATE_CLOTURE'],0,4)>1900){
|
||||
$tabAnnees[$i]=substr($tabBilan[$i]['DATE_CLOTURE'],0,4);
|
||||
}
|
||||
@ -1041,8 +1026,8 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$MARCHE=$MARCHEp=$MARCHEVOL=$MARCHEPART=$MARCHEPARTp=$MARCHEPARTEVOL='';
|
||||
$MARCHESAL=$MARCHESALp=$MARCHENBENT=$MARCHENBENTp='';
|
||||
$tabRatiosSecteurs=$Rtot=array();
|
||||
if (count($tabAnnees)>0) {
|
||||
|
||||
if (count($tabAnnees)>0)
|
||||
{
|
||||
if (strlen($naf)>4) $strNaf=" AND naf5='$naf' ";
|
||||
else $strNaf=" AND naf4='$naf' ";
|
||||
if (count($tabAnnees)>2) $strAnnees='AND annee BETWEEN '.$tabAnnees[2].' AND '.$tabAnnees[0];
|
||||
@ -1153,29 +1138,12 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
|
||||
$timer['regression']=microtime(true);
|
||||
|
||||
/** Bilan des collectivités **/
|
||||
/*if ($FJUR==7210) {
|
||||
$lstCom=$iDb->select(
|
||||
'bilansM14',
|
||||
'millesime, dep, com, depA, siren, sirenValide, depLib, comLib, popLeg, popInf, fiscalite, popFisc, R01a, R01b, R01c, R02a, R02b, R02c, R02d, R02e, R03a, R03b, R03c, R03d, R03e, R04a, R04b, R04c, R04d, R04e, R05a, R05b, R05c, R06a, R06b, R06c, R06d, R06e, R07a, R07b, R07c, R07d, R07e, R08a, R08b, R08c, R08d, R08e, R09a, R09b, R09c, R09d, R09e, R10a, R10b, R10c, R10d, R10e, R11a, R11b, R11c, R12a, R12b, R12c, R13a, R13b, R13c, R13d, R13e, R14a, R14b, R14c, R14d, R14e, R15a, R15b, R15c, R15d, R15e, R16a, R16b, R16c, R16d, R16e, R17a, R17b, R17c, R18a, R18b, R18c, R18d, R18e, R19a, R19b, R19c, R19d, R19e, R20a, R20b, R20c, R20d, R20e, R21a, R21b, R21c, R21d, R21e, R22a, R22b, R22c, R23a, R23b, R23c, R24a, R24b, R24c, R25a, R25b, R25c, R26a, R26b, R26c, R26d, R26e, R27a, R27b, R27c, R27d, R27e, R28a, R28b, R28c, R28d, R28e, R29a, R29b, R29c, R29d, R29e, R30a, R30b, R30c, R30d, R30e, R31a, R31b, R31c, R31d, R31e, R32a, R32b, R32c, R33a, R33b, R33c, R33d, R33e, R33f, R34a, R34b, R34c, R34d, R34e, R34f, R35a, R35b, R35c, R35d, R35e, R35f, R36a, R36b, R36c, R36d, R36e, R36f, R37a, R37b, R37c, R37d, R37e, R37f, R38a, R38b, R38c, R38d, R38e, R39a, R39b, R39c, R39d, R39e, R40a, R40b, R40c, R40d, R40e, R41a, R41b, R41c, R41d, R41e, R42a, R42b, R42c, R42d, R42e, R43a, R43b, R43c, R43d, R43e, R44a, R44b, R44c, dateInsert',
|
||||
"siren=$siren ORDER BY millesime DESC LIMIT 0,5", false, MYSQL_ASSOC);
|
||||
foreach ($lstCom as $i=>$tabCom) {
|
||||
$tabRatios[]=convertZones('R', $tabCom);
|
||||
}
|
||||
$R=$tabRatios[0];
|
||||
$Rp=$tabRatios[1];
|
||||
$Rp2=$tabRatios[2];
|
||||
$Rp3=$tabRatios[3];
|
||||
$Rp4=$tabRatios[4];
|
||||
}*/
|
||||
|
||||
// Elements provenant des bilans
|
||||
$EFFBILAN=$tabBilan[0]['YP'];
|
||||
$nm=$nbMoisBilCumul=$tabBilan[0]['DUREE_MOIS'];
|
||||
$nmp=$tabBilan[0]['DUREE_MOIS_PRE'];
|
||||
|
||||
$BILANDATE=$tabBilan[0]['DATE_CLOTURE'];
|
||||
$tabClotures[$BILANDATE]=$BILANDATE;
|
||||
$BILANDATEp=$tabBilan[0]['DATE_CLOTURE_PRE'];
|
||||
if ($BILANDATEp==0) $BILANDATEp=$tabBilan[1]['DATE_CLOTURE'];
|
||||
|
||||
@ -1186,7 +1154,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$BILANp=1;
|
||||
$nbMoisBilDate=$classWdate->nbMoisEntre($BILANDATEp, $BILANDATE);
|
||||
$nbMoisBilCumul+=$nmp;
|
||||
$tabClotures[$BILANDATEp]=$BILANDATEp;
|
||||
}
|
||||
|
||||
$BILANDATEp2 =$tabBilan[2]['DATE_CLOTURE'];
|
||||
@ -1196,7 +1163,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$BILANp2=1;
|
||||
$nbMoisBilDate=$classWdate->nbMoisEntre($BILANDATEp2, $BILANDATE);
|
||||
$nbMoisBilCumul+=$nmp2;
|
||||
$tabClotures[$BILANDATEp2]=$BILANDATEp2;
|
||||
}
|
||||
|
||||
$BILANDATEp3 =$tabBilan[3]['DATE_CLOTURE'];
|
||||
@ -1206,7 +1172,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$BILANp3=1;
|
||||
$nbMoisBilDate=$classWdate->nbMoisEntre($BILANDATEp3, $BILANDATE);
|
||||
$nbMoisBilCumul+=$nmp3;
|
||||
$tabClotures[$BILANDATEp3]=$BILANDATEp3;
|
||||
}
|
||||
|
||||
$BILANDATEp4 =$tabBilan[4]['DATE_CLOTURE'];
|
||||
@ -1216,7 +1181,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$BILANp4=1;
|
||||
$nbMoisBilDate=$classWdate->nbMoisEntre($BILANDATEp4, $BILANDATE);
|
||||
//$nbMoisBilCumul+=$nmp4;
|
||||
$tabClotures[$BILANDATEp4]=$BILANDATEp4;
|
||||
}
|
||||
|
||||
// Liste des années de bilans ultérieurs
|
||||
@ -1228,7 +1192,8 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
|
||||
/** Détection fine de l'état de fermeture éventuel à l'INSEE **/
|
||||
$tabTmp=$iDb->select('insee.insee_even', 'insEVE, insDATEVE',
|
||||
"insSIREN=$siren AND insEVE IN ('400','410','420','425','MPF','MNP') ORDER BY insDATEVE DESC", INDISCORE_DEBUG, MYSQL_ASSOC);
|
||||
"insSIREN=$siren AND insEVE IN ('400','410','420','425','MPF','MNP') ORDER BY insDATEVE DESC",
|
||||
INDISCORE_DEBUG, MYSQL_ASSOC);
|
||||
if (count($tabTmp)>0) {
|
||||
$tabModif=$tabTmp[0];
|
||||
$ETATINSEE_MMAA=substr($tabModif['insDATEVE'],0,7);
|
||||
@ -1371,12 +1336,10 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
}
|
||||
}
|
||||
}
|
||||
$tabClotures[str_replace('-','',$depot['dateEffet'])]=str_replace('-','',$depot['DateParution']);
|
||||
$lastDepot=$depot['dateEffet'];
|
||||
$ANNONCEBOD++;
|
||||
$ANNONCEBODC++;
|
||||
}
|
||||
sort($tabClotures);
|
||||
}
|
||||
|
||||
// Publications régulieres et 12 mois identiques
|
||||
@ -2015,7 +1978,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$timer['participations']=microtime(true);
|
||||
|
||||
$tabBil=array();
|
||||
if ($NBBILAN==0)
|
||||
if ($NBBILAN == 0)
|
||||
{
|
||||
$noteSolvabilite=round($noteStructure)*5; // La note finale est sur 100
|
||||
/** Pas de bilan mais capital elevé **/
|
||||
@ -2035,38 +1998,31 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
}
|
||||
else
|
||||
{
|
||||
$numBil=0;//sleep(1);
|
||||
|
||||
for ($i=0; isset($tabBilan[$i]); $i++)
|
||||
$numBil = $i = 0;
|
||||
foreach ($tabBilan as $item)
|
||||
{
|
||||
|
||||
//if (substr($millesime,0,1)=='S') {
|
||||
// @todo attention au type de bilan S en N et banque assu consolidé !!!
|
||||
|
||||
if ($tabBilan[$i]['CONSOLIDE']=='S') {
|
||||
$tabTmp=$mBil->bilanSimplifie2Normal($tabBilan[$i]);
|
||||
$tabBilan[$i]=array_merge($tabTmp, $tabBilan[$i]);
|
||||
if ($item['CONSOLIDE']=='S')
|
||||
{
|
||||
$tabTmp=$mBil->bilanSimplifie2Normal($item);
|
||||
$tabBilan[$i] = array_merge($tabTmp, $item);
|
||||
$numBil++;
|
||||
} elseif ($tabBilan[$i]['CONSOLIDE']=='N')
|
||||
}
|
||||
elseif ($item['CONSOLIDE']=='N')
|
||||
{
|
||||
$numBil++;
|
||||
else {
|
||||
/** On ignore les bilans Assurance, Banques et Consolidés **/
|
||||
/*if ($tabBilan[$i]['CONSOLIDE']=='C' && $scoreAltman=='') {
|
||||
$icotation = new ICotation($tabBilan[$i], true);
|
||||
$scoreAltman=round($icotation->scoreAltman(),2);
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ($numBil>2) break;
|
||||
|
||||
unset($icotation);
|
||||
|
||||
$icotation = new ICotation($tabBilan[$i], true);
|
||||
$icotation = new ICotation($item, true);
|
||||
$secteur=$icotation->getSecteurActivite($isolv->getNaf4($naf));
|
||||
$libSecteur=$icotation->tabLibActivite[$secteur];
|
||||
$chiffeAffaire=$icotation->calculChiffreAffaires($isolv->getNaf4($naf));
|
||||
$tabBil[$i]=array(
|
||||
'Millesime'=>$tabBilan[$i]['DATE_CLOTURE'],
|
||||
$tabBil[$i] = array(
|
||||
'Millesime'=>$item['DATE_CLOTURE'],
|
||||
'FraisPerso'=>$icotation->calculFraisPersonnel(),
|
||||
'CA'=>$chiffeAffaire,
|
||||
'EBE'=>$icotation->calculEBE(),
|
||||
@ -2229,14 +2185,16 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
//sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "Indiscore sur $siren : Structure Score Financier", $strNote);
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
$noteSolvabilitePre=$noteSD;
|
||||
$noteFinPre=$noteMoy;
|
||||
if ($noteSolvabilite>$noteSolvabilitePre) $tendance='Haussière';
|
||||
elseif ($noteSolvabilite==$noteSolvabilitePre) $tendance='Stable';
|
||||
else $tendance='Baissière';
|
||||
}
|
||||
//Note financière Solvabilite = $icotation->scoreD($naf)
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Cas de présence unique de bilan Banque ou Assurance qui ne sont pas géré financièrement
|
||||
@ -2264,7 +2222,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
(substr($tabIdentite['DateCreaEn'],0,4)*1+2)<date('Y') && // L'entreprise à plus de 2 ans
|
||||
$FJURPUB ) { // et est soumise à publication
|
||||
$SCORECONF-=20;
|
||||
//$tabCommentaires['neg'][]=prepareString("L'entreprise ne respecte pas ses obligations de publication régulière de ses bilans.");
|
||||
}
|
||||
if (!$tabIdentite['TvaAttribue']) { // Entreprise sans numéro de TVA
|
||||
$TVAINTRA=false;
|
||||
@ -2774,7 +2731,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
// Encours estimé = CA Estimé / 72
|
||||
if ($CAESTIME>0) $encoursEstime=$CAESTIME/36;
|
||||
}
|
||||
// debugLog('I', "INDISCORE A $encoursIni $encoursEstime $encours", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
/** Plafond des encours en fonction de la note / 100
|
||||
**/
|
||||
@ -3432,7 +3388,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
}
|
||||
|
||||
//Chargement des phrases de commentaires - @todo : Mettre en cache
|
||||
$tabCommentaires = $tabTri = $tabTriAff = array();
|
||||
$tabCommentaires = $tabTriAff = array();
|
||||
switch( $type ) {
|
||||
case 'scores':
|
||||
$version = '414';
|
||||
@ -3452,7 +3408,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
}
|
||||
require_once 'Metier/scores/Variables/'.$fileIndiscore;
|
||||
|
||||
asort($tabTri);
|
||||
asort($tabTriAff);
|
||||
$tabCommentairesATrier=array();
|
||||
global $idx;
|
||||
@ -3464,7 +3419,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
foreach ($C as $idx=>$value){
|
||||
$numC++;
|
||||
if ($value) {
|
||||
$commentaires=@implode('<br/>',$tabCommentaires[$idx][$cycleClient]);
|
||||
$commentaires=@implode('<br/>',$tabCommentaires[$idx]);
|
||||
$commentaires=preg_replace('/\[0+/', '[', $commentaires);
|
||||
|
||||
if(INDISCORE_DEBUG) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -225,20 +225,17 @@ function filtreNumero(&$formR, &$criteres, &$sphinx)
|
||||
function filtreDateNaiss(&$formR, &$criteres, &$sphinx)
|
||||
{
|
||||
$jj = preg_replace('/[^0-9]/', '', $formR['dirDateNaissJJ']);
|
||||
if ($jj < 0 ||
|
||||
$jj > 31) {
|
||||
echo ('Jour de naissance incorrect !');
|
||||
if ($jj < 0 || $jj > 31) {
|
||||
//echo ('Jour de naissance incorrect !');
|
||||
}
|
||||
$mm = preg_replace('/[^0-9]/', '', $formR['dirDateNaissMM']);
|
||||
if ($mm < 0 ||
|
||||
$mm > 12) {
|
||||
echo ('Mois de naissance incorrect !');
|
||||
if ($mm < 0 || $mm > 12) {
|
||||
//echo ('Mois de naissance incorrect !');
|
||||
}
|
||||
$aa = preg_replace('/[^0-9]/', '', $formR['dirDateNaissAAAA']);
|
||||
$annee = date('Y') - 18;
|
||||
if ($aa < 0 ||
|
||||
$aa > $annee) {
|
||||
echo ('Année de naissance incorrecte !');
|
||||
if ($aa < 0 || $aa > $annee) {
|
||||
//echo ('Année de naissance incorrecte !');
|
||||
}
|
||||
|
||||
if (empty($jj) == false && strstr($criteres, 'J') != false) {
|
||||
|
Loading…
Reference in New Issue
Block a user