diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java index 1a82be96..23f77437 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java @@ -690,10 +690,11 @@ public class SpedizioneViewModel { if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) { if (mtbColt.getSegno() != -1) { + boolean codMdepMatchPreviousPick = mCurrentMtbColt != null && (mtbColt.getMtbColr().isEmpty() || mCurrentMtbColt.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep())); boolean codMdepIsValid = SettingsManager.iDB().getAvailableCodMdep().stream() .anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep())); - if (codMdepIsValid) { + if (codMdepIsValid && codMdepMatchPreviousPick) { searchArtFromUL(mtbColt); } else throw new InvalidCodMdepException();