[WMS - Rettifica Collo]

- fix rettifica positiva su nuovo collo: il salvataggio avviene due volte (sia su nuovo collo come richieste che sul collo originale)
This commit is contained in:
2025-10-10 15:51:31 +02:00
parent 884c051b18
commit cdcb1eb0b6

View File

@@ -1366,40 +1366,6 @@ public class WMSGenericService {
entityProcessor.processEntity(mtbColtOrphan, true, multiDBTransactionManager);
MtbColt sourceMtbColt = new MtbColt()
.setNumCollo(sourceMtbColr.getNumCollo())
.setGestione(sourceMtbColr.getGestione())
.setSerCollo(sourceMtbColr.getSerCollo())
.setDataCollo(sourceMtbColr.getDataCollo());
mtbColrToSave = ((MtbColr) sourceMtbColr.clone())
.setNumCollo(null)
.setDataCollo(null)
.setSerCollo(null)
.setGestione(null)
.setQtaCol(differenceQtaCol)
.setQtaCnf(qtaCnf)
.setNumCnf(differenceNumCnf)
.setSerColloRif(mtbColtOrphan.getSerCollo())
.setDataColloRif(mtbColtOrphan.getDataCollo())
.setGestioneRif(mtbColtOrphan.getGestione())
.setNumColloRif(mtbColtOrphan.getNumCollo())
.setUtente(requestDataDTO.getUsername())
.setCausale(MtbColr.Causale.RETTIFICA)
.setPesoNettoKg(null)
.setPesoLordoKg(null)
.setDatetimeRow(UtilityLocalDate.getNowTime());
sourceMtbColt.setOperation(OperationType.UPDATE);
mtbColrToSave.setOperation(OperationType.INSERT);
sourceMtbColt.getMtbColr()
.add(mtbColrToSave);
entityProcessor.processEntity(sourceMtbColt, true, multiDBTransactionManager);
if (returnRettifica) {
mtbColrToSave = mtbColrOrphan;
}