/**
  * Render invoice PDF
  *
  * @param void
  * @return null
  */
 function pdf()
 {
     if ($this->active_invoice->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     if ($this->active_invoice->getStatus() == INVOICE_STATUS_DRAFT) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     require_once INVOICING_MODULE_PATH . '/models/InvoicePdf.class.php';
     InvoicePDF::download($this->active_invoice, lang('#:invoice_id.pdf', array('invoice_id' => $this->active_invoice->getName())));
     die;
 }
 /**
  * Show PDF file
  *
  * @param void
  * @return null
  */
 function pdf()
 {
     if ($this->active_invoice->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     if (!$this->active_invoice->canView($this->logged_user)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     require_once INVOICING_MODULE_PATH . '/models/InvoicePdf.class.php';
     InvoicePDF::download($this->active_invoice, lang(':invoice_id.pdf', array('invoice_id' => $this->active_invoice->getName())));
     die;
 }