From ddd2a64451ace5ac8be6e11d46fcd496a9d1d1e6 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Thu, 3 Sep 2015 13:49:04 +0000 Subject: [PATCH] Correction livraison des fichiers statut association --- library/WsScore/Pieces/v0.1/Service.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/library/WsScore/Pieces/v0.1/Service.php b/library/WsScore/Pieces/v0.1/Service.php index bd247d4e..91411605 100644 --- a/library/WsScore/Pieces/v0.1/Service.php +++ b/library/WsScore/Pieces/v0.1/Service.php @@ -917,7 +917,7 @@ class Pieces extends Scores_Ws_Server * Identifiant, siren de l'entreprise * @param string $type * @param string $date - * Date au format AAAAMMJJ + * Date au format AAAA-MM-JJ * @throws SoapFault * @return string * URL ou identifiant de commande @@ -928,11 +928,19 @@ class Pieces extends Scores_Ws_Server $this->permission('actes'); // --- Lecture table des actes associations - $statutM = new Application_Model_JoAssoStatut(); - $statutSql = $statutM->select() - ->where('companyId=?', $companyId) - ->where('satutDate=?', $date); - $statutResult = $statutM->fetchRow($statutSql); + try { + $statutM = new Application_Model_JoAssoStatut(); + $statutSql = $statutM->select() + ->where('companyId=?', $companyId) + ->where('statutDate=?', $date); + $statutResult = $statutM->fetchRow($statutSql); + } catch (Zend_Db_Exception $e) { + if ($this->User->idClient==1) { + throw new SoapFault('ERR', $e->getMessage()); + } else { + throw new SoapFault('ERR', "Application error"); + } + } if ($statutResult === null) { return false; }