Example #1
0
 public function createInvoiceRowArrayFromInvoiceRow(Document\Row $row)
 {
     $rowArray = array('rowId' => $row->getId(), 'description' => $row->getDescription(), 'code' => $row->getCode(), 'barcode' => $row->getBarCode(), 'name' => $row->getName(), 'price' => $row->getPrice(), 'quantity' => $row->getQuantity(), 'vats' => $this->findAllObjects(Vat::getClass()), 'selectedVat' => $row->getVat(), 'selectedArticle' => $row->getArticle(), 'uoms' => $this->findAllObjects(Uom::getClass()), 'selectedUom' => $row->getUom(), 'amount' => $row->getAmount(), 'warehouses' => $this->getObjectByField(Warehouse::getClass(), array('hidden' => false)), 'selectedWarehouse' => $row->getWarehouse());
     if ($row->getDocument() instanceof Document\CreditInvoice) {
         $rowArray['minCreditQuantity'] = $row->getQuantity();
         $rowArray['creditingRowId'] = $row->getCreditingRowId();
     }
     return $rowArray;
 }
 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;
 }