Gestion de l'affichage des bilans confidentiel

This commit is contained in:
Michael RICOIS 2017-03-08 16:17:07 +01:00
parent 23bd68129c
commit ed53d33b7e
4 changed files with 67 additions and 41 deletions

View File

@ -941,8 +941,6 @@ class FinanceController extends Zend_Controller_Action
$request = $this->getRequest();
$unite = $request->getParam('unit','K');
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
$ws = new WsScores();
// Récupération de la date
$dateAndType = $request->getParam('date', $defaultTypeBilan.$defaultDateExercice);
@ -953,38 +951,51 @@ class FinanceController extends Zend_Controller_Action
$date = substr($dateAndType, 1);
// Récupération des postes du bilan
$infos = $ws->getBilan(substr($this->siret, 0, 9), $date, $type, true);
if ($infos === false) $this->forward('soap', 'error');
try {
$ws = new Scores_Ws_Client('entreprise', '0.8');
$params = new stdClass();
$params->siren = substr($this->siret, 0, 9);
$params->millesime = $date;
$params->typeBilan = $type;
$params->ref = '';
$infos = $ws->getBilan($params);
// Formatage de la liasse
$infoLiasse = new Scores_Finance_Liasse($infos, $unite);
$this->view->assign('dateCloture', $infoLiasse->getInfo('dateCloture'));
$this->view->assign('dateCloturePre', $infoLiasse->getInfo('dateCloturePre'));
// Error
if ($infos === false) {
$this->forward('soap', 'error');
}
$date = new Zend_Date($infoLiasse->getInfo('dateCloture'), 'yyyyMMdd');
$this->view->assign('dateClotureD', $date->toString('dd/MM/yyyy'));
// Formatage de la liasse
$infoLiasse = new Scores_Finance_Liasse($infos, $unite);
$this->view->assign('dateCloture', $infoLiasse->getInfo('dateCloture'));
$this->view->assign('dateCloturePre', $infoLiasse->getInfo('dateCloturePre'));
$dateCloturePre = $infoLiasse->getInfo('dateCloturePre');
if ( $dateCloturePre == '' ) {
$this->view->assign('dateCloturePreD', '-');
} else {
$date = new Zend_Date($dateCloturePre, 'yyyyMMdd');
$this->view->assign('dateCloturePreD', $date->toString('dd/MM/yyyy'));
$date = new Zend_Date($infoLiasse->getInfo('dateCloture'), 'yyyyMMdd');
$this->view->assign('dateClotureD', $date->toString('dd/MM/yyyy'));
$dateCloturePre = $infoLiasse->getInfo('dateCloturePre');
if ($dateCloturePre == '') {
$this->view->assign('dateCloturePreD', '-');
} else {
$date = new Zend_Date($dateCloturePre, 'yyyyMMdd');
$this->view->assign('dateCloturePreD', $date->toString('dd/MM/yyyy'));
}
$this->view->assign('dureesMois', $infoLiasse->getInfo('dureeMois'));
$this->view->assign('dureesMoisPre', $infoLiasse->getInfo('dureeMoisPre'));
$this->view->assign('date', $date);
$this->view->assign('champType', $type);
$this->view->assign('liasse', $infoLiasse->getPostes());
$this->view->assign('ancres', $ancres[$type]);
} catch (Exception $e) {
$this->view->msg = $e->getMessage();
}
$this->view->assign('dureesMois', $infoLiasse->getInfo('dureeMois'));
$this->view->assign('dureesMoisPre', $infoLiasse->getInfo('dureeMoisPre'));
$this->view->assign('date', $date);
$this->view->assign('champType', $type);
$this->view->assign('liasse', $infoLiasse->getPostes());
$this->view->assign('ancres', $ancres[$type]);
//Gestion export de la liasse au format XLS
if ( $user->checkPerm('liassexls') & in_array($type,array('C', 'N', 'S')) ) {
$this->view->assign('exportxls', true);
}
}
$this->view->assign('id', $id);

View File

@ -17,13 +17,12 @@
<h2>Liste des relations bancaires</h2>
<div class="paragraph">
<?php if (empty($this->AutrePage) && $this->edition) {?>
<div style="line-height:16px;">
<a class="dialog" title="Ajouter RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'add','siren'=>$this->siren), null, true)?>">
<img style="vertical-align:middle;" src="/themes/default/images/interfaces/ajouter.png" /> Ajouter une autre relation bancaire</a>
</div>
<?php
}?>
<?php if (empty($this->AutrePage) && $this->edition) {?>
<div style="line-height:16px;">
<a class="dialog" title="Ajouter RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'add','siren'=>$this->siren), null, true)?>">
<img style="vertical-align:middle;" src="/themes/default/images/interfaces/ajouter.png" /> Ajouter une autre relation bancaire</a>
</div>
<?php }?>

View File

@ -51,6 +51,12 @@
</table>
</div>
<?php if ($this->msg) {?>
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
<?=$this->msg?>
</p>
<?php } else {?>
<?php
switch ($this->champType) {
case 'N' : $name = 'Réel Normal'; break;
@ -64,12 +70,12 @@ switch ($this->champType) {
<div class="paragraph">
<form method="post" action="<?=$this->url(array('controller'=>'finance','action'=>'liasse','siret'=>$this->siret,'id'=>$this->id))?>">
Valeurs exprimées en
<select name="unit">
<?php foreach ($this->unit as $id => $titre):?>
<option value="<?=$id?>"<?=($id==$this->unite)? ' selected': '';?>><?=$titre?></option>
<?php endforeach;?>
</select>
<input type="submit" value="OK" />
<select name="unit">
<?php foreach ($this->unit as $id => $titre):?>
<option value="<?=$id?>"<?=($id==$this->unite)? ' selected': '';?>><?=$titre?></option>
<?php endforeach;?>
</select>
<input type="submit" value="OK" />
</form>
</div>
@ -132,5 +138,7 @@ Valeurs exprimées en
<?php }?>
</div>
<?php }?>
<?php echo $this->render('cgu.phtml', $this->cgu);?>
</div>

View File

@ -1,5 +1,13 @@
<?php
return array(
'0.8' => array(
'getBilan' => array(
'cache' => true,
'errorMsg' => array('MSG'),
'debug' => true,
'log' => 'mail',
),
),
'0.9' => array(
'getGreffeAffaireList' => array(
'debug' => true,