issue #0000642 : Ajout element pour gestion modification insee à l'établissement
This commit is contained in:
parent
6badc92806
commit
9b68cc4107
@ -403,26 +403,29 @@ function scorews_privileges($siret, $siren, $detail, $vue){
|
||||
return $return;
|
||||
}
|
||||
|
||||
function scoresws_evenements($siret, $siren, $idEntreprise) {
|
||||
function scoresws_evenements($siren, $nic = 0, $idEntreprise = 0, $vue = '') {
|
||||
global $client;
|
||||
|
||||
/*
|
||||
Siret = SiretSiege => Tout || Juste établissement
|
||||
Siret != SiretSiege => Juste établissement + lien vers SiretSiege
|
||||
*/
|
||||
if ($nic==0) {
|
||||
$siret = $siren;
|
||||
} else {
|
||||
$siret = $siren.$nic;
|
||||
}
|
||||
|
||||
if ( $siret*1 == 0 && $siren*1 < 100) {
|
||||
if ( intval($siren) == 0 && intval($siren) < 100) {
|
||||
$fileName = 'evenements-'.$idEntreprise;
|
||||
} else {
|
||||
$fileName = 'evenements-'.$siret;
|
||||
if (!empty($vue)) { $fileName.= $vue; }
|
||||
}
|
||||
|
||||
cache_filename($fileName);
|
||||
if( cache_exist() && !hasModeEdition() ) {
|
||||
$evens = cache_get('evens');
|
||||
$return = cache_get('evens');
|
||||
} else {
|
||||
$return = null;
|
||||
try {
|
||||
$O = $client->getListeEvenements($siren, 0, 0, 200);
|
||||
$O = $client->getListeEvenements($siren, $nic, 0, 200);
|
||||
$return = $O['result'];
|
||||
cache_delete();
|
||||
cache_add('evens', $return);
|
||||
|
@ -1,12 +1,9 @@
|
||||
<?php
|
||||
if (!page_checkParams()) die('Paramètres incorrects !');
|
||||
|
||||
require_once 'partenaires/classMTva.php';
|
||||
require_once 'partenaires/classMMap.php';
|
||||
require_once 'common/dates.php';
|
||||
require_once 'scoresws/scoresws.php';
|
||||
|
||||
$mil=false;
|
||||
?>
|
||||
<div id="center">
|
||||
<h1 class="titre">LISTE DES ÉVÉNEMENTS</h1>
|
||||
@ -14,44 +11,72 @@ $mil=false;
|
||||
<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>
|
||||
<td width="350" class="StyleInfoData">
|
||||
<?php echo 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="350" class="StyleInfoData"><?=$raisonSociale?></td>
|
||||
</tr>
|
||||
<?php /*?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="550" colspan="2">
|
||||
<?php
|
||||
isset($_REQUEST['vue']) ? $vue = $_REQUEST['vue'] : $vue = '';
|
||||
$nic = substr($siret,9,5);
|
||||
if (empty($nic) || $siret == $_SESSION['tabInfo']['entrep']['SiretSiege']){
|
||||
$siret = $_SESSION['tabInfo']['entrep']['SiretSiege'];
|
||||
$nic = substr($siret,9,5);
|
||||
}
|
||||
$href = './?page=evenements&siret='.$siret.'&idEntreprise='.$idEntreprise;
|
||||
if (!empty($vue) && $vue=='entreprise') {
|
||||
$nic = 0;
|
||||
?>
|
||||
<a href="<?php echo $href?>">Afficher les modifications INSEE sur l'établissement.</a>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<a href="<?php echo $href.'&vue=entreprise'?>">Afficher les modifications INSEE sur toute l'entreprise.</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php */?>
|
||||
</table>
|
||||
|
||||
<h2>Événements INSEE</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td colspan="2" width="550" class="StyleInfoData">
|
||||
<?php
|
||||
$evens = scoresws_evenements($siret, $siren, $idEntreprise);
|
||||
?>
|
||||
<table>
|
||||
<?php
|
||||
$nic = 0;
|
||||
$evens = scoresws_evenements($siren, $nic, $idEntreprise, $vue);
|
||||
if (is_array($evens) && count($evens)>0) {
|
||||
foreach ($evens as $i=>$even)
|
||||
{
|
||||
if ($even['Siege']==1) $type='siège';
|
||||
else $type='établissement';
|
||||
$lien='<a title="Voir la fiche d\'identité" href="/?page=identite&siret='.$siren.$even['Nic'].'&idEntreprise='.$idEntreprise.'">';
|
||||
$lien2='<a title="Voir la fiche d\'identité" href="/?page=identite&siret='.$even['SiretAss'].'&idEntreprise='.$idEntreprise.'">';
|
||||
$lien = '<a title="Voir la fiche d\'identité" href="/?page=identite&siret='.$siren.$even['Nic'].'&idEntreprise='.$idEntreprise.'">';
|
||||
$lien2 = '<a title="Voir la fiche d\'identité" href="/?page=identite&siret='.$even['SiretAss'].'&idEntreprise='.$idEntreprise.'">';
|
||||
?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="60"><?=WDate::dateT('Ymd','d/m/Y',$even['DateInfo'])?></td>
|
||||
<td class="StyleInfoData" width="480"><b><?=$even['EvenLib']?></b> <i> - NIC <?=$lien.$even['Nic'].'</a>'?> le <?=WDate::dateT('Ymd','d/m/Y',$even['EvenDate'])?></i>
|
||||
<?
|
||||
if (trim($even['EvenLibDet'])<>'') echo '<br/>'.str_replace(', ','<br/>', $even['EvenLibDet']);
|
||||
<td width="30"> </td>
|
||||
<td class="StyleInfoLib" width="60" valign="top">
|
||||
<?=WDate::dateT('Ymd','d/m/Y',$even['DateInfo'])?>
|
||||
</td>
|
||||
<td class="StyleInfoData" width="480">
|
||||
<b><?=$even['EvenLib']?></b> <i> - NIC <?=$lien.$even['Nic'].'</a>'?>
|
||||
le <?=WDate::dateT('Ymd','d/m/Y',$even['EvenDate'])?></i>
|
||||
<?php
|
||||
if (trim($even['EvenLibDet'])<>'') echo '<br/>'.str_replace(', ','<br/>', $even['EvenLibDet']);
|
||||
if ($even['SiretAss']*1<>0 && $even['TypeSiretAss']<>'') echo '<br/>Siret du '.$even['TypeSiretAss'].' : '.$lien2.substr($even['SiretAss'],0,9).' '.substr($even['SiretAss'],9,5).'</a>';
|
||||
elseif ($even['SiretAss']*1<>0 && $even['TypeSiretAss']=='') echo '<br/>Siret associé : '.$lien2.substr($even['SiretAss'],0,9).' '.substr($even['SiretAss'],9,5).'</a>';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
<?php
|
||||
}
|
||||
} elseif (is_array($evens) && count($evens)==0) {
|
||||
?>
|
||||
@ -70,9 +95,7 @@ if (is_array($evens) && count($evens)>0) {
|
||||
<?php
|
||||
require_once 'export/genexport.php';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<table>
|
||||
<td width="30"> </td>
|
||||
<td colspan="3" width="550" class="StyleInfoData">
|
||||
<?php
|
||||
|
Loading…
x
Reference in New Issue
Block a user