'That quote no longer exists.'])); } $client_id = intval($doc['client_id']); enforceClientAccess(); $doc_number = billingNumber($doc_type, $doc); $lines = count(billingItems('quote', intval($doc['quote_id']))); $clients = []; // Leads are quoted too - marked, after the clients $sql = mysqli_query($mysqli, "SELECT client_id, client_name, client_abbreviation, client_lead FROM clients WHERE client_archived_at IS NULL " . clientScopeSql('clients.client_id') . " ORDER BY client_lead ASC, client_name ASC"); while ($row = mysqli_fetch_assoc($sql)) { $clients[] = $row; } ob_start(); ?>