public function vatAction() { $auth = $this->getServiceLocator()->get('zfcuser_auth_service'); $user = $auth->getIdentity(); $view = new ViewModel(); $form = $this->getServiceLocator()->get('Application\\Form\\VatUom')->init(); $form->setVatValidation(); $vats = $this->settingsService->getAllVats($user); $view->messages = $this->flashMessenger()->getMessages(); $view->form = $form; $view->vats = $vats; $view->tab = 'vat'; return $view; }
private function getVatValues() { $results = array(); foreach ($this->settingsService->getAllVats($this->user) as $vat) { $results[$vat->getId()] = $vat->getCode(); } return $results; }
private function addInvoiceRowToView(ViewModel $view, Row $row = null) { $auth = $this->getServiceLocator()->get('zfcuser_auth_service'); $user = $auth->getIdentity(); $view->setTemplate('application/document/partial/row'); $view->uoms = $this->settingsService->getAllUoms($user); $view->vats = $this->settingsService->getAllVats($user); if ($row != null) { $view->price = $row->getPrice(); $view->code = $row->getCode(); $view->name = $row->getName(); $view->description = $row->getDescription(); $view->quantity = $row->getQuantity(); $view->rowId = $row->getId(); $view->selectedUom = $row->getUom(); $view->selectedVat = $row->getVat(); $view->selectedArticle = $row->getArticle(); $view->selectedWarehouse = $row->getWarehouse(); $view->amount = $row->getAmount(); $view->vatAmount = $row->getVatAmount(); $view->vatValue = $row->getVatValue(); } return $view; }