688 lines
28 KiB
PHP
688 lines
28 KiB
PHP
<?php
|
|
|
|
function block_bilans($wsresult)
|
|
{
|
|
global $firephp, $ratiosEntrep, $siren;
|
|
$fileName = $siren;
|
|
|
|
$bilansInfos = $wsresult['bilansInfos'];
|
|
$ratiosInfos = $wsresult['ratiosInfos'];
|
|
$ratiosEntrep = $wsresult['ratiosEntrep'];
|
|
$ratiosEntrepEvol = $wsresult['ratiosEntrepEvol'];
|
|
$dataActif = $wsresult['dataActif'];
|
|
$dataPassif = $wsresult['dataPassif'];
|
|
$dataSIG = $wsresult['dataSIG'];
|
|
|
|
$page = array();
|
|
$page['titre'] = 'ÉLÉMENTS FINANCIERS - BILANS';
|
|
$page['blocks'] = array();
|
|
|
|
if (count($ratiosEntrep)==0 || !isset($ratiosEntrep))
|
|
{
|
|
$i=0;
|
|
$page['blocks'][$i]['titre'] = '';
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'<b>Aucun bilan disponible pour cette entreprise !</b>' );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
}
|
|
else
|
|
{
|
|
$i=0;
|
|
$page['blocks'][$i]['titre'] = 'Bilan actif - passif';
|
|
|
|
$i++;
|
|
$page['blocks'][$i]['table'] = array();
|
|
$page['blocks'][$i]['table']['class'] = 'bilans';
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'ACTIF' );
|
|
$nb_bilans = 5;
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
if(isset($bilansInfos[$nb_bilans-$cptBilan]['dateCloture']))
|
|
{
|
|
$lignes[] = array( 'class'=>'date', 'content'=>substr($bilansInfos[$nb_bilans-$cptBilan]['dateCloture'],6,2).'/'.substr($bilansInfos[$nb_bilans-$cptBilan]['dateCloture'],4,2).'/'.substr($bilansInfos[$nb_bilans-$cptBilan]['dateCloture'],0,4).'<br/>'.$bilansInfos[$nb_bilans-$cptBilan]['duree'].'mois' );
|
|
}else{
|
|
$lignes[] = array( 'class'=>'date', 'content'=>'-' );
|
|
}
|
|
}
|
|
$lignes[] = array( 'content'=>'% T.B.' );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'thead'=>true, 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Actif Immobilisé Net' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r59') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r59','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Incorporelles' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r51') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r51','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Corporelles' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r52') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r52','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Financières' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r53') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r53','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Actif Circulant Net' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r69') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r69','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Stock et encours' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r60') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r60','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Créances Clients' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r61') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r61','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Autres Créances' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r62') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r62','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'content'=>'' );
|
|
}
|
|
$lignes[] = array( 'content'=>'' );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Trésorerie Active' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r63') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r62','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'TOTAL ACTIF' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r22') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r22','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
//TODO : nom de fichier pour le graphique
|
|
$lignes = array();
|
|
$lignes[] = array( 'class'=>'graph', 'colspan'=>'7', 'content'=>bilans_graph_actif($dataActif, $fileName) );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$i++;
|
|
$page['blocks'][$i]['table'] = array();
|
|
$page['blocks'][$i]['table']['class'] = 'bilans';
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'PASSIF' );
|
|
$nb_bilans = 5;
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
if(isset($bilansInfos[$nb_bilans-$cptBilan]['dateCloture']))
|
|
{
|
|
$lignes[] = array( 'class'=>'date', 'content'=>substr($bilansInfos[$nb_bilans-$cptBilan]['dateCloture'],6,2).'/'.substr($bilansInfos[$nb_bilans-$cptBilan]['dateCloture'],4,2).'/'.substr($bilansInfos[$nb_bilans-$cptBilan]['dateCloture'],0,4).'<br/>'.$bilansInfos[$nb_bilans-$cptBilan]['duree'].'mois' );
|
|
}else{
|
|
$lignes[] = array( 'class'=>'date', 'content'=>'-' );
|
|
}
|
|
}
|
|
$lignes[] = array( 'content'=>'% T.B.' );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'thead'=>true, 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Ressources Propres' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r79') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r79','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Fonds Propres' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r70') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r70','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Provisions Risques' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r71') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r71','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Comptes Courants' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r72') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r72','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Ressources Externes' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r90') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r90','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Dettes Financières' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r83') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r83','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Dettes Fournisseurs' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r84') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r84','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Dettes Fiscales' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r85') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r85','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Autres Dettes' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r86') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r86','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'Trésorerie Passive' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r87') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r87','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'TOTAL PASSIF' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r22') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r22','r22') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'class'=>'graph', 'colspan'=>'7', 'content'=>bilans_graph_passif($dataPassif, $fileName) );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$i++;
|
|
$page['blocks'][$i]['titre'] = 'Soldes Intermédiare de Gestion';
|
|
|
|
$i++;
|
|
$page['blocks'][$i]['table'] = array();
|
|
$page['blocks'][$i]['table']['class'] = 'bilans';
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'content'=>'SOLDES INTERMEDIAIRES DE GESTION' );
|
|
$nb_bilans = 5;
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
if(isset($bilansInfos[$nb_bilans-$cptBilan]['dateCloture']))
|
|
{
|
|
$lignes[] = array( 'class'=>'date', 'content'=>substr($bilansInfos[$nb_bilans-$cptBilan]['dateCloture'],6,2).'/'.substr($bilansInfos[$nb_bilans-$cptBilan]['dateCloture'],4,2).'/'.substr($bilansInfos[$nb_bilans-$cptBilan]['dateCloture'],0,4).'<br/>'.$bilansInfos[$nb_bilans-$cptBilan]['duree'].'mois' );
|
|
}else{
|
|
$lignes[] = array( 'class'=>'date', 'content'=>'-' );
|
|
}
|
|
}
|
|
$lignes[] = array( 'content'=>'% C.A' );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'thead'=>true, 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'class'=>'center', 'content'=>'CHIFFRE D\'AFFAIRES HORS TAXE' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r101') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r101','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'-' );
|
|
$lignes[] = array( 'content'=>'Achat de marchandises, de matières premières' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r102') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r102','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'class'=>'center', 'content'=>'MARGE COMMERCIALE' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r110') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r110','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'Production vendue' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r111') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r111','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'Production immobilisée et stockée' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r112') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r112','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'class'=>'center', 'content'=>'PRODUCTION DE L\'EXERCICE' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r120') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r120','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'±' );
|
|
$lignes[] = array( 'content'=>'Variation de stock de marchandises et matières premières' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r121') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r121','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'class'=>'center', 'content'=>'MARGE BRUTE' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r122') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r122','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'-' );
|
|
$lignes[] = array( 'content'=>'Autres charges externes' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r123') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r123','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'class'=>'center', 'content'=>'VALEUR AJOUTÉE' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r130') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r130','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'-' );
|
|
$lignes[] = array( 'content'=>'Charges de personnel' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r132') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r132','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'-' );
|
|
$lignes[] = array( 'content'=>'Impôts, taxes & versements assimilés' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r133') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r133','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'Subventions d\'exploitation' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r131') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r131','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'class'=>'center', 'content'=>'EXCÉDENT BRUT D\'EXPLOITATION (EBE)' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r140') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r140','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'Autres produits d\'exploitation' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r141') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r141','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'-' );
|
|
$lignes[] = array( 'content'=>'Autres charges d\'exploitation' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r142') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r142','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'Reprise sur dotations & transferts de charges' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r143') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r143','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'70% Loyer de crédit bail' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r144') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r144','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'-' );
|
|
$lignes[] = array( 'content'=>'Dotations d\'exploitation & provisions d\'exploitation' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r145') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r145','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'class'=>'center', 'content'=>'RÉSULTAT D\'EXPLOITATION' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r150') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r150','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'Produits financiers' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r151') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r151','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'30% Loyer de crédit bail' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r152') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r152','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'Charges financières' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r153') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r153','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'class'=>'center', 'content'=>'RÉSULTAT COURANT AVANT IMPOTS' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r170') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r170','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'+' );
|
|
$lignes[] = array( 'content'=>'Produits exceptionnels' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r171') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r171','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'-' );
|
|
$lignes[] = array( 'content'=>'Charges exceptionnelles' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r172') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r172','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'-' );
|
|
$lignes[] = array( 'content'=>'Impôts sur les bénéfices' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r181') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r181','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'content'=>'-' );
|
|
$lignes[] = array( 'content'=>'Participation salariale' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r182') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r182','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'colspan'=>'2', 'class'=>'center', 'content'=>'RÉSULTAT NET' );
|
|
for($cptBilan=1; $cptBilan<=$nb_bilans; $cptBilan++)
|
|
{
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dRatio($nb_bilans-$cptBilan,'r199') );
|
|
}
|
|
$lignes[] = array( 'class'=>'right', 'content'=>dPercent(0,'r199','r101') );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'class'=>'subhead', 'content'=>$lignes );
|
|
|
|
$lignes = array();
|
|
$lignes[] = array( 'class'=>'graph', 'colspan'=>'8', 'content'=>bilans_graph_sig($dataSIG, $fileName) );
|
|
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
|
}
|
|
|
|
return $page;
|
|
}
|
|
|
|
|
|
function theme_bblocks($blocks)
|
|
{
|
|
global $firephp;
|
|
$html = '';
|
|
if(count($blocks)>0)
|
|
{
|
|
foreach( $blocks as $key => $element )
|
|
{
|
|
if( isset($element['titre']) && $element['titre']!='' )
|
|
{
|
|
$html.= theme_blocktitre($element['titre']);
|
|
}
|
|
elseif( isset($element['table']) )
|
|
{
|
|
$html.= theme_table($element['table']);
|
|
}
|
|
//TODO : Optimiser les options pour le div
|
|
elseif( isset($element['div']) )
|
|
{
|
|
$html.= theme_div($element['div']['content']);
|
|
}
|
|
}
|
|
}
|
|
return $html;
|
|
}
|
|
|
|
function theme_blocktitre($content)
|
|
{
|
|
return '<h2>'.$content.'</h2>';
|
|
}
|
|
|
|
function theme_table($table)
|
|
{
|
|
$html = '<table';
|
|
if(isset($table['id']) && $table['id']!=''){ $html.= ' id="'.$table['id'].'"'; }
|
|
if(isset($table['titre']) && $table['titre']!=''){ $html.= ' title="'.$table['titre'].'"'; }
|
|
if(isset($table['class']) && $table['class']!=''){ $html.= ' class="'.$table['class'].'"'; }
|
|
$html.= '>';
|
|
$tbody = 0;
|
|
foreach($table['row'] as $row)
|
|
{
|
|
//TODO: initialiser les variables
|
|
if(isset($row['thead']))
|
|
{
|
|
$html.= '<thead>'."\n";
|
|
$html.= theme_tablehead($row)."\n";
|
|
$html.= '</thead>'."\n";
|
|
}
|
|
else
|
|
{
|
|
if( $tbody == 0 ) { $html.= '<tbody>'."\n"; }
|
|
$html.= theme_tablerow($row);
|
|
$tbody++;
|
|
if($tbody==count($table['row'])){ $html.= '</tbody>'."\n"; }
|
|
}
|
|
}
|
|
$html.= '</table>';
|
|
return $html;
|
|
}
|
|
|
|
function theme_tablehead($row)
|
|
{
|
|
$html.= '<tr';
|
|
if(isset($row['id']) && $row['id']!=''){ $html.= ' id="'.$row['id'].'"'; }
|
|
if(isset($row['titre']) && $row['titre']!=''){ $html.= ' title="'.$row['titre'].'"'; }
|
|
if(isset($row['class']) && $row['class']!=''){ $html.= ' class="'.$row['class'].'"'; }
|
|
$html.= '>'."\n";
|
|
foreach($row['content'] as $item)
|
|
{
|
|
$html.= '<th';
|
|
if(isset($item['id']) && $item['id']!=''){ $html.= ' id="'.$item['id'].'"'; }
|
|
if(isset($item['titre']) && $item['titre']!=''){ $html.= ' title="'.$item['titre'].'"'; }
|
|
if(isset($item['class']) && $item['class']!=''){ $html.= ' class="'.$item['class'].'"'; }
|
|
if(isset($item['colspan']) && $item['colspan']!=''){ $html.= ' colspan="'.$item['colspan'].'"'; }
|
|
if(isset($item['width']) && $item['width']!=''){ $html.= ' width="'.$item['width'].'"'; }
|
|
$html.= '>'.$item['content'].'</th>'."\n";
|
|
}
|
|
$html.= '</tr>'."\n";
|
|
return $html;
|
|
}
|
|
|
|
function theme_tablerow($row)
|
|
{
|
|
$html.= '<tr';
|
|
if(isset($row['id']) && $row['id']!=''){ $html.= ' id="'.$row['id'].'"'; }
|
|
if(isset($row['titre']) && $row['titre']!=''){ $html.= ' title="'.$row['titre'].'"'; }
|
|
if(isset($row['class']) && $row['class']!=''){ $html.= ' class="'.$row['class'].'"'; }
|
|
if(isset($row['width']) && $row['width']!=''){ $html.= ' width="'.$row['width'].'"'; }
|
|
$html.= '>'."\n";
|
|
foreach($row['content'] as $item)
|
|
{
|
|
$html.= '<td';
|
|
if(isset($item['id']) && $item['id']!=''){ $html.= ' id="'.$item['id'].'"'; }
|
|
if(isset($item['titre']) && $item['titre']!=''){ $html.= ' title="'.$item['titre'].'"'; }
|
|
if(isset($item['class']) && $item['class']!=''){ $html.= ' class="'.$item['class'].'"'; }
|
|
if(isset($item['colspan']) && $item['colspan']!=''){ $html.= ' colspan="'.$item['colspan'].'"'; }
|
|
$html.= '>'.$item['content'].'</td>'."\n";
|
|
}
|
|
$html.= '</tr>'."\n";
|
|
return $html;
|
|
}
|