Risolto bug della chiusura del collo in vendita tramite tasto Back
This commit is contained in:
parent
17d2e7f980
commit
10c77362b8
260
app/build.gradle
260
app/build.gradle
@ -1,153 +1,153 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://maven.fabric.io/public' }
|
maven { url 'https://maven.fabric.io/public' }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'io.fabric.tools:gradle:1.27.0'
|
classpath 'io.fabric.tools:gradle:1.27.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'com.google.firebase.firebase-perf'
|
apply plugin: 'com.google.firebase.firebase-perf'
|
||||||
apply plugin: 'io.fabric'
|
apply plugin: 'io.fabric'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 37
|
def appVersionCode = 37
|
||||||
def appVersionName = '1.0.34'
|
def appVersionName = '1.0.34'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
keyAlias 'wms key'
|
keyAlias 'wms key'
|
||||||
keyPassword 'inpmiy'
|
keyPassword 'inpmiy'
|
||||||
storeFile file('Integry.jks')
|
storeFile file('Integry.jks')
|
||||||
storePassword 'inpmiy'
|
storePassword 'inpmiy'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.all { output ->
|
variant.outputs.all { output ->
|
||||||
output.outputFileName = "android-release_v2.apk"
|
output.outputFileName = "android-release_v2.apk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
buildToolsVersion '28.0.3'
|
buildToolsVersion '28.0.3'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "it.integry.integrywmsnative"
|
applicationId "it.integry.integrywmsnative"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode appVersionCode
|
versionCode appVersionCode
|
||||||
versionName appVersionName
|
versionName appVersionName
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dataBinding {
|
dataBinding {
|
||||||
enabled = true
|
enabled = true
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
targetCompatibility 1.8
|
targetCompatibility 1.8
|
||||||
sourceCompatibility 1.8
|
sourceCompatibility 1.8
|
||||||
}
|
}
|
||||||
productFlavors {
|
productFlavors {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
build {
|
build {
|
||||||
doLast {
|
doLast {
|
||||||
delete "$projectDir/build/outputs/apk/release/version_v2.txt"
|
delete "$projectDir/build/outputs/apk/release/version_v2.txt"
|
||||||
file("$projectDir/build/outputs/apk/release/version_v2.txt").text = appVersionCode + '\n' + appVersionName
|
file("$projectDir/build/outputs/apk/release/version_v2.txt").text = appVersionCode + '\n' + appVersionName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gradle.projectsEvaluated {
|
gradle.projectsEvaluated {
|
||||||
tasks.withType(JavaCompile.class) {
|
tasks.withType(JavaCompile.class) {
|
||||||
options.compilerArgs << "-Xmaxerrs" << "10000"
|
options.compilerArgs << "-Xmaxerrs" << "10000"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamicFeatures = [":dynamic__base"]
|
dynamicFeatures = [":dynamic__base"]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
|
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
|
||||||
exclude group: 'com.android.support', module: 'support-annotations'
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
})
|
})
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
implementation 'com.orhanobut:logger:2.2.0'
|
implementation 'com.orhanobut:logger:2.2.0'
|
||||||
implementation 'com.google.firebase:firebase-core:16.0.7'
|
implementation 'com.google.firebase:firebase-core:16.0.7'
|
||||||
implementation 'com.google.firebase:firebase-crash:16.2.1'
|
implementation 'com.google.firebase:firebase-crash:16.2.1'
|
||||||
implementation 'com.google.firebase:firebase-perf:16.2.3'
|
implementation 'com.google.firebase:firebase-perf:16.2.3'
|
||||||
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
|
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
|
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.1.0-alpha03'
|
implementation 'com.google.android.material:material:1.1.0-alpha03'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha02'
|
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha02'
|
||||||
implementation 'androidx.preference:preference:1.1.0-alpha03'
|
implementation 'androidx.preference:preference:1.1.0-alpha03'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
|
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
|
||||||
implementation 'com.annimon:stream:1.2.1'
|
implementation 'com.annimon:stream:1.2.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime:2.0.0'
|
implementation 'androidx.lifecycle:lifecycle-runtime:2.0.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.0.0'
|
implementation 'androidx.lifecycle:lifecycle-common-java8:2.0.0'
|
||||||
kapt "androidx.lifecycle:lifecycle-compiler:2.0.0"
|
kapt "androidx.lifecycle:lifecycle-compiler:2.0.0"
|
||||||
implementation 'com.danielpuiu:ghostfish:2.0.0'
|
implementation 'com.danielpuiu:ghostfish:2.0.0'
|
||||||
annotationProcessor "com.danielpuiu:ghostfish-compiler:2.0.0"
|
annotationProcessor "com.danielpuiu:ghostfish-compiler:2.0.0"
|
||||||
//MVVM
|
//MVVM
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
|
||||||
annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.0.0"
|
annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.0.0"
|
||||||
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
|
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
|
||||||
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.1.1'
|
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.1.1'
|
||||||
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.1.1'
|
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.1.1'
|
||||||
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.1.1'
|
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.1.1'
|
||||||
implementation 'com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:2.1.1'
|
implementation 'com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:2.1.1'
|
||||||
implementation 'com.jakewharton:butterknife:10.0.0'
|
implementation 'com.jakewharton:butterknife:10.0.0'
|
||||||
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
|
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
|
||||||
implementation 'br.com.zbra:android-linq:1.1.0'
|
implementation 'br.com.zbra:android-linq:1.1.0'
|
||||||
//FAB
|
//FAB
|
||||||
implementation 'com.github.clans:fab:1.6.4'
|
implementation 'com.github.clans:fab:1.6.4'
|
||||||
//CUSTOM VIEWS
|
//CUSTOM VIEWS
|
||||||
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
|
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
|
||||||
implementation 'de.hdodenhof:circleimageview:2.2.0'
|
implementation 'de.hdodenhof:circleimageview:2.2.0'
|
||||||
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
|
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
|
||||||
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
||||||
implementation 'com.github.andrefrsousa:SuperBottomSheet:1.2.1@aar'
|
implementation 'com.github.andrefrsousa:SuperBottomSheet:1.2.1@aar'
|
||||||
implementation 'com.fede987:status-bar-alert:1.0.1'
|
implementation 'com.fede987:status-bar-alert:1.0.1'
|
||||||
implementation 'com.fxn769:stash:1.2'
|
implementation 'com.fxn769:stash:1.2'
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
implementation project(':waterfall_toolbar')
|
implementation project(':waterfall_toolbar')
|
||||||
implementation 'com.mikhaellopez:lazydatepicker:1.0.0'
|
implementation 'com.mikhaellopez:lazydatepicker:1.0.0'
|
||||||
implementation 'com.github.demoNo:AutoScrollViewPager:v1.0.2'
|
implementation 'com.github.demoNo:AutoScrollViewPager:v1.0.2'
|
||||||
//AppUpdate
|
//AppUpdate
|
||||||
implementation 'com.github.javiersantos:AppUpdater:2.7'
|
implementation 'com.github.javiersantos:AppUpdater:2.7'
|
||||||
//Barcode
|
//Barcode
|
||||||
implementation project(':pointmobilescannerlibrary')
|
implementation project(':pointmobilescannerlibrary')
|
||||||
implementation project(path: ':barcode_base_library')
|
implementation project(path: ':barcode_base_library')
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://maven.fabric.io/public' }
|
maven { url 'https://maven.fabric.io/public' }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,9 @@ import androidx.databinding.ObservableArrayList;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -471,7 +474,7 @@ public class MtbColt extends EntityBase implements Parcelable {
|
|||||||
return posizione;
|
return posizione;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt setPosizione(String posizione) {
|
public MtbColt setPosizione(@Nullable String posizione) {
|
||||||
this.posizione = posizione;
|
this.posizione = posizione;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,9 @@ import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|||||||
public class UtilityFirebase {
|
public class UtilityFirebase {
|
||||||
|
|
||||||
public static Trace getNewPerformanceTrace(String traceName) {
|
public static Trace getNewPerformanceTrace(String traceName) {
|
||||||
String username = SettingsManager.i().user.fullname ;
|
String username = SettingsManager.i().user != null && !UtilityString.isNullOrEmpty(SettingsManager.i().user.fullname) ?
|
||||||
|
SettingsManager.i().user.fullname :
|
||||||
|
"N / A";
|
||||||
|
|
||||||
Trace newTrace = FirebasePerformance.getInstance().newTrace(traceName);
|
Trace newTrace = FirebasePerformance.getInstance().newTrace(traceName);
|
||||||
|
|
||||||
|
|||||||
@ -528,18 +528,20 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onColloClosed() {
|
public void onColloClosed(Runnable onComplete) {
|
||||||
if(thereIsAnOpenedUL()) {
|
if(thereIsAnOpenedUL()) {
|
||||||
|
|
||||||
final ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
final ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||||
progress.show();
|
progress.show();
|
||||||
|
|
||||||
if(thereIsAnyRowInUL()) {
|
if(thereIsAnyRowInUL()) {
|
||||||
updateDataFine(progress, () -> printCollo(progress));
|
updateDataFine(progress, () -> printCollo(progress, onComplete));
|
||||||
} else {
|
} else {
|
||||||
deleteCollo(progress);
|
deleteCollo(progress, onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -565,11 +567,11 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printCollo(ProgressDialog progress) {
|
private void printCollo(ProgressDialog progress, Runnable onComplete) {
|
||||||
MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||||
|
|
||||||
if(currentMtbColt.getDisablePrint() != null && currentMtbColt.getDisablePrint()){
|
if(currentMtbColt.getDisablePrint() != null && currentMtbColt.getDisablePrint()){
|
||||||
postCloseOperations();
|
postCloseOperations(onComplete);
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -589,7 +591,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
|||||||
currentMtbColt,
|
currentMtbColt,
|
||||||
1, reportName, () -> {
|
1, reportName, () -> {
|
||||||
|
|
||||||
postCloseOperations();
|
postCloseOperations(onComplete);
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
|
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
@ -602,7 +604,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
R.string.button_ignore_print,
|
R.string.button_ignore_print,
|
||||||
() -> postCloseOperations()).show();
|
() -> postCloseOperations(onComplete)).show();
|
||||||
});
|
});
|
||||||
|
|
||||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
||||||
@ -629,7 +631,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void deleteCollo(ProgressDialog progress) {
|
private void deleteCollo(ProgressDialog progress, Runnable onComplete) {
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.deleteCollo(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
|
ColliMagazzinoRESTConsumer.deleteCollo(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
|
||||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||||
@ -637,8 +639,8 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
|||||||
isFabVisible.set(true);
|
isFabVisible.set(true);
|
||||||
|
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
if(onComplete != null) onComplete.run();
|
||||||
);
|
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -653,7 +655,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void postCloseOperations() {
|
private void postCloseOperations(Runnable onComplete) {
|
||||||
|
|
||||||
MtbColt mtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
MtbColt mtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||||
|
|
||||||
@ -682,6 +684,8 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
|||||||
removeListFilter();
|
removeListFilter();
|
||||||
refreshOrderBy(true);
|
refreshOrderBy(true);
|
||||||
|
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import java.math.BigDecimal;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.MainActivity;
|
import it.integry.integrywmsnative.MainActivity;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
@ -469,8 +470,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
|
|
||||||
private void posizionaCollo(Runnable onComplete, Runnable onAbort, 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() != null) {
|
||||||
mtbColt.get().setPosizione(mtbDepoPosizione.getPosizione());
|
Objects.requireNonNull(mtbColt.get()).setPosizione(mtbDepoPosizione.getPosizione());
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
} else {
|
} else {
|
||||||
onAbort.run();
|
onAbort.run();
|
||||||
|
|||||||
@ -118,7 +118,7 @@ public class MainVenditaFragment extends Fragment implements ITitledFragment, IS
|
|||||||
|
|
||||||
ButterKnife.bind(this, mBinding.getRoot());
|
ButterKnife.bind(this, mBinding.getRoot());
|
||||||
|
|
||||||
mWaterfallToolbar.setRecyclerView(mBinding.venditaMainList);
|
if(mWaterfallToolbar != null) mWaterfallToolbar.setRecyclerView(mBinding.venditaMainList);
|
||||||
|
|
||||||
return mBinding.getRoot();
|
return mBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,10 +72,11 @@ public class VenditaOrdineInevasoActivity extends AppCompatActivity {
|
|||||||
if(mArticoliInColloBottomSheetViewModel.isExpanded()){
|
if(mArticoliInColloBottomSheetViewModel.isExpanded()){
|
||||||
mArticoliInColloBottomSheetViewModel.collapse();
|
mArticoliInColloBottomSheetViewModel.collapse();
|
||||||
} else if(mVenditaOrdineInevasoViewModel.thereIsAnOpenedUL()) {
|
} else if(mVenditaOrdineInevasoViewModel.thereIsAnOpenedUL()) {
|
||||||
mArticoliInColloBottomSheetViewModel.closeCurrentUL();
|
mArticoliInColloBottomSheetViewModel.closeCurrentUL(() -> {
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
super.onBackPressed();
|
||||||
|
});
|
||||||
|
|
||||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
|
||||||
super.onBackPressed();
|
|
||||||
} else {
|
} else {
|
||||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
|
|||||||
@ -800,21 +800,21 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onColloClosed() {
|
public void onColloClosed(Runnable onComplete) {
|
||||||
if(thereIsAnOpenedUL()) {
|
if(thereIsAnOpenedUL()) {
|
||||||
final ProgressDialog progress = ProgressDialog.show(mActivity, mActivity.getText(R.string.waiting),
|
|
||||||
mActivity.getText(R.string.loading) + " ...", true);
|
|
||||||
|
|
||||||
|
final ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||||
progress.show();
|
progress.show();
|
||||||
|
|
||||||
if(thereIsAnyRowInUL()) {
|
if(thereIsAnyRowInUL()) {
|
||||||
updateDataFine(progress, () -> distribuisciCollo(progress, (generatedMtbColts) -> printCollo(progress, generatedMtbColts)));
|
updateDataFine(progress, () -> distribuisciCollo(progress, (generatedMtbColts) -> printCollo(progress, generatedMtbColts, onComplete)));
|
||||||
} else {
|
} else {
|
||||||
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
||||||
deleteCollo(progress);
|
deleteCollo(progress, onComplete);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -853,7 +853,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printCollo(ProgressDialog progress, List<MtbColt> mtbColtsToPrint) {
|
private void printCollo(ProgressDialog progress, List<MtbColt> mtbColtsToPrint, Runnable onComplete) {
|
||||||
DialogAskShouldPrint.make(mActivity, "Packing List", shouldPrint -> {
|
DialogAskShouldPrint.make(mActivity, "Packing List", shouldPrint -> {
|
||||||
|
|
||||||
if(shouldPrint) {
|
if(shouldPrint) {
|
||||||
@ -864,7 +864,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
if (value.size() > 0) {
|
if (value.size() > 0) {
|
||||||
try {
|
try {
|
||||||
cyclicPrint(mtbColtsToPrint.iterator(), value.get(0), () -> {
|
cyclicPrint(mtbColtsToPrint.iterator(), value.get(0), () -> {
|
||||||
postCloseOperations(mtbColtsToPrint);
|
postCloseOperations(mtbColtsToPrint, onComplete);
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
@ -875,17 +875,17 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
R.string.button_ignore_print,
|
R.string.button_ignore_print,
|
||||||
() -> postCloseOperations(mtbColtsToPrint)).show();
|
() -> postCloseOperations(mtbColtsToPrint, onComplete)).show();
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||||
postCloseOperations(mtbColtsToPrint);
|
postCloseOperations(mtbColtsToPrint, onComplete);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
String errorMessage = "Nessuna stampante configurata";
|
String errorMessage = "Nessuna stampante configurata";
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mActivity, new SpannableString(errorMessage), null, () -> postCloseOperations(mtbColtsToPrint)).show();
|
DialogSimpleMessageHelper.makeWarningDialog(mActivity, new SpannableString(errorMessage), null, () -> postCloseOperations(mtbColtsToPrint, onComplete)).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -895,7 +895,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
postCloseOperations(mtbColtsToPrint);
|
postCloseOperations(mtbColtsToPrint, onComplete);
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
@ -925,7 +925,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void deleteCollo(ProgressDialog progress) {
|
private void deleteCollo(ProgressDialog progress, Runnable onComplete) {
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.deleteCollo(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
|
ColliMagazzinoRESTConsumer.deleteCollo(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
|
||||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||||
@ -933,6 +933,9 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
isFabVisible.set(true);
|
isFabVisible.set(true);
|
||||||
|
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
|
|
||||||
|
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -948,7 +951,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void postCloseOperations(List<MtbColt> generatedMtbColt) {
|
private void postCloseOperations(List<MtbColt> generatedMtbColt, Runnable onComplete) {
|
||||||
|
|
||||||
MtbColt mtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
MtbColt mtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||||
|
|
||||||
@ -983,6 +986,8 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
|
|
||||||
removeListFilter();
|
removeListFilter();
|
||||||
refreshOrderBy(true);
|
refreshOrderBy(true);
|
||||||
|
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,6 @@ package it.integry.integrywmsnative.view.bottomsheet.interfaces;
|
|||||||
|
|
||||||
public interface IOnColloClosedCallback {
|
public interface IOnColloClosedCallback {
|
||||||
|
|
||||||
void onColloClosed();
|
void onColloClosed(Runnable onComplete);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,7 +121,11 @@ public class ArticoliInColloBottomSheetViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public void closeCurrentUL(){
|
public void closeCurrentUL(){
|
||||||
if(onCloseColloCallback != null) onCloseColloCallback.onColloClosed();
|
closeCurrentUL(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void closeCurrentUL(Runnable onComplete){
|
||||||
|
if(onCloseColloCallback != null) onCloseColloCallback.onColloClosed(onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExpanded() {
|
public boolean isExpanded() {
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import device.common.DecodeResult;
|
import device.common.DecodeResult;
|
||||||
import device.common.ScanConst;
|
import device.common.ScanConst;
|
||||||
import device.sdk.ScanManager;
|
import device.sdk.ScanManager;
|
||||||
@ -91,9 +93,15 @@ public class PointMobileBarcodeReader implements BarcodeReaderInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(mDecodeResult != null) {
|
if(mDecodeResult != null) {
|
||||||
|
String stringValue = null;
|
||||||
|
|
||||||
|
if(mDecodeResult.decodeValue != null && mDecodeResult.decodeValue.length > 0) {
|
||||||
|
stringValue = new String(mDecodeResult.decodeValue, StandardCharsets.UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
BarcodeScanDTO barcodeScanDTO = new BarcodeScanDTO()
|
BarcodeScanDTO barcodeScanDTO = new BarcodeScanDTO()
|
||||||
.setByteValue(mDecodeResult.decodeValue)
|
.setByteValue(mDecodeResult.decodeValue)
|
||||||
.setStringValue(mDecodeResult.toString().replaceAll("\n", "").replaceAll("\r", "").trim())
|
.setStringValue(stringValue)
|
||||||
.setType(BarcodeType.fromInt(mDecodeResult.symType))
|
.setType(BarcodeType.fromInt(mDecodeResult.symType))
|
||||||
.setName(mDecodeResult.symName)
|
.setName(mDecodeResult.symName)
|
||||||
.setDecodingTime(mDecodeResult.decodeTimeMillisecond);
|
.setDecodingTime(mDecodeResult.decodeTimeMillisecond);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user