<?php
 $availableTableColumns = array_keys($tableColumns); $reportFilters['balanceDate']['startDate'] = standard2mysqlDateConversion($reportFilters['balanceDate']['startDate']); $reportFilters['balanceDate']['endDate'] = standard2mysqlDateConversion($reportFilters['balanceDate']['endDate']); $reportFilters['orderDate']['startDate'] = standard2mysqlDateConversion($reportFilters['orderDate']['startDate']); $reportFilters['orderDate']['endDate'] = standard2mysqlDateConversion($reportFilters['orderDate']['endDate']); if ($reportFilters['offerStartDatetime']['startDate']) { $reportFilters['offerStartDatetime']['startDate'] = standard2mysqlDateConversion($reportFilters['offerStartDatetime']['startDate'])." 00:00:00"; } if ($reportFilters['offerStartDatetime']['endDate']) { $reportFilters['offerStartDatetime']['endDate'] = standard2mysqlDateConversion($reportFilters['offerStartDatetime']['endDate'])." 23:59:59"; } if ($reportFilters['offerEndDatetime']['startDate']) { $reportFilters['offerEndDatetime']['startDate'] = standard2mysqlDateConversion($reportFilters['offerEndDatetime']['startDate'])." 00:00:00"; } if ($reportFilters['offerEndDatetime']['endDate']) { $reportFilters['offerEndDatetime']['endDate'] = standard2mysqlDateConversion($reportFilters['offerEndDatetime']['endDate'])." 23:59:59"; } if ($reportFilters['offerPeriod']['startDate']) { $reportFilters['offerPeriod']['startDate'] = standard2mysqlDateConversion($reportFilters['offerPeriod']['startDate'])." 00:00:00"; } if ($reportFilters['offerPeriod']['endDate']) { $reportFilters['offerPeriod']['endDate'] = standard2mysqlDateConversion($reportFilters['offerPeriod']['endDate'])." 23:59:59"; } $reportFilters['clientInvDate']['startDate'] = standard2mysqlDateConversion($reportFilters['clientInvDate']['startDate']); $reportFilters['clientInvDate']['endDate'] = standard2mysqlDateConversion($reportFilters['clientInvDate']['endDate']); $reportFilters['supplierInvDate']['startDate'] = standard2mysqlDateConversion($reportFilters['supplierInvDate']['startDate']); $reportFilters['supplierInvDate']['endDate'] = standard2mysqlDateConversion($reportFilters['supplierInvDate']['endDate']); list($reportFilters['balanceRespOfficeUser']['idOffice'], $reportFilters['balanceRespOfficeUser']['idUser']) = explode("|", $reportFilters['balanceRespOfficeUser']['id']); list($reportFilters['orderRespOfficeUser']['idOffice'], $reportFilters['orderRespOfficeUser']['idUser']) = explode("|", $reportFilters['orderRespOfficeUser']['id']); $reportFilters['idInvoiceCorporate'] = $reportFilters['clientInvCorporate']['id']; $reportFilters['idInvoiceCustomer'] = $reportFilters['clientInvCustomer']['id']; $reportFilters['idInvoiceSupplier'] = $reportFilters['supplier']['id']; $reportFilters['clientInvClientType'] = (array)$reportFilters['clientInvClientType']; $reportFilters['clientServiceType'] = (array)$reportFilters['clientServiceType']; $reportExtraFilters = []; if ($reportFilters['idInvoiceCorporate']) { $reportExtraFilters['invoiceCorporateIds'] = \Entity\Corporate::select($reportFilters['idInvoiceCorporate'])->fullDuplicatedCorporatesGroup; } if ($reportFilters['idInvoiceCustomer']) { $reportExtraFilters['invoiceCustomerIds'] = \Entity\Customer::select($reportFilters['idInvoiceCustomer'])->fullDuplicatedCustomersGroup; } if ($reportFilters['idInvoiceSupplier']) { $reportExtraFilters['invoiceSupplierIds'] = \Entity\Supplier::select($reportFilters['idInvoiceSupplier'])->fullDuplicatedSuppliersGroup; } $reportExtraFilters['idInvoiceCorporateTrust'] = $reportFilters['clientInvCorporateTrust']['id']; $reportExtraFilters['idInvoiceSupplierTrust'] = $reportFilters['supplierTrust']['id']; try { include(__DIR__."/reportData_initialFilter.php"); include(__DIR__."/reportData_executeSQL.php"); include(__DIR__."/reportData_otherFields.php"); } catch (\DBException $e) { killReport("Could not run SQL in report. SQL error: ".$e->getMessage()); } catch (\Exception $e) { killReport("Could not process report. Error: ".$e->getMessage()); } 