mises a jour annonces liasse par rapport au ws-2.0

This commit is contained in:
Sebastien BEAUGRAND 2011-02-09 11:16:07 +00:00
parent 46ac4aeff9
commit 5608237ffc
7 changed files with 26 additions and 24 deletions

View File

@ -5,7 +5,7 @@
function afficheListeAnnonces(&$annonces, $siret, $idEntreprise) function afficheListeAnnonces(&$annonces, $siret, $idEntreprise)
{ {
if (count($annonces) > 0) { if (count($annonces) > 0) {
$objAnnonces = new Annonces($annonces->liste->item); $objAnnonces = new Annonces($annonces->item);
$typeAnnonces = $typeAnnonces =
array('Bodacc' => 'EVÉNEMENTS LÉGAUX', array('Bodacc' => 'EVÉNEMENTS LÉGAUX',
'Balo' => 'BALO', 'Balo' => 'BALO',

View File

@ -521,7 +521,7 @@ function afficheTableaux($tabBilan, $unite)
print "<tr>\n"; print "<tr>\n";
print ' <td colspan="2"></td>'."\n"; print ' <td colspan="2"></td>'."\n";
print ' <td align="center"><b><u><i>Valeurs exprimées en '. print ' <td align="center"><b><u><i>Valeurs exprimées en '.
$unite.$tabBilan->devise."</i></u></b></td>\n"; $unite.$tabBilan->MONNAIE."</i></u></b></td>\n";
print ' <td colspan="2" align="center"><b>Brut</b></td>'."\n"; print ' <td colspan="2" align="center"><b>Brut</b></td>'."\n";
print ' <td colspan="2" align="center"><b>Amortissement,'. print ' <td colspan="2" align="center"><b>Amortissement,'.
' provisions</b></td>'."\n"; ' provisions</b></td>'."\n";
@ -542,7 +542,7 @@ function afficheTableaux($tabBilan, $unite)
print "<tr>\n"; print "<tr>\n";
print ' <td></td>'."\n"; print ' <td></td>'."\n";
print ' <td align="center" colspan="3"><b><u><i>'. print ' <td align="center" colspan="3"><b><u><i>'.
'Valeurs exprimées en '.$unite.$tabBilan->devise. 'Valeurs exprimées en '.$unite.$tabBilan->MONNAIE.
"</i></u></b></td>\n"; "</i></u></b></td>\n";
print ' <td colspan="2" align="center"><b>Exercice N</b><br/>'; print ' <td colspan="2" align="center"><b>Exercice N</b><br/>';
$date = new WDate; $date = new WDate;
@ -558,7 +558,7 @@ function afficheTableaux($tabBilan, $unite)
} else if ($titre == 'COMPTE DE RESULTAT') { } else if ($titre == 'COMPTE DE RESULTAT') {
print "<tr>\n"; print "<tr>\n";
print ' <td align="center" rowspan="2"><b><i><u>'. print ' <td align="center" rowspan="2"><b><i><u>'.
'Valeurs exprimées en '.$unite.$tabBilan->devise. 'Valeurs exprimées en '.$unite.$tabBilan->MONNAIE.
"</u></i></b></td>\n"; "</u></i></b></td>\n";
print ' <td colspan="6" align="center" valign="middle">'. print ' <td colspan="6" align="center" valign="middle">'.
'<b>Exercice N</b><br/>('; '<b>Exercice N</b><br/>(';
@ -580,7 +580,7 @@ function afficheTableaux($tabBilan, $unite)
} else if ($titre == 'COMPTE DE RESULTAT suite') { } else if ($titre == 'COMPTE DE RESULTAT suite') {
print "<tr>\n"; print "<tr>\n";
print ' <td align="center" colspan="3"><b><i><u>'. print ' <td align="center" colspan="3"><b><i><u>'.
'Valeurs exprimées en '.$unite.$tabBilan->devise. 'Valeurs exprimées en '.$unite.$tabBilan->MONNAIE.
"</u></i></b></td>\n"; "</u></i></b></td>\n";
print ' <td colspan="2" align="center" valign="middle">'. print ' <td colspan="2" align="center" valign="middle">'.
'<b>Exercice N</b><br/>('; '<b>Exercice N</b><br/>(';

View File

@ -159,7 +159,8 @@ function bilanPostes($tabPostes)
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
function liasse2xml(&$val, &$liasse, &$tableTexteBilan) function liasse2xml(&$val, &$liasse, &$tableTexteBilan)
{ {
global $tabBilan; global $tabPostes;
$tabBilan = &$tabPostes;
global $unite; global $unite;
if (is_array($val)) { if (is_array($val)) {

View File

@ -25,8 +25,10 @@ if ($mil !== false) {
$tabBilans = $ret[0]; $tabBilans = $ret[0];
} }
$tabPostes = bilanPostes($tabBilan->POSTES->item); if (isset($tabBilan->POSTES) == true) {
FB::log($tabPostes, 'tabPostes'); $tabPostes = bilanPostes($tabBilan->POSTES->item);
FB::log($tabPostes, 'tabPostes');
}
if ($action == 'export') { if ($action == 'export') {
require_once realpath(dirname(__FILE__)).'/liassexls.php'; require_once realpath(dirname(__FILE__)).'/liassexls.php';

View File

@ -206,7 +206,7 @@ function scoresws_ratios($siret, $siren, $idEntreprise, $page = 'ratios')
$ws = new WsScores(); $ws = new WsScores();
$reponse = $ws->getRatios($siren, $page); $reponse = $ws->getRatios($siren, $page);
if ($reponse!=false){ if ($reponse!=false){
$result = $reponse->result; $result = $reponse;
$bilansInfos = $result->BilansInfos->item; $bilansInfos = $result->BilansInfos->item;
$ratiosInfos = $result->RatiosInfos->item; $ratiosInfos = $result->RatiosInfos->item;
$ratiosSecteur = $result->RatiosSecteur->item; $ratiosSecteur = $result->RatiosSecteur->item;
@ -253,8 +253,7 @@ function scoresws_listeBilans($siret, $siren, $idEntreprise, $mil)
$fileName = 'liasse-'.$siret; $fileName = 'liasse-'.$siret;
} }
if ($mil != false) { if ($mil != false) {
$indice = substr($mil, 0, 1); $fileName .= '-'.substr($mil, 0, 8);
$fileName .= '-'.$indice;
} }
cache_filename($fileName); cache_filename($fileName);
@ -263,15 +262,15 @@ function scoresws_listeBilans($siret, $siren, $idEntreprise, $mil)
$tabBilan = cache_get('tabBilan'); $tabBilan = cache_get('tabBilan');
return array($tabBilans, $tabBilan); return array($tabBilans, $tabBilan);
} else { } else {
$ws = new WsScores(); $ws = new WsScores();
$reponse = $ws->getListeBilans($siren); $reponse = $ws->getListeBilans($siren);
if ($reponse === false) { if ($reponse === false) {
return false; return false;
} }
$tabBilans = $reponse->result; $tabBilans = $reponse->result;
// Tri du tableau // Tri du tableau
if ($tabBilans->nbReponses > 0) { if ($reponse->nbReponses > 0) {
foreach ($tabBilans->liste->item as $bilan) { foreach ($tabBilans->item as $bilan) {
$tabBilansNew[$bilan->typeBilan.$bilan->dateExercice] = $bilan; $tabBilansNew[$bilan->typeBilan.$bilan->dateExercice] = $bilan;
} }
krsort($tabBilansNew); krsort($tabBilansNew);
@ -281,15 +280,14 @@ function scoresws_listeBilans($siret, $siren, $idEntreprise, $mil)
cache_add('tabBilans', $tabBilans); cache_add('tabBilans', $tabBilans);
if ($mil != false) { if ($mil != false) {
$reponse = $tabBilan =
$ws->getBilan($siren, $ws->getBilan($siren,
substr($mil, 1 ,8), substr($mil, 1, 8),
substr($mil, 0, 1), substr($mil, 0, 1),
substr($mil, 9)); substr($mil, 9));
if ($reponse === false) { if ($tabBilan === false) {
return false; return false;
} }
$tabBilan = $reponse->result;
cache_add('tabBilan', $tabBilan); cache_add('tabBilan', $tabBilan);
return array($tabBilans, $tabBilan); return array($tabBilans, $tabBilan);
} else { } else {

View File

@ -296,7 +296,7 @@ if (count($annonces) > 0) {
require_once 'export.php'; require_once 'export.php';
$parseTab = new tabExport(); $parseTab = new tabExport();
$parseTab->tab = $annonces->liste->item; $parseTab->tab = $annonces->item;
$parseTab->notdisplay = array('id'); $parseTab->notdisplay = array('id');
$parseTab->title = $parseTab->title =
array('BodaccCode' => 'Code Bodacc', array('BodaccCode' => 'Code Bodacc',
@ -318,7 +318,7 @@ if (count($annonces) > 0) {
$array2csv->records = $tabForExport; $array2csv->records = $tabForExport;
$array2csv->writeCSV($fileName); $array2csv->writeCSV($fileName);
$tabForExport = $annonces->liste->item; $tabForExport = $annonces->item;
$array2xml = new ExportXML(); $array2xml = new ExportXML();
$array2xml->rootName = $page; $array2xml->rootName = $page;
$array2xml->defaultTagName = substr($page, 0, -1); $array2xml->defaultTagName = substr($page, 0, -1);

View File

@ -78,6 +78,7 @@ if (count($tabBilans) > 0) {
'B' => 'Banque', 'B' => 'Banque',
'A' => 'Assurance' 'A' => 'Assurance'
); );
$wdate = new WDate;
foreach ($typBil as $keyType => $type) { foreach ($typBil as $keyType => $type) {
$numBil = 0; $numBil = 0;
foreach ($tabBilans as $bilan) { foreach ($tabBilans as $bilan) {
@ -91,8 +92,8 @@ if (count($tabBilans) > 0) {
print ' selected'; print ' selected';
} }
$str=' '. $typBil[substr($millesime, 0, 1)]; $str=' '. $typBil[substr($millesime, 0, 1)];
$millesimeSelect = WDate::dateT('Ymd','d/m/Y', $millesimeSelect =
substr($millesime, 1, 8)); $wdate->dateT('Ymd', 'd/m/Y', substr($millesime, 1, 8));
print '>'. $millesimeSelect . $str .'</option>'; print '>'. $millesimeSelect . $str .'</option>';
$numBil++; $numBil++;
} }
@ -132,7 +133,7 @@ if (isset($_REQUEST['mil']) == true && $_SESSION['tabInfo']['idClient'] == 1) {
// Si un bilan est sélectionné dans la liste, on affiche le bilan // Si un bilan est sélectionné dans la liste, on affiche le bilan
if (isset($_REQUEST['mil']) == true) { if (isset($_REQUEST['mil']) == true) {
$mil = $_REQUEST['mil']; $mil = $_REQUEST['mil'];
if ($mil[0] == 'A') { if ($mil[0] == 'A') {
include 'liasse/bilan_assurance.php'; include 'liasse/bilan_assurance.php';
} else if ($mil[0] == 'B') { } else if ($mil[0] == 'B') {