Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
60414c949e
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 354
|
||||
def appVersionName = '1.32.14'
|
||||
def appVersionCode = 360
|
||||
def appVersionName = '1.32.20'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -70,19 +70,19 @@ public class MainApplication extends Application {
|
||||
|
||||
|
||||
// handler listener
|
||||
private Thread.UncaughtExceptionHandler _unCaughtExceptionHandler =
|
||||
private final Thread.UncaughtExceptionHandler _unCaughtExceptionHandler =
|
||||
new Thread.UncaughtExceptionHandler() {
|
||||
@Override
|
||||
public void uncaughtException(Thread thread, Throwable ex) {
|
||||
try {
|
||||
UtilityLogger.error(new Exception(ex));
|
||||
} catch (Exception e) {
|
||||
Log.e("Uncaught error", "Exception Logger failed!", e);
|
||||
//MainApplication.exit();
|
||||
}
|
||||
|
||||
// re-throw critical exception further to the os (important)
|
||||
defaultUncaughtExceptionHandler.uncaughtException(thread, ex);
|
||||
|
||||
try {
|
||||
UtilityLogger.error(new Exception(ex));
|
||||
MainApplication.exit();
|
||||
} catch (Exception e) {
|
||||
Log.e("Uncaught error", "Exception Logger failed!", e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.context;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.orhanobut.logger.AndroidLogAdapter;
|
||||
import com.orhanobut.logger.DiskLogAdapter;
|
||||
@ -91,6 +92,32 @@ public class AppContext {
|
||||
logsFolder = new File(mApplicationContext.getExternalFilesDir(null).getAbsolutePath());
|
||||
int maxBytesSize = 5 * 1024 * 1024;
|
||||
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
|
||||
|
||||
removeOldLogs(logsFolder);
|
||||
}
|
||||
|
||||
private void removeOldLogs(File logsFolder) {
|
||||
var files = logsFolder.listFiles();
|
||||
|
||||
if (files == null || files.length <= 1)
|
||||
return;
|
||||
|
||||
var logFiles = Stream.of(files)
|
||||
.sortBy(x -> -1 * x.lastModified())
|
||||
.skip(1)
|
||||
.toList();
|
||||
|
||||
for (var logFile : logFiles) {
|
||||
boolean isDeleted = logFile.delete();
|
||||
}
|
||||
|
||||
files = logsFolder.listFiles();
|
||||
|
||||
if (files == null || files.length > 1)
|
||||
return;
|
||||
|
||||
final boolean isRenamed = files[0].renameTo(new File(files[0].getParentFile().getAbsolutePath() + "/" + "logs_0.csv"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -39,6 +39,9 @@ public class ColliDataRecoverService {
|
||||
if(isFilePresent(CommonConst.Files.RECOVER_COLLO_FILE)) {
|
||||
loadLocalFile();
|
||||
}
|
||||
|
||||
if(mtbColtsSessions == null)
|
||||
mtbColtsSessions = new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean thereIsAnExistantSession() {
|
||||
@ -47,7 +50,6 @@ public class ColliDataRecoverService {
|
||||
|
||||
public List<Integer> getAllSessionIDs() {
|
||||
if(thereIsAnExistantSession()) {
|
||||
|
||||
return Stream.of(mtbColtsSessions)
|
||||
.map(ColliDataRecoverDTO::getId)
|
||||
.toList();
|
||||
@ -56,7 +58,6 @@ public class ColliDataRecoverService {
|
||||
}
|
||||
|
||||
public ColliDataRecoverDTO getSession(Integer sessionID) {
|
||||
|
||||
if(sessionID == null) return null;
|
||||
|
||||
return getIfExists(sessionID);
|
||||
|
||||
@ -66,7 +66,8 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
.addMigrations(MIGRATION_10_11)
|
||||
.addMigrations(MIGRATION_11_12)
|
||||
.addMigrations(MIGRATION_12_13)
|
||||
.addMigrations(MIGRATION_13_14);
|
||||
.addMigrations(MIGRATION_13_14)
|
||||
.addMigrations(MIGRATION_14_15);
|
||||
|
||||
sInstance = builder.build();
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ public class Ordine {
|
||||
private boolean orderNewProducts = false;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
private Integer idGriglia;
|
||||
|
||||
@ColumnInfo(name = "cod_alis")
|
||||
private String codAlis;
|
||||
|
||||
@ -27,6 +27,20 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
|
||||
|
||||
private boolean mBarcodeListener = false;
|
||||
|
||||
private boolean cancelable = true;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isCancelable() {
|
||||
return cancelable;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setCancelable(boolean cancelable) {
|
||||
super.setCancelable(cancelable);
|
||||
this.cancelable = cancelable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(FragmentManager manager, String tag) {
|
||||
|
||||
@ -53,9 +53,9 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
|
||||
public void loadDocumentoAvailableArts(String codDtip, String codMgrp, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void loadDocumentoAvailableArts(String codDtip, String codMgrp, String codAnagForn, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp)
|
||||
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp, codAnagForn)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> response) {
|
||||
|
||||
@ -26,6 +26,7 @@ public interface DocumentiRESTConsumerService {
|
||||
@GET("wms/documento/arts")
|
||||
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
||||
@Query("codDtip") String codDtip,
|
||||
@Query("codMgrp") String codMgrp);
|
||||
@Query("codMgrp") String codMgrp,
|
||||
@Query("codAnagForn") String codAnagForn);
|
||||
|
||||
}
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
public class UtilityProgress {
|
||||
|
||||
public static DialogProgressView createDefaultProgressDialog(FragmentActivity mContext) {
|
||||
var progress = DialogProgressView.newInstance(null, null, true);
|
||||
progress.show(mContext.getSupportFragmentManager(), "tag");
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -8,6 +8,8 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
@ -90,9 +92,11 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
if (!this.mViewModel.hasDocDetails()) {
|
||||
mViewModel.init();
|
||||
} else {
|
||||
@ -100,6 +104,11 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||
|
||||
@ -102,7 +102,11 @@ public class DocInterniViewModel {
|
||||
this.productsFetched = false;
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
documentRESTConsumer.loadDocumentoAvailableArts(this.getCodDtip(), this.getCodMgrp(), data -> {
|
||||
documentRESTConsumer.loadDocumentoAvailableArts(
|
||||
this.getCodDtip(),
|
||||
this.getCodMgrp(),
|
||||
this.getCodAnagForn(),
|
||||
data -> {
|
||||
this.productsFetched = true;
|
||||
this.availableArts = data.getArts();
|
||||
this.artsSize.set(this.availableArts.size());
|
||||
@ -159,6 +163,13 @@ public class DocInterniViewModel {
|
||||
return this.mtbGrup.getValue().getCodMgrp();
|
||||
}
|
||||
|
||||
private String getCodAnagForn() {
|
||||
if (this.fornitore.getValue() == null) {
|
||||
return null;
|
||||
}
|
||||
return this.fornitore.getValue().getCodAnag();
|
||||
}
|
||||
|
||||
public void editDocument(SqlMtbColt document) {
|
||||
this.mListener.onDocumentEditRequest(document, availableArts);
|
||||
}
|
||||
|
||||
@ -90,17 +90,17 @@ public class DialogSelectDocInfoView extends BaseDialogFragment {
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
setCancelable(false);
|
||||
|
||||
mBindings = DialogSelectDocInfoViewBinding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setView(this);
|
||||
|
||||
mViewModel.setFornitori(mDocInputData.getFornitori());
|
||||
|
||||
var cancelable = false;
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(cancelable)
|
||||
.setCancelable(isCancelable())
|
||||
.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
||||
//Volutamente vuoto
|
||||
})
|
||||
@ -110,7 +110,7 @@ public class DialogSelectDocInfoView extends BaseDialogFragment {
|
||||
.create();
|
||||
|
||||
alertDialog.setOnShowListener(this);
|
||||
alertDialog.setCanceledOnTouchOutside(cancelable);
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnDismissListener(this);
|
||||
|
||||
|
||||
|
||||
@ -256,6 +256,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
.setSaveOnImeDone(true)
|
||||
.setPartitaMag(row.getPartitaMag())
|
||||
.setDataScad(row.getDataScad())
|
||||
.setCanInputZeroQuantity(true)
|
||||
.setCanOverflowOrderQuantity(false)
|
||||
.setCanLUBeClosed(false)
|
||||
.setNotesAllowed(true)
|
||||
|
||||
@ -245,20 +245,32 @@ public class DocInterniEditFormViewModel {
|
||||
|
||||
private void initCheckFornitore() {
|
||||
SqlMtbColt doc = this.document.getValue();
|
||||
|
||||
if (doc == null)
|
||||
return;
|
||||
|
||||
boolean isCheckPartitaMag = false;
|
||||
if (doc != null && this.checkFornitoreRules != null) {
|
||||
|
||||
try {
|
||||
if (this.checkFornitoreRules != null && this.checkFornitoreRules.has("value")) {
|
||||
isCheckPartitaMag = this.checkFornitoreRules.getBoolean("value");
|
||||
} else if (this.checkFornitoreRules != null) {
|
||||
String key = doc.getCodAnag();
|
||||
if (doc.getCodVdes() != null && !doc.getCodVdes().isEmpty()) {
|
||||
key += "-" + doc.getCodVdes();
|
||||
}
|
||||
try {
|
||||
if (this.checkFornitoreRules.has(key) && ((String) ((JSONObject) this.checkFornitoreRules.get(key)).get(doc.getCodDtipProvv())).equalsIgnoreCase("check-partitaMag")) {
|
||||
if (this.checkFornitoreRules.has(key) &&
|
||||
((String) ((JSONObject) this.checkFornitoreRules.get(key))
|
||||
.get(doc.getCodDtipProvv()))
|
||||
.equalsIgnoreCase("check-partitaMag")) {
|
||||
isCheckPartitaMag = true;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
this.sendError(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.isCheckPartitaMag = isCheckPartitaMag;
|
||||
}
|
||||
|
||||
|
||||
@ -63,11 +63,11 @@ public class DialogAskInfoInventarioView extends BaseDialogFragment {
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
var cancelable = true;
|
||||
setCancelable(true);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(cancelable)
|
||||
.setCancelable(isCancelable())
|
||||
.setPositiveButton(R.string.ok, (dialog, which) -> {
|
||||
var zone = UtilityString.empty2null(this.zone.get());
|
||||
if(zone != null) zone = StringUtils.capitalize(zone);
|
||||
@ -81,7 +81,7 @@ public class DialogAskInfoInventarioView extends BaseDialogFragment {
|
||||
})
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(cancelable);
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@ -214,6 +214,7 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
||||
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
||||
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
||||
.setCanInputZeroQuantity(true)
|
||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||
.setCanLUBeClosed(canLUBeClosed)
|
||||
|
||||
@ -599,7 +599,7 @@ public class SpedizioneViewModel {
|
||||
|
||||
final List<MagazzinoAutomaticoPickOrderRequestDTO> orders = Stream.of(this.mTestateOrdini)
|
||||
.map(x -> new MagazzinoAutomaticoPickOrderRequestDTO(UtilityDate.toLocalDate(x.getDataOrdD()), x.getGestione(), x.getNumOrd())
|
||||
.setDataCons(UtilityDate.toLocalDate(x.getDataConsD())))
|
||||
.setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null))
|
||||
.toList();
|
||||
|
||||
final List<MagazzinoAutomaticoPickItemRequestDTO> magazzinoAutomaticoPickItemRequestDTOList = new ArrayList<>();
|
||||
@ -1210,8 +1210,9 @@ public class SpedizioneViewModel {
|
||||
.setOrders(orders);
|
||||
|
||||
this.mColliScaricoRESTConsumer.createUDS(createUDSRequestDTO, createdUDS -> {
|
||||
this.mCurrentMtbColt = createdUDS;
|
||||
mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(createdUDS, mTestateOrdini);
|
||||
|
||||
this.mCurrentMtbColt = createdUDS;
|
||||
this.mIsNewLU = true;
|
||||
|
||||
if (onComplete != null) onComplete.run();
|
||||
@ -1342,53 +1343,6 @@ public class SpedizioneViewModel {
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
|
||||
|
||||
// MtbColt mtbColt = new MtbColt()
|
||||
// .setNumCollo(mtbColrToUpdate.getNumCollo())
|
||||
// .setDataCollo(mtbColrToUpdate.getDataColloS())
|
||||
// .setSerCollo(mtbColrToUpdate.getSerCollo())
|
||||
// .setGestione(mtbColrToUpdate.getGestione())
|
||||
// .setMtbColr(new ObservableArrayList<>());
|
||||
// mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
//
|
||||
// final MtbColr mtbColr = (MtbColr) mtbColrToUpdate.clone();
|
||||
// mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
// mtbColr.setRiga(null)
|
||||
// .setPesoLordoKg(null)
|
||||
// .setPesoNettoKg(null)
|
||||
// .setNumCnf(numCnf.subtract(mtbColrToUpdate.getNumCnf()))
|
||||
// .setQtaCnf(qtaCnf)
|
||||
// .setQtaCol(qtaTot.subtract(mtbColrToUpdate.getQtaCol()))
|
||||
// .setPartitaMag(partitaMag)
|
||||
// .setDataScadPartita(dataScad);
|
||||
//
|
||||
// mtbColt.getMtbColr().add(mtbColr);
|
||||
//
|
||||
// this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||
//
|
||||
// mtbColr
|
||||
// .setNumCnf(numCnf)
|
||||
// .setQtaCnf(qtaCnf)
|
||||
// .setQtaCol(qtaTot);
|
||||
//
|
||||
// Optional<PickingObjectDTO> pickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
||||
// .filter(x -> Stream.of(x.getWithdrawMtbColrs())
|
||||
// .anyMatch(y -> y == mtbColrToUpdate)).findSingle();
|
||||
//
|
||||
// if (pickingObjectDTO.isPresent()) {
|
||||
// pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToUpdate);
|
||||
// pickingObjectDTO.get().getWithdrawMtbColrs().add(mtbColr);
|
||||
// }
|
||||
//
|
||||
// this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||
// this.mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
//
|
||||
// this.resetMatchedRows();
|
||||
// this.sendOnRowSaved();
|
||||
// this.sendOnLoadingEnded();
|
||||
//
|
||||
// }, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -62,15 +62,15 @@ public class DialogInfoSituazioneArticoloView extends BaseDialogRowInfoView {
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
var cancelable = true;
|
||||
setCancelable(true);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setNeutralButton(R.string.action_close, null)
|
||||
.setCancelable(cancelable)
|
||||
.setCancelable(isCancelable())
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(cancelable);
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@ -56,6 +56,8 @@ public class DialogProgressView extends DialogFragment {
|
||||
.setCancelable(false)
|
||||
.create();
|
||||
alertDialog.setCanceledOnTouchOutside(false);
|
||||
|
||||
setCancelable(false);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
|
||||
@ -68,11 +68,11 @@ public class DialogChooseArtsFromMtbAartListView extends BaseDialogFragment impl
|
||||
.inject(this);
|
||||
|
||||
|
||||
var cancelable = false;
|
||||
setCancelable(false);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(cancelable)
|
||||
.setCancelable(isCancelable())
|
||||
.setPositiveButton(R.string.ok, (dialog, which) -> {
|
||||
var selectedArts = Stream.of(this.artsItemModels)
|
||||
.filter(x -> x.getSelected().get())
|
||||
@ -96,7 +96,7 @@ public class DialogChooseArtsFromMtbAartListView extends BaseDialogFragment impl
|
||||
|
||||
|
||||
alertDialog.setOnShowListener(this);
|
||||
alertDialog.setCanceledOnTouchOutside(cancelable);
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
|
||||
@ -111,11 +111,11 @@ public class DialogChooseArtsFromMtbColrList extends BaseDialogFragment implemen
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
var cancelable = false;
|
||||
setCancelable(false);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(cancelable)
|
||||
.setCancelable(isCancelable())
|
||||
.setPositiveButton(R.string.ok, (dialog, which) -> {
|
||||
var selectedArts = Stream.of(this.mtbColrItemModels)
|
||||
.filter(x -> x.getChecked().get())
|
||||
@ -137,7 +137,7 @@ public class DialogChooseArtsFromMtbColrList extends BaseDialogFragment implemen
|
||||
|
||||
|
||||
alertDialog.setOnShowListener(this);
|
||||
alertDialog.setCanceledOnTouchOutside(cancelable);
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
|
||||
@ -82,14 +82,14 @@ public class DialogInputPesoLUView extends BaseDialogFragment {
|
||||
|
||||
this.init();
|
||||
|
||||
var cancelable = false;
|
||||
setCancelable(false);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(cancelable)
|
||||
.setCancelable(isCancelable())
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(cancelable);
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ public class DialogInputQuantityV2DTO {
|
||||
private BigDecimal totalNumCnfAvailable;
|
||||
private BigDecimal qtaCnfAvailable;
|
||||
|
||||
private boolean canInputZeroQuantity = false;
|
||||
private boolean canPartitaMagBeChanged = true;
|
||||
private boolean isDataScadMandatory = false;
|
||||
private boolean isNotesAllowed = false;
|
||||
@ -214,6 +215,15 @@ public class DialogInputQuantityV2DTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isCanInputZeroQuantity() {
|
||||
return canInputZeroQuantity;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setCanInputZeroQuantity(boolean canInputZeroQuantity) {
|
||||
this.canInputZeroQuantity = canInputZeroQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isCanPartitaMagBeChanged() {
|
||||
return canPartitaMagBeChanged;
|
||||
}
|
||||
|
||||
@ -165,6 +165,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
.setQtaCnfToBeTaken(mDialogInputQuantityV2DTO.getQtaCnfToBeTaken())
|
||||
.setTotalNumCnfAvailable(mDialogInputQuantityV2DTO.getTotalNumCnfAvailable())
|
||||
.setTotalQtaAvailable(mDialogInputQuantityV2DTO.getTotalQtaAvailable())
|
||||
.setCanInputZeroQuantity(mDialogInputQuantityV2DTO.isCanInputZeroQuantity())
|
||||
.setCanOverflowOrderQuantity(mDialogInputQuantityV2DTO.isCanOverflowOrderQuantity())
|
||||
.setQtaCnfAvailable(mDialogInputQuantityV2DTO.getQtaCnfAvailable())
|
||||
.setPartitaMag(mDialogInputQuantityV2DTO.getPartitaMag())
|
||||
|
||||
@ -72,6 +72,7 @@ public class DialogInputQuantityV2ViewModel {
|
||||
|
||||
private RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> suggestPartitaMagRunnable;
|
||||
|
||||
private boolean canInputZeroQuantity;
|
||||
private boolean canOverflowOrderQuantity;
|
||||
private boolean canPartitaMagBeChanged;
|
||||
private int onNumCnfInputChanged;
|
||||
@ -314,6 +315,11 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setCanInputZeroQuantity(boolean canInputZeroQuantity) {
|
||||
this.canInputZeroQuantity = canInputZeroQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setCanOverflowOrderQuantity(boolean canOverflowOrderQuantity) {
|
||||
this.canOverflowOrderQuantity = canOverflowOrderQuantity;
|
||||
return this;
|
||||
@ -443,8 +449,8 @@ public class DialogInputQuantityV2ViewModel {
|
||||
|
||||
this.mListener.onError(new InvalidQtaCnfQuantityException());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (mtbAart.get().isFlagTracciabilitaBoolean() && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||
if (suggestPartitaMagRunnable != null) {
|
||||
internalPartitaMag = suggestPartitaMagRunnable.run(this);
|
||||
@ -456,54 +462,54 @@ public class DialogInputQuantityV2ViewModel {
|
||||
this.mListener.onError(new InvalidBatchLotException());
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (this.shouldAskDataScad && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||
|
||||
this.mListener.onError(new InvalidBatchLotException());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (this.shouldAskDataScad && this.internalDataScad == null) {
|
||||
|
||||
this.mListener.onError(new InvalidExpireDateException());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalQtaTot, this.totalQtaOrd) &&
|
||||
this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
||||
|
||||
this.mListener.onError(new OverflowQtaTotOrderedQuantityException());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfOrd)) {
|
||||
|
||||
this.mListener.onError(new OverflowNumCnfOrderedQuantityException());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (UtilityBigDecimal.greaterThan(this.internalQtaTot, this.totalQtaAvailable)) {
|
||||
|
||||
this.mListener.onError(new OverflowQtaTotAvailableQuantityException());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfAvailable)) {
|
||||
|
||||
this.mListener.onError(new OverflowNumCnfAvailableQuantityException());
|
||||
return false;
|
||||
|
||||
}
|
||||
if (this.internalNumCnf == null || this.internalQtaCnf == null || this.internalQtaTot == null ||
|
||||
|
||||
if (!this.canInputZeroQuantity && (this.internalNumCnf == null || this.internalQtaCnf == null || this.internalQtaTot == null ||
|
||||
UtilityBigDecimal.equalsOrLowerThan(this.internalNumCnf, BigDecimal.ZERO) ||
|
||||
UtilityBigDecimal.equalsOrLowerThan(this.internalQtaCnf, BigDecimal.ZERO) ||
|
||||
UtilityBigDecimal.equalsOrLowerThan(this.internalQtaTot, BigDecimal.ZERO)) {
|
||||
UtilityBigDecimal.equalsOrLowerThan(this.internalQtaTot, BigDecimal.ZERO))) {
|
||||
|
||||
this.mListener.onError(new InvalidQuantityException());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (this.isNoteMandatory() && (this.internalNote == null || this.internalNote.length() <= 0)) {
|
||||
this.mListener.onError(new InvalidNotesException());
|
||||
return false;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
buildscript {
|
||||
ext {
|
||||
kotlin_version = '1.8.0'
|
||||
agp_version = '8.1.0-alpha09'
|
||||
agp_version = '8.1.0-alpha10'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user