2009-04-21 07:40:48 +00:00
|
|
|
|
<?php
|
2010-05-21 12:47:17 +00:00
|
|
|
|
define('NB_BILANS', 5);
|
2009-04-21 07:40:48 +00:00
|
|
|
|
|
2010-05-21 12:47:17 +00:00
|
|
|
|
$actif = array(59 => 'Actif Immobilisé Net',
|
|
|
|
|
51 => 'Incorporelles',
|
|
|
|
|
52 => 'Corporelles',
|
|
|
|
|
53 => 'Financières',
|
|
|
|
|
69 => 'Actif Circulant Net',
|
|
|
|
|
60 => 'Stock et encours',
|
|
|
|
|
61 => 'Créances Clients',
|
|
|
|
|
62 => 'Autres Créances',
|
|
|
|
|
00 => '',
|
|
|
|
|
63 => 'Trésorerie Active',
|
|
|
|
|
22 => 'TOTAL ACTIF');
|
2010-03-18 14:57:23 +00:00
|
|
|
|
|
2010-05-21 12:47:17 +00:00
|
|
|
|
$passif = array(79 => 'Ressources Propres',
|
|
|
|
|
70 => 'Fonds Propres',
|
|
|
|
|
71 => 'Provisions Risques',
|
|
|
|
|
72 => 'Comptes Courants',
|
|
|
|
|
90 => 'Ressources Externes',
|
|
|
|
|
83 => 'Dettes Financières',
|
|
|
|
|
84 => 'Dettes Fournisseurs',
|
|
|
|
|
85 => 'Dettes Fiscales',
|
|
|
|
|
86 => 'Autres Dettes',
|
|
|
|
|
87 => 'Trésorerie Passive',
|
|
|
|
|
22 => 'TOTAL PASSIF');
|
|
|
|
|
|
|
|
|
|
$sig = array(101 => 'CHIFFRE D\'AFFAIRES HORS TAXE',
|
|
|
|
|
102 => '-Achat de marchandises, de matières premières',
|
|
|
|
|
110 => 'MARGE COMMERCIALE',
|
|
|
|
|
111 => '+Production vendue',
|
|
|
|
|
112 => '+Production immobilisée et stockée',
|
|
|
|
|
120 => 'PRODUCTION DE L\'EXERCICE',
|
|
|
|
|
121 =>'Variation de stock de marchandises et matières premières',
|
|
|
|
|
122 => 'MARGE BRUTE',
|
|
|
|
|
123 => '-Autres charges externes',
|
|
|
|
|
130 => 'VALEUR AJOUTÉE',
|
|
|
|
|
132 => '-Charges de personnel',
|
|
|
|
|
133 => '-Impôts, taxes & versements assimilés',
|
|
|
|
|
131 => '+Subventions d\'exploitation',
|
|
|
|
|
140 => 'EXCÉDENT BRUT D\'EXPLOITATION (EBE)',
|
|
|
|
|
141 => '+Autres produits d\'exploitation',
|
|
|
|
|
142 => '-Autres charges d\'exploitation',
|
|
|
|
|
143 => '+Reprise sur dotations & transferts de charges',
|
|
|
|
|
144 => '+70% Loyer de crédit bail',
|
|
|
|
|
145 => '-Dotations d\'exploitation & provisions d\'exploitation',
|
|
|
|
|
150 => 'RÉSULTAT D\'EXPLOITATION',
|
|
|
|
|
151 => '+Produits financiers',
|
|
|
|
|
152 => '+30% Loyer de crédit bail',
|
|
|
|
|
153 => '+Charges financières',
|
|
|
|
|
170 => 'RÉSULTAT COURANT AVANT IMPOTS',
|
|
|
|
|
171 => '+Produits exceptionnels',
|
|
|
|
|
172 => '-Charges exceptionnelles',
|
|
|
|
|
181 => '-Impôts sur les bénéfices',
|
|
|
|
|
182 => '-Participation salariale',
|
|
|
|
|
199 => 'RÉSULTAT NET');
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
|
// afficheDates
|
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
|
function afficheDates(&$bilansInfos)
|
|
|
|
|
{
|
|
|
|
|
for ($i = 1; $i <= NB_BILANS; ++$i) {
|
|
|
|
|
print '<th class="date">';
|
|
|
|
|
if (isset($bilansInfos[NB_BILANS - $i]['dateCloture'])) {
|
|
|
|
|
print substr($bilansInfos[NB_BILANS - $i]['dateCloture'], 6, 2).'/'.
|
|
|
|
|
substr($bilansInfos[NB_BILANS - $i]['dateCloture'], 4, 2).'/'.
|
|
|
|
|
substr($bilansInfos[NB_BILANS - $i]['dateCloture'], 0, 4);
|
|
|
|
|
print '<br>';
|
|
|
|
|
print $bilansInfos[NB_BILANS - $i]['duree'];
|
|
|
|
|
print 'mois';
|
|
|
|
|
} else {
|
|
|
|
|
print '-';
|
|
|
|
|
}
|
|
|
|
|
print '</th>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
|
// afficheBilan
|
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
|
function afficheBilan(&$liste, $total)
|
|
|
|
|
{
|
|
|
|
|
foreach ($liste as $num => $label) {
|
|
|
|
|
if ($num == 00) {
|
|
|
|
|
print '<tr><td> </td>'.
|
|
|
|
|
'<td></td><td></td><td></td>'.
|
|
|
|
|
'<td></td><td></td><td></td></tr>';
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if ($num == 101 || $num == 110 || $num == 120 ||
|
|
|
|
|
$num == 122 || $num == 130 || $num == 140 ||
|
|
|
|
|
$num == 150 || $num == 170 || $num == 199) {
|
|
|
|
|
print '<tr class="subhead">';
|
|
|
|
|
print '<td class="center" colspan="2">';
|
|
|
|
|
} else if ($num > 100) {
|
|
|
|
|
print '<tr>';
|
|
|
|
|
$c = substr($label, 0, 1);
|
|
|
|
|
if ($c == '+' ||
|
|
|
|
|
$c == '-') {
|
|
|
|
|
print '<td>'.$c.'</td><td>';
|
|
|
|
|
$label = substr($label, 1);
|
|
|
|
|
} else {
|
|
|
|
|
print '<td>±</td><td>';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if ($num == 59 || $num == 69 || $num == 79 ||
|
|
|
|
|
$num == 90 || $num == 22) {
|
|
|
|
|
print '<tr class="subhead">';
|
|
|
|
|
} else {
|
|
|
|
|
print '<tr>';
|
|
|
|
|
}
|
|
|
|
|
print '<td>';
|
|
|
|
|
}
|
|
|
|
|
print $label.'</td>';
|
|
|
|
|
for ($i = 1; $i <= NB_BILANS; ++$i) {
|
|
|
|
|
print '<td class="right">'.dRatio(NB_BILANS - $i,'r'.$num).'</td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td class="right">'.dPercent(0,'r'.$num,'r'.$total).'</td>';
|
|
|
|
|
print '</tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
|
// ajouteExport
|
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
|
function ajouteExport(&$liste)
|
|
|
|
|
{
|
|
|
|
|
global $bilansInfos;
|
|
|
|
|
|
|
|
|
|
$export = array();
|
|
|
|
|
foreach ($liste as $num => $label) {
|
|
|
|
|
if ($num == 00) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$valeurs = array();
|
|
|
|
|
for ($i = 1; $i <= NB_BILANS; ++$i) {
|
|
|
|
|
if (isset($bilansInfos[NB_BILANS - $i]['dateCloture']) == false) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$date = $bilansInfos[NB_BILANS - $i]['dateCloture'];
|
|
|
|
|
$duree = $bilansInfos[NB_BILANS - $i]['duree'];
|
|
|
|
|
$valeur = dRatio(NB_BILANS - $i,'r'.$num);
|
|
|
|
|
$valeurs[] = array('date' => $date,
|
|
|
|
|
'duree' => $duree,
|
|
|
|
|
'valeur' => $valeur);
|
|
|
|
|
}
|
|
|
|
|
$c = substr($label, 0, 1);
|
|
|
|
|
if ($c == '+' ||
|
|
|
|
|
$c == '-') {
|
2010-05-24 09:03:22 +00:00
|
|
|
|
$export[] = array('label' => substr($label, 1),
|
2010-05-21 12:47:17 +00:00
|
|
|
|
'signe' => $c,
|
|
|
|
|
'valeurs' => $valeurs);
|
|
|
|
|
} else {
|
|
|
|
|
$export[] = array('label' => $label,
|
|
|
|
|
'valeurs' => $valeurs);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $export;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
|
// Main
|
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
|
if (page_checkParams() == false) {
|
|
|
|
|
die('Paramètres incorrects !');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['type']) == true) {
|
|
|
|
|
$typeBilan = $_REQUEST['type'];
|
|
|
|
|
} else {
|
|
|
|
|
$typeBilan = '';
|
|
|
|
|
}
|
2009-10-02 14:39:29 +00:00
|
|
|
|
|
2009-08-27 07:28:00 +00:00
|
|
|
|
require_once 'cache/cache.php';
|
|
|
|
|
require_once 'ratios/ratios.php';
|
2009-10-08 13:20:51 +00:00
|
|
|
|
require_once 'scoresws/scoresws.php';
|
2009-08-27 07:28:00 +00:00
|
|
|
|
|
2009-10-23 13:34:42 +00:00
|
|
|
|
$result = scoresws_ratios($siret, $siren, $idEntreprise);
|
2010-05-21 12:47:17 +00:00
|
|
|
|
$bilansInfos = $result['bilansInfos'];
|
|
|
|
|
$ratiosInfos = $result['ratiosInfos'];
|
|
|
|
|
$ratiosEntrep = $result['ratiosEntrep'];
|
2009-10-08 13:20:51 +00:00
|
|
|
|
$ratiosEntrepEvol = $result['ratiosEntrepEvol'];
|
2010-05-21 12:47:17 +00:00
|
|
|
|
$ratiosSecteur = $result['ratiosSecteur'];
|
|
|
|
|
$dataActif = $result['dataActif'];
|
|
|
|
|
$dataPassif = $result['dataPassif'];
|
|
|
|
|
$dataSIG = $result['dataSIG'];
|
2009-04-21 07:40:48 +00:00
|
|
|
|
|
2010-05-21 12:47:17 +00:00
|
|
|
|
if (($siret * 1) == 0 ||
|
|
|
|
|
($siren * 1) < 100) {
|
|
|
|
|
$fileName = $page.'-'.$idEntreprise;
|
|
|
|
|
} else {
|
|
|
|
|
$fileName = $page.'-'.$siren;
|
|
|
|
|
}
|
2009-10-02 14:39:29 +00:00
|
|
|
|
|
2009-10-12 13:31:05 +00:00
|
|
|
|
list($typeBilan, $numBilan) = countBilans($bilansInfos, $typeBilan);
|
|
|
|
|
$numBilanN = $numBilan['N'];
|
|
|
|
|
$numBilanC = $numBilan['C'];
|
2009-10-13 16:36:27 +00:00
|
|
|
|
$numBilanB = $numBilan['B'];
|
|
|
|
|
$numBilanA = $numBilan['A'];
|
2010-05-21 12:47:17 +00:00
|
|
|
|
list($bilansInfos, $ratiosEntrep, $ratiosEntrepEvol, $ratiosSecteur,
|
|
|
|
|
$dataActif, $dataPassif, $dataSIG) =
|
|
|
|
|
filtreTypeBilans($bilansInfos, $ratiosEntrep, $ratiosEntrepEvol,
|
|
|
|
|
$ratiosSecteur, $dataActif, $dataPassif, $dataSIG,
|
|
|
|
|
$typeBilan);
|
2009-08-27 07:28:00 +00:00
|
|
|
|
?>
|
2010-05-21 12:47:17 +00:00
|
|
|
|
|
2009-08-27 07:28:00 +00:00
|
|
|
|
<div id="center">
|
2009-09-10 15:31:37 +00:00
|
|
|
|
<h1>ÉLÉMENTS FINANCIERS - BILANS</h1>
|
2009-08-27 07:28:00 +00:00
|
|
|
|
<table>
|
2010-05-21 12:47:17 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib">Numéro identifiant Siren</td>
|
|
|
|
|
<td width="340" class="StyleInfoData">
|
|
|
|
|
<?php
|
|
|
|
|
print substr($siren, 0, 3).' '.
|
|
|
|
|
substr($siren, 3, 3).' '.
|
|
|
|
|
substr($siren, 6, 3);
|
|
|
|
|
?>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib">Raison Sociale</td>
|
|
|
|
|
<td width="340" class="StyleInfoData"><?php print $raisonSociale; ?></td>
|
|
|
|
|
</tr>
|
2010-03-18 14:57:23 +00:00
|
|
|
|
<?php
|
2010-05-21 12:47:17 +00:00
|
|
|
|
if ($numBilanN > 0 || $numBilanC > 0) {
|
|
|
|
|
print '<tr>';
|
|
|
|
|
print '<td width="30"> </td>';
|
|
|
|
|
print '<td width="200" class="StyleInfoLib">Type de bilans</td>';
|
|
|
|
|
print '<td width="340" class="StyleInfoData">';
|
|
|
|
|
if ($numBilanN > 0 && $numBilanC > 0) {
|
|
|
|
|
print '<input type="radio" name="typeBilan" value="index.php?page='.
|
|
|
|
|
$page.'&siret='.$siret.'&idEntreprise='.$idEntreprise.'&type=N"';
|
|
|
|
|
if ($typeBilan == 'N') {
|
|
|
|
|
print ' checked';
|
|
|
|
|
}
|
|
|
|
|
print '/><label>Réel normal ou Simplifié</label>';
|
|
|
|
|
print '<input type="radio" name="typeBilan" value="index.php?page='.
|
|
|
|
|
$page.'&siret='.$siret.'&idEntreprise='.$idEntreprise.'&type=C"';
|
|
|
|
|
if ($typeBilan == 'C') {
|
|
|
|
|
print ' checked';
|
|
|
|
|
}
|
|
|
|
|
print '/><label>Consolidé</label>';
|
|
|
|
|
} else if ($numBilanN > 0 && $numBilanC == 0) {
|
|
|
|
|
print 'Réel normal ou Simplifié';
|
|
|
|
|
} else if ($numBilanN == 0 && $numBilanC > 0) {
|
|
|
|
|
print 'Consolidé';
|
|
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '</tr>';
|
2009-10-09 14:27:01 +00:00
|
|
|
|
}
|
|
|
|
|
?>
|
2009-08-27 07:28:00 +00:00
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
<?php
|
2010-05-21 12:47:17 +00:00
|
|
|
|
if ($numBilanN == 0 && $numBilanC == 0 &&
|
|
|
|
|
$numBilanB == 0 && $numBilanA == 0) {
|
2009-08-27 07:28:00 +00:00
|
|
|
|
?>
|
|
|
|
|
<table>
|
2010-05-21 12:47:17 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td><b>Aucun bilan disponible pour cette entreprise !</b></td>
|
|
|
|
|
</tr>
|
2009-08-27 07:28:00 +00:00
|
|
|
|
</table>
|
|
|
|
|
<?php
|
2010-05-21 12:47:17 +00:00
|
|
|
|
} else if ($numBilanN == 0 && $numBilanC == 0 &&
|
|
|
|
|
($numBilanB > 0 || $numBilanA > 0)) {
|
2009-10-13 16:36:27 +00:00
|
|
|
|
?>
|
|
|
|
|
<table>
|
2010-05-21 12:47:17 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td><b>Bilan de banque/assurance non gérés</b></td>
|
|
|
|
|
</tr>
|
2009-10-13 16:36:27 +00:00
|
|
|
|
</table>
|
2010-03-18 14:57:23 +00:00
|
|
|
|
<?php
|
2010-05-21 12:47:17 +00:00
|
|
|
|
} else {
|
2009-08-27 07:28:00 +00:00
|
|
|
|
?>
|
2009-08-10 16:54:43 +00:00
|
|
|
|
|
2009-08-27 07:28:00 +00:00
|
|
|
|
<h2>Bilan actif - passif</h2>
|
2010-04-27 07:20:30 +00:00
|
|
|
|
<div class="blockh2">
|
2009-06-22 06:56:42 +00:00
|
|
|
|
|
2010-05-21 12:47:17 +00:00
|
|
|
|
<table class="bilans">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>ACTIF</th>
|
|
|
|
|
<?php afficheDates($bilansInfos); ?>
|
|
|
|
|
<th>% T.B.</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php afficheBilan($actif, 22); ?>
|
|
|
|
|
<tr><td colspan="7" class="graph">
|
|
|
|
|
<?php print bilans_graph_actif($dataActif[0], $fileName.$typeBilan); ?>
|
|
|
|
|
</td></tr>
|
|
|
|
|
</tbody>
|
2010-02-10 17:27:03 +00:00
|
|
|
|
</table>
|
2009-08-27 07:28:00 +00:00
|
|
|
|
<br/><br/>
|
2009-06-22 06:56:42 +00:00
|
|
|
|
|
2009-08-27 07:28:00 +00:00
|
|
|
|
<table class="bilans">
|
2010-05-21 12:47:17 +00:00
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>PASSIF</th>
|
|
|
|
|
<?php afficheDates($bilansInfos); ?>
|
|
|
|
|
<th>% T.B.</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php afficheBilan($passif, 22); ?>
|
|
|
|
|
<tr><td colspan="7" class="graph">
|
|
|
|
|
<?php print bilans_graph_passif($dataPassif[0], $fileName.$typeBilan); ?>
|
|
|
|
|
</td></tr>
|
|
|
|
|
</tbody>
|
2010-02-10 17:27:03 +00:00
|
|
|
|
</table>
|
2009-08-27 07:28:00 +00:00
|
|
|
|
<br/><br/>
|
2009-06-22 06:56:42 +00:00
|
|
|
|
|
2009-12-16 10:15:57 +00:00
|
|
|
|
<h2>Soldes Intermédiaire de Gestion</h2>
|
2009-06-22 06:56:42 +00:00
|
|
|
|
|
2009-08-27 07:28:00 +00:00
|
|
|
|
<table class="bilans">
|
2010-05-21 12:47:17 +00:00
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th colspan="2">SOLDES INTERMEDIAIRES DE GESTION</th>
|
|
|
|
|
<?php afficheDates($bilansInfos); ?>
|
|
|
|
|
<th>% C.A.</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php afficheBilan($sig, 101); ?>
|
|
|
|
|
<tr><td colspan="8" class="graph">
|
|
|
|
|
<?php print bilans_graph_sig($dataSIG[0], $fileName.$typeBilan); ?>
|
|
|
|
|
</td></tr>
|
|
|
|
|
</tbody>
|
2010-02-10 17:27:03 +00:00
|
|
|
|
</table>
|
2010-05-21 12:47:17 +00:00
|
|
|
|
|
2010-04-27 07:20:30 +00:00
|
|
|
|
</div>
|
2009-06-22 06:56:42 +00:00
|
|
|
|
<?php
|
2009-08-27 07:28:00 +00:00
|
|
|
|
}
|
2010-05-21 12:47:17 +00:00
|
|
|
|
|
2011-02-21 17:09:22 +00:00
|
|
|
|
require_once 'export/genexport.php';
|
2010-04-12 14:49:55 +00:00
|
|
|
|
require_once 'cgu/cgu.php';
|
2010-05-21 12:47:17 +00:00
|
|
|
|
print '<p class="confidentiel blockh2">'.afficheCgu();
|
2010-04-12 14:49:55 +00:00
|
|
|
|
?>
|
|
|
|
|
</p>
|
2010-04-09 14:55:22 +00:00
|
|
|
|
</div>
|