public static function reorderInvoicesByAge($invoices)
    {
        $invoicesByAge    = [];
        $invoicesByAgeRaw = [];
        foreach ($invoices as $invoiceData) {
            $invoicesByAgeRaw[\FlexiPeeHP\FlexiBeeRW::flexiDateToDateTime($invoiceData['datVyst'])->getTimestamp()]
                = $invoiceData;
        }
        ksort($invoicesByAgeRaw);
        foreach ($invoicesByAgeRaw as $invoiceData) {
            $invoicesByAge[$invoiceData['kod']] = $invoiceData;
        }
        return $invoicesByAge;
    }