Fixato tasto annulla in picking libero.
Fixata creazione UL in Picking Libero.
This commit is contained in:
parent
38f7be5076
commit
a2f719441f
@ -217,7 +217,22 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
|
|
||||||
|
if(!thereIsAnOpenedUL.get()) {
|
||||||
|
createNewLU(null, null, progressDialog, () -> {
|
||||||
|
executeEtichetteBehaviour(data, progressDialog);
|
||||||
|
}, () -> {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
executeEtichetteBehaviour(data, progressDialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
private void executeEtichetteBehaviour(BarcodeScanDTO data, ProgressDialog progressDialog){
|
||||||
if(UtilityBarcode.isEtichettaAnonima(data)){
|
if(UtilityBarcode.isEtichettaAnonima(data)){
|
||||||
//Cerco gli articoli presenti nell'ul dell'etichetta anonima
|
//Cerco gli articoli presenti nell'ul dell'etichetta anonima
|
||||||
this.executeEtichettaLU(data.getStringValue(), progressDialog);
|
this.executeEtichettaLU(data.getStringValue(), progressDialog);
|
||||||
@ -229,8 +244,7 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
private void executeEtichettaLU(String sscc, ProgressDialog progressDialog) {
|
private void executeEtichettaLU(String sscc, ProgressDialog progressDialog) {
|
||||||
@ -341,6 +355,9 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
saveLU(clonedTestata);
|
saveLU(clonedTestata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}, () -> {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
BarcodeManager.enable();
|
||||||
});
|
});
|
||||||
|
|
||||||
}, () -> {
|
}, () -> {
|
||||||
@ -350,21 +367,19 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void askQuantities(Iterator<MtbColr> sourceMtbColrs, List<MtbColr> destMtbColr, Runnable onComplete){
|
private void askQuantities(Iterator<MtbColr> sourceMtbColrs, List<MtbColr> destMtbColr, Runnable onComplete, Runnable onAbort){
|
||||||
|
|
||||||
if(sourceMtbColrs.hasNext()){
|
if(sourceMtbColrs.hasNext()){
|
||||||
|
|
||||||
askSingleQuantity(sourceMtbColrs.next(), mtbColr -> {
|
askSingleQuantity(sourceMtbColrs.next(), mtbColr -> {
|
||||||
destMtbColr.add(mtbColr);
|
destMtbColr.add(mtbColr);
|
||||||
askQuantities(sourceMtbColrs, destMtbColr, onComplete);
|
askQuantities(sourceMtbColrs, destMtbColr, onComplete, onAbort);
|
||||||
});
|
}, onAbort);
|
||||||
} else {
|
} else {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void askSingleQuantity(MtbColr mtbColr, RunnableArgs<MtbColr> onComplete) {
|
private void askSingleQuantity(MtbColr mtbColr, RunnableArgs<MtbColr> onComplete, Runnable onAbort) {
|
||||||
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
||||||
.setBatchLot(mtbColr.getPartitaMag())
|
.setBatchLot(mtbColr.getPartitaMag())
|
||||||
.setDataScad(mtbColr.getDataScadPartitaD())
|
.setDataScad(mtbColr.getDataScadPartitaD())
|
||||||
@ -378,13 +393,15 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
.setMaxQta(mtbColr.getQtaCol());
|
.setMaxQta(mtbColr.getQtaCol());
|
||||||
|
|
||||||
DialogInputQuantity.makeBase(mContext, dto, false, quantityDTO -> {
|
DialogInputQuantity.makeBase(mContext, dto, false, quantityDTO -> {
|
||||||
mtbColr
|
if(quantityDTO != null) {
|
||||||
.setQtaCol(new BigDecimal(quantityDTO.qtaTot.get()))
|
mtbColr
|
||||||
.setQtaCnf(new BigDecimal(quantityDTO.qtaCnf.get()))
|
.setQtaCol(new BigDecimal(quantityDTO.qtaTot.get()))
|
||||||
.setNumCnf(new BigDecimal(quantityDTO.numCnf.get()))
|
.setQtaCnf(new BigDecimal(quantityDTO.qtaCnf.get()))
|
||||||
.setDatetimeRow(new Date());
|
.setNumCnf(new BigDecimal(quantityDTO.numCnf.get()))
|
||||||
|
.setDatetimeRow(new Date());
|
||||||
|
|
||||||
onComplete.run(mtbColr);
|
onComplete.run(mtbColr);
|
||||||
|
} else onAbort.run();
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,12 +455,13 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
|
|
||||||
|
|
||||||
public void createNewLU() {
|
public void createNewLU() {
|
||||||
createNewLU(null, null, null);
|
createNewLU(null, null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
private void createNewLU(Integer customNumCollo, String customSerCollo, ProgressDialog progressDialog, Runnable onComplete, Runnable onFailed) {
|
||||||
|
|
||||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
boolean shouldCloseProgress = progressDialog == null;
|
||||||
|
final ProgressDialog progressDialogFinal = progressDialog == null ? UtilityProgress.createDefaultProgressDialog(mContext) : progressDialog;
|
||||||
|
|
||||||
MtbColt mtbColt = new MtbColt();
|
MtbColt mtbColt = new MtbColt();
|
||||||
mtbColt .setGestione(GestioneEnum.VENDITA)
|
mtbColt .setGestione(GestioneEnum.VENDITA)
|
||||||
@ -462,7 +480,7 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
savedMtbColt.setMtbColr(new ObservableArrayList<>());
|
savedMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
setULToCurrentContext(savedMtbColt);
|
setULToCurrentContext(savedMtbColt);
|
||||||
|
|
||||||
progressDialog.dismiss();
|
if(shouldCloseProgress) progressDialogFinal.dismiss();
|
||||||
|
|
||||||
new StatusBarAlert.Builder(mContext)
|
new StatusBarAlert.Builder(mContext)
|
||||||
.autoHide(true)
|
.autoHide(true)
|
||||||
@ -474,7 +492,10 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
if(onComplete != null) onComplete.run();
|
||||||
|
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progressDialog));
|
}, ex -> {
|
||||||
|
UtilityExceptions.defaultException(mContext, ex, progressDialogFinal);
|
||||||
|
if(onFailed != null) onFailed.run();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -485,13 +506,15 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
this.mtbColt.set(mtbColt);
|
this.mtbColt.set(mtbColt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void closeLU() {
|
public void closeLU() {
|
||||||
if(thereIsAnOpenedUL.get()) {
|
if(thereIsAnOpenedUL.get()) {
|
||||||
final ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
final ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
if(thereIsAnyRowInUL.get()) {
|
if(thereIsAnyRowInUL.get()) {
|
||||||
updateDataFine(progress, null); //() -> distribuisciCollo(progress, () -> printCollo(progress)));
|
updateDataFine(progress, () -> {
|
||||||
|
progress.dismiss();
|
||||||
|
setULToCurrentContext(null);
|
||||||
|
}); //() -> distribuisciCollo(progress, () -> printCollo(progress)));
|
||||||
} else {
|
} else {
|
||||||
deleteCollo(progress);
|
deleteCollo(progress);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import android.app.AlertDialog;
|
|||||||
import android.app.DatePickerDialog;
|
import android.app.DatePickerDialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.databinding.Observable;
|
import androidx.databinding.Observable;
|
||||||
@ -251,7 +252,9 @@ public class DialogInputQuantity {
|
|||||||
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
|
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
|
||||||
.setView(currentBinding.getRoot())
|
.setView(currentBinding.getRoot())
|
||||||
.setPositiveButton(context.getText(R.string.confirm), null)
|
.setPositiveButton(context.getText(R.string.confirm), null)
|
||||||
.setNegativeButton(context.getText(R.string.abort), null);
|
.setNegativeButton(context.getText(R.string.abort), (dialog, which) -> {
|
||||||
|
dialogCallback.onResult(null);
|
||||||
|
});
|
||||||
|
|
||||||
currentAlert = alertDialog.create();
|
currentAlert = alertDialog.create();
|
||||||
currentAlert.setCanceledOnTouchOutside(false);
|
currentAlert.setCanceledOnTouchOutside(false);
|
||||||
@ -275,8 +278,8 @@ public class DialogInputQuantity {
|
|||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
Button positiveButton = currentAlert.getButton(AlertDialog.BUTTON_POSITIVE);
|
Button positiveButton = currentAlert.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||||
|
|
||||||
positiveButton.setOnClickListener(view -> onConfirm(context, currentQuantityDto, dialogCallback));
|
positiveButton.setOnClickListener(view -> onConfirm(context, currentQuantityDto, dialogCallback));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user