<?php
 if ($reportFilters['operationType'] and count($reportFilters['operationType'])==3) { $reportFilters['operationType'] = []; } $reportFilters['operationDate']['startDate'] = standard2mysqlDateConversion($reportFilters['operationDate']['startDate']); $reportFilters['operationDate']['endDate'] = standard2mysqlDateConversion($reportFilters['operationDate']['endDate']); $reportFilters['impServSystem'] = array_keys((array)$reportFilters['impServSystem']); $reportFilters['offerFormOfPayment'] = array_keys((array)$reportFilters['offerFormOfPayment']); if (count($reportFilters['offerFormOfPayment'])==count($CFG['offers']['formOfPaymentList'])+1) { $reportFilters['offerFormOfPayment'] = []; } $reportFilters['orderDate']['startDate'] = standard2mysqlDateConversion($reportFilters['orderDate']['startDate']); $reportFilters['orderDate']['endDate'] = standard2mysqlDateConversion($reportFilters['orderDate']['endDate']); $reportFilters['offerStartDate']['startDate'] = standard2mysqlDateConversion($reportFilters['offerStartDate']['startDate']); $reportFilters['offerStartDate']['endDate'] = standard2mysqlDateConversion($reportFilters['offerStartDate']['endDate']); $reportFilters['servicePassenger'] = $reportFilters['servicePassenger']['id']; list($reportFilters['impServBookUserOffice']['idOffice'], $reportFilters['impServBookUserOffice']['idUser']) = explode('|', $reportFilters['impServBookUserOffice']['id']); list($reportFilters['impServIssueUserOffice']['idOffice'], $reportFilters['impServIssueUserOffice']['idUser']) = explode('|', $reportFilters['impServIssueUserOffice']['id']); list($reportFilters['servUserOffice']['idOffice'], $reportFilters['servUserOffice']['idUser']) = explode('|', $reportFilters['servUserOffice']['id']); $reportFilters['offerSupplier'] = $reportFilters['offerSupplier']['id']; list($reportFilters['offerDestination']['countryCode'], $reportFilters['offerDestination']['cityId']) = explode('|', $reportFilters['offerDestination']['id']); $reportFilters['invoiceDate']['startDate'] = standard2mysqlDateConversion($reportFilters['invoiceDate']['startDate']); $reportFilters['invoiceDate']['endDate'] = standard2mysqlDateConversion($reportFilters['invoiceDate']['endDate']); $reportFilters['invoiceCorporate'] = $reportFilters['invoiceCorporate']['id']; $reportFilters['invoiceCustomer'] = $reportFilters['invoiceCustomer']['id']; $reportExtraFilters = []; if ($reportFilters['invoiceCorporate']) { $reportExtraFilters['invoiceCorporate'] = \Entity\Corporate::select($reportFilters['invoiceCorporate'])->fullDuplicatedCorporatesGroup; } if ($reportFilters['invoiceCustomer']) { $reportExtraFilters['invoiceCustomer'] = \Entity\Customer::select($reportFilters['invoiceCustomer'])->fullDuplicatedCustomersGroup; } if ($reportFilters['corporateGroups']) { $reportFilters['corporateGroups'] = $reportFilters['corporateGroups']['d']; } if ($reportFilters['corporateGroups']) { $corporateGroupsHelper = new \App\ReportsData\Helpers\PartnerGroups\Corporate(); $corporateGroupsHelper->setGroupElementsLinear($reportFilters['corporateGroups']); $reportExtraFilters['corporatesInGroups'] = $corporateGroupsHelper->getPartnerIdsList(); } if ($reportFilters['supplierGroups']) { $reportFilters['supplierGroups'] = $reportFilters['supplierGroups']['d']; } if ($reportFilters['supplierGroups']) { $supplierGroupsHelper = new \App\ReportsData\Helpers\PartnerGroups\Supplier(); $supplierGroupsHelper->setGroupElementsLinear($reportFilters['supplierGroups']); $reportExtraFilters['suppliersInGroups'] = $supplierGroupsHelper->getPartnerIdsList(); } $availableTableColumns = array_keys($tableColumns); try { include(__DIR__."/reportData_initialImport.php"); include(__DIR__."/reportData_otherFields.php"); include(__DIR__."/reportData_loopRecords.php"); } catch (\DBException $e) { killReport(sprintf("Could not run SQL in report. SQL error: %s.", $e->getMessage())); } catch (\Exception $e) { killReport("Could not process report. Error: ".$e->getMessage()); } 