Finish v1_12_1(130)
This commit is contained in:
commit
5b76092f58
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 129
|
def appVersionCode = 130
|
||||||
def appVersionName = '1.12.0'
|
def appVersionName = '1.12.1'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public class CommonConst {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public static String[] forErrors = {
|
public static String[] forErrors = {
|
||||||
"syslogs@integry.it",
|
// "syslogs@integry.it",
|
||||||
"g.scorrano@integry.it",
|
"g.scorrano@integry.it",
|
||||||
"v.castellana@integry.it"
|
"v.castellana@integry.it"
|
||||||
};
|
};
|
||||||
|
|||||||
@ -23,10 +23,11 @@ import java.util.Random;
|
|||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
||||||
|
|
||||||
public class ColliDataRecover {
|
public class ColliDataRecover {
|
||||||
|
|
||||||
private static class RecoverDTO {
|
public static class RecoverDTO {
|
||||||
private int id;
|
private int id;
|
||||||
private int numCollo;
|
private int numCollo;
|
||||||
private String serCollo;
|
private String serCollo;
|
||||||
@ -34,6 +35,8 @@ public class ColliDataRecover {
|
|||||||
private String gestioneCollo;
|
private String gestioneCollo;
|
||||||
private String filtro;
|
private String filtro;
|
||||||
|
|
||||||
|
private List<OrdineVenditaInevasoDTO> testateOrdini;
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -87,6 +90,25 @@ public class ColliDataRecover {
|
|||||||
this.filtro = filtro;
|
this.filtro = filtro;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<OrdineVenditaInevasoDTO> getTestateOrdini() {
|
||||||
|
return testateOrdini;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecoverDTO setTestateOrdini(List<OrdineVenditaInevasoDTO> testateOrdini) {
|
||||||
|
this.testateOrdini = testateOrdini;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MtbColt getMtbColt() {
|
||||||
|
return new MtbColt()
|
||||||
|
.setNumCollo(getNumCollo())
|
||||||
|
.setSerCollo(getSerCollo())
|
||||||
|
.setGestione(getGestioneCollo())
|
||||||
|
.setDataCollo(getDataCollo())
|
||||||
|
.setFiltroOrdini(getFiltro());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Context mContext;
|
private static Context mContext;
|
||||||
@ -115,18 +137,11 @@ public class ColliDataRecover {
|
|||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MtbColt getSession(Integer sessionID) {
|
public static RecoverDTO getSession(Integer sessionID) {
|
||||||
|
|
||||||
if(sessionID == null) return null;
|
if(sessionID == null) return null;
|
||||||
|
|
||||||
RecoverDTO dto = getIfExists(sessionID);
|
return getIfExists(sessionID);
|
||||||
|
|
||||||
return new MtbColt()
|
|
||||||
.setNumCollo(dto.getNumCollo())
|
|
||||||
.setSerCollo(dto.getSerCollo())
|
|
||||||
.setGestione(dto.getGestioneCollo())
|
|
||||||
.setDataCollo(dto.getDataCollo())
|
|
||||||
.setFiltroOrdini(dto.getFiltro());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RecoverDTO getIfExists(int id) {
|
private static RecoverDTO getIfExists(int id) {
|
||||||
@ -138,7 +153,7 @@ public class ColliDataRecover {
|
|||||||
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
|
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int startNewSession(MtbColt mtbColtSession) {
|
public static int startNewSession(MtbColt mtbColtSession, List<OrdineVenditaInevasoDTO> testateOrdini) {
|
||||||
Integer newId = null;
|
Integer newId = null;
|
||||||
|
|
||||||
while(newId == null) {
|
while(newId == null) {
|
||||||
@ -154,7 +169,8 @@ public class ColliDataRecover {
|
|||||||
.setNumCollo(mtbColtSession.getNumCollo())
|
.setNumCollo(mtbColtSession.getNumCollo())
|
||||||
.setSerCollo(mtbColtSession.getSerCollo())
|
.setSerCollo(mtbColtSession.getSerCollo())
|
||||||
.setGestioneCollo(mtbColtSession.getGestione())
|
.setGestioneCollo(mtbColtSession.getGestione())
|
||||||
.setFiltro(mtbColtSession.getFiltroOrdini());
|
.setFiltro(mtbColtSession.getFiltroOrdini())
|
||||||
|
.setTestateOrdini(testateOrdini);
|
||||||
|
|
||||||
mtbColtsSessions.add(recoverDTO);
|
mtbColtsSessions.add(recoverDTO);
|
||||||
updateLocalFile();
|
updateLocalFile();
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class UtilityBigDecimal {
|
||||||
|
|
||||||
|
public static boolean greaterThan(BigDecimal input, BigDecimal toCompareWith) {
|
||||||
|
if(input == null) return false;
|
||||||
|
if(toCompareWith == null) return false;
|
||||||
|
|
||||||
|
return input.compareTo(toCompareWith) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean equalsTo(BigDecimal input, BigDecimal toCompareWith) {
|
||||||
|
if(input == null) return false;
|
||||||
|
if(toCompareWith == null) return false;
|
||||||
|
|
||||||
|
return input.compareTo(toCompareWith) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean lowerThan(BigDecimal input, BigDecimal toCompareWith) {
|
||||||
|
if(input == null) return false;
|
||||||
|
if(toCompareWith == null) return false;
|
||||||
|
|
||||||
|
return input.compareTo(toCompareWith) < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.utility;
|
|||||||
|
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.net.SocketException;
|
import java.net.SocketException;
|
||||||
@ -14,15 +15,15 @@ import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|||||||
|
|
||||||
public class UtilityLogger {
|
public class UtilityLogger {
|
||||||
|
|
||||||
public static void logMe(String message){
|
public static void logMe(String message) {
|
||||||
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
|
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
|
||||||
|
|
||||||
String caller = "UtilityLogger";
|
String caller = "UtilityLogger";
|
||||||
|
|
||||||
for(int i = 0; i < stackTraceElements.length; i++){
|
for (int i = 0; i < stackTraceElements.length; i++) {
|
||||||
|
|
||||||
if(stackTraceElements[i].getMethodName().equalsIgnoreCase("logMe")){
|
if (stackTraceElements[i].getMethodName().equalsIgnoreCase("logMe")) {
|
||||||
caller = stackTraceElements[i+1].getFileName() + "->" + stackTraceElements[i+1].getMethodName();
|
caller = stackTraceElements[i + 1].getFileName() + "->" + stackTraceElements[i + 1].getMethodName();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -39,8 +40,9 @@ public class UtilityLogger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void errorMe(Exception ex, String additionalText, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public static void errorMe(Exception ex, String additionalText, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
if((!(ex instanceof SocketTimeoutException) && !(ex.getCause() instanceof SocketTimeoutException)) ||
|
if ((!(ex instanceof SocketTimeoutException) && !(ex.getCause() instanceof SocketTimeoutException)) ||
|
||||||
(!(ex instanceof SocketException) && !(ex.getCause() instanceof SocketException)) ) {
|
(!(ex instanceof SocketException) && !(ex.getCause() instanceof SocketException)) ||
|
||||||
|
(!(ex instanceof IOException) && !(ex.getCause() instanceof IOException))) {
|
||||||
|
|
||||||
String message = UtilityResources.readRawTextFile(R.raw.error_mail);
|
String message = UtilityResources.readRawTextFile(R.raw.error_mail);
|
||||||
|
|
||||||
|
|||||||
@ -72,4 +72,10 @@ public class UtilityString {
|
|||||||
return Html.fromHtml(String.format(UtilityResources.getString(stringId),params));
|
return Html.fromHtml(String.format(UtilityResources.getString(stringId),params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean equalsIgnoreCase(String val1, String val2) {
|
||||||
|
return (val1 == null && val2 == null) ||
|
||||||
|
(val1 != null && val1.equalsIgnoreCase(val2));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,12 +2,15 @@ package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.viewmodel;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.tfb.fbtoast.FBToast;
|
import com.tfb.fbtoast.FBToast;
|
||||||
|
|
||||||
@ -36,6 +39,7 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
|||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
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.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
@ -88,7 +92,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(){
|
private void init() {
|
||||||
|
|
||||||
currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(SettingsManager.i().userSession.defaultOrdinamentoPickingAccettazione);
|
currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(SettingsManager.i().userSession.defaultOrdinamentoPickingAccettazione);
|
||||||
|
|
||||||
@ -97,7 +101,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
mArticoliInColloBottomSheetViewModel.setOnItemEditedCallback(this::onRowEdited);
|
mArticoliInColloBottomSheetViewModel.setOnItemEditedCallback(this::onRowEdited);
|
||||||
|
|
||||||
groupedOrdini = new ArrayList<>();
|
groupedOrdini = new ArrayList<>();
|
||||||
for (OrdineAccettazioneDTO ordine : mOrders){
|
for (OrdineAccettazioneDTO ordine : mOrders) {
|
||||||
groupedOrdini.addAll(ordine.getOrdini());
|
groupedOrdini.addAll(ordine.getOrdini());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,9 +119,9 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
.distinctBy(x -> x)
|
.distinctBy(x -> x)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if(foundGestioni != null) {
|
if (foundGestioni != null) {
|
||||||
|
|
||||||
if(foundGestioni.size() == 1) {
|
if (foundGestioni.size() == 1) {
|
||||||
defaultGestioneOfUL = foundGestioni.get(0) == GestioneEnum.PRODUZIONE ? GestioneEnum.LAVORAZIONE : foundGestioni.get(0);
|
defaultGestioneOfUL = foundGestioni.get(0) == GestioneEnum.PRODUZIONE ? GestioneEnum.LAVORAZIONE : foundGestioni.get(0);
|
||||||
} else {
|
} else {
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(mActivity.getString(R.string.error_multiple_gest)), null, () -> {
|
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(mActivity.getString(R.string.error_multiple_gest)), null, () -> {
|
||||||
@ -134,7 +138,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initRecyclerView(List<List<OrdineAccettazioneDTO.Riga>> groupedRighe){
|
private void initRecyclerView(List<List<OrdineAccettazioneDTO.Riga>> groupedRighe) {
|
||||||
//RecyclerView setup
|
//RecyclerView setup
|
||||||
mActivity.bindings.accettazioneOrdineMainList.setHasFixedSize(true);
|
mActivity.bindings.accettazioneOrdineMainList.setHasFixedSize(true);
|
||||||
|
|
||||||
@ -152,8 +156,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
mActivity.bindings.accettazioneOrdineMainList.setAdapter(mAdapter);
|
mActivity.bindings.accettazioneOrdineMainList.setAdapter(mAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshOrderBy(boolean forceHiddenCheck){
|
public void refreshOrderBy(boolean forceHiddenCheck) {
|
||||||
switch (currentOrderBy){
|
switch (currentOrderBy) {
|
||||||
case COD_ART_FOR:
|
case COD_ART_FOR:
|
||||||
groupedRighe = helper.getOrdiniRaggruppatiPerCodArtForn(groupedOrdini, forceHiddenCheck);
|
groupedRighe = helper.getOrdiniRaggruppatiPerCodArtForn(groupedOrdini, forceHiddenCheck);
|
||||||
break;
|
break;
|
||||||
@ -186,7 +190,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void removeListFilter() {
|
public void removeListFilter() {
|
||||||
for(int i = 0; i < groupedOrdini.size(); i++) {
|
for (int i = 0; i < groupedOrdini.size(); i++) {
|
||||||
groupedOrdini.get(i).setTempHidden(false);
|
groupedOrdini.get(i).setTempHidden(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,9 +198,9 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
mActivity.bindings.filteredArtsInListExpandableLayout.collapse(true);
|
mActivity.bindings.filteredArtsInListExpandableLayout.collapse(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void recoverUL(MtbColt recoveredMtbColt){
|
public void recoverUL(MtbColt recoveredMtbColt) {
|
||||||
|
|
||||||
for(int i = 0; i < recoveredMtbColt.getMtbColr().size(); i++){
|
for (int i = 0; i < recoveredMtbColt.getMtbColr().size(); i++) {
|
||||||
|
|
||||||
MtbColr currentMtbColr = recoveredMtbColt.getMtbColr().get(i);
|
MtbColr currentMtbColr = recoveredMtbColt.getMtbColr().get(i);
|
||||||
|
|
||||||
@ -215,7 +219,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
if(foundRows != null && foundRows.size() > 0){
|
if (foundRows != null && foundRows.size() > 0) {
|
||||||
OrdineAccettazioneDTO.Riga currentRow = foundRows.get(0);
|
OrdineAccettazioneDTO.Riga currentRow = foundRows.get(0);
|
||||||
|
|
||||||
currentRow.setHidden(false);
|
currentRow.setHidden(false);
|
||||||
@ -230,15 +234,13 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
public RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mActivity);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||||
|
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
if(UtilityBarcode.isEtichettaAnonima(data)){
|
if (UtilityBarcode.isEtichettaAnonima(data)) {
|
||||||
if(!thereIsAnOpenedUL()) this.executeEtichettaAnonima(data, progressDialog);
|
if (!thereIsAnOpenedUL()) this.executeEtichettaAnonima(data, progressDialog);
|
||||||
else {
|
else {
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(
|
DialogSimpleMessageHelper.makeErrorDialog(
|
||||||
mActivity,
|
mActivity,
|
||||||
@ -250,9 +252,9 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
})
|
})
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
} else if(UtilityBarcode.isEtichetta128(data)) {
|
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||||
this.executeEtichettaEan128(data, progressDialog);
|
this.executeEtichettaEan128(data, progressDialog);
|
||||||
} else if(UtilityBarcode.isEanPeso(data)){
|
} else if (UtilityBarcode.isEanPeso(data)) {
|
||||||
this.executeEtichettaEanPeso(data, progressDialog);
|
this.executeEtichettaEanPeso(data, progressDialog);
|
||||||
} else {
|
} else {
|
||||||
this.loadArticolo(data.getStringValue(), null, progressDialog);
|
this.loadArticolo(data.getStringValue(), null, progressDialog);
|
||||||
@ -264,8 +266,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), false, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), false, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
if(!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
||||||
UtilityExceptions.defaultException(mActivity, new Exception("Per continuare scansiona un'etichetta dell'anno corrente"), progressDialog, false);
|
UtilityExceptions.defaultException(mActivity, new Exception("Per continuare scansiona un'etichetta dell'anno corrente"), progressDialog, false);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
} else {
|
} else {
|
||||||
@ -292,12 +294,12 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
String barcodeProd = null;
|
String barcodeProd = null;
|
||||||
|
|
||||||
if(ean128Model.Sscc != null) barcodeProd = ean128Model.Sscc;
|
if (ean128Model.Sscc != null) barcodeProd = ean128Model.Sscc;
|
||||||
if(ean128Model.Gtin != null) barcodeProd = ean128Model.Gtin;
|
if (ean128Model.Gtin != null) barcodeProd = ean128Model.Gtin;
|
||||||
if(ean128Model.Content != null) barcodeProd = ean128Model.Content;
|
if (ean128Model.Content != null) barcodeProd = ean128Model.Content;
|
||||||
|
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||||
if (barcodeProd.startsWith("0") || barcodeProd.startsWith("9")) {
|
if (barcodeProd.startsWith("0") || barcodeProd.startsWith("9")) {
|
||||||
barcodeProd = barcodeProd.substring(1, barcodeProd.length());
|
barcodeProd = barcodeProd.substring(1, barcodeProd.length());
|
||||||
}
|
}
|
||||||
@ -307,7 +309,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
}, ex-> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mActivity, ex, progressDialog);
|
UtilityExceptions.defaultException(mActivity, ex, progressDialog);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
});
|
});
|
||||||
@ -326,20 +328,19 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Dialog progressDialog) {
|
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Dialog progressDialog) {
|
||||||
if(barcodeProd.length() == 14) {
|
if (barcodeProd.length() == 14) {
|
||||||
// barcodeProd = UtilityBarcode.convertITF14toNeutral(barcodeProd);
|
// barcodeProd = UtilityBarcode.convertITF14toNeutral(barcodeProd);
|
||||||
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
||||||
}
|
}
|
||||||
|
|
||||||
ArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
ArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
||||||
|
|
||||||
if(mtbAartList != null && mtbAartList.size() > 0) {
|
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||||
|
|
||||||
if(!thereIsAnOpenedUL()){
|
if (!thereIsAnOpenedUL()) {
|
||||||
|
|
||||||
if(SettingsManager.iDB().isFlagCanAutoOpenNewULAccettazione()) {
|
if (SettingsManager.iDB().isFlagCanAutoOpenNewULAccettazione()) {
|
||||||
this.createNewUL(null, null, progressDialog, false, () -> {
|
this.createNewUL(null, null, progressDialog, false, () -> {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||||
@ -382,13 +383,13 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
(x.isHidden() != null && !x.isHidden()) && (x.isTempHidden() != null && !x.isTempHidden()))
|
(x.isHidden() != null && !x.isHidden()) && (x.isTempHidden() != null && !x.isTempHidden()))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if(foundRowsList.size() == 0) {
|
if (foundRowsList.size() == 0) {
|
||||||
showNoArtFoundDialog();
|
showNoArtFoundDialog();
|
||||||
} else if(foundRowsList.size() == 1) {
|
} else if (foundRowsList.size() == 1) {
|
||||||
onOrdineRowDispatch(foundRowsList.get(0), ean128Model);
|
onOrdineRowDispatch(foundRowsList.get(0), ean128Model);
|
||||||
} else {
|
} else {
|
||||||
for(int i = 0; i < groupedOrdini.size(); i++) {
|
for (int i = 0; i < groupedOrdini.size(); i++) {
|
||||||
if(!foundRowsList.contains(groupedOrdini.get(i))) {
|
if (!foundRowsList.contains(groupedOrdini.get(i))) {
|
||||||
groupedOrdini.get(i).setTempHidden(true);
|
groupedOrdini.get(i).setTempHidden(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -433,7 +434,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
mActivity.bindings.accettazioneOrdineInevasoFab.close(true);
|
mActivity.bindings.accettazioneOrdineInevasoFab.close(true);
|
||||||
|
|
||||||
if (progress == null){
|
if (progress == null) {
|
||||||
progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,7 +449,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
||||||
|
|
||||||
String defaultPosAccettazione = "";
|
String defaultPosAccettazione = "";
|
||||||
if(defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value)) defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
if (defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value))
|
||||||
|
defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
||||||
|
|
||||||
MtbColt mtbColt = new MtbColt();
|
MtbColt mtbColt = new MtbColt();
|
||||||
mtbColt
|
mtbColt
|
||||||
@ -458,11 +460,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
.setPosizione(defaultPosAccettazione)
|
.setPosizione(defaultPosAccettazione)
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
if(customNumCollo != null) {
|
if (customNumCollo != null) {
|
||||||
mtbColt.setNumCollo(customNumCollo);
|
mtbColt.setNumCollo(customNumCollo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(customSerCollo)) {
|
if (!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||||
mtbColt.setSerCollo(customSerCollo);
|
mtbColt.setSerCollo(customSerCollo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,7 +474,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
.distinct()
|
.distinct()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if(codAnags != null && codAnags.size() == 1){
|
if (codAnags != null && codAnags.size() == 1) {
|
||||||
mtbColt.setCodAnag(codAnags.get(0));
|
mtbColt.setCodAnag(codAnags.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,7 +484,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
.distinct()
|
.distinct()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if(rifOrds != null && rifOrds.size() == 1){
|
if (rifOrds != null && rifOrds.size() == 1) {
|
||||||
mtbColt.setRifOrd(rifOrds.get(0));
|
mtbColt.setRifOrd(rifOrds.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,7 +494,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
.distinct()
|
.distinct()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if(numDataOrds != null && numDataOrds.size() == 1){
|
if (numDataOrds != null && numDataOrds.size() == 1) {
|
||||||
mtbColt.setNumOrd(mOrders.get(0).getNumero());
|
mtbColt.setNumOrd(mOrders.get(0).getNumero());
|
||||||
mtbColt.setDataOrd(mOrders.get(0).getData());
|
mtbColt.setDataOrd(mOrders.get(0).getData());
|
||||||
|
|
||||||
@ -519,9 +521,9 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
finalProgress.dismiss();
|
finalProgress.dismiss();
|
||||||
|
|
||||||
FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
|
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,7 +547,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void setULToCurrentContext(MtbColt mtbColt){
|
private void setULToCurrentContext(MtbColt mtbColt) {
|
||||||
isFabVisible.set(false);
|
isFabVisible.set(false);
|
||||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(mtbColt);
|
mArticoliInColloBottomSheetViewModel.mtbColt.set(mtbColt);
|
||||||
}
|
}
|
||||||
@ -574,14 +576,14 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onColloClosed(Runnable onComplete, boolean shouldPrint) {
|
public void onColloClosed(Runnable onComplete, boolean shouldPrint) {
|
||||||
if(thereIsAnOpenedUL()) {
|
if (thereIsAnOpenedUL()) {
|
||||||
|
|
||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||||
progress.show();
|
progress.show();
|
||||||
|
|
||||||
if(thereIsAnyRowInUL()) {
|
if (thereIsAnyRowInUL()) {
|
||||||
updateDataFine(progress, () -> {
|
updateDataFine(progress, () -> {
|
||||||
if(shouldPrint) printCollo(progress, onComplete);
|
if (shouldPrint) printCollo(progress, onComplete);
|
||||||
else {
|
else {
|
||||||
postCloseOperations(onComplete);
|
postCloseOperations(onComplete);
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
@ -592,7 +594,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -621,7 +623,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
private void printCollo(Dialog progress, Runnable onComplete) {
|
private void printCollo(Dialog progress, Runnable onComplete) {
|
||||||
MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||||
|
|
||||||
if(currentMtbColt.getDisablePrint()){
|
if (currentMtbColt.getDisablePrint()) {
|
||||||
postCloseOperations(onComplete);
|
postCloseOperations(onComplete);
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
return;
|
return;
|
||||||
@ -629,8 +631,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.SECONDARIA, value -> {
|
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.SECONDARIA, value -> {
|
||||||
|
|
||||||
if(value.size() > 0) {
|
if (value.size() > 0) {
|
||||||
try{
|
try {
|
||||||
|
|
||||||
|
|
||||||
ReportManager.getRightReportNameByGestione(GestioneEnum.ACQUISTO, reportName -> {
|
ReportManager.getRightReportNameByGestione(GestioneEnum.ACQUISTO, reportName -> {
|
||||||
@ -658,7 +660,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
||||||
);
|
);
|
||||||
} catch (Exception ex){
|
} catch (Exception ex) {
|
||||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -683,7 +685,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
isFabVisible.set(true);
|
isFabVisible.set(true);
|
||||||
|
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -699,7 +701,6 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void postCloseOperations(Runnable onComplete) {
|
private void postCloseOperations(Runnable onComplete) {
|
||||||
|
|
||||||
MtbColt mtbColt = (MtbColt) getColloRef().clone();
|
MtbColt mtbColt = (MtbColt) getColloRef().clone();
|
||||||
@ -708,18 +709,18 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
isFabVisible.set(true);
|
isFabVisible.set(true);
|
||||||
|
|
||||||
if(mtbColt != null && mtbColt.getMtbColr() != null) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null) {
|
||||||
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
|
||||||
|
|
||||||
MtbColr currentRow = mtbColt.getMtbColr().get(i);
|
MtbColr currentRow = mtbColt.getMtbColr().get(i);
|
||||||
|
|
||||||
if(currentRow.getRigaOrd() != null) {
|
if (currentRow.getRigaOrd() != null) {
|
||||||
|
|
||||||
for(int k = 0; k < this.groupedOrdini.size(); k++) {
|
for (int k = 0; k < this.groupedOrdini.size(); k++) {
|
||||||
|
|
||||||
OrdineAccettazioneDTO.Riga x = this.groupedOrdini.get(k);
|
OrdineAccettazioneDTO.Riga x = this.groupedOrdini.get(k);
|
||||||
|
|
||||||
if(x.getQtaDaEvadere().floatValue() > 0 &&
|
if (x.getQtaDaEvadere().floatValue() > 0 &&
|
||||||
x.getMtbAart().getCodMart().equalsIgnoreCase(currentRow.getCodMart()) &&
|
x.getMtbAart().getCodMart().equalsIgnoreCase(currentRow.getCodMart()) &&
|
||||||
x.getCodJcom().equalsIgnoreCase(currentRow.getCodJcom()) &&
|
x.getCodJcom().equalsIgnoreCase(currentRow.getCodJcom()) &&
|
||||||
x.getRigaOrd() == currentRow.getRigaOrd() &&
|
x.getRigaOrd() == currentRow.getRigaOrd() &&
|
||||||
@ -753,13 +754,13 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
removeListFilter();
|
removeListFilter();
|
||||||
refreshOrderBy(true);
|
refreshOrderBy(true);
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onOrdineRowDispatch(final OrdineAccettazioneDTO.Riga item, Ean128Model ean128Model) {
|
public void onOrdineRowDispatch(final OrdineAccettazioneDTO.Riga item, Ean128Model ean128Model) {
|
||||||
if(getColloRef() != null){
|
if (getColloRef() != null) {
|
||||||
|
|
||||||
List<MtbColr> currentMtbColrs = getColloRef().getMtbColr();
|
List<MtbColr> currentMtbColrs = getColloRef().getMtbColr();
|
||||||
|
|
||||||
@ -777,14 +778,13 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
float qtaEvasa = item.qtaRiservate + qtaEvasaInMtbColr;
|
float qtaEvasa = item.qtaRiservate + qtaEvasaInMtbColr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BigDecimal qtaDaEvadere;
|
BigDecimal qtaDaEvadere;
|
||||||
|
|
||||||
BigDecimal totalQtaDaEvadere = item.getQtaOrd().subtract(new BigDecimal(qtaEvasa)).subtract(item.getQtaEvasa());
|
BigDecimal totalQtaDaEvadere = item.getQtaOrd().subtract(new BigDecimal(qtaEvasa)).subtract(item.getQtaEvasa());
|
||||||
|
|
||||||
BigDecimal qtaColliPedana = item.mtbAart.getColliPedana().multiply(item.mtbAart.getQtaCnf());
|
BigDecimal qtaColliPedana = item.mtbAart.getColliPedana().multiply(item.mtbAart.getQtaCnf());
|
||||||
|
|
||||||
if(qtaColliPedana.floatValue() > 0 && qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) {
|
if (qtaColliPedana.floatValue() > 0 && qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) {
|
||||||
qtaDaEvadere = qtaColliPedana;
|
qtaDaEvadere = qtaColliPedana;
|
||||||
} else {
|
} else {
|
||||||
qtaDaEvadere = totalQtaDaEvadere;
|
qtaDaEvadere = totalQtaDaEvadere;
|
||||||
@ -799,15 +799,15 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
.setQtaEvasa(new BigDecimal(qtaEvasa))
|
.setQtaEvasa(new BigDecimal(qtaEvasa))
|
||||||
.setCanPartitaMagBeChanged(true);
|
.setCanPartitaMagBeChanged(true);
|
||||||
|
|
||||||
if(ean128Model != null){
|
if (ean128Model != null) {
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
if (!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||||
dto.setBatchLot(ean128Model.BatchLot);
|
dto.setBatchLot(ean128Model.BatchLot);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
|
if (!UtilityString.isNullOrEmpty(ean128Model.BestBefore)) {
|
||||||
dto.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
|
dto.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
|
||||||
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
} else if (!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
||||||
dto.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
|
dto.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -816,11 +816,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(ean128Model.Count != null && ean128Model.Count > 0) {
|
if (ean128Model.Count != null && ean128Model.Count > 0) {
|
||||||
//if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
//if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||||
dto.setQtaTot(new BigDecimal(ean128Model.Count));
|
dto.setQtaTot(new BigDecimal(ean128Model.Count));
|
||||||
|
|
||||||
if(!item.getMtbAart().isFlagQtaCnfFissa()) {
|
if (!item.getMtbAart().isFlagQtaCnfFissa()) {
|
||||||
dto.setQtaCnf(new BigDecimal(ean128Model.Count));
|
dto.setQtaCnf(new BigDecimal(ean128Model.Count));
|
||||||
}
|
}
|
||||||
//} else {
|
//} else {
|
||||||
@ -832,7 +832,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
dto.setQtaTot(new BigDecimal(ean128Model.NetWeightKg));
|
dto.setQtaTot(new BigDecimal(ean128Model.NetWeightKg));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dto.getQtaTot() != null && dto.getQtaTot().floatValue() > 0 && dto.getNumCnf() != null && dto.getNumCnf() > 0) {
|
if (dto.getQtaTot() != null && dto.getQtaTot().floatValue() > 0 && dto.getNumCnf() != null && dto.getNumCnf() > 0) {
|
||||||
dto.setQtaCnf(dto.getQtaTot().divide(new BigDecimal(dto.getNumCnf())));
|
dto.setQtaCnf(dto.getQtaTot().divide(new BigDecimal(dto.getNumCnf())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -845,7 +845,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onOrdineRowDispatched(OrdineAccettazioneDTO.Riga item, QuantityDTO quantityDTO, boolean closeLU){
|
private void onOrdineRowDispatched(OrdineAccettazioneDTO.Riga item, QuantityDTO quantityDTO, boolean closeLU) {
|
||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||||
|
|
||||||
String gestioneRif = item.getGestioneOrdEnum() == GestioneEnum.PRODUZIONE ? "L" : item.getGestioneOrd();
|
String gestioneRif = item.getGestioneOrdEnum() == GestioneEnum.PRODUZIONE ? "L" : item.getGestioneOrd();
|
||||||
@ -863,7 +863,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
.setCodJcom(item.getCodJcom())
|
.setCodJcom(item.getCodJcom())
|
||||||
.setRigaOrd(item.getRigaOrd());
|
.setRigaOrd(item.getRigaOrd());
|
||||||
|
|
||||||
if(!item.getMtbAart().isFlagQtaCnfFissa()) {
|
if (!item.getMtbAart().isFlagQtaCnfFissa()) {
|
||||||
mtbColr.setQtaCnf(quantityDTO.qtaCnf.getBigDecimal());
|
mtbColr.setQtaCnf(quantityDTO.qtaCnf.getBigDecimal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -896,7 +896,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
|
|
||||||
if(closeLU) onColloClosed(null, true);
|
if (closeLU) onColloClosed(null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -908,7 +908,6 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private MtbColt getColloRef() {
|
private MtbColt getColloRef() {
|
||||||
return mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
return mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||||
}
|
}
|
||||||
@ -919,33 +918,37 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
private void onRowEdited(MtbColr oldValue, MtbColr newValue) {
|
private void onRowEdited(MtbColr oldValue, MtbColr newValue) {
|
||||||
|
|
||||||
if(getColloRef() != null) {
|
// if (getColloRef() != null) {
|
||||||
|
//
|
||||||
Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
// Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||||
|
//
|
||||||
MtbColr mtbColrToEditOfAccettazione = Stream.of(getColloRef().getMtbColr())
|
// Optional<MtbColr> optionalMtbColrToEditOfAccettazione = Stream.of(getColloRef().getMtbColr())
|
||||||
.filter(x -> x.getQtaCol().compareTo(oldValue.getQtaCol()) == 0 &&
|
// .filter(x -> UtilityBigDecimal.equalsTo(x.getQtaCol(), oldValue.getQtaCol()) &&
|
||||||
x.getCodMart().equalsIgnoreCase(oldValue.getCodMart()) &&
|
// UtilityString.equalsIgnoreCase(x.getCodMart(), oldValue.getCodMart()) &&
|
||||||
x.getPartitaMag().equalsIgnoreCase(oldValue.getPartitaMag()) &&
|
// UtilityString.equalsIgnoreCase(x.getPartitaMag(), oldValue.getPartitaMag()) &&
|
||||||
x.getCodJcom().equalsIgnoreCase(oldValue.getCodJcom()))
|
// UtilityString.equalsIgnoreCase(x.getCodJcom(), oldValue.getCodJcom()))
|
||||||
.findFirst()
|
// .findFirst();
|
||||||
.get();
|
//
|
||||||
|
// if(optionalMtbColrToEditOfAccettazione.isPresent()) {
|
||||||
mtbColrToEditOfAccettazione
|
// MtbColr mtbColrToEditOfAccettazione = optionalMtbColrToEditOfAccettazione.get();
|
||||||
.setQtaCol(newValue.getQtaCol());
|
//
|
||||||
|
// mtbColrToEditOfAccettazione
|
||||||
ColliMagazzinoRESTConsumer.updateRiga(mtbColrToEditOfAccettazione, () -> {
|
// .setQtaCol(newValue.getQtaCol());
|
||||||
progress.dismiss();
|
//
|
||||||
|
// ColliMagazzinoRESTConsumer.updateRiga(mtbColrToEditOfAccettazione, () -> {
|
||||||
|
// progress.dismiss();
|
||||||
|
// this.refreshOrderBy(false);
|
||||||
|
// }, ex -> {
|
||||||
|
// UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||||
|
// this.refreshOrderBy(false);
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// } else {
|
||||||
|
//
|
||||||
this.refreshOrderBy(false);
|
this.refreshOrderBy(false);
|
||||||
}, ex -> {
|
// }
|
||||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
|
||||||
this.refreshOrderBy(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
this.refreshOrderBy(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.MainActivity;
|
import it.integry.integrywmsnative.MainActivity;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.class_router.interfaces.IOrdiniVendita;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||||
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
||||||
@ -145,10 +146,15 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
private void cyclicRecover(Iterator<Integer> sessionsIterator, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private void cyclicRecover(Iterator<Integer> sessionsIterator, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
if(sessionsIterator.hasNext()) {
|
if(sessionsIterator.hasNext()) {
|
||||||
Integer recoveredMtbColtID = sessionsIterator.next();
|
Integer recoveredMtbColtID = sessionsIterator.next();
|
||||||
MtbColt recoveredMtbColt = ColliDataRecover.getSession(recoveredMtbColtID);
|
ColliDataRecover.RecoverDTO recoveredMtbColtDto = ColliDataRecover.getSession(recoveredMtbColtID);
|
||||||
|
MtbColt recoveredMtbColt = recoveredMtbColtDto.getMtbColt();
|
||||||
|
|
||||||
if(recoveredMtbColt != null && (recoveredMtbColt.getGestioneEnum() == GestioneEnum.VENDITA || recoveredMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && !UtilityString.isNullOrEmpty(recoveredMtbColt.getFiltroOrdini())) {
|
if(recoveredMtbColt != null && (recoveredMtbColt.getGestioneEnum() == GestioneEnum.VENDITA || recoveredMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && !UtilityString.isNullOrEmpty(recoveredMtbColt.getFiltroOrdini())) {
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(recoveredMtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
|
||||||
|
IOrdiniVendita ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA);
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumer.updateDataFine(getActivity(), null, recoveredMtbColt, () -> {
|
||||||
|
ordiniVendita.distribuisciCollo(null, recoveredMtbColt, recoveredMtbColtDto.getTestateOrdini(),
|
||||||
mtbColts -> {
|
mtbColts -> {
|
||||||
ColliDataRecover.closeSession(recoveredMtbColtID);
|
ColliDataRecover.closeSession(recoveredMtbColtID);
|
||||||
|
|
||||||
@ -164,6 +170,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
|
|
||||||
cyclicRecover(sessionsIterator, onComplete, onFailed);
|
cyclicRecover(sessionsIterator, onComplete, onFailed);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
ColliDataRecover.closeSession(recoveredMtbColtID);
|
ColliDataRecover.closeSession(recoveredMtbColtID);
|
||||||
cyclicRecover(sessionsIterator, onComplete, onFailed);
|
cyclicRecover(sessionsIterator, onComplete, onFailed);
|
||||||
|
|||||||
@ -89,7 +89,7 @@ public class ProdVersamentoMaterialViewModel {
|
|||||||
DialogScanOrCreateLU.make(mContext, false, false, true, false, mtbColt -> {
|
DialogScanOrCreateLU.make(mContext, false, false, true, false, mtbColt -> {
|
||||||
if (mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
((IPoppableActivity) mContext).pop();
|
((IPoppableActivity) mContext).pop();
|
||||||
} else if ((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(+1)) {
|
} else if ((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE || mtbColt.getGestioneEnum() == GestioneEnum.VENDITA) && mtbColt.getSegno().equals(+1)) {
|
||||||
|
|
||||||
if (mtbColt.getMtbColr() == null || mtbColt.getMtbColr().size() == 0) {
|
if (mtbColt.getMtbColr() == null || mtbColt.getMtbColr().size() == 0) {
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
|
|||||||
@ -337,7 +337,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void recoverUL(MtbColt recoveredMtbColt){
|
public void recoverUL(MtbColt recoveredMtbColt){
|
||||||
mtbColtSessionID = ColliDataRecover.startNewSession(recoveredMtbColt);
|
mtbColtSessionID = ColliDataRecover.startNewSession(recoveredMtbColt, mTestateOrdini);
|
||||||
setULToCurrentContext(recoveredMtbColt);
|
setULToCurrentContext(recoveredMtbColt);
|
||||||
refreshOrderBy(false);
|
refreshOrderBy(false);
|
||||||
}
|
}
|
||||||
@ -825,7 +825,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
mtbColt
|
mtbColt
|
||||||
.setNumCollo(value.getNumCollo())
|
.setNumCollo(value.getNumCollo())
|
||||||
.setDataCollo(value.getDataColloS());
|
.setDataCollo(value.getDataColloS());
|
||||||
mtbColtSessionID = ColliDataRecover.startNewSession(mtbColt);
|
mtbColtSessionID = ColliDataRecover.startNewSession(mtbColt, mTestateOrdini);
|
||||||
|
|
||||||
value
|
value
|
||||||
.setDisablePrint(disablePrint)
|
.setDisablePrint(disablePrint)
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
UtilityToast.showToast("Avviato metodo in BaseFeature");
|
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||||
onComplete,
|
onComplete,
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
UtilityToast.showToast("Avviato metodo in Frudis");
|
// UtilityToast.showToast("Avviato metodo in Frudis");
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||||
onComplete,
|
onComplete,
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
UtilityToast.showToast("Avviato metodo in BaseFeature");
|
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||||
onComplete,
|
onComplete,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
UtilityToast.showToast("Avviato metodo in BaseFeature");
|
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||||
onComplete,
|
onComplete,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user