From a9edf7fcb3a2894a46ebc08a48f088122bee0c4b Mon Sep 17 00:00:00 2001 From: FabioL <1647128+loviuz@users.noreply.github.com> Date: Mon, 18 Nov 2024 17:16:03 +0100 Subject: [PATCH] fix: filtro sedi dell'anagrafica azienda --- modules/articoli/header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/articoli/header.php b/modules/articoli/header.php index 76e95c3eb..0cae9a482 100644 --- a/modules/articoli/header.php +++ b/modules/articoli/header.php @@ -61,9 +61,9 @@ echo ' '; if ($user->is_admin) { - $sedi = $dbo->fetchArray('(SELECT "0" AS id, "Sede legale" AS nomesede) UNION (SELECT id, nomesede FROM an_sedi)'); + $sedi = $dbo->fetchArray('(SELECT "0" AS id, "Sede legale" AS nomesede) UNION (SELECT id, nomesede FROM an_sedi WHERE idanagrafica='.prepare(setting('Azienda predefinita')).')'); } else { - $sedi = $dbo->fetchArray('SELECT nomesede FROM zz_user_sedi INNER JOIN ((SELECT "0" AS id, "Sede legale" AS nomesede) UNION (SELECT id, nomesede FROM an_sedi)) sedi ON zz_user_sedi.idsede=sedi.id WHERE id_user='.prepare($user['id']).' GROUP BY id_user, nomesede'); + $sedi = $dbo->fetchArray('SELECT nomesede FROM zz_user_sedi INNER JOIN ((SELECT "0" AS id, "Sede legale" AS nomesede) UNION (SELECT id, nomesede FROM an_sedi WHERE idanagrafica='.prepare(setting('Azienda predefinita')).')) sedi ON zz_user_sedi.idsede=sedi.id WHERE id_user='.prepare($user['id']).' GROUP BY id_user, nomesede'); } $giacenze = $articolo->getGiacenze();