Visualizzazione giacenza per depositi dell'utente in riepilogo prodotto rosso gargano
All checks were successful
PVM/pipeline/head This commit looks good

This commit is contained in:
2025-10-01 18:21:00 +02:00
parent 01aa13e4c3
commit 1b391a2814
2 changed files with 5 additions and 1 deletions

View File

@@ -2131,7 +2131,9 @@ class DeliveryPlan {
$query
= KendoService::queryInitializerService($data, "get-riepiloghi-giorno", "cod_msgr, articolo", false, false);
$query->setDateVar("dataCons", $dataCons);
$query
->setDateVar("dataCons", $dataCons)
->setVar("userName", count(User::get_current_userAllDepos()) > 0 ? User::get_current_username() : null);
return $query->execute();
}

View File

@@ -72,8 +72,10 @@ WITH Consegne AS (SELECT mtb_aart.cod_msgr,
Giacenze AS (SELECT cod_mart, SUM(qta_esistente) AS qta_esistente
FROM giacenzaArticolo
INNER JOIN mtb_depo md ON giacenzaArticolo.cod_mdep = md.cod_mdep
LEFT OUTER JOIN wtb_depo wd ON md.cod_mdep = wd.cod_mdep AND wd.user_name = '[userName]'
LEFT OUTER JOIN mtb_depo_tipi mdt ON md.flag_tipo_negozio = mdt.cod_tipo_depo
WHERE ISNULL(gestisci_colli, 1) = 1
AND ('[userName]' IS NULL OR wd.cod_mdep IS NOT NULL)
GROUP BY cod_mart),
TempResult AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS row_number,
*