2009-03-25 09:37:17 +00:00
< ? php
2009-03-25 18:32:45 +00:00
if ( ! $_SESSION [ 'connected' ]) die ();
2009-04-02 09:54:01 +00:00
$tabInfo = $_SESSION [ 'tabInfo' ];
2009-03-25 18:32:45 +00:00
$siret = trim ( preg_replace ( '/[^0-9]/' , '' , $_REQUEST [ 'siret' ]));
if ( strlen ( $siret ) <> 0 && strlen ( $siret ) <> 9 && strlen ( $siret ) <> 14 ) die ( 'Param<61> tres incorrects !' );
$idEntreprise = trim ( preg_replace ( '/[^0-9]/' , '' , $_REQUEST [ 'idEntreprise' ])) * 1 ; // Si id=0 alors non communiqu<71>
if (( $siret * 1 ) == 0 && $idEntreprise == 0 ) die ( 'Param<61> tres incorrects !' );
$siren = substr ( $siret , 0 , 9 );
2009-04-03 09:30:51 +00:00
$ratiosEntrep = array ();
$ratiosInfos = array ();
$bilansInfos = array ();
$rationsEntrepEvol = array ();
2009-03-25 18:32:45 +00:00
try {
2009-04-03 09:30:51 +00:00
$O = $client -> getRatios ( $siren );
$bilansInfos = $O [ 'result' ][ 'BilansInfos' ];
$ratiosInfos = $O [ 'result' ][ 'RatiosInfos' ];
$ratiosEntrep = $O [ 'result' ][ 'RatiosEntrep' ];
2009-04-08 08:06:07 +00:00
$ratiosEntrepEvol = $O [ 'result' ][ 'RatiosEntrepEvol' ];
print '<!--' ;
print_r ( $O [ 'result' ]);
print '-->' ;
2009-03-25 18:32:45 +00:00
} catch ( SoapFault $fault ) {
include_once ( realpath ( dirname ( __FILE__ ) . '/../../' ) . '/includes/soaperror.php' );
processSoapFault ( $client , $fault , $tabInfo );
die ();
}
2009-03-25 09:37:17 +00:00
2009-04-03 09:30:51 +00:00
function dRatio ( $nAnnee , $nRatio ){
global $ratiosEntrep ;
global $ratiosInfos ;
$ratio = $ratiosEntrep [ $nAnnee ][ $nRatio ];
if ( $ratio == 'NS' ) {
print 'NS' ;
} elseif ( $ratio == NULL ){
print '-' ;
} else {
if ( ( $ratiosInfos [ $nRatio ][ 'unite' ] == 'EUR' ) && (( abs ( $ratio ) / 1000 ) > 0 ) ){
print number_format ( $ratio / 1000 , 0 , '' , ' ' ) . ' K€' ;
} elseif (( $ratiosInfos [ $nRatio ][ 'unite' ] == 'EUR' ) && (( abs ( $ratio ) / 1000 ) < 0 )) {
print number_format ( $ratio , 0 , '' , ' ' ) . ' €' ;
} elseif (( $ratiosInfos [ $nRatio ][ 'unite' ] == 'Jours' )) {
print number_format ( $ratio , 0 , '' , ' ' ) . ' ' . $ratiosInfos [ $nRatio ][ 'unite' ];
} elseif (( $ratiosInfos [ $nRatio ][ 'unite' ] == 'AN' )) {
print number_format ( $ratio , 2 , '' , ' ' ) . ' ' . $ratiosInfos [ $nRatio ][ 'unite' ];
} elseif (( $ratiosInfos [ $nRatio ][ 'unite' ] == '%' )) {
print number_format ( $ratio , 2 , '' , ' ' ) . ' ' . $ratiosInfos [ $nRatio ][ 'unite' ];
} else {
print $ratio . ' ' . $ratiosInfos [ $nRatio ][ 'unite' ];
}
}
}
2009-03-25 09:37:17 +00:00
?>
2009-04-03 09:30:51 +00:00
< script type = " text/javascript " src = " ./js/jquery.simpletip.js " ></ script >
< script type = " text/javascript " >
$ ( document ) . ready ( function (){
$ ( " #r235 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r235 > .tooltip " ) . text ()});
$ ( " #r236 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r236 > .tooltip " ) . text ()});
$ ( " #r233 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r233 > .tooltip " ) . text ()});
$ ( " #r234 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r234 > .tooltip " ) . text ()});
$ ( " #r237 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r237 > .tooltip " ) . text ()});
$ ( " #r238 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r238 > .tooltip " ) . text ()});
$ ( " #r239 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r239 > .tooltip " ) . text ()});
$ ( " #r240 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r240 > .tooltip " ) . text ()});
$ ( " #r262 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r262 > .tooltip " ) . text ()});
$ ( " #r263 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r263 > .tooltip " ) . text ()});
$ ( " #r264 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r264 > .tooltip " ) . text ()});
$ ( " #r265 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r265 > .tooltip " ) . text ()});
$ ( " #r266 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r266 > .tooltip " ) . text ()});
$ ( " #r250 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r250 > .tooltip " ) . text ()});
$ ( " #r251 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r251 > .tooltip " ) . text ()});
$ ( " #r252 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r252 > .tooltip " ) . text ()});
$ ( " #r244 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r244 > .tooltip " ) . text ()});
$ ( " #r247 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r247 > .tooltip " ) . text ()});
$ ( " #r248 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r248 > .tooltip " ) . text ()});
$ ( " #r271 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r271 > .tooltip " ) . text ()});
$ ( " #r278 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r278 > .tooltip " ) . text ()});
$ ( " #r279 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r279 > .tooltip " ) . text ()});
$ ( " #r281 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r281 > .tooltip " ) . text ()});
$ ( " #r261 " ) . simpletip ({ fixed : true , position : 'bottom' , content : $ ( this ) . find ( " #r261 > .tooltip " ) . text ()});
});
</ script >
2009-03-25 09:37:17 +00:00
< style >
#container
{
width : 580 px ;
background - color : #FFFFFF;
}
#ratios
{
font - family : " Lucida Sans Unicode " , " Lucida Grande " , Sans - Serif ;
font - size : 12 px ;
2009-04-03 09:30:51 +00:00
margin : 10 px 0 0 0 ;
2009-03-25 09:37:17 +00:00
width : 580 px ;
text - align : left ;
border - collapse : collapse ;
}
2009-04-03 09:30:51 +00:00
#ratios a {
color : #000000;
cursor : help ;
}
2009-03-25 09:37:17 +00:00
#ratios th
{
padding : 8 px ;
font - weight : normal ;
font - size : 13 px ;
color : #039;
background : #b9c9fe;
}
#ratios td
{
padding : 8 px ;
border : 1 px solid #000;
color : #000;
}
#ratios td.center {
text - align : center ;
}
#ratios td.italique {
font - style : italic ;
}
2009-04-03 09:30:51 +00:00
#ratios td.right {
text - align : right ;
}
2009-03-25 09:37:17 +00:00
#ratios tr.subhead td
{
padding : 8 px ;
background : #b9c9fe;
border : 1 px solid #000;
font - weight : bold ;
color : #000;
}
#entete {
margin : 1 px ;
}
2009-04-03 09:30:51 +00:00
#secteur{
margin - top : 10 px ;
}
2009-03-25 09:37:17 +00:00
2009-04-03 09:30:51 +00:00
. tooltip {
display : none ;
position : absolute ;
padding : 10 px 10 px ;
width : 300 px ;
z - index : 3 ;
color : #303030;
background - color : #f5f5b5;
border : 1 px solid #DECA7E;
font - family : sans - serif ;
font - weight : normal ;
font - size : 12 px ;
line - height : 16 px ;
}
2009-03-25 09:37:17 +00:00
</ style >
< div id = " container " >
2009-03-26 11:44:14 +00:00
< div >< img id = " entete " src = " ./img/rub_ratios.png " width = " 577 " height = " 36 " ></ div >
2009-03-25 09:37:17 +00:00
2009-04-03 09:30:51 +00:00
< table width = " 580 " border = " 0 " align = " left " bgcolor = " #FFFFFF " >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Num & eacute ; ro identifiant Siren </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = substr ( $siren , 0 , 3 ) . ' ' . substr ( $siren , 3 , 3 ) . ' ' . substr ( $siren , 6 , 3 ) ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Raison Sociale </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $tabInfo [ 'entrep' ][ 'raisonSociale' ]; ?> </td>
</ tr >
</ table >
< br />< br />
< ? php
if ( count ( $ratiosEntrep ) == 0 || ! isset ( $ratiosEntrep )){
?>
< table >
< tr >< td width = " 30 " >& nbsp ; </ td >< td >< b > Aucun bilan disponible pour cette entreprise !</ b ></ td ></ tr >
</ table >
< ? php
} else {
$firephp -> log ( $tabInfo , 'tabInfo' );
?>
< br />< br />
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td >
Secteur d 'activit<69> : <?php print $tabInfo[' entrep '][' nafEn ' ]; ?> - <b>Conseil pour les affaires et la gestion</b>
</ td >
</ tr >
</ table >
2009-03-25 09:37:17 +00:00
< table id = " ratios " >
< tbody >
< tr class = " subhead " >
< td class = " center italique " > EQUILIBRE FINANCIER </ td >
< td > Entreprise </ td >
< td > Secteur </ td >
< td > Position </ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r235 " > FR ( FONDS DE ROULEMENT ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r231' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r235' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r236 " > BFR ( Besoin en fonds de roulement ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r232' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r236' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r233 " > MARGE BRUTE D 'AUTOFINANCEMENT (MBA) ou CAF<div class="tooltip"><?=$ratiosInfos[' r233 '][' commentaires ' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r233' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r234 " > COUVERTURE du BFR ( FR / BFR ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r234' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r234' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r237 " > COUVERTURE des IMMOS NETTES < br /> capitaux permanents / immobilisations nettes < div class = " tooltip " >< ? = $ratiosInfos [ 'r237' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r237' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r238 " > COUVERTURE du CA < br /> fond de roulement net global sur 12 m x 360 / chiffre d 'affaire<div class="tooltip"><?=$ratiosInfos[' r238 '][' commentaires ' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r238' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r239 " > SOLVABILITE capitaux propres / ensemble des dettes < div class = " tooltip " >< ? = $ratiosInfos [ 'r239' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r239' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r240 " > INDEPENDANCE FINANCIERE ( Cap . propres / Capitaux permanents ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r240' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r240' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr class = " subhead " >
< td class = " center italique " > PROFITABILITE </ td >
< td > Entreprise </ td >
< td > Secteur </ td >
< td > Position </ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r262 " > RENTABILITE ECONOMIQUE ( EBE / TOTAL bilan ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r262' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r262' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r263 " > RENTABILITE FINANCIERE ( R<EFBFBD> sult . Net / Cap . propres ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r263' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r263' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r264 " > RENTABILITE COMMERCIALE ( r<EFBFBD> sultat net / CA ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r264' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r264' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r265 " > CONTRIBUTION DU CAPITAL < br /> Capacit<EFBFBD> d 'autofinancement sur 12 mois / capitaux permanents<div class="tooltip"><?=$ratiosInfos[' r265 '][' commentaires ' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r265' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r266 " > CONTRIBUTION DE LA VA < br /> capacit<EFBFBD> d 'autofinancement / valeur ajout<75> e<div class="tooltip"><?=$ratiosInfos[' r266 '][' commentaires ' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r266' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr class = " subhead " >
< td class = " center italique " > LIQUIDITE </ td >
< td > Entreprise </ td >
< td > Secteur </ td >
< td > Position </ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r250 " > LIQUIDITE IMMEDIATE : ( Disponibilit<EFBFBD> / Dettes CT ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r250' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r250' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r251 " > LIQUIDITE GENERALE : ( Act . circulant net / Dettes CT ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r251' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r251' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r252 " > LIQUIDITE REDUITE : Disponibilit<EFBFBD> et cr<EFBFBD> ances r<EFBFBD> elles / Dettes CT ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r252' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r252' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr class = " subhead " >
< td class = " center italique " > ENDETTEMENT </ td >
< td > Entreprise </ td >
< td > Secteur </ td >
< td > Position </ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r244 " > ENDETTEMENT ( dettes a + 1 an / capitaux propres ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r244' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r244' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r247 " > CAPACITE DE REMBOURSEMENT ( Dettes . bancaires . ( + MT + LT + C . bail ) / CAF ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r247' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r247' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r248 " > FINANCEMENT DES STOCKS ( dettes aux fournisseurs / stock ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r248' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r248' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr class = " subhead " >
< td class = " center italique " > PRODUCTIVITE </ td >
< td > Entreprise </ td >
< td > Secteur </ td >
< td > Position </ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r271 " > PRODUCTIVITE DE l 'ACTIF<br/>chiffre d' affaire / actif comptable < div class = " tooltip " >< ? = $ratiosInfos [ 'r271' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r271' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r278 " > DUREE CLIENT ( Rotation clients en VJ TTC ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r278' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r278' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r279 " > DUREE FOURNISSEUR ( Rotation fournisseurs en JA TTC ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r279' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r279' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r281 " > POIDS MASSE SALARIALE ( Ch personnel / VA ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r281' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r281' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
< tr >
2009-04-03 09:30:51 +00:00
< td >< a id = " r261 " > RENDEMENT ( Production sur 12 mois / effectif ) < div class = " tooltip " >< ? = $ratiosInfos [ 'r261' ][ 'commentaires' ] ?> </div></a></td>
< td class = " right " >< ? php dRatio ( 0 , 'r261' ); ?> </td>
< td class = " right " ></ td >
2009-03-25 09:37:17 +00:00
< td ></ td >
</ tr >
</ tbody >
</ table > <EFBFBD>
2009-04-03 09:30:51 +00:00
< ? php
}
?>
2009-03-25 09:37:17 +00:00
</ div >