From 85b1d508caa8c5c52b701e576cf15efa8f04c7fd Mon Sep 17 00:00:00 2001 From: benoitpotier Date: Thu, 9 Mar 2017 14:29:22 +0100 Subject: [PATCH] validation de la saisie bilan via webservice --- library/WsScore/Order/v0.1/Service.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/WsScore/Order/v0.1/Service.php b/library/WsScore/Order/v0.1/Service.php index 45d1597f..5833fd2c 100644 --- a/library/WsScore/Order/v0.1/Service.php +++ b/library/WsScore/Order/v0.1/Service.php @@ -19,17 +19,17 @@ class Order extends Scores_Ws_Server * @return string * Retourne la référence de commande */ - public function setBilanInput($siren, $date, $type, $source, $private = 0) + public function setBilanInput($siren, $date, $type, $source='client', $private = 0) { $this->authenticate(); $this->permission('UPLOADBILAN'); // Check source - if (in_array($source, array('extranet', 'infogreffe'))) { - + if (!in_array($source, array('extranet', 'infogreffe'))) { + $source = 'client'; } // Check Siren - else { + if ($source == 'client') { if (strlen($siren) != 9 || intval($siren) == 0) { throw new SoapFault('ERR', "SIREN invalid"); } @@ -106,8 +106,8 @@ class Order extends Scores_Ws_Server // Generate filename $siren = $commandeResult->siren; - $type = $commandeResult->type; - $cloture = $commandeResult->bilanCloture; + $type = $commandeResult->bilanType; + $cloture = str_replace('-', '', $commandeResult->bilanCloture); $ref = $commandeResult->refCommande; $filename = $siren.'_'.$type.'_'.$cloture.'_'.$ref.'.pdf';