2009-07-15 13:11:03 +00:00
|
|
|
<?php
|
2010-04-27 08:09:23 +00:00
|
|
|
if (!page_checkParams()) die('Paramètres incorrects !');
|
2010-04-27 07:20:30 +00:00
|
|
|
|
2009-10-02 09:14:22 +00:00
|
|
|
$mil = false;
|
2009-02-17 13:14:53 +00:00
|
|
|
|
2009-05-20 15:49:08 +00:00
|
|
|
require_once 'partenaires/classMTva.php';
|
|
|
|
require_once 'partenaires/classMMap.php';
|
|
|
|
require_once 'common/dates.php';
|
2009-08-27 07:28:00 +00:00
|
|
|
require_once 'cache/cache.php';
|
2009-10-02 09:14:22 +00:00
|
|
|
require_once 'liasse/liasse.php';
|
2009-05-28 16:31:14 +00:00
|
|
|
|
2009-10-13 16:36:27 +00:00
|
|
|
if (($siret*1)==0 || ($siren*1)<100){ $fileName = $page.'-'.$idEntreprise;
|
|
|
|
}else{ $fileName = $page.'-'.$siret; }
|
2009-05-28 16:31:14 +00:00
|
|
|
|
|
|
|
if(isset($_REQUEST['mil'])){
|
|
|
|
$mil = explode(',',$_REQUEST['mil']);
|
|
|
|
$annee = substr($mil[0],-10);
|
|
|
|
$annee = str_replace('/', '', $annee);
|
2009-10-02 09:14:22 +00:00
|
|
|
$indice = str_replace('/', '', substr($mil[0], 0, 11));
|
|
|
|
$fileName.= '-'.$indice;
|
2009-02-17 13:14:53 +00:00
|
|
|
}
|
2009-10-02 14:39:29 +00:00
|
|
|
|
2010-02-17 14:44:28 +00:00
|
|
|
isset($_REQUEST['unit']) ? $unite = $_REQUEST['unit'] : $unite = '';
|
|
|
|
|
2010-02-10 17:27:03 +00:00
|
|
|
$typBil = array('C'=>'Consolidé', 'N'=>'', 'S'=>'Réel Simplifié', 'B'=> 'Banque', 'A'=>'Assurance');
|
2009-10-02 14:39:29 +00:00
|
|
|
|
2009-08-27 07:28:00 +00:00
|
|
|
cache_filename($fileName);
|
2009-12-10 09:54:47 +00:00
|
|
|
if( cache_exist() && !( preg_match('/\bsaisie\b/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) )
|
2009-08-27 07:28:00 +00:00
|
|
|
{
|
2009-10-02 09:14:22 +00:00
|
|
|
$tabBilans = cache_get('tabBilans');
|
|
|
|
$tabBilan = cache_get('tabBilan');
|
2009-05-28 16:31:14 +00:00
|
|
|
}else{
|
|
|
|
try {
|
|
|
|
$O = $client->getListeBilans($siren);
|
2009-08-27 07:28:00 +00:00
|
|
|
$tabBilans = $O['result'];
|
2009-10-13 16:36:27 +00:00
|
|
|
//Tri du tableau
|
2010-02-11 16:01:21 +00:00
|
|
|
if(count($tabBilans)>0)
|
2009-10-13 16:36:27 +00:00
|
|
|
{
|
2010-02-11 16:01:21 +00:00
|
|
|
foreach($tabBilans as $key => $bilan)
|
|
|
|
{
|
|
|
|
$cle[$key] = $key[0].substr($key, -4);
|
|
|
|
$dateProvPartenaire[$key] = $bilan['dateProvPartenaire'];
|
|
|
|
$dateInsert[$key] = $bilan['dateInsert'];
|
|
|
|
$dureeExercice[$key] = $bilan['dureeExercice'];
|
|
|
|
$dateExercicePre[$key] = $bilan['dateExercicePre'];
|
|
|
|
$monnaie[$key] = $bilan['monnaie'];
|
|
|
|
$source[$key] = $bilan['source'];
|
|
|
|
}
|
|
|
|
array_multisort($cle, SORT_DESC, $tabBilans);
|
2009-10-13 16:36:27 +00:00
|
|
|
}
|
|
|
|
cache_delete();
|
2009-08-27 07:28:00 +00:00
|
|
|
cache_add('tabBilans', $tabBilans);
|
2010-03-18 14:57:23 +00:00
|
|
|
if (isset($_REQUEST['mil']))
|
2009-10-13 16:36:27 +00:00
|
|
|
{
|
2009-10-13 16:59:04 +00:00
|
|
|
$O = $client->getBilan($siren, substr($mil[0],-10), substr($mil[0],0,1), $mil[1]);
|
2009-08-27 07:28:00 +00:00
|
|
|
$tabBilan = $O['result'];
|
|
|
|
cache_add('tabBilan',$tabBilan);
|
2009-05-28 16:31:14 +00:00
|
|
|
}
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
require_once 'soaperror.php';
|
2009-08-27 07:28:00 +00:00
|
|
|
processSoapFault($client,$fault,$_SESSION['tabInfo']);
|
2009-05-28 16:31:14 +00:00
|
|
|
die();
|
|
|
|
}
|
2009-08-27 07:28:00 +00:00
|
|
|
}
|
|
|
|
?>
|
2010-02-17 14:44:28 +00:00
|
|
|
<style type="text/css">
|
|
|
|
.tabLiasse { font-size:1em;}
|
|
|
|
</style>
|
2009-12-04 17:17:09 +00:00
|
|
|
<div id="center">
|
2009-08-27 07:28:00 +00:00
|
|
|
<h1 class="titre">ÉLÉMENTS FINANCIERS - BILANS</h1>
|
2010-02-17 14:44:28 +00:00
|
|
|
<form action="./" method="get">
|
2009-08-27 07:28:00 +00:00
|
|
|
<table>
|
2009-06-01 08:27:39 +00:00
|
|
|
<tr>
|
|
|
|
<td width="30"> </td>
|
|
|
|
<td width="200" class="StyleInfoLib">Numé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"> </td>
|
|
|
|
<td width="200" class="StyleInfoLib">Raison Sociale</td>
|
2010-03-18 14:57:23 +00:00
|
|
|
<td width="350" class="StyleInfoData"><?=$raisonSociale?></td>
|
2009-06-01 08:27:39 +00:00
|
|
|
</tr>
|
2010-02-17 14:44:28 +00:00
|
|
|
|
2010-03-18 14:57:23 +00:00
|
|
|
<?php
|
|
|
|
if (count($tabBilans)>0)
|
2010-02-17 14:44:28 +00:00
|
|
|
{
|
|
|
|
$tabUnit = array(
|
|
|
|
0 => array('lib'=>'€', 'val'=>''),
|
|
|
|
1 => array('lib'=>'K€', 'val'=>'K'),
|
|
|
|
2 => array('lib'=>'M€', 'val'=>'M'),
|
|
|
|
)
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td width="30"> </td>
|
|
|
|
<td width="200" class="StyleInfoLib">Valeurs exprimées en</td>
|
|
|
|
<td width="350" class="StyleInfoData">
|
|
|
|
<select name="unit">
|
2010-03-18 14:57:23 +00:00
|
|
|
<?php
|
2010-02-17 14:44:28 +00:00
|
|
|
foreach($tabUnit as $unit)
|
|
|
|
{
|
|
|
|
$select = '';
|
|
|
|
if($unite == $unit['val']) $select = ' selected';
|
2010-03-18 14:57:23 +00:00
|
|
|
?><option value="<?=$unit['val']?>"<?=$select?>><?=$unit['lib']?></option><?php
|
2010-02-17 14:44:28 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2010-03-18 14:57:23 +00:00
|
|
|
<?php
|
2010-02-17 14:44:28 +00:00
|
|
|
}
|
|
|
|
?>
|
2009-06-01 08:27:39 +00:00
|
|
|
<tr>
|
|
|
|
<td width="30"> </td>
|
|
|
|
<td width="200" class="StyleInfoLib">Millesime</td>
|
2009-07-15 13:11:03 +00:00
|
|
|
<td width="350" class="StyleInfoData">
|
|
|
|
<?
|
2010-03-18 14:57:23 +00:00
|
|
|
if (count($tabBilans)>0)
|
|
|
|
{
|
2009-10-02 09:14:22 +00:00
|
|
|
?>
|
2009-07-15 13:11:03 +00:00
|
|
|
<input type="hidden" name="page" value="liasse"/>
|
|
|
|
<input type="hidden" name="siret" value="<?=$siren?>"/>
|
|
|
|
<select name="mil">
|
2010-03-18 14:57:23 +00:00
|
|
|
<?php
|
2009-10-02 14:39:29 +00:00
|
|
|
//Tri de l'affichage des bilans en fonction de leurs types
|
|
|
|
foreach($typBil as $keyType => $type)
|
2009-10-02 09:14:22 +00:00
|
|
|
{
|
2009-10-09 14:27:01 +00:00
|
|
|
$numBil=0;
|
2010-03-18 14:57:23 +00:00
|
|
|
foreach ($tabBilans as $millesime => $bilan)
|
2009-10-02 14:39:29 +00:00
|
|
|
{
|
2009-10-09 14:27:01 +00:00
|
|
|
if($numBil>=5){ break; }
|
2009-10-02 14:39:29 +00:00
|
|
|
if( $millesime[0] == $keyType )
|
|
|
|
{
|
2009-10-13 16:36:27 +00:00
|
|
|
echo '<option value="'.$millesime.','.$bilan['ref'].'"';
|
|
|
|
if ($mil[0]==$millesime) echo ' selected';
|
2009-10-02 14:39:29 +00:00
|
|
|
$str=' '. $typBil[substr($millesime,0,1)];
|
2010-03-18 14:57:23 +00:00
|
|
|
echo '>'. substr($millesime,-10) . $str .'</option>';
|
2009-10-02 14:39:29 +00:00
|
|
|
$numBil++;
|
|
|
|
}
|
|
|
|
}
|
2010-03-18 14:57:23 +00:00
|
|
|
}
|
2009-10-02 09:14:22 +00:00
|
|
|
?>
|
2010-02-17 14:44:28 +00:00
|
|
|
</select>
|
|
|
|
<input type="submit" value="Ok"/>
|
2009-06-01 08:27:39 +00:00
|
|
|
<?php
|
2009-07-15 13:11:03 +00:00
|
|
|
} else {
|
|
|
|
?>
|
2009-06-01 08:27:39 +00:00
|
|
|
<b>Aucun bilan disponible pour cette entreprise !</b>
|
2009-07-15 13:11:03 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2009-06-01 08:27:39 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2009-10-02 09:14:22 +00:00
|
|
|
</table>
|
2010-02-17 14:44:28 +00:00
|
|
|
</form>
|
2009-05-28 16:31:14 +00:00
|
|
|
|
2010-02-17 14:44:28 +00:00
|
|
|
<div class="blockh2">
|
2009-10-02 09:14:22 +00:00
|
|
|
<?php
|
2010-02-10 17:27:03 +00:00
|
|
|
/** Si un bilan est sélectionné dans la liste, on affiche le bilan **/
|
2010-04-09 14:55:22 +00:00
|
|
|
if(isset($_REQUEST['mil']) == true) {
|
|
|
|
$mil = $_REQUEST['mil'];
|
|
|
|
if ($mil[0] == 'A') {
|
|
|
|
include 'liasse/bilan_assurance.php';
|
|
|
|
} else if ($mil[0] == 'B') {
|
|
|
|
include 'liasse/bilan_banque.php';
|
|
|
|
} else {
|
|
|
|
include 'liasse/bilan_normal.php';
|
|
|
|
} // Fin test bilan banque ou assurance et autres
|
|
|
|
|
|
|
|
// Export
|
|
|
|
require_once 'export.php';
|
|
|
|
if (isset($siret) == true) {
|
|
|
|
$fileName = $page.'-'.$siret;
|
|
|
|
} else {
|
|
|
|
$fileName = $page.'-'.$idEntreprise;
|
|
|
|
}
|
|
|
|
|
|
|
|
$parseTab = new tabExport;
|
|
|
|
$parseTab->tab = array($tabBilans);
|
|
|
|
$parseTab->type = array();
|
|
|
|
|
|
|
|
$array2csv = new ExportCSV;
|
|
|
|
$array2csv->records = $parseTab->convertTable();
|
|
|
|
$array2csv->writeCSV($fileName);
|
|
|
|
|
|
|
|
$array2xml = new ExportXML;
|
|
|
|
$array2xml->rootName = $page.'s';
|
|
|
|
$array2xml->defaultTagName = $page;
|
|
|
|
$array2xml->records = $tabBilans;
|
|
|
|
$array2xml->writeXML($fileName);
|
|
|
|
} // Fin if "pas de bilan choisit"
|
2010-02-17 14:44:28 +00:00
|
|
|
?>
|
|
|
|
</div>
|
2009-10-02 09:14:22 +00:00
|
|
|
<table>
|
2009-05-20 15:49:08 +00:00
|
|
|
<tr>
|
|
|
|
<td width="30"> </td>
|
2009-05-22 12:26:07 +00:00
|
|
|
<td colspan="2" width="550" class="StyleInfoData">
|
2009-07-15 13:11:03 +00:00
|
|
|
<?php
|
2009-05-20 15:49:08 +00:00
|
|
|
require_once 'surveillance/surveillance.php';
|
2009-12-15 17:14:21 +00:00
|
|
|
echo getSurveillance('bilans', $siret);
|
2009-05-20 15:49:08 +00:00
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2009-05-28 16:31:14 +00:00
|
|
|
</table>
|
2010-04-09 14:55:22 +00:00
|
|
|
|
2010-04-12 14:49:55 +00:00
|
|
|
<p class="confidentiel blockh2">
|
2010-04-09 14:55:22 +00:00
|
|
|
<?php
|
2010-04-12 14:49:55 +00:00
|
|
|
require_once 'cgu/cgu.php';
|
|
|
|
echo afficheCgu();
|
2010-04-09 14:55:22 +00:00
|
|
|
?>
|
2010-04-12 14:49:55 +00:00
|
|
|
</p>
|
2010-04-09 14:55:22 +00:00
|
|
|
|
2009-08-27 07:28:00 +00:00
|
|
|
</div>
|