function invoice_status_list() { App::import('Model', 'InvoiceManager.InvoiceStatus'); $invoiceStatus = new InvoiceStatus(); $invoiceStatusData = $invoiceStatus->find('list', array('fields' => array('id', 'name'))); return $invoiceStatusData; }
/** * Get invoiceStatus * * @return InvoiceStatuses */ public function getInvoiceStatus() { $status = InvoiceStatus::find($this->invoice_status_id); return $status->name; }
/** * view method * * @param string $id * @return void */ public function listing_report_print($id = null) { $this->layoutOpt['layout'] = 'invoice'; $this->Invoice->id = $id; $this->Invoice->recursive = 1; if (!$this->Invoice->exists()) { throw new NotFoundException(__('Invalid invoice')); } App::import('Model', 'InvoiceManager.InvoiceStatus'); $invoiceStatus = new InvoiceStatus(); $status_list = $invoiceStatus->find('list', array('fields' => array('id', 'name'))); App::import('Model', 'InvoiceManager.InvoiceLog'); $invoiceLog = new InvoiceLog(); $status_log = $invoiceLog->find('all', array('conditions' => array('invoice_id' => $id))); $invoice = $this->Invoice->read(null, $id); $reportDate = date('l, F m, Y'); // debug($invoice); $this->set(compact('invoice', 'status_list', 'status_log', 'reportDate')); }