vg aggiunta possibilità di selezionare il tipo pedana in accettazione e visulizzati dettagli peso
This commit is contained in:
parent
6e070285e3
commit
ecfb8faf01
12
.idea/deploymentTargetDropDown.xml
generated
12
.idea/deploymentTargetDropDown.xml
generated
@ -1,6 +1,18 @@
|
||||
<?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" />
|
||||
|
||||
@ -63,6 +63,7 @@ import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.Dial
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialogComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
||||
@ -114,42 +115,79 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
SplashActivityComponent.Factory splashActivityComponent();
|
||||
|
||||
LoginComponent.Factory loginActivityComponent();
|
||||
|
||||
MainActivityComponent.Factory mainActivityComponent();
|
||||
|
||||
MainFragmentComponent.Factory mainFragmentComponent();
|
||||
|
||||
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
||||
|
||||
ListaBancaliComponent.Factory listaBancaliComponent();
|
||||
|
||||
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
||||
|
||||
PVOrdiniAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
||||
|
||||
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
||||
|
||||
PickingLiberoComponent.Factory pickingLiberoComponent();
|
||||
|
||||
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
||||
|
||||
SpedizioneComponent.Factory spedizioneComponent();
|
||||
|
||||
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
||||
|
||||
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
||||
|
||||
UltimiArriviFornitoreComponent.Factory ultimiArriviFornitoreComponent();
|
||||
|
||||
PickingResiComponent.Factory pickingResiComponent();
|
||||
|
||||
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
||||
|
||||
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||
|
||||
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
||||
|
||||
DialogScanArtComponent.Factory dialogScanArtComponent();
|
||||
|
||||
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
||||
|
||||
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
||||
|
||||
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
||||
|
||||
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
||||
|
||||
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
||||
|
||||
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
||||
|
||||
ProdRientroMerceComponent.Factory prodRientroMerceComponent();
|
||||
|
||||
ProdRientroMerceOrderDetailComponent.Factory prodRientroMerceOrderDetailComponent();
|
||||
|
||||
ProdOrdineProduzioneElencoComponent.Factory prodOrdineProduzioneElencoComponent();
|
||||
|
||||
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
||||
|
||||
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
||||
|
||||
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
||||
|
||||
DocInterniComponent.Factory docInterniComponent();
|
||||
|
||||
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
||||
|
||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||
|
||||
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
}
|
||||
|
||||
@ -41,6 +41,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
@ -72,9 +73,9 @@ import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFrag
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_should_versamento_automatico_ul.DialogAskShouldVersamentoAutomaticoULView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialog;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
||||
import it.integry.integrywmsnative.view.dialogs.versamento_automatico_ul_done.DialogVersamentoAutomaticoULDoneView;
|
||||
|
||||
public class AccettazionePickingActivity extends BaseActivity implements AccettazionePickingViewModel.Listener, BottomSheetFragmentLUContentViewModel.Listener, BottomSheetFragmentLUContentView.Listener {
|
||||
@ -791,9 +792,9 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNoteAggiuntiveRequest(RunnableArgs<String> onComplete) {
|
||||
public void onInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
runOnUiThread(() -> {
|
||||
NoteAggiuntiveLUDialog.make(this, onComplete).show();
|
||||
InfoAggiuntiveLUDialog.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
@ -359,7 +360,7 @@ public class AccettazionePickingViewModel {
|
||||
}
|
||||
|
||||
public void createNewLU(Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
||||
this.sendOnNoteAggiuntiveRequest(additionalNotes -> {
|
||||
this.sendOnInfoAggiuntiveRequest((additionalNotes, tCol) -> {
|
||||
|
||||
this.mGestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
||||
|
||||
@ -375,6 +376,10 @@ public class AccettazionePickingViewModel {
|
||||
.setPosizione(defaultPosAccettazione)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
if (tCol != null) {
|
||||
mtbColt.setCodTcol(tCol.getCodTcol());
|
||||
}
|
||||
|
||||
if (customNumCollo != null) {
|
||||
mtbColt.setNumCollo(customNumCollo);
|
||||
}
|
||||
@ -896,8 +901,8 @@ public class AccettazionePickingViewModel {
|
||||
if (this.mListener != null) this.mListener.onVersamentoAutomaticoULRequest(onComplete);
|
||||
}
|
||||
|
||||
private void sendOnNoteAggiuntiveRequest(RunnableArgs<String> onComplete) {
|
||||
if (this.mListener != null) this.mListener.onNoteAggiuntiveRequest(onComplete);
|
||||
private void sendOnInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
if (this.mListener != null) this.mListener.onInfoAggiuntiveRequest(onComplete);
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
@ -990,7 +995,7 @@ public class AccettazionePickingViewModel {
|
||||
|
||||
void onVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete);
|
||||
|
||||
void onNoteAggiuntiveRequest(RunnableArgs<String> onComplete);
|
||||
void onInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete);
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.rest.model.DocumentoResoDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
@ -42,18 +43,18 @@ import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||
import it.integry.integrywmsnative.databinding.ActivityPickingResiBinding;
|
||||
import it.integry.integrywmsnative.gest.picking_resi.rest.WithdrawableDtbDocr;
|
||||
import it.integry.integrywmsnative.gest.picking_resi.ui.PickingResiListAdapter;
|
||||
import it.integry.integrywmsnative.gest.picking_resi.ui.PickingResiListModel;
|
||||
import it.integry.integrywmsnative.gest.picking_resi.rest.WithdrawableDtbDocr;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_should_print.DialogAskShouldPrint;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialog;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
||||
|
||||
public class PickingResiActivity extends BaseActivity implements BottomSheetFragmentLUContentView.Listener, BottomSheetFragmentLUContentViewModel.Listener, PickingResiViewModel.Listener {
|
||||
|
||||
@ -276,15 +277,15 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNoteAggiuntiveRequired(RunnableArgs<String> onComplete) {
|
||||
NoteAggiuntiveLUDialog.make(this, onComplete).show();
|
||||
public void onInfoAggiuntiveRequired(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
InfoAggiuntiveLUDialog.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
|
||||
if(ex instanceof InvalidPesoKGException) {
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||
|
||||
@ -28,6 +28,7 @@ import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
@ -161,11 +162,14 @@ public class PickingResiViewModel {
|
||||
this.sendOnLoadingEnded();
|
||||
});
|
||||
} else {
|
||||
this.sendOnNoteAggiuntiveRequired(noteAggiuntive -> {
|
||||
this.sendOnInfoAggiuntiveRequired((noteAggiuntive, tCol) -> {
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(noteAggiuntive)) {
|
||||
this.mCurrentMtbColt.setAnnotazioni(noteAggiuntive);
|
||||
}
|
||||
if (tCol != null) {
|
||||
this.mCurrentMtbColt.setCodTcol(tCol.getCodTcol());
|
||||
}
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
||||
|
||||
@ -717,8 +721,8 @@ public class PickingResiViewModel {
|
||||
return mPickingList;
|
||||
}
|
||||
|
||||
private void sendOnNoteAggiuntiveRequired(RunnableArgs<String> onComplete) {
|
||||
if (this.mListener != null) this.mListener.onNoteAggiuntiveRequired(onComplete);
|
||||
private void sendOnInfoAggiuntiveRequired(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
if (this.mListener != null) this.mListener.onInfoAggiuntiveRequired(onComplete);
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
@ -795,7 +799,7 @@ public class PickingResiViewModel {
|
||||
|
||||
public interface Listener extends ILUPrintListener, ILoadingListener, ILUBaseOperationsListener {
|
||||
|
||||
void onNoteAggiuntiveRequired(RunnableArgs<String> onComplete);
|
||||
void onInfoAggiuntiveRequired(RunnableArgss<String, MtbTCol> onComplete);
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ public class ProdRientroMerceOrderDetailRESTConsumer extends _BaseRESTConsumer {
|
||||
}.getType();
|
||||
systemRESTConsumer.<List<MtbColt>>processSql(mtbColtSql, mtbColtTypeOfObjectsList, mtbColtList -> {
|
||||
|
||||
if(mtbColtList == null) mtbColtList = new ArrayList<>();
|
||||
if (mtbColtList == null) mtbColtList = new ArrayList<>();
|
||||
|
||||
for (MtbColt mtbColt : mtbColtList) {
|
||||
|
||||
@ -108,23 +108,21 @@ public class ProdRientroMerceOrderDetailRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void importColloDaProduzione(ImportColliDaProduzioneRequestDTO importColliDaProduzioneRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
ProdRientroMerceOrderDetailRESTConsumerService service = RESTBuilder.getService(ProdRientroMerceOrderDetailRESTConsumerService.class);
|
||||
service.importColloDaProduzione(importColliDaProduzioneRequestDTO).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||
service.importColloDaProduzione(importColliDaProduzioneRequestDTO).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
||||
analyzeAnswer(response, "importColliDaProduzione", mtbColt -> {
|
||||
onComplete.run(mtbColt);
|
||||
onComplete.run(mtbColt.get(0));
|
||||
}, ex -> {
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||
public void onFailure(Call<ServiceRESTResponse<List<MtbColt>>> call, Throwable t) {
|
||||
Logger.e(t, "importColliDaProduzione");
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
@ -140,7 +138,7 @@ public class ProdRientroMerceOrderDetailRESTConsumer extends _BaseRESTConsumer {
|
||||
analyzeAnswer(response, "deleteColloDaProduzione", mtbColt -> {
|
||||
onComplete.run();
|
||||
}, ex -> {
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -13,10 +13,10 @@ public interface ProdRientroMerceOrderDetailRESTConsumerService {
|
||||
|
||||
|
||||
@POST("importColliDaProduzioneJson")
|
||||
Call<ServiceRESTResponse<MtbColt>> importColliDaProduzione(@Body List<ImportColliDaProduzioneRequestDTO> importColliDaProduzioneRequestDTO);
|
||||
Call<ServiceRESTResponse<List<MtbColt>>> importColliDaProduzione(@Body List<ImportColliDaProduzioneRequestDTO> importColliDaProduzioneRequestDTO);
|
||||
|
||||
@POST("importColloDaProduzioneJson")
|
||||
Call<ServiceRESTResponse<MtbColt>> importColloDaProduzione(@Body ImportColliDaProduzioneRequestDTO importColloDaProduzioneRequestDTO);
|
||||
Call<ServiceRESTResponse<List<MtbColt>>> importColloDaProduzione(@Body ImportColliDaProduzioneRequestDTO importColloDaProduzioneRequestDTO);
|
||||
|
||||
@POST("cancellaColloDaProduzione")
|
||||
Call<ServiceRESTResponse<Object>> deleteColloDaProduzione(@Body MtbColt mtbColtToDelete);
|
||||
|
||||
@ -0,0 +1,146 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.AdapterView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.adapter.DialogInputLUProdTipoColloAdapter;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.adapter.DialogInputLUProdTipoColloListModel;
|
||||
|
||||
public class InfoAggiuntiveLUDialog extends BaseDialogFragment implements InfoAggiuntiveLUDialogViewModel.Listener {
|
||||
|
||||
@Inject
|
||||
InfoAggiuntiveLUDialogViewModel mViewModel;
|
||||
|
||||
private DialogNoteAggiuntiveNuovaUlBinding mBindings;
|
||||
private final RunnableArgss<String, MtbTCol> mOnComplete;
|
||||
|
||||
private DialogInputLUProdTipoColloAdapter codTcolArrayAdapter = null;
|
||||
public ObservableField<String> additionalNotes = new ObservableField<>();
|
||||
public ObservableField<String> selectedMtbTcol = new ObservableField<>();
|
||||
public ObservableField<DialogInputLUProdTipoColloListModel> currentMtbTCol = new ObservableField<>();
|
||||
|
||||
public static InfoAggiuntiveLUDialog newInstance(@NotNull RunnableArgss<String, MtbTCol> onComplete) {
|
||||
return new InfoAggiuntiveLUDialog(onComplete);
|
||||
}
|
||||
|
||||
private InfoAggiuntiveLUDialog(@NotNull RunnableArgss<String, MtbTCol> onComplete) {
|
||||
super();
|
||||
this.mOnComplete = onComplete;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
this.init();
|
||||
|
||||
UtilityDialog.setTo90PercentWidth(requireActivity(), this);
|
||||
this.mViewModel.setListener(this);
|
||||
this.mViewModel.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_note_aggiuntive_nuova_ul, container, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
MainApplication.appComponent
|
||||
.infoAggiuntiveLUDialogComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
mBindings.setView(this);
|
||||
mBindings.setViewModel(this.mViewModel);
|
||||
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
getDialog().setCanceledOnTouchOutside(false);
|
||||
getDialog().setCancelable(false);
|
||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
if (mOnComplete != null)
|
||||
mOnComplete.run(additionalNotes.get(), mViewModel.getInternalTipoPed());
|
||||
super.onDismiss(dialog);
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.selectedMtbTcol, (value) -> {
|
||||
if (this.codTcolArrayAdapter != null && this.codTcolArrayAdapter.getDataset() != null) {
|
||||
Optional<DialogInputLUProdTipoColloListModel> selectedItem = Stream.of(this.codTcolArrayAdapter.getDataset())
|
||||
.filter(x -> x.toString().equals(value))
|
||||
.findFirst();
|
||||
|
||||
if (selectedItem.isPresent()) {
|
||||
currentMtbTCol.set(selectedItem.get());
|
||||
this.mViewModel.setInternalTipoPed(selectedItem.get().getOriginalModel());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.mViewModel.getTipiCollo().observe(getViewLifecycleOwner(), tipiCollo -> {
|
||||
|
||||
codTcolArrayAdapter = new DialogInputLUProdTipoColloAdapter(getActivity(), R.layout.array_adapter_single_item, tipiCollo);
|
||||
mBindings.filledExposedDropdownCodTcol.setAdapter(codTcolArrayAdapter);
|
||||
|
||||
});
|
||||
|
||||
this.mBindings.filledExposedDropdownCodTcol.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
currentMtbTCol.set(codTcolArrayAdapter.getItem(i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||
currentMtbTCol.set(null);
|
||||
}
|
||||
});
|
||||
|
||||
mBindings.buttonConfirm.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface InfoAggiuntiveLUDialogComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
InfoAggiuntiveLUDialogComponent create();
|
||||
}
|
||||
|
||||
void inject(InfoAggiuntiveLUDialog infoAggiuntiveLUDialog);
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||
|
||||
@Module(subcomponents = InfoAggiuntiveLUDialogComponent.class)
|
||||
public class InfoAggiuntiveLUDialogModule {
|
||||
|
||||
@Provides
|
||||
InfoAggiuntiveLUDialogViewModel providesInfoAggiuntiveLUDialogViewModel(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
return new InfoAggiuntiveLUDialogViewModel(magazzinoRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||
|
||||
public class InfoAggiuntiveLUDialogViewModel {
|
||||
|
||||
private final MutableLiveData<List<MtbTCol>> mTipiColloLiveData = new MutableLiveData<>();
|
||||
|
||||
private MtbTCol internalTipoPed;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
private final MagazzinoRESTConsumer mMagazzinoRESTConsumer;
|
||||
|
||||
@Inject
|
||||
public InfoAggiuntiveLUDialogViewModel(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
this.mMagazzinoRESTConsumer = magazzinoRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
new Thread(this::sendOnLoadingStarted).start();
|
||||
|
||||
mMagazzinoRESTConsumer.getTipiCollo(tipiCollo -> {
|
||||
this.mTipiColloLiveData.postValue(tipiCollo);
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<MtbTCol>> getTipiCollo() {
|
||||
return this.mTipiColloLiveData;
|
||||
}
|
||||
|
||||
public void setInternalTipoPed(MtbTCol internalTipoPed) {
|
||||
this.internalTipoPed = internalTipoPed;
|
||||
}
|
||||
|
||||
|
||||
public MtbTCol getInternalTipoPed() {
|
||||
return internalTipoPed;
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
}
|
||||
|
||||
private void sendOnLoadingEnded() {
|
||||
if (this.mListener != null) mListener.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
public void setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
void onError(Exception ex);
|
||||
}
|
||||
|
||||
}
|
||||
@ -100,7 +100,6 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@ -154,12 +153,12 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
});
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.selectedMtbTcol, (value) -> {
|
||||
if(this.codTcolArrayAdapter != null && this.codTcolArrayAdapter.getDataset() != null) {
|
||||
if (this.codTcolArrayAdapter != null && this.codTcolArrayAdapter.getDataset() != null) {
|
||||
Optional<DialogInputLUProdTipoColloListModel> selectedItem = Stream.of(this.codTcolArrayAdapter.getDataset())
|
||||
.filter(x -> x.toString().equals(value))
|
||||
.findFirst();
|
||||
|
||||
if(selectedItem.isPresent()) {
|
||||
if (selectedItem.isPresent()) {
|
||||
currentMtbTCol.set(selectedItem.get());
|
||||
this.mViewModel.setInternalTipoPed(selectedItem.get().getOriginalModel());
|
||||
}
|
||||
@ -171,12 +170,12 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
});
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.selectedLineaProd, (value) -> {
|
||||
if(this.lineeProdArrayAdapter != null && this.lineeProdArrayAdapter.getDataset() != null) {
|
||||
if (this.lineeProdArrayAdapter != null && this.lineeProdArrayAdapter.getDataset() != null) {
|
||||
Optional<DialogInputLULineeProdListModel> selectedItem = Stream.of(this.lineeProdArrayAdapter.getDataset())
|
||||
.filter(x -> x.toString().equals(value))
|
||||
.findFirst();
|
||||
|
||||
if(selectedItem.isPresent()) {
|
||||
if (selectedItem.isPresent()) {
|
||||
currentLineaProd.set(selectedItem.get());
|
||||
this.mViewModel.setInternalLineaProd(selectedItem.get().getOriginalModel());
|
||||
}
|
||||
@ -196,7 +195,7 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
});
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.currentPesoNetto, (value) -> {
|
||||
if(value != null) {
|
||||
if (value != null) {
|
||||
this.currentPesoNetto.set(value.setScale(0, RoundingMode.HALF_UP));
|
||||
}
|
||||
if (this.mEnableDataCallback) {
|
||||
@ -217,7 +216,7 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
});
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.currentPesoLordo, (value) -> {
|
||||
if(value != null) {
|
||||
if (value != null) {
|
||||
this.currentPesoLordo.set(value.setScale(0, RoundingMode.HALF_UP));
|
||||
}
|
||||
if (this.mEnableDataCallback) {
|
||||
@ -322,12 +321,12 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
codTcolArrayAdapter = new DialogInputLUProdTipoColloAdapter(getActivity(), R.layout.array_adapter_single_item, tipiCollo);
|
||||
mBindings.filledExposedDropdownCodTcol.setAdapter(codTcolArrayAdapter);
|
||||
|
||||
if(mDialogInputLUProdDTO.getCodTcol() != null) {
|
||||
if (mDialogInputLUProdDTO.getCodTcol() != null) {
|
||||
Optional<MtbTCol> optTCol = Stream.of(tipiCollo)
|
||||
.filter(x -> x.getCodTcol().equalsIgnoreCase(mDialogInputLUProdDTO.getCodTcol()))
|
||||
.findFirst();
|
||||
|
||||
if(optTCol.isPresent())
|
||||
if (optTCol.isPresent())
|
||||
selectedMtbTcol.set(new DialogInputLUProdTipoColloListModel().setOriginalModel(optTCol.get()).toString());
|
||||
}
|
||||
|
||||
@ -341,12 +340,12 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
lineeProdArrayAdapter = new DialogInputLULineeProdAdapter(getActivity(), R.layout.array_adapter_single_item, lineeProd);
|
||||
mBindings.filledExposedDropdownCodJfas.setAdapter(lineeProdArrayAdapter);
|
||||
|
||||
if(mDialogInputLUProdDTO.getSuggestedCodJfas() != null) {
|
||||
if (mDialogInputLUProdDTO.getSuggestedCodJfas() != null) {
|
||||
Optional<JtbFasi> optFas = Stream.of(lineeProd)
|
||||
.filter(x -> x.getCodJfas().equalsIgnoreCase(mDialogInputLUProdDTO.getSuggestedCodJfas()))
|
||||
.findFirst();
|
||||
|
||||
if(optFas.isPresent())
|
||||
if (optFas.isPresent())
|
||||
selectedLineaProd.set(new DialogInputLULineeProdListModel().setOriginalModel(optFas.get()).toString());
|
||||
}
|
||||
});
|
||||
@ -372,9 +371,6 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void resetValues() {
|
||||
this.mViewModel.blockedNumCnf.set(false);
|
||||
this.mViewModel.blockedPesoLordo.set(false);
|
||||
|
||||
@ -3,8 +3,6 @@ package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.InputType;
|
||||
@ -12,9 +10,7 @@ import android.text.SpannableString;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@ -42,10 +38,10 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
@ -67,9 +63,14 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
public ObservableField<BigDecimal> currentQtaCnf = new ObservableField<>();
|
||||
public ObservableField<BigDecimal> currentQtaTot = new ObservableField<>();
|
||||
|
||||
public ObservableField<BigDecimal> currentTaraTot = new ObservableField<>();
|
||||
public ObservableField<BigDecimal> currentTaraArticolo = new ObservableField<>();
|
||||
public ObservableField<BigDecimal> currentPesoLordo = new ObservableField<>();
|
||||
|
||||
public ObservableField<Boolean> enabledNumCnf = new ObservableField<>(true);
|
||||
public ObservableField<Boolean> enabledQtaCnf = new ObservableField<>(true);
|
||||
public ObservableField<Boolean> enabledQtaTot = new ObservableField<>(true);
|
||||
public ObservableField<Boolean> enabledPesoLordo = new ObservableField<>(false);
|
||||
|
||||
public ObservableField<Boolean> enabledChangePartitaMag = new ObservableField<>(true);
|
||||
public ObservableField<Boolean> enabledNotes = new ObservableField<>(false);
|
||||
@ -144,7 +145,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
}
|
||||
|
||||
|
||||
if (mDialogInputQuantityV2DTO.isSaveOnImeDone()){
|
||||
if (mDialogInputQuantityV2DTO.isSaveOnImeDone()) {
|
||||
|
||||
mBindings.inputNumCnfText.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
@ -206,6 +207,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
}
|
||||
|
||||
private void init() {
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.currentPartitaMag, (value) -> {
|
||||
if (this.mEnableDataCallback) {
|
||||
this.mViewModel.setPartitaMag(value);
|
||||
@ -351,6 +353,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
this.mViewModel.shouldAskDataScad = this.mDialogInputQuantityV2DTO.isDataScadMandatory();
|
||||
this.enabledNotes.set(this.mDialogInputQuantityV2DTO.isNotesAllowed());
|
||||
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
|
||||
this.currentTaraArticolo.set(this.mViewModel.getMtbAart().getTaraKg());
|
||||
}
|
||||
|
||||
|
||||
@ -376,11 +379,17 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
this.currentPartitaMag.set(this.mViewModel.getPartitaMag());
|
||||
this.currentNotes.set(this.mViewModel.getNote());
|
||||
this.currentDataScad.set(this.mViewModel.getDataScad());
|
||||
|
||||
this.currentNumCnf.set(this.mViewModel.getNumCnf());
|
||||
this.currentQtaCnf.set(this.mViewModel.getQtaCnf());
|
||||
this.currentQtaTot.set(this.mViewModel.getQtaTot());
|
||||
|
||||
MtbAart articolo = this.mViewModel.getMtbAart();
|
||||
if (articolo != null && !articolo.isFlagQtaCnfFissaBoolean()) {
|
||||
BigDecimal taraTot = this.mViewModel.getNumCnf().multiply(articolo.getTaraKg());
|
||||
this.currentTaraTot.set(taraTot);
|
||||
this.currentPesoLordo.set(this.mViewModel.getQtaTot().add(taraTot));
|
||||
}
|
||||
|
||||
this.mBindings.executePendingBindings();
|
||||
|
||||
this.mEnableDataCallback = true;
|
||||
|
||||
@ -63,7 +63,7 @@ public class DialogInputQuantityV2ViewModel {
|
||||
private String internalNote;
|
||||
private Date internalDataScad;
|
||||
|
||||
private RunnableArgsWithReturn<DialogInputQuantityV2ViewModel,String> suggestPartitaMagRunnable;
|
||||
private RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> suggestPartitaMagRunnable;
|
||||
|
||||
private boolean canOverflowOrderQuantity;
|
||||
private boolean canPartitaMagBeChanged;
|
||||
@ -102,7 +102,7 @@ public class DialogInputQuantityV2ViewModel {
|
||||
this.internalQtaTot = totalQtaOrd;
|
||||
}
|
||||
|
||||
if (this.shouldAskDataScad == null){
|
||||
if (this.shouldAskDataScad == null) {
|
||||
this.shouldAskDataScad = mtbAart.get().isFlagTracciabilitaBoolean() && mtbAart.get().getGgScadPartita() != null && mtbAart.get().getGgScadPartita() > 0;
|
||||
}
|
||||
this.shouldShowDataScad = this.shouldAskDataScad || this.internalDataScad != null;
|
||||
@ -151,7 +151,7 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return;
|
||||
}
|
||||
|
||||
if(canPartitaMagBeChanged) {
|
||||
if (canPartitaMagBeChanged) {
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||
this.setPartitaMag(ean128Model.BatchLot);
|
||||
@ -334,7 +334,8 @@ public class DialogInputQuantityV2ViewModel {
|
||||
this.internalQtaTot = UtilityBigDecimal.multiply(newValue, this.internalQtaCnf);
|
||||
break;
|
||||
|
||||
case UPDATE_QTA_TOT:if (!this.blockedQtaTot.get() && this.internalQtaCnf != null)
|
||||
case UPDATE_QTA_TOT:
|
||||
if (!this.blockedQtaTot.get() && this.internalQtaCnf != null)
|
||||
this.internalQtaTot = UtilityBigDecimal.multiply(newValue, this.internalQtaCnf);
|
||||
else if (!this.blockedQtaCnf.get() && !this.mtbAart.get().isFlagQtaCnfFissaBoolean() && this.internalQtaTot != null)
|
||||
this.internalQtaCnf = UtilityBigDecimal.divide(internalQtaTot, newValue);
|
||||
@ -403,13 +404,13 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return false;
|
||||
|
||||
} else if (mtbAart.get().isFlagTracciabilitaBoolean() && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||
if (suggestPartitaMagRunnable != null){
|
||||
if (suggestPartitaMagRunnable != null) {
|
||||
internalPartitaMag = suggestPartitaMagRunnable.run(this);
|
||||
if (internalPartitaMag == null){
|
||||
if (internalPartitaMag == null) {
|
||||
this.mListener.onError(new InvalidBatchLotException());
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
this.mListener.onError(new InvalidBatchLotException());
|
||||
return false;
|
||||
}
|
||||
@ -480,11 +481,16 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setSuggestPartitaMagRunnable(RunnableArgsWithReturn<DialogInputQuantityV2ViewModel,String> suggestPartitaMagRunnable) {
|
||||
public DialogInputQuantityV2ViewModel setSuggestPartitaMagRunnable(RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> suggestPartitaMagRunnable) {
|
||||
this.suggestPartitaMagRunnable = suggestPartitaMagRunnable;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public MtbAart getMtbAart() {
|
||||
return this.mtbAart.get();
|
||||
}
|
||||
|
||||
public interface Listener {
|
||||
void onDataChanged();
|
||||
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
|
||||
|
||||
public class NoteAggiuntiveLUDialog {
|
||||
|
||||
private Dialog mDialog;
|
||||
|
||||
public static Dialog make(Context context, final RunnableArgs<String> onComplete) {
|
||||
return new NoteAggiuntiveLUDialog(context, onComplete).mDialog;
|
||||
}
|
||||
|
||||
private NoteAggiuntiveLUDialog(Context context, final RunnableArgs<String> onComplete){
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||
DialogNoteAggiuntiveNuovaUlBinding bindings = DataBindingUtil.inflate(inflater, R.layout.dialog_note_aggiuntive_nuova_ul, null, false);
|
||||
|
||||
|
||||
mDialog = new Dialog(context);
|
||||
mDialog.setContentView(bindings.getRoot());
|
||||
|
||||
mDialog.setCanceledOnTouchOutside(false);
|
||||
mDialog.setCancelable(false);
|
||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
UtilityDialog.setTo90PercentWidth(context, mDialog);
|
||||
|
||||
|
||||
bindings.buttonConfirm.setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
if(onComplete != null) onComplete.run(bindings.additionalNotesText.getText().toString());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -13,6 +13,10 @@
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
|
||||
<import type="androidx.core.content.ContextCompat" />
|
||||
|
||||
<variable
|
||||
name="viewmodel"
|
||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ViewModel" />
|
||||
@ -536,7 +540,89 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
android:visibility="@{viewmodel.mtbAart.isFlagQtaCnfFissaBoolean() ? View.GONE : View.VISIBLE}"
|
||||
android:weightSum="3">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_tara_ped_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:paddingEnd="4dp"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_tara_ped_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:textColor="@color/gray_400"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_art"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.currentTaraArticolo}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_tara_col_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:paddingEnd="4dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_tara_col_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:textColor="@color/gray_400"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_pckg"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
app:binding="@{view.currentTaraTot}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_peso_lordo_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="@{view.enabledPesoLordo}"
|
||||
android:focusableInTouchMode="false"
|
||||
android:imeOptions="actionDone"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_peso_lordo_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/LU_weight"
|
||||
android:inputType="number"
|
||||
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
|
||||
android:textColor="@{ContextCompat.getColor(context, view.enabledQtaCnf ? android.R.color.black : R.color.gray_400)}"
|
||||
app:binding="@{view.currentPesoLordo}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_note_layout"
|
||||
@ -544,8 +630,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.enabledNotes}"
|
||||
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
|
||||
>
|
||||
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_note_text"
|
||||
|
||||
@ -363,6 +363,74 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/net_weight"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{viewModel.mtbColt.pesoNettoKg.toString()}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline5"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/gross_weight"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline6"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{viewModel.mtbColt.pesoKg.toString()}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline6"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@ -2,8 +2,7 @@
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
>
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
@ -15,6 +14,10 @@
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
|
||||
<import type="androidx.core.content.ContextCompat" />
|
||||
|
||||
<variable
|
||||
name="viewmodel"
|
||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ViewModel" />
|
||||
@ -70,6 +73,7 @@
|
||||
android:text="@{viewmodel.mtbAart.codMart}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
tools:text="COD MART (Partita mag)" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
|
||||
android:id="@+id/unt_mis"
|
||||
@ -553,7 +557,88 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
android:visibility="@{viewmodel.mtbAart.isFlagQtaCnfFissaBoolean() ? View.GONE : View.VISIBLE}"
|
||||
android:weightSum="3">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_tara_ped_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:paddingEnd="4dp"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_tara_ped_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:textColor="@color/gray_400"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_art"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.currentTaraArticolo}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_tara_col_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:paddingEnd="4dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_tara_col_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:textColor="@color/gray_400"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_pckg"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
app:binding="@{view.currentTaraTot}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_peso_lordo_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="@{view.enabledPesoLordo}"
|
||||
android:focusableInTouchMode="false"
|
||||
android:imeOptions="actionDone"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_peso_lordo_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/LU_weight"
|
||||
android:inputType="number"
|
||||
android:textColor="@{ContextCompat.getColor(context, view.enabledQtaCnf ? android.R.color.black : R.color.gray_400)}"
|
||||
app:binding="@{view.currentPesoLordo}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_note_layout"
|
||||
@ -561,8 +646,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.enabledNotes}"
|
||||
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
|
||||
>
|
||||
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_note_text"
|
||||
|
||||
@ -12,6 +12,14 @@
|
||||
<variable
|
||||
name="mContext"
|
||||
type="android.content.Context" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialog" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialogViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
@ -52,6 +60,29 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_cod_tcol"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_text"
|
||||
app:layout_constraintBottom_toTopOf="@id/level_number_layout"
|
||||
android:hint="@string/lu_type">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_cod_tcol"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:nextFocusForward="@id/filled_exposed_dropdown_cod_jfas"
|
||||
app:binding="@{view.selectedMtbTcol}"
|
||||
android:singleLine="true" />
|
||||
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/level_number_layout"
|
||||
@ -59,7 +90,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_text">
|
||||
app:layout_constraintTop_toBottomOf="@id/input_cod_tcol">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/additional_notes_text"
|
||||
@ -67,6 +98,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_additional_notes"
|
||||
app:binding="@{view.additionalNotes}"
|
||||
android:inputType="text" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@ -117,7 +117,6 @@
|
||||
<string name="piece">Pezzo</string>
|
||||
|
||||
|
||||
|
||||
<string name="password_error_length">deve essere tra 3 e 30 caratteri</string>
|
||||
<string name="username_error_not_valid">inserire un username valido</string>
|
||||
<string name="server_cod_azienda_error_not_valid">inserire un codice azienda valido</string>
|
||||
@ -137,6 +136,7 @@
|
||||
<string name="quantity_short">Qtà</string>
|
||||
<string name="net_weight">Peso netto (KG)</string>
|
||||
<string name="gross_weight">Peso lordo (KG)</string>
|
||||
<string name="LU_weight">Peso Collo (KG)</string>
|
||||
<string name="lu_type">Tipo pedana</string>
|
||||
|
||||
<string name="total_ordered">Totale ordinato</string>
|
||||
@ -158,6 +158,7 @@
|
||||
<string name="tot_kg">Peso totale</string>
|
||||
<string name="tare_lu">Tara pedana</string>
|
||||
<string name="tare_pckg">Tara collo</string>
|
||||
<string name="tare_art">Tara articolo</string>
|
||||
|
||||
<string name="saving">Salvataggio</string>
|
||||
<string name="data_saved">Salvataggio completato</string>
|
||||
|
||||
@ -134,6 +134,7 @@
|
||||
<string name="quantity_short">Qty</string>
|
||||
<string name="net_weight">Net weight (KG)</string>
|
||||
<string name="gross_weight">Gross weight (KG)</string>
|
||||
<string name="LU_weight">LU weight (KG)</string>
|
||||
<string name="lu_type">LU type</string>
|
||||
|
||||
<string name="total_ordered">Total ordered</string>
|
||||
@ -156,6 +157,7 @@
|
||||
<string name="kg_x_pck">Qty x pck</string>
|
||||
<string name="tot_kg">Tot qty</string>
|
||||
<string name="tare_lu">Tare LU</string>
|
||||
<string name="tare_art">Tare product</string>
|
||||
<string name="tare_pckg">Tare pckg</string>
|
||||
|
||||
<string name="saving">Saving</string>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user