Modicata query colli per prendere l'ultima rettifica fatta nella stessa giornata per deposito - articolo
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2025-02-19 10:13:42 +01:00
parent 7530d5dfdf
commit c5b6b69a5a

View File

@@ -379,7 +379,7 @@ public class GiacenzaService {
" AND mtb_colt.data_collo >= %s\n" +
" AND mtb_colt.data_distribuzione is null \n" +
" AND mtb_colt.cod_mdep = %s\n" +
" AND exists (select * from carelli_giacenza_prog c where c.cod_mdep = mtb_colt.cod_mdep and c.cod_mart = art.cod_mart_mov and (c.data_reg < mtb_colt.data_collo or IsNull(tipo_car, 'G') = 'G' ))\n " +
" AND exists (select * from carelli_giacenza_prog c where c.cod_mdep = mtb_colt.cod_mdep and c.cod_mart = art.cod_mart_mov and (c.data_reg < mtb_colt.data_ins or IsNull(tipo_car, 'G') = 'G' ))\n " +
"GROUP BY art.cod_mart_mov, mtb_colt.data_ins",
codDtipRett, dataIniz, codMdep);