public function generateReport() { $report = new SimpleListReport(); $content = array(); $i = 0; $purchaseOrders = $this->getPurchaseOrderCollection(); $purchaseOrderEntryCollection = $this->getPurchaseOrderEntryCollection(); $purchaseOrderLogCollection = $this->getPurchaseOrderLogCollection(); $folioImportLogCollection = $this->getFolioImportLogCollection(); $requisitionLogCollection = $this->getRequisitionLogCollection(); $requisitionEntryCollection = $this->getRequisitionEntryCollection(); $proformaInvoiceEntryCollection = $this->getProformaInvoiceEntryCollection(); while ($purchaseOrder = $purchaseOrders->read()) { $purchaseOrderEntries = $purchaseOrderEntryCollection->filterByPurchaseOrderPk($purchaseOrder->getIdPurchaseOrder()); $proformaInvoiceIds = $purchaseOrderEntries->getDisctinctProformaInvoiceIds(); $proformaInvoiceLogs = $this->getProformaInvoiceLogCollection()->filterByProformaInvoicesIds($proformaInvoiceIds); $proformaInvoiceEntries = $proformaInvoiceEntryCollection->filterByProformaInvoiceIds($proformaInvoiceIds); $requisitionEntries = $requisitionEntryCollection->filterByRequisitionEntryIds($proformaInvoiceEntries->getDistinctRequisitionEntryIdsToArray()); $requisitionLogs = $requisitionLogCollection->filterByRequisitionIds($requisitionEntries->getDistinctRequisitions()); $inspections = $this->getInspectionCollection()->filterByProformaInvoiceIds($proformaInvoiceIds); $purchaseOrderLogs = $purchaseOrderLogCollection->getByIdPurchaseOrder($purchaseOrder->getIdPurchaseOrder()); $folioImportLogs = $folioImportLogCollection->filterByIdFolioImport(array($purchaseOrder->getIdFolioImport())); $proformaInvoiceEntryLogs = $this->getProformaInvoiceEntryLogCollection()->filterByProformaInvoiceIds($proformaInvoiceIds); $proformaInvoiceIds = implode(', ', $proformaInvoiceIds); $uploadPIDate = ''; $uploadAuthorizedPIDate = ''; $endOfProductionDate = ''; $inspectionScheduleDate = ''; $inspectionRateDate = ''; $purchaseOrderDate = ''; $documentUploadDate = ''; $readyToShipmentDate = ''; $documentsUploadDate = ''; $folioImportDate = ''; $receiptDate = ''; while ($proformaInvoiceLog = $proformaInvoiceLogs->read()) { if ($proformaInvoiceLog->getEventType() == ProformaInvoiceLog::$EventTypes['Create']) { $uploadPIDate .= 'PI# ' . $proformaInvoiceLog->getIdProformaInvoice() . ' - ' . $proformaInvoiceLog->getDate() . "\n"; } if ($proformaInvoiceLog->getEventType() == ProformaInvoiceLog::$EventTypes['Autorized']) { $uploadAuthorizedPIDate .= 'PI# ' . $proformaInvoiceLog->getIdProformaInvoice() . ' - ' . $proformaInvoiceLog->getDate() . "\n"; } } while ($inspection = $inspections->read()) { $inspectionScheduleDate .= $inspection->getPlannedDate() . "\n"; $inspectionRateDate .= $inspection->getDateOn() . "\n"; } while ($proformaInvoiceEntryLog = $proformaInvoiceEntryLogs->read()) { $endOfProductionDate .= 'PI#' . $proformaInvoiceEntryLog->getIdProformaInvoice() . ' Line: ' . $proformaInvoiceEntryLog->getIdProformaInvoiceEntry() . ' - ' . $proformaInvoiceEntryLog->getDate() . "\n"; } $createLog = $purchaseOrderLogs->filterByEvent(PurchaseOrderLog::$EventTypes['Create'])->getOne(); $commercialInvoiceLog = $purchaseOrderLogs->filterByEvent(PurchaseOrderLog::$EventTypes['UploadCI'])->getOne(); $bLLog = $purchaseOrderLogs->filterByEvent(PurchaseOrderLog::$EventTypes['UploadBL'])->getOne(); $readyToShipmentLog = $purchaseOrderLogs->filterByEvent(PurchaseOrderLog::$EventTypes['ReadyToShipment'])->getOne(); $folioImportCreationLog = $folioImportLogs->filterByEventType(FolioImportLog::$EventTypes['Create'])->getOne(); $receiptDateLog = $folioImportLogs->filterByEventType(FolioImportLog::$EventTypes['CloseFrontpage'])->getOne(); if ($commercialInvoiceLog) { $documentsUploadDate .= 'Commercial Invoice Date - ' . $commercialInvoiceLog->getDate() . "\n"; } if ($bLLog) { $documentsUploadDate .= 'BL Date - ' . $bLLog->getDate() . "\n"; } // $content[$i][] = '';//RQ // $content[$i][] = '';//CreationDate // $content[$i][] = '';//ApprovalDate // $content[$i][] = '';//BenchmarkingDate // $content[$i][] = '';//AutorizedPriceDate $content[$i][] = $proformaInvoiceIds; $content[$i][] = $uploadPIDate; $content[$i][] = $uploadAuthorizedPIDate; $content[$i][] = $endOfProductionDate; $content[$i][] = $inspectionScheduleDate; $content[$i][] = $inspectionRateDate; $content[$i][] = $purchaseOrder->getSapDocumentNumber(); $content[$i][] = $createLog ? $createLog->getDate() : ''; $content[$i][] = $documentsUploadDate; $content[$i][] = $readyToShipmentLog ? $readyToShipmentLog->getDate() : ''; $content[$i][] = $purchaseOrder->getIdFolioImport() && $purchaseOrder->getIdFolioImport() != -1 ? $purchaseOrder->getIdFolioImport() : ''; $content[$i][] = $folioImportCreationLog ? $folioImportCreationLog->getDate() : ''; $content[$i][] = $receiptDateLog ? $receiptDateLog->getDate() : ''; $i++; } $report->setTableHeaders(self::$headers); $report->setTableContent($content); $now = new \Zend_Date(); $report->setFilename('purchase-order-tracking-report' . $now->get('yyyy-MM-dd')); $report->createSpreadsheet(); }
public function exportToExcelAction() { $params = $this->getRequest()->getParams(); if (!empty($params['username'])) { $params['username'] = '******' . $params['username'] . '%'; } $query = UserQuery::create()->filter($params)->find(); $headers = array('ID', 'Access Role', 'Username', 'Name', 'Second Name', 'Last Name', 'Status'); foreach ($query as $key => $object) { $content[$key][] = $object->getIdUser(); $content[$key][] = AccessRoleQuery::create()->findByPK($object->getIdAccessRole())->getName(); $content[$key][] = utf8_encode($object->getUsername()); $content[$key][] = utf8_encode($object->getName()); $content[$key][] = utf8_encode($object->getSecondName()); $content[$key][] = utf8_encode($object->getLastName()); $content[$key][] = $object->getStatusName(); } $title = $this->i18n->_('Users Report'); $filename = 'users_report'; $report = new SimpleListReport(); $report->setTableHeaders($headers); $report->setTableContent($content); $report->setTableTitle($title); $report->setFilename($filename); // $report->setTableColumnsWidth($columsWidth); $report->createSpreadsheet(); }
/** * */ public function exportToExcelSentSamplesAction() { $params = $this->getRequest()->getParams(); $sampleShipmentQuery = SampleShipmentQuery::create()->addDescendingOrderBy(SampleShipment::ID_SAMPLE_SHIPMENT)->filter($params)->find(); $i = 1; while ($sampleShipment = $sampleShipmentQuery->read()) { $content[$i] = array('Guide', $sampleShipment->getGuide(), '', '', '', '', ''); $i++; $content[$i] = array('Courier', $sampleShipment->getCourier(), '', '', '', '', ''); $i++; $content[$i] = array('Shipment Date', $sampleShipment->getShipmentDate(), '', '', '', '', ''); $i++; $content[$i] = array('Notes', $sampleShipment->getNote(), '', '', '', '', ''); $i++; $content[$i] = array('', '', '', '', '', '', ''); $i++; $content[$i] = array('Id Npd Sheet', 'Description', 'Supplier', 'Color', 'Quantity', 'Cost', 'Ammount'); $i++; $sampleQuery = SampleQuery::create()->whereAdd(Sample::ID_SAMPLE_SHIPMENT, $sampleShipment->getIdSampleShipment())->find(); while ($sample = $sampleQuery->read()) { $npd = NpdSheetQuery::create()->findByPK($sample->getIdNpdSheet()); if (ColorQuery::create()->whereAdd(Color::ID_COLOR, $sample->getIdColor())->count()) { $color = ColorQuery::create()->findByPK($sample->getIdColor()); } else { $color = new Color(); $color->setName('Any'); } $content[$i] = array($sample->getIdNpdSheet(), $npd->getDescription(), $sample->getIdSupplier(), $color->getName(), $sample->getQuantity(), '$' . number_format($sample->getCost(), 4) . $npd->getIdCurrency(), '$' . number_format($sample->getTotalAmmount(), 4) . $npd->getIdCurrency()); $i++; } $content[$i] = array('', '', '', '', '', 'Total', '$' . number_format($sampleQuery->getTotalAmmount(), 4) . $npd->getIdCurrency()); $i++; $content[$i] = array('', '', '', '', '', '', ''); $i++; $content[$i] = array('', '', '', '', '', '', ''); $i++; } $header = array('', '', '', '', '', '', ''); $tableColumnsWidth = array('small', 'medium', 'small', 'small', 'small', 'medium', 'medium'); // $content $title = $this->i18n->_('Sent Samples Report'); $fileName = $this->i18n->_('sent_samples_report'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($content); $report->setTableColumnsWidth($tableColumnsWidth); $report->setFilename($fileName); $report->createSpreadsheet(); }
/** * */ public function exportToExcelAction() { $params = $this->getRequest()->getParams(); $customsCodes = CustomsTariffCodeQuery::create()->filter($params)->find(); //die(print_r($post)); if (!$customsCodes->isEmpty()) { $i = 1; while ($customsCode = $customsCodes->read()) { $data[$i] = array($customsCode->getCode(), $customsCode->getName(), $customsCode->getPercent(), $customsCode->getStatusName()); $i++; } $header = array($this->i18n->_('Code'), $this->i18n->_('Description'), $this->i18n->_('Percent'), $this->i18n->_('Status')); $title = $this->i18n->_('Custom Codes'); $fileName = $this->i18n->_('Custom Codes Report'); $tableColumnsWidth = array('mini'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->setTableColumnsWidth($tableColumnsWidth); $report->createSpreadsheet(); } else { $filter = $this->createFilterForUrl($post); $this->setFlash("error", $this->i18n->_('No records')); $this->_redirect('customs-tariff-code/list'); } }
/** * * Enter description here ... */ public function exportToExcelAction() { $params = $this->getRequest()->getParams(); $params['name'] = urldecode($this->getRequest()->getParam('name')); $params['code'] = urldecode($this->getRequest()->getParam('code')); $colors = ColorQuery::create()->filter($params)->find(); if (!$colors->isEmpty()) { $i = 1; while ($color = $colors->read()) { $data[$i] = array($color->getCode(), $color->getName(), $color->getStatusName()); $i++; } $header = array($this->i18n->_('Code'), $this->i18n->_('Name'), $this->i18n->_('Status')); $title = $this->i18n->_('Colors Report'); $fileName = $this->i18n->_('Colors_report'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->createSpreadsheet(); } else { $filter = $this->createFilterForUrl($params); $this->setFlash("error", $this->i18n->_('No records')); $this->_redirect('color/list'); } }
/** * */ public function exportToExcelAction() { $post = $this->getRequest()->getParams(); $inspectors = InspectorQuery::create()->filter($post)->find(); if (!$inspectors->isEmpty()) { $i = 1; while ($inspector = $inspectors->read()) { $person = InspectorQuery::create()->innerJoinPerson()->addColumn('Person.*')->whereAdd('Person.id_person', $inspector->getIdPerson())->findOne(); $data[$i] = array($inspector->getUsername(), $person->getName(), $person->getLastName(), $person->getSecondName(), $inspector->getStatusName()); $i++; } $header = array($this->i18n->_('Username'), $this->i18n->_('Name'), $this->i18n->_('Last Name'), $this->i18n->_('Second Name'), $this->i18n->_('Status')); $title = $this->i18n->_('Inspector Report'); $fileName = $this->i18n->_('Inspector_report'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->createSpreadsheet(); } else { $filter = $this->createFilterForUrl($post); $this->setFlash("warning", $this->i18n->_('No records found')); $this->_redirect('inspector/list'); } }
/** * @author joseluis */ public function exportToExcelAction() { $params = $this->getRequest()->getParams(); $params['name'] = '%' . $params['name'] . '%'; $values = RespondentQuery::create()->filter($params)->find(); $report = new SimpleListReport(); $i = 0; $content = array(); while ($value = $values->read()) { $content[$i][] = $value->getIdRespondent(); $content[$i][] = $value->getName(); $content[$i][] = $value->getCompanyName(); $content[$i][] = SapSupplier::$customerProfile[$value->getProfile()] ? SapSupplier::$customerProfile[$value->getProfile()] : $this->i18n->_('Without Profile'); $content[$i][] = $value->getGenders(); $i++; } $headers = array('Id', 'Name', 'Customer Number', 'Profile', 'Gender'); $tableTitle = $this->i18n->_('Focus Group Participants Report'); $filename = 'focus_group_participants_report'; $report->setTableContent($content); $report->setTableHeaders($headers); $report->setTableTitle($tableTitle); $report->setFilename($filename); $report->createSpreadsheet(); }
/** * */ public function exportToExcelAction() { $post['status'] = $this->getRequest()->getParam('status'); $post['name'] = "%" . utf8_decode($this->getRequest()->getParam('name')) . "%"; $forwarders = ForwarderQuery::create()->filter($post)->find(); if (!$forwarders->isEmpty()) { $i = 1; while ($forwarder = $forwarders->read()) { $data[$i] = array($forwarder->getIdForwarder(), $forwarder->getName(), $forwarder->getStatusName()); $i++; } $header = array($this->i18n->_('ID'), $this->i18n->_('Name'), $this->i18n->_('Status')); $title = $this->i18n->_('Forwarders Report'); $fileName = $this->i18n->_('Forwarders_report'); $tableColumnsWidth = array('mini'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->setTableColumnsWidth($tableColumnsWidth); $report->createSpreadsheet(); } else { $filter = $this->createFilterForUrl($post); $this->setFlash("warning", $this->i18n->_('No records were found')); $this->_redirect('forwarder/list'); } }
/** * */ public function exportToExcelAction() { $post['name'] = utf8_decode($this->getRequest()->getParam('name')); $post['name'] = '%' . $post['name'] . '%'; $post['status'] = $this->getRequest()->getParam('status'); $post['sap_id_bussiness_associate'] = $this->getRequest()->getParam('sap_id_bussiness_associate') . '%'; $customsBrokers = CustomsBrokerQuery::create()->filter($post)->find(); if (!$customsBrokers->isEmpty()) { $i = 1; while ($customsBroker = $customsBrokers->read()) { $address = AddressQuery::create()->innerJoinCompany()->whereAdd('Address2Company.id_company', $customsBroker->getIdCompany())->find()->getOne(); $company = CompanyQuery::create()->innerJoinAddress()->whereAdd('Company2Address.id_company', $customsBroker->getIdCompany())->find()->getOne(); $country = \Application\Query\CountryQuery::create()->whereAdd(\Application\Model\Bean\Country::CODE, $address->getCountry())->find()->getOne(); $data[$i] = array($company->getSapIdBussinessassociate(), $customsBroker->getName(), $country ? $country->getName() : null, $address->getState(), $address->getStreet(), $address->getSettlement(), $address->getDistrict(), $address->getCity(), $address->getZipCode(), $customsBroker->getStatusName()); $i++; } $header = array($this->i18n->_('SAP ID Business Associate'), $this->i18n->_('Name'), $this->i18n->_('Country'), $this->i18n->_('State'), $this->i18n->_('Street'), $this->i18n->_('Settlement'), $this->i18n->_('District'), $this->i18n->_('City'), $this->i18n->_('Zip Code'), $this->i18n->_('Status')); $title = $this->i18n->_('Customs Brokers Report'); $filename = 'customs_brokers_report'; $customsBrokersReport = new SimpleListReport(); $customsBrokersReport->setTableHeaders($header); $customsBrokersReport->setTableContent($data); $customsBrokersReport->setTableTitle($title); $customsBrokersReport->setFilename($filename); $customsBrokersReport->createSpreadsheet(); } else { $filter = $this->createFilterForUrl($post); $this->setFlash("error", $this->i18n->_('No records')); $this->_redirect('customs-broker/list'); } }
/** * */ public function exportToExcelAction() { $params = $this->getRequest()->getParams(); $productGroupQuery = ProductGroupQuery::create()->filter($params)->find(); $headers = array('Name', 'Code', 'Status'); foreach ($productGroupQuery as $key => $productGroup) { $content[$key][] = utf8_encode($productGroup->getName()); $content[$key][] = $productGroup->getCode(); $content[$key][] = $productGroup->getStatusName(); } $title = $this->i18n->_('Product Groups Report'); $filename = 'product_groups_report'; $report = new SimpleListReport(); $report->setTableHeaders($headers); $report->setTableContent($content); $report->setTableTitle($title); $report->setFilename($filename); $report->createSpreadsheet(); }
/** * */ public function exportToExcelAction() { $params = $this->getRequest()->getParams(); if (!empty($params['name'])) { $params['name'] = '%' . $params['name'] . '%'; } $query = WarehouseQuery::create()->filter($params)->find(); $report = new SimpleListReport(); $columnsWidth = array('', 'biggest', ''); $headers = array('ID', 'Name', 'Status'); foreach ($query as $key => $object) { $content[$key][] = $object->getIdWarehouse(); $content[$key][] = utf8_encode($object->getName()); $content[$key][] = $object->getStatusName(); } $title = $this->i18n->_('Warehouses Report'); $filename = 'warehouses_report'; $report->setTableHeaders($headers); $report->setTableContent($content); $report->setTableTitle($title); $report->setFilename($filename); $report->setTableColumnsWidth($columnsWidth); $report->createSpreadsheet(); }
public function exportToExcelAction() { $report = new SimpleListReport(); $params = $this->getRequest()->getParams(); $productPrintingAreas = ProductPrintingAreaQuery::create()->filter($params)->find(); $i = 0; $tableContent = array(); while ($productPrintingArea = $productPrintingAreas->read()) { $productionTimePrintingTechniqueQuery = ProductionTimePrintingTechniqueQuery::create()->whereAdd(ProductionTimePrintingTechnique::ID_PRODUCT_PRINTING_AREA, $productPrintingArea->getIdProductPrintingArea())->find(); $j = 1; while ($productionTimePrintingTechnique = $productionTimePrintingTechniqueQuery->read()) { switch ($j) { case 1: $id_printing_technique = $productionTimePrintingTechnique->getIdPrintingTechnique(); $max_area = $productionTimePrintingTechnique->getMaxArea(); $max_inks = $productionTimePrintingTechnique->getMaxInks(); break; case 2: $id_printing_technique_alternative = $productionTimePrintingTechnique->getIdPrintingTechnique(); $max_area_alternative = $productionTimePrintingTechnique->getMaxArea(); $max_inks_alternative = $productionTimePrintingTechnique->getMaxInks(); break; } if ($j == 2) { break; } $j++; } $product = ProductQuery::create()->findByPK($productPrintingArea->getIdProduct()); $tableContent[$i][] = $productPrintingArea->getIdProduct(); $tableContent[$i][] = $product->getKeyMother(); $tableContent[$i][] = $product->getItemName(); $tableContent[$i][] = $productPrintingArea->getIdEShop(); $tableContent[$i][] = $id_printing_technique; $tableContent[$i][] = $productPrintingArea->getIncludedLogos(); $tableContent[$i][] = $productPrintingArea->getIdPrintingSize(); $tableContent[$i][] = $max_inks; $tableContent[$i][] = $id_printing_technique_alternative; $tableContent[$i][] = $max_inks_alternative; $tableContent[$i][] = $max_area; $tableContent[$i][] = $max_area_alternative; $tableContent[$i][] = $productPrintingArea->getPrintingOrder(); $i++; } $tableHeaders = array('SKU', 'Item', 'Item Name', 'Id E-Shop', 'Printing Technique', 'Included Logos', 'Surface', 'Max Inks', 'Printing Technique Alternative', 'Max Inks Alternative', 'Max Area', 'Max Area Alternative', 'Printing Order'); $report->setTableTitle('Product Printing Area Report'); $report->setTableHeaders($tableHeaders); $report->setTableContent($tableContent); $report->setFilename('product_printing_area_report'); $report->createSpreadsheet(); die; }
public function exportToExcelPendingProductAction() { $post['id_product_group'] = urldecode($this->getRequest()->getParam('id_product_group')); $post['reference'] = urldecode($this->getRequest()->getParam('reference')); $post['status'] = $this->getRequest()->getParam('status'); $npdsheets = NpdSheetQuery::create()->filter($post)->addDescendingOrderBy(NpdSheet::ID_NPD_SHEET)->whereAdd(NpdSheet::STATUS, NpdSheet::$Status['Pending Product'])->find(); if (!$npdsheets->isEmpty()) { $i = 1; while ($npdsheet = $npdsheets->read()) { $productGroup = ProductGroupQuery::create()->whereAdd(ProductGroup::ID_PRODUCT_GROUP, $npdsheet->getIdProductGroup())->findOne(); $family = FamilyQuery::create()->whereAdd(Family::ID_FAMILY, $npdsheet->getIdFamily())->findOne(); $subfamily = SubfamilyQuery::create()->whereAdd(Subfamily::ID_SUBFAMILY, $npdsheet->getIdSubfamily())->findOne(); $npdSupplier = NpdSheetSupplierQuery::create()->innerJoinNpdSheet()->whereAdd('NpdSheetSupplier.id_npd_sheet', $npdsheet->getIdNpdSheet())->find()->getPrimaryKeys(); if ($npdSupplier) { $authorizedPrice = SupplierBudgetQuery::create()->innerJoinNpdSheetSupplier()->whereAdd('SupplierBudget.id_npd_supplier', $npdSupplier, Criteria::IN)->whereAdd('SupplierBudget.is_authorized', 1)->findOne(); } if (!$authorizedPrice) { $authorizedPrice = new SupplierBudget(); } if (NpdSheetSupplierQuery::create()->whereAdd(NpdSheetSupplier::ID_NPD_SUPPLIER, $authorizedPrice->getIdNpdSupplier())->count()) { $npdSupplier = NpdSheetSupplierQuery::create()->whereAdd(NpdSheetSupplier::ID_NPD_SUPPLIER, $authorizedPrice->getIdNpdSupplier())->findOne(); } else { $npdSupplier = null; } if ($npdSupplier) { if (SapSupplierQuery::create()->whereAdd(SapSupplier::ID_SUPPLIER, $npdSupplier->getIdSupplier())->count()) { $supplier = SapSupplierQuery::create()->whereAdd(SapSupplier::ID_SUPPLIER, $npdSupplier->getIdSupplier())->findOne()->getSupplierCardCodeWithCardName(); } } $data[$i] = array($npdsheet->getIdNpdSheet(), $npdsheet->getStatusName(), $npdsheet->getReference(), $npdsheet->getCreationDateAsZendDate()->get('YYYY-MM-dd'), $productGroup->getCode() . '-' . $productGroup->getName(), $family->getCode() . '-' . $family->getName(), $subfamily ? $subfamily->getCode() . '-' . $subfamily->getName() : $this->i18n->_('Not Available'), $npdsheet->getName(), $npdsheet->getPrice(), $authorizedPrice->getPrice(), $supplier ? $supplier : null); $i++; } $header = array($this->i18n->_('ID'), $this->i18n->_('Status'), $this->i18n->_('Reference'), $this->i18n->_('Creation date'), $this->i18n->_('Product Group'), $this->i18n->_('Family'), $this->i18n->_('Subfamily'), $this->i18n->_('Product'), $this->i18n->_('Target Price'), $this->i18n->_('Authorized Price'), $this->i18n->_('Prefered Supplier')); $title = $this->i18n->_('NPDs Report'); $fileName = $this->i18n->_('Npds_report'); $tableColumnsWidth = array('mini'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->setTableColumnsWidth($tableColumnsWidth); $report->createSpreadsheet(); } else { $filter = $this->createFilterForUrl($post); $this->setFlash("warning", $this->i18n->_('No records found')); $this->_redirect('npd-sheet/pending-product'); } }
/** * */ public function exportToExcelAction() { $params = $this->getRequest()->getParams(); $params['name'] = "%" . $params['name'] . "%"; $query = PortCustomQuery::create()->filter($params)->find(); $report = new SimpleListReport(); $headers = array('Code', 'Name', 'International Code', 'Air', 'Ground', 'Sea', 'Country', 'Status'); foreach ($query as $key => $object) { $content[$key][] = $object->getCode(); $content[$key][] = utf8_encode($object->getName()); $content[$key][] = $object->getInternationalCode(); if ($object->getAir() == 1) { $content[$key][] = Symbols::$checkMark; } else { $content[$key][] = Symbols::$crossMark; } if ($object->getGround() == 1) { $content[$key][] = Symbols::$checkMark; } else { $content[$key][] = Symbols::$crossMark; } if ($object->getSea() == 1) { $content[$key][] = Symbols::$checkMark; } else { $content[$key][] = Symbols::$crossMark; } if (CountryQuery::create()->whereAdd(Country::CODE, $object->getIdCountry())->count()) { $content[$key][] = utf8_encode(CountryQuery::create()->findByPK($object->getIdCountry())->getName()); } else { $content[$key][] = $this->i18n->_('Not Available'); } $content[$key][] = $object->getStatusName(); } $title = $this->i18n->_('Ports Report'); $filename = 'ports_report'; $report->setTableHeaders($headers); $report->setTableContent($content); $report->setTableTitle($title); $report->setFilename($filename); // $report->setTableColumnsWidth($columsWidth); $report->createSpreadsheet(); }
/** * */ public function exportToExcelAction() { $params = $this->getRequest()->getParams(); $query = FolioImportQuery::create()->filter($params)->find(); $report = new SimpleListReport(); $headers = array('ID', 'Folio', 'Departure Port', 'Forwarder', 'Destination Port', 'Customs Broker', 'Status'); $i = 0; while ($folioImport = $query->read()) { $content[$i][] = $folioImport->getIdFolioImport(); $content[$i][] = $folioImport->getFolio(); $content[$i][] = PortCustomQuery::create()->findByPK($folioImport->getIdPortDestination())->getName(); $content[$i][] = ForwarderQuery::create()->findByPK($folioImport->getIdForwarder())->getName(); $content[$i][] = PortCustomQuery::create()->findByPK($folioImport->getIdPortCustom())->getName(); $idCustomsBroker = $folioImport->getIdCustomsBroker(); if (!empty($idCustomsBroker)) { $content[$i][] = CustomsBrokerQuery::create()->findByPK($folioImport->getIdCustomsBroker())->getName(); } else { $content[$i][] = 'Not Available'; } $content[$i][] = $folioImport->getStatusName(); $i++; } $title = $this->i18n->_('Folio Import Report'); $filename = 'folio_import_report'; $report->setTableHeaders($headers); $report->setTableContent($content); $report->setTableTitle($title); $report->setFilename($filename); $report->createSpreadsheet(); }
/** * * Enter description here ... */ public function exportToExcelAction() { $post['id_product_group'] = urldecode($this->getRequest()->getParam('id_product_group')); $post['id_family'] = urldecode($this->getRequest()->getParam('id_family')); $post['status'] = $this->getRequest()->getParam('status'); $families = FamilyQuery::create()->filter($post)->find(); if (!$families->isEmpty()) { $i = 1; while ($family = $families->read()) { if (ProductGroupQuery::create()->whereAdd(ProductGroup::ID_PRODUCT_GROUP, $family->getIdProductGroup())->count()) { $productGroup = ProductGroupQuery::create()->whereAdd(ProductGroup::ID_PRODUCT_GROUP, $family->getIdProductGroup())->findOne(); } else { $productGroup = new ProductGroup(); } $data[$i] = array($productGroup->getCode() . '-' . $productGroup->getName(), $family->getName(), $family->getCode(), $family->getStatusName()); $i++; } $header = array($this->i18n->_('Product Group'), $this->i18n->_('Family'), $this->i18n->_('Code'), $this->i18n->_('Status')); $title = $this->i18n->_('Family Report'); $fileName = $this->i18n->_('Family_report'); $tableColumnsWidth = array('medium', 'medium', 'mini'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->setTableColumnsWidth($tableColumnsWidth); $report->createSpreadsheet(); } else { $filter = $this->createFilterForUrl($post); $this->setFlash("error", $this->i18n->_('No records')); $this->_redirect('family/list'); } }
/** * * Enter description here ... */ public function exportToExcelAction() { $post = $this->getRequest()->getParams(); $brands = BrandQuery::create()->filter($post)->find(); if (!$brands->isEmpty()) { $i = 1; while ($brand = $brands->read()) { $data[$i] = array($brand->getCode(), $brand->getName(), $brand->getDataSource(), $brand->getUserSign()); $i++; } $header = array($this->i18n->_('Code'), $this->i18n->_('Name'), $this->i18n->_('DataSource'), $this->i18n->_('UserSign')); $title = $this->i18n->_('Brands Report'); $fileName = $this->i18n->_('Brands_report'); $tableColumnsWidth = array('mini'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->setTableColumnsWidth($tableColumnsWidth); $report->createSpreadsheet(); } else { $filter = $this->createFilterForUrl($post); $this->setFlash("error", $this->i18n->_('No records')); $this->_redirect('brand/list'); } }
public function exportToExcelAction() { $params = $this->getRequest()->getParams(); $printingTechniques = PrintingTechniqueQuery::create()->filter($params)->find(); $tableHeaders = array('id printing Technique', 'Name', 'Code'); $i = 0; $tableContent = array(); while ($printingTechnique = $printingTechniques->read()) { $tableContent[$i][] = $printingTechnique->getIdPrintingTechnique(); $tableContent[$i][] = $printingTechnique->getName(); $tableContent[$i][] = $printingTechnique->getAbbreviation(); $i++; } $tableTitle = "Printing Techniques Report"; $filename = "printing_technique_report"; $report = new SimpleListReport(); $report->setTableTitle($tableTitle); $report->setTableHeaders($tableHeaders); $report->setTableContent($tableContent); $report->setFilename($filename); $report->createSpreadsheet(); die; }
public function exportToExcelAction() { $params = $this->getRequest()->getParams(); $idProductGroup = $params['id_product_group']; $idFamily = $params['id_family']; $familyQuery = FamilyQuery::create()->addColumn(Family::ID_FAMILY); if ($idProductGroup != '' && $idFamily == '') { $idFamilies = FamilyQuery::create()->whereAdd(Family::ID_PRODUCT_GROUP, $idProductGroup)->fetchIds(); $params = array('id_family' => array($idFamilies)); //die(print_r($params)); } if ($idFamily != '' && $idProductGroup != '') { $idFamilies = FamilyQuery::create()->whereAdd(Family::ID_PRODUCT_GROUP, $idProductGroup)->whereAdd(Family::ID_FAMILY, $idFamily)->fetchIds(); if ($idFamilies) { $params = array('id_family' => array($idFamilies)); } else { $params = array('id_family' => array(0)); } } $subfamilyQuery = SubfamilyQuery::create()->filter($params)->find(); $headers = array('Product Group', 'Family', 'Subfamily', 'Code', 'Status'); $content = array(); foreach ($subfamilyQuery as $key => $subfamily) { $family = FamilyQuery::create()->findByPK($subfamily->getIdFamily()); $content[$key][] = ProductGroupQuery::create()->findByPK($family->getIdProductGroup())->getName(); $content[$key][] = $family->getName(); $content[$key][] = $subfamily->getName(); $content[$key][] = $subfamily->getCode(); $content[$key][] = $subfamily->getStatusName(); } $title = $this->i18n->_('Subfamilies Report'); $filename = 'product_groups_report'; $report = new SimpleListReport(); $report->setTableHeaders($headers); $report->setTableContent($content); $report->setTableTitle($title); $report->setFilename($filename); $report->createSpreadsheet(); }
public function exportToExcelAction() { $report = new SimpleListReport(); $params = $this->getRequest()->getParams(); $params['description'] = '%' . $params['description'] . '%'; $warehouseEntranceClaimReports = WarehouseEntranceClaimReportQuery::create()->whereAdd(WarehouseEntranceClaimReport::DESCRIPTION, null, WarehouseEntranceClaimReportQuery::IS_NOT_NULL)->orderBy(WarehouseEntranceClaimReport::ID_WAREHOUSE_ENTRANCE_QUARANTINE_CLAIM_REPORT, WarehouseEntranceClaimReportQuery::DESC)->filter($params)->find(); $i = 0; $tableTitle = 'Claim Report Summary'; $filename = 'claim_report'; $tableHeaders = array('Id Claim Report', 'Invoice Number', 'Description', 'Claimed Amount', 'Final Amount', 'Status'); while ($warehouseEntranceClaimReport = $warehouseEntranceClaimReports->read()) { $tableContent[$i][] = $warehouseEntranceClaimReport->getIdWarehouseEntranceQuarantineClaimReport(); $tableContent[$i][] = $warehouseEntranceClaimReport->getInvoiceNumber(); $tableContent[$i][] = $warehouseEntranceClaimReport->getDescription(); $tableContent[$i][] = $warehouseEntranceClaimReport->getClaimedAmount() ? $warehouseEntranceClaimReport->getClaimedAmount() : 'N/S'; $tableContent[$i][] = $warehouseEntranceClaimReport->getFinalAmount() ? $warehouseEntranceClaimReport->getFinalAmount() : 'N/S'; $tableContent[$i][] = $warehouseEntranceClaimReport->getStatusName(); $i++; } $report->setFilename($filename); $report->setTableContent($tableContent); $report->setTableHeaders($tableHeaders); $report->setTableTitle($tableTitle); $report->createSpreadsheet(); die; }
public function exportToExcelByDateAction() { $filters = $this->getRequest()->getParams(); $programmedPaymentManager = new ProgrammedPaymentManager(); $payments = $programmedPaymentManager->getProgrammedPayments($filters); $condensedProgrammedPayments = $programmedPaymentManager->getCondensedProgrammedPayments($payments); $suppliers = $programmedPaymentManager->getSuppliers($payments); $dates = $condensedProgrammedPayments->getDatesAndIndex("asc"); foreach ($dates as $date) { $pay = $condensedProgrammedPayments->getByPK($date["index"]); $supplier = $suppliers->getByPK($pay->getIdSupplier()); if (!$supplier instanceof SapSupplier) { $supplier = new SapSupplier(); } $data[$i] = array(0 => $paymentArray[$pay->getIdSupplier()][$pay->getCurrency()][0] = $pay->getDueDateAsZendDate() instanceof \Zend_Date ? $pay->getDueDateAsZendDate()->get("yyyy-MM-dd") : $pay->getDueDate(), 1 => $paymentArray[$pay->getIdSupplier()][$pay->getCurrency()][1] = $pay->getTypeName(), 2 => $paymentArray[$pay->getIdSupplier()][$pay->getCurrency()][2] = $pay->getSapDocnum(), 3 => $paymentArray[$pay->getIdSupplier()][$pay->getCurrency()][3] = $supplier->getIndex(), 4 => $paymentArray[$pay->getIdSupplier()][$pay->getCurrency()][4] = $supplier->getName(), 5 => $paymentArray[$pay->getIdSupplier()][$pay->getCurrency()][5] = $pay->getCurrency(), 6 => $paymentArray[$pay->getIdSupplier()][$pay->getCurrency()][6] = $pay->getAmmount(), 7 => $paymentArray[$pay->getIdSupplier()][$pay->getCurrency()][7] = $pay->getCredits(), 8 => $paymentArray[$pay->getIdSupplier()][$pay->getCurrency()][8] = $pay->getPendingBalance()); $i++; } $header = array($this->i18n->_('Due Date'), $this->i18n->_('Document'), $this->i18n->_('Document Number'), $this->i18n->_('Card Code'), $this->i18n->_('Name'), $this->i18n->_('Currency'), $this->i18n->_('Debits'), $this->i18n->_('Credits'), $this->i18n->_('Pending Balance')); $title = $this->i18n->_('Programmed Payment Report (by Date)'); $fileName = $this->i18n->_('programmed_payment_report'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->createSpreadsheet(); }
/** * */ public function exportToExcelAction() { $params = $this->getRequest()->getParams(); // if (!empty($params['rfc'])) // $params['rfc'] = '%'.$params['rfc'].'%'; // $params['id_approval_status'] = $params['status']; // unset($params['status']); $params = $this->getRequest()->getParams(); $query = SapSupplierQuery::create(); $queryCount = SapSupplierQuery::create(); if (!empty($params['name'])) { $query = $query->whereAdd(SapSupplier::CARDNAME, "%" . $params['name'] . "%", SapSupplierQuery::LIKE); $queryCount = $queryCount->whereAdd(SapSupplier::CARDNAME, "%" . $params['name'] . "%", SapSupplierQuery::LIKE); } if (!empty($params['sap_id_bussiness_associate'])) { $query = $query->whereAdd(SapSupplier::CARDCODE, '%' . $params['sap_id_bussiness_associate'] . '%', SapSupplierQuery::LIKE); $queryCount = $queryCount->whereAdd(SapSupplier::CARDCODE, '%' . $params['sap_id_bussiness_associate'] . '%', SapSupplierQuery::LIKE); } if (isset($params['status'])) { $query = $query->whereAdd(SapSupplier::ID_APPROVAL_STATUS, $params['status'], SapSupplierQuery::LIKE); $queryCount = $queryCount->whereAdd(SapSupplier::ID_APPROVAL_STATUS, $params['status'], SapSupplierQuery::LIKE); } $total = $queryCount->count(); $query = $query->whereAdd(SapSupplier::CARDTYPE, SapSupplier::$CardTypes['Supplier'])->find(); $headers = array('Name', 'Payment Term', 'RFC', 'Approval Status'); $content = array(); foreach ($query as $key => $object) { $content[$key][] = utf8_encode($object->getName()); if (PaymentTermQuery::create()->whereAdd(\Application\Model\Bean\PaymentTerm::ID_PAYMENT_TERM, $object->getIdPaymentTerm())->count()) { $content[$key][] = PaymentTermQuery::create()->findByPK($object->getIdPaymentTerm())->getName(); } else { $content[$key][] = $this->i18n->_('Not Available'); } $content[$key][] = $object->getRfc(); $approvalStatus = array_flip(SapSupplier::$IdApprovalStatus); $content[$key][] = $approvalStatus[$object->getIdApprovalStatus()]; } $title = $this->i18n->_('Suppliers Report'); $filename = 'suppliers_report'; $report = new SimpleListReport(); $report->setTableHeaders($headers); $report->setTableContent($content); $report->setTableTitle($title); $report->setFilename($filename); $report->createSpreadsheet(); }
public function exportToExcelAction() { $params = $this->getRequest()->getParams(); if (!empty($params['name'])) { $params['name'] = '%' . $params['name'] . '%'; } $query = PaymentTermQuery::create()->filter($params)->find(); $columnsWidth = array('mini', 'medium', 'biggest', 'small'); $headers = array('ID', 'Name', 'Description', 'Status'); foreach ($query as $key => $object) { $events = PaymentTermQuery::create()->whereAdd('PaymentTerm.' . PaymentTerm::ID_PAYMENT_TERM, $object->getIdPaymentTerm())->addColumns(array('PaymentTerm2Event.percent', 'Event.name'))->innerJoinEvent()->fetchAll(); $paymentTermEvent = ''; foreach ($events as $event) { $paymentTermEvent .= $event['name'] . '-' . $event['percent'] . "% \r"; } $content[$key][] = $object->getIdPaymentTerm(); $content[$key][] = utf8_encode($object->getName()); $content[$key][] = $paymentTermEvent; $content[$key][] = $object->getStatusName(); } $title = $this->i18n->_('Payment Terms Report'); $filename = 'payment_terms_report'; $report = new SimpleListReport(); $report->setTableHeaders($headers); $report->setTableContent($content); $report->setTableTitle($title); $report->setFilename($filename); $report->setTableColumnsWidth($columnsWidth); $report->createSpreadsheet(); }
/** * */ public function exportToExcelQuarantineAction() { $report = new SimpleListReport(); $params = $this->getRequest()->getParams(); $subquery = WarehouseEntranceQuery::create()->whereAdd(WarehouseEntrance::ID_FOLIO_IMPORT, null, WarehouseEntranceQuery::NOT_EQUAL)->whereAdd(WarehouseEntrance::ID_FOLIO_IMPORT, '0', WarehouseEntranceQuery::NOT_EQUAL)->fetchCol(); $warehouseEntryProductQuery = WarehouseEntranceProductQuery::create()->whereAdd(WarehouseEntranceProduct::ID_PURCHASE_ORDER, null, WarehouseEntranceProductQuery::NOT_EQUAL)->whereAdd(WarehouseEntranceProduct::STATUS, WarehouseEntranceProduct::$Status['Quarantine'], WarehouseEntranceProductQuery::EQUAL)->whereAdd(WarehouseEntranceProduct::ID_WAREHOUSE_ENTRANCE, $subquery, WarehouseEntranceProductQuery::IN)->filter($params)->orderBy(WarehouseEntranceProduct::ID_WAREHOUSE_ENTRANCE, 'DESC')->find(); $i = 0; $this->getCatalog('QuarantineCatalog')->beginTransaction(); while ($warehouseEntryLine = $warehouseEntryProductQuery->read()) { $warehouseEntry = WarehouseEntranceQuery::create()->whereAdd(WarehouseEntrance::ID_WAREHOUSE_ENTRANCE, $warehouseEntryLine->getIdWarehouseEntrance())->findOne(); $claimReport = $this->getClaimReport($warehouseEntryLine->getIdWarehouseEntrance(), $warehouseEntryLine->getIdWarehouseEntranceProduct()); $folioImport = $this->getWarehouseEntryFolioImport($warehouseEntry->getIdFolioImport()); $quarantine = $this->getQuarantine($warehouseEntryLine->getIdWarehouseEntrance(), $warehouseEntryLine->getIdWarehouseEntranceProduct()); $product = ProductQuery::create()->findByPK($warehouseEntryLine->getIdProduct()); $warehouseEntryLines[$i][] = $folioImport->getFolio(); $warehouseEntryLines[$i][] = $warehouseEntryLine->getIdPurchaseOrder(); $warehouseEntryLines[$i][] = $product->getItemCode() . ' - ' . $product->getItemName(); if (TransferLineLogQuery::create()->whereAdd(TransferLineLog::BASEENTRY, $warehouseEntryLine->getIdWarehouseEntrance())->whereAdd(TransferLineLog::BASELINE, $warehouseEntryLine->getIdWarehouseEntranceProduct())->count()) { $transferLine = TransferLineLogQuery::create()->whereAdd(TransferLineLog::BASEENTRY, $warehouseEntryLine->getIdWarehouseEntrance())->whereAdd(TransferLineLog::BASELINE, $warehouseEntryLine->getIdWarehouseEntranceProduct())->findOne(); $warehouseEntryLines[$i][] = WarehouseStoreQuery::create()->whereAdd(WarehouseStore::CODE, $transferLine->getWhsCode())->findOne()->getName(); } else { $warehouseEntryLines[$i][] = $this->i18n->_('Not Available'); } $warehouseEntryLines[$i][] = $warehouseEntryLine->getQuantity(); $warehouseEntryLines[$i][] = $currentQuantity = $quarantine->getQuantity(); $warehouseEntryLines[$i][] = $currentQuantity == 0 ? 'Debugged' : 'Quarantine'; $i++; } $tableHeaders = array('Folio Import', 'Doc Entry Purchase Order', 'Description', 'Warehouse', 'Original Quantity', 'Current Quantity', 'Status'); $report->setTableContent($warehouseEntryLines); $report->setTableHeaders($tableHeaders); $report->setFilename('quarantine_report'); $report->setTableTitle('Quarantine Report'); $report->createSpreadsheet(); }
/** * */ public function exportToExcelAction() { $post = $this->getRequest()->getParams(); $post['name'] = "%" . $post['name'] . "%"; $freightTypes = FreightTypeQuery::create()->filter($post)->find(); if (!$freightTypes->isEmpty()) { $i = 1; while ($freightType = $freightTypes->read()) { $data[$i] = array($freightType->getCode(), FreightType::$FreightTypeCombo[$freightType->getType()], $freightType->getName(), $freightType->getMaxLoad(), $freightType->getMinLoad(), $freightType->getPayload(), $freightType->getStatusName()); $i++; } $header = array($this->i18n->_('Code'), $this->i18n->_('Freight Type'), $this->i18n->_('Detail'), $this->i18n->_('Max Load (CBM)'), $this->i18n->_('Min Load (CBM)'), $this->i18n->_('Payload'), $this->i18n->_('Status')); $title = $this->i18n->_('Freight Types Report'); $fileName = $this->i18n->_('Freight_types_report'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->createSpreadsheet(); } else { $filter = $this->createFilterForUrl($post); $this->setFlash("error", $this->i18n->_('No records')); $this->_redirect('freight-type/list'); } }
public function exportToExcelAction() { $params = $this->getRequest()->getParams(); $incoterms = IncotermQuery::create()->filter($params)->find(); $report = new SimpleListReport(); $i = 0; while ($incoterm = $incoterms->read()) { $content[$i][] = $incoterm->getIdIncoterm(); $content[$i][] = $incoterm->getName(); $content[$i][] = $incoterm->getStatusName(); $i++; } $headers = array('Id Incoterm', 'Name', 'Status'); $tableTitle = $this->i18n->_('Incoterm Report'); $filename = 'incoterm_report'; $report->setTableContent($content); $report->setTableHeaders($headers); $report->setTableTitle($tableTitle); $report->setFilename($filename); $report->createSpreadsheet(); }
/** * */ public function exportToExcelAction() { $post = $this->getRequest()->getParams(); $post['id_transit'] = "%" . $post['id_transit'] . "%"; $freightFares = FreightFareQuery::create()->filter($post)->find(); $i = 1; while ($freightFare = $freightFares->read()) { $port = \Application\Query\PortCustomQuery::create()->whereAdd(PortCustom::ID_PORT_CUSTOM, $freightFare->getFobPort())->findOne(); $destination = \Application\Query\PortCustomQuery::create()->whereAdd(PortCustom::ID_PORT_CUSTOM, $freightFare->getDestinationPort())->findOne(); $freightTYpe = FreightTypeQuery::create()->whereAdd(FreightType::ID_FREIGHT_TYPE, $freightFare->getIdFreightType())->findOne(); $forwarder = ForwarderQuery::create()->whereAdd(Forwarder::ID_FORWARDER, $freightFare->getIdForwarder())->findOne(); $currency = \Application\Query\CurrencyQuery::create()->whereAdd(\Application\Model\Bean\Currency::CURRCODE, $freightFare->getIdCurrency())->findOne(); $data[$i] = array($freightFare->getIdFreightFare(), $freightFare->getIdTransit(), $port->getName(), $destination->getName(), $freightTYpe->getName(), $freightFare->getNotes(), $freightFare->getTt(), $freightFare->getFrecuency(), $forwarder->getName(), $freightFare->getGoodThrough(), $freightFare->getUnitName(), $freightFare->getUNitCost(), $freightFare->getPeak(), $freightFare->getStatusName()); $i++; } $header = array($this->i18n->_('ID'), $this->i18n->_('ID-Transit'), $this->i18n->_('FOB Port'), $this->i18n->_('Destination Port'), $this->i18n->_('Freight Type'), $this->i18n->_('Notes'), $this->i18n->_('Transit Time'), $this->i18n->_('Frecuency'), $this->i18n->_('Forwarder'), $this->i18n->_('Good Through'), $this->i18n->_('Unit'), $this->i18n->_('Unit Cost'), $this->i18n->_('Peak/Unit'), $this->i18n->_('Status')); $title = $this->i18n->_('Freight Fares Report'); $fileName = $this->i18n->_('Freight_fares_report'); $tableColumnsWidth = array('mini', 'medium', 'medium', 'medium', 'medium', 'medium', 'medium', 'medium', 'medium', 'medium', 'mini', 'mini', 'mini'); $report = new SimpleListReport(); $report->setTableTitle($title); $report->setTableHeaders($header); $report->setTableContent($data); $report->setFilename($fileName); $report->setTableColumnsWidth($tableColumnsWidth); $report->createSpreadsheet(); }
/** * */ public function exportToExcelAction() { $focusGroups = FocusGroupQuery::create()->find(); $i = 0; while ($focusGroup = $focusGroups->read()) { $content[$i][] = $focusGroup->getIdFocusGroups(); $content[$i][] = $focusGroup->getName(); $content[$i][] = PollQuery::create()->findByPK($focusGroup->getIdPoll())->getName(); $i++; } $title = $this->i18n->_('Focus Group Report'); $filename = 'focus_group_report'; $headers = array('Id Focus Group', 'Name', 'Poll'); $report = new SimpleListReport(); $report->setTableContent($content); $report->setTableHeaders($headers); $report->setTableTitle($title); $report->setFilename($filename); $report->createSpreadsheet(); }