public static function GetClientNotes($clientid) { try { $client = Client::GetClient($clientid); $sql = 'SELECT * FROM credit_notes WHERE client_id = ' . $clientid . ' AND status = 1'; $res = DatabaseHandler::GetAll($sql); $invoices = []; foreach ($res as $item) { if (!empty($item['datetime'])) { $invoice = new CreditNote($item['id'], $item['description'], $item['datetime'], $item['status'], $client); $invoice->initialize(); $invoices[] = $invoice; } else { } } return $invoices; } catch (Exception $e) { return null; } }