Example #1
0
 /**
  * printAction
  * Create a pdf invoice document
  * @return void
  */
 public function createinvoiceAction()
 {
     $NS = new Zend_Session_Namespace('Default');
     if (empty($NS->customer['customer_id'])) {
         $this->_helper->redirector('index', 'index', 'default', array('mex' => 'There was an error. The invoice selected has not been found.', 'status' => 'danger'));
     }
     $request = Zend_Controller_Front::getInstance()->getRequest();
     try {
         if (is_numeric($request->id)) {
             if (Invoices::isOwner($request->id, $NS->customer['customer_id'])) {
                 Invoices::PrintPDF($request->id);
             }
         }
     } catch (Exception $e) {
         die($e->getMessage());
     }
     die;
 }