aggiunto controllo data scadenza
nascosta input tipo collo in accettazione se non ci sono tipi collo configurati
This commit is contained in:
parent
52092e7e9c
commit
92aadad5cb
12
.idea/deploymentTargetDropDown.xml
generated
12
.idea/deploymentTargetDropDown.xml
generated
@ -1,18 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2022-02-07T11:49:11.375317900Z" />
|
||||
<runningDeviceTargetsSelectedWithDialog>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
name="mContext"
|
||||
type="android.content.Context" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialog" />
|
||||
@ -68,6 +70,7 @@
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_text"
|
||||
app:layout_constraintBottom_toTopOf="@id/level_number_layout"
|
||||
android:visibility="@{viewModel.tipiCollo.empty ? View.GONE : View.VISIBLE}"
|
||||
android:hint="@string/lu_type">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user