Rimosso accorpamento ordine di lavorazione se in campagna
This commit is contained in:
@@ -305,25 +305,29 @@ public class ProductionPlanService {
|
|||||||
|
|
||||||
ordLavDTO.setPartite(saveProductionPlanDTO.getPartite());
|
ordLavDTO.setPartite(saveProductionPlanDTO.getPartite());
|
||||||
|
|
||||||
sql = Query.format(
|
// Se il deposito dell'ordine di lavorazione è diverso dal quello della sede
|
||||||
"SELECT num_ord, qta_prod\n" +
|
// allora siamo in campagna e quindi non accorpiamo prodotto, commessa nello stesso ordine
|
||||||
"FROM dtb_ordt\n" +
|
if (depo != null && codMdep.equalsIgnoreCase(depo.getCodMdep())) {
|
||||||
"WHERE cod_jcom = %s\n" +
|
sql = Query.format(
|
||||||
" AND cod_prod = %s\n" +
|
"SELECT num_ord, qta_prod\n" +
|
||||||
" AND data_ord = %s",
|
"FROM dtb_ordt\n" +
|
||||||
saveProductionPlanDTO.getCodJcom(),
|
"WHERE cod_jcom = %s\n" +
|
||||||
saveProductionPlanDTO.getCodProd(),
|
" AND cod_prod = %s\n" +
|
||||||
saveProductionPlanDTO.getDataOrd()
|
" AND data_ord = %s",
|
||||||
);
|
saveProductionPlanDTO.getCodJcom(),
|
||||||
|
saveProductionPlanDTO.getCodProd(),
|
||||||
|
saveProductionPlanDTO.getDataOrd()
|
||||||
|
);
|
||||||
|
|
||||||
if (numOrdL == null || numOrdL == 0) {
|
if (numOrdL == null || numOrdL == 0) {
|
||||||
HashMap<String, Object> ordData = UtilityDB.executeSimpleQueryOnlyFirstRow(multiDBTransactionManager.getPrimaryConnection(), sql);
|
HashMap<String, Object> ordData = UtilityDB.executeSimpleQueryOnlyFirstRow(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||||
|
|
||||||
if (ordData != null) {
|
if (ordData != null) {
|
||||||
numOrdL = UtilityHashMap.getValueIfExists(ordData, "num_ord");
|
numOrdL = UtilityHashMap.getValueIfExists(ordData, "num_ord");
|
||||||
|
|
||||||
qtaProd = (qtaProd != null ? qtaProd : BigDecimal.ZERO)
|
qtaProd = (qtaProd != null ? qtaProd : BigDecimal.ZERO)
|
||||||
.add(UtilityHashMap.getValueIfExists(ordData, "qta_prod"));
|
.add(UtilityHashMap.getValueIfExists(ordData, "qta_prod"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user