diff --git a/app/src/main/java/it/integry/integrywmsnative/core/REST/CommonRESTException.java b/app/src/main/java/it/integry/integrywmsnative/core/REST/CommonRESTException.java index 2fe01208..6bcd686e 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/REST/CommonRESTException.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/REST/CommonRESTException.java @@ -26,9 +26,9 @@ public class CommonRESTException { } else if(ex instanceof SocketTimeoutException){ return "Errore di timeout durante la comunicazione con il server remoto. Riprova."; } else if(ex.getMessage().startsWith("Printer not found")){ - return "Stampante non configurata"; + return "Stampante non trovata"; } else { - return null; + return ex.getMessage(); } } diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/rettifica_giacenze/viewmodel/RettificaGiacenzeViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/rettifica_giacenze/viewmodel/RettificaGiacenzeViewModel.java index d32329c7..80c7e3de 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/rettifica_giacenze/viewmodel/RettificaGiacenzeViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/rettifica_giacenze/viewmodel/RettificaGiacenzeViewModel.java @@ -426,37 +426,40 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked public void closeLU(boolean openNewOne) { - final ProgressDialog progress = ProgressDialog.show(mContext, mContext.getText(R.string.waiting), - mContext.getText(R.string.loading) + " ...", true); + if(thereIsAnyRowInUL()) { - if(thereIsAnyRowInUL()){ + final ProgressDialog progress = ProgressDialog.show(mContext, mContext.getText(R.string.waiting), + mContext.getText(R.string.loading) + " ...", true); - if(!UtilityString.isNullOrEmpty(SettingsManager.iDB().getDefaultCausaleRettificaGiacenze())) { + if (thereIsAnyRowInUL()) { - progress.show(); - saveCausaleRettificaGiacenze(progress, () -> { - if(!mtbColt.get().getDisablePrint()){ + if (!UtilityString.isNullOrEmpty(SettingsManager.iDB().getDefaultCausaleRettificaGiacenze())) { + + progress.show(); + saveCausaleRettificaGiacenze(progress, () -> { + if (!mtbColt.get().getDisablePrint()) { + printCollo(progress); + } else { + progress.dismiss(); + resetMtbColt(openNewOne); + } + }); + } else { + if (!mtbColt.get().getDisablePrint()) { + progress.show(); printCollo(progress); } else { - progress.dismiss(); resetMtbColt(openNewOne); } - }); - } else { - if(!mtbColt.get().getDisablePrint()){ - progress.show(); - printCollo(progress); - } else { - resetMtbColt(openNewOne); } - } - } else { - progress.show(); - ColliMagazzinoRESTConsumer.deleteCollo(mtbColt.get(), () -> { - progress.dismiss(); - resetMtbColt(openNewOne); - }, ex -> UtilityExceptions.defaultException(mContext, ex, progress)); + } else { + progress.show(); + ColliMagazzinoRESTConsumer.deleteCollo(mtbColt.get(), () -> { + progress.dismiss(); + resetMtbColt(openNewOne); + }, ex -> UtilityExceptions.defaultException(mContext, ex, progress)); + } } }