clientScopeSql sweep whicn now removed the extra unessesary client joins

This commit is contained in:
johnnyq
2026-08-06 11:45:56 -04:00
parent 83383599a1
commit ddd9c2b56a
79 changed files with 139 additions and 174 deletions

View File

@@ -732,7 +732,7 @@ if (isset($_POST['export_quotes'])) {
LEFT JOIN categories ON quote_category_id = category_id
WHERE (CONCAT(quote_prefix,quote_number) LIKE '%$q%' OR quote_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%' OR quote_amount LIKE '%$q%' OR client_name LIKE '%$q%')
AND DATE(quote_date) BETWEEN '$dtf' AND '$dtt'
$access_permission_query
" . clientScopeSql('quote_client_id') . "
$client_query
ORDER BY quote_number ASC"
);
@@ -774,7 +774,7 @@ if (isset($_GET['export_quote_pdf'])) {
LEFT JOIN contacts ON clients.client_id = contacts.contact_client_id AND contact_primary = 1
LEFT JOIN locations ON clients.client_id = locations.location_client_id AND location_primary = 1
WHERE quote_id = $quote_id
$access_permission_query
" . clientScopeSql('quote_client_id') . "
LIMIT 1"
);