Rimosso definitivamente DialogInputQuantity.
Fix su scansione barcodes posizioni.
This commit is contained in:
parent
c7777b261d
commit
4e36053ba6
@ -91,7 +91,7 @@ dependencies {
|
|||||||
//Firebase
|
//Firebase
|
||||||
|
|
||||||
// Import the Firebase BoM
|
// Import the Firebase BoM
|
||||||
implementation platform('com.google.firebase:firebase-bom:26.0.0')
|
implementation platform('com.google.firebase:firebase-bom:26.3.0')
|
||||||
implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.google.firebase:firebase-analytics'
|
||||||
implementation 'com.google.firebase:firebase-core'
|
implementation 'com.google.firebase:firebase-core'
|
||||||
implementation 'com.google.firebase:firebase-crash'
|
implementation 'com.google.firebase:firebase-crash'
|
||||||
@ -102,7 +102,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.3.0-alpha04'
|
implementation 'com.google.android.material:material:1.3.0-rc01'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||||
|
|||||||
@ -44,7 +44,7 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer{
|
|||||||
public static void getBancaliInPosizione(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getBancaliInPosizione(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
|
||||||
String sql = "SELECT * FROM mtb_colt WHERE cod_mdep = " + UtilityDB.valueToString(mtbDepoPosizione.getCodMdep()) + " AND posizione = " + UtilityDB.valueToString(mtbDepoPosizione.getPosizione());
|
String sql = "SELECT * FROM mtb_colt WHERE segno > 0 AND cod_mdep = " + UtilityDB.valueToString(mtbDepoPosizione.getCodMdep()) + " AND posizione = " + UtilityDB.valueToString(mtbDepoPosizione.getPosizione());
|
||||||
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale.viewmodel;
|
package it.integry.integrywmsnative.gest.prod_recupero_materiale.viewmodel;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
@ -18,6 +17,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
@ -31,6 +31,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
@ -39,15 +40,16 @@ import it.integry.integrywmsnative.databinding.FragmentProdRecuperoMaterialeBind
|
|||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.HistoryULsListAdapter;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.HistoryULsListAdapter;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.ProdRecuperoMaterialeHelper;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.ProdRecuperoMaterialeHelper;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
|
||||||
|
|
||||||
public class ProdRecuperoMaterialeViewModel {
|
public class ProdRecuperoMaterialeViewModel {
|
||||||
|
|
||||||
private Context mContext;
|
private FragmentActivity mContext;
|
||||||
|
|
||||||
private FragmentProdRecuperoMaterialeBinding mBinding;
|
private FragmentProdRecuperoMaterialeBinding mBinding;
|
||||||
private ProdRecuperoMaterialeHelper mHelper;
|
private ProdRecuperoMaterialeHelper mHelper;
|
||||||
@ -61,7 +63,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
|
|
||||||
private int barcodeScannerIstanceID = -1;
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
|
||||||
public void init(Activity context, FragmentProdRecuperoMaterialeBinding binding, ProdRecuperoMaterialeHelper helper, Runnable onRecuperoCompleted) {
|
public void init(FragmentActivity context, FragmentProdRecuperoMaterialeBinding binding, ProdRecuperoMaterialeHelper helper, Runnable onRecuperoCompleted) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mBinding = binding;
|
mBinding = binding;
|
||||||
mHelper = helper;
|
mHelper = helper;
|
||||||
@ -152,32 +154,72 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// private void dispatchItem(HistoryVersamentoProdULDTO item, MtbColt sourceMtbColt, Dialog dialogProgress) {
|
||||||
|
// BigDecimal qtaDaEvadere = BigDecimal.ZERO;
|
||||||
|
//
|
||||||
|
// qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
||||||
|
// .setBatchLot(item.getPartitaMag())
|
||||||
|
// .setQtaDaEvadere(null)
|
||||||
|
// .setQtaOrd(null)
|
||||||
|
// .setMtbAart(item.getMtbAart())
|
||||||
|
// .setCanPartitaMagBeChanged(false)
|
||||||
|
// .setNumCnf(1)
|
||||||
|
// .setQtaCnf(item.getQtaCnf())
|
||||||
|
// .setQtaTot(item.getQtaCnf())
|
||||||
|
// .setMaxQta(qtaDaEvadere)
|
||||||
|
// .setQtaDisponibile(qtaDaEvadere);
|
||||||
|
//
|
||||||
|
// DialogInputQuantity.makeBase(mContext, dto, false, quantity -> {
|
||||||
|
// onItemDispatched(item, quantity.qtaTot.getBigDecimal(), sourceMtbColt, dialogProgress);
|
||||||
|
// }, () -> {
|
||||||
|
// if (dialogProgress != null) dialogProgress.dismiss();
|
||||||
|
// }).show();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
private void dispatchItem(HistoryVersamentoProdULDTO item, MtbColt sourceMtbColt, Dialog dialogProgress) {
|
private void dispatchItem(HistoryVersamentoProdULDTO item, MtbColt sourceMtbColt, Dialog dialogProgress) {
|
||||||
BigDecimal qtaDaEvadere = BigDecimal.ZERO;
|
BigDecimal qtaDaEvadere = BigDecimal.ZERO;
|
||||||
|
BigDecimal numCnfDaEvadere = BigDecimal.ZERO;
|
||||||
|
|
||||||
qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
||||||
|
|
||||||
|
if(!UtilityBigDecimal.equalsTo(qtaDaEvadere, BigDecimal.ZERO)) {
|
||||||
|
numCnfDaEvadere = UtilityBigDecimal.divide(qtaDaEvadere, item.getQtaCnf());
|
||||||
|
}
|
||||||
|
|
||||||
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||||
.setBatchLot(item.getPartitaMag())
|
|
||||||
.setQtaDaEvadere(null)
|
|
||||||
.setQtaOrd(null)
|
|
||||||
.setMtbAart(item.getMtbAart())
|
.setMtbAart(item.getMtbAart())
|
||||||
.setCanPartitaMagBeChanged(false)
|
.setInitialNumCnf(BigDecimal.ONE)
|
||||||
.setNumCnf(1)
|
.setInitialQtaCnf(item.getQtaCnf())
|
||||||
.setQtaCnf(item.getQtaCnf())
|
.setInitialQtaTot(item.getQtaCnf())
|
||||||
.setQtaTot(item.getQtaCnf())
|
|
||||||
.setMaxQta(qtaDaEvadere)
|
|
||||||
.setQtaDisponibile(qtaDaEvadere);
|
|
||||||
|
|
||||||
DialogInputQuantity.makeBase(mContext, dto, false, quantity -> {
|
.setTotalQtaAvailable(qtaDaEvadere)
|
||||||
onItemDispatched(item, quantity.qtaTot.getBigDecimal(), sourceMtbColt, dialogProgress);
|
.setTotalNumCnfAvailable(numCnfDaEvadere)
|
||||||
}, () -> {
|
.setQtaCnfAvailable(item.getQtaCnf())
|
||||||
if (dialogProgress != null) dialogProgress.dismiss();
|
.setPartitaMag(item.getPartitaMag())
|
||||||
}).show();
|
// .setDataScad(item.getDa)
|
||||||
|
.setCanOverflowOrderQuantity(false)
|
||||||
|
.setCanLUBeClosed(false);
|
||||||
|
|
||||||
|
DialogInputQuantityV2
|
||||||
|
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
||||||
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
|
.setQtaTot(resultDTO.getQtaTot())
|
||||||
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
|
onItemDispatched(item, resultDTO.getQtaTot(), sourceMtbColt, dialogProgress);
|
||||||
|
}, () -> {
|
||||||
|
if (dialogProgress != null) dialogProgress.dismiss();
|
||||||
|
})
|
||||||
|
.show(mContext.getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void onItemDispatched(HistoryVersamentoProdULDTO item, BigDecimal quantity, MtbColt sourceMtbColt, Dialog progress) {
|
private void onItemDispatched(HistoryVersamentoProdULDTO item, BigDecimal quantity, MtbColt sourceMtbColt, Dialog progress) {
|
||||||
|
|
||||||
if (progress == null) {
|
if (progress == null) {
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.gest.rettifica_giacenze;
|
package it.integry.integrywmsnative.gest.rettifica_giacenze;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -27,12 +25,12 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbCols;
|
import it.integry.integrywmsnative.core.model.MtbCols;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@ -40,7 +38,6 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
|
|||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.RettificaGiacenzeRESTConsumer;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.RettificaGiacenzeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.dto.FornitoreDTO;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.dto.FornitoreDTO;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||||
|
|
||||||
@ -329,7 +326,7 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
if (!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
// if (!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||||
mtbColr
|
mtbColr
|
||||||
.setQtaCol(BigDecimal.ZERO)
|
.setQtaCol(BigDecimal.ZERO)
|
||||||
.setNumCnf(BigDecimal.ZERO)
|
.setNumCnf(BigDecimal.ZERO)
|
||||||
@ -359,39 +356,39 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
if (shouldCloseLU) closeLU(true, null);
|
if (shouldCloseLU) closeLU(true, null);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
} else {
|
// } else {
|
||||||
mtbColr
|
// mtbColr
|
||||||
.setQtaCol(qtaTot)
|
// .setQtaCol(qtaTot)
|
||||||
.setQtaCnf(qtaCnf)
|
// .setQtaCnf(qtaCnf)
|
||||||
.setNumCnf(numCnf);
|
// .setNumCnf(numCnf);
|
||||||
|
//
|
||||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
// MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
// cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
//
|
||||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
// cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
|
//
|
||||||
cloneMtbColt.getMtbColr().add(mtbColr);
|
// cloneMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
// mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||||
mtbColr
|
// mtbColr
|
||||||
.setDataCollo(value.getDataColloS())
|
// .setDataCollo(value.getDataColloS())
|
||||||
.setNumCollo(value.getNumCollo())
|
// .setNumCollo(value.getNumCollo())
|
||||||
.setGestione(value.getGestione())
|
// .setGestione(value.getGestione())
|
||||||
.setSerCollo(value.getSerCollo())
|
// .setSerCollo(value.getSerCollo())
|
||||||
.setRiga(value.getMtbColr().get(0).getRiga())
|
// .setRiga(value.getMtbColr().get(0).getRiga())
|
||||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
// .setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
// .setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
//
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
// mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
this.mAnyEditDone = true;
|
// this.mAnyEditDone = true;
|
||||||
|
//
|
||||||
this.sendOnRowSaved();
|
// this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
// this.sendOnLoadingEnded();
|
||||||
|
//
|
||||||
if (shouldCloseLU) closeLU(true, null);
|
// if (shouldCloseLU) closeLU(true, null);
|
||||||
}, this::sendError);
|
// }, this::sendError);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -556,7 +553,7 @@ public class RettificaGiacenzeViewModel {
|
|||||||
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
// if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||||
|
|
||||||
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||||
mtbColrToUpdate,
|
mtbColrToUpdate,
|
||||||
@ -579,46 +576,46 @@ public class RettificaGiacenzeViewModel {
|
|||||||
this::sendError
|
this::sendError
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
|
//
|
||||||
MtbColt mtbColt = new MtbColt()
|
// MtbColt mtbColt = new MtbColt()
|
||||||
.setNumCollo(mtbColrToUpdate.getNumCollo())
|
// .setNumCollo(mtbColrToUpdate.getNumCollo())
|
||||||
.setDataCollo(mtbColrToUpdate.getDataColloS())
|
// .setDataCollo(mtbColrToUpdate.getDataColloS())
|
||||||
.setSerCollo(mtbColrToUpdate.getSerCollo())
|
// .setSerCollo(mtbColrToUpdate.getSerCollo())
|
||||||
.setGestione(mtbColrToUpdate.getGestione())
|
// .setGestione(mtbColrToUpdate.getGestione())
|
||||||
.setMtbColr(new ObservableArrayList<>());
|
// .setMtbColr(new ObservableArrayList<>());
|
||||||
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
// mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
//
|
||||||
final MtbColr mtbColr = (MtbColr) mtbColrToUpdate.clone();
|
// final MtbColr mtbColr = (MtbColr) mtbColrToUpdate.clone();
|
||||||
mtbColr
|
// mtbColr
|
||||||
.setNumCnf(numCnf.subtract(mtbColr.getNumCnf()))
|
// .setNumCnf(numCnf.subtract(mtbColr.getNumCnf()))
|
||||||
.setQtaCnf(qtaCnf)
|
// .setQtaCnf(qtaCnf)
|
||||||
.setQtaCol(qtaTot.subtract(mtbColr.getQtaCol()))
|
// .setQtaCol(qtaTot.subtract(mtbColr.getQtaCol()))
|
||||||
.setPartitaMag(partitaMag)
|
// .setPartitaMag(partitaMag)
|
||||||
.setDataScadPartita(dataScad)
|
// .setDataScadPartita(dataScad)
|
||||||
.setUtente(SettingsManager.i().getUser().getFullname())
|
// .setUtente(SettingsManager.i().getUser().getFullname())
|
||||||
.setCausale(MtbColr.Causale.RETTIFICA)
|
// .setCausale(MtbColr.Causale.RETTIFICA)
|
||||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
// .setDatetimeRow(UtilityDate.getDateInstance())
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
// .setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
//
|
||||||
mtbColt.getMtbColr().add(mtbColr);
|
// mtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
// this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||||
|
//
|
||||||
mtbColr.setNumCnf(numCnf)
|
// mtbColr.setNumCnf(numCnf)
|
||||||
.setQtaCnf(qtaCnf)
|
// .setQtaCnf(qtaCnf)
|
||||||
.setQtaCol(qtaTot);
|
// .setQtaCol(qtaTot);
|
||||||
|
//
|
||||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
// this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||||
this.mCurrentMtbColt.getMtbColr().add(mtbColr);
|
// this.mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
this.mAnyEditDone = true;
|
// this.mAnyEditDone = true;
|
||||||
|
//
|
||||||
this.sendOnRowSaved();
|
// this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
// this.sendOnLoadingEnded();
|
||||||
|
//
|
||||||
}, this::sendError);
|
// }, this::sendError);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteRow(MtbColr mtbColrToDelete) {
|
public void deleteRow(MtbColr mtbColrToDelete) {
|
||||||
@ -626,7 +623,7 @@ public class RettificaGiacenzeViewModel {
|
|||||||
if (shouldDelete) {
|
if (shouldDelete) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
// if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||||
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||||
mtbColrToDelete,
|
mtbColrToDelete,
|
||||||
BigDecimal.ZERO,
|
BigDecimal.ZERO,
|
||||||
@ -638,37 +635,37 @@ public class RettificaGiacenzeViewModel {
|
|||||||
},
|
},
|
||||||
this::sendError
|
this::sendError
|
||||||
);
|
);
|
||||||
} else {
|
// } else {
|
||||||
MtbColt mtbColt = new MtbColt()
|
// MtbColt mtbColt = new MtbColt()
|
||||||
.setNumCollo(mtbColrToDelete.getNumCollo())
|
// .setNumCollo(mtbColrToDelete.getNumCollo())
|
||||||
.setDataCollo(mtbColrToDelete.getDataColloS())
|
// .setDataCollo(mtbColrToDelete.getDataColloS())
|
||||||
.setSerCollo(mtbColrToDelete.getSerCollo())
|
// .setSerCollo(mtbColrToDelete.getSerCollo())
|
||||||
.setGestione(mtbColrToDelete.getGestione())
|
// .setGestione(mtbColrToDelete.getGestione())
|
||||||
.setMtbColr(new ObservableArrayList<>());
|
// .setMtbColr(new ObservableArrayList<>());
|
||||||
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
// mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
//
|
||||||
MtbColr mtbColr = (MtbColr) mtbColrToDelete.clone();
|
// MtbColr mtbColr = (MtbColr) mtbColrToDelete.clone();
|
||||||
mtbColr
|
// mtbColr
|
||||||
.setNumCnf(mtbColr.getNumCnf().multiply(new BigDecimal(-1)))
|
// .setNumCnf(mtbColr.getNumCnf().multiply(new BigDecimal(-1)))
|
||||||
.setQtaCnf(mtbColr.getQtaCnf())
|
// .setQtaCnf(mtbColr.getQtaCnf())
|
||||||
.setQtaCol(mtbColr.getQtaCol().multiply(new BigDecimal(-1)))
|
// .setQtaCol(mtbColr.getQtaCol().multiply(new BigDecimal(-1)))
|
||||||
.setPartitaMag(mtbColr.getPartitaMag())
|
// .setPartitaMag(mtbColr.getPartitaMag())
|
||||||
.setDataScadPartita(mtbColr.getDataScadPartitaD())
|
// .setDataScadPartita(mtbColr.getDataScadPartitaD())
|
||||||
.setUtente(SettingsManager.i().getUser().getFullname())
|
// .setUtente(SettingsManager.i().getUser().getFullname())
|
||||||
.setCausale(MtbColr.Causale.RETTIFICA)
|
// .setCausale(MtbColr.Causale.RETTIFICA)
|
||||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
// .setDatetimeRow(UtilityDate.getDateInstance())
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
// .setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
//
|
||||||
mtbColt.getMtbColr().add(mtbColr);
|
// mtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
// this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
// this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
||||||
|
//
|
||||||
this.sendOnRowSaved();
|
// this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
// this.sendOnLoadingEnded();
|
||||||
|
//
|
||||||
}, this::sendError);
|
// }, this::sendError);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,6 +137,10 @@ public class VersamentoMerceViewModel {
|
|||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
showTooMuchULFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
@ -148,6 +152,12 @@ public class VersamentoMerceViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showTooMuchULFound() {
|
||||||
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
|
new SpannableString(mContext.getResources().getText(R.string.too_much_lu_found_message_in_mono_lu)),
|
||||||
|
null, null).show();
|
||||||
|
}
|
||||||
|
|
||||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||||
BarcodeRESTConsumer.decodeEan128Static(barcodeScanDTO, ean128Model -> {
|
BarcodeRESTConsumer.decodeEan128Static(barcodeScanDTO, ean128Model -> {
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import com.google.android.material.textfield.TextInputLayout;
|
|||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
||||||
|
|
||||||
@ -55,6 +56,8 @@ public class DialogAskLivelloPosizione {
|
|||||||
mDialog.setCancelable(false);
|
mDialog.setCancelable(false);
|
||||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
|
||||||
|
UtilityDialog.setTo90PercentWidth(mContext, mDialog);
|
||||||
|
|
||||||
mDialog.setOnDismissListener(dialog -> {
|
mDialog.setOnDismissListener(dialog -> {
|
||||||
if(!completedFLow) onComplete.run(null);
|
if(!completedFLow) onComplete.run(null);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,755 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.input_quantity;
|
|
||||||
|
|
||||||
import android.app.DatePickerDialog;
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.ColorStateList;
|
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import androidx.databinding.Observable;
|
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Handler;
|
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
|
||||||
import android.text.Html;
|
|
||||||
import android.text.SpannableString;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
|
||||||
import android.widget.EditText;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|
||||||
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.utility.UtilityBarcode;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogInputQuantityArticoloBinding;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
|
||||||
|
|
||||||
public class DialogInputQuantity {
|
|
||||||
|
|
||||||
public static class DTO {
|
|
||||||
private MtbAart mtbAart;
|
|
||||||
private String batchLot;
|
|
||||||
private BigDecimal qtaDaEvadere;
|
|
||||||
private BigDecimal qtaDisponibile;
|
|
||||||
private BigDecimal qtaEvasa;
|
|
||||||
private BigDecimal qtaOrd;
|
|
||||||
private BigDecimal qtaTot;
|
|
||||||
private BigDecimal qtaCnf;
|
|
||||||
private Integer numCnf;
|
|
||||||
private BigDecimal maxQta;
|
|
||||||
private String codArtFor;
|
|
||||||
private Date dataScad;
|
|
||||||
private boolean canPartitaMagBeChanged;
|
|
||||||
private Boolean canDataScadBeChanged;
|
|
||||||
private Boolean shouldAskDataScad;
|
|
||||||
|
|
||||||
public MtbAart getMtbAart() {
|
|
||||||
return mtbAart;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setMtbAart(MtbAart mtbAart) {
|
|
||||||
this.mtbAart = mtbAart;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBatchLot() {
|
|
||||||
return batchLot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setBatchLot(String batchLot) {
|
|
||||||
this.batchLot = batchLot;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaDaEvadere() {
|
|
||||||
return qtaDaEvadere;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaDaEvadere(BigDecimal qtaDaEvadere) {
|
|
||||||
this.qtaDaEvadere = qtaDaEvadere;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaDisponibile() {
|
|
||||||
return qtaDisponibile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaDisponibile(BigDecimal qtaDisponibile) {
|
|
||||||
this.qtaDisponibile = qtaDisponibile;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaOrd() {
|
|
||||||
return qtaOrd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaOrd(BigDecimal qtaOrd) {
|
|
||||||
this.qtaOrd = qtaOrd;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaTot() {
|
|
||||||
return qtaTot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaTot(BigDecimal qtaTot) {
|
|
||||||
this.qtaTot = qtaTot;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaCnf() {
|
|
||||||
return qtaCnf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaCnf(BigDecimal qtaCnf) {
|
|
||||||
this.qtaCnf = qtaCnf;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNumCnf() {
|
|
||||||
return numCnf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setNumCnf(Integer numCnf) {
|
|
||||||
this.numCnf = numCnf;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaEvasa() {
|
|
||||||
return qtaEvasa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaEvasa(BigDecimal qtaEvasa) {
|
|
||||||
this.qtaEvasa = qtaEvasa;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getMaxQta() {
|
|
||||||
return maxQta;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setMaxQta(BigDecimal maxQta) {
|
|
||||||
this.maxQta = maxQta;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodArtFor() {
|
|
||||||
return codArtFor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setCodArtFor(String codArtFor) {
|
|
||||||
this.codArtFor = codArtFor;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getDataScad() {
|
|
||||||
return dataScad;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setDataScad(Date dataScad) {
|
|
||||||
this.dataScad = dataScad;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getCanPartitaMagBeChanged() {
|
|
||||||
return canPartitaMagBeChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setCanPartitaMagBeChanged(boolean canPartitaMagBeChanged) {
|
|
||||||
this.canPartitaMagBeChanged = canPartitaMagBeChanged;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isCanDataScadBeChanged() {
|
|
||||||
return canDataScadBeChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setCanDataScadBeChanged(boolean canDataScadBeChanged) {
|
|
||||||
this.canDataScadBeChanged = canDataScadBeChanged;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getShouldAskDataScad() {
|
|
||||||
return shouldAskDataScad;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setShouldAskDataScad(Boolean shouldAskDataScad) {
|
|
||||||
this.shouldAskDataScad = shouldAskDataScad;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private ColorStateList originalColorStateList = null;
|
|
||||||
|
|
||||||
private String scadenzaString = "Scadenza";
|
|
||||||
|
|
||||||
private Dialog currentDialog;
|
|
||||||
private Context currentContext;
|
|
||||||
|
|
||||||
private DialogInputQuantityArticoloBinding currentBinding;
|
|
||||||
|
|
||||||
private MtbAart currentMtbAart;
|
|
||||||
private QuantityDTO currentQuantityDto;
|
|
||||||
private DTO currentDTO;
|
|
||||||
|
|
||||||
public static Dialog makeBase(final Context context, final DTO dto, boolean canOverflowQuantity, final RunnableArgs<QuantityDTO> dialogCallback, final Runnable onAbort) {
|
|
||||||
return new DialogInputQuantity(context, dto, canOverflowQuantity, false, (quantityDto, closeUL) -> {
|
|
||||||
dialogCallback.run(quantityDto);
|
|
||||||
}, onAbort).currentDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Dialog makeBase(final Context context, final DTO dto, boolean canOverflowQuantity, final RunnableArgss<QuantityDTO, Boolean> dialogCallback, final Runnable onAbort) {
|
|
||||||
return new DialogInputQuantity(context, dto, canOverflowQuantity, true, dialogCallback, onAbort).currentDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DialogInputQuantity(@NotNull Context context, @NotNull final DTO dto, boolean canOverflowQuantity, boolean showCloseUL, final RunnableArgss<QuantityDTO, Boolean> dialogCallback, final Runnable onAbort) {
|
|
||||||
currentContext = context;
|
|
||||||
currentMtbAart = dto.getMtbAart();
|
|
||||||
currentDTO = dto;
|
|
||||||
|
|
||||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
|
||||||
currentBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_input_quantity_articolo, null, false);
|
|
||||||
|
|
||||||
final TextInputLayout txlInputBatchLot = currentBinding.inputPartitaMag;
|
|
||||||
|
|
||||||
final TextInputLayout txlInputNumDiCnf = currentBinding.inputNumCnf;
|
|
||||||
final TextInputLayout txlInputQtaPerCnf = currentBinding.inputQtaCnf;
|
|
||||||
final TextInputLayout txlInputQtaTot = currentBinding.inputQtaTot;
|
|
||||||
|
|
||||||
txlInputNumDiCnf.getEditText().setSelectAllOnFocus(true);
|
|
||||||
txlInputQtaPerCnf.getEditText().setSelectAllOnFocus(true);
|
|
||||||
txlInputQtaTot.getEditText().setSelectAllOnFocus(true);
|
|
||||||
|
|
||||||
|
|
||||||
originalColorStateList = txlInputNumDiCnf.getEditText().getTextColors();
|
|
||||||
|
|
||||||
currentQuantityDto = new QuantityDTO();
|
|
||||||
currentQuantityDto.canOverflowQuantity = canOverflowQuantity;
|
|
||||||
|
|
||||||
setupQuantities(dto, currentQuantityDto);
|
|
||||||
|
|
||||||
setupQuantityListener(currentQuantityDto, txlInputNumDiCnf, txlInputQtaPerCnf, txlInputQtaTot);
|
|
||||||
|
|
||||||
currentBinding.setViewmodel(dto);
|
|
||||||
currentBinding.setQuantityViewModel(currentQuantityDto);
|
|
||||||
|
|
||||||
|
|
||||||
currentDialog = new Dialog(context);
|
|
||||||
currentDialog.setContentView(currentBinding.getRoot());
|
|
||||||
|
|
||||||
currentDialog.setCanceledOnTouchOutside(false);
|
|
||||||
currentDialog.setCancelable(false);
|
|
||||||
currentDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
|
|
||||||
currentDialog.setCanceledOnTouchOutside(false);
|
|
||||||
|
|
||||||
currentDialog.setOnShowListener(dialogInterface -> {
|
|
||||||
|
|
||||||
final Handler handler = new Handler();
|
|
||||||
handler.postDelayed(() -> {
|
|
||||||
EditText editTextToFocus;
|
|
||||||
if(currentQuantityDto.canPartitaMagBeChanged.get()) {
|
|
||||||
editTextToFocus = txlInputBatchLot.getEditText();
|
|
||||||
} else {
|
|
||||||
editTextToFocus = txlInputNumDiCnf.getEditText();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
editTextToFocus.requestFocus();
|
|
||||||
|
|
||||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
||||||
imm.showSoftInput(editTextToFocus, InputMethodManager.SHOW_IMPLICIT);
|
|
||||||
|
|
||||||
}, 100);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
currentBinding.saveBtn.setOnClickListener(view -> {
|
|
||||||
onConfirm(context, currentQuantityDto, dialogCallback, false);
|
|
||||||
currentDialog.dismiss();
|
|
||||||
});
|
|
||||||
currentBinding.abortBtn.setOnClickListener(view -> {
|
|
||||||
if(onAbort != null) onAbort.run();
|
|
||||||
currentDialog.dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
currentBinding.closeLuBtn.setVisibility(showCloseUL ? View.VISIBLE : View.INVISIBLE);
|
|
||||||
currentBinding.closeLuBtn.setOnClickListener(view -> {
|
|
||||||
onConfirm(context, currentQuantityDto, dialogCallback, true);
|
|
||||||
currentDialog.dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
initDatePicker(context, currentQuantityDto, currentBinding.getRoot().findViewById(R.id.input_data_scad));
|
|
||||||
|
|
||||||
setupBarcode(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupQuantities(@NotNull DTO dto, QuantityDTO quantityDTO){
|
|
||||||
if(dto.getQtaTot() != null) quantityDTO.qtaTot.set(dto.getQtaTot().floatValue());
|
|
||||||
if(dto.getMaxQta() != null) quantityDTO.maxQta.set(dto.getMaxQta().floatValue());
|
|
||||||
|
|
||||||
float qtaDisponibile = dto.getQtaDisponibile() != null ? dto.getQtaDisponibile().floatValue() : 0f;
|
|
||||||
if (qtaDisponibile < 0) {
|
|
||||||
currentBinding.layoutQtaDisponibile.setVisibility(View.GONE);
|
|
||||||
qtaDisponibile = 0;
|
|
||||||
}
|
|
||||||
if(qtaDisponibile > 0) quantityDTO.qtaDisponibile.set(qtaDisponibile);
|
|
||||||
|
|
||||||
float qtaDaEvadere = dto.qtaDaEvadere != null ? dto.qtaDaEvadere.floatValue() : 0f;
|
|
||||||
if (qtaDaEvadere < 0) {
|
|
||||||
currentBinding.layoutQtaDaEvadere.setVisibility(View.GONE);
|
|
||||||
qtaDaEvadere = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(qtaDaEvadere > 0) quantityDTO.qtaDaEvadere.set(qtaDaEvadere);
|
|
||||||
quantityDTO.qtaEvasa.set(dto.qtaEvasa != null ? dto.qtaEvasa.floatValue() : null);
|
|
||||||
|
|
||||||
quantityDTO.batchLot.set(dto.batchLot);
|
|
||||||
if(quantityDTO.qtaCnf.get(false) == null) {
|
|
||||||
if(dto.getQtaCnf() != null) {
|
|
||||||
|
|
||||||
quantityDTO.qtaCnf.set(dto.getQtaCnf().floatValue());
|
|
||||||
|
|
||||||
} else if(dto.numCnf != null && dto.qtaTot != null &&
|
|
||||||
dto.numCnf > 0 && dto.qtaTot.compareTo(BigDecimal.ZERO) > 0) {
|
|
||||||
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = false;
|
|
||||||
quantityDTO.qtaCnf.set(dto.qtaTot.divide(new BigDecimal(dto.numCnf), RoundingMode.HALF_EVEN).floatValue());
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
quantityDTO.qtaCnf.set(dto.mtbAart.getQtaCnf().floatValue());
|
|
||||||
|
|
||||||
if(dto.getMtbAart().isFlagQtaCnfFissaBoolean()) {
|
|
||||||
quantityDTO.blockedQtaPerCnf.set(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(quantityDTO.qtaTot.get(false) == null) {
|
|
||||||
quantityDTO.qtaTot.set(qtaDaEvadere);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dto.getNumCnf() != null) {
|
|
||||||
quantityDTO.numCnf.set(new BigDecimal(dto.getNumCnf()).floatValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(quantityDTO.numCnf.get(false) == null) {
|
|
||||||
float numCnf = (float) Math.ceil(UtilityNumber.truncateToDecimal(quantityDTO.qtaTot.get() / quantityDTO.qtaCnf.get(),3));
|
|
||||||
if(numCnf < 1) numCnf = 1;
|
|
||||||
quantityDTO.numCnf.set(numCnf);
|
|
||||||
}
|
|
||||||
|
|
||||||
quantityDTO.canPartitaMagBeChanged.set(dto.getCanPartitaMagBeChanged());
|
|
||||||
|
|
||||||
if(dto.isCanDataScadBeChanged() != null){
|
|
||||||
quantityDTO.canDataScadBeChanged.set(dto.isCanDataScadBeChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
quantityDTO.shouldAskDataScad.set(dto.mtbAart.isFlagTracciabilitaBoolean() && dto.mtbAart.getGgScadPartita() != null && dto.mtbAart.getGgScadPartita() > 0);
|
|
||||||
|
|
||||||
if(dto.getShouldAskDataScad() != null) {
|
|
||||||
quantityDTO.shouldAskDataScad.set(dto.getShouldAskDataScad());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dto.getDataScad() != null) {
|
|
||||||
quantityDTO.expireDate = dto.getDataScad();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(quantityDTO.expireDate == null && dto.mtbAart.getGgScadPartita() != null && dto.mtbAart.getGgScadPartita() > 0) {
|
|
||||||
Calendar c = UtilityDate.getCalendarInstance();
|
|
||||||
c.add(Calendar.DATE, dto.mtbAart.getGgScadPartita()); // number of days to add
|
|
||||||
|
|
||||||
quantityDTO.expireDate = c.getTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
refreshQtaDescriptionText();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void setupBarcode(Context context) {
|
|
||||||
|
|
||||||
int barcodeIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
|
||||||
.setOnScanSuccessfull(onScanSuccessfull)
|
|
||||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(context, ex, false)));
|
|
||||||
|
|
||||||
currentDialog.setOnDismissListener(dialog -> {
|
|
||||||
BarcodeManager.removeCallback(barcodeIstanceID);
|
|
||||||
});
|
|
||||||
|
|
||||||
BarcodeManager.enable();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
|
|
||||||
if(UtilityBarcode.isEanPeso(data)){
|
|
||||||
|
|
||||||
try {
|
|
||||||
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(data.getStringValue());
|
|
||||||
|
|
||||||
if(ean13PesoModel.getPrecode().contains(currentMtbAart.getBarCode())) {
|
|
||||||
|
|
||||||
currentQuantityDto.numCnf.set(1f);
|
|
||||||
currentQuantityDto.qtaCnf.set(ean13PesoModel.getPeso());
|
|
||||||
currentQuantityDto.qtaTot.set(ean13PesoModel.getPeso());
|
|
||||||
|
|
||||||
BarcodeManager.enable();
|
|
||||||
} else {
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
UtilityLogger.errorMe(e);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if(UtilityBarcode.isEtichetta128(data)){
|
|
||||||
final Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(currentContext);
|
|
||||||
|
|
||||||
BarcodeRESTConsumer.decodeEan128Static(data, ean128Model -> {
|
|
||||||
progressDialog.dismiss();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
|
|
||||||
if(ean128Model != null){
|
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
|
||||||
currentQuantityDto.batchLot.set(ean128Model.BatchLot);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
|
|
||||||
currentQuantityDto.expireDate = UtilityDate.recognizeDate(ean128Model.BestBefore);
|
|
||||||
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
|
||||||
currentQuantityDto.expireDate = UtilityDate.recognizeDate(ean128Model.Expiry);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(currentQuantityDto.expireDate != null) {
|
|
||||||
currentQuantityDto.expireDateString.set(UtilityDate.formatDate(currentQuantityDto.expireDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
UtilityLogger.errorMe(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(ean128Model.Count != null && ean128Model.Count > 0) {
|
|
||||||
currentQuantityDto.numCnf.set((float) ean128Model.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ean128Model.NetWeightKg != null && ean128Model.NetWeightKg > 0) {
|
|
||||||
currentQuantityDto.qtaTot.set(ean128Model.NetWeightKg);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(currentQuantityDto.qtaTot.get() > 0 && currentQuantityDto.numCnf.get() > 0) {
|
|
||||||
currentQuantityDto.qtaCnf.set(currentQuantityDto.qtaTot.get() / currentQuantityDto.numCnf.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}, ex -> {
|
|
||||||
UtilityExceptions.defaultException(currentContext, ex, progressDialog);
|
|
||||||
|
|
||||||
BarcodeManager.enable();
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
private void setupQuantityListener(final QuantityDTO quantityDTO, final TextInputLayout txlInputNumDiCnf, final TextInputLayout txlInputQtaPerCnf, final TextInputLayout txlInputQtaTot) {
|
|
||||||
|
|
||||||
quantityDTO.numCnf.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
|
||||||
@Override
|
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
|
||||||
|
|
||||||
if(quantityDTO.numCnfNotificationEnabled) {
|
|
||||||
|
|
||||||
quantityDTO.blockedNumDiCnf.set(!(quantityDTO.numCnf.get(true) == 0 || quantityDTO.numCnf.get().toString().equals("")));
|
|
||||||
|
|
||||||
toggleTextInputLayoutError(txlInputNumDiCnf, quantityDTO.blockedNumDiCnf.get());
|
|
||||||
|
|
||||||
if (!quantityDTO.blockedQtaTot.get()) {
|
|
||||||
|
|
||||||
quantityDTO.qtaTotNotificationEnabled = false;
|
|
||||||
quantityDTO.qtaTot.set((float) Math.round(quantityDTO.qtaCnf.get(true) * quantityDTO.numCnf.get(true) * 1000) / 1000);
|
|
||||||
quantityDTO.qtaTotNotificationEnabled = true;
|
|
||||||
|
|
||||||
|
|
||||||
} else if (!quantityDTO.blockedQtaPerCnf.get()) {
|
|
||||||
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = false;
|
|
||||||
if(quantityDTO.numCnf.get(true) != 0) {
|
|
||||||
quantityDTO.qtaCnf.set((float) Math.round(quantityDTO.qtaTot.get(true) / quantityDTO.numCnf.get(true) * 1000) / 1000);
|
|
||||||
} else {
|
|
||||||
quantityDTO.qtaCnf.set((float) Math.round(quantityDTO.qtaTot.get(true) / 1 * 1000) / 1000);
|
|
||||||
}
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Log.e("DialogInputQuantity", "Tutti i campi sono bloccati, non è possibile modificare il numero di confezioni");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// refreshQtaDescriptionText();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
quantityDTO.qtaCnf.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
|
||||||
@Override
|
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
|
||||||
|
|
||||||
if(quantityDTO.qtaCnfNotificationEnabled) {
|
|
||||||
|
|
||||||
quantityDTO.blockedQtaPerCnf.set(!(quantityDTO.qtaCnf.get(true) == 0 || quantityDTO.qtaCnf.get().toString().equals("")));
|
|
||||||
|
|
||||||
toggleTextInputLayoutError(txlInputQtaPerCnf, quantityDTO.blockedQtaPerCnf.get());
|
|
||||||
|
|
||||||
if (!quantityDTO.blockedQtaTot.get()) {
|
|
||||||
|
|
||||||
quantityDTO.qtaTotNotificationEnabled = false;
|
|
||||||
float qtaTot = (float) Math.round(quantityDTO.qtaCnf.get(true) * quantityDTO.numCnf.get(true) * 1000) / 1000;
|
|
||||||
if(qtaTot > quantityDTO.maxQta.get() && !quantityDTO.canOverflowQuantity) qtaTot = quantityDTO.maxQta.get();
|
|
||||||
quantityDTO.qtaTot.set(qtaTot);
|
|
||||||
quantityDTO.qtaTotNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else if (!quantityDTO.blockedNumDiCnf.get()) {
|
|
||||||
|
|
||||||
quantityDTO.numCnfNotificationEnabled = false;
|
|
||||||
if(quantityDTO.qtaCnf.get(true) != 0){
|
|
||||||
quantityDTO.numCnf.set((float) Math.ceil(quantityDTO.qtaTot.get(true) / quantityDTO.qtaCnf.get(true)));
|
|
||||||
} else {
|
|
||||||
quantityDTO.numCnf.set((float) Math.ceil(quantityDTO.qtaTot.get(true)));
|
|
||||||
}
|
|
||||||
|
|
||||||
quantityDTO.numCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Log.e("DialogInputQuantity", "Tutti i campi sono bloccati, non è possibile modificare la quantità per confezione");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// refreshQtaDescriptionText();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
quantityDTO.qtaTot.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
|
||||||
@Override
|
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
|
||||||
|
|
||||||
if (quantityDTO.qtaTotNotificationEnabled) {
|
|
||||||
|
|
||||||
quantityDTO.blockedQtaTot.set(!(quantityDTO.qtaTot.get(true) == 0 || quantityDTO.qtaTot.get().toString().equals("")));
|
|
||||||
|
|
||||||
toggleTextInputLayoutError(txlInputQtaTot, quantityDTO.blockedQtaTot.get());
|
|
||||||
|
|
||||||
if(!quantityDTO.blockedQtaPerCnf.get()){
|
|
||||||
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = false;
|
|
||||||
quantityDTO.qtaCnf.set((float) Math.round(quantityDTO.qtaTot.get(true) / quantityDTO.numCnf.get(true) *1000)/1000);
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else if(!quantityDTO.blockedNumDiCnf.get()) {
|
|
||||||
|
|
||||||
quantityDTO.numCnfNotificationEnabled = false;
|
|
||||||
quantityDTO.numCnf.set((float) Math.ceil(quantityDTO.qtaTot.get(true) / quantityDTO.qtaCnf.get(true)));
|
|
||||||
quantityDTO.numCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Log.e("DialogInputQuantity", "Tutti i campi sono bloccati, non è possibile modificare la quantità totale");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// refreshQtaDescriptionText();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void toggleTextInputLayoutError(TextInputLayout textInputLayout, boolean isError) {
|
|
||||||
if(isError){
|
|
||||||
textInputLayout.setErrorEnabled(true);
|
|
||||||
textInputLayout.setError(" ");
|
|
||||||
textInputLayout.getEditText().setTextColor(ContextCompat.getColor(currentContext, R.color.red_600));
|
|
||||||
textInputLayout.setHintTextAppearance(R.style.ErrorFloatingLabel);
|
|
||||||
textInputLayout.setErrorIconDrawable(null);
|
|
||||||
|
|
||||||
if (textInputLayout.getChildCount() == 2) {
|
|
||||||
textInputLayout.getChildAt(1).setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
textInputLayout.setErrorEnabled(false);
|
|
||||||
textInputLayout.setError(null);
|
|
||||||
textInputLayout.getEditText().setTextColor(originalColorStateList);
|
|
||||||
textInputLayout.setHintTextAppearance(R.style.NormalFloatingLabel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initDatePicker(Context context, QuantityDTO quantityDTO, AppCompatTextView textInputLayout) {
|
|
||||||
quantityDTO.expireDateString.set(scadenzaString);
|
|
||||||
|
|
||||||
if(quantityDTO.expireDate != null) {
|
|
||||||
quantityDTO.expireDateString.set(UtilityDate.formatDate(quantityDTO.expireDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Runnable onTextClicked = () -> {
|
|
||||||
// Get Current Date
|
|
||||||
Calendar c = UtilityDate.getCalendarInstance();
|
|
||||||
|
|
||||||
if(quantityDTO.expireDate != null) {
|
|
||||||
c.setTime(quantityDTO.expireDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
int mYear = c.get(Calendar.YEAR);
|
|
||||||
int mMonth = c.get(Calendar.MONTH);
|
|
||||||
int mDay = c.get(Calendar.DAY_OF_MONTH);
|
|
||||||
|
|
||||||
DatePickerDialog datePickerDialog = new DatePickerDialog(context,
|
|
||||||
(view, year, month, day) -> {
|
|
||||||
|
|
||||||
quantityDTO.expireDate = new GregorianCalendar(year, month, day).getTime();
|
|
||||||
quantityDTO.expireDateString.set(UtilityDate.formatDate(quantityDTO.expireDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
|
||||||
|
|
||||||
}, mYear, mMonth, mDay);
|
|
||||||
datePickerDialog.show();
|
|
||||||
};
|
|
||||||
|
|
||||||
textInputLayout.setOnClickListener(v -> onTextClicked.run());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void refreshQtaDescriptionText() {
|
|
||||||
|
|
||||||
int numConf = (int) (currentQuantityDto.qtaDaEvadere.get() / currentQuantityDto.qtaCnf.get());
|
|
||||||
float qtaTot = currentQuantityDto.qtaDaEvadere.get();
|
|
||||||
|
|
||||||
float mod = qtaTot % numConf;
|
|
||||||
|
|
||||||
String text = "";
|
|
||||||
|
|
||||||
if(numConf > 0) {
|
|
||||||
text += "<b>" + numConf + " " + currentContext.getResources().getQuantityString(R.plurals.item_package, numConf).toUpperCase() + "</b>";
|
|
||||||
}
|
|
||||||
if(numConf > 0 && mod > 0) {
|
|
||||||
text += " e ";
|
|
||||||
}
|
|
||||||
if(mod > 0) {
|
|
||||||
|
|
||||||
text += "<b>" + UtilityNumber.decimalToString(mod) + " ";
|
|
||||||
if(mod == 1) {
|
|
||||||
text += currentContext.getResources().getQuantityString(R.plurals.pieces, (int) mod).toUpperCase();
|
|
||||||
} else {
|
|
||||||
text += currentContext.getString(R.string.piece).toUpperCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
text += "</b>";
|
|
||||||
}
|
|
||||||
|
|
||||||
currentBinding.qtaDescriptionText.setText(Html.fromHtml(text));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void onConfirm(Context context, QuantityDTO quantityDTO, RunnableArgss<QuantityDTO, Boolean> dialogCallback, boolean closeUL){
|
|
||||||
if(currentDTO.mtbAart.isFlagTracciabilitaBoolean() && (quantityDTO.batchLot == null || quantityDTO.batchLot.get().trim().length() == 0)){
|
|
||||||
|
|
||||||
showBatchLotErrorPrompt(context);
|
|
||||||
|
|
||||||
} else if(quantityDTO.shouldAskDataScad.get() && (quantityDTO.batchLot == null || quantityDTO.batchLot.get().trim().length() == 0)){
|
|
||||||
|
|
||||||
showBatchLotErrorPrompt(context);
|
|
||||||
|
|
||||||
} else if(quantityDTO.shouldAskDataScad.get() && quantityDTO.expireDate == null){
|
|
||||||
|
|
||||||
showExpireDateErrorPrompt(context);
|
|
||||||
|
|
||||||
} else if(!quantityDTO.canOverflowQuantity && quantityDTO.qtaTot.get() > quantityDTO.maxQta.get()) {
|
|
||||||
|
|
||||||
showQuantityOverflowErrorPrompt(context);
|
|
||||||
|
|
||||||
} else if(quantityDTO.qtaCnf.get() <= 0 || quantityDTO.numCnf.get() <= 0 || quantityDTO.qtaTot.get() <= 0) {
|
|
||||||
|
|
||||||
showQuantityErrorDialog(context);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if(quantityDTO.batchLot != null && !quantityDTO.batchLot.isEmpty()) {
|
|
||||||
quantityDTO.batchLot.set(quantityDTO.batchLot.get().toUpperCase());
|
|
||||||
}
|
|
||||||
|
|
||||||
dialogCallback.run(quantityDTO, closeUL);
|
|
||||||
currentDialog.dismiss();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showQuantityErrorDialog(Context mContext){
|
|
||||||
|
|
||||||
String errorMessage = mContext.getText(R.string.wrong_quantity_input_message).toString();
|
|
||||||
|
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext, new SpannableString(Html.fromHtml(errorMessage)), null, null).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showQuantityOverflowErrorPrompt(Context mContext){
|
|
||||||
|
|
||||||
String errorMessage = mContext.getText(R.string.available_quantity_overflow_error_message).toString();
|
|
||||||
|
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext, new SpannableString(Html.fromHtml(errorMessage)), null, null).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showExpireDateErrorPrompt(Context mContext){
|
|
||||||
|
|
||||||
String errorMessage = mContext.getText(R.string.expire_date_error_message).toString();
|
|
||||||
|
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext, new SpannableString(Html.fromHtml(errorMessage)), null, null).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showBatchLotErrorPrompt(Context mContext){
|
|
||||||
|
|
||||||
String errorMessage = mContext.getText(R.string.batch_lot_error_message).toString();
|
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext, new SpannableString(Html.fromHtml(errorMessage)), null, null).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.input_quantity;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableFloat;
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableString;
|
|
||||||
|
|
||||||
public class QuantityDTO {
|
|
||||||
|
|
||||||
public BindableString batchLot = new BindableString();
|
|
||||||
public BindableString expireDateString = new BindableString();
|
|
||||||
|
|
||||||
public Date expireDate = null;
|
|
||||||
|
|
||||||
public BindableFloat numCnf = new BindableFloat();
|
|
||||||
public BindableFloat qtaCnf = new BindableFloat();
|
|
||||||
public BindableFloat qtaTot = new BindableFloat();
|
|
||||||
|
|
||||||
public BindableFloat qtaEvasa = new BindableFloat();
|
|
||||||
public BindableFloat qtaDaEvadere = new BindableFloat();
|
|
||||||
public BindableFloat qtaDisponibile = new BindableFloat();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public BindableBoolean blockedNumDiCnf = new BindableBoolean();
|
|
||||||
public BindableBoolean blockedQtaTot = new BindableBoolean();
|
|
||||||
public BindableBoolean blockedQtaPerCnf = new BindableBoolean();
|
|
||||||
|
|
||||||
public boolean numCnfNotificationEnabled = true;
|
|
||||||
public boolean qtaCnfNotificationEnabled = true;
|
|
||||||
public boolean qtaTotNotificationEnabled = true;
|
|
||||||
public boolean canOverflowQuantity = false;
|
|
||||||
public BindableFloat maxQta = new BindableFloat();
|
|
||||||
|
|
||||||
|
|
||||||
public BindableBoolean canPartitaMagBeChanged = new BindableBoolean(true);
|
|
||||||
public BindableBoolean canDataScadBeChanged = new BindableBoolean(true);
|
|
||||||
public BindableBoolean shouldAskDataScad = new BindableBoolean();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -288,7 +288,7 @@ public class DialogScanOrCreateLU {
|
|||||||
|
|
||||||
private void showTooMuchULFound() {
|
private void showTooMuchULFound() {
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
new SpannableString(mContext.getResources().getText(R.string.too_much_lu_found_message)),
|
new SpannableString(mContext.getResources().getText(R.string.too_much_lu_found_message_in_mono_lu)),
|
||||||
null, null).show();
|
null, null).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,425 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<data>
|
|
||||||
<import type="android.view.View" />
|
|
||||||
|
|
||||||
<variable
|
|
||||||
name="viewmodel"
|
|
||||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity.DTO"/>
|
|
||||||
<variable
|
|
||||||
name="quantityViewModel"
|
|
||||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity.QuantityDTO"/>
|
|
||||||
|
|
||||||
<import type="androidx.core.content.ContextCompat" />
|
|
||||||
|
|
||||||
<import type="it.integry.integrywmsnative.MainApplication" />
|
|
||||||
|
|
||||||
<import type="it.integry.integrywmsnative.R" />
|
|
||||||
|
|
||||||
<import type="androidx.databinding.adapters.Converters"/>
|
|
||||||
|
|
||||||
<import type="android.graphics.Color" />
|
|
||||||
|
|
||||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
|
||||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
|
||||||
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:cardCornerRadius="12dp"
|
|
||||||
app:cardElevation="0dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="16dp">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/dialog_title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/dialog_title_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:text='@{viewmodel.mtbAart.codMart + (!UtilityString.isNullOrEmpty(viewmodel.batchLot) ? " (" + viewmodel.batchLot + ")" : "") }'
|
|
||||||
android:textColor="@color/colorPrimary"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
|
||||||
tools:text="AV25D200010B"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_below="@id/dialog_title_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:text='@{!UtilityString.isNullOrEmpty(viewmodel.mtbAart.diacod) ? viewmodel.mtbAart.diacod : ""}'
|
|
||||||
android:textColor="@color/red_600"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:visibility="@{UtilityString.isNullOrEmpty(viewmodel.mtbAart.diacod) ? View.GONE : View.VISIBLE}"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
|
||||||
tools:text="DIACOD HERE"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:paddingStart="8dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:text='@{viewmodel.mtbAart.untMis != null ? "(" + viewmodel.mtbAart.untMis + ")" : ""}'
|
|
||||||
android:textColor="#000"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="(PZ)"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
|
||||||
app:layout_constraintRight_toRightOf="parent" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/dialog_title"
|
|
||||||
android:layout_marginTop="6dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatTextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:text="@string/description"-->
|
|
||||||
<!--android:textSize="16sp"-->
|
|
||||||
<!--tools:text="Descrizione" />-->
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewmodel.mtbAart.descrizioneEstesa}"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
tools:text="RAD 25 D H/L 200 - 10 EL B BIANCO" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="@{viewmodel.qtaOrd == null ? View.GONE : View.VISIBLE}"
|
|
||||||
android:text="@string/ordered_abbr"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="@{viewmodel.qtaOrd == null ? View.GONE : View.VISIBLE}"
|
|
||||||
android:text='@{UtilityNumber.decimalToString(viewmodel.qtaOrd)}'
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingStart="4dp"
|
|
||||||
tools:text="1200" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:text="@string/dispatched_abbr"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:visibility="@{quantityViewModel.qtaEvasa.get() == 0 ? View.GONE : View.VISIBLE}" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text='@{UtilityNumber.decimalToString(quantityViewModel.qtaEvasa.get())}'
|
|
||||||
android:visibility="@{quantityViewModel.qtaEvasa.get() == 0 ? View.GONE : View.VISIBLE}"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingLeft="4dp"
|
|
||||||
tools:text="1200" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layout_qta_da_evadere"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/to_dispatch_abbr"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text='@{UtilityNumber.decimalToString(quantityViewModel.qtaDaEvadere.get())}'
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingLeft="4dp"
|
|
||||||
tools:text="1200" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layout_qta_disponibile"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="("
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/available_abbr"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text='@{UtilityNumber.decimalToString(quantityViewModel.qtaDisponibile.get())}'
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingStart="4dp"
|
|
||||||
tools:text="1200" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text=")"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/qta_description_text"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:paddingTop="4dp"
|
|
||||||
tools:text="2 CARTONI e 3 PEZZI"/>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline_partita_data"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintGuide_percent='@{quantityViewModel.shouldAskDataScad.get() == false ? 1.0f : 0.5f}'/>
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:id="@+id/input_partita_mag"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:enabled="@{quantityViewModel.canPartitaMagBeChanged}"
|
|
||||||
app:hintTextAppearance="@style/hint_text"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/guideline_partita_data"
|
|
||||||
android:nextFocusRight="@+id/input_data_scad"
|
|
||||||
style="@style/TextInputLayout.NoLine">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="textNoSuggestions"
|
|
||||||
android:hint="@string/batch_lot"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
app:binding="@{quantityViewModel.batchLot}"/>
|
|
||||||
|
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/input_data_scad"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="11 nov 2018"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:enabled="@{quantityViewModel.canDataScadBeChanged}"
|
|
||||||
android:visibility="@{quantityViewModel.shouldAskDataScad.get() == false ? View.GONE : View.VISIBLE}"
|
|
||||||
app:binding="@{quantityViewModel.expireDateString}"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/guideline_partita_data"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
|
||||||
|
|
||||||
|
|
||||||
<!--<android.support.design.widget.TextInputLayout-->
|
|
||||||
<!--android:id="@+id/input_data_scad_layout"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:enabled="@{quantityViewModel.shouldAskDataScad.get()}"-->
|
|
||||||
<!--app:hintTextAppearance="@style/hint_text"-->
|
|
||||||
<!--app:layout_constraintStart_toEndOf="@id/guideline_partita_data"-->
|
|
||||||
<!--app:layout_constraintEnd_toEndOf="parent">-->
|
|
||||||
|
|
||||||
<!--<android.support.design.widget.TextInputEditText-->
|
|
||||||
<!--android:id="@+id/input_data_scad"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:inputType="textNoSuggestions"-->
|
|
||||||
<!--android:hint="@string/expire_date"-->
|
|
||||||
<!--app:binding="@{quantityViewModel.expireDate}"/>-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--</android.support.design.widget.TextInputLayout>-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:weightSum="3">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:id="@+id/input_num_cnf"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:enabled="@{!(quantityViewModel.blockedQtaTot.get() && quantityViewModel.blockedQtaPerCnf.get())}"
|
|
||||||
style="@style/TextInputLayout.NoLine">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="number"
|
|
||||||
android:hint="@string/num_pcks"
|
|
||||||
android:gravity="end"
|
|
||||||
app:binding="@{quantityViewModel.numCnf}" >
|
|
||||||
</com.google.android.material.textfield.TextInputEditText>
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:id="@+id/input_qta_cnf"
|
|
||||||
android:enabled="@{!(quantityViewModel.blockedQtaTot.get() && quantityViewModel.blockedNumDiCnf.get())}"
|
|
||||||
style="@style/TextInputLayout.NoLine">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:hint="@string/qty_x_pck"
|
|
||||||
android:gravity="end"
|
|
||||||
app:binding="@{quantityViewModel.qtaCnf}"/>
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:id="@+id/input_qta_tot"
|
|
||||||
android:enabled="@{!(quantityViewModel.blockedNumDiCnf.get() && quantityViewModel.blockedQtaPerCnf.get())}"
|
|
||||||
style="@style/TextInputLayout.NoLine">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:hint="@string/tot_qty"
|
|
||||||
android:gravity="end"
|
|
||||||
app:binding="@{quantityViewModel.qtaTot}"/>
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:weightSum="1">
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/close_lu_btn"
|
|
||||||
android:layout_weight="0.4"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Button.PrimaryOutline"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/left_buttons_guideline"
|
|
||||||
app:strokeColor="@color/colorPrimary"
|
|
||||||
android:text="@string/action_close_ul"/>
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/abort_btn"
|
|
||||||
android:layout_weight="0.3"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Button.DangerFull"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:paddingEnd="3dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/left_buttons_guideline"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
|
|
||||||
app:icon="@drawable/ic_close_24dp"
|
|
||||||
app:iconGravity="textStart"/>
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/save_btn"
|
|
||||||
android:layout_weight="0.3"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Button.PrimaryFull"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:paddingEnd="3dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/right_buttons_guideline"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:icon="@drawable/ic_save_24"
|
|
||||||
app:iconGravity="textStart"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
</layout>
|
|
||||||
@ -217,7 +217,7 @@
|
|||||||
<string name="gestione_A_L_only_accepted_message">Sono ammesse solo UL di <b>Acquisto</b> o <b>Lavorazione</b> qui</string>
|
<string name="gestione_A_L_only_accepted_message">Sono ammesse solo UL di <b>Acquisto</b> o <b>Lavorazione</b> qui</string>
|
||||||
<string name="gestione_A_V_not_accepted_message"><![CDATA[Le UL di tipo <b>Acquisto</b> o <b>Vendita</b> non sono ammesse qui]]></string>
|
<string name="gestione_A_V_not_accepted_message"><![CDATA[Le UL di tipo <b>Acquisto</b> o <b>Vendita</b> non sono ammesse qui]]></string>
|
||||||
<string name="gestione_V_not_accepted_message"><![CDATA[Le UL di tipo <b>Vendita</b> non sono ammesse qui]]></string>
|
<string name="gestione_V_not_accepted_message"><![CDATA[Le UL di tipo <b>Vendita</b> non sono ammesse qui]]></string>
|
||||||
<string name="too_much_lu_found_message">E\' stata trovata più di una UL</string>
|
<string name="too_much_lu_found_message_in_mono_lu">E\' stata trovata più di una UL in una posizione MONO-UL</string>
|
||||||
<string name="ask_print_message"><![CDATA[Si vuole procedere con la stampa dell\'etichetta?]]></string>
|
<string name="ask_print_message"><![CDATA[Si vuole procedere con la stampa dell\'etichetta?]]></string>
|
||||||
<string name="ask_position_of_lu_message">Scansiona il codice a barre di una <b>Posizione</b></string>
|
<string name="ask_position_of_lu_message">Scansiona il codice a barre di una <b>Posizione</b></string>
|
||||||
<string name="ask_production_line_of_lu_message">Scansiona il codice a barre di una <b>Linea di Produzione</b></string>
|
<string name="ask_production_line_of_lu_message">Scansiona il codice a barre di una <b>Linea di Produzione</b></string>
|
||||||
|
|||||||
@ -220,7 +220,7 @@
|
|||||||
<string name="gestione_A_L_only_accepted_message">Only <b>Purchase</b> or <b>Production\'s</b> LU are accepted here</string>
|
<string name="gestione_A_L_only_accepted_message">Only <b>Purchase</b> or <b>Production\'s</b> LU are accepted here</string>
|
||||||
<string name="gestione_A_V_not_accepted_message">The LU of type Purchase or Sale is not accepted here</string>
|
<string name="gestione_A_V_not_accepted_message">The LU of type Purchase or Sale is not accepted here</string>
|
||||||
<string name="gestione_V_not_accepted_message">The LU of type Sale is not accepted here</string>
|
<string name="gestione_V_not_accepted_message">The LU of type Sale is not accepted here</string>
|
||||||
<string name="too_much_lu_found_message">Multiple LU found</string>
|
<string name="too_much_lu_found_message_in_mono_lu">Multiple LU found in MONO-LU position</string>
|
||||||
<string name="ask_print_message">Do you want print the label?</string>
|
<string name="ask_print_message">Do you want print the label?</string>
|
||||||
<string name="ask_position_of_lu_message">Please scan a <b>Position</b> barcode</string>
|
<string name="ask_position_of_lu_message">Please scan a <b>Position</b> barcode</string>
|
||||||
<string name="ask_production_line_of_lu_message">Please scan a <b>Production Line</b> barcode</string>
|
<string name="ask_production_line_of_lu_message">Please scan a <b>Production Line</b> barcode</string>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user