示例#1
0
 private function getUomValues()
 {
     $results = array();
     foreach ($this->settingsService->getAllUoms($this->user) as $value) {
         $results[$value->getId()] = $value->getCode();
     }
     return $results;
 }
 public function uomAction()
 {
     $auth = $this->getServiceLocator()->get('zfcuser_auth_service');
     $user = $auth->getIdentity();
     $view = new ViewModel();
     $form = $this->getServiceLocator()->get('Application\\Form\\VatUom')->init();
     $form->setUomValidation();
     $uoms = $this->settingsService->getAllUoms($user);
     $view->messages = $this->flashMessenger()->getMessages();
     $view->form = $form;
     $view->uoms = $uoms;
     $view->tab = 'uom';
     return $view;
 }
 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;
 }