Finish v1.16.26(208)

This commit is contained in:
Giuseppe Scorrano 2021-04-14 12:25:50 +02:00
commit eb94944928
3 changed files with 16 additions and 9 deletions

View File

@ -6,8 +6,8 @@ apply plugin: 'com.google.gms.google-services'
android { android {
def appVersionCode = 207 def appVersionCode = 208
def appVersionName = '1.16.25' def appVersionName = '1.16.26'
signingConfigs { signingConfigs {
release { release {

View File

@ -46,6 +46,7 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
private boolean mShouldCheckResiduo; private boolean mShouldCheckResiduo;
private boolean mShouldCheckIfExistDoc; private boolean mShouldCheckIfExistDoc;
private boolean mEnableCreation;
private final BindableBoolean basketEnabled = new BindableBoolean(); private final BindableBoolean basketEnabled = new BindableBoolean();
private final BindableBoolean creationEnabled = new BindableBoolean(); private final BindableBoolean creationEnabled = new BindableBoolean();
@ -71,6 +72,7 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
this.basketEnabled.set(enableBasket); this.basketEnabled.set(enableBasket);
this.creationEnabled.set(enableCreation); this.creationEnabled.set(enableCreation);
mEnableCreation = enableCreation;
mOnComplete = onComplete; mOnComplete = onComplete;
} }
@ -95,7 +97,7 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
getDialog().setCanceledOnTouchOutside(false); getDialog().setCanceledOnTouchOutside(false);
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
this.mViewModel.init(mShouldCheckResiduo, mShouldCheckIfExistDoc); this.mViewModel.init(mShouldCheckResiduo, mShouldCheckIfExistDoc, mEnableCreation);
mBindings.createNewLuButton.setOnClickListener(v -> { mBindings.createNewLuButton.setOnClickListener(v -> {
this.mViewModel.createNewLU(); this.mViewModel.createNewLU();

View File

@ -29,6 +29,7 @@ public class DialogScanOrCreateLUViewModel {
private boolean mShouldCheckResiduo = false; private boolean mShouldCheckResiduo = false;
private boolean mShouldCheckIfExistDoc = true; private boolean mShouldCheckIfExistDoc = true;
private boolean mEnableCreation = false;
private Listener mListener; private Listener mListener;
@ -40,9 +41,10 @@ public class DialogScanOrCreateLUViewModel {
} }
public void init(boolean checkResiduo, boolean shouldCheckIfExistDoc) { public void init(boolean checkResiduo, boolean shouldCheckIfExistDoc, boolean enableCreation) {
this.mShouldCheckResiduo = checkResiduo; this.mShouldCheckResiduo = checkResiduo;
this.mShouldCheckIfExistDoc = shouldCheckIfExistDoc; this.mShouldCheckIfExistDoc = shouldCheckIfExistDoc;
this.mEnableCreation = enableCreation;
} }
public void createNewLU() { public void createNewLU() {
@ -94,11 +96,14 @@ public class DialogScanOrCreateLUViewModel {
this.mColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), mShouldCheckResiduo, false, mtbColt -> { this.mColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), mShouldCheckResiduo, false, mtbColt -> {
if (mtbColt == null) { if (mtbColt == null) {
if(mEnableCreation) {
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(barcodeScanDTO, GestioneEnum.LAVORAZIONE, createdMtbColt -> { this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(barcodeScanDTO, GestioneEnum.LAVORAZIONE, createdMtbColt -> {
onComplete.run(); onComplete.run();
this.sendOnLUOpened(createdMtbColt, true); this.sendOnLUOpened(createdMtbColt, true);
}, this::sendError); }, this::sendError);
} else {
this.sendError(new NoLUFoundException());
}
} else { } else {
if (mtbColt.getCodDtip() != null && mShouldCheckIfExistDoc) { if (mtbColt.getCodDtip() != null && mShouldCheckIfExistDoc) {
this.sendError(new AlreadyAttachedDocumentToLUException()); this.sendError(new AlreadyAttachedDocumentToLUException());