diff --git a/application/controllers/ReportController.php b/application/controllers/ReportController.php index 554809f..c41ab72 100644 --- a/application/controllers/ReportController.php +++ b/application/controllers/ReportController.php @@ -436,6 +436,7 @@ class ReportController extends Zend_Controller_Action public function pdfAction() { $this->_helper->layout()->disableLayout(); + $this->_helper->viewRenderer->setNoRender(true); $request = $this->getRequest(); @@ -489,11 +490,14 @@ class ReportController extends Zend_Controller_Action */ public function getcmdAction() { + $this->_helper->layout()->disableLayout(); + $this->_helper->viewRenderer->setNoRender(true); + $request = $this->getRequest(); $cmdId = $request->getParam('id'); $c = Zend_Registry::get('config'); - $path = $c->profil->path->data; + $path = $c->profil->path->pages; $auth = Zend_Auth::getInstance(); @@ -524,6 +528,9 @@ class ReportController extends Zend_Controller_Action */ public function billAction() { + $this->_helper->layout()->disableLayout(); + $this->_helper->viewRenderer->setNoRender(true); + $request = $this->getRequest(); $cmdId = $request->getParam('id'); $regen = $request->getParam('regen'); @@ -549,7 +556,10 @@ class ReportController extends Zend_Controller_Action //Prepare information in database if ( $bill === null ) { + $lastItemSql = $billM->select()->order('id DESC')->limit(1); + $lastItem = $billM->fetchRow($lastItemSql); $NumCmd = $billM->insert(array( + 'id' => $lastItem->id+1, 'cmdId' => $cmdId, )); } elseif ( $bill !== null && $regen !== null ) { @@ -631,11 +641,6 @@ class ReportController extends Zend_Controller_Action $pdf->save($path.$file); $billM->update(array('file' => $file), 'id='.$NumCmd); - - /** -ALTER TABLE `command` ADD `mt` FLOAT NOT NULL COMMENT 'Montant Hors taxes' AFTER `cmdId` , -ADD `tax` FLOAT NOT NULL COMMENT 'Taux de taxe' AFTER `mt` ; - */ } //Distribuer la facture else {