Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2024-09-24 09:32:51 +02:00

View File

@@ -508,14 +508,18 @@ public class GiacenzaService {
} }
public List<GiacenzaDTO> retrieveGiacenza(String codMdep) throws Exception { public List<GiacenzaDTO> retrieveGiacenza(String codMdep) throws Exception {
String codMdepNew = setupGest.getSetupDepo("DATI_AZIENDA", "GIACENZA_DA_INV", "REPLACE_DEPO", codMdep);
String sql = Query.format(
"SELECT cod_mdep FROM stb_gest_setup_depo WHERE gest_name = %s AND section = %s AND key_section = %S AND value = %S",
"DATI_AZIENDA", "GIACENZA_DA_INV", "REPLACE_DEPO", codMdep);
String codMdepNew = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
String whereCond = UtilityDB.valueToString(codMdep); String whereCond = UtilityDB.valueToString(codMdep);
if (codMdepNew != null) { if (codMdepNew != null) {
whereCond += ", " + UtilityDB.valueToString(codMdepNew); whereCond += ", " + UtilityDB.valueToString(codMdepNew);
} }
String sql = "WITH art AS (SELECT mtb_aart.cod_mart AS cod_mart,\n" + sql = "WITH art AS (SELECT mtb_aart.cod_mart AS cod_mart,\n" +
" IIF(mtb_aart.articolo_composto = 'S'\n" + " IIF(mtb_aart.articolo_composto = 'S'\n" +
" AND mtb_comp.cod_comp IS NOT NULL, mtb_comp.cod_comp, mtb_aart.cod_mart) AS cod_mart_mov,\n" + " AND mtb_comp.cod_comp IS NOT NULL, mtb_comp.cod_comp, mtb_aart.cod_mart) AS cod_mart_mov,\n" +
" ISNULL(mtb_comp.qta_std, 1) AS qta_std\n" + " ISNULL(mtb_comp.qta_std, 1) AS qta_std\n" +