Ejemplo n.º 1
0
 function consultAction()
 {
     $this->_helper->layout->disableLayout();
     //check if the user select a production
     $this->production = new Zend_Session_Namespace('production');
     if ($this->production->id == null) {
         return $this->_helper->_redirector->gotoSimple('index', 'production', 'production');
     }
     $model = new Finances_Model_Invoices();
     $this->view->title = "Consult Invoice";
     $invoice_id = $this->_getParam('id', 1);
     if (!$model->fetchInvoiceBelongProduction($invoice_id, $_SESSION["production"]["id"])) {
         return $this->_helper->_redirector->gotoSimple('index');
     }
     $production_model = new Company_Model_Company();
     Zend_Debug::dump($model->fetchInvoice($invoice_id));
     $this->view->company = $production_model->fetchEntry($_SESSION["company"]["id"]);
     $this->view->client = $model->fetchDatasReceiptEntry($invoice_id);
     $this->view->invoices = $model->fetchInvoice($invoice_id);
 }
Ejemplo n.º 2
0
 public function outlitterAction()
 {
     if ($this->getRequest()->isPost()) {
         $del = $this->getRequest()->getPost('del');
         if ($del == 'Yes') {
             $id = $this->getRequest()->getPost('id');
             $model = new Company_Model_Company();
             $model->outLitter('id = ' . (int) $id);
         }
         return $this->_helper->redirector('index');
     } else {
         $id = $this->_getParam('id', 0);
         if ($id > 0) {
             $model = new Company_Model_Company();
             $this->view->company = $model->fetchEntry($id);
         }
     }
 }