diff --git a/application/controllers/DeliveryController.php b/application/controllers/DeliveryController.php index 242086f..884c45d 100644 --- a/application/controllers/DeliveryController.php +++ b/application/controllers/DeliveryController.php @@ -23,10 +23,10 @@ class DeliveryController extends Zend_Controller_Action if ( $row !== null ) { $c = Zend_Registry::get('config'); - $html = $c->profil->path->pages . DIRECTORY_SEPARATOR . $row->cmdId . '.html'; + $html = $c->profil->path->pages . '/' . $row->cmdId . '.html'; //Save the HTML file - copy($html, $c->profil->path->data . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR . $id.'.html'); + copy($html, $c->profil->path->data . '/' . $row->cmdId . '.html'); //Generate the PDF $pdf = new Scores_Wkhtml_Pdf(); @@ -79,8 +79,8 @@ class DeliveryController extends Zend_Controller_Action //Regen command if ($regen !== null) { - $source = $c->profil->path->data . DIRECTORY_SEPARATOR . $cmdId . '.html'; - $dest = $c->profil->path->pages . DIRECTORY_SEPARATOR . $cmdId . '.html'; + $source = $c->profil->path->data . '/' . $cmdId . '.html'; + $dest = $c->profil->path->pages . '/' . $cmdId . '.html'; copy($source, $dest); //Generate the PDF @@ -124,19 +124,25 @@ class DeliveryController extends Zend_Controller_Action $sql = $commandM->select()->where('cmdId = ?',$cmdId); $row = $commandM->fetchRow($sql); - //Selection de la facture - $billM = new Application_Model_ReportBill(); - $sql = $billM->select()->where('cmdId = ?',$cmdId); - $bill = $billM->fetchRow($sql); - //Verif if ( $row !== null) { $c = Zend_Registry::get('config'); $path = $c->profil->path->data.'/bill/'; + //Selection de la facture + $billM = new Application_Model_ReportBill(); + $sql = $billM->select()->where('cmdId = ?', $cmdId); + $bill = $billM->fetchRow($sql); + + if ( $bill === null ) { + $regen = true; + } elseif ( empty($bill->file) ) { + $regen = true; + } + //Générer la facture - if ($bill === null || $bill->file == '' || $regen!==null) { + if ( $regen !== null ) { //Prepare information in database if ( $bill === null ) { @@ -144,9 +150,9 @@ class DeliveryController extends Zend_Controller_Action $mois = substr($row->dateInsert, 5,2); $lastItemSql = $billM->select() - ->where('annee=?', $annee) - ->where('mois=?', $mois) - ->order('num DESC')->limit(1); + ->where('annee=?', $annee) + ->where('mois=?', $mois) + ->order('num DESC')->limit(1); $lastItem = $billM->fetchRow($lastItemSql); $NumCmd = $lastItem->num + 1; $billM->insert(array( @@ -155,7 +161,7 @@ class DeliveryController extends Zend_Controller_Action 'mois' => $mois, 'num' => $NumCmd, )); - } elseif ( $bill !== null && $regen !== null ) { + } else { $NumCmd = $bill->num; } @@ -233,7 +239,7 @@ class DeliveryController extends Zend_Controller_Action $pdf->save($path.$file); - $billM->update(array('file' => $file), 'id='.$NumCmd); + $billM->update(array('file' => $file), 'cmdId="'.$cmdId.'"'); } //Distribuer la facture else { diff --git a/application/controllers/ReportController.php b/application/controllers/ReportController.php index 501b7fe..f8650bc 100644 --- a/application/controllers/ReportController.php +++ b/application/controllers/ReportController.php @@ -24,10 +24,11 @@ class ReportController extends Zend_Controller_Action $prestation = null; + $session = new Zend_Session_Namespace('Cmd'); + $session->unlock(); + // Get partner parameters - if ( Zend_Session::isReadable() && Zend_Session::namespaceIsset('Cmd') ) { - $session = new Zend_Session_Namespace('Cmd'); - $session->unlock(); + if ( isset($session->p) ) { $prestation = $session->p; } else { $p = $request->getParam('p'); @@ -222,9 +223,7 @@ class ReportController extends Zend_Controller_Action if ( !isset($session->CmdID) || empty($session->CmdID) ) { //Get the report if (intval($siren)>100) { - $login = $c->profil->report->username; - $password = $c->profil->report->password; - $report = new Scores_Partner_Report('indiscore3', $siren, $login, $password); + $report = new Scores_Partner_Report('indiscore3', $siren, $this->pLogin, $this->pPassword); $html = $report->getContent(); if ( $html !== false ) { @@ -582,10 +581,10 @@ class ReportController extends Zend_Controller_Action if ( $row !== null ) { $c = Zend_Registry::get('config'); - $html = $c->profil->path->pages . DIRECTORY_SEPARATOR . $row->cmdId . '.html'; + $html = $c->profil->path->pages . '/' . $row->cmdId . '.html'; //Save the HTML file - copy($html, $c->profil->path->data . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR . $id.'.html'); + copy($html, $c->profil->path->data . '/' . $id . '.html'); //Generate the PDF $pdf = new Scores_Wkhtml_Pdf(); @@ -638,8 +637,8 @@ class ReportController extends Zend_Controller_Action //Regen command if ($regen !== null) { - $source = $c->profil->path->data . DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . $cmdId . 'html'; - $dest = $c->profil->path->pages . DIRECTORY_SEPARATOR . $cmdId . '.html'; + $source = $c->profil->path->data . '/' . $cmdId . 'html'; + $dest = $c->profil->path->pages . '/' . $cmdId . '.html'; copy($source, $dest); //Generate the PDF @@ -649,7 +648,7 @@ class ReportController extends Zend_Controller_Action //Serve the file $path = $c->profil->path->pages; - $file = $path . DIRECTORY_SEPARATOR . $cmdId . '.pdf'; + $file = $path . '/' . $cmdId . '.pdf'; if( file_exists($file) && filesize($file)>0 ) { header('Content-Transfer-Encoding: none'); header('Content-type: application/pdf'); diff --git a/library/Scores/Partner/Report/Html.php b/library/Scores/Partner/Report/Html.php index ad4e37c..dbff22b 100644 --- a/library/Scores/Partner/Report/Html.php +++ b/library/Scores/Partner/Report/Html.php @@ -31,4 +31,9 @@ class Scores_Partner_Report_Html extends Scores_Partner_Report_Helpers { $this->{$name} = $value; } + + public function translate($txt) + { + return $txt; + } } \ No newline at end of file diff --git a/library/Scores/WsScores.php b/library/Scores/WsScores.php index 54cf0a6..b4a579e 100644 --- a/library/Scores/WsScores.php +++ b/library/Scores/WsScores.php @@ -2674,6 +2674,7 @@ class WsScores } return $reponse->getIdentiteLightResult; } catch (SoapFault $fault) { + print_r($fault); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -3037,7 +3038,7 @@ class WsScores } } } - + /** * getScoreHistorique pour les derniers 5 ans * @param string $siret diff --git a/library/Scores/webservices.ini b/library/Scores/webservices.ini index 8f8ad7c..7972d15 100644 --- a/library/Scores/webservices.ini +++ b/library/Scores/webservices.ini @@ -1,29 +1,29 @@ [local] -webservices.interne.wsdl = "http://webservice-2.6.sd.dev/interne/v0.6?wsdl-auto" +webservices.interne.wsdl = "http://webservice-2.7.sd.dev/interne/v0.6?wsdl-auto" webservices.interne.options.soap_version = SOAP_1_2 -webservices.entreprise.wsdl = "http://webservice-2.6.sd.dev/entreprise/v0.8?wsdl-auto" +webservices.entreprise.wsdl = "http://webservice-2.7.sd.dev/entreprise/v0.8?wsdl-auto" webservices.entreprise.options.soap_version = SOAP_1_2 -webservices.gestion.wsdl = "http://webservice-2.6.sd.dev/gestion/v0.3?wsdl-auto" +webservices.gestion.wsdl = "http://webservice-2.7.sd.dev/gestion/v0.3?wsdl-auto" webservices.gestion.options.soap_version = SOAP_1_2 -webservices.saisie.wsdl = "http://webservice-2.6.sd.dev/saisie/v0.2?wsdl-auto" +webservices.saisie.wsdl = "http://webservice-2.7.sd.dev/saisie/v0.2?wsdl-auto" webservices.saisie.options.soap_version = SOAP_1_2 -webservices.pieces.wsdl = "http://webservice-2.6.sd.dev/pieces/v0.1?wsdl-auto" +webservices.pieces.wsdl = "http://webservice-2.7.sd.dev/pieces/v0.1?wsdl-auto" webservices.pieces.options.soap_version = SOAP_1_2 -webservices.catalog.wsdl = "http://webservice-2.6.sd.dev/catalog/v0.1?wsdl-auto" +webservices.catalog.wsdl = "http://webservice-2.7.sd.dev/catalog/v0.1?wsdl-auto" webservices.catalog.options.soap_version = SOAP_1_2 [sdsrvdev01] -webservices.interne.wsdl = "http://webservice-2.6.sd.lan/interne/v0.6?wsdl-auto" +webservices.interne.wsdl = "http://webservice-2.7.sd.lan/interne/v0.6?wsdl-auto" webservices.interne.options.soap_version = SOAP_1_2 -webservices.entreprise.wsdl = "http://webservice-2.6.sd.lan/entreprise/v0.8?wsdl-auto" +webservices.entreprise.wsdl = "http://webservice-2.7.sd.lan/entreprise/v0.8?wsdl-auto" webservices.entreprise.options.soap_version = SOAP_1_2 -webservices.gestion.wsdl = "http://webservice-2.6.sd.lan/gestion/v0.3?wsdl-auto" +webservices.gestion.wsdl = "http://webservice-2.7.sd.lan/gestion/v0.3?wsdl-auto" webservices.gestion.options.soap_version = SOAP_1_2 -webservices.saisie.wsdl = "http://webservice-2.6.sd.lan/saisie/v0.2?wsdl-auto" +webservices.saisie.wsdl = "http://webservice-2.7.sd.lan/saisie/v0.2?wsdl-auto" webservices.saisie.options.soap_version = SOAP_1_2 -webservices.pieces.wsdl = "http://webservice-2.6.sd.lan/pieces/v0.1?wsdl-auto" +webservices.pieces.wsdl = "http://webservice-2.7.sd.lan/pieces/v0.1?wsdl-auto" webservices.pieces.options.soap_version = SOAP_1_2 -webservices.catalog.wsdl = "http://webservice-2.6.sd.lan/catalog/v0.1?wsdl-auto" +webservices.catalog.wsdl = "http://webservice-2.7.sd.lan/catalog/v0.1?wsdl-auto" webservices.catalog.options.soap_version = SOAP_1_2 [sd-25137]