Finish v1_12_6(135)
This commit is contained in:
commit
7478b4f2ec
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 134
|
||||
def appVersionName = '1.12.5'
|
||||
def appVersionCode = 135
|
||||
def appVersionName = '1.12.6'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -4,14 +4,18 @@ import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.text.SpannableString;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
@ -83,7 +87,6 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
public BindableBoolean isMtbColtLoaded = new BindableBoolean();
|
||||
|
||||
|
||||
|
||||
public void init(Activity context, FragmentMainRettificaGiacenzeBinding binding, RettificaGiacenzeHelper helper) {
|
||||
mContext = context;
|
||||
mBinding = binding;
|
||||
@ -96,12 +99,13 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
isFabVisible.set(mtbColt != null);
|
||||
isMtbColtLoaded.set(mtbColt != null);
|
||||
|
||||
if(this.mtbColt.get().getMtbColr() == null) this.mtbColt.get().setMtbColr(new ObservableArrayList<>());
|
||||
if (this.mtbColt.get().getMtbColr() == null)
|
||||
this.mtbColt.get().setMtbColr(new ObservableArrayList<>());
|
||||
else {
|
||||
ObservableArrayList<MtbColr> mtbColrList = this.mtbColt.get().getMtbColr();
|
||||
|
||||
for(int i = 0; i < mtbColrList.size(); i++) {
|
||||
if(mtbColrList.get(i).getQtaCol() == null || mtbColrList.get(i).getQtaCol().floatValue() < 0){
|
||||
for (int i = 0; i < mtbColrList.size(); i++) {
|
||||
if (mtbColrList.get(i).getQtaCol() == null || mtbColrList.get(i).getQtaCol().floatValue() < 0) {
|
||||
mtbColrList.remove(i);
|
||||
i--;
|
||||
}
|
||||
@ -165,9 +169,9 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
if(data.getType() == BarcodeType.EAN8 || data.getType() == BarcodeType.EAN13 || data.getType() == BarcodeType.UPCA){
|
||||
if (data.getType() == BarcodeType.EAN8 || data.getType() == BarcodeType.EAN13 || data.getType() == BarcodeType.UPCA) {
|
||||
searchArtInt(data.getStringValue(), progressDialog);
|
||||
} else if(UtilityBarcode.isEtichetta128(data)) {
|
||||
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaEan128(data, progressDialog);
|
||||
} else {
|
||||
BarcodeManager.enable();
|
||||
@ -182,11 +186,12 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
String barcodeProd = null;
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Content)) barcodeProd = ean128Model.Content;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
|
||||
barcodeProd = ean128Model.Content;
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
if (barcodeProd.startsWith("0") || barcodeProd.startsWith("9")) {
|
||||
barcodeProd = barcodeProd.substring(1, barcodeProd.length());
|
||||
}
|
||||
@ -196,7 +201,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
progressDialog.dismiss();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
}, ex-> {
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
@ -204,14 +209,14 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
|
||||
private void loadBarcodeArticolo(String barcodeProd, Ean128Model ean128Model, Dialog progressDialog) {
|
||||
if(barcodeProd.length() == 14) {
|
||||
if (barcodeProd.length() == 14) {
|
||||
// barcodeProd = UtilityBarcode.convertITF14toNeutral(barcodeProd);
|
||||
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
||||
}
|
||||
|
||||
ArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
||||
|
||||
if(mtbAartList != null && mtbAartList.size() > 0) {
|
||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||
|
||||
this.dispatchArt(mtbAartList.get(0), ean128Model);
|
||||
|
||||
@ -243,12 +248,12 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
mBinding.inputCodArtDescrForn.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
resetAllError();
|
||||
if(UtilityString.isNullOrEmpty(mBinding.autoCompleteFornitori.getText().toString())) {
|
||||
if (UtilityString.isNullOrEmpty(mBinding.autoCompleteFornitori.getText().toString())) {
|
||||
setError(mBinding.autoCompleteFornitoriLayout, mContext.getResources().getText(R.string.error).toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrForn.getText().toString())) {
|
||||
if (UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrForn.getText().toString())) {
|
||||
setError(mBinding.layoutCodArtDescrForn, mContext.getResources().getText(R.string.error).toString());
|
||||
return true;
|
||||
}
|
||||
@ -266,7 +271,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
resetAllError();
|
||||
|
||||
if(UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrInt.getText().toString())) {
|
||||
if (UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrInt.getText().toString())) {
|
||||
setError(mBinding.layoutCodArtDescrInt, mContext.getResources().getText(R.string.error).toString());
|
||||
return true;
|
||||
}
|
||||
@ -279,7 +284,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
|
||||
private void setError(TextInputLayout textInputLayout, String message){
|
||||
private void setError(TextInputLayout textInputLayout, String message) {
|
||||
textInputLayout.setErrorEnabled(true);
|
||||
textInputLayout.setError(message);
|
||||
}
|
||||
@ -294,7 +299,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
//mBinding.autoCompleteFornitori.setText("");
|
||||
mBinding.inputCodArtDescrForn.setText("");
|
||||
mBinding.inputCodArtDescrInt.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
private void resetError(TextInputLayout textInputLayout) {
|
||||
textInputLayout.setErrorEnabled(false);
|
||||
@ -328,12 +333,12 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
|
||||
private void dispatchArtsList(List<MtbAart> articoloFornitoreDTOS){
|
||||
private void dispatchArtsList(List<MtbAart> articoloFornitoreDTOS) {
|
||||
|
||||
if(articoloFornitoreDTOS != null){
|
||||
if(articoloFornitoreDTOS.size() == 0) {
|
||||
if (articoloFornitoreDTOS != null) {
|
||||
if (articoloFornitoreDTOS.size() == 0) {
|
||||
showNoArtsFound();
|
||||
} else if(articoloFornitoreDTOS.size() == 1) {
|
||||
} else if (articoloFornitoreDTOS.size() == 1) {
|
||||
dispatchArt(articoloFornitoreDTOS.get(0), null);
|
||||
} else {
|
||||
DialogChooseArtFromListaArts.make(mContext, articoloFornitoreDTOS, mtbAart -> this.dispatchArt(mtbAart, null)).show();
|
||||
@ -350,7 +355,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
|
||||
private void dispatchArt(MtbAart mtbAart, Ean128Model ean128Model){
|
||||
private void dispatchArt(MtbAart mtbAart, Ean128Model ean128Model) {
|
||||
DialogInputQuantity.DTO qtaDto = new DialogInputQuantity.DTO();
|
||||
|
||||
qtaDto.setMtbAart(mtbAart);
|
||||
@ -366,17 +371,17 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
qtaDto.setCanDataScadBeChanged(true);
|
||||
|
||||
|
||||
if(ean128Model != null){
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||
if (ean128Model != null) {
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||
qtaDto.setBatchLot(ean128Model.BatchLot);
|
||||
qtaDto.setCanPartitaMagBeChanged(false);
|
||||
}
|
||||
|
||||
try {
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.BestBefore)) {
|
||||
qtaDto.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
|
||||
qtaDto.setCanDataScadBeChanged(false);
|
||||
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
||||
} else if (!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
||||
qtaDto.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
|
||||
qtaDto.setCanDataScadBeChanged(false);
|
||||
}
|
||||
@ -386,7 +391,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
|
||||
if(ean128Model.Count != null && ean128Model.Count > 0) {
|
||||
if (ean128Model.Count != null && ean128Model.Count > 0) {
|
||||
qtaDto.setNumCnf(ean128Model.Count);
|
||||
}
|
||||
|
||||
@ -407,7 +412,6 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void onPostDispatch(MtbAart mtbAart, QuantityDTO quantityDTO) {
|
||||
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
@ -445,7 +449,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
mtbColt.get().getMtbColr().add(mtbColr);
|
||||
|
||||
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
|
||||
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
resetTexts();
|
||||
progress.dismiss();
|
||||
@ -460,8 +464,6 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onItemClick(MtbColr item, int position) {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
@ -474,13 +476,13 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
mBinding.bottomSheetActionsEditBtn.setOnClickListener(v -> onItemEdit(item, position));
|
||||
mBinding.bottomSheetActionsDeleteBtn.setOnClickListener(v -> onItemDelete(item));
|
||||
|
||||
mBinding.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getQtaCol()) + " " + clickedItem.getMtbAart().getUntMis());
|
||||
mBinding.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getQtaCol()) + " " + clickedItem.getMtbAart().getUntMis());
|
||||
}
|
||||
|
||||
public void openLU() {
|
||||
DialogScanOrCreateLU.make(mContext, true, false, mtbColt -> {
|
||||
if(mtbColt == null) {
|
||||
((IPoppableActivity)mContext).pop();
|
||||
if (mtbColt == null) {
|
||||
((IPoppableActivity) mContext).pop();
|
||||
} else {
|
||||
setMtbColt(mtbColt);
|
||||
}
|
||||
@ -490,6 +492,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
public boolean thereIsAnOpenedUL() {
|
||||
return mtbColt.get() != null;
|
||||
}
|
||||
|
||||
public boolean thereIsAnyRowInUL() {
|
||||
return mtbColt.get() != null &&
|
||||
mtbColt.get().getMtbColr() != null &&
|
||||
@ -498,7 +501,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
public void closeLU(boolean openNewOne, boolean saveCausale) {
|
||||
|
||||
if(thereIsAnOpenedUL()) {
|
||||
if (thereIsAnOpenedUL()) {
|
||||
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
@ -526,8 +529,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
} else {
|
||||
|
||||
// ColliMagazzinoRESTConsumer.deleteCollo(mtbColt.get(), () -> {
|
||||
progress.dismiss();
|
||||
resetMtbColt(openNewOne);
|
||||
progress.dismiss();
|
||||
resetMtbColt(openNewOne);
|
||||
// }, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||
|
||||
}
|
||||
@ -552,21 +555,14 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mtbColt.get().clone();
|
||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
cloneMtbColt.setMtbCols(new ArrayList<>());
|
||||
cloneMtbColt.getMtbCols().add(mtbCols);
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||
@Override
|
||||
public void onSuccess(MtbColt value) {
|
||||
onComplete.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
DialogCommon.showRestError(mContext, ex, onComplete::run);
|
||||
}
|
||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, mtbColt -> onComplete.run(), ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
DialogCommon.showRestError(mContext, ex, onComplete::run);
|
||||
});
|
||||
}
|
||||
|
||||
@ -574,10 +570,10 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
DialogYesNo.make(mContext, "Posiziona UL", "Vuoi cambiare la posizione della UL corrente?", result -> {
|
||||
|
||||
switch (result){
|
||||
switch (result) {
|
||||
case YES:
|
||||
DialogAskPositionOfLU.makeBase(mContext, mtbColt.get(), false, (status, mtbDepoPosizione) -> {
|
||||
if(status == DialogConsts.Results.ABORT) {
|
||||
if (status == DialogConsts.Results.ABORT) {
|
||||
onAbort.run();
|
||||
} else {
|
||||
if (mtbDepoPosizione != null && mtbColt.get() != null) {
|
||||
@ -622,7 +618,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
BigDecimal qtaCol = value.qtaTot.getBigDecimal().subtract(mtbColrToEditClone.getQtaCol());
|
||||
|
||||
if(qtaCol.compareTo(BigDecimal.ZERO) != 0) {
|
||||
if (qtaCol.compareTo(BigDecimal.ZERO) != 0) {
|
||||
|
||||
BigDecimal numCnf = value.numCnf.getBigDecimal().subtract(mtbColrToEditClone.getNumCnf());
|
||||
|
||||
@ -696,12 +692,11 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void printCollo(Dialog progress) {
|
||||
|
||||
this.showAskPrint(shouldPrint -> {
|
||||
|
||||
if(shouldPrint) {
|
||||
if (shouldPrint) {
|
||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), new ISimpleOperationCallback<List<String>>() {
|
||||
@Override
|
||||
public void onSuccess(List<String> value) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user