diff --git a/modules/anagrafiche/ajax/select.php b/modules/anagrafiche/ajax/select.php index 010732a91..8887697f5 100644 --- a/modules/anagrafiche/ajax/select.php +++ b/modules/anagrafiche/ajax/select.php @@ -200,7 +200,7 @@ switch ($resource) { case 'sedi': if (isset($superselect['idanagrafica'])) { - $query = "SELECT * FROM (SELECT '0' AS id, CONCAT('Sede legale', ' (' , (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica = ".$superselect['idanagrafica']." ), ')') AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione"; + $query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', 'Sede legale' , (SELECT CONCAT (citta, ' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione"; foreach ($elements as $element) { $filter[] = 'id='.prepare($element); @@ -219,7 +219,7 @@ switch ($resource) { if (isset($superselect['idanagrafica'])) { $user = Auth::user(); - $query = "SELECT * FROM (SELECT '0' AS id, CONCAT('Sede legale', ' (' , (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica = ".$user->idanagrafica." ), ')') AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione"; + $query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', 'Sede legale' , (SELECT CONCAT (citta, ' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione"; foreach ($elements as $element) { $filter[] = 'id='.prepare($element); diff --git a/modules/fatture/edit.php b/modules/fatture/edit.php index 9540b6d17..54f141c4a 100644 --- a/modules/fatture/edit.php +++ b/modules/fatture/edit.php @@ -629,9 +629,13 @@ if ($dir == 'entrata') { echo '