diff --git a/application/controllers/SaisieController.php b/application/controllers/SaisieController.php index 2254350e5..63c0aa445 100644 --- a/application/controllers/SaisieController.php +++ b/application/controllers/SaisieController.php @@ -1670,10 +1670,15 @@ class SaisieController extends Zend_Controller_Action $this->view->assign('id1', $infos['idAct']); } + $dateEffetLien = $this->wDate->dateT('Y-m-d', 'd/m/Y', $infos['dateEffetLien']); + $doc = ($siren) ? $ws->getLienDoc($siren, 'Siren') : $ws->getLienDoc($lienRef, 'Entreprise'); + $dateEffetLienDoc = ($doc->item[0]->date) ? $this->wDate->dateT('Y-m-d', 'd/m/Y', $doc->item[0]->date) : $dateEffetLien; + $this->view->assign('PDetention', $infos['PDetention']); $this->view->assign('Pvote', $infos['Pvote']); $this->view->assign('MajMin', $infos['MajMin']); - $this->view->assign('dateEffetLien', $this->wDate->dateT('Y-m-d', 'd/m/Y', $infos['dateEffetLien'])); + $this->view->assign('dateEffetLien', $dateEffetLien); + $this->view->assign('dateEffetLienDoc', $dateEffetLienDoc); } else { diff --git a/application/views/default/scripts/saisie/lien.phtml b/application/views/default/scripts/saisie/lien.phtml index 25ce11d0d..45eb2d4a3 100644 --- a/application/views/default/scripts/saisie/lien.phtml +++ b/application/views/default/scripts/saisie/lien.phtml @@ -241,6 +241,7 @@ $('a#lienDoc').on('click', function(e){ $('select[name=motifUpdate]').on('change', function(e){ e.preventDefault(); + $('input[name=dateEffetLien]').val('dateEffetLien;?>'); if ($(this).val()=='TUP') { $('select[name=MajMin]').val('T'); $('input[name=PDetention]').val(0); @@ -249,6 +250,8 @@ $('select[name=motifUpdate]').on('change', function(e){ $('select[name=MajMin]').val('F'); $('input[name=PDetention]').val(0); $('input[name=Pvote]').val(0); + } else if ($(this).val()=='Dernier rapport annuel') { + $('input[name=dateEffetLien]').val('dateEffetLienDoc;?>'); } });