issue #0001847 : Ajout récupération de la disponibilité et l'état des informations financière

This commit is contained in:
Michael RICOIS 2014-03-12 09:58:15 +00:00
parent 5ce8b75ffe
commit 077f51ce4f
10 changed files with 181 additions and 99 deletions

View File

@ -1372,4 +1372,33 @@ class FinanceController extends Zend_Controller_Action
}
}
/**
* Affichage en ajax des informations dernière date de cloture du bilan et etat de saisie
*/
public function liasseinfosAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$siren = $request->getParam('siren');
$ws = new WsScores();
$response = $ws->getEntrepriseLiasseInfos($siren);
Zend_Registry::get('firebug')->info($response);
if ( $response === null ) {
$this->view->assign('msg','Aucun bilan déposé.');
} else {
$date = new Zend_Date($response->DateCloture, 'yyyy-MM-dd');
$this->view->assign('DateCloture', $date->toString('dd/MM/yyyy'));
$this->view->assign('DateClotureIso', $response->DateCloture);
if ( $response->SaisieDate!='' || $response->SaisieDate!='0000-00-00' ) {
$this->view->assign('SaisieDateIso', $response->SaisieDate);
$date = new Zend_Date($response->SaisieDate, 'yyyy-MM-dd');
$this->view->assign('SaisieDate', $date->toString('dd/MM/yyyy'));
}
$this->view->assign('SaisieLabel', $response->SaisieLabel);
}
}
}

View File

@ -5,42 +5,52 @@
<?php if (empty($this->AutrePage)) {?>
<h1>ÉLÉMENTS FINANCIERS - BILANS</h1>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">
Num&eacute;ro identifiant Siren
</td>
<td width="350" class="StyleInfoData">
<?php echo $this->SirenTexte($this->siren);?>
</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?php echo $this->raisonSociale;?></td>
</tr>
<?php if (isset($this->tabResultActif) && isset($this->tabResultPassif) && isset($this->tabResultSig)){?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Type de bilans</td>
<td width="350" class="StyleInfoData">
<?php if ($this->nbBilanC==0){?>
Réel normal ou Simplifié
<?php } elseif ($this->nbBilanN==0){?>
Consolidé
<?php } else {?>
<form>
<select name="typeBilan">
<option value="N"<?=($this->typeBilan=='N')? ' selected' : '';?>>Réel normal ou Simplifié</option>
<option value="C"<?=($this->typeBilan=='C')? ' selected' : '';?>>Consolidé</option>
</select>
</form>
<?php }?>
</td>
</tr>
<?php }?>
</table>
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">
Num&eacute;ro identifiant Siren
</td>
<td width="350" class="StyleInfoData">
<?php echo $this->SirenTexte($this->siren);?>
</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?php echo $this->raisonSociale;?></td>
</tr>
<?php if (isset($this->tabResultActif) && isset($this->tabResultPassif) && isset($this->tabResultSig)){?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Type de bilans</td>
<td width="350" class="StyleInfoData">
<?php if ($this->nbBilanC==0){?>
Réel normal ou Simplifié
<?php } elseif ($this->nbBilanN==0){?>
Consolidé
<?php } else {?>
<form>
<select name="typeBilan">
<option value="N"<?=($this->typeBilan=='N')? ' selected' : '';?>>Réel normal ou Simplifié</option>
<option value="C"<?=($this->typeBilan=='C')? ' selected' : '';?>>Consolidé</option>
</select>
</form>
<?php }?>
</td>
</tr>
<?php }?>
</table>
<?php if ( empty($this->AutrePage) ) {?>
<div id="liasse-check-result" class="ui-state-highlight ui-corner-all" style="margin-top: 5px;">
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
<a title="Cliquez ici pour vérifier l'intégration des éléments financiers"
href="<?=$this->url(array('controller'=>'finance','action'=>'liasseinfos','siren'=>$this->siren), null, true)?>"
id="liasse-check">Vérifier la disponibilité des derniers états financiers au Greffe.</a></p>
</div>
<?php }?>
</div>
<?php }?>
@ -195,10 +205,10 @@
<?php }?>
<?php if (empty($this->AutrePage)) {?>
<?php if ( empty($this->AutrePage) ) {?>
<?=$this->render('cgu.phtml', $this->cgu)?>
<?php }?>
<?php if (empty($this->AutrePage)) {?>
<?php if ( empty($this->AutrePage) ) {?>
</div>
<?php }?>

View File

@ -13,7 +13,7 @@
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
<?php if($this->haveLiasse):?>
<?php if ( $this->haveLiasse ) {?>
<form method="post" action="<?=$this->url(array('controller'=>'finance','action'=>'liasse','siret'=>$this->siret,'id'=>$this->id))?>">
<tr>
<td width="30">&nbsp;</td>
@ -44,13 +44,13 @@
</td>
</tr>
</form>
<?php endif;?>
<?php }?>
<?php if ($this->edition) {?>
<tr>
<td width="30">&nbsp;</td>
<td colspan="2">
<?php if ($this->haveLiasse) {?>
<?php if ( $this->haveLiasse ) {?>
<a href="<?=$this->url(array('controller'=>'saisie', 'action'=>'liasse', 'siret'=>$this->siren, 'selection'=>$this->date.':'.$this->champType))?>">
Corriger le bilan sélectionné</a><br/> ou <?php }?>
Saisir une nouvelle liasse au format
@ -110,6 +110,16 @@
</tr>
<?php }?>
</table>
<?php if ( empty($this->AutrePage) && $this->haveLiasse) {?>
<div id="liasse-check-result" class="ui-state-highlight ui-corner-all" style="margin-top: 5px;">
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
<a title="Cliquez ici pour vérifier l'intégration des éléments financiers"
href="<?=$this->url(array('controller'=>'finance','action'=>'liasseinfos','siren'=>$this->siren), null, true)?>"
id="liasse-check">Vérifier la disponibilité des derniers états financiers</a></p>
</div>
<?php }?>
</div>
<div class="paragraph">

View File

@ -0,0 +1,18 @@
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
<?php if ( $this->DateClotureIso ) { ?>
Le dernier millésime déposé au greffe est le <?=$this->DateCloture?>.
<?php if ( $this->SaisieDateIso && $this->SaisieCode=='00' ) {?>
Le bilan a été saisie le <?=$this->SaisieDate?>.
<?php } else {?>
Le bilan n'a pas été saisie par la source officielle (<i><?=$this->SaisieLabel?>)</i>.
<br/>Contactez le support (support@scores-decisions.com) pour une demande de mise à jour.
(Soumis à facturation selon vos accords contractuels)
<?php }?>
<?php } else {?>
<?=$this->msg?>
<?php }?>
</p>

View File

@ -1,8 +1,8 @@
<?php if (empty($this->AutrePage)):?>
<?php if ( empty($this->AutrePage) ):{?>
<div id="center">
<?php endif;?>
<?php }?>
<?php if (empty($this->AutrePage)):?>
<?php if ( empty($this->AutrePage) ) {?>
<h1>RATIOS</h1>
<div class="paragraph">
<table class="identite">
@ -21,7 +21,7 @@
<td class="StyleInfoLib" width="200">Secteur d'activité </td>
<td class="StyleInfoData" width="340"><?=$this->naf?> - <?=$this->nafLib?></td>
</tr>
<?php if (isset($this->tabResult)){?>
<?php if ( isset($this->tabResult) ) {?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Type de bilans</td>
@ -67,8 +67,18 @@
</tr>
<?php }?>
</table>
<?php if ( empty($this->AutrePage) && isset($this->tabResult) ) {?>
<div id="liasse-check-result" class="ui-state-highlight ui-corner-all" style="margin-top: 5px;">
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
<a title="Cliquez ici pour vérifier l'intégration des éléments financiers"
href="<?=$this->url(array('controller'=>'finance','action'=>'liasseinfos','siren'=>$this->siren), null, true)?>"
id="liasse-check">Vérifier la disponibilité des derniers états financiers</a></p>
</div>
<?php endif;?>
<?php }?>
</div>
<?php }?>
<div class="paragraph">

View File

@ -1,37 +0,0 @@
<div id="paragraph">
<h2>Synthese</h2>
<?php if(!empty($this->annees)):?>
<h2>Eléments Financiers</h2>
<?php $i = 0;?>
<table id="synthese">
<tr>
<th></th>
<?php foreach ($this->annees as $annee => $duree):?>
<th class="date" colspan="2"><?php echo $annee;?><br /><?php echo $duree;?> Mois</th>
<?php endforeach;?>
</tr>
<?php foreach ($this->synthese as $champ => $element):?>
<?php $nom = explode(':', $champ);?>
<tr>
<td style="cursor:help" class="tooltip" title="<?php echo $this->commentaires[$nom[0]]['commentaires'];?>" class="head">
<b><?php echo $nom[1];?></b>
</td>
<?php foreach ($element as $item):?>
<td><?php echo number_format($item['Valeur'], 0, '', ' ');?> K€</td>
<td><?php echo $item['percent'];?> %</td>
<?php endforeach;?>
</tr>
<?php $i++;?>
<?php endforeach;?>
</table>
<?php else :?>
<table>
<tr>
<td width="30"></td>
<td colspan="2" valign="top" width="350" class="StyleInfoData">Aucune synthése diponnible.</td>
</tr>
</table>
<?php endif;?>
<?=$this->render('cgu.phtml', $this->cgu)?>
</div>

View File

@ -1,6 +1,6 @@
<?php if (empty($this->AutrePage)):?>
<?php if ( empty($this->AutrePage) ) {?>
<div id="center">
<?php endif;?>
<?php }?>
<?php if (empty($this->AutrePage)){?>
<h1>SYNTHÈSE</h1>
@ -41,6 +41,16 @@
</tr>
<?php }?>
</table>
<?php if ( empty($this->AutrePage) ) {?>
<div id="liasse-check-result" class="ui-state-highlight ui-corner-all" style="margin-top: 5px;">
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
<a title="Cliquez ici pour vérifier l'intégration des éléments financiers"
href="<?=$this->url(array('controller'=>'finance','action'=>'liasseinfos','siren'=>$this->siren), null, true)?>"
id="liasse-check">Vérifier la disponibilité des derniers états financiers</a></p>
</div>
<?php }?>
</div>
<?php }?>
@ -117,7 +127,7 @@ Aucun bilan disponible.
<?php }?>
<?php if (empty($this->AutrePage)):?>
<?php if ( empty($this->AutrePage) ) {?>
<?=$this->render('cgu.phtml', $this->cgu)?>
</div>
<?php endif;?>
<?php }?>

View File

@ -101,6 +101,25 @@ class WsScores
return $client;
}
public function getEntrepriseLiasseInfos($siren)
{
$params = new stdClass();
$params->siren = $siren;
$client = $this->loadClient('entreprise');
try {
$reponse = $client->getLiasseInfos($params);
return $reponse->getLiasseInfosResult;
} catch (SoapFault $fault) {
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring;
} else {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
}
public function delSaisieContactEt($id)
{
$params = new stdClass();

View File

@ -1,29 +1,29 @@
[local]
webservices.interne.wsdl = "http://webservice-2.5.sd.dev/interne/v0.6?wsdl-auto"
webservices.interne.wsdl = "http://webservice-2.6.sd.dev/interne/v0.6?wsdl-auto"
webservices.interne.options.soap_version = SOAP_1_2
webservices.entreprise.wsdl = "http://webservice-2.5.sd.dev/entreprise/v0.8?wsdl-auto"
webservices.entreprise.wsdl = "http://webservice-2.6.sd.dev/entreprise/v0.8?wsdl-auto"
webservices.entreprise.options.soap_version = SOAP_1_2
webservices.gestion.wsdl = "http://webservice-2.5.sd.dev/gestion/v0.3?wsdl-auto"
webservices.gestion.wsdl = "http://webservice-2.6.sd.dev/gestion/v0.3?wsdl-auto"
webservices.gestion.options.soap_version = SOAP_1_2
webservices.saisie.wsdl = "http://webservice-2.5.sd.dev/saisie/v0.2?wsdl-auto"
webservices.saisie.wsdl = "http://webservice-2.6.sd.dev/saisie/v0.2?wsdl-auto"
webservices.saisie.options.soap_version = SOAP_1_2
webservices.pieces.wsdl = "http://webservice-2.5.sd.dev/pieces/v0.1?wsdl-auto"
webservices.pieces.wsdl = "http://webservice-2.6.sd.dev/pieces/v0.1?wsdl-auto"
webservices.pieces.options.soap_version = SOAP_1_2
webservices.catalog.wsdl = "http://webservice-2.5.sd.dev/catalog/v0.1?wsdl-auto"
webservices.catalog.wsdl = "http://webservice-2.6.sd.dev/catalog/v0.1?wsdl-auto"
webservices.catalog.options.soap_version = SOAP_1_2
[sdsrvdev01]
webservices.interne.wsdl = "http://webservice-2.5.sd.lan/interne/v0.6?wsdl-auto"
webservices.interne.wsdl = "http://webservice-2.6.sd.lan/interne/v0.6?wsdl-auto"
webservices.interne.options.soap_version = SOAP_1_2
webservices.entreprise.wsdl = "http://webservice-2.5.sd.lan/entreprise/v0.8?wsdl-auto"
webservices.entreprise.wsdl = "http://webservice-2.6.sd.lan/entreprise/v0.8?wsdl-auto"
webservices.entreprise.options.soap_version = SOAP_1_2
webservices.gestion.wsdl = "http://webservice-2.5.sd.lan/gestion/v0.3?wsdl-auto"
webservices.gestion.wsdl = "http://webservice-2.6.sd.lan/gestion/v0.3?wsdl-auto"
webservices.gestion.options.soap_version = SOAP_1_2
webservices.saisie.wsdl = "http://webservice-2.5.sd.lan/saisie/v0.2?wsdl-auto"
webservices.saisie.wsdl = "http://webservice-2.6.sd.lan/saisie/v0.2?wsdl-auto"
webservices.saisie.options.soap_version = SOAP_1_2
webservices.pieces.wsdl = "http://webservice-2.5.sd.lan/pieces/v0.1?wsdl-auto"
webservices.pieces.wsdl = "http://webservice-2.6.sd.lan/pieces/v0.1?wsdl-auto"
webservices.pieces.options.soap_version = SOAP_1_2
webservices.catalog.wsdl = "http://webservice-2.5.sd.lan/catalog/v0.1?wsdl-auto"
webservices.catalog.wsdl = "http://webservice-2.6.sd.lan/catalog/v0.1?wsdl-auto"
webservices.catalog.options.soap_version = SOAP_1_2
[sd-25137]

View File

@ -84,6 +84,19 @@ $(document).ready(function()
});
});
$('a#liasse-check').on('click', function(e){
e.preventDefault();
var url = $(this).attr('href');
var objetId = $(this).attr('id') + '-result';
$(this).parent().html("Chargement...");
$.post( url, function (data, textStatus) {
if( data=='' || data=='FALSE' || textStatus=='timeout' ) {
data = "Impossible d'obtenir l'état.";
}
$('div#'+objetId).html(data);
});
});
});