aggiunto controllo data scadenza
nascosta input tipo collo in accettazione se non ci sono tipi collo configurati
This commit is contained in:
@@ -12,7 +12,7 @@ import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||
|
||||
public class InfoAggiuntiveLUDialogViewModel {
|
||||
|
||||
private final MutableLiveData<List<MtbTCol>> mTipiColloLiveData = new MutableLiveData<>();
|
||||
public final MutableLiveData<List<MtbTCol>> tipiCollo = new MutableLiveData<>();
|
||||
|
||||
private MtbTCol internalTipoPed;
|
||||
|
||||
@@ -29,15 +29,16 @@ public class InfoAggiuntiveLUDialogViewModel {
|
||||
new Thread(this::sendOnLoadingStarted).start();
|
||||
|
||||
mMagazzinoRESTConsumer.getTipiCollo(tipiCollo -> {
|
||||
this.mTipiColloLiveData.postValue(tipiCollo);
|
||||
this.tipiCollo.postValue(tipiCollo);
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<MtbTCol>> getTipiCollo() {
|
||||
return this.mTipiColloLiveData;
|
||||
return this.tipiCollo;
|
||||
}
|
||||
|
||||
|
||||
public void setInternalTipoPed(MtbTCol internalTipoPed) {
|
||||
this.internalTipoPed = internalTipoPed;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.pedromassango.doubleclick.DoubleClickListener;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -222,7 +223,26 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.currentDataScad, (value) -> {
|
||||
if (this.mEnableDataCallback) {
|
||||
this.mViewModel.setDataScad(value);
|
||||
MtbAart mtbAart = this.mViewModel.getMtbAart();
|
||||
if (value != null && mtbAart != null && mtbAart.getGgScadPartita() != null && mtbAart.getGgScadPartita() > 0) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, mtbAart.getGgScadPartita());
|
||||
Date minDataScad = calendar.getTime();
|
||||
if (minDataScad.after(value) && value.after(new Date())) {
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString("La data selezionata è precedente alla data di scadenza consigliata per l'articolo scelto ( " + mtbAart.getGgScadPartita() + " giorni) . Continuare?"), null, () -> {
|
||||
this.mViewModel.setDataScad(value);
|
||||
}, () -> {
|
||||
this.currentDataScad.set(null);
|
||||
})
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
} else {
|
||||
this.mViewModel.setDataScad(value);
|
||||
}
|
||||
} else {
|
||||
this.mViewModel.setDataScad(value);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user