<?php
$availableTableColumns = array_keys($tableColumns); $reportFilters['invoiceDate']['startDate'] = standard2mysqlDateConversion($reportFilters['invoiceDate']['startDate']); $reportFilters['invoiceDate']['endDate'] = standard2mysqlDateConversion($reportFilters['invoiceDate']['endDate']); $reportFilters['invoiceDueDate']['startDate'] = standard2mysqlDateConversion($reportFilters['invoiceDueDate']['startDate']); $reportFilters['invoiceDueDate']['endDate'] = standard2mysqlDateConversion($reportFilters['invoiceDueDate']['endDate']); list($reportFilters['responsibleUser']['idOffice'], $reportFilters['responsibleUser']['idUser']) = explode("|", $reportFilters['responsibleUser']['id']); list($reportFilters['clientCorporateKeyAccount']['idOffice'], $reportFilters['clientCorporateKeyAccount']['idUser']) = explode("|", $reportFilters['clientCorporateKeyAccount']['id']); $reportFilters['invoiceCashedStatus'] = array_keys((array)$reportFilters['invoiceCashedStatus']); $reportFilters['invoiceCorporate'] = $reportFilters['corporate']['id']; $reportFilters['invoiceCustomer'] = $reportFilters['customer']['id']; $reportFilters['clientType'] = (array)$reportFilters['clientType']; $reportFilters['issued'] = (array)$reportFilters['issued']; $reportFilters['voided'] = (array)$reportFilters['voided']; $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(); } try { include(__DIR__."/reportData_executeSQL.php"); include(__DIR__."/reportData_otherFields.php"); include(__DIR__."/reportData_loopRecords.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()); } 