Bugfix vari
This commit is contained in:
parent
25aefc9823
commit
e9cf6e2ff7
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -52,8 +52,8 @@ public class MainActivity extends AppCompatActivity
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
new ExceptionsHandler(this);
|
|
||||||
|
|
||||||
|
ExceptionsHandler.init(this);
|
||||||
|
|
||||||
PermissionsHelper.askPermissions(this);
|
PermissionsHelper.askPermissions(this);
|
||||||
|
|
||||||
|
|||||||
@ -23,9 +23,13 @@ public class CommonConst {
|
|||||||
|
|
||||||
public static class Mail {
|
public static class Mail {
|
||||||
|
|
||||||
|
public static String[] forErrorsDebug = {
|
||||||
|
"g.scorrano@integry.it"
|
||||||
|
};
|
||||||
|
|
||||||
public static String[] forErrors = {
|
public static String[] forErrors = {
|
||||||
// "syslogs@integry.it",
|
"syslogs@integry.it",
|
||||||
"g.scorrano@integry.it"
|
"g.scorrano@integry.it"
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import java.lang.reflect.Type;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||||
@ -124,11 +125,18 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().userSession.profileDB) ? "" : " [" + SettingsManager.i().userSession.profileDB + "]";
|
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().userSession.profileDB) ? "" : " [" + SettingsManager.i().userSession.profileDB + "]";
|
||||||
|
|
||||||
|
String dest = "";
|
||||||
|
if(BuildConfig.DEBUG) {
|
||||||
|
dest = TextUtils.join(";", CommonConst.Mail.forErrorsDebug);
|
||||||
|
} else {
|
||||||
|
dest = TextUtils.join(";", CommonConst.Mail.forErrors);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MailRequestDTO mailDTO = new MailRequestDTO()
|
MailRequestDTO mailDTO = new MailRequestDTO()
|
||||||
.setFrom("sender@integry.it")
|
.setFrom("sender@integry.it")
|
||||||
.setFromName("WMS Android")
|
.setFromName((BuildConfig.DEBUG ? "[DEBUG] " : "") + "WMS Android")
|
||||||
.setTo(TextUtils.join(";", CommonConst.Mail.forErrors))
|
.setTo(dest)
|
||||||
.setSubject("Bug notification" + currentAzienda)
|
.setSubject("Bug notification" + currentAzienda)
|
||||||
.setMsgText(message)
|
.setMsgText(message)
|
||||||
.setHtml(true);
|
.setHtml(true);
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.core.exception;
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -11,7 +10,7 @@ import java.io.File;
|
|||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
import it.integry.integrywmsnative.view.dialogs.exception.DialogException;
|
import it.integry.integrywmsnative.view.dialogs.exception.DialogException;
|
||||||
|
|
||||||
@ -20,14 +19,20 @@ public class ExceptionsHandler implements Thread.UncaughtExceptionHandler {
|
|||||||
private final static String TAG = ExceptionsHandler.class.getSimpleName();
|
private final static String TAG = ExceptionsHandler.class.getSimpleName();
|
||||||
|
|
||||||
private final Activity context;
|
private final Activity context;
|
||||||
private final Thread.UncaughtExceptionHandler rootHandler;
|
//private final Thread.UncaughtExceptionHandler rootHandler;
|
||||||
|
|
||||||
public ExceptionsHandler(Activity context) {
|
public static void init(Activity context) {
|
||||||
|
new ExceptionsHandler(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ExceptionsHandler(Activity context) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
// we should store the current exception handler -- to invoke it for all not handled exceptions ...
|
|
||||||
rootHandler = Thread.getDefaultUncaughtExceptionHandler();
|
if (!BuildConfig.DEBUG) {
|
||||||
// we replace the exception handler now with us -- we will properly dispatch the exceptions ...
|
//rootHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||||
Thread.setDefaultUncaughtExceptionHandler(this);
|
Thread.setDefaultUncaughtExceptionHandler(this);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -428,8 +428,9 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
resetMtbColt(openNewOne);
|
resetMtbColt(openNewOne);
|
||||||
}
|
}
|
||||||
})
|
}), () -> {
|
||||||
, ex ->
|
progress.dismiss();
|
||||||
|
}, ex ->
|
||||||
UtilityExceptions.defaultException(mContext, ex, progress)
|
UtilityExceptions.defaultException(mContext, ex, progress)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -440,6 +441,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
} else {
|
} else {
|
||||||
resetMtbColt(openNewOne);
|
resetMtbColt(openNewOne);
|
||||||
}
|
}
|
||||||
|
}, () -> {
|
||||||
|
progress.dismiss();
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -478,13 +481,13 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void posizionaCollo(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private void posizionaCollo(Runnable onComplete, Runnable onAbort, RunnableArgs<Exception> onFailed) {
|
||||||
DialogAskPositionOfLU.makeBase(mContext, mtbColt.get(), mtbDepoPosizione -> {
|
DialogAskPositionOfLU.makeBase(mContext, mtbColt.get(), mtbDepoPosizione -> {
|
||||||
if(mtbDepoPosizione != null) {
|
if(mtbDepoPosizione != null) {
|
||||||
mtbColt.get().setPosizione(mtbDepoPosizione.getPosizione());
|
mtbColt.get().setPosizione(mtbDepoPosizione.getPosizione());
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
} else {
|
} else {
|
||||||
onFailed.run(null);
|
onAbort.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import com.annimon.stream.Stream;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -230,7 +231,7 @@ public class VersamentoMerceViewModel {
|
|||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
|
|
||||||
resetMtbColt();
|
showDataSavedDialog();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
@ -323,7 +324,13 @@ public class VersamentoMerceViewModel {
|
|||||||
.setCanDataScadBeChanged(false)
|
.setCanDataScadBeChanged(false)
|
||||||
.setMaxQta(mtbColr.getQtaCol());
|
.setMaxQta(mtbColr.getQtaCol());
|
||||||
|
|
||||||
DialogInputQuantity.makeBase(mContext, dto, false, value -> {
|
DialogInputQuantity.makeBase(mContext, dto, false, quantityDTO -> {
|
||||||
|
mtbColr
|
||||||
|
.setQtaCol(new BigDecimal(quantityDTO.qtaTot.get()))
|
||||||
|
.setQtaCnf(new BigDecimal(quantityDTO.qtaCnf.get()))
|
||||||
|
.setNumCnf(new BigDecimal(quantityDTO.numCnf.get()))
|
||||||
|
.setDatetimeRow(new Date());
|
||||||
|
|
||||||
onComplete.run(mtbColr);
|
onComplete.run(mtbColr);
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
@ -358,7 +365,7 @@ public class VersamentoMerceViewModel {
|
|||||||
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
||||||
resetMtbColt();
|
showDataSavedDialog();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mContext, ex);
|
UtilityExceptions.defaultException(mContext, ex);
|
||||||
});
|
});
|
||||||
@ -374,7 +381,6 @@ public class VersamentoMerceViewModel {
|
|||||||
new SpannableString(mContext.getResources().getString(R.string.data_saved)),
|
new SpannableString(mContext.getResources().getString(R.string.data_saved)),
|
||||||
null, () -> {
|
null, () -> {
|
||||||
resetMtbColt();
|
resetMtbColt();
|
||||||
openLU();
|
|
||||||
}).show();
|
}).show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,6 +44,8 @@ public class DialogAskPositionOfLU {
|
|||||||
|
|
||||||
private TextInputLayout livelloTextInputLayout;
|
private TextInputLayout livelloTextInputLayout;
|
||||||
|
|
||||||
|
private boolean completedFlow = false;
|
||||||
|
|
||||||
public static Dialog makeBase(final Context context, MtbColt mtbColtToUpdate, RunnableArgs<MtbDepoPosizione> onComplete, RunnableArgs<Exception> onFailed) {
|
public static Dialog makeBase(final Context context, MtbColt mtbColtToUpdate, RunnableArgs<MtbDepoPosizione> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
return new DialogAskPositionOfLU(context, mtbColtToUpdate, onComplete, onFailed).mDialog;
|
return new DialogAskPositionOfLU(context, mtbColtToUpdate, onComplete, onFailed).mDialog;
|
||||||
}
|
}
|
||||||
@ -124,6 +126,7 @@ public class DialogAskPositionOfLU {
|
|||||||
|
|
||||||
mDialog.setOnDismissListener(dialog -> {
|
mDialog.setOnDismissListener(dialog -> {
|
||||||
BarcodeManager.removeCallback(barcodeIstanceID);
|
BarcodeManager.removeCallback(barcodeIstanceID);
|
||||||
|
if(!completedFlow) onComplete.run(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -145,10 +148,16 @@ public class DialogAskPositionOfLU {
|
|||||||
askLivello();
|
askLivello();
|
||||||
} else {
|
} else {
|
||||||
updatePosizione(foundPosizione, () -> {
|
updatePosizione(foundPosizione, () -> {
|
||||||
|
completedFlow = true;
|
||||||
if(onComplete != null) onComplete.run(foundPosizione);
|
if(onComplete != null) onComplete.run(foundPosizione);
|
||||||
}, onFailed);
|
}, ex -> {
|
||||||
|
completedFlow = true;
|
||||||
|
onFailed.run(ex);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
@ -169,10 +178,12 @@ public class DialogAskPositionOfLU {
|
|||||||
|
|
||||||
ColliMagazzinoRESTConsumer.changePosizione(mtbColt, foundPosizione, () -> {
|
ColliMagazzinoRESTConsumer.changePosizione(mtbColt, foundPosizione, () -> {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
|
completedFlow = true;
|
||||||
onComplete.run(foundPosizione);
|
onComplete.run(foundPosizione);
|
||||||
mDialog.dismiss();
|
mDialog.dismiss();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
|
completedFlow = true;
|
||||||
onFailed.run(ex);
|
onFailed.run(ex);
|
||||||
mDialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
@ -202,6 +213,7 @@ public class DialogAskPositionOfLU {
|
|||||||
|
|
||||||
|
|
||||||
private void onLevelAbort() {
|
private void onLevelAbort() {
|
||||||
|
completedFlow = true;
|
||||||
onComplete.run(null);
|
onComplete.run(null);
|
||||||
mDialog.dismiss();
|
mDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -287,7 +287,7 @@ public class DialogInputQuantity {
|
|||||||
|
|
||||||
private void setupQuantities(DTO dto, QuantityDTO quantityDTO){
|
private void setupQuantities(DTO dto, QuantityDTO quantityDTO){
|
||||||
if(dto.getQtaTot() != null) quantityDTO.qtaTot.set(dto.getQtaTot().floatValue());
|
if(dto.getQtaTot() != null) quantityDTO.qtaTot.set(dto.getQtaTot().floatValue());
|
||||||
if(dto.getMaxQta() != null) quantityDTO.maxQta = dto.getMaxQta().floatValue();
|
if(dto.getMaxQta() != null) quantityDTO.maxQta.set(dto.getMaxQta().floatValue());
|
||||||
|
|
||||||
float qtaDisponibile = dto.getQtaDisponibile() != null ? dto.getQtaDisponibile().floatValue() : 0f;
|
float qtaDisponibile = dto.getQtaDisponibile() != null ? dto.getQtaDisponibile().floatValue() : 0f;
|
||||||
if (qtaDisponibile < 0) {
|
if (qtaDisponibile < 0) {
|
||||||
@ -616,7 +616,7 @@ public class DialogInputQuantity {
|
|||||||
|
|
||||||
showExpireDateErrorPrompt(context);
|
showExpireDateErrorPrompt(context);
|
||||||
|
|
||||||
} else if(!quantityDTO.canOverflowQuantity && quantityDTO.qtaTot.get() > quantityDTO.maxQta) {
|
} else if(!quantityDTO.canOverflowQuantity && quantityDTO.qtaTot.get() > quantityDTO.maxQta.get()) {
|
||||||
|
|
||||||
showQuantityOverflowErrorPrompt(context);
|
showQuantityOverflowErrorPrompt(context);
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public class QuantityDTO {
|
|||||||
public boolean qtaCnfNotificationEnabled = true;
|
public boolean qtaCnfNotificationEnabled = true;
|
||||||
public boolean qtaTotNotificationEnabled = true;
|
public boolean qtaTotNotificationEnabled = true;
|
||||||
public boolean canOverflowQuantity = false;
|
public boolean canOverflowQuantity = false;
|
||||||
public Float maxQta = 0f;
|
public BindableFloat maxQta = new BindableFloat();
|
||||||
|
|
||||||
|
|
||||||
public BindableBoolean canPartitaMagBeChanged = new BindableBoolean(true);
|
public BindableBoolean canPartitaMagBeChanged = new BindableBoolean(true);
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
style="@style/TextViewMaterial"
|
style="@style/TextViewMaterial"
|
||||||
android:text="Scansiona il codice a barre di una UL"/>
|
android:text="Scansiona il codice a barre di uno Scaffale"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
Loading…
x
Reference in New Issue
Block a user