1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-27 00:06:14 +01:00

Fix select sedi azienda

This commit is contained in:
MatteoPistorello 2023-10-25 09:20:19 +02:00
parent 6db962f068
commit 85e8f861b0

View File

@ -362,7 +362,7 @@ switch ($resource) {
$user = Auth::user(); $user = Auth::user();
$id_azienda = setting('Azienda predefinita'); $id_azienda = setting('Azienda predefinita');
$query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', \"".tr('Sede legale')."\" , (SELECT CONCAT (citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), ''),' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, CONCAT(citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), '')) ) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione"; $query = "SELECT * FROM (SELECT '0' AS id, 'Sede legale' AS nomesede, CONCAT_WS(' - ', \"".tr('Sede legale')."\" , (SELECT CONCAT (citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), ''),' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, nomesede, CONCAT_WS(' - ', nomesede, CONCAT(citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), '')) ) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione";
foreach ($elements as $element) { foreach ($elements as $element) {
$filter[] = 'id='.prepare($element); $filter[] = 'id='.prepare($element);