/** * * @return \Application\Model\Collection\InspectionCollection */ public function getInspectionCollection() { if (!$this->inspectionCollection instanceof InspectionCollection) { $this->inspectionCollection = InspectionQuery::create()->whereAdd(Inspection::ID_PROFORMA_INVOICE, $this->purchaseOrderEntryCollection->getDisctinctProformaInvoiceIds())->find(); } return $this->inspectionCollection; }
public function newPurchaseOrderAction() { $this->view->contentTitle = $this->i18n->_("New Purchase Order"); $this->view->proformasInvoiceEntries = $proformaInvoiceEntries = ProformaInvoiceEntryQuery::create()->whereAdd(ProformaInvoiceEntry::LINE_STATUS, ProformaInvoiceEntry::$LineStatus["Open"])->whereAdd(ProformaInvoiceEntry::STATUS, ProformaInvoiceEntry::$Status["End Production"])->find(); if (!$proformaInvoiceEntries->count()) { $this->setFlash('warning', $this->i18n->_('There are no Proforma Invoice Lines to be consolidated.')); $this->_redirect('purchase-order/list'); } if (!$proformaInvoiceEntries->isEmpty()) { $this->view->inspections = InspectionQuery::create()->whereAdd(Inspection::ID_INSPECTION_TYPE, Inspection::$inspectionsArray["Pre-shipment"])->whereAdd(Inspection::ID_PROFORMA_INVOICE, $proformaInvoiceEntries->getIdProformasInvoice(), InspectionQuery::IN)->find(); $this->view->proformasInvoice = $proformasInvoice = ProformaInvoiceQuery::create()->whereAdd(ProformaInvoice::ID_PROFORMA_INVOICE, $proformaInvoiceEntries->getIdProformasInvoice(), ProformaInvoiceQuery::IN)->find(); $this->view->products = ProductQuery::create()->whereAdd(Product::ITEM_CODE, $proformaInvoiceEntries->getIdProducts(), ProductQuery::IN)->find(); $this->view->suppliers = $suppliers = SapSupplierQuery::create()->whereAdd(SapSupplier::CARDCODE, $proformasInvoice->getDistinctSuppliers(), SapSupplierQuery::IN)->find(); $this->view->courtyards = CourtyardQuery::create()->whereAdd(Courtyard::ID_COURTYARD, $proformasInvoice->getDistinctCourtyards(), CourtyardQuery::IN)->find(); } $this->view->currencies = CurrencyQuery::create()->find(); $this->view->setTpl("Purchase"); }
/** * */ protected function trackingAction() { $id = $this->getRequest()->getParam('id'); $inspection = InspectionQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the Inspection with id {$id}")); $this->view->inspectionLogs = InspectionLogQuery::create()->whereAdd('id_inspection', $id)->find(); $this->view->users = UserQuery::create()->find()->toCombo(); }