Compare commits
36 Commits
v1.21.1(25
...
v1.23.3(25
| Author | SHA1 | Date | |
|---|---|---|---|
| ddc038add4 | |||
| f037617dd9 | |||
| 84cff70567 | |||
| 8a1b3a1b00 | |||
| f11a81ef05 | |||
| eb8595e247 | |||
| 85520b937f | |||
| ec5bee558c | |||
| 857295d92b | |||
| 4da2c43251 | |||
| fc1681d111 | |||
| 692a350128 | |||
| 47f29899a2 | |||
| a0dfd20110 | |||
| 92aadad5cb | |||
| 52092e7e9c | |||
| ecfb8faf01 | |||
| e5dd4b15f4 | |||
| 6e070285e3 | |||
| d13cdf63c2 | |||
| c3884774e1 | |||
| 983b70821a | |||
| 8e60aa0249 | |||
| 69962781aa | |||
| a921b83c1f | |||
| ea8be0559a | |||
| 66f117186c | |||
| 4ff39009d2 | |||
| 981a42cd7e | |||
| 062938d0e4 | |||
| cc7044c7de | |||
| 7d771bf39b | |||
| 3261aa7c41 | |||
| d79c13b370 | |||
| 55c1cb40a2 | |||
| e3ebfcb27d |
1
.idea/.gitignore
generated
vendored
Normal file
1
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/saveactions_settings.xml
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'com.google.firebase.firebase-perf'
|
|
||||||
|
if (!project.hasProperty("disable-performance-plugin")) {
|
||||||
|
apply plugin: 'com.google.firebase.firebase-perf'
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 253
|
def appVersionCode = 258
|
||||||
def appVersionName = '1.21.1'
|
def appVersionName = '1.23.3'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -27,12 +31,12 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileSdkVersion 30
|
compileSdkVersion 31
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "it.integry.integrywmsnative"
|
applicationId "it.integry.integrywmsnative"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 31
|
||||||
versionCode appVersionCode
|
versionCode appVersionCode
|
||||||
versionName appVersionName
|
versionName appVersionName
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@@ -94,37 +98,37 @@ dependencies {
|
|||||||
//Firebase
|
//Firebase
|
||||||
|
|
||||||
// Import the Firebase BoM
|
// Import the Firebase BoM
|
||||||
implementation platform('com.google.firebase:firebase-bom:26.3.0')
|
implementation platform('com.google.firebase:firebase-bom:29.1.0')
|
||||||
implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.google.firebase:firebase-analytics'
|
||||||
implementation 'com.google.firebase:firebase-core'
|
implementation 'com.google.firebase:firebase-core'
|
||||||
implementation 'com.google.firebase:firebase-crash'
|
|
||||||
implementation 'com.google.firebase:firebase-crashlytics'
|
implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
implementation 'com.google.firebase:firebase-perf'
|
implementation 'com.google.firebase:firebase-perf'
|
||||||
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
implementation 'com.google.android.gms:play-services-basement:18.0.0'
|
||||||
|
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
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.4.0'
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.annimon:stream:1.2.2'
|
implementation 'com.annimon:stream:1.2.2'
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
|
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.1'
|
||||||
implementation 'org.apache.commons:commons-text:1.9'
|
implementation 'org.apache.commons:commons-text:1.9'
|
||||||
|
|
||||||
//MVVM
|
//MVVM
|
||||||
def dagger2_version = '2.35.1'
|
def dagger2_version = '2.40'
|
||||||
api "com.google.dagger:dagger:$dagger2_version"
|
api "com.google.dagger:dagger:$dagger2_version"
|
||||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||||
api "com.google.dagger:dagger-android-support:$dagger2_version" // if you use the support libraries
|
api "com.google.dagger:dagger-android-support:$dagger2_version"
|
||||||
|
// if you use the support libraries
|
||||||
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
|
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
|
||||||
|
|
||||||
//FAB
|
//FAB
|
||||||
@@ -134,13 +138,12 @@ dependencies {
|
|||||||
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
|
implementation 'com.github.cachapa: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.fede87:StatusBarAlert:1.0.1'
|
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
|
||||||
implementation 'com.github.akshay2211:Stash:master'
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
|
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
|
||||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||||
|
|
||||||
//SQLite ROOM
|
//SQLite ROOM
|
||||||
def room_version = "2.3.0"
|
def room_version = "2.4.1"
|
||||||
|
|
||||||
implementation "androidx.room:room-runtime:$room_version"
|
implementation "androidx.room:room-runtime:$room_version"
|
||||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||||
@@ -159,7 +162,6 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
||||||
implementation 'org.reflections:reflections:0.10.2'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -40,7 +40,8 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".gest.main.MainActivity"
|
android:name=".gest.main.MainActivity"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing">
|
android:windowSoftInputMode="adjustNothing"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
||||||
|
|
||||||
@@ -73,7 +74,8 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".SplashActivity"
|
android:name=".SplashActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/SplashTheme">
|
android:theme="@style/SplashTheme"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleCompon
|
|||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliModule;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliModule;
|
||||||
|
import it.integry.integrywmsnative.gest.login.LoginComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.login.LoginModule;
|
||||||
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
||||||
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
||||||
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
||||||
@@ -61,6 +63,7 @@ import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.Dial
|
|||||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialogComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
||||||
@@ -76,6 +79,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
RoomModule.class,
|
RoomModule.class,
|
||||||
SplashActivityModule.class,
|
SplashActivityModule.class,
|
||||||
MainApplicationModule.class,
|
MainApplicationModule.class,
|
||||||
|
LoginModule.class,
|
||||||
MainActivityModule.class,
|
MainActivityModule.class,
|
||||||
MainFragmentModule.class,
|
MainFragmentModule.class,
|
||||||
MainAccettazioneModule.class,
|
MainAccettazioneModule.class,
|
||||||
@@ -111,41 +115,79 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
public interface MainApplicationComponent {
|
public interface MainApplicationComponent {
|
||||||
|
|
||||||
SplashActivityComponent.Factory splashActivityComponent();
|
SplashActivityComponent.Factory splashActivityComponent();
|
||||||
|
|
||||||
|
LoginComponent.Factory loginActivityComponent();
|
||||||
|
|
||||||
MainActivityComponent.Factory mainActivityComponent();
|
MainActivityComponent.Factory mainActivityComponent();
|
||||||
|
|
||||||
MainFragmentComponent.Factory mainFragmentComponent();
|
MainFragmentComponent.Factory mainFragmentComponent();
|
||||||
|
|
||||||
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
||||||
|
|
||||||
ListaBancaliComponent.Factory listaBancaliComponent();
|
ListaBancaliComponent.Factory listaBancaliComponent();
|
||||||
|
|
||||||
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
||||||
|
|
||||||
PVOrdiniAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
PVOrdiniAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
||||||
|
|
||||||
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
||||||
|
|
||||||
PickingLiberoComponent.Factory pickingLiberoComponent();
|
PickingLiberoComponent.Factory pickingLiberoComponent();
|
||||||
|
|
||||||
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
||||||
|
|
||||||
SpedizioneComponent.Factory spedizioneComponent();
|
SpedizioneComponent.Factory spedizioneComponent();
|
||||||
|
|
||||||
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
||||||
|
|
||||||
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
||||||
|
|
||||||
UltimiArriviFornitoreComponent.Factory ultimiArriviFornitoreComponent();
|
UltimiArriviFornitoreComponent.Factory ultimiArriviFornitoreComponent();
|
||||||
|
|
||||||
PickingResiComponent.Factory pickingResiComponent();
|
PickingResiComponent.Factory pickingResiComponent();
|
||||||
|
|
||||||
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
||||||
|
|
||||||
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||||
|
|
||||||
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
||||||
|
|
||||||
DialogScanArtComponent.Factory dialogScanArtComponent();
|
DialogScanArtComponent.Factory dialogScanArtComponent();
|
||||||
|
|
||||||
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
||||||
|
|
||||||
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
||||||
|
|
||||||
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
||||||
|
|
||||||
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
||||||
|
|
||||||
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
||||||
|
|
||||||
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
||||||
|
|
||||||
ProdRientroMerceComponent.Factory prodRientroMerceComponent();
|
ProdRientroMerceComponent.Factory prodRientroMerceComponent();
|
||||||
|
|
||||||
ProdRientroMerceOrderDetailComponent.Factory prodRientroMerceOrderDetailComponent();
|
ProdRientroMerceOrderDetailComponent.Factory prodRientroMerceOrderDetailComponent();
|
||||||
|
|
||||||
ProdOrdineProduzioneElencoComponent.Factory prodOrdineProduzioneElencoComponent();
|
ProdOrdineProduzioneElencoComponent.Factory prodOrdineProduzioneElencoComponent();
|
||||||
|
|
||||||
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
||||||
|
|
||||||
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
||||||
|
|
||||||
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
||||||
|
|
||||||
DocInterniComponent.Factory docInterniComponent();
|
DocInterniComponent.Factory docInterniComponent();
|
||||||
|
|
||||||
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
||||||
|
|
||||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||||
|
|
||||||
|
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||||
|
|
||||||
void inject(MainApplication mainApplication);
|
void inject(MainApplication mainApplication);
|
||||||
|
|
||||||
void inject(AppContext mainApplication);
|
void inject(AppContext mainApplication);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,12 +19,14 @@ import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||||
|
|
||||||
@@ -165,5 +167,16 @@ public class MainApplicationModule {
|
|||||||
return new DocInterniRESTConsumer();
|
return new DocInterniRESTConsumer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
|
return new GiacenzaRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
InventarioService provideInventarioService(GiacenzaRESTConsumer giacenzaRESTConsumer) {
|
||||||
|
return new InventarioService(giacenzaRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative;
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@@ -38,6 +39,12 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
|||||||
|
|
||||||
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
||||||
|
|
||||||
|
public static void startActivity(Context context) {
|
||||||
|
Intent intent = new Intent(context, SplashActivity.class);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|||||||
@@ -551,6 +551,12 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@BindingAdapter("visibility")
|
||||||
|
public static void bindViewVisibility(View view, boolean bool) {
|
||||||
|
view.setVisibility(bool ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@BindingAdapter({"reverse_visibility"})
|
@BindingAdapter({"reverse_visibility"})
|
||||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class MtbColr extends EntityBase {
|
|||||||
public MtbColr() {
|
public MtbColr() {
|
||||||
type = "mtb_colr";
|
type = "mtb_colr";
|
||||||
|
|
||||||
if(SettingsManager.i().isUserLoggedIn()) {
|
if (SettingsManager.i().isUserLoggedIn()) {
|
||||||
setUtente(SettingsManager.i().getUser().getFullname());
|
setUtente(SettingsManager.i().getUser().getFullname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MtbColr setGestione(GestioneEnum gestione) {
|
public MtbColr setGestione(GestioneEnum gestione) {
|
||||||
this.gestione = gestione.getText();
|
this.gestione = gestione.getText();
|
||||||
return this;
|
return this;
|
||||||
@@ -124,6 +123,11 @@ public class MtbColr extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataCollo(Date dataCollo) {
|
||||||
|
setDataCollo(UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Integer getRiga() {
|
public Integer getRiga() {
|
||||||
return riga;
|
return riga;
|
||||||
@@ -301,8 +305,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getDatetimeRowS() {
|
public String getDatetimeRowS() {
|
||||||
return datetimeRow;
|
return datetimeRow;
|
||||||
}
|
}
|
||||||
@@ -322,11 +324,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getCodJcom() {
|
public String getCodJcom() {
|
||||||
return codJcom;
|
return codJcom;
|
||||||
}
|
}
|
||||||
@@ -364,11 +361,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getDataScadPartitaS() {
|
public String getDataScadPartitaS() {
|
||||||
return dataScadPartita;
|
return dataScadPartita;
|
||||||
}
|
}
|
||||||
@@ -398,7 +390,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getUntMis() {
|
public String getUntMis() {
|
||||||
return untMis;
|
return untMis;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ public class MtbColt extends EntityBase {
|
|||||||
private String codJcom;
|
private String codJcom;
|
||||||
|
|
||||||
private List<MtbCols> mtbCols;
|
private List<MtbCols> mtbCols;
|
||||||
|
private MtbTCol mtbTCol;
|
||||||
|
|
||||||
private Boolean disablePrint;
|
private Boolean disablePrint;
|
||||||
private String ragSocCliente;
|
private String ragSocCliente;
|
||||||
@@ -83,7 +84,6 @@ public class MtbColt extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
||||||
|
|
||||||
public ObservableArrayList<MtbColr> getMtbColr() {
|
public ObservableArrayList<MtbColr> getMtbColr() {
|
||||||
@@ -95,12 +95,12 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt(){
|
public MtbColt() {
|
||||||
type = "mtb_colt";
|
type = "mtb_colt";
|
||||||
setDataCollo(UtilityDate.getDateInstance());
|
setDataCollo(UtilityDate.getDateInstance());
|
||||||
setSerCollo("/");
|
setSerCollo("/");
|
||||||
|
|
||||||
if(SettingsManager.i().isUserLoggedIn()) {
|
if (SettingsManager.i().isUserLoggedIn()) {
|
||||||
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,11 +137,11 @@ public class MtbColt extends EntityBase {
|
|||||||
Date dataColloD = null;
|
Date dataColloD = null;
|
||||||
try {
|
try {
|
||||||
dataColloD = getDataColloD();
|
dataColloD = getDataColloD();
|
||||||
} catch (Exception ex){
|
} catch (Exception ex) {
|
||||||
UtilityLogger.errorMe(ex);
|
UtilityLogger.errorMe(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dataColloD != null){
|
if (dataColloD != null) {
|
||||||
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN_LONG);
|
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN_LONG);
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ public class MtbColt extends EntityBase {
|
|||||||
public String getTimeVers() {
|
public String getTimeVers() {
|
||||||
Date dataColloD = getDataVersD();
|
Date dataColloD = getDataVersD();
|
||||||
|
|
||||||
if(dataColloD != null){
|
if (dataColloD != null) {
|
||||||
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.TIME);
|
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.TIME);
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
@@ -526,6 +526,15 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbTCol getMtbTCol() {
|
||||||
|
return mtbTCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setMtbTCol(MtbTCol mtbTCol) {
|
||||||
|
this.mtbTCol = mtbTCol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||||
|
|
||||||
String xmlPrefix = "{\"whereCond\": \"";
|
String xmlPrefix = "{\"whereCond\": \"";
|
||||||
@@ -533,9 +542,9 @@ public class MtbColt extends EntityBase {
|
|||||||
|
|
||||||
StringBuilder whereCond = new StringBuilder();
|
StringBuilder whereCond = new StringBuilder();
|
||||||
|
|
||||||
if(filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
||||||
|
|
||||||
for(int i = 0; i < filtroOrdineDtos.size(); i++){
|
for (int i = 0; i < filtroOrdineDtos.size(); i++) {
|
||||||
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -545,13 +554,13 @@ public class MtbColt extends EntityBase {
|
|||||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
||||||
UtilityDB.valueToString(x.getNumOrd())));
|
UtilityDB.valueToString(x.getNumOrd())));
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(x.getDataConsS())) {
|
if (!UtilityString.isNullOrEmpty(x.getDataConsS())) {
|
||||||
whereCond.append(String.format(" AND dr.dc = %s",
|
whereCond.append(String.format(" AND dr.dc = %s",
|
||||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
||||||
}
|
}
|
||||||
|
|
||||||
whereCond.append(")");
|
whereCond.append(")");
|
||||||
if(i < filtroOrdineDtos.size()-1) {
|
if (i < filtroOrdineDtos.size() - 1) {
|
||||||
whereCond.append(" OR ");
|
whereCond.append(" OR ");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -0,0 +1,273 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ValerioC on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MvwSitArtUdcDetInventario {
|
||||||
|
|
||||||
|
private String gestione;
|
||||||
|
private Date dataCollo;
|
||||||
|
private String serCollo;
|
||||||
|
private Integer numCollo;
|
||||||
|
private Integer segno;
|
||||||
|
private String codMdep;
|
||||||
|
private String posizione;
|
||||||
|
private Integer priorita;
|
||||||
|
private String codGruppo;
|
||||||
|
private String gruppo;
|
||||||
|
private String codSgruppo;
|
||||||
|
private String sottogruppo;
|
||||||
|
private String codMart;
|
||||||
|
private String diacod;
|
||||||
|
private String descrizioneEstesa;
|
||||||
|
private String partitaMag;
|
||||||
|
private String codJcom;
|
||||||
|
private String commessa;
|
||||||
|
private String untMis;
|
||||||
|
private BigDecimal qtaCol;
|
||||||
|
private BigDecimal numCnf;
|
||||||
|
private BigDecimal qtaCnf;
|
||||||
|
private BigDecimal pesoNettoKg;
|
||||||
|
private BigDecimal pesoLordoKg;
|
||||||
|
private String codJfas;
|
||||||
|
private MtbAart mtbAart;
|
||||||
|
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataCollo() {
|
||||||
|
return dataCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setDataCollo(Date dataCollo) {
|
||||||
|
this.dataCollo = dataCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerCollo() {
|
||||||
|
return serCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setSerCollo(String serCollo) {
|
||||||
|
this.serCollo = serCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumCollo() {
|
||||||
|
return numCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setNumCollo(Integer numCollo) {
|
||||||
|
this.numCollo = numCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSegno() {
|
||||||
|
return segno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setSegno(Integer segno) {
|
||||||
|
this.segno = segno;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPriorita() {
|
||||||
|
return priorita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPriorita(Integer priorita) {
|
||||||
|
this.priorita = priorita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodGruppo() {
|
||||||
|
return codGruppo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodGruppo(String codGruppo) {
|
||||||
|
this.codGruppo = codGruppo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGruppo() {
|
||||||
|
return gruppo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setGruppo(String gruppo) {
|
||||||
|
this.gruppo = gruppo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodSgruppo() {
|
||||||
|
return codSgruppo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodSgruppo(String codSgruppo) {
|
||||||
|
this.codSgruppo = codSgruppo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSottogruppo() {
|
||||||
|
return sottogruppo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setSottogruppo(String sottogruppo) {
|
||||||
|
this.sottogruppo = sottogruppo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDiacod() {
|
||||||
|
return diacod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setDiacod(String diacod) {
|
||||||
|
this.diacod = diacod;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneEstesa() {
|
||||||
|
return descrizioneEstesa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setDescrizioneEstesa(String descrizioneEstesa) {
|
||||||
|
this.descrizioneEstesa = descrizioneEstesa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJcom() {
|
||||||
|
return codJcom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodJcom(String codJcom) {
|
||||||
|
this.codJcom = codJcom;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommessa() {
|
||||||
|
return commessa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCommessa(String commessa) {
|
||||||
|
this.commessa = commessa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUntMis() {
|
||||||
|
return untMis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setUntMis(String untMis) {
|
||||||
|
this.untMis = untMis;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCol() {
|
||||||
|
return qtaCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setQtaCol(BigDecimal qtaCol) {
|
||||||
|
this.qtaCol = qtaCol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumCnf() {
|
||||||
|
return numCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setNumCnf(BigDecimal numCnf) {
|
||||||
|
this.numCnf = numCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPesoNettoKg() {
|
||||||
|
return pesoNettoKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPesoNettoKg(BigDecimal pesoNettoKg) {
|
||||||
|
this.pesoNettoKg = pesoNettoKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPesoLordoKg() {
|
||||||
|
return pesoLordoKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPesoLordoKg(BigDecimal pesoLordoKg) {
|
||||||
|
this.pesoLordoKg = pesoLordoKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart getMtbAart() {
|
||||||
|
return mtbAart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setMtbAart(MtbAart mtbAart) {
|
||||||
|
this.mtbAart = mtbAart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -83,7 +83,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||||
if(response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
if (response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
||||||
onComplete.run(response.body().getEntityList().get(0));
|
onComplete.run(response.body().getEntityList().get(0));
|
||||||
} else onComplete.run(null);
|
} else onComplete.run(null);
|
||||||
|
|
||||||
@@ -107,9 +107,10 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
})
|
})
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
var whereCond = " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
var whereCond = whereCondMap.isEmpty() ? "" : " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {
|
||||||
|
}.getType();
|
||||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
@@ -32,6 +33,7 @@ import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@@ -153,7 +155,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
mtbColrClone
|
mtbColrClone
|
||||||
.setNumCollo(null)
|
.setNumCollo(null)
|
||||||
.setDataCollo(null)
|
.setDataCollo((String) null)
|
||||||
.setRiga(null)
|
.setRiga(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||||
|
|
||||||
@@ -207,7 +209,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
MtbColr mtbColrClone = new MtbColr();
|
MtbColr mtbColrClone = new MtbColr();
|
||||||
mtbColrClone
|
mtbColrClone
|
||||||
.setNumCollo(null)
|
.setNumCollo(null)
|
||||||
.setDataCollo(null)
|
.setDataCollo((String) null)
|
||||||
.setRiga(null)
|
.setRiga(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||||
.setDataColloRif(sourceMtbColt.getDataColloD())
|
.setDataColloRif(sourceMtbColt.getDataColloD())
|
||||||
@@ -237,7 +239,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
saveCollo(newMtbColt, onComplete, onFailed);
|
saveCollo(newMtbColt, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
@@ -397,7 +398,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
private void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
if (sourceMtbColts.hasNext()) {
|
if (sourceMtbColts.hasNext()) {
|
||||||
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
||||||
@@ -447,7 +447,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
String codMdep = posizione.getCodMdep();
|
String codMdep = posizione.getCodMdep();
|
||||||
@@ -543,7 +542,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
||||||
@@ -620,7 +618,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
|
||||||
@@ -646,4 +643,57 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void versamentoAutomaticoUL(MtbColt sourceMtbColt, RunnableArgs<VersamentoAutomaticoULResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
|
||||||
|
for (int i = 0; i < sourceMtbColtClone.getMtbColr().size(); i++) {
|
||||||
|
sourceMtbColtClone.getMtbColr().get(i)
|
||||||
|
.setMtbAart(null)
|
||||||
|
.setMtbPartitaMag(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Response<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> response) {
|
||||||
|
analyzeAnswer(response, "versamentoAutomaticoUL", data -> {
|
||||||
|
var result = response.body().getDto();
|
||||||
|
|
||||||
|
List<MtbColr> allMtbColr = new ArrayList<>();
|
||||||
|
allMtbColr.addAll(result.getSuccess());
|
||||||
|
allMtbColr.addAll(result.getFailed());
|
||||||
|
|
||||||
|
List<String> codMarts = Stream.of(allMtbColr)
|
||||||
|
.map(x -> x.getCodMart().trim())
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||||
|
for (var mtbColr : allMtbColr) {
|
||||||
|
|
||||||
|
MtbAart foundMtbAart = null;
|
||||||
|
|
||||||
|
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (mtbAartOpt.isPresent()) {
|
||||||
|
foundMtbAart = mtbAartOpt.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
mtbColr.setMtbAart(foundMtbAart);
|
||||||
|
}
|
||||||
|
|
||||||
|
onComplete.run(result);
|
||||||
|
}, onFailed);
|
||||||
|
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -42,4 +43,7 @@ public interface ColliMagazzinoRESTConsumerService {
|
|||||||
@POST("wms/assegnaLottoSuColloScarico")
|
@POST("wms/assegnaLottoSuColloScarico")
|
||||||
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||||
|
|
||||||
|
@POST("wms/versamentoAutomaticoUL")
|
||||||
|
Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> versamentoAutomaticoUL(@Body MtbColt mtbColt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
|
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
|
|
||||||
|
public GiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getGiacenzeInPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
|
params.put("posizione", posizione.getPosizione());
|
||||||
|
String whereCond = UtilityQuery.concatFieldsInWhereCond(params);
|
||||||
|
String query = "SELECT * from mvw_sitart_udc_det_inventario" +
|
||||||
|
" WHERE " + whereCond;
|
||||||
|
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MvwSitArtUdcDetInventario>>() {
|
||||||
|
}.getType();
|
||||||
|
this.mSystemRESTConsumer.<ArrayList<MvwSitArtUdcDetInventario>>processSql(query, typeOfObjectsList, inventarioList -> {
|
||||||
|
List<String> codMarts = Stream.of(inventarioList)
|
||||||
|
.map(x -> x.getCodMart().trim())
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||||
|
for (var row : inventarioList) {
|
||||||
|
|
||||||
|
MtbAart foundMtbAart = null;
|
||||||
|
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (mtbAartOpt.isPresent()) {
|
||||||
|
foundMtbAart = mtbAartOpt.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
row.setMtbAart(foundMtbAart);
|
||||||
|
}
|
||||||
|
|
||||||
|
onComplete.run(inventarioList);
|
||||||
|
}, onFailed);
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
public interface GiacenzaRESTConsumerService {
|
||||||
|
}
|
||||||
@@ -4,6 +4,9 @@ import android.text.TextUtils;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonDeserializer;
|
||||||
|
import com.google.gson.JsonParseException;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
@@ -13,20 +16,22 @@ import java.io.InputStreamReader;
|
|||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.Azienda;
|
||||||
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;
|
||||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.model.Azienda;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
@@ -46,7 +51,17 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "ProcessSql", o -> {
|
analyzeAnswer(response, "ProcessSql", o -> {
|
||||||
Gson gson = new Gson();
|
Gson gson = new GsonBuilder()
|
||||||
|
.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> {
|
||||||
|
try {
|
||||||
|
return UtilityDate.recognizeDate(json.getAsString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new JsonParseException(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.create();
|
||||||
|
|
||||||
|
|
||||||
String json = gson.toJson(o);
|
String json = gson.toJson(o);
|
||||||
|
|
||||||
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
||||||
@@ -100,7 +115,11 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getAvailableCodMdeps(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
public void getAvailableCodMdeps(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||||
|
getAvailableCodMdepsStatic(onSuccess, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getAvailableCodMdepsStatic(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
service.getAvailableCodMdeps().enqueue(new Callback<>() {
|
service.getAvailableCodMdeps().enqueue(new Callback<>() {
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
|
||||||
|
public class VersamentoAutomaticoULResponseDTO {
|
||||||
|
|
||||||
|
private List<MtbColr> success;
|
||||||
|
private List<MtbColr> failed;
|
||||||
|
|
||||||
|
public List<MtbColr> getSuccess() {
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VersamentoAutomaticoULResponseDTO setSuccess(List<MtbColr> success) {
|
||||||
|
this.success = success;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbColr> getFailed() {
|
||||||
|
return failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VersamentoAutomaticoULResponseDTO setFailed(List<MtbColr> failed) {
|
||||||
|
this.failed = failed;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package it.integry.integrywmsnative.core.services.inventario;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class InventarioService {
|
||||||
|
|
||||||
|
private final GiacenzaRESTConsumer mGiacenzaRESTConsumer;
|
||||||
|
|
||||||
|
public InventarioService(GiacenzaRESTConsumer giacenzaRESTConsumer) {
|
||||||
|
this.mGiacenzaRESTConsumer = giacenzaRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getInventarioDaPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onSuccess, RunnableArgs<Exception> onError) {
|
||||||
|
mGiacenzaRESTConsumer.getGiacenzeInPosizione(posizione, onSuccess, onError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getInventarioDaPosizionePerArticolo(MtbDepoPosizione posizione, MtbAart articolo, RunnableArgs<List<MvwSitArtUdcDetInventario>> onSuccess, RunnableArgs<Exception> onError) {
|
||||||
|
getInventarioDaPosizione(posizione, (inventario) -> {
|
||||||
|
List<MvwSitArtUdcDetInventario> inventarioArticolo = Stream.of(inventario).filter(
|
||||||
|
x -> articolo.getCodMart().equalsIgnoreCase(x.getCodMart())
|
||||||
|
).toList();
|
||||||
|
onSuccess.run(inventarioArticolo);
|
||||||
|
}, onError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt mapInventarioToMtbColt(MvwSitArtUdcDetInventario inventario) {
|
||||||
|
return mapInventarioToMtbColt(inventario, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt mapInventarioToMtbColt(MvwSitArtUdcDetInventario inventario, boolean includeRows) {
|
||||||
|
MtbColt mtbColt = new MtbColt();
|
||||||
|
|
||||||
|
mtbColt.setGestione(inventario.getGestione());
|
||||||
|
mtbColt.setDataCollo(inventario.getDataCollo());
|
||||||
|
mtbColt.setSerCollo(inventario.getSerCollo());
|
||||||
|
mtbColt.setNumCollo(inventario.getNumCollo());
|
||||||
|
mtbColt.setSegno(inventario.getSegno());
|
||||||
|
mtbColt.setCodMdep(inventario.getCodMdep());
|
||||||
|
mtbColt.setPosizione(inventario.getPosizione());
|
||||||
|
mtbColt.setCodJcom(inventario.getCodJcom());
|
||||||
|
mtbColt.setPesoNettoKg(inventario.getPesoNettoKg());
|
||||||
|
mtbColt.setPesoKg(inventario.getPesoLordoKg());
|
||||||
|
mtbColt.setCodJfas(inventario.getCodJfas());
|
||||||
|
|
||||||
|
if (includeRows) {
|
||||||
|
ObservableArrayList<MtbColr> rows = new ObservableArrayList<>();
|
||||||
|
rows.add(mapInventarioToMtbColr(inventario));
|
||||||
|
mtbColt.setMtbColr(rows);
|
||||||
|
}
|
||||||
|
return mtbColt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr mapInventarioToMtbColr(MvwSitArtUdcDetInventario inventario) {
|
||||||
|
MtbColr mtbColr = new MtbColr();
|
||||||
|
|
||||||
|
mtbColr.setGestione(inventario.getGestione());
|
||||||
|
mtbColr.setDataCollo(inventario.getDataCollo());
|
||||||
|
mtbColr.setSerCollo(inventario.getSerCollo());
|
||||||
|
mtbColr.setNumCollo(inventario.getNumCollo());
|
||||||
|
mtbColr.setCodMart(inventario.getCodMart());
|
||||||
|
mtbColr.setDescrizione(inventario.getDescrizioneEstesa());
|
||||||
|
mtbColr.setPartitaMag(inventario.getPartitaMag());
|
||||||
|
mtbColr.setCodJcom(inventario.getCodJcom());
|
||||||
|
mtbColr.setUntMis(inventario.getUntMis());
|
||||||
|
mtbColr.setQtaCol(inventario.getQtaCol());
|
||||||
|
mtbColr.setNumCnf(inventario.getNumCnf());
|
||||||
|
mtbColr.setQtaCnf(inventario.getQtaCnf());
|
||||||
|
mtbColr.setPesoNettoKg(inventario.getPesoNettoKg());
|
||||||
|
mtbColr.setPesoLordoKg(inventario.getPesoLordoKg());
|
||||||
|
mtbColr.setMtbAart(inventario.getMtbAart());
|
||||||
|
|
||||||
|
|
||||||
|
return mtbColr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbColt> mapInventarioToMtbColtList(List<MvwSitArtUdcDetInventario> inventario) {
|
||||||
|
return new ArrayList<>(Stream.of(inventario).groupBy(x -> x.getNumCollo() + "-" + x.getDataCollo() + "-" + x.getSerCollo() + x.getGestione()).map(inv -> {
|
||||||
|
List<MvwSitArtUdcDetInventario> rows = inv.getValue();
|
||||||
|
MtbColt mtbColt = mapInventarioToMtbColt(rows.get(0), false);
|
||||||
|
ObservableArrayList<MtbColr> mtbColrs = new ObservableArrayList<>();
|
||||||
|
mtbColrs.addAll(Stream.of(rows).map(this::mapInventarioToMtbColr).toList());
|
||||||
|
mtbColt.setMtbColr(mtbColrs);
|
||||||
|
return mtbColt;
|
||||||
|
}).toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -130,7 +130,7 @@ public class SettingsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void loadAvailableCodMdeps(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private static void loadAvailableCodMdeps(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
SystemRESTConsumer.getAvailableCodMdeps(availableCodMdeps -> {
|
SystemRESTConsumer.getAvailableCodMdepsStatic(availableCodMdeps -> {
|
||||||
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
|
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
|
||||||
|
|
||||||
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
||||||
|
|||||||
@@ -13,13 +13,19 @@ import java.lang.reflect.Type;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by akshay on 01/03/18.
|
||||||
|
*/
|
||||||
|
|
||||||
public class Stash {
|
public class Stash {
|
||||||
|
|
||||||
private static Stash stash;
|
private static Stash stash;
|
||||||
|
private static Context instance;
|
||||||
private SharedPreferences sp;
|
private SharedPreferences sp;
|
||||||
|
|
||||||
public static void init(Context context) {
|
public static void init(Context context) {
|
||||||
stash = new Stash();
|
stash = new Stash();
|
||||||
|
instance = context;
|
||||||
if (stash.sp == null) {
|
if (stash.sp == null) {
|
||||||
stash.sp = PreferenceManager.getDefaultSharedPreferences(context);
|
stash.sp = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
}
|
}
|
||||||
@@ -34,7 +40,7 @@ public class Stash {
|
|||||||
public static void put(String key, String value) {
|
public static void put(String key, String value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putString(key, value).apply();
|
stash.sp.edit().putString(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -44,7 +50,7 @@ public class Stash {
|
|||||||
public static void put(String key, Set<String> value) {
|
public static void put(String key, Set<String> value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putStringSet(key, value).apply();
|
stash.sp.edit().putStringSet(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -54,7 +60,7 @@ public class Stash {
|
|||||||
public static void put(String key, int value) {
|
public static void put(String key, int value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putInt(key, value).apply();
|
stash.sp.edit().putInt(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -64,7 +70,7 @@ public class Stash {
|
|||||||
public static void put(String key, long value) {
|
public static void put(String key, long value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putLong(key, value).apply();
|
stash.sp.edit().putLong(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -74,7 +80,7 @@ public class Stash {
|
|||||||
public static void put(String key, float value) {
|
public static void put(String key, float value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putFloat(key, value).apply();
|
stash.sp.edit().putFloat(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -84,7 +90,7 @@ public class Stash {
|
|||||||
public static void put(String key, boolean value) {
|
public static void put(String key, boolean value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putBoolean(key, value).apply();
|
stash.sp.edit().putBoolean(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -95,7 +101,7 @@ public class Stash {
|
|||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
Gson gson = new GsonBuilder().create();
|
Gson gson = new GsonBuilder().create();
|
||||||
stash.sp.edit().putString(key, gson.toJson(value).toString()).apply();
|
stash.sp.edit().putString(key, gson.toJson(value)).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -112,18 +118,26 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getString(String key) {
|
||||||
|
return getString(key, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//getStringSet
|
//getStringSet
|
||||||
public static Set<String> getStringSet(String key, Set<String> defaultvalue) {
|
public static Set<String> getStringSet(String key, Set<String> defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
return getStringSet(key, defaultvalue);
|
return stash.sp.getStringSet(key, defaultvalue);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return defaultvalue;
|
return defaultvalue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Set<String> getStringSet(String key) {
|
||||||
|
return getStringSet(key, null);
|
||||||
|
}
|
||||||
|
|
||||||
//getInt
|
//getInt
|
||||||
public static int getInt(String key, int defaultvalue) {
|
public static int getInt(String key, int defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -135,6 +149,10 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getInt(String key) {
|
||||||
|
return getInt(key, 0);
|
||||||
|
}
|
||||||
|
|
||||||
//getLong
|
//getLong
|
||||||
public static long getLong(String key, long defaultvalue) {
|
public static long getLong(String key, long defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -146,6 +164,10 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long getLong(String key) {
|
||||||
|
return getLong(key, (long) 0);
|
||||||
|
}
|
||||||
|
|
||||||
//getFloat
|
//getFloat
|
||||||
public static float getFloat(String key, float defaultvalue) {
|
public static float getFloat(String key, float defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -157,6 +179,10 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float getFloat(String key) {
|
||||||
|
return getFloat(key, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
//getBoolean
|
//getBoolean
|
||||||
public static boolean getBoolean(String key, boolean defaultvalue) {
|
public static boolean getBoolean(String key, boolean defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -168,6 +194,10 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean getBoolean(String key) {
|
||||||
|
return getBoolean(key, false);
|
||||||
|
}
|
||||||
|
|
||||||
//getObject
|
//getObject
|
||||||
public static <T> Object getObject(String key, Class<?> tClass) {
|
public static <T> Object getObject(String key, Class<?> tClass) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -196,7 +226,7 @@ public class Stash {
|
|||||||
public static void clear(String key) {
|
public static void clear(String key) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().remove(key).apply();
|
stash.sp.edit().remove(key).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -206,12 +236,22 @@ public class Stash {
|
|||||||
public static void clearAll() {
|
public static void clearAll() {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().clear().apply();
|
stash.sp.edit().clear().commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void addListener(StashListener listener){
|
||||||
|
checkfornull();
|
||||||
|
stash.sp.registerOnSharedPreferenceChangeListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeListener(StashListener listener){
|
||||||
|
checkfornull();
|
||||||
|
stash.sp.unregisterOnSharedPreferenceChangeListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
private static class GenericType implements ParameterizedType {
|
private static class GenericType implements ParameterizedType {
|
||||||
|
|
||||||
private Type type;
|
private Type type;
|
||||||
@@ -238,4 +278,7 @@ public class Stash {
|
|||||||
// implement equals method too! (as per javadoc)
|
// implement equals method too! (as per javadoc)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public interface StashListener extends SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import com.google.android.gms.common.internal.service.Common;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ 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.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@@ -33,14 +35,17 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnGeneralChangedCallback;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
@@ -50,20 +55,28 @@ import it.integry.integrywmsnative.core.utility.UtilityToast;
|
|||||||
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListAdapter;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListModel;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.AccettazionePickingFiltroOrdineViewModel;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterCodArtLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterDescrLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterPosizioneLayoutView;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListAdapter;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListModel;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipView;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_should_versamento_automatico_ul.DialogAskShouldVersamentoAutomaticoULView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialog;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.versamento_automatico_ul_done.DialogVersamentoAutomaticoULDoneView;
|
||||||
|
|
||||||
public class AccettazionePickingActivity extends BaseActivity implements AccettazionePickingViewModel.Listener, BottomSheetFragmentLUContentViewModel.Listener, BottomSheetFragmentLUContentView.Listener {
|
public class AccettazionePickingActivity extends BaseActivity implements AccettazionePickingViewModel.Listener, BottomSheetFragmentLUContentViewModel.Listener, BottomSheetFragmentLUContentView.Listener {
|
||||||
|
|
||||||
@@ -72,6 +85,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
@Inject
|
@Inject
|
||||||
AccettazionePickingViewModel mViewModel;
|
AccettazionePickingViewModel mViewModel;
|
||||||
|
|
||||||
|
private final AccettazionePickingFiltroOrdineViewModel mAppliedFilterViewModel = new AccettazionePickingFiltroOrdineViewModel();
|
||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
private final ObservableArrayList<AccettazioneListModel> mAccettazioneMutableData = new ObservableArrayList<>();
|
private final ObservableArrayList<AccettazioneListModel> mAccettazioneMutableData = new ObservableArrayList<>();
|
||||||
@@ -123,6 +138,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
this.initVars();
|
this.initVars();
|
||||||
this.initBarcodeReader();
|
this.initBarcodeReader();
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
this.initFilters();
|
||||||
|
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
@@ -130,6 +146,158 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
mViewModel.init(mOrders, mSitArts, codMdep);
|
mViewModel.init(mOrders, mSitArts, codMdep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initFilters() {
|
||||||
|
|
||||||
|
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
refreshList();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mAppliedFilterViewModel.getCurrentCodArtPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentPosPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
|
||||||
|
List<FilterChipDTO> filterList = Stream.of(AccettazionePickingBindings.AVAILABLE_FILTERS.entrySet())
|
||||||
|
.map(Map.Entry::getValue)
|
||||||
|
.sortBy(FilterChipDTO::getPosizione)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
for (FilterChipDTO filterChipDTO : filterList) {
|
||||||
|
|
||||||
|
FilterChipView filterChipView = new FilterChipView(
|
||||||
|
this,
|
||||||
|
filterChipDTO.getFilterChipText(),
|
||||||
|
v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||||
|
|
||||||
|
switch (filterChipDTO.getID()) {
|
||||||
|
case AccettazionePickingBindings.COD_ART_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentCodArtPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null) {
|
||||||
|
mViewModel.resetMatchedRows();
|
||||||
|
filterChipView.disableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
} else {
|
||||||
|
filterChipView.enableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentCodArtPredicate().set(null));
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.DESCR_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null) {
|
||||||
|
mViewModel.resetMatchedRows();
|
||||||
|
filterChipView.disableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
} else {
|
||||||
|
filterChipView.enableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentDescrPredicate().set(null));
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.POS_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentPosPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentPosPredicate().get() == null) {
|
||||||
|
mViewModel.resetMatchedRows();
|
||||||
|
filterChipView.disableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
} else {
|
||||||
|
filterChipView.enableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentPosPredicate().set(null));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||||
|
|
||||||
|
filterChipDTO
|
||||||
|
.getFilterLayoutView()
|
||||||
|
.setFilterName(filterChipDTO.getFilterChipText())
|
||||||
|
.setContext(this);
|
||||||
|
|
||||||
|
var filterLayoutView = filterChipDTO
|
||||||
|
.getFilterLayoutView();
|
||||||
|
|
||||||
|
switch (filterChipDTO.getID()) {
|
||||||
|
case AccettazionePickingBindings.COD_ART_FILTER_ID:
|
||||||
|
((FilterCodArtLayoutView) filterLayoutView)
|
||||||
|
.setAll(mAppliedFilterViewModel.getAllCodArts())
|
||||||
|
.setAvailable(mAppliedFilterViewModel.getAvailableCodArts())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setCodArtFilter)
|
||||||
|
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentCodArtPredicate().get())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.DESCR_FILTER_ID:
|
||||||
|
((FilterDescrLayoutView) filterLayoutView)
|
||||||
|
.setAll(mAppliedFilterViewModel.getAllDescrs())
|
||||||
|
.setAvailable(mAppliedFilterViewModel.getAvailableDescrs())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter)
|
||||||
|
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentDescrPredicate().get())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.POS_FILTER_ID:
|
||||||
|
((FilterPosizioneLayoutView) filterLayoutView)
|
||||||
|
.setAll(mAppliedFilterViewModel.getAllPos())
|
||||||
|
.setAvailable(mAppliedFilterViewModel.getAvailablePos())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setPosFilter)
|
||||||
|
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentPosPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentPosPredicate().get())
|
||||||
|
.map(x -> x.getMtbAart().getPosizione())
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSupportNavigateUp() {
|
public boolean onSupportNavigateUp() {
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@@ -162,7 +330,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
// Handle item selection
|
// Handle item selection
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.action_filter:
|
case R.id.action_filter:
|
||||||
showOrderDialog();
|
showOrderByDialog();
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
@@ -189,6 +357,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
this.mBindings.accettazionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
this.mBindings.accettazionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
this.mViewModel.getPickingList().observe(this, updatedData -> {
|
this.mViewModel.getPickingList().observe(this, updatedData -> {
|
||||||
|
mAppliedFilterViewModel.init(updatedData);
|
||||||
|
|
||||||
refreshList();
|
refreshList();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -198,9 +368,28 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void refreshList() {
|
private void refreshList() {
|
||||||
this.mAccettazioneMutableData.clear();
|
//this.onLoadingStarted();
|
||||||
this.mAccettazioneMutableData.addAll(convertDataModelToListModel(this.mViewModel.getPickingList().getValue()));
|
|
||||||
this.noItemsToPick.set(!isThereAnyItemToPick(this.mViewModel.getPickingList().getValue()));
|
//new Thread(() -> {
|
||||||
|
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
List<PickingObjectDTO> tmpList;
|
||||||
|
|
||||||
|
if (mAppliedFilterViewModel != null) {
|
||||||
|
mAppliedFilterViewModel.applyAllTests();
|
||||||
|
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||||
|
} else {
|
||||||
|
tmpList = mViewModel.getPickingList().getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = convertDataModelToListModel(tmpList);
|
||||||
|
|
||||||
|
this.mAccettazioneMutableData.clear();
|
||||||
|
this.mAccettazioneMutableData.addAll(list);
|
||||||
|
this.noItemsToPick.set(!isThereAnyItemToPick(tmpList));
|
||||||
|
|
||||||
|
//this.onLoadingEnded();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<AccettazioneListModel> convertDataModelToListModel(List<PickingObjectDTO> dataList) {
|
private List<AccettazioneListModel> convertDataModelToListModel(List<PickingObjectDTO> dataList) {
|
||||||
@@ -228,17 +417,21 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
private List<AccettazioneListModel> convertDataModelToListModel__CodArtForn(List<PickingObjectDTO> dataList) {
|
private List<AccettazioneListModel> convertDataModelToListModel__CodArtForn(List<PickingObjectDTO> dataList) {
|
||||||
ArrayList<AccettazioneListModel> list = new ArrayList<>();
|
ArrayList<AccettazioneListModel> list = new ArrayList<>();
|
||||||
Stream.of(dataList)
|
Stream.of(dataList)
|
||||||
.sortBy(x -> x.getSitArtOrdDTO().getCodArtFor() + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()))
|
.sortBy(x -> UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) +
|
||||||
|
(UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()))
|
||||||
.forEach(x -> {
|
.forEach(x -> {
|
||||||
AccettazioneListModel accettazioneListModel = new AccettazioneListModel();
|
AccettazioneListModel accettazioneListModel = new AccettazioneListModel();
|
||||||
accettazioneListModel.setActive(true);
|
accettazioneListModel.setActive(true);
|
||||||
|
|
||||||
accettazioneListModel.setGroupTitle(x.getSitArtOrdDTO().getCodArtFor() + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
accettazioneListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) +
|
||||||
|
(UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||||
|
|
||||||
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||||
|
|
||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
@@ -295,12 +488,15 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
AccettazioneListModel accettazioneListModel = new AccettazioneListModel();
|
AccettazioneListModel accettazioneListModel = new AccettazioneListModel();
|
||||||
accettazioneListModel.setActive(true);
|
accettazioneListModel.setActive(true);
|
||||||
|
|
||||||
accettazioneListModel.setGroupTitle(x.getSitArtOrdDTO().getCodArtFor() + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
accettazioneListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart())
|
||||||
|
+ (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||||
|
|
||||||
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||||
|
|
||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
@@ -361,7 +557,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
accettazioneListModel.setGroupTitle(x.getSitArtOrdDTO().getCodJcom() + (!UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) ? " - " + x.getSitArtOrdDTO().getDescrizioneCommessa() : ""));
|
accettazioneListModel.setGroupTitle(x.getSitArtOrdDTO().getCodJcom() + (!UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) ? " - " + x.getSitArtOrdDTO().getDescrizioneCommessa() : ""));
|
||||||
|
|
||||||
accettazioneListModel.setBadge1(x.getSitArtOrdDTO().getCodArtFor());
|
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
@@ -405,6 +601,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
if (x.getMtbAart() != null) {
|
if (x.getMtbAart() != null) {
|
||||||
accettazioneListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
accettazioneListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
||||||
|
accettazioneListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||||
}
|
}
|
||||||
|
|
||||||
accettazioneListModel.setOriginalModel(x);
|
accettazioneListModel.setOriginalModel(x);
|
||||||
@@ -420,7 +617,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
accettazioneListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
accettazioneListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||||
|
|
||||||
accettazioneListModel.setBadge1(x.getSitArtOrdDTO().getCodArtFor());
|
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
|
|
||||||
@@ -514,8 +711,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
this.mViewModel.retrieveExistentLU(this::startListaBancaliRegistratiActivity);
|
this.mViewModel.retrieveExistentLU(this::startListaBancaliRegistratiActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showOrderDialog() {
|
private void showOrderByDialog() {
|
||||||
|
|
||||||
AlertDialog dialog = new AlertDialog.Builder(this)
|
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||||
.setTitle(this.getText(R.string.action_orderBy))
|
.setTitle(this.getText(R.string.action_orderBy))
|
||||||
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, mCurrentOrderBy.getVal(), (dialog12, which) -> {
|
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, mCurrentOrderBy.getVal(), (dialog12, which) -> {
|
||||||
@@ -527,7 +723,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void startListaBancaliRegistratiActivity(ArrayList<RecoverMtbColt> mtbColts) {
|
public void startListaBancaliRegistratiActivity(ArrayList<RecoverMtbColt> mtbColts) {
|
||||||
|
|
||||||
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
||||||
@@ -560,7 +755,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
null,
|
null,
|
||||||
R.string.button_ignore_print,
|
R.string.button_ignore_print,
|
||||||
onComplete)
|
onComplete)
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -589,8 +784,18 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNoteAggiuntiveRequest(RunnableArgs<String> onComplete) {
|
public void onVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
NoteAggiuntiveLUDialog.make(this, onComplete::run, () -> onComplete.run(null)).show();
|
runOnUiThread(() -> {
|
||||||
|
DialogAskShouldVersamentoAutomaticoULView.newInstance(onComplete)
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
InfoAggiuntiveLUDialog.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -645,44 +850,72 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRowSaved() {
|
public void onRowSaved() {
|
||||||
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
runOnUiThread(() -> {
|
||||||
|
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterApplied(String newValue) {
|
public void onFilterCodMartApplied(String codMartToFilter) {
|
||||||
this.mBindings.filteredArtsInListExpandableLayout.expand(true);
|
runOnUiThread(() -> {
|
||||||
this.mBindings.descriptionFilterText.setText(!UtilityString.isNullOrEmpty(newValue) ? newValue : "");
|
var codMarts = new ArrayList<String>();
|
||||||
|
codMarts.add(codMartToFilter);
|
||||||
|
|
||||||
|
this.mAppliedFilterViewModel.setCodArtFilter(codMarts);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterRemoved() {
|
public void onFilterPosizioneApplied(String posizioneToFilter) {
|
||||||
mBindings.filteredArtsInListExpandableLayout.collapse(true);
|
runOnUiThread(() -> {
|
||||||
|
var posizioni = new ArrayList<String>();
|
||||||
|
posizioni.add(posizioneToFilter);
|
||||||
|
|
||||||
|
this.mAppliedFilterViewModel.setPosFilter(posizioni);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||||
|
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
DialogVersamentoAutomaticoULDoneView
|
||||||
|
.newInstance(versamentoAutomaticoULResponseDTO, onComplete)
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
runOnUiThread(() -> {
|
||||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
||||||
null,
|
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||||
() -> onComplete.run(true),
|
null,
|
||||||
() -> onComplete.run(false)
|
() -> onComplete.run(true),
|
||||||
).show(getSupportFragmentManager(), "tag");
|
() -> onComplete.run(false)
|
||||||
|
).show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUOpened(MtbColt mtbColt) {
|
public void onLUOpened(MtbColt mtbColt) {
|
||||||
noLUPresent.set(false);
|
runOnUiThread(() -> {
|
||||||
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
noLUPresent.set(false);
|
||||||
|
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
|
|
||||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUClosed() {
|
public void onLUClosed() {
|
||||||
noLUPresent.set(true);
|
runOnUiThread(() -> {
|
||||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
noLUPresent.set(true);
|
||||||
|
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||||
|
|
||||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterCodArtLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterDescrLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterPosizioneLayoutView;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||||
|
|
||||||
|
public class AccettazionePickingBindings {
|
||||||
|
|
||||||
|
public static final int COD_ART_FILTER_ID = 0;
|
||||||
|
public static final int DESCR_FILTER_ID = 1;
|
||||||
|
public static final int POS_FILTER_ID = 2;
|
||||||
|
|
||||||
|
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {
|
||||||
|
{
|
||||||
|
put(COD_ART_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(COD_ART_FILTER_ID)
|
||||||
|
.setPosizione(0)
|
||||||
|
.setFilterChipText("Codice articolo")
|
||||||
|
.setFilterLayoutView(new FilterCodArtLayoutView()));
|
||||||
|
|
||||||
|
put(DESCR_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(DESCR_FILTER_ID)
|
||||||
|
.setPosizione(1)
|
||||||
|
.setFilterChipText("Descrizione articolo")
|
||||||
|
.setFilterLayoutView(new FilterDescrLayoutView()));
|
||||||
|
|
||||||
|
put(POS_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(POS_FILTER_ID)
|
||||||
|
.setPosizione(1)
|
||||||
|
.setFilterChipText("Posizione")
|
||||||
|
.setFilterLayoutView(new FilterPosizioneLayoutView()));
|
||||||
|
}};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -34,6 +34,7 @@ import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
@@ -42,11 +43,13 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.HistoryMtbAartDTO;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.HistoryMtbAartDTO;
|
||||||
@@ -243,6 +246,10 @@ public class AccettazionePickingViewModel {
|
|||||||
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
||||||
|
|
||||||
|
|
||||||
|
} else if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
|
||||||
|
//Applico filtro per posizione
|
||||||
|
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
||||||
|
|
||||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||||
@@ -293,6 +300,15 @@ public class AccettazionePickingViewModel {
|
|||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void executeEtichettaPosizione(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
|
||||||
|
var optionalPos = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
||||||
|
.filter(x -> x.getPosizione().equalsIgnoreCase(barcodeScanDTO.getStringValue()))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
this.sendFilterPosizioneApplied(optionalPos.get().getPosizione());
|
||||||
|
onComplete.run();
|
||||||
|
}
|
||||||
|
|
||||||
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
|
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
|
||||||
if (barcodeProd.length() == 14) {
|
if (barcodeProd.length() == 14) {
|
||||||
@@ -332,21 +348,19 @@ public class AccettazionePickingViewModel {
|
|||||||
} else if (matchedRows.size() == 1) {
|
} else if (matchedRows.size() == 1) {
|
||||||
this.dispatchOrdineRow(matchedRows.get(0));
|
this.dispatchOrdineRow(matchedRows.get(0));
|
||||||
} else {
|
} else {
|
||||||
List<PickingObjectDTO> pickingList = mPickingList.getValue();
|
//So che il codMart sarà solo 1
|
||||||
|
var firstCodMart = Stream.of(matchedRows)
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.distinct()
|
||||||
|
.findFirst()
|
||||||
|
.get();
|
||||||
|
|
||||||
for (int i = 0; i < pickingList.size(); i++) {
|
this.sendFilterCodMartApplied(firstCodMart);
|
||||||
if (!matchedRows.contains(pickingList.get(i))) {
|
|
||||||
pickingList.get(i).setHidden(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sendFilterApplied(null);
|
|
||||||
this.getPickingList().postValue(pickingList);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createNewLU(Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
public void createNewLU(Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
||||||
this.sendOnNoteAggiuntiveRequest(additionalNotes -> {
|
this.sendOnInfoAggiuntiveRequest((additionalNotes, tCol) -> {
|
||||||
|
|
||||||
this.mGestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
this.mGestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
||||||
|
|
||||||
@@ -362,6 +376,11 @@ public class AccettazionePickingViewModel {
|
|||||||
.setPosizione(defaultPosAccettazione)
|
.setPosizione(defaultPosAccettazione)
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
if (tCol != null) {
|
||||||
|
mtbColt.setCodTcol(tCol.getCodTcol());
|
||||||
|
mtbColt.setMtbTCol(tCol);
|
||||||
|
}
|
||||||
|
|
||||||
if (customNumCollo != null) {
|
if (customNumCollo != null) {
|
||||||
mtbColt.setNumCollo(customNumCollo);
|
mtbColt.setNumCollo(customNumCollo);
|
||||||
}
|
}
|
||||||
@@ -571,64 +590,67 @@ public class AccettazionePickingViewModel {
|
|||||||
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
String gestioneRif = pickingObjectDTO.getSitArtOrdDTO().getGestioneEnum() == GestioneEnum.PRODUZIONE ? "L" : pickingObjectDTO.getSitArtOrdDTO().getGestione();
|
UtilityThread.executeParallel(() -> {
|
||||||
|
|
||||||
final MtbColr mtbColr = new MtbColr()
|
String gestioneRif = pickingObjectDTO.getSitArtOrdDTO().getGestioneEnum() == GestioneEnum.PRODUZIONE ? "L" : pickingObjectDTO.getSitArtOrdDTO().getGestione();
|
||||||
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
|
||||||
.setPartitaMag(partitaMag)
|
final MtbColr mtbColr = new MtbColr()
|
||||||
.setDataScadPartita(dataScad)
|
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
||||||
.setQtaCol(qtaTot)
|
.setPartitaMag(partitaMag)
|
||||||
.setQtaCnf(qtaCnf)
|
.setDataScadPartita(dataScad)
|
||||||
.setNumCnf(numCnf)
|
.setQtaCol(qtaTot)
|
||||||
.setGestioneRif(gestioneRif)
|
.setQtaCnf(qtaCnf)
|
||||||
.setCodJcom(pickingObjectDTO.getSitArtOrdDTO().getCodJcom())
|
.setNumCnf(numCnf)
|
||||||
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
.setGestioneRif(gestioneRif)
|
||||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
.setCodJcom(pickingObjectDTO.getSitArtOrdDTO().getCodJcom())
|
||||||
.setDataOrd(pickingObjectDTO.getSitArtOrdDTO().getDataOrd())
|
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
||||||
.setNumOrd(pickingObjectDTO.getSitArtOrdDTO().getNumOrd())
|
.setDatetimeRow(UtilityDate.getDateInstance())
|
||||||
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
.setDataOrd(pickingObjectDTO.getSitArtOrdDTO().getDataOrd())
|
||||||
|
.setNumOrd(pickingObjectDTO.getSitArtOrdDTO().getNumOrd())
|
||||||
|
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
||||||
|
|
||||||
|
|
||||||
this.addHistoryItem(mtbColr);
|
this.addHistoryItem(mtbColr);
|
||||||
|
|
||||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
|
|
||||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
||||||
|
|
||||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||||
resetMatchedRows();
|
resetMatchedRows();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (shouldCloseLU) closeLU();
|
if (shouldCloseLU) closeLU();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||||
|
|
||||||
mtbColr
|
mtbColr
|
||||||
.setDataCollo(value.getDataColloS())
|
.setDataCollo(value.getDataColloS())
|
||||||
.setNumCollo(value.getNumCollo())
|
.setNumCollo(value.getNumCollo())
|
||||||
.setGestione(value.getGestione())
|
.setGestione(value.getGestione())
|
||||||
.setSerCollo(value.getSerCollo())
|
.setSerCollo(value.getSerCollo())
|
||||||
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
||||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
|
||||||
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||||
resetMatchedRows();
|
resetMatchedRows();
|
||||||
|
|
||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (shouldCloseLU) closeLU();
|
if (shouldCloseLU) closeLU();
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -772,19 +794,40 @@ public class AccettazionePickingViewModel {
|
|||||||
} else {
|
} else {
|
||||||
mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
||||||
|
|
||||||
if (!mCurrentMtbColt.getDisablePrint()) {
|
Runnable onVersamentoCompleted = () -> {
|
||||||
printCollo(this::postCloseOperations);
|
if (!mCurrentMtbColt.getDisablePrint()) {
|
||||||
} else {
|
printCollo(this::postCloseOperations);
|
||||||
postCloseOperations();
|
} else {
|
||||||
}
|
postCloseOperations();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sendLUClosed();
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
};
|
||||||
|
|
||||||
|
sendVersamentoAutomaticoULRequest(response -> {
|
||||||
|
if (response) {
|
||||||
|
versaAutomaticamenteUL(onVersamentoCompleted);
|
||||||
|
} else {
|
||||||
|
onVersamentoCompleted.run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
this.sendLUClosed();
|
|
||||||
this.sendOnLoadingEnded();
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void versaAutomaticamenteUL(Runnable onComplete) {
|
||||||
|
if (mCurrentMtbColt == null) return;
|
||||||
|
|
||||||
|
mColliMagazzinoRESTConsumer.versamentoAutomaticoUL(mCurrentMtbColt, versamentoResult -> {
|
||||||
|
this.notifyVersamentoAutomaticoResult(versamentoResult, onComplete);
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void printCollo(Runnable onComplete) {
|
private void printCollo(Runnable onComplete) {
|
||||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
cloneMtbColt.setGestione(cloneMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE ? GestioneEnum.PRODUZIONE : cloneMtbColt.getGestioneEnum());
|
cloneMtbColt.setGestione(cloneMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE ? GestioneEnum.PRODUZIONE : cloneMtbColt.getGestioneEnum());
|
||||||
@@ -816,12 +859,10 @@ public class AccettazionePickingViewModel {
|
|||||||
public void resetMatchedRows() {
|
public void resetMatchedRows() {
|
||||||
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
||||||
pickingObjectDTO
|
pickingObjectDTO
|
||||||
.setTempPickData(null)
|
.setTempPickData(null);
|
||||||
.setHidden(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mPickingList.postValue(this.mPickingList.getValue());
|
this.mPickingList.postValue(this.mPickingList.getValue());
|
||||||
this.sendFilterRemoved();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addHistoryItem(@NonNull MtbColr mtbColr) {
|
private void addHistoryItem(@NonNull MtbColr mtbColr) {
|
||||||
@@ -857,8 +898,12 @@ public class AccettazionePickingViewModel {
|
|||||||
if (this.mListener != null) mListener.onLoadingEnded();
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendOnNoteAggiuntiveRequest(RunnableArgs<String> onComplete) {
|
private void sendVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
if (this.mListener != null) this.mListener.onNoteAggiuntiveRequest(onComplete);
|
if (this.mListener != null) this.mListener.onVersamentoAutomaticoULRequest(onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||||
|
if (this.mListener != null) this.mListener.onInfoAggiuntiveRequest(onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendError(Exception ex) {
|
private void sendError(Exception ex) {
|
||||||
@@ -925,27 +970,33 @@ public class AccettazionePickingViewModel {
|
|||||||
if (this.mListener != null) mListener.onRowSaved();
|
if (this.mListener != null) mListener.onRowSaved();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendFilterApplied(String newValue) {
|
private void sendFilterCodMartApplied(String codMart) {
|
||||||
if (this.mListener != null) mListener.onFilterApplied(newValue);
|
if (this.mListener != null) mListener.onFilterCodMartApplied(codMart);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendFilterRemoved() {
|
private void sendFilterPosizioneApplied(String posizione) {
|
||||||
if (this.mListener != null) mListener.onFilterRemoved();
|
if (this.mListener != null) mListener.onFilterPosizioneApplied(posizione);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
private void sendMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete);
|
if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccettazionePickingViewModel setListeners(AccettazionePickingViewModel.Listener
|
private void notifyVersamentoAutomaticoResult(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||||
listener) {
|
if (this.mListener != null)
|
||||||
|
mListener.onULVersata(versamentoAutomaticoULResponseDTO, onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccettazionePickingViewModel setListeners(AccettazionePickingViewModel.Listener listener) {
|
||||||
this.mListener = listener;
|
this.mListener = listener;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Listener extends ILoadingListener, ILUPrintListener, ILUBaseOperationsListener {
|
public interface Listener extends ILoadingListener, ILUPrintListener, ILUBaseOperationsListener {
|
||||||
|
|
||||||
void onNoteAggiuntiveRequest(RunnableArgs<String> onComplete);
|
void onVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete);
|
||||||
|
|
||||||
|
void onInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete);
|
||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
|
||||||
@@ -969,9 +1020,11 @@ public class AccettazionePickingViewModel {
|
|||||||
boolean canOverflowQuantity,
|
boolean canOverflowQuantity,
|
||||||
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
||||||
|
|
||||||
void onFilterApplied(String newValue);
|
void onFilterCodMartApplied(String codMartToFilter);
|
||||||
|
|
||||||
void onFilterRemoved();
|
void onFilterPosizioneApplied(String posizioneToFilter);
|
||||||
|
|
||||||
|
void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,174 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.annimon.stream.function.Predicate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
|
|
||||||
|
public class AccettazionePickingFiltroOrdineViewModel {
|
||||||
|
|
||||||
|
private final ObservableField<Predicate<PickingObjectDTO>> currentCodArtPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<PickingObjectDTO>> currentDescrPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<PickingObjectDTO>> currentPosPredicate = new ObservableField<>();
|
||||||
|
|
||||||
|
|
||||||
|
private List<PickingObjectDTO> initialOrderList;
|
||||||
|
private final MutableLiveData<List<PickingObjectDTO>> currentFilteredOrderList = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public void init(List<PickingObjectDTO> initialList) {
|
||||||
|
this.initialOrderList = initialList;
|
||||||
|
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MutableLiveData<List<PickingObjectDTO>> getMutableFilteredOrderList() {
|
||||||
|
return this.currentFilteredOrderList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setCodArtFilter(List<String> codArts) {
|
||||||
|
if (codArts == null || codArts.isEmpty()) currentCodArtPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentCodArtPredicate.set(o -> codArts.contains(o.getSitArtOrdDTO().getCodMart()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setDescrFilter(List<String> descrs) {
|
||||||
|
if (descrs == null || descrs.isEmpty()) currentDescrPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentDescrPredicate.set(o -> descrs.contains(o.getSitArtOrdDTO().getDescrizioneEstesaArt()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setPosFilter(List<String> pos) {
|
||||||
|
if (pos == null || pos.isEmpty()) currentPosPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentPosPredicate.set(o -> o.getMtbAart() != null && o.getMtbAart().getPosizione() == null ? pos.contains(null) : pos.contains(o.getMtbAart().getPosizione()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void applyAllTests() {
|
||||||
|
|
||||||
|
List<PickingObjectDTO> returnList = null;
|
||||||
|
|
||||||
|
if (currentCodArtPredicate.get() == null &&
|
||||||
|
currentDescrPredicate.get() == null &&
|
||||||
|
currentPosPredicate.get() == null) {
|
||||||
|
returnList = this.initialOrderList;
|
||||||
|
} else {
|
||||||
|
Stream<PickingObjectDTO> tmpStream = Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentCodArtPredicate.get() == null || (currentCodArtPredicate.get().test(x))) &&
|
||||||
|
(currentDescrPredicate.get() == null || (currentDescrPredicate.get().test(x))) &&
|
||||||
|
(currentPosPredicate.get() == null || (currentPosPredicate.get().test(x)))
|
||||||
|
);
|
||||||
|
|
||||||
|
returnList = tmpStream.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.currentFilteredOrderList.setValue(returnList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<PickingObjectDTO>> getCurrentCodArtPredicate() {
|
||||||
|
return currentCodArtPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<PickingObjectDTO>> getCurrentDescrPredicate() {
|
||||||
|
return currentDescrPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<PickingObjectDTO>> getCurrentPosPredicate() {
|
||||||
|
return currentPosPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllCodArts() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getSitArtOrdDTO().getCodMart() != null)
|
||||||
|
.sortBy(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart() != null ? x.getSitArtOrdDTO().getCodMart() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableCodArts() {
|
||||||
|
|
||||||
|
if (currentDescrPredicate.get() == null &&
|
||||||
|
currentPosPredicate.get() == null) {
|
||||||
|
return getAllCodArts();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentDescrPredicate.get() == null || (currentDescrPredicate.get().test(x))) &&
|
||||||
|
(currentPosPredicate.get() == null || (currentPosPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllDescrs() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt() != null)
|
||||||
|
.sortBy(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt() != null ? x.getSitArtOrdDTO().getDescrizioneEstesaArt() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableDescrs() {
|
||||||
|
|
||||||
|
if (currentCodArtPredicate.get() == null &&
|
||||||
|
currentPosPredicate.get() == null) {
|
||||||
|
return getAllDescrs();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentCodArtPredicate.get() == null || (currentCodArtPredicate.get().test(x))) &&
|
||||||
|
(currentPosPredicate.get() == null || (currentPosPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllPos() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getMtbAart() != null && x.getMtbAart().getPosizione() != null)
|
||||||
|
.sortBy(x -> UtilityString.isNull(x.getMtbAart().getPosizione(), "000000"))
|
||||||
|
.map(x -> x.getMtbAart().getPosizione() != null ? x.getMtbAart().getPosizione() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailablePos() {
|
||||||
|
|
||||||
|
if (currentCodArtPredicate.get() == null &&
|
||||||
|
currentDescrPredicate.get() == null) {
|
||||||
|
return getAllPos();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentCodArtPredicate.get() == null || (currentCodArtPredicate.get().test(x))) &&
|
||||||
|
(currentDescrPredicate.get() == null || (currentDescrPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(x -> x.getMtbAart().getPosizione())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BR;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterCodArtBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterCodArtLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterCodArtBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> all;
|
||||||
|
private List<String> available;
|
||||||
|
private List<String> preselected = new ArrayList<>();
|
||||||
|
private List<String> hidden = new ArrayList<>();
|
||||||
|
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private RunnableArgs<List<String>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_cod_art, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||||
|
hidden = Stream.of(all)
|
||||||
|
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||||
|
!x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_cod_art__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
ComparatorCompat<ListModel> c =
|
||||||
|
ComparatorCompat
|
||||||
|
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareToIgnoreCase(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
|
||||||
|
listModel.setValue(Stream.of(getAll())
|
||||||
|
.filter(x -> !hidden.contains(x))
|
||||||
|
.map(x -> {
|
||||||
|
var selectedBoolean = new BindableBoolean(preselected.contains(x));
|
||||||
|
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||||
|
if (selectedBoolean.get()) preselected.add(x);
|
||||||
|
else preselected.remove(x);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ListModel()
|
||||||
|
.setSelected(selectedBoolean)
|
||||||
|
.setEnabled(new BindableBoolean(available.contains(x)))
|
||||||
|
.setOriginalModel(x);
|
||||||
|
})
|
||||||
|
.sorted(c)
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAll() {
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setAll(List<String> all) {
|
||||||
|
this.all = all;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailable() {
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setAvailable(List<String> available) {
|
||||||
|
this.available = available;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreselected() {
|
||||||
|
return preselected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setPreselected(List<String> preselected) {
|
||||||
|
this.preselected = preselected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setHidden(List<String> hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private String originalModel;
|
||||||
|
|
||||||
|
public BindableBoolean getSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setSelected(BindableBoolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setEnabled(BindableBoolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(String originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BR;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterDescrBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterDescrLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterDescrBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> all;
|
||||||
|
private List<String> available;
|
||||||
|
private List<String> preselected = new ArrayList<>();
|
||||||
|
private List<String> hidden = new ArrayList<>();
|
||||||
|
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private RunnableArgs<List<String>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_descr, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||||
|
hidden = Stream.of(all)
|
||||||
|
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||||
|
!x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_descr__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
ComparatorCompat<ListModel> c =
|
||||||
|
ComparatorCompat
|
||||||
|
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareToIgnoreCase(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
|
||||||
|
listModel.setValue(Stream.of(getAll())
|
||||||
|
.filter(x -> !hidden.contains(x))
|
||||||
|
.map(x -> {
|
||||||
|
var selectedBoolean = new BindableBoolean(preselected.contains(x));
|
||||||
|
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||||
|
if (selectedBoolean.get()) preselected.add(x);
|
||||||
|
else preselected.remove(x);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ListModel()
|
||||||
|
.setSelected(selectedBoolean)
|
||||||
|
.setEnabled(new BindableBoolean(available.contains(x)))
|
||||||
|
.setOriginalModel(x);
|
||||||
|
})
|
||||||
|
.sorted(c)
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAll() {
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setAll(List<String> all) {
|
||||||
|
this.all = all;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailable() {
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setAvailable(List<String> available) {
|
||||||
|
this.available = available;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreselected() {
|
||||||
|
return preselected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setPreselected(List<String> preselected) {
|
||||||
|
this.preselected = preselected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setHidden(List<String> hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private String originalModel;
|
||||||
|
|
||||||
|
public BindableBoolean getSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setSelected(BindableBoolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setEnabled(BindableBoolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(String originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BR;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterPosizioneBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterPosizioneLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterPosizioneBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> all;
|
||||||
|
private List<String> available;
|
||||||
|
private List<String> preselected = new ArrayList<>();
|
||||||
|
private List<String> hidden = new ArrayList<>();
|
||||||
|
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private RunnableArgs<List<String>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_posizione, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||||
|
hidden = Stream.of(all)
|
||||||
|
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||||
|
!x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_posizione__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
ComparatorCompat<ListModel> c =
|
||||||
|
ComparatorCompat
|
||||||
|
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) ->
|
||||||
|
UtilityString.isNull(y.getOriginalModel(), "000000").compareToIgnoreCase(UtilityString.isNull(x.getOriginalModel(), "000000"))))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
|
||||||
|
listModel.setValue(Stream.of(getAll())
|
||||||
|
.filter(x -> !hidden.contains(x))
|
||||||
|
.map(x -> {
|
||||||
|
var selectedBoolean = new BindableBoolean(preselected.contains(x));
|
||||||
|
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||||
|
if (selectedBoolean.get()) preselected.add(x);
|
||||||
|
else preselected.remove(x);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ListModel()
|
||||||
|
.setSelected(selectedBoolean)
|
||||||
|
.setEnabled(new BindableBoolean(available.contains(x)))
|
||||||
|
.setOriginalModel(x);
|
||||||
|
})
|
||||||
|
.sorted(c)
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAll() {
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setAll(List<String> all) {
|
||||||
|
this.all = all;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailable() {
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setAvailable(List<String> available) {
|
||||||
|
this.available = available;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreselected() {
|
||||||
|
return preselected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setPreselected(List<String> preselected) {
|
||||||
|
this.preselected = preselected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setHidden(List<String> hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private String originalModel;
|
||||||
|
|
||||||
|
public BindableBoolean getSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setSelected(BindableBoolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setEnabled(BindableBoolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(String originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -114,7 +114,7 @@ public class AccettazioneListAdapter extends SectionedRecyclerViewAdapter<Accett
|
|||||||
|
|
||||||
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
||||||
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
||||||
holder.mBinding.badge1.setBackground(ResourcesCompat.getDrawable(mContext.getResources(), !pickingObjectDTO.isActive() ? R.drawable.badge_gray_round_corner : R.drawable.badge1_round_corner, null));
|
holder.mBinding.badge1.setBackground(ResourcesCompat.getDrawable(mContext.getResources(), !pickingObjectDTO.isActive() ? R.drawable.badge_round_corner : R.drawable.badge1_round_corner, null));
|
||||||
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingObjectDTO.isActive() ? R.color.gray_600 : R.color.green_700, null));
|
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingObjectDTO.isActive() ? R.color.gray_600 : R.color.green_700, null));
|
||||||
|
|
||||||
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
||||||
@@ -125,6 +125,9 @@ public class AccettazioneListAdapter extends SectionedRecyclerViewAdapter<Accett
|
|||||||
holder.mBinding.badge2.setText(pickingObjectDTO.getBadge2());
|
holder.mBinding.badge2.setText(pickingObjectDTO.getBadge2());
|
||||||
holder.mBinding.badge2.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getBadge2()) ? View.GONE : View.VISIBLE);
|
holder.mBinding.badge2.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getBadge2()) ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
|
holder.mBinding.badge3.setText(pickingObjectDTO.getPosizione());
|
||||||
|
holder.mBinding.badge3Layout.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getPosizione()) ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
|
|
||||||
holder.mBinding.qtaEvasa.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaEvasa()));
|
holder.mBinding.qtaEvasa.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaEvasa()));
|
||||||
holder.mBinding.qtaTot.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaTot()));
|
holder.mBinding.qtaTot.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaTot()));
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ public class AccettazioneListModel implements Cloneable {
|
|||||||
private BigDecimal secQtaTot;
|
private BigDecimal secQtaTot;
|
||||||
private String secUntMis;
|
private String secUntMis;
|
||||||
|
|
||||||
|
private String posizione;
|
||||||
|
|
||||||
private boolean active;
|
private boolean active;
|
||||||
|
|
||||||
private PickingObjectDTO mOriginalModel;
|
private PickingObjectDTO mOriginalModel;
|
||||||
@@ -154,6 +156,15 @@ public class AccettazioneListModel implements Cloneable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccettazioneListModel setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
|
||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniViewModel;
|
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||||
|
|
||||||
|
|
||||||
@@ -94,11 +91,11 @@ public class DialogSelectDocInfoViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getAvailableCodDtips() {
|
public List<String> getAvailableCodDtips() {
|
||||||
return Stream.of(mDocInterniSetupDTO.getTipiDoc()).map(TipiDocDTO::getLabel).toList();
|
return mDocInterniSetupDTO.getTipiDoc() != null ? Stream.of(mDocInterniSetupDTO.getTipiDoc()).map(TipiDocDTO::getLabel).toList() : new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getAvailableCodMgrps() {
|
public List<String> getAvailableCodMgrps() {
|
||||||
return Stream.of(mDocInterniSetupDTO.getGruppiArt()).map(GruppiArticoloDTO::getLabel).toList();
|
return mDocInterniSetupDTO.getGruppiArt() != null ? Stream.of(mDocInterniSetupDTO.getGruppiArt()).map(GruppiArticoloDTO::getLabel).toList() : new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getAvailableFornitori() {
|
public List<String> getAvailableFornitori() {
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ public class ColloDTO {
|
|||||||
private String segno;
|
private String segno;
|
||||||
private String idDisp;
|
private String idDisp;
|
||||||
private String codDtip;
|
private String codDtip;
|
||||||
|
private String codAnag;
|
||||||
|
private String codVdes;
|
||||||
|
private Integer numDoc;
|
||||||
|
private Date dataDoc;
|
||||||
private List<ArtDTO> artRows = new ArrayList<>();
|
private List<ArtDTO> artRows = new ArrayList<>();
|
||||||
private RifOrd rifOrd;
|
private RifOrd rifOrd;
|
||||||
|
|
||||||
@@ -88,6 +92,42 @@ public class ColloDTO {
|
|||||||
return rifOrd;
|
return rifOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColloDTO setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumDoc() {
|
||||||
|
return numDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColloDTO setNumDoc(Integer numDoc) {
|
||||||
|
this.numDoc = numDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataDoc() {
|
||||||
|
return dataDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColloDTO setDataDoc(Date dataDoc) {
|
||||||
|
this.dataDoc = dataDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVdes() {
|
||||||
|
return codVdes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColloDTO setCodVdes(String codVdes) {
|
||||||
|
this.codVdes = codVdes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void setRifOrd(RifOrd rifOrd) {
|
public void setRifOrd(RifOrd rifOrd) {
|
||||||
this.rifOrd = rifOrd;
|
this.rifOrd = rifOrd;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQua
|
|||||||
|
|
||||||
public class DocInterniEditFormActivity extends BaseActivity implements DocInterniEditFormViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
public class DocInterniEditFormActivity extends BaseActivity implements DocInterniEditFormViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
||||||
|
|
||||||
private static String DATA_KEY_DOCUMENT = "document";
|
private static final String DATA_KEY_DOCUMENT = "document";
|
||||||
private static String DATA_KEY_PRODUCTS_LIST = "productsList";
|
private static final String DATA_KEY_PRODUCTS_LIST = "productsList";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
MtbColrRepository documentRowsRepository;
|
MtbColrRepository documentRowsRepository;
|
||||||
@@ -101,22 +101,22 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
SqlMtbColt document = this.viewModel.getDocument();
|
SqlMtbColt document = this.viewModel.getDocument();
|
||||||
this.codDtip.set(document.getCodDtipProvv());
|
this.codDtip.set(document.getCodDtipProvv());
|
||||||
this.note.set(document.getAnnotazioni());
|
this.note.set(document.getAnnotazioni());
|
||||||
if(document.getCodMgrp() != null){
|
if (document.getCodMgrp() != null) {
|
||||||
this.codMgrp.set(document.getCodMgrp());
|
this.codMgrp.set(document.getCodMgrp());
|
||||||
}else{
|
} else {
|
||||||
binding.mtbGrupContainer.setVisibility(View.GONE);
|
binding.mtbGrupContainer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
if (document.getCodAnag() != null){
|
if (document.getCodAnag() != null) {
|
||||||
this.codAnag.set(document.getCodAnag() + (document.getCodVdes()!=null?" - "+document.getCodVdes():""));
|
this.codAnag.set(document.getCodAnag() + (document.getCodVdes() != null ? " - " + document.getCodVdes() : ""));
|
||||||
}else{
|
} else {
|
||||||
this.binding.supplierLayout.setVisibility(View.GONE);
|
this.binding.supplierLayout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.documentHeader.set(String.format(this.getString(R.string.doc_interni_doc_header), document.getId(), document.getCodDtipProvv()));
|
this.documentHeader.set(String.format(this.getString(R.string.doc_interni_doc_header), document.getId(), document.getCodDtipProvv()));
|
||||||
|
|
||||||
if (document.getNumDoc() != null && document.getDataDoc() != null){
|
if (document.getNumDoc() != null && document.getDataDoc() != null) {
|
||||||
this.documentRifHeader.set(String.format(this.getString(R.string.doc_testata), document.getNumDoc().toString(), document.getDataDoc()));
|
this.documentRifHeader.set(String.format(this.getString(R.string.doc_testata), document.getNumDoc().toString(), document.getDataDoc()));
|
||||||
}else{
|
} else {
|
||||||
this.binding.docRifLayout.setVisibility(View.GONE);
|
this.binding.docRifLayout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,6 +138,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
this.viewModel.setProductsList(productList);
|
this.viewModel.setProductsList(productList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
this.viewModel.docRows.observe(this, this::refreshList);
|
this.viewModel.docRows.observe(this, this::refreshList);
|
||||||
DocumentRowsListAdapter listAdapter = new DocumentRowsListAdapter(this, documentRowsObservableList);
|
DocumentRowsListAdapter listAdapter = new DocumentRowsListAdapter(this, documentRowsObservableList);
|
||||||
@@ -156,14 +157,13 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void closeEdit() {
|
public void closeEdit() {
|
||||||
this.onBackPressed();
|
this.onBackPressed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void manualSearch() {
|
public void manualSearch() {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre/codice articolo da cercare", null, this.viewModel::onSearch, BarcodeManager::enable).show();
|
DialogSimpleInputHelper.makeInputDialog(this, "Ricerca articolo", null, "Cod articolo / Barcode", this.viewModel::onSearch, BarcodeManager::enable).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
}
|
}
|
||||||
|
|
||||||
mBarcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
mBarcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
.setOnScanSuccessfull(this.viewModel::onScanSuccessful)
|
.setOnScanSuccessfull(this.viewModel::processBarcode)
|
||||||
.setOnScanFailed(this::onError));
|
.setOnScanFailed(this::onError));
|
||||||
this.viewModel.fetchDocumentRows();
|
this.viewModel.fetchDocumentRows();
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
mtbAart.setQtaCnf(BigDecimal.valueOf(row.getQtaCnf()));
|
mtbAart.setQtaCnf(BigDecimal.valueOf(row.getQtaCnf()));
|
||||||
mtbAart.setDescrizione(row.getDescrizione());
|
mtbAart.setDescrizione(row.getDescrizione());
|
||||||
mtbAart.setDescrizioneEstesa(row.getDescrizione());
|
mtbAart.setDescrizioneEstesa(row.getDescrizione());
|
||||||
mtbAart.setFlagTracciabilita(flagTracciabilita? "S" : "N");
|
mtbAart.setFlagTracciabilita(flagTracciabilita ? "S" : "N");
|
||||||
mtbAart.setUntMis(row.getUntMis());
|
mtbAart.setUntMis(row.getUntMis());
|
||||||
|
|
||||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||||
@@ -226,6 +226,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
.setInitialQtaCnf(BigDecimal.valueOf(row.getQtaCnf()))
|
.setInitialQtaCnf(BigDecimal.valueOf(row.getQtaCnf()))
|
||||||
.setInitialQtaTot(BigDecimal.valueOf(row.getQtaCol()))
|
.setInitialQtaTot(BigDecimal.valueOf(row.getQtaCol()))
|
||||||
.setNote(row.getNote())
|
.setNote(row.getNote())
|
||||||
|
.setSaveOnImeDone(true)
|
||||||
.setPartitaMag(row.getPartitaMag())
|
.setPartitaMag(row.getPartitaMag())
|
||||||
.setDataScad(row.getDataScad())
|
.setDataScad(row.getDataScad())
|
||||||
.setCanOverflowOrderQuantity(false)
|
.setCanOverflowOrderQuantity(false)
|
||||||
@@ -236,7 +237,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
.setSuggestPartitaMag(data -> {
|
.setSuggestPartitaMag(data -> {
|
||||||
Date dataScad = data.getDataScad();
|
Date dataScad = data.getDataScad();
|
||||||
String partitaMag = null;
|
String partitaMag = null;
|
||||||
if (dataScad != null){
|
if (dataScad != null) {
|
||||||
partitaMag = new SimpleDateFormat("yyyymmdd").format(dataScad);
|
partitaMag = new SimpleDateFormat("yyyymmdd").format(dataScad);
|
||||||
}
|
}
|
||||||
return partitaMag;
|
return partitaMag;
|
||||||
@@ -271,7 +272,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
@Override
|
@Override
|
||||||
public void onMtbColrEdit(MtbColr mtbColr) {
|
public void onMtbColrEdit(MtbColr mtbColr) {
|
||||||
GrigliaAcquistiChildDTO articolo = viewModel.getArticoloByCodMart(mtbColr.getCodMart());
|
GrigliaAcquistiChildDTO articolo = viewModel.getArticoloByCodMart(mtbColr.getCodMart());
|
||||||
this.viewModel.editRow(entityToSql(mtbColr),articolo.getFlagTracciabilita().equalsIgnoreCase("S"));
|
this.viewModel.editRow(entityToSql(mtbColr), articolo.getFlagTracciabilita().equalsIgnoreCase("S"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import androidx.lifecycle.MutableLiveData;
|
|||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -68,8 +70,8 @@ public class DocInterniEditFormViewModel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void editRow(SqlMtbColr row,boolean flagTracciabilita) {
|
public void editRow(SqlMtbColr row, boolean flagTracciabilita) {
|
||||||
this.listener.onEditRowRequest(row,flagTracciabilita);
|
this.listener.onEditRowRequest(row, flagTracciabilita);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer getNextIdRiga() {
|
private Integer getNextIdRiga() {
|
||||||
@@ -91,7 +93,8 @@ public class DocInterniEditFormViewModel {
|
|||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
public void deleteDocument() {
|
|
||||||
|
public void deleteDocument() {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
docInterniRESTConsumer.saveDoc(this.getSaveDto(), obj -> {
|
docInterniRESTConsumer.saveDoc(this.getSaveDto(), obj -> {
|
||||||
SqlMtbColt document = this.getDocument();
|
SqlMtbColt document = this.getDocument();
|
||||||
@@ -116,7 +119,8 @@ public void deleteDocument() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SqlMtbColr row = this.getRowForArticolo(articolo);
|
SqlMtbColr row = this.getRowForArticolo(articolo);
|
||||||
this.editRow(row,articolo.getFlagTracciabilita().equalsIgnoreCase("S"));
|
this.sendOnLoadingEnded();
|
||||||
|
this.editRow(row, articolo.getFlagTracciabilita().equalsIgnoreCase("S"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +151,12 @@ public void deleteDocument() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private GrigliaAcquistiChildDTO searchArticolo(String filter) {
|
private GrigliaAcquistiChildDTO searchArticolo(String filter) {
|
||||||
return Stream.of(this.productsList).filter(dto -> dto.getCodMart().equalsIgnoreCase(filter) || dto.getBarcode().equalsIgnoreCase(filter)).findFirstOrElse(null);
|
return Stream.of(this.productsList).filter(dto ->
|
||||||
|
filter.equalsIgnoreCase(dto.getCodMart())
|
||||||
|
|| filter.equalsIgnoreCase(dto.getBarcode())
|
||||||
|
|| StringUtils.leftPad(filter, 13, '0').equalsIgnoreCase(dto.getCodMart())
|
||||||
|
|| StringUtils.leftPad(filter, 13, '0').equalsIgnoreCase(dto.getBarcode())
|
||||||
|
).findFirstOrElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SaveDTO getSaveDto() {
|
private SaveDTO getSaveDto() {
|
||||||
@@ -168,6 +177,10 @@ public void deleteDocument() {
|
|||||||
collo.setCreatedDate(UtilityDate.formatDate(document.getDataCollo(), UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
|
collo.setCreatedDate(UtilityDate.formatDate(document.getDataCollo(), UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
|
||||||
collo.setAnnotazioni(document.getAnnotazioni());
|
collo.setAnnotazioni(document.getAnnotazioni());
|
||||||
collo.setSegno(saveDTO.getSegno());
|
collo.setSegno(saveDTO.getSegno());
|
||||||
|
collo.setDataDoc(document.getDataDoc());
|
||||||
|
collo.setNumDoc(document.getNumDoc());
|
||||||
|
collo.setCodAnag(document.getCodAnag());
|
||||||
|
collo.setCodVdes(document.getCodVdes());
|
||||||
|
|
||||||
for (SqlMtbColr row : this.getDocumentRows()) {
|
for (SqlMtbColr row : this.getDocumentRows()) {
|
||||||
ArtDTO artDto = new ArtDTO();
|
ArtDTO artDto = new ArtDTO();
|
||||||
@@ -209,7 +222,7 @@ public void deleteDocument() {
|
|||||||
this.productsList = productsList;
|
this.productsList = productsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onScanSuccessful(BarcodeScanDTO dto) {
|
public void processBarcode(BarcodeScanDTO dto) {
|
||||||
String code = dto.getStringValue();
|
String code = dto.getStringValue();
|
||||||
this.onSearch(code);
|
this.onSearch(code);
|
||||||
}
|
}
|
||||||
@@ -246,7 +259,7 @@ public void deleteDocument() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public GrigliaAcquistiChildDTO getArticoloByCodMart(String codMart) {
|
public GrigliaAcquistiChildDTO getArticoloByCodMart(String codMart) {
|
||||||
return Stream.of(productsList).filter(prod->prod.codMart.equalsIgnoreCase(codMart)).findFirstOrElse(null);
|
return Stream.of(productsList).filter(prod -> prod.codMart.equalsIgnoreCase(codMart)).findFirstOrElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Listener extends ILoadingListener {
|
public interface Listener extends ILoadingListener {
|
||||||
@@ -255,7 +268,7 @@ public void deleteDocument() {
|
|||||||
|
|
||||||
void onRowsChanged(List<SqlMtbColr> rows);
|
void onRowsChanged(List<SqlMtbColr> rows);
|
||||||
|
|
||||||
void onEditRowRequest(SqlMtbColr row,boolean flagTracciabilita);
|
void onEditRowRequest(SqlMtbColr row, boolean flagTracciabilita);
|
||||||
|
|
||||||
void onDocumentHoldRequest();
|
void onDocumentHoldRequest();
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,48 @@
|
|||||||
package it.integry.integrywmsnative.gest.login;
|
package it.integry.integrywmsnative.gest.login;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.SplashActivity;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityWindow;
|
import it.integry.integrywmsnative.core.utility.UtilityWindow;
|
||||||
import it.integry.integrywmsnative.databinding.ActivityLoginBinding;
|
import it.integry.integrywmsnative.databinding.ActivityLoginBinding;
|
||||||
import it.integry.integrywmsnative.gest.login.viewmodel.LoginViewModel;
|
import it.integry.integrywmsnative.gest.login.viewmodel.LoginViewModel;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class LoginActivity extends BaseActivity {
|
public class LoginActivity extends BaseActivity implements LoginViewModel.Listener {
|
||||||
|
|
||||||
|
ActivityLoginBinding mBindings;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
LoginViewModel mViewmodel;
|
||||||
|
|
||||||
|
|
||||||
|
public BindableString username = new BindableString();
|
||||||
|
public BindableString password = new BindableString();
|
||||||
|
public BindableString codAzienda = new BindableString();
|
||||||
|
|
||||||
|
public BindableBoolean customSettingsCheckboxEnabled = new BindableBoolean();
|
||||||
|
public BindableBoolean customSettingsCheckboxChecked = new BindableBoolean();
|
||||||
|
|
||||||
|
public BindableBoolean loginButtonEnabled = new BindableBoolean();
|
||||||
|
|
||||||
|
|
||||||
|
public BindableString usernameError = new BindableString();
|
||||||
|
public BindableString passwordError = new BindableString();
|
||||||
|
public BindableString codAziendaError = new BindableString();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -18,9 +50,44 @@ public class LoginActivity extends BaseActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
UtilityWindow.maximizeToFullScreen(this);
|
UtilityWindow.maximizeToFullScreen(this);
|
||||||
|
|
||||||
ActivityLoginBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_login);
|
mBindings = DataBindingUtil.setContentView(this, R.layout.activity_login);
|
||||||
LoginViewModel loginViewModel = new LoginViewModel(this);
|
mBindings.setView(this);
|
||||||
binding.setLoginViewModel(loginViewModel);
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.loginActivityComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
mViewmodel.setListener(this);
|
||||||
|
|
||||||
|
loginButtonEnabled.set(true);
|
||||||
|
|
||||||
|
codAzienda.set(SettingsManager.i().getServer().getCodAzienda());
|
||||||
|
|
||||||
|
customSettingsCheckboxChecked.set(SettingsManager.i().getServer().getHost() == null);
|
||||||
|
customSettingsCheckboxEnabled.set(SettingsManager.i().getServer().getHost() != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean validate(String username, String codAzienda) {
|
||||||
|
if (username.isEmpty() || username.length() < 3) {
|
||||||
|
usernameError.set(getText(R.string.username_error_not_valid).toString());
|
||||||
|
return false;
|
||||||
|
} else usernameError.set(null);
|
||||||
|
|
||||||
|
if (codAzienda.isEmpty() || codAzienda.length() < 3) {
|
||||||
|
codAziendaError.set(getText(R.string.server_cod_azienda_error_not_valid).toString());
|
||||||
|
return false;
|
||||||
|
} else codAziendaError.set(null);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void login() {
|
||||||
|
if (validate(username.get(), codAzienda.get())) {
|
||||||
|
loginButtonEnabled.set(false);
|
||||||
|
mViewmodel.login(codAzienda.get(), username.get(), password.get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -29,4 +96,65 @@ public class LoginActivity extends BaseActivity {
|
|||||||
// disable going back to the MainActivity
|
// disable going back to the MainActivity
|
||||||
moveTaskToBack(true);
|
moveTaskToBack(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoginCompleted(String host, int port, String fullName, List<String> availableProfiles) {
|
||||||
|
|
||||||
|
this.onLoadingEnded();
|
||||||
|
runOnUiThread(() -> DialogSimpleMessageView.makeSuccessDialog(
|
||||||
|
"Benvenuto",
|
||||||
|
Html.fromHtml("Ciao <b>" + fullName + "</b>, la Integry le augura di svolgere al meglio il suo lavoro"),
|
||||||
|
null,
|
||||||
|
() -> showProfileDBSelectionDialog(host, port, availableProfiles))
|
||||||
|
.show(getSupportFragmentManager(), "tag"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
super.onError(ex);
|
||||||
|
loginButtonEnabled.set(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showProfileDBSelectionDialog(final String host, final int port, final List<String> availableProfiles) {
|
||||||
|
Runnable onComplete = () -> {
|
||||||
|
SettingsManager.update();
|
||||||
|
|
||||||
|
startSplashActivity();
|
||||||
|
};
|
||||||
|
|
||||||
|
loginButtonEnabled.set(true);
|
||||||
|
|
||||||
|
if (availableProfiles != null && availableProfiles.size() == 1) {
|
||||||
|
SettingsManager.i().getUserSession().setProfileDB(availableProfiles.get(0));
|
||||||
|
|
||||||
|
mViewmodel.loadDepo(codAzienda.get(), host, port, username.get(), password.get(), onComplete);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// setup the alert builder
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
builder.setTitle(R.string.action_choose_profile_db);
|
||||||
|
|
||||||
|
// add a list
|
||||||
|
String[] profiles = new String[availableProfiles.size()];
|
||||||
|
profiles = availableProfiles
|
||||||
|
.toArray(profiles);
|
||||||
|
|
||||||
|
builder.setItems(profiles, (dialog, which) -> {
|
||||||
|
SettingsManager.i().getUserSession().setProfileDB(availableProfiles.get(which));
|
||||||
|
|
||||||
|
mViewmodel.loadDepo(codAzienda.get(), host, port, username.get(), password.get(), onComplete);
|
||||||
|
});
|
||||||
|
|
||||||
|
// create and show the alert dialog
|
||||||
|
AlertDialog dialog = builder.create();
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startSplashActivity() {
|
||||||
|
finish();
|
||||||
|
SplashActivity.startActivity(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.login;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface LoginComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
LoginComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(LoginActivity loginActivity);
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.login;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.login.rest.LoginRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.login.viewmodel.LoginViewModel;
|
||||||
|
|
||||||
|
@Module(subcomponents = LoginComponent.class)
|
||||||
|
public class LoginModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
LoginRESTConsumer provideLoginRESTConsumer() {
|
||||||
|
return new LoginRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
LoginViewModel providesSpedizioneViewModel(SystemRESTConsumer systemRESTConsumer, LoginRESTConsumer loginRESTConsumer) {
|
||||||
|
return new LoginViewModel(systemRESTConsumer, loginRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.gest.login.core;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
|
||||||
import it.integry.integrywmsnative.gest.login.dto.LoginAziendaDTO;
|
|
||||||
import it.integry.integrywmsnative.gest.login.dto.LoginDTO;
|
|
||||||
import it.integry.integrywmsnative.gest.login.rest.LoginRESTConsumerService;
|
|
||||||
import retrofit2.Call;
|
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
|
||||||
|
|
||||||
public class LoginHelper {
|
|
||||||
|
|
||||||
private Context mContext;
|
|
||||||
|
|
||||||
private String mCodAzienda;
|
|
||||||
private String mUsername;
|
|
||||||
private String mPassword;
|
|
||||||
|
|
||||||
public LoginHelper(Context context, String codAzienda, String username, String password){
|
|
||||||
this.mContext = context;
|
|
||||||
|
|
||||||
this.mCodAzienda = codAzienda;
|
|
||||||
this.mUsername = username;
|
|
||||||
this.mPassword = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void retrieveServerData(final ISimpleOperationCallback<LoginAziendaDTO> callback){
|
|
||||||
|
|
||||||
String host = CommonConst.Login.Azienda.host;
|
|
||||||
int port = CommonConst.Login.Azienda.port;
|
|
||||||
|
|
||||||
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, host, port, false, true);
|
|
||||||
service.loginAzienda(mCodAzienda).enqueue(new Callback<ServiceRESTResponse<LoginAziendaDTO>>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<LoginAziendaDTO>> call, Response<ServiceRESTResponse<LoginAziendaDTO>> response) {
|
|
||||||
if(response.isSuccessful()) {
|
|
||||||
|
|
||||||
if(response.body() != null) {
|
|
||||||
if(response.body().getEsito() == EsitoType.OK) {
|
|
||||||
callback.onSuccess(response.body().getDto());
|
|
||||||
} else {
|
|
||||||
Log.e("LoginAzienda", response.body().getErrorMessage());
|
|
||||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("LoginAzienda", response.message());
|
|
||||||
callback.onFailed(new Exception(response.message()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("LoginAzienda", "Status " + response.code() + ": " + response.message());
|
|
||||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Call<ServiceRESTResponse<LoginAziendaDTO>> call, Throwable t) {
|
|
||||||
Log.e("LoginAzienda", t.toString());
|
|
||||||
callback.onFailed(new Exception(t));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void doLogin(String host, int port, final ISimpleOperationCallback<LoginDTO> callback){
|
|
||||||
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, host, port, false);
|
|
||||||
service.login(mUsername, mPassword).enqueue(new Callback<ServiceRESTResponse<LoginDTO>>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<LoginDTO>> call, Response<ServiceRESTResponse<LoginDTO>> response) {
|
|
||||||
|
|
||||||
if(response.isSuccessful()) {
|
|
||||||
|
|
||||||
if(response.body() != null) {
|
|
||||||
if(response.body().getEsito() == EsitoType.OK) {
|
|
||||||
callback.onSuccess(response.body().getDto());
|
|
||||||
} else {
|
|
||||||
Log.e("Login", response.body().getErrorMessage());
|
|
||||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("Login", response.message());
|
|
||||||
callback.onFailed(new Exception(response.message()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("Login", "Status " + response.code() + ": " + response.message());
|
|
||||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Call<ServiceRESTResponse<LoginDTO>> call, final Throwable t) {
|
|
||||||
|
|
||||||
Log.e("Login", t.toString());
|
|
||||||
callback.onFailed(new Exception(t));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -2,10 +2,54 @@ package it.integry.integrywmsnative.gest.login.dto;
|
|||||||
|
|
||||||
public class LoginAziendaDTO {
|
public class LoginAziendaDTO {
|
||||||
|
|
||||||
public String profileDb;
|
private String profileDb;
|
||||||
public String endpointRestApi;
|
private String endpointRestApi;
|
||||||
public String phpApi;
|
private String phpApi;
|
||||||
public String repoPhoto;
|
private String repoPhoto;
|
||||||
public String endpointPvm;
|
private String endpointPvm;
|
||||||
|
|
||||||
|
public String getProfileDb() {
|
||||||
|
return profileDb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginAziendaDTO setProfileDb(String profileDb) {
|
||||||
|
this.profileDb = profileDb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndpointRestApi() {
|
||||||
|
return endpointRestApi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginAziendaDTO setEndpointRestApi(String endpointRestApi) {
|
||||||
|
this.endpointRestApi = endpointRestApi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhpApi() {
|
||||||
|
return phpApi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginAziendaDTO setPhpApi(String phpApi) {
|
||||||
|
this.phpApi = phpApi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRepoPhoto() {
|
||||||
|
return repoPhoto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginAziendaDTO setRepoPhoto(String repoPhoto) {
|
||||||
|
this.repoPhoto = repoPhoto;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndpointPvm() {
|
||||||
|
return endpointPvm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginAziendaDTO setEndpointPvm(String endpointPvm) {
|
||||||
|
this.endpointPvm = endpointPvm;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,24 @@ import java.util.List;
|
|||||||
|
|
||||||
public class LoginDTO {
|
public class LoginDTO {
|
||||||
|
|
||||||
public String full_name;
|
private String full_name;
|
||||||
public List<String> availableProfiles;
|
private List<String> availableProfiles;
|
||||||
|
|
||||||
|
public String getFull_name() {
|
||||||
|
return full_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginDTO setFull_name(String full_name) {
|
||||||
|
this.full_name = full_name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableProfiles() {
|
||||||
|
return availableProfiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginDTO setAvailableProfiles(List<String> availableProfiles) {
|
||||||
|
this.availableProfiles = availableProfiles;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.login.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class InvalidServerCodAziendaException extends Exception {
|
||||||
|
|
||||||
|
public InvalidServerCodAziendaException(String codAzienda, Throwable cause) {
|
||||||
|
super(String.format(UtilityResources.getString(R.string.server_cod_azienda_not_valid), codAzienda), cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.login.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class InvalidUserDepositException extends Exception {
|
||||||
|
|
||||||
|
public InvalidUserDepositException() {
|
||||||
|
super(UtilityResources.getString(R.string.no_codmdep_available));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.login.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class InvalidUsernameException extends Exception {
|
||||||
|
|
||||||
|
public InvalidUsernameException() {
|
||||||
|
super(UtilityResources.getString(R.string.username_error_not_valid));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.login.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class ServerNotReachableException extends Exception {
|
||||||
|
|
||||||
|
public ServerNotReachableException(String host, int port, Throwable cause) {
|
||||||
|
super(String.format(UtilityResources.getString(R.string.server_not_reachable), host, port), cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.login.rest;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.login.dto.LoginAziendaDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.login.dto.LoginDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class LoginRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
|
||||||
|
public void retrieveServerData(String codAzienda, RunnableArgs<LoginAziendaDTO> onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
|
||||||
|
String host = CommonConst.Login.Azienda.host;
|
||||||
|
int port = CommonConst.Login.Azienda.port;
|
||||||
|
|
||||||
|
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, host, port, false, true);
|
||||||
|
service.loginAzienda(codAzienda).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<LoginAziendaDTO>> call, Response<ServiceRESTResponse<LoginAziendaDTO>> response) {
|
||||||
|
analyzeAnswer(response, "LoginAzienda", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<LoginAziendaDTO>> call, Throwable t) {
|
||||||
|
Log.e("LoginAzienda", t.toString());
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void authenticate(String host, int port, String username, String password, RunnableArgs<LoginDTO> onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, host, port, false);
|
||||||
|
service.login(username, password).enqueue(new Callback<>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<LoginDTO>> call, Response<ServiceRESTResponse<LoginDTO>> response) {
|
||||||
|
analyzeAnswer(response, "Login", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<LoginDTO>> call, final Throwable t) {
|
||||||
|
Log.e("Login", t.toString());
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,167 +1,103 @@
|
|||||||
package it.integry.integrywmsnative.gest.login.viewmodel;
|
package it.integry.integrywmsnative.gest.login.viewmodel;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import com.annimon.stream.Stream;
|
||||||
import android.content.Intent;
|
|
||||||
import android.text.Html;
|
|
||||||
import android.text.SpannableString;
|
|
||||||
import android.text.Spanned;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import javax.inject.Inject;
|
||||||
import it.integry.integrywmsnative.SplashActivity;
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
import it.integry.integrywmsnative.core.di.BindableString;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityServer;
|
import it.integry.integrywmsnative.core.utility.UtilityServer;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
import it.integry.integrywmsnative.gest.login.exception.InvalidServerCodAziendaException;
|
||||||
import it.integry.integrywmsnative.gest.login.core.LoginHelper;
|
import it.integry.integrywmsnative.gest.login.exception.InvalidUserDepositException;
|
||||||
import it.integry.integrywmsnative.gest.login.dto.LoginAziendaDTO;
|
import it.integry.integrywmsnative.gest.login.exception.ServerNotReachableException;
|
||||||
import it.integry.integrywmsnative.gest.login.dto.LoginDTO;
|
import it.integry.integrywmsnative.gest.login.rest.LoginRESTConsumer;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
|
||||||
|
|
||||||
public class LoginViewModel {
|
public class LoginViewModel {
|
||||||
|
|
||||||
public BindableString username = new BindableString();
|
|
||||||
public BindableString password = new BindableString();
|
|
||||||
public BindableString codAzienda = new BindableString();
|
|
||||||
|
|
||||||
public BindableBoolean customSettingsCheckboxEnabled = new BindableBoolean();
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
public BindableBoolean customSettingsCheckboxChecked = new BindableBoolean();
|
private final LoginRESTConsumer mLoginRESTConsumer;
|
||||||
|
|
||||||
public BindableBoolean loginButtonEnabled = new BindableBoolean();
|
private Listener mListener;
|
||||||
|
|
||||||
|
@Inject
|
||||||
public BindableString usernameError = new BindableString();
|
public LoginViewModel(SystemRESTConsumer systemRESTConsumer, LoginRESTConsumer loginRESTConsumer) {
|
||||||
public BindableString passwordError = new BindableString();
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
public BindableString codAziendaError = new BindableString();
|
this.mLoginRESTConsumer = loginRESTConsumer;
|
||||||
|
|
||||||
|
|
||||||
private LoginActivity mActivity;
|
|
||||||
|
|
||||||
private Dialog mProgress;
|
|
||||||
|
|
||||||
public LoginViewModel(LoginActivity activity) {
|
|
||||||
this.mActivity = activity;
|
|
||||||
|
|
||||||
loginButtonEnabled.set(true);
|
|
||||||
|
|
||||||
codAzienda.set(SettingsManager.i().getServer().getCodAzienda());
|
|
||||||
|
|
||||||
customSettingsCheckboxChecked.set(SettingsManager.i().getServer().getHost() == null);
|
|
||||||
customSettingsCheckboxEnabled.set(SettingsManager.i().getServer().getHost() != null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean validate() {
|
public void login(String codAzienda, String username, String password) {
|
||||||
if (username.isEmpty() || username.get().length() < 3) {
|
this.sendOnLoadingStarted();
|
||||||
usernameError.set(mActivity.getText(R.string.username_error_not_valid).toString());
|
|
||||||
return false;
|
|
||||||
} else usernameError.set(null);
|
|
||||||
|
|
||||||
if (codAzienda.isEmpty() || codAzienda.get().length() < 3) {
|
mLoginRESTConsumer.retrieveServerData(codAzienda, value -> {
|
||||||
codAziendaError.set(mActivity.getText(R.string.server_cod_azienda_not_valid).toString());
|
|
||||||
return false;
|
|
||||||
} else codAziendaError.set(null);
|
|
||||||
|
|
||||||
return true;
|
final String serverEndpoint = value.getEndpointRestApi();
|
||||||
}
|
|
||||||
|
|
||||||
|
URL u;
|
||||||
|
try {
|
||||||
|
u = new URL(serverEndpoint);
|
||||||
|
} catch (final MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
this.sendError(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public void login(boolean areValidData) {
|
final String host = u.getHost();
|
||||||
if (areValidData) {
|
final int port = u.getPort();
|
||||||
loginButtonEnabled.set(false);
|
|
||||||
|
|
||||||
mProgress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
UtilityServer.isEmsApiAvailable(host, port, value1 -> {
|
||||||
|
|
||||||
final LoginHelper loginHelper = new LoginHelper(mActivity, codAzienda.get(), username.get(), password.get());
|
if (value1) { //Is online
|
||||||
|
mLoginRESTConsumer.authenticate(host, port, username, password, loginDTO -> {
|
||||||
|
|
||||||
loginHelper.retrieveServerData(new ISimpleOperationCallback<LoginAziendaDTO>() {
|
SettingsManager.iDB().setAvailableProfiles(loginDTO.getAvailableProfiles());
|
||||||
|
|
||||||
@Override
|
SettingsManager.i().createUserSession();
|
||||||
public void onSuccess(LoginAziendaDTO value) {
|
SettingsManager.i().getUser().setFullname(!UtilityString.isNullOrEmpty(loginDTO.getFull_name()) ? loginDTO.getFull_name() : username);
|
||||||
|
|
||||||
final String serverEndpoint = value.endpointRestApi;
|
List<String> availableProfiles = null;
|
||||||
|
if(loginDTO.getAvailableProfiles() != null && !loginDTO.getAvailableProfiles().isEmpty()) {
|
||||||
URL u;
|
availableProfiles = Stream.of(loginDTO.getAvailableProfiles())
|
||||||
try {
|
.sorted()
|
||||||
u = new URL(serverEndpoint);
|
.toList();
|
||||||
} catch (final MalformedURLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
onLoginFailed(new SpannableString(e.toString()));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final String host = u.getHost();
|
|
||||||
final int port = u.getPort();
|
|
||||||
|
|
||||||
UtilityServer.isEmsApiAvailable(host, port, value1 -> {
|
|
||||||
|
|
||||||
if (value1) { //Is online
|
|
||||||
loginHelper.doLogin(host, port, new ISimpleOperationCallback<LoginDTO>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(final LoginDTO loginDTO) {
|
|
||||||
|
|
||||||
SettingsManager.iDB().setAvailableProfiles(loginDTO.availableProfiles);
|
|
||||||
|
|
||||||
SettingsManager.i().createUserSession();
|
|
||||||
SettingsManager.i().getUser().setFullname(!UtilityString.isNullOrEmpty(loginDTO.full_name) ? loginDTO.full_name : username.get());
|
|
||||||
|
|
||||||
|
|
||||||
mActivity.runOnUiThread(() -> onLoginSuccess(
|
|
||||||
"Benvenuto",
|
|
||||||
Html.fromHtml("Ciao <b>" + loginDTO.full_name + "</b>, la Integry le augura di svolgere al meglio il suo lavoro"),
|
|
||||||
host, port, loginDTO.availableProfiles));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(final Exception ex) {
|
|
||||||
onLoginFailed(new SpannableString(ex.getMessage()));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
} else { //Is not online
|
|
||||||
onLoginFailed(Html.fromHtml(String.format(mActivity.getText(R.string.server_not_reachable).toString(), host, port)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
this.sendOnLoginCompleted(host, port, loginDTO.getFull_name(), availableProfiles);
|
||||||
|
}, this::sendError);
|
||||||
|
|
||||||
|
|
||||||
|
} else { //Is not online
|
||||||
|
this.sendError(new ServerNotReachableException(host, port, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
onLoginFailed(Html.fromHtml(String.format(mActivity.getText(R.string.server_cod_azienda_not_valid).toString(), codAzienda.get())));
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
}, ex -> {
|
||||||
}
|
this.sendError(new InvalidServerCodAziendaException(codAzienda, ex));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void loadDepo(String host, int port, Runnable onComplete) {
|
public void loadDepo(String codAzienda, String host, int port, String username, String password, Runnable onComplete) {
|
||||||
|
|
||||||
SettingsManager.i().getServer().setCodAzienda(codAzienda.get());
|
SettingsManager.i().getServer().setCodAzienda(codAzienda);
|
||||||
SettingsManager.i().getServer().setHost(host);
|
SettingsManager.i().getServer().setHost(host);
|
||||||
SettingsManager.i().getServer().setPort(port);
|
SettingsManager.i().getServer().setPort(port);
|
||||||
|
|
||||||
SettingsManager.i().getUser().setUsername(username.get());
|
SettingsManager.i().getUser().setUsername(username);
|
||||||
SettingsManager.i().getUser().setPassword(password.get());
|
SettingsManager.i().getUser().setPassword(password);
|
||||||
|
|
||||||
SystemRESTConsumer.getAvailableCodMdeps(availableCodMdeps -> {
|
this.mSystemRESTConsumer.getAvailableCodMdeps(availableCodMdeps -> {
|
||||||
SettingsManager.iDB().setAvailableCodMdep(availableCodMdeps);
|
SettingsManager.iDB().setAvailableCodMdep(availableCodMdeps);
|
||||||
|
|
||||||
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
||||||
onLoginFailed(Html.fromHtml(String.format(mActivity.getText(R.string.no_codmdep_available).toString())));
|
this.sendError(new InvalidUserDepositException());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,72 +105,36 @@ public class LoginViewModel {
|
|||||||
|
|
||||||
|
|
||||||
if (onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}, ex -> {
|
}, this::sendError);
|
||||||
//BOH
|
|
||||||
onLoginFailed(new SpannableString(ex.getMessage()));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void onLoginFailed(final Spanned message) {
|
private void sendOnLoadingStarted() {
|
||||||
mProgress.dismiss();
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
loginButtonEnabled.set(true);
|
|
||||||
mActivity.runOnUiThread(() -> DialogSimpleMessageView.makeErrorDialog(
|
|
||||||
message,
|
|
||||||
null,
|
|
||||||
null)
|
|
||||||
.show(mActivity.getSupportFragmentManager(), "tag"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingEnded() {
|
||||||
private void onLoginSuccess(final String title, final Spanned message, final String host, final int port, final List<String> availableProfiles) {
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
mProgress.dismiss();
|
|
||||||
mActivity.runOnUiThread(() -> DialogSimpleMessageView.makeSuccessDialog(
|
|
||||||
title,
|
|
||||||
message,
|
|
||||||
null,
|
|
||||||
() -> showProfileDBSelectionDialog(host, port, availableProfiles))
|
|
||||||
.show(mActivity.getSupportFragmentManager(), "tag"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showProfileDBSelectionDialog(final String host, final int port, final List<String> availableProfiles) {
|
private void sendOnLoginCompleted(String host, int port, String fullName, List<String> availableProfiles) {
|
||||||
if (availableProfiles != null && availableProfiles.size() == 1) {
|
if (this.mListener != null)
|
||||||
SettingsManager.i().getUserSession().setProfileDB(availableProfiles.get(0));
|
mListener.onLoginCompleted(host, port, fullName, availableProfiles);
|
||||||
|
|
||||||
loadDepo(host, port, this::onLoginCompleted);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// setup the alert builder
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
|
||||||
builder.setTitle(R.string.action_choose_profile_db);
|
|
||||||
|
|
||||||
// add a list
|
|
||||||
String[] profiles = new String[availableProfiles.size()];
|
|
||||||
profiles = availableProfiles.toArray(profiles);
|
|
||||||
builder.setItems(profiles, (dialog, which) -> {
|
|
||||||
SettingsManager.i().getUserSession().setProfileDB(availableProfiles.get(which));
|
|
||||||
|
|
||||||
loadDepo(host, port, this::onLoginCompleted);
|
|
||||||
});
|
|
||||||
|
|
||||||
// create and show the alert dialog
|
|
||||||
AlertDialog dialog = builder.create();
|
|
||||||
dialog.show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLoginCompleted() {
|
private void sendError(Exception ex) {
|
||||||
loginButtonEnabled.set(true);
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
SettingsManager.update();
|
|
||||||
|
|
||||||
startSplashActivity();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LoginViewModel setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
private void startSplashActivity() {
|
public interface Listener extends ILoadingListener {
|
||||||
mActivity.finish();
|
void onError(Exception ex);
|
||||||
Intent myIntent = new Intent(mActivity, SplashActivity.class);
|
|
||||||
mActivity.startActivity(myIntent);
|
void onLoginCompleted(String host, int port, String fullName, List<String> availableProfiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,7 +262,10 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
mAppliedFilterViewModel.getCurrentDataConsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
mAppliedFilterViewModel.getCurrentDataConsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
|
||||||
List<FilterChipDTO> filterList = Stream.of(OrdiniUscitaElencoBindings.AVAILABLE_FILTERS.entrySet()).map(Map.Entry::getValue).sortBy(FilterChipDTO::getPosizione).toList();
|
List<FilterChipDTO> filterList = Stream.of(OrdiniUscitaElencoBindings.AVAILABLE_FILTERS.entrySet())
|
||||||
|
.map(Map.Entry::getValue)
|
||||||
|
.sortBy(FilterChipDTO::getPosizione)
|
||||||
|
.toList();
|
||||||
|
|
||||||
for (FilterChipDTO filterChipDTO : filterList) {
|
for (FilterChipDTO filterChipDTO : filterList) {
|
||||||
|
|
||||||
@@ -848,8 +851,10 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
|
|
||||||
private void initMtbGrupsCache(Runnable onComplete) {
|
private void initMtbGrupsCache(Runnable onComplete) {
|
||||||
var codMgrpArts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
var codMgrpArts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
||||||
.flatMap(x -> Stream.of(x.getAvailableClassMerc()))
|
.flatMap(x -> Stream.of(x.getAvailableClassMerc() != null ? x.getAvailableClassMerc() : new ArrayList<>()))
|
||||||
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
||||||
|
.withoutNulls()
|
||||||
|
.distinct()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
this.mArticoloRESTConsumer.getArtsGroups(codMgrpArts, mtbGrupCache -> {
|
this.mArticoloRESTConsumer.getArtsGroups(codMgrpArts, mtbGrupCache -> {
|
||||||
|
|||||||
@@ -648,7 +648,10 @@ public class VenditaFiltroOrdiniViewModel {
|
|||||||
|
|
||||||
public List<MtbGrup> getAllGruppoMerc(List<MtbGrup> mtbGrupFullList) {
|
public List<MtbGrup> getAllGruppoMerc(List<MtbGrup> mtbGrupFullList) {
|
||||||
var codMgrp = Stream.of(initialOrderList)
|
var codMgrp = Stream.of(initialOrderList)
|
||||||
.flatMap(ordiniUscitaElencoDTO -> Stream.of(ordiniUscitaElencoDTO.getAvailableClassMerc()))
|
.flatMap(ordiniUscitaElencoDTO ->
|
||||||
|
Stream.of(ordiniUscitaElencoDTO.getAvailableClassMerc() != null ?
|
||||||
|
ordiniUscitaElencoDTO.getAvailableClassMerc() :
|
||||||
|
new ArrayList<>()))
|
||||||
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
||||||
.withoutNulls()
|
.withoutNulls()
|
||||||
.distinct()
|
.distinct()
|
||||||
|
|||||||
@@ -289,9 +289,9 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArtSelectionRequest(List<MtbColr> mtbColrsToPick, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort) {
|
public void onArtSelectionRequest(List<MtbColr> mtbColrsToPick, MtbAart mtbAart, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort) {
|
||||||
DialogChooseArtsFromListaArts
|
DialogChooseArtsFromListaArts
|
||||||
.newInstance(mtbColrsToPick, onComplete, () -> {
|
.newInstance(mtbColrsToPick, mtbAart, onComplete, () -> {
|
||||||
onAbort.run();
|
onAbort.run();
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import dagger.Provides;
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
|
|
||||||
@Module(subcomponents = {PickingLiberoComponent.class})
|
@Module(subcomponents = {PickingLiberoComponent.class})
|
||||||
public class PickingLiberoModule {
|
public class PickingLiberoModule {
|
||||||
@@ -15,7 +16,9 @@ public class PickingLiberoModule {
|
|||||||
@Singleton
|
@Singleton
|
||||||
PickingLiberoViewModel providesPickingLiberoViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
PickingLiberoViewModel providesPickingLiberoViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||||
BarcodeRESTConsumer barcodeRESTConsumer) {
|
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||||
return new PickingLiberoViewModel(articoloRESTConsumer, colliMagazzinoRESTConsumer, barcodeRESTConsumer);
|
PosizioniRESTConsumer posizioniRESTConsumer
|
||||||
|
) {
|
||||||
|
return new PickingLiberoViewModel(articoloRESTConsumer, colliMagazzinoRESTConsumer, barcodeRESTConsumer, posizioniRESTConsumer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import javax.inject.Inject;
|
|||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILUBaseOperationsListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILUBaseOperationsListener;
|
||||||
@@ -23,18 +24,21 @@ import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.model.VtbDest;
|
import it.integry.integrywmsnative.core.model.VtbDest;
|
||||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
@@ -48,6 +52,7 @@ public class PickingLiberoViewModel {
|
|||||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||||
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||||
|
private final PosizioniRESTConsumer mPosizioniRESTConsumer;
|
||||||
|
|
||||||
|
|
||||||
private boolean mFlagAskCliente;
|
private boolean mFlagAskCliente;
|
||||||
@@ -60,10 +65,13 @@ public class PickingLiberoViewModel {
|
|||||||
@Inject
|
@Inject
|
||||||
public PickingLiberoViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
public PickingLiberoViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||||
BarcodeRESTConsumer barcodeRESTConsumer) {
|
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||||
|
PosizioniRESTConsumer posizioniRESTConsumer
|
||||||
|
) {
|
||||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||||
|
this.mPosizioniRESTConsumer = posizioniRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -88,6 +96,10 @@ public class PickingLiberoViewModel {
|
|||||||
//Cerco gli articoli presenti nell'ul dell'etichetta anonima
|
//Cerco gli articoli presenti nell'ul dell'etichetta anonima
|
||||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onComplete);
|
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onComplete);
|
||||||
|
|
||||||
|
} else if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
|
||||||
|
//Cerco tramite etichetta un collo in posizione mono ul
|
||||||
|
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
||||||
|
|
||||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
//Cerco tramite etichetta ean 128 (che può indicarmi una UL)
|
//Cerco tramite etichetta ean 128 (che può indicarmi una UL)
|
||||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||||
@@ -97,11 +109,41 @@ public class PickingLiberoViewModel {
|
|||||||
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
//Cerco tramite ean13 un collo in posizione mono ul definita in anagrafica articolo, altrimenti se abilitato procedo con picking manuale
|
||||||
this.loadArticolo(barcodeScanDTO.getStringValue(), null, onComplete);
|
this.loadArticolo(barcodeScanDTO.getStringValue(), null, onComplete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void executeEtichettaPosizione(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
|
||||||
|
MtbDepoPosizione foundPosizione = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
||||||
|
.filter(x -> x.getPosizione().equalsIgnoreCase(barcodeScanDTO.getStringValue()))
|
||||||
|
.single();
|
||||||
|
this.executePosizione(foundPosizione, null, onComplete);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void executePosizione(MtbDepoPosizione posizione, MtbAart articolo, Runnable onComplete) {
|
||||||
|
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
||||||
|
|
||||||
|
if (mtbColtList == null || mtbColtList.size() == 0) {
|
||||||
|
if (articolo != null) {
|
||||||
|
this.dispatchArt(articolo, null);
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
}
|
||||||
|
} else if (mtbColtList.size() == 1) {
|
||||||
|
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
pickMerceULtoUL(mtbColt, articolo, onComplete);
|
||||||
|
}, this::sendError);
|
||||||
|
} else {
|
||||||
|
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
||||||
|
}
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
private void executeEtichettaEanPeso(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
private void executeEtichettaEanPeso(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
try {
|
try {
|
||||||
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(barcodeScanDTO.getStringValue());
|
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(barcodeScanDTO.getStringValue());
|
||||||
@@ -164,10 +206,18 @@ public class PickingLiberoViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
mArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
||||||
|
|
||||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||||
this.dispatchArt(mtbAartList.get(0), ean128Model);
|
MtbAart articolo = mtbAartList.get(0);
|
||||||
onComplete.run();
|
MtbDepoPosizione posizione = UtilityPosizione.getFromCache(articolo.getPosizione());
|
||||||
|
|
||||||
|
if (posizione != null && posizione.isFlagMonoCollo()) {
|
||||||
|
this.executePosizione(posizione, articolo, onComplete);
|
||||||
|
} else if(mDefaultGestione == GestioneEnum.VENDITA){
|
||||||
|
this.dispatchArt(articolo, ean128Model);
|
||||||
|
onComplete.run();
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoResultFromBarcodeException());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.sendError(new NoResultFromBarcodeException());
|
this.sendError(new NoResultFromBarcodeException());
|
||||||
@@ -336,13 +386,16 @@ public class PickingLiberoViewModel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void pickMerceULtoUL(MtbColt sourceMtbColt, Runnable onComplete) {
|
private void pickMerceULtoUL(MtbColt sourceMtbColt, Runnable onComplete) {
|
||||||
|
pickMerceULtoUL(sourceMtbColt, null, onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pickMerceULtoUL(MtbColt sourceMtbColt, MtbAart mtbAart, Runnable onComplete) {
|
||||||
List<MtbColr> mtbColrsToPick = Stream.of(sourceMtbColt.getMtbColr())
|
List<MtbColr> mtbColrsToPick = Stream.of(sourceMtbColt.getMtbColr())
|
||||||
.filter(x -> UtilityBigDecimal.greaterThan(x.getQtaCol(), BigDecimal.ZERO))
|
.filter(x -> UtilityBigDecimal.greaterThan(x.getQtaCol(), BigDecimal.ZERO))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
this.sendArtSelectionRequest(mtbColrsToPick, pickedAarts -> {
|
this.sendArtSelectionRequest(mtbColrsToPick, mtbAart, pickedAarts -> {
|
||||||
List<MtbColr> destNewMtbColr = new ArrayList<>();
|
List<MtbColr> destNewMtbColr = new ArrayList<>();
|
||||||
|
|
||||||
if (pickedAarts.size() > 0) {
|
if (pickedAarts.size() > 0) {
|
||||||
@@ -369,7 +422,7 @@ public class PickingLiberoViewModel {
|
|||||||
.setNumCollo(null)
|
.setNumCollo(null)
|
||||||
|
|
||||||
.setDataColloRif(cloneMtbColr.getDataColloS())
|
.setDataColloRif(cloneMtbColr.getDataColloS())
|
||||||
.setDataCollo(null)
|
.setDataCollo((String) null)
|
||||||
|
|
||||||
.setPesoLordoKg(null)
|
.setPesoLordoKg(null)
|
||||||
.setPesoNettoKg(null);
|
.setPesoNettoKg(null);
|
||||||
@@ -480,46 +533,46 @@ public class PickingLiberoViewModel {
|
|||||||
new Thread(this::sendOnLoadingStarted).start();
|
new Thread(this::sendOnLoadingStarted).start();
|
||||||
|
|
||||||
|
|
||||||
final MtbColr mtbColr = new MtbColr()
|
final MtbColr mtbColr = new MtbColr()
|
||||||
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
||||||
.setPartitaMag(partitaMag)
|
.setPartitaMag(partitaMag)
|
||||||
.setDataScadPartita(dataScad)
|
.setDataScadPartita(dataScad)
|
||||||
.setQtaCol(qtaTot)
|
.setQtaCol(qtaTot)
|
||||||
.setQtaCnf(qtaCnf)
|
.setQtaCnf(qtaCnf)
|
||||||
.setNumCnf(numCnf)
|
.setNumCnf(numCnf)
|
||||||
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
||||||
.setDatetimeRow(UtilityDate.getDateInstance());
|
.setDatetimeRow(UtilityDate.getDateInstance());
|
||||||
|
|
||||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
|
|
||||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
||||||
|
|
||||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||||
mtbColr
|
mtbColr
|
||||||
.setDataCollo(value.getDataColloS())
|
.setDataCollo(value.getDataColloS())
|
||||||
.setNumCollo(value.getNumCollo())
|
.setNumCollo(value.getNumCollo())
|
||||||
.setGestione(value.getGestione())
|
.setGestione(value.getGestione())
|
||||||
.setSerCollo(value.getSerCollo())
|
.setSerCollo(value.getSerCollo())
|
||||||
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
||||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (shouldCloseLU) closeLU(null);
|
if (shouldCloseLU) closeLU(null);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -763,9 +816,9 @@ public class PickingLiberoViewModel {
|
|||||||
if (this.mListener != null) mListener.onLUClienteRequired(onComplete, onAbort);
|
if (this.mListener != null) mListener.onLUClienteRequired(onComplete, onAbort);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendArtSelectionRequest(List<MtbColr> mtbColrsToPick, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort) {
|
private void sendArtSelectionRequest(List<MtbColr> mtbColrsToPick, MtbAart mtbAart, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort) {
|
||||||
if (this.mListener != null)
|
if (this.mListener != null)
|
||||||
mListener.onArtSelectionRequest(mtbColrsToPick, onComplete, onAbort);
|
mListener.onArtSelectionRequest(mtbColrsToPick, mtbAart, onComplete, onAbort);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendOnItemDispatched(PickingObjectDTO pickingObjectDTO,
|
private void sendOnItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||||
@@ -819,7 +872,7 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort);
|
void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort);
|
||||||
|
|
||||||
void onArtSelectionRequest(List<MtbColr> mtbColrsToPick, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort);
|
void onArtSelectionRequest(List<MtbColr> mtbColrsToPick, MtbAart mtbAart, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort);
|
||||||
|
|
||||||
void onItemDispatched(PickingObjectDTO pickingObjectDTO,
|
void onItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||||
MtbAart mtbAart,
|
MtbAart mtbAart,
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
import it.integry.integrywmsnative.core.rest.model.DocumentoResoDTO;
|
import it.integry.integrywmsnative.core.rest.model.DocumentoResoDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
@@ -42,18 +43,18 @@ import it.integry.integrywmsnative.core.utility.UtilityResources;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||||
import it.integry.integrywmsnative.databinding.ActivityPickingResiBinding;
|
import it.integry.integrywmsnative.databinding.ActivityPickingResiBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.picking_resi.rest.WithdrawableDtbDocr;
|
||||||
import it.integry.integrywmsnative.gest.picking_resi.ui.PickingResiListAdapter;
|
import it.integry.integrywmsnative.gest.picking_resi.ui.PickingResiListAdapter;
|
||||||
import it.integry.integrywmsnative.gest.picking_resi.ui.PickingResiListModel;
|
import it.integry.integrywmsnative.gest.picking_resi.ui.PickingResiListModel;
|
||||||
import it.integry.integrywmsnative.gest.picking_resi.rest.WithdrawableDtbDocr;
|
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_should_print.DialogAskShouldPrint;
|
import it.integry.integrywmsnative.view.dialogs.ask_should_print.DialogAskShouldPrint;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialog;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
|
||||||
|
|
||||||
public class PickingResiActivity extends BaseActivity implements BottomSheetFragmentLUContentView.Listener, BottomSheetFragmentLUContentViewModel.Listener, PickingResiViewModel.Listener {
|
public class PickingResiActivity extends BaseActivity implements BottomSheetFragmentLUContentView.Listener, BottomSheetFragmentLUContentViewModel.Listener, PickingResiViewModel.Listener {
|
||||||
|
|
||||||
@@ -276,15 +277,15 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNoteAggiuntiveRequired(RunnableArgs<String> onComplete, Runnable onAbort) {
|
public void onInfoAggiuntiveRequired(RunnableArgss<String, MtbTCol> onComplete) {
|
||||||
NoteAggiuntiveLUDialog.make(this, onComplete, onAbort).show();
|
InfoAggiuntiveLUDialog.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
|
|
||||||
if(ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
} else {
|
} else {
|
||||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||||
@@ -401,7 +402,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
null,
|
null,
|
||||||
R.string.button_ignore_print,
|
R.string.button_ignore_print,
|
||||||
onComplete)
|
onComplete)
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
@@ -161,11 +162,16 @@ public class PickingResiViewModel {
|
|||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.sendOnNoteAggiuntiveRequired(noteAggiuntive -> {
|
this.sendOnInfoAggiuntiveRequired((noteAggiuntive, tCol) -> {
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(noteAggiuntive)) {
|
if (!UtilityString.isNullOrEmpty(noteAggiuntive)) {
|
||||||
this.mCurrentMtbColt.setAnnotazioni(noteAggiuntive);
|
this.mCurrentMtbColt.setAnnotazioni(noteAggiuntive);
|
||||||
}
|
}
|
||||||
|
if (tCol != null) {
|
||||||
|
this.mCurrentMtbColt.setCodTcol(tCol.getCodTcol());
|
||||||
|
this.mCurrentMtbColt.setMtbTCol(tCol);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
this.mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
this.mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
||||||
|
|
||||||
@@ -185,9 +191,6 @@ public class PickingResiViewModel {
|
|||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|
||||||
}, () -> {
|
|
||||||
this.sendLUClosed();
|
|
||||||
this.sendOnLoadingEnded();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
@@ -720,8 +723,8 @@ public class PickingResiViewModel {
|
|||||||
return mPickingList;
|
return mPickingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendOnNoteAggiuntiveRequired(RunnableArgs<String> onComplete, Runnable onAbort) {
|
private void sendOnInfoAggiuntiveRequired(RunnableArgss<String, MtbTCol> onComplete) {
|
||||||
if (this.mListener != null) this.mListener.onNoteAggiuntiveRequired(onComplete, onAbort);
|
if (this.mListener != null) this.mListener.onInfoAggiuntiveRequired(onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendOnLoadingStarted() {
|
private void sendOnLoadingStarted() {
|
||||||
@@ -798,7 +801,7 @@ public class PickingResiViewModel {
|
|||||||
|
|
||||||
public interface Listener extends ILUPrintListener, ILoadingListener, ILUBaseOperationsListener {
|
public interface Listener extends ILUPrintListener, ILoadingListener, ILUBaseOperationsListener {
|
||||||
|
|
||||||
void onNoteAggiuntiveRequired(RunnableArgs<String> onComplete, Runnable onAbort);
|
void onInfoAggiuntiveRequired(RunnableArgss<String, MtbTCol> onComplete);
|
||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class PickingResiRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run(values);
|
if(onComplete != null) onComplete.run(values);
|
||||||
}
|
} else onComplete.run(new ArrayList<>());
|
||||||
|
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class PickingResiListAdapter extends SectionedRecyclerViewAdapter<Picking
|
|||||||
|
|
||||||
holder.mBinding.deactivatedOverBg.setVisibility(!pickingResiListModel.isActive() ? View.VISIBLE : View.GONE);
|
holder.mBinding.deactivatedOverBg.setVisibility(!pickingResiListModel.isActive() ? View.VISIBLE : View.GONE);
|
||||||
holder.mBinding.getRoot().setAlpha(!pickingResiListModel.isActive() ? 0.8f : 1);
|
holder.mBinding.getRoot().setAlpha(!pickingResiListModel.isActive() ? 0.8f : 1);
|
||||||
holder.mBinding.badge1.setBackground(ResourcesCompat.getDrawable(mContext.getResources(), !pickingResiListModel.isActive() ? R.drawable.badge_gray_round_corner : R.drawable.badge1_round_corner, null));
|
holder.mBinding.badge1.setBackground(ResourcesCompat.getDrawable(mContext.getResources(), !pickingResiListModel.isActive() ? R.drawable.badge_round_corner : R.drawable.badge1_round_corner, null));
|
||||||
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingResiListModel.isActive() ? R.color.gray_600 : R.color.green_700, null));
|
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingResiListModel.isActive() ? R.color.gray_600 : R.color.green_700, null));
|
||||||
|
|
||||||
holder.mBinding.descrizione.setText(pickingResiListModel.getDescrizione());
|
holder.mBinding.descrizione.setText(pickingResiListModel.getDescrizione());
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class ProdRientroMerceOrderDetailRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}.getType();
|
}.getType();
|
||||||
systemRESTConsumer.<List<MtbColt>>processSql(mtbColtSql, mtbColtTypeOfObjectsList, mtbColtList -> {
|
systemRESTConsumer.<List<MtbColt>>processSql(mtbColtSql, mtbColtTypeOfObjectsList, mtbColtList -> {
|
||||||
|
|
||||||
if(mtbColtList == null) mtbColtList = new ArrayList<>();
|
if (mtbColtList == null) mtbColtList = new ArrayList<>();
|
||||||
|
|
||||||
for (MtbColt mtbColt : mtbColtList) {
|
for (MtbColt mtbColt : mtbColtList) {
|
||||||
|
|
||||||
@@ -108,23 +108,21 @@ public class ProdRientroMerceOrderDetailRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void importColloDaProduzione(ImportColliDaProduzioneRequestDTO importColliDaProduzioneRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void importColloDaProduzione(ImportColliDaProduzioneRequestDTO importColliDaProduzioneRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
ProdRientroMerceOrderDetailRESTConsumerService service = RESTBuilder.getService(ProdRientroMerceOrderDetailRESTConsumerService.class);
|
ProdRientroMerceOrderDetailRESTConsumerService service = RESTBuilder.getService(ProdRientroMerceOrderDetailRESTConsumerService.class);
|
||||||
service.importColloDaProduzione(importColliDaProduzioneRequestDTO).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
service.importColloDaProduzione(importColliDaProduzioneRequestDTO).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
||||||
analyzeAnswer(response, "importColliDaProduzione", mtbColt -> {
|
analyzeAnswer(response, "importColliDaProduzione", mtbColt -> {
|
||||||
onComplete.run(mtbColt);
|
onComplete.run(mtbColt.get(0));
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<MtbColt>>> call, Throwable t) {
|
||||||
Logger.e(t, "importColliDaProduzione");
|
Logger.e(t, "importColliDaProduzione");
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
@@ -140,7 +138,7 @@ public class ProdRientroMerceOrderDetailRESTConsumer extends _BaseRESTConsumer {
|
|||||||
analyzeAnswer(response, "deleteColloDaProduzione", mtbColt -> {
|
analyzeAnswer(response, "deleteColloDaProduzione", mtbColt -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ public interface ProdRientroMerceOrderDetailRESTConsumerService {
|
|||||||
|
|
||||||
|
|
||||||
@POST("importColliDaProduzioneJson")
|
@POST("importColliDaProduzioneJson")
|
||||||
Call<ServiceRESTResponse<MtbColt>> importColliDaProduzione(@Body List<ImportColliDaProduzioneRequestDTO> importColliDaProduzioneRequestDTO);
|
Call<ServiceRESTResponse<List<MtbColt>>> importColliDaProduzione(@Body List<ImportColliDaProduzioneRequestDTO> importColliDaProduzioneRequestDTO);
|
||||||
|
|
||||||
@POST("importColloDaProduzioneJson")
|
@POST("importColloDaProduzioneJson")
|
||||||
Call<ServiceRESTResponse<MtbColt>> importColloDaProduzione(@Body ImportColliDaProduzioneRequestDTO importColloDaProduzioneRequestDTO);
|
Call<ServiceRESTResponse<List<MtbColt>>> importColloDaProduzione(@Body ImportColliDaProduzioneRequestDTO importColloDaProduzioneRequestDTO);
|
||||||
|
|
||||||
@POST("cancellaColloDaProduzione")
|
@POST("cancellaColloDaProduzione")
|
||||||
Call<ServiceRESTResponse<Object>> deleteColloDaProduzione(@Body MtbColt mtbColtToDelete);
|
Call<ServiceRESTResponse<Object>> deleteColloDaProduzione(@Body MtbColt mtbColtToDelete);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.gest.rettifica_giacenze;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -95,15 +96,21 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_rettifica_giacenze, container, false);
|
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_rettifica_giacenze, container, false);
|
||||||
|
|
||||||
MainApplication.appComponent
|
MainApplication.appComponent
|
||||||
.rettificaGiacenzeComponent()
|
.rettificaGiacenzeComponent()
|
||||||
.create()
|
.create()
|
||||||
@@ -126,7 +133,6 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
return mBinding.getRoot();
|
return mBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initVars() {
|
private void initVars() {
|
||||||
thereIsAnOpenedUL.addOnPropertyChangedCallback(() -> {
|
thereIsAnOpenedUL.addOnPropertyChangedCallback(() -> {
|
||||||
thereIsntAnOpenedUL.set(!thereIsAnOpenedUL.get());
|
thereIsntAnOpenedUL.set(!thereIsAnOpenedUL.get());
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
private void getEmptyPickingList(List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete) {
|
private void getEmptyPickingList(List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete) {
|
||||||
List<String> codMarts = Stream.of(sitArtOrdList)
|
List<String> codMarts = Stream.of(sitArtOrdList)
|
||||||
.map(SitArtOrdDTO::getCodMart)
|
.map(x -> x.getCodMart().trim())
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
this.mArticoloRESTConsumer.getByCodMarts(codMarts, listMtbAarts -> {
|
this.mArticoloRESTConsumer.getByCodMarts(codMarts, listMtbAarts -> {
|
||||||
@@ -183,7 +183,7 @@ public class SpedizioneViewModel {
|
|||||||
MtbAart mtbAart = null;
|
MtbAart mtbAart = null;
|
||||||
|
|
||||||
for (MtbAart mtbAartItem : listMtbAarts) {
|
for (MtbAart mtbAartItem : listMtbAarts) {
|
||||||
if (mtbAartItem.getCodMart().equalsIgnoreCase(sitArtOrdDTO.getCodMart())) {
|
if (mtbAartItem.getCodMart().trim().equalsIgnoreCase(sitArtOrdDTO.getCodMart().trim())) {
|
||||||
mtbAart = mtbAartItem;
|
mtbAart = mtbAartItem;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -776,34 +776,34 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
List<MtbPartitaMag> availableBatchLots = Stream.of(scannedMtbColrs)
|
List<MtbPartitaMag> availableBatchLots = Stream.of(scannedMtbColrs)
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(pickingObjectDTO.getMtbAart().getCodMart()) && (
|
.filter(x -> x.getCodMart().equalsIgnoreCase(pickingObjectDTO.getMtbAart().getCodMart()) && (
|
||||||
x.getPartitaMag() == null ||
|
x.getPartitaMag() == null ||
|
||||||
UtilityString.isNullOrEmpty(x.getMtbPartitaMag().getDataScadS()) ||
|
UtilityString.isNullOrEmpty(x.getMtbPartitaMag().getDataScadS()) ||
|
||||||
UtilityDate.getDateInstance().before(x.getMtbPartitaMag().getDataScadD())
|
UtilityDate.getDateInstance().before(x.getMtbPartitaMag().getDataScadD())
|
||||||
))
|
))
|
||||||
.distinctBy(MtbColr::getPartitaMag)
|
.distinctBy(MtbColr::getPartitaMag)
|
||||||
.map(x -> x.getPartitaMag() == null ? new MtbPartitaMag().setCodMart(x.getMtbAart().getCodMart()) : x.getMtbPartitaMag())
|
.map(x -> x.getPartitaMag() == null ? new MtbPartitaMag().setCodMart(x.getMtbAart().getCodMart()) : x.getMtbPartitaMag())
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
//Controllo se una delle partite combacia con quella che voglio evadere
|
//Controllo se una delle partite combacia con quella che voglio evadere
|
||||||
if(refMtbColr != null && refMtbColr.getMtbPartitaMag() != null) {
|
if (refMtbColr != null && refMtbColr.getMtbPartitaMag() != null) {
|
||||||
MtbPartitaMag refMtbPartitaMag = refMtbColr.getMtbPartitaMag();
|
MtbPartitaMag refMtbPartitaMag = refMtbColr.getMtbPartitaMag();
|
||||||
|
|
||||||
Optional<MtbPartitaMag> matchPartitaMag = Stream.of(availableBatchLots)
|
Optional<MtbPartitaMag> matchPartitaMag = Stream.of(availableBatchLots)
|
||||||
.filter(availableBatchLot -> refMtbPartitaMag.getPartitaMag().equalsIgnoreCase(availableBatchLot.getPartitaMag()))
|
.filter(availableBatchLot -> refMtbPartitaMag.getPartitaMag().equalsIgnoreCase(availableBatchLot.getPartitaMag()))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(matchPartitaMag.isPresent()) {
|
if (matchPartitaMag.isPresent()) {
|
||||||
availableBatchLots.clear();
|
availableBatchLots.clear();
|
||||||
availableBatchLots.add(refMtbPartitaMag);
|
availableBatchLots.add(refMtbPartitaMag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(availableBatchLots.size() > 1) {
|
if (availableBatchLots.size() > 1) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
List<MtbPartitaMag> tmp = new ArrayList<>();
|
List<MtbPartitaMag> tmp = new ArrayList<>();
|
||||||
|
|
||||||
if(Stream.of(availableBatchLots).anyMatch(x -> !UtilityString.isNullOrEmpty(x.getDataScadS()))) {
|
if (Stream.of(availableBatchLots).anyMatch(x -> !UtilityString.isNullOrEmpty(x.getDataScadS()))) {
|
||||||
tmp.addAll(
|
tmp.addAll(
|
||||||
Stream.of(availableBatchLots)
|
Stream.of(availableBatchLots)
|
||||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getDataScadS()) && UtilityDate.getDateInstance().before(x.getDataScadD()))
|
.filter(x -> !UtilityString.isNullOrEmpty(x.getDataScadS()) && UtilityDate.getDateInstance().before(x.getDataScadD()))
|
||||||
@@ -811,7 +811,7 @@ public class SpedizioneViewModel {
|
|||||||
.toList());
|
.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Stream.of(availableBatchLots).anyMatch(x -> UtilityString.isNullOrEmpty(x.getDataScadS()))) {
|
if (Stream.of(availableBatchLots).anyMatch(x -> UtilityString.isNullOrEmpty(x.getDataScadS()))) {
|
||||||
tmp.addAll(
|
tmp.addAll(
|
||||||
Stream.of(availableBatchLots)
|
Stream.of(availableBatchLots)
|
||||||
.filter(x -> UtilityString.isNullOrEmpty(x.getDataScadS()))
|
.filter(x -> UtilityString.isNullOrEmpty(x.getDataScadS()))
|
||||||
@@ -822,7 +822,7 @@ public class SpedizioneViewModel {
|
|||||||
this.sendBatchLotSelectionRequest(tmp, selected -> {
|
this.sendBatchLotSelectionRequest(tmp, selected -> {
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if(selected != null) {
|
if (selected != null) {
|
||||||
MtbColr scannedMtbColr = Stream.of(pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr())
|
MtbColr scannedMtbColr = Stream.of(pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr())
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(pickingObjectDTO.getMtbAart().getCodMart()) &&
|
.filter(x -> x.getCodMart().equalsIgnoreCase(pickingObjectDTO.getMtbAart().getCodMart()) &&
|
||||||
((x.getPartitaMag() != null && selected.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(selected.getPartitaMag())) ||
|
((x.getPartitaMag() != null && selected.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(selected.getPartitaMag())) ||
|
||||||
@@ -897,7 +897,7 @@ public class SpedizioneViewModel {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
if(refMtbColr != null) {
|
if (refMtbColr != null) {
|
||||||
if (pickingObjectDTO.getMtbAart().isFlagQtaCnfFissaBoolean()) {
|
if (pickingObjectDTO.getMtbAart().isFlagQtaCnfFissaBoolean()) {
|
||||||
if (UtilityBigDecimal.equalsOrLowerThan(refMtbColr.getQtaCol(), qtaDaEvadere)) {
|
if (UtilityBigDecimal.equalsOrLowerThan(refMtbColr.getQtaCol(), qtaDaEvadere)) {
|
||||||
numCnfDaPrelevare = refMtbColr.getNumCnf();
|
numCnfDaPrelevare = refMtbColr.getNumCnf();
|
||||||
@@ -1456,7 +1456,7 @@ public class SpedizioneViewModel {
|
|||||||
refMtbColt.getMtbColr().size() > 0 ?
|
refMtbColt.getMtbColr().size() > 0 ?
|
||||||
refMtbColt.getMtbColr().get(0) : null;
|
refMtbColt.getMtbColr().get(0) : null;
|
||||||
|
|
||||||
if(originalRefMtbColr != null) {
|
if (originalRefMtbColr != null) {
|
||||||
refMtbColr.setId(originalRefMtbColr.getId());
|
refMtbColr.setId(originalRefMtbColr.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1695,7 +1695,7 @@ public class SpedizioneViewModel {
|
|||||||
.setRiga(null)
|
.setRiga(null)
|
||||||
.setNumCollo(null)
|
.setNumCollo(null)
|
||||||
.setGestione((String) null)
|
.setGestione((String) null)
|
||||||
.setDataCollo(null)
|
.setDataCollo((String) null)
|
||||||
.setSerCollo(null)
|
.setSerCollo(null)
|
||||||
.setCausale(MtbColr.Causale.VERSAMENTO);
|
.setCausale(MtbColr.Causale.VERSAMENTO);
|
||||||
|
|
||||||
@@ -1721,7 +1721,7 @@ public class SpedizioneViewModel {
|
|||||||
if (!shouldPrint) {
|
if (!shouldPrint) {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
} else {
|
} else {
|
||||||
cyclicPrint(PrinterRESTConsumer.Type.PRIMARIA, mtbColtsToPrint.iterator(), onComplete, ex -> this.sendLUPrintError(ex, onComplete));
|
cyclicPrint(PrinterRESTConsumer.Type.PRIMARIA, mtbColtsToPrint.iterator(), onComplete, ex -> this.sendLUPrintError(ex, onComplete));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1762,10 +1762,12 @@ public class SpedizioneViewModel {
|
|||||||
.filter(x -> !this.mColliRegistrati.contains(x))
|
.filter(x -> !this.mColliRegistrati.contains(x))
|
||||||
.forEach(x -> this.mColliRegistrati.add(x));
|
.forEach(x -> this.mColliRegistrati.add(x));
|
||||||
|
|
||||||
for (MtbColt mtbColt : mtbColtList) {
|
if (mTestateOrdini != null) {
|
||||||
Stream.of(mTestateOrdini)
|
for (MtbColt mtbColt : mtbColtList) {
|
||||||
.filter(x -> x.getNumOrd().equals(mtbColt.getNumOrd()) && x.getDataOrdD().equals(mtbColt.getDataOrdD()) && x.getGestioneEnum() == mtbColt.getGestioneEnum())
|
Stream.of(mTestateOrdini)
|
||||||
.forEach(x -> x.setExistColloBoolean(true));
|
.filter(x -> x.getNumOrd().equals(mtbColt.getNumOrd()) && x.getDataOrdD().equals(mtbColt.getDataOrdD()) && x.getGestioneEnum() == mtbColt.getGestioneEnum())
|
||||||
|
.forEach(x -> x.setExistColloBoolean(true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mMtbColtSessionID != null)
|
if (mMtbColtSessionID != null)
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
|
|||||||
|
|
||||||
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
||||||
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
||||||
holder.mBinding.badge1.setBackground(ResourcesCompat.getDrawable(mContext.getResources(), !pickingObjectDTO.isActive() ? R.drawable.badge_gray_round_corner : R.drawable.badge1_round_corner, null));
|
holder.mBinding.badge1.setBackground(ResourcesCompat.getDrawable(mContext.getResources(), !pickingObjectDTO.isActive() ? R.drawable.badge_round_corner : R.drawable.badge1_round_corner, null));
|
||||||
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingObjectDTO.isActive() ? R.color.gray_600 : R.color.green_700, null));
|
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingObjectDTO.isActive() ? R.color.gray_600 : R.color.green_700, null));
|
||||||
|
|
||||||
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
||||||
|
|||||||
@@ -0,0 +1,333 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.expandablelayout;
|
||||||
|
|
||||||
|
import static it.integry.integrywmsnative.ui.expandablelayout.ExpandableLayout.State.COLLAPSED;
|
||||||
|
import static it.integry.integrywmsnative.ui.expandablelayout.ExpandableLayout.State.COLLAPSING;
|
||||||
|
import static it.integry.integrywmsnative.ui.expandablelayout.ExpandableLayout.State.EXPANDED;
|
||||||
|
import static it.integry.integrywmsnative.ui.expandablelayout.ExpandableLayout.State.EXPANDING;
|
||||||
|
|
||||||
|
import android.animation.Animator;
|
||||||
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
import android.animation.ValueAnimator;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.animation.Interpolator;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
|
||||||
|
public class ExpandableLayout extends FrameLayout {
|
||||||
|
public interface State {
|
||||||
|
int COLLAPSED = 0;
|
||||||
|
int COLLAPSING = 1;
|
||||||
|
int EXPANDING = 2;
|
||||||
|
int EXPANDED = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String KEY_SUPER_STATE = "super_state";
|
||||||
|
public static final String KEY_EXPANSION = "expansion";
|
||||||
|
|
||||||
|
public static final int HORIZONTAL = 0;
|
||||||
|
public static final int VERTICAL = 1;
|
||||||
|
|
||||||
|
private static final int DEFAULT_DURATION = 300;
|
||||||
|
|
||||||
|
private int duration = DEFAULT_DURATION;
|
||||||
|
private float parallax;
|
||||||
|
private float expansion;
|
||||||
|
private int orientation;
|
||||||
|
private int state;
|
||||||
|
|
||||||
|
private Interpolator interpolator = new FastOutSlowInInterpolator();
|
||||||
|
private ValueAnimator animator;
|
||||||
|
|
||||||
|
private ExpandableLayout.OnExpansionUpdateListener listener;
|
||||||
|
|
||||||
|
public ExpandableLayout(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExpandableLayout(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
|
||||||
|
if (attrs != null) {
|
||||||
|
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.ExpandableLayout);
|
||||||
|
duration = a.getInt(R.styleable.ExpandableLayout_el_duration, DEFAULT_DURATION);
|
||||||
|
expansion = a.getBoolean(R.styleable.ExpandableLayout_el_expanded, false) ? 1 : 0;
|
||||||
|
orientation = a.getInt(R.styleable.ExpandableLayout_android_orientation, VERTICAL);
|
||||||
|
parallax = a.getFloat(R.styleable.ExpandableLayout_el_parallax, 1);
|
||||||
|
a.recycle();
|
||||||
|
|
||||||
|
state = expansion == 0 ? COLLAPSED : EXPANDED;
|
||||||
|
setParallax(parallax);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Parcelable onSaveInstanceState() {
|
||||||
|
Parcelable superState = super.onSaveInstanceState();
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
|
||||||
|
expansion = isExpanded() ? 1 : 0;
|
||||||
|
|
||||||
|
bundle.putFloat(KEY_EXPANSION, expansion);
|
||||||
|
bundle.putParcelable(KEY_SUPER_STATE, superState);
|
||||||
|
|
||||||
|
return bundle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onRestoreInstanceState(Parcelable parcelable) {
|
||||||
|
Bundle bundle = (Bundle) parcelable;
|
||||||
|
expansion = bundle.getFloat(KEY_EXPANSION);
|
||||||
|
state = expansion == 1 ? EXPANDED : COLLAPSED;
|
||||||
|
Parcelable superState = bundle.getParcelable(KEY_SUPER_STATE);
|
||||||
|
|
||||||
|
super.onRestoreInstanceState(superState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
|
||||||
|
int width = getMeasuredWidth();
|
||||||
|
int height = getMeasuredHeight();
|
||||||
|
|
||||||
|
int size = orientation == LinearLayout.HORIZONTAL ? width : height;
|
||||||
|
|
||||||
|
setVisibility(expansion == 0 && size == 0 ? GONE : VISIBLE);
|
||||||
|
|
||||||
|
int expansionDelta = size - Math.round(size * expansion);
|
||||||
|
if (parallax > 0) {
|
||||||
|
float parallaxDelta = expansionDelta * parallax;
|
||||||
|
for (int i = 0; i < getChildCount(); i++) {
|
||||||
|
View child = getChildAt(i);
|
||||||
|
if (orientation == HORIZONTAL) {
|
||||||
|
int direction = -1;
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1 && getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
|
||||||
|
direction = 1;
|
||||||
|
}
|
||||||
|
child.setTranslationX(direction * parallaxDelta);
|
||||||
|
} else {
|
||||||
|
child.setTranslationY(-parallaxDelta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (orientation == HORIZONTAL) {
|
||||||
|
setMeasuredDimension(width - expansionDelta, height);
|
||||||
|
} else {
|
||||||
|
setMeasuredDimension(width, height - expansionDelta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onConfigurationChanged(Configuration newConfig) {
|
||||||
|
if (animator != null) {
|
||||||
|
animator.cancel();
|
||||||
|
}
|
||||||
|
super.onConfigurationChanged(newConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get expansion state
|
||||||
|
*
|
||||||
|
* @return one of {@link ExpandableLayout.State}
|
||||||
|
*/
|
||||||
|
public int getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isExpanded() {
|
||||||
|
return state == EXPANDING || state == EXPANDED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggle() {
|
||||||
|
toggle(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggle(boolean animate) {
|
||||||
|
if (isExpanded()) {
|
||||||
|
collapse(animate);
|
||||||
|
} else {
|
||||||
|
expand(animate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void expand() {
|
||||||
|
expand(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void expand(boolean animate) {
|
||||||
|
setExpanded(true, animate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void collapse() {
|
||||||
|
collapse(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void collapse(boolean animate) {
|
||||||
|
setExpanded(false, animate);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience method - same as calling setExpanded(expanded, true)
|
||||||
|
*/
|
||||||
|
public void setExpanded(boolean expand) {
|
||||||
|
setExpanded(expand, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpanded(boolean expand, boolean animate) {
|
||||||
|
if (expand == isExpanded()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int targetExpansion = expand ? 1 : 0;
|
||||||
|
if (animate) {
|
||||||
|
animateSize(targetExpansion);
|
||||||
|
} else {
|
||||||
|
setExpansion(targetExpansion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDuration() {
|
||||||
|
return duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterpolator(Interpolator interpolator) {
|
||||||
|
this.interpolator = interpolator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDuration(int duration) {
|
||||||
|
this.duration = duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getExpansion() {
|
||||||
|
return expansion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpansion(float expansion) {
|
||||||
|
if (this.expansion == expansion) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Infer state from previous value
|
||||||
|
float delta = expansion - this.expansion;
|
||||||
|
if (expansion == 0) {
|
||||||
|
state = COLLAPSED;
|
||||||
|
} else if (expansion == 1) {
|
||||||
|
state = EXPANDED;
|
||||||
|
} else if (delta < 0) {
|
||||||
|
state = COLLAPSING;
|
||||||
|
} else if (delta > 0) {
|
||||||
|
state = EXPANDING;
|
||||||
|
}
|
||||||
|
|
||||||
|
setVisibility(state == COLLAPSED ? GONE : VISIBLE);
|
||||||
|
this.expansion = expansion;
|
||||||
|
requestLayout();
|
||||||
|
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onExpansionUpdate(expansion, state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getParallax() {
|
||||||
|
return parallax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParallax(float parallax) {
|
||||||
|
// Make sure parallax is between 0 and 1
|
||||||
|
parallax = Math.min(1, Math.max(0, parallax));
|
||||||
|
this.parallax = parallax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOrientation() {
|
||||||
|
return orientation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrientation(int orientation) {
|
||||||
|
if (orientation < 0 || orientation > 1) {
|
||||||
|
throw new IllegalArgumentException("Orientation must be either 0 (horizontal) or 1 (vertical)");
|
||||||
|
}
|
||||||
|
this.orientation = orientation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnExpansionUpdateListener(ExpandableLayout.OnExpansionUpdateListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void animateSize(int targetExpansion) {
|
||||||
|
if (animator != null) {
|
||||||
|
animator.cancel();
|
||||||
|
animator = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||||
|
|
||||||
|
animator = ValueAnimator.ofFloat(expansion, targetExpansion);
|
||||||
|
animator.setInterpolator(interpolator);
|
||||||
|
animator.setDuration(duration);
|
||||||
|
|
||||||
|
animator.addUpdateListener(valueAnimator -> setExpansion((float) valueAnimator.getAnimatedValue()));
|
||||||
|
animator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
super.onAnimationEnd(animation);
|
||||||
|
|
||||||
|
setLayerType(View.LAYER_TYPE_NONE, null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
animator.addListener(new ExpandableLayout.ExpansionListener(targetExpansion));
|
||||||
|
|
||||||
|
animator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnExpansionUpdateListener {
|
||||||
|
/**
|
||||||
|
* Callback for expansion updates
|
||||||
|
*
|
||||||
|
* @param expansionFraction Value between 0 (collapsed) and 1 (expanded) representing the the expansion progress
|
||||||
|
* @param state One of {@link ExpandableLayout.State} repesenting the current expansion state
|
||||||
|
*/
|
||||||
|
void onExpansionUpdate(float expansionFraction, int state);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ExpansionListener implements Animator.AnimatorListener {
|
||||||
|
private int targetExpansion;
|
||||||
|
private boolean canceled;
|
||||||
|
|
||||||
|
public ExpansionListener(int targetExpansion) {
|
||||||
|
this.targetExpansion = targetExpansion;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(Animator animation) {
|
||||||
|
state = targetExpansion == 0 ? COLLAPSING : EXPANDING;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
if (!canceled) {
|
||||||
|
state = targetExpansion == 0 ? COLLAPSED : EXPANDED;
|
||||||
|
setExpansion(targetExpansion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancel(Animator animation) {
|
||||||
|
canceled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationRepeat(Animator animation) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.expandablelayout;
|
||||||
|
|
||||||
|
public class FastOutSlowInInterpolator extends LookupTableInterpolator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lookup table values sampled with x at regular intervals between 0 and 1 for a total of
|
||||||
|
* 201 points.
|
||||||
|
*/
|
||||||
|
private static final float[] VALUES = new float[] {
|
||||||
|
0.0000f, 0.0001f, 0.0002f, 0.0005f, 0.0009f, 0.0014f, 0.0020f,
|
||||||
|
0.0027f, 0.0036f, 0.0046f, 0.0058f, 0.0071f, 0.0085f, 0.0101f,
|
||||||
|
0.0118f, 0.0137f, 0.0158f, 0.0180f, 0.0205f, 0.0231f, 0.0259f,
|
||||||
|
0.0289f, 0.0321f, 0.0355f, 0.0391f, 0.0430f, 0.0471f, 0.0514f,
|
||||||
|
0.0560f, 0.0608f, 0.0660f, 0.0714f, 0.0771f, 0.0830f, 0.0893f,
|
||||||
|
0.0959f, 0.1029f, 0.1101f, 0.1177f, 0.1257f, 0.1339f, 0.1426f,
|
||||||
|
0.1516f, 0.1610f, 0.1707f, 0.1808f, 0.1913f, 0.2021f, 0.2133f,
|
||||||
|
0.2248f, 0.2366f, 0.2487f, 0.2611f, 0.2738f, 0.2867f, 0.2998f,
|
||||||
|
0.3131f, 0.3265f, 0.3400f, 0.3536f, 0.3673f, 0.3810f, 0.3946f,
|
||||||
|
0.4082f, 0.4217f, 0.4352f, 0.4485f, 0.4616f, 0.4746f, 0.4874f,
|
||||||
|
0.5000f, 0.5124f, 0.5246f, 0.5365f, 0.5482f, 0.5597f, 0.5710f,
|
||||||
|
0.5820f, 0.5928f, 0.6033f, 0.6136f, 0.6237f, 0.6335f, 0.6431f,
|
||||||
|
0.6525f, 0.6616f, 0.6706f, 0.6793f, 0.6878f, 0.6961f, 0.7043f,
|
||||||
|
0.7122f, 0.7199f, 0.7275f, 0.7349f, 0.7421f, 0.7491f, 0.7559f,
|
||||||
|
0.7626f, 0.7692f, 0.7756f, 0.7818f, 0.7879f, 0.7938f, 0.7996f,
|
||||||
|
0.8053f, 0.8108f, 0.8162f, 0.8215f, 0.8266f, 0.8317f, 0.8366f,
|
||||||
|
0.8414f, 0.8461f, 0.8507f, 0.8551f, 0.8595f, 0.8638f, 0.8679f,
|
||||||
|
0.8720f, 0.8760f, 0.8798f, 0.8836f, 0.8873f, 0.8909f, 0.8945f,
|
||||||
|
0.8979f, 0.9013f, 0.9046f, 0.9078f, 0.9109f, 0.9139f, 0.9169f,
|
||||||
|
0.9198f, 0.9227f, 0.9254f, 0.9281f, 0.9307f, 0.9333f, 0.9358f,
|
||||||
|
0.9382f, 0.9406f, 0.9429f, 0.9452f, 0.9474f, 0.9495f, 0.9516f,
|
||||||
|
0.9536f, 0.9556f, 0.9575f, 0.9594f, 0.9612f, 0.9629f, 0.9646f,
|
||||||
|
0.9663f, 0.9679f, 0.9695f, 0.9710f, 0.9725f, 0.9739f, 0.9753f,
|
||||||
|
0.9766f, 0.9779f, 0.9791f, 0.9803f, 0.9815f, 0.9826f, 0.9837f,
|
||||||
|
0.9848f, 0.9858f, 0.9867f, 0.9877f, 0.9885f, 0.9894f, 0.9902f,
|
||||||
|
0.9910f, 0.9917f, 0.9924f, 0.9931f, 0.9937f, 0.9944f, 0.9949f,
|
||||||
|
0.9955f, 0.9960f, 0.9964f, 0.9969f, 0.9973f, 0.9977f, 0.9980f,
|
||||||
|
0.9984f, 0.9986f, 0.9989f, 0.9991f, 0.9993f, 0.9995f, 0.9997f,
|
||||||
|
0.9998f, 0.9999f, 0.9999f, 1.0000f, 1.0000f
|
||||||
|
};
|
||||||
|
|
||||||
|
public FastOutSlowInInterpolator() {
|
||||||
|
super(VALUES);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.expandablelayout;
|
||||||
|
|
||||||
|
import android.view.animation.Interpolator;
|
||||||
|
|
||||||
|
abstract class LookupTableInterpolator implements Interpolator {
|
||||||
|
|
||||||
|
private final float[] mValues;
|
||||||
|
private final float mStepSize;
|
||||||
|
|
||||||
|
public LookupTableInterpolator(float[] values) {
|
||||||
|
mValues = values;
|
||||||
|
mStepSize = 1f / (mValues.length - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getInterpolation(float input) {
|
||||||
|
if (input >= 1.0f) {
|
||||||
|
return 1.0f;
|
||||||
|
}
|
||||||
|
if (input <= 0f) {
|
||||||
|
return 0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate index - We use min with length - 2 to avoid IndexOutOfBoundsException when
|
||||||
|
// we lerp (linearly interpolate) in the return statement
|
||||||
|
int position = Math.min((int) (input * (mValues.length - 1)), mValues.length - 2);
|
||||||
|
|
||||||
|
// Calculate values to account for small offsets as the lookup table has discrete values
|
||||||
|
float quantized = position * mStepSize;
|
||||||
|
float diff = input - quantized;
|
||||||
|
float weight = diff / mStepSize;
|
||||||
|
|
||||||
|
// Linearly interpolate between the table values
|
||||||
|
return mValues[position] + weight * (mValues[position + 1] - mValues[position]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -77,12 +77,14 @@ public class BottomSheetFragmentLUContentView extends BottomSheetFragmentBaseVie
|
|||||||
this.mViewModel.getObservableMtbColt().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
this.mViewModel.getObservableMtbColt().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
if(mViewModel.getObservableMtbColt().get() != null) {
|
var mtbColt = mViewModel.getObservableMtbColt().get();
|
||||||
|
|
||||||
|
if (mtbColt != null) {
|
||||||
initAdapter();
|
initAdapter();
|
||||||
|
|
||||||
onMtbColrItemChanged();
|
onMtbColrItemChanged();
|
||||||
|
|
||||||
mViewModel.getObservableMtbColt().get().getMtbColr().addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
mtbColt.getMtbColr().addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(ObservableList sender) {
|
public void onChanged(ObservableList sender) {
|
||||||
onMtbColrItemChanged();
|
onMtbColrItemChanged();
|
||||||
@@ -99,6 +101,7 @@ public class BottomSheetFragmentLUContentView extends BottomSheetFragmentBaseVie
|
|||||||
List<MtbColr> mtbColrs = mViewModel.getObservableMtbColt().get().getMtbColr();
|
List<MtbColr> mtbColrs = mViewModel.getObservableMtbColt().get().getMtbColr();
|
||||||
mBinding.textviewArtCounter.setText(String.valueOf(mtbColrs.size()));
|
mBinding.textviewArtCounter.setText(String.valueOf(mtbColrs.size()));
|
||||||
mBinding.textviewArtDescription.setText(mContext.getResources().getQuantityString(R.plurals.articles, mtbColrs.size()));
|
mBinding.textviewArtDescription.setText(mContext.getResources().getQuantityString(R.plurals.articles, mtbColrs.size()));
|
||||||
|
mViewModel.calcPesi();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BottomSheetFragmentLUContentView setListener(Listener listener) {
|
public BottomSheetFragmentLUContentView setListener(Listener listener) {
|
||||||
@@ -129,12 +132,12 @@ public class BottomSheetFragmentLUContentView extends BottomSheetFragmentBaseVie
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMtbColrEdit(MtbColr mtbColr) {
|
public void onMtbColrEdit(MtbColr mtbColr) {
|
||||||
if(mListener != null) this.mListener.onMtbColrEdit(mtbColr);
|
if (mListener != null) this.mListener.onMtbColrEdit(mtbColr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMtbColrDelete(MtbColr mtbColr) {
|
public void onMtbColrDelete(MtbColr mtbColr) {
|
||||||
if(mListener != null) this.mListener.onMtbColrDelete(mtbColr);
|
if (mListener != null) this.mListener.onMtbColrDelete(mtbColr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,24 @@ package it.integry.integrywmsnative.view.bottom_sheet__lu_content;
|
|||||||
|
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
|
|
||||||
public class BottomSheetFragmentLUContentViewModel {
|
public class BottomSheetFragmentLUContentViewModel {
|
||||||
|
|
||||||
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||||
|
public ObservableField<String> pesoKg = new ObservableField<>();
|
||||||
|
public ObservableField<String> pesoNettoKg = new ObservableField<>();
|
||||||
private Listener mListener;
|
private Listener mListener;
|
||||||
private MtbColrListener mMtbColrListener;
|
private MtbColrListener mMtbColrListener;
|
||||||
|
|
||||||
public void closeCurrentLU() {
|
public void closeCurrentLU() {
|
||||||
if(this.mListener != null) this.mListener.onBottomSheetLUClose();
|
if (this.mListener != null) this.mListener.onBottomSheetLUClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BottomSheetFragmentLUContentViewModel setMtbColt(MtbColt mtbColt) {
|
public BottomSheetFragmentLUContentViewModel setMtbColt(MtbColt mtbColt) {
|
||||||
@@ -33,6 +41,26 @@ public class BottomSheetFragmentLUContentViewModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void calcPesi() {
|
||||||
|
MtbColt collo = this.mtbColt.get();
|
||||||
|
if (collo != null) {
|
||||||
|
MtbTCol tipoPedana = collo.getMtbTCol();
|
||||||
|
BigDecimal taraPedana = tipoPedana != null ? tipoPedana.getTaraKg() : BigDecimal.ZERO;
|
||||||
|
BigDecimal pesoNetto = BigDecimal.ZERO;
|
||||||
|
for (MtbColr mtbColr : collo.getMtbColr()) {
|
||||||
|
MtbAart articolo = mtbColr.getMtbAart();
|
||||||
|
if (articolo != null) {
|
||||||
|
BigDecimal pesoRiga = articolo.isFlagQtaCnfFissaBoolean() ? mtbColr.getNumCnf().multiply(articolo.getPesoKg()) : mtbColr.getQtaCol();
|
||||||
|
BigDecimal pesoTara = articolo.getTaraKg().multiply(mtbColr.getNumCnf());
|
||||||
|
pesoRiga = pesoRiga.add(pesoTara);
|
||||||
|
pesoNetto = pesoNetto.add(pesoRiga);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.pesoNettoKg.set(pesoNetto.setScale(2, RoundingMode.CEILING).toString());
|
||||||
|
this.pesoKg.set(pesoNetto.add(taraPedana).setScale(2, RoundingMode.CEILING).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public interface Listener {
|
public interface Listener {
|
||||||
void onBottomSheetLUClose();
|
void onBottomSheetLUClose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.ask_should_versamento_automatico_ul;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogAskShouldVersamentoAutomaticoUlBinding;
|
||||||
|
|
||||||
|
public class DialogAskShouldVersamentoAutomaticoULView extends BaseDialogFragment {
|
||||||
|
|
||||||
|
private RunnableArgs<Boolean> mOnDismiss;
|
||||||
|
private DialogAskShouldVersamentoAutomaticoUlBinding mBindings;
|
||||||
|
|
||||||
|
private boolean returnValue = false;
|
||||||
|
|
||||||
|
public static DialogAskShouldVersamentoAutomaticoULView newInstance(@NotNull RunnableArgs<Boolean> onDismiss) {
|
||||||
|
return new DialogAskShouldVersamentoAutomaticoULView(onDismiss);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DialogAskShouldVersamentoAutomaticoULView(@NotNull RunnableArgs<Boolean> onDismiss) {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.mOnDismiss = onDismiss;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_ask_should_versamento_automatico_ul, container, false);
|
||||||
|
mBindings.setLifecycleOwner(this);
|
||||||
|
|
||||||
|
getDialog().setCanceledOnTouchOutside(false);
|
||||||
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
|
||||||
|
mBindings.setView(this);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
|
||||||
|
if (mOnDismiss != null) {
|
||||||
|
this.mOnDismiss.run(returnValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void confirm() {
|
||||||
|
this.returnValue = true;
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void abort() {
|
||||||
|
this.returnValue = false;
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.view.dialogs.base;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.ColorStateList;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -12,6 +11,7 @@ import androidx.databinding.DataBindingUtil;
|
|||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.DialogInputGeneralBinding;
|
import it.integry.integrywmsnative.databinding.DialogInputGeneralBinding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,7 +21,7 @@ import it.integry.integrywmsnative.databinding.DialogInputGeneralBinding;
|
|||||||
public class DialogSimpleInputHelper {
|
public class DialogSimpleInputHelper {
|
||||||
|
|
||||||
|
|
||||||
private static Dialog makeBase(Context mContext, String titleText, String valueText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
private static Dialog makeBase(Context mContext, String titleText, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
||||||
Dialog dialog = new Dialog(mContext);
|
Dialog dialog = new Dialog(mContext);
|
||||||
DialogSimpleInputViewModel viewModel = new DialogSimpleInputViewModel(dialog);
|
DialogSimpleInputViewModel viewModel = new DialogSimpleInputViewModel(dialog);
|
||||||
|
|
||||||
@@ -39,10 +39,14 @@ public class DialogSimpleInputHelper {
|
|||||||
|
|
||||||
//Title VIEW
|
//Title VIEW
|
||||||
mBinding.titleText.setText(titleText);
|
mBinding.titleText.setText(titleText);
|
||||||
if (valueText != null){
|
|
||||||
mBinding.generalInput.setText(valueText);
|
if (!UtilityString.isNullOrEmpty(hintText)){
|
||||||
|
mBinding.generalInput.setHint(hintText);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(defaultTextValue)){
|
||||||
|
mBinding.generalInput.setText(defaultTextValue);
|
||||||
}
|
}
|
||||||
ColorStateList colorStateList = ColorStateList.valueOf(Color.WHITE);
|
|
||||||
|
|
||||||
//Content View
|
//Content View
|
||||||
dialog.setCancelable(true);
|
dialog.setCancelable(true);
|
||||||
@@ -60,17 +64,19 @@ public class DialogSimpleInputHelper {
|
|||||||
return makeBase(mContext,
|
return makeBase(mContext,
|
||||||
title,
|
title,
|
||||||
null,
|
null,
|
||||||
|
null,
|
||||||
onPositiveClick,
|
onPositiveClick,
|
||||||
onNegativeClick);
|
onNegativeClick);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Dialog makeInputDialog(Context mContext, String title,String value, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
public static Dialog makeInputDialog(Context mContext, String title, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
||||||
|
|
||||||
return makeBase(mContext,
|
return makeBase(mContext,
|
||||||
title,
|
title,
|
||||||
value,
|
defaultTextValue,
|
||||||
|
hintText,
|
||||||
onPositiveClick,
|
onPositiveClick,
|
||||||
onNegativeClick);
|
onNegativeClick);
|
||||||
|
|
||||||
|
|||||||
@@ -62,11 +62,23 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
private final List<DialogChooseArtsFromListaArtsItemModel> mDataset;
|
private final List<DialogChooseArtsFromListaArtsItemModel> mDataset;
|
||||||
|
|
||||||
private int mBarcodeScannerIstanceID;
|
private int mBarcodeScannerIstanceID;
|
||||||
|
private Dialog mCurrentProgress;
|
||||||
|
private MtbAart selectedArt;
|
||||||
|
|
||||||
public static DialogChooseArtsFromListaArts newInstance(List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
public static DialogChooseArtsFromListaArts newInstance(List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
||||||
return new DialogChooseArtsFromListaArts(listaMtbColr, onItemsChoosed, onAbort);
|
return new DialogChooseArtsFromListaArts(listaMtbColr, onItemsChoosed, onAbort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static DialogChooseArtsFromListaArts newInstance(List<MtbColr> listaMtbColr, MtbAart mtbAart, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
||||||
|
DialogChooseArtsFromListaArts dialog = newInstance(listaMtbColr, onItemsChoosed, onAbort);
|
||||||
|
dialog.setSelectedArt(mtbAart);
|
||||||
|
return dialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedArt(MtbAart mtbAart) {
|
||||||
|
this.selectedArt = mtbAart;
|
||||||
|
}
|
||||||
|
|
||||||
private DialogChooseArtsFromListaArts(List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
private DialogChooseArtsFromListaArts(List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@@ -125,6 +137,14 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
return mBindings.getRoot();
|
return mBindings.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
|
||||||
|
if (selectedArt != null) {
|
||||||
|
this.loadArticolo(selectedArt.getBarCode(), null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
mBindings.listaArts.setNestedScrollingEnabled(false);
|
mBindings.listaArts.setNestedScrollingEnabled(false);
|
||||||
@@ -229,8 +249,6 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
||||||
@@ -242,14 +260,15 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(context);
|
openProgress();
|
||||||
|
|
||||||
|
|
||||||
if (UtilityBarcode.isEan13(data)) {
|
if (UtilityBarcode.isEan13(data)) {
|
||||||
this.loadArticolo(data.getStringValue(), null, progressDialog);
|
this.loadArticolo(data.getStringValue(), null);
|
||||||
} else if (UtilityBarcode.isEtichetta128(data)) {
|
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||||
this.executeEtichettaEan128(data, progressDialog);
|
this.executeEtichettaEan128(data);
|
||||||
} else {
|
} else {
|
||||||
progressDialog.dismiss();
|
closeProgress();
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,7 +276,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO) {
|
||||||
this.barcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
this.barcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||||
|
|
||||||
String barcodeProd = null;
|
String barcodeProd = null;
|
||||||
@@ -271,11 +290,11 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin) || !UtilityString.isNullOrEmpty(ean128Model.Content)) {
|
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin) || !UtilityString.isNullOrEmpty(ean128Model.Content)) {
|
||||||
this.loadArticolo(barcodeProd, ean128Model, progressDialog);
|
this.loadArticolo(barcodeProd, ean128Model);
|
||||||
} else {
|
} else {
|
||||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
progressDialog.dismiss();
|
closeProgress();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -285,18 +304,19 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
progressDialog.dismiss();
|
closeProgress();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(context, ex, progressDialog);
|
closeProgress();
|
||||||
|
UtilityExceptions.defaultException(context, ex);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Dialog progressDialog) {
|
private void loadArticolo(String barcodeProd, Ean128Model ean128Model) {
|
||||||
if (barcodeProd.length() == 14) {
|
if (barcodeProd.length() == 14) {
|
||||||
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
||||||
}
|
}
|
||||||
@@ -310,19 +330,20 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||||
|
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
progressDialog.dismiss();
|
closeProgress();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
progressDialog.dismiss();
|
closeProgress();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
|
closeProgress();
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
UtilityExceptions.defaultException(context, ex, progressDialog);
|
UtilityExceptions.defaultException(context, ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,5 +385,20 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
this.dismiss();
|
this.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void openProgress() {
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
if (this.mCurrentProgress == null) {
|
||||||
|
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void closeProgress() {
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
if (mCurrentProgress != null) {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,146 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.adapter.DialogInputLUProdTipoColloAdapter;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.adapter.DialogInputLUProdTipoColloListModel;
|
||||||
|
|
||||||
|
public class InfoAggiuntiveLUDialog extends BaseDialogFragment implements InfoAggiuntiveLUDialogViewModel.Listener {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
InfoAggiuntiveLUDialogViewModel mViewModel;
|
||||||
|
|
||||||
|
private DialogNoteAggiuntiveNuovaUlBinding mBindings;
|
||||||
|
private final RunnableArgss<String, MtbTCol> mOnComplete;
|
||||||
|
|
||||||
|
private DialogInputLUProdTipoColloAdapter codTcolArrayAdapter = null;
|
||||||
|
public ObservableField<String> additionalNotes = new ObservableField<>();
|
||||||
|
public ObservableField<String> selectedMtbTcol = new ObservableField<>();
|
||||||
|
public ObservableField<DialogInputLUProdTipoColloListModel> currentMtbTCol = new ObservableField<>();
|
||||||
|
|
||||||
|
public static InfoAggiuntiveLUDialog newInstance(@NotNull RunnableArgss<String, MtbTCol> onComplete) {
|
||||||
|
return new InfoAggiuntiveLUDialog(onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
private InfoAggiuntiveLUDialog(@NotNull RunnableArgss<String, MtbTCol> onComplete) {
|
||||||
|
super();
|
||||||
|
this.mOnComplete = onComplete;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
this.init();
|
||||||
|
|
||||||
|
UtilityDialog.setTo90PercentWidth(requireActivity(), this);
|
||||||
|
this.mViewModel.setListener(this);
|
||||||
|
this.mViewModel.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_note_aggiuntive_nuova_ul, container, false);
|
||||||
|
mBindings.setLifecycleOwner(this);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.infoAggiuntiveLUDialogComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
mBindings.setView(this);
|
||||||
|
mBindings.setViewModel(this.mViewModel);
|
||||||
|
|
||||||
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
getDialog().setCanceledOnTouchOutside(false);
|
||||||
|
getDialog().setCancelable(false);
|
||||||
|
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
|
if (mOnComplete != null)
|
||||||
|
mOnComplete.run(additionalNotes.get(), mViewModel.getInternalTipoPed());
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
|
||||||
|
|
||||||
|
UtilityObservable.addPropertyChanged(this.selectedMtbTcol, (value) -> {
|
||||||
|
if (this.codTcolArrayAdapter != null && this.codTcolArrayAdapter.getDataset() != null) {
|
||||||
|
Optional<DialogInputLUProdTipoColloListModel> selectedItem = Stream.of(this.codTcolArrayAdapter.getDataset())
|
||||||
|
.filter(x -> x.toString().equals(value))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (selectedItem.isPresent()) {
|
||||||
|
currentMtbTCol.set(selectedItem.get());
|
||||||
|
this.mViewModel.setInternalTipoPed(selectedItem.get().getOriginalModel());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.mViewModel.getTipiCollo().observe(getViewLifecycleOwner(), tipiCollo -> {
|
||||||
|
|
||||||
|
codTcolArrayAdapter = new DialogInputLUProdTipoColloAdapter(getActivity(), R.layout.array_adapter_single_item, tipiCollo);
|
||||||
|
mBindings.filledExposedDropdownCodTcol.setAdapter(codTcolArrayAdapter);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.mBindings.filledExposedDropdownCodTcol.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
|
currentMtbTCol.set(codTcolArrayAdapter.getItem(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||||
|
currentMtbTCol.set(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mBindings.buttonConfirm.setOnClickListener(v -> {
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface InfoAggiuntiveLUDialogComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
InfoAggiuntiveLUDialogComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(InfoAggiuntiveLUDialog infoAggiuntiveLUDialog);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||||
|
|
||||||
|
@Module(subcomponents = InfoAggiuntiveLUDialogComponent.class)
|
||||||
|
public class InfoAggiuntiveLUDialogModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
InfoAggiuntiveLUDialogViewModel providesInfoAggiuntiveLUDialogViewModel(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||||
|
return new InfoAggiuntiveLUDialogViewModel(magazzinoRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu;
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||||
|
|
||||||
|
public class InfoAggiuntiveLUDialogViewModel {
|
||||||
|
|
||||||
|
public final MutableLiveData<List<MtbTCol>> tipiCollo = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private MtbTCol internalTipoPed;
|
||||||
|
|
||||||
|
private Listener mListener;
|
||||||
|
|
||||||
|
private final MagazzinoRESTConsumer mMagazzinoRESTConsumer;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public InfoAggiuntiveLUDialogViewModel(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||||
|
this.mMagazzinoRESTConsumer = magazzinoRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
new Thread(this::sendOnLoadingStarted).start();
|
||||||
|
|
||||||
|
mMagazzinoRESTConsumer.getTipiCollo(tipiCollo -> {
|
||||||
|
this.tipiCollo.postValue(tipiCollo);
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MutableLiveData<List<MtbTCol>> getTipiCollo() {
|
||||||
|
return this.tipiCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setInternalTipoPed(MtbTCol internalTipoPed) {
|
||||||
|
this.internalTipoPed = internalTipoPed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MtbTCol getInternalTipoPed() {
|
||||||
|
return internalTipoPed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingStarted() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingEnded() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendError(Exception ex) {
|
||||||
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
|
void onError(Exception ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -100,7 +100,6 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -154,12 +153,12 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
|||||||
});
|
});
|
||||||
|
|
||||||
UtilityObservable.addPropertyChanged(this.selectedMtbTcol, (value) -> {
|
UtilityObservable.addPropertyChanged(this.selectedMtbTcol, (value) -> {
|
||||||
if(this.codTcolArrayAdapter != null && this.codTcolArrayAdapter.getDataset() != null) {
|
if (this.codTcolArrayAdapter != null && this.codTcolArrayAdapter.getDataset() != null) {
|
||||||
Optional<DialogInputLUProdTipoColloListModel> selectedItem = Stream.of(this.codTcolArrayAdapter.getDataset())
|
Optional<DialogInputLUProdTipoColloListModel> selectedItem = Stream.of(this.codTcolArrayAdapter.getDataset())
|
||||||
.filter(x -> x.toString().equals(value))
|
.filter(x -> x.toString().equals(value))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(selectedItem.isPresent()) {
|
if (selectedItem.isPresent()) {
|
||||||
currentMtbTCol.set(selectedItem.get());
|
currentMtbTCol.set(selectedItem.get());
|
||||||
this.mViewModel.setInternalTipoPed(selectedItem.get().getOriginalModel());
|
this.mViewModel.setInternalTipoPed(selectedItem.get().getOriginalModel());
|
||||||
}
|
}
|
||||||
@@ -171,12 +170,12 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
|||||||
});
|
});
|
||||||
|
|
||||||
UtilityObservable.addPropertyChanged(this.selectedLineaProd, (value) -> {
|
UtilityObservable.addPropertyChanged(this.selectedLineaProd, (value) -> {
|
||||||
if(this.lineeProdArrayAdapter != null && this.lineeProdArrayAdapter.getDataset() != null) {
|
if (this.lineeProdArrayAdapter != null && this.lineeProdArrayAdapter.getDataset() != null) {
|
||||||
Optional<DialogInputLULineeProdListModel> selectedItem = Stream.of(this.lineeProdArrayAdapter.getDataset())
|
Optional<DialogInputLULineeProdListModel> selectedItem = Stream.of(this.lineeProdArrayAdapter.getDataset())
|
||||||
.filter(x -> x.toString().equals(value))
|
.filter(x -> x.toString().equals(value))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(selectedItem.isPresent()) {
|
if (selectedItem.isPresent()) {
|
||||||
currentLineaProd.set(selectedItem.get());
|
currentLineaProd.set(selectedItem.get());
|
||||||
this.mViewModel.setInternalLineaProd(selectedItem.get().getOriginalModel());
|
this.mViewModel.setInternalLineaProd(selectedItem.get().getOriginalModel());
|
||||||
}
|
}
|
||||||
@@ -196,7 +195,7 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
|||||||
});
|
});
|
||||||
|
|
||||||
UtilityObservable.addPropertyChanged(this.currentPesoNetto, (value) -> {
|
UtilityObservable.addPropertyChanged(this.currentPesoNetto, (value) -> {
|
||||||
if(value != null) {
|
if (value != null) {
|
||||||
this.currentPesoNetto.set(value.setScale(0, RoundingMode.HALF_UP));
|
this.currentPesoNetto.set(value.setScale(0, RoundingMode.HALF_UP));
|
||||||
}
|
}
|
||||||
if (this.mEnableDataCallback) {
|
if (this.mEnableDataCallback) {
|
||||||
@@ -217,7 +216,7 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
|||||||
});
|
});
|
||||||
|
|
||||||
UtilityObservable.addPropertyChanged(this.currentPesoLordo, (value) -> {
|
UtilityObservable.addPropertyChanged(this.currentPesoLordo, (value) -> {
|
||||||
if(value != null) {
|
if (value != null) {
|
||||||
this.currentPesoLordo.set(value.setScale(0, RoundingMode.HALF_UP));
|
this.currentPesoLordo.set(value.setScale(0, RoundingMode.HALF_UP));
|
||||||
}
|
}
|
||||||
if (this.mEnableDataCallback) {
|
if (this.mEnableDataCallback) {
|
||||||
@@ -322,12 +321,12 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
|||||||
codTcolArrayAdapter = new DialogInputLUProdTipoColloAdapter(getActivity(), R.layout.array_adapter_single_item, tipiCollo);
|
codTcolArrayAdapter = new DialogInputLUProdTipoColloAdapter(getActivity(), R.layout.array_adapter_single_item, tipiCollo);
|
||||||
mBindings.filledExposedDropdownCodTcol.setAdapter(codTcolArrayAdapter);
|
mBindings.filledExposedDropdownCodTcol.setAdapter(codTcolArrayAdapter);
|
||||||
|
|
||||||
if(mDialogInputLUProdDTO.getCodTcol() != null) {
|
if (mDialogInputLUProdDTO.getCodTcol() != null) {
|
||||||
Optional<MtbTCol> optTCol = Stream.of(tipiCollo)
|
Optional<MtbTCol> optTCol = Stream.of(tipiCollo)
|
||||||
.filter(x -> x.getCodTcol().equalsIgnoreCase(mDialogInputLUProdDTO.getCodTcol()))
|
.filter(x -> x.getCodTcol().equalsIgnoreCase(mDialogInputLUProdDTO.getCodTcol()))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(optTCol.isPresent())
|
if (optTCol.isPresent())
|
||||||
selectedMtbTcol.set(new DialogInputLUProdTipoColloListModel().setOriginalModel(optTCol.get()).toString());
|
selectedMtbTcol.set(new DialogInputLUProdTipoColloListModel().setOriginalModel(optTCol.get()).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,12 +340,12 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
|||||||
lineeProdArrayAdapter = new DialogInputLULineeProdAdapter(getActivity(), R.layout.array_adapter_single_item, lineeProd);
|
lineeProdArrayAdapter = new DialogInputLULineeProdAdapter(getActivity(), R.layout.array_adapter_single_item, lineeProd);
|
||||||
mBindings.filledExposedDropdownCodJfas.setAdapter(lineeProdArrayAdapter);
|
mBindings.filledExposedDropdownCodJfas.setAdapter(lineeProdArrayAdapter);
|
||||||
|
|
||||||
if(mDialogInputLUProdDTO.getSuggestedCodJfas() != null) {
|
if (mDialogInputLUProdDTO.getSuggestedCodJfas() != null) {
|
||||||
Optional<JtbFasi> optFas = Stream.of(lineeProd)
|
Optional<JtbFasi> optFas = Stream.of(lineeProd)
|
||||||
.filter(x -> x.getCodJfas().equalsIgnoreCase(mDialogInputLUProdDTO.getSuggestedCodJfas()))
|
.filter(x -> x.getCodJfas().equalsIgnoreCase(mDialogInputLUProdDTO.getSuggestedCodJfas()))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(optFas.isPresent())
|
if (optFas.isPresent())
|
||||||
selectedLineaProd.set(new DialogInputLULineeProdListModel().setOriginalModel(optFas.get()).toString());
|
selectedLineaProd.set(new DialogInputLULineeProdListModel().setOriginalModel(optFas.get()).toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -372,9 +371,6 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void resetValues() {
|
public void resetValues() {
|
||||||
this.mViewModel.blockedNumCnf.set(false);
|
this.mViewModel.blockedNumCnf.set(false);
|
||||||
this.mViewModel.blockedPesoLordo.set(false);
|
this.mViewModel.blockedPesoLordo.set(false);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public class DialogInputQuantityV2DTO {
|
|||||||
private boolean isDataScadMandatory = false;
|
private boolean isDataScadMandatory = false;
|
||||||
private boolean isNotesAllowed = false;
|
private boolean isNotesAllowed = false;
|
||||||
private boolean canLUBeClosed;
|
private boolean canLUBeClosed;
|
||||||
|
private boolean saveOnImeDone = false;
|
||||||
|
|
||||||
private String partitaMag;
|
private String partitaMag;
|
||||||
private String note;
|
private String note;
|
||||||
@@ -236,4 +237,13 @@ public class DialogInputQuantityV2DTO {
|
|||||||
this.suggestPartitaMag = suggestPartitaMag;
|
this.suggestPartitaMag = suggestPartitaMag;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSaveOnImeDone() {
|
||||||
|
return saveOnImeDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2DTO setSaveOnImeDone(boolean saveOnImeDone) {
|
||||||
|
this.saveOnImeDone = saveOnImeDone;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
@@ -12,6 +10,7 @@ import android.text.SpannableString;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -27,6 +26,7 @@ import com.pedromassango.doubleclick.DoubleClickListener;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -39,6 +39,7 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|||||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
@@ -51,9 +52,12 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
@Inject
|
@Inject
|
||||||
DialogInputQuantityV2ViewModel mViewModel;
|
DialogInputQuantityV2ViewModel mViewModel;
|
||||||
|
|
||||||
private DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
private final DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
||||||
private RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
|
private final RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
|
||||||
private Runnable mOnAbort;
|
private final Runnable mOnAbort;
|
||||||
|
|
||||||
|
public ObservableField<Integer> currentTextNumCnfToTake = new ObservableField<>(0);
|
||||||
|
public ObservableField<Integer> currentTextNumPezziToTake = new ObservableField<>(0);
|
||||||
|
|
||||||
public ObservableField<String> currentPartitaMag = new ObservableField<>();
|
public ObservableField<String> currentPartitaMag = new ObservableField<>();
|
||||||
public ObservableField<String> currentNotes = new ObservableField<>();
|
public ObservableField<String> currentNotes = new ObservableField<>();
|
||||||
@@ -63,9 +67,14 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
public ObservableField<BigDecimal> currentQtaCnf = new ObservableField<>();
|
public ObservableField<BigDecimal> currentQtaCnf = new ObservableField<>();
|
||||||
public ObservableField<BigDecimal> currentQtaTot = new ObservableField<>();
|
public ObservableField<BigDecimal> currentQtaTot = new ObservableField<>();
|
||||||
|
|
||||||
|
public ObservableField<BigDecimal> currentTaraTot = new ObservableField<>();
|
||||||
|
public ObservableField<BigDecimal> currentTaraArticolo = new ObservableField<>();
|
||||||
|
public ObservableField<BigDecimal> currentPesoLordo = new ObservableField<>();
|
||||||
|
|
||||||
public ObservableField<Boolean> enabledNumCnf = new ObservableField<>(true);
|
public ObservableField<Boolean> enabledNumCnf = new ObservableField<>(true);
|
||||||
public ObservableField<Boolean> enabledQtaCnf = new ObservableField<>(true);
|
public ObservableField<Boolean> enabledQtaCnf = new ObservableField<>(true);
|
||||||
public ObservableField<Boolean> enabledQtaTot = new ObservableField<>(true);
|
public ObservableField<Boolean> enabledQtaTot = new ObservableField<>(true);
|
||||||
|
public ObservableField<Boolean> enabledPesoLordo = new ObservableField<>(false);
|
||||||
|
|
||||||
public ObservableField<Boolean> enabledChangePartitaMag = new ObservableField<>(true);
|
public ObservableField<Boolean> enabledChangePartitaMag = new ObservableField<>(true);
|
||||||
public ObservableField<Boolean> enabledNotes = new ObservableField<>(false);
|
public ObservableField<Boolean> enabledNotes = new ObservableField<>(false);
|
||||||
@@ -94,7 +103,6 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setStyle(DialogFragment.STYLE_NORMAL, R.style.AppTheme_NewMaterial_Dialog_FullscreenDialog);
|
setStyle(DialogFragment.STYLE_NORMAL, R.style.AppTheme_NewMaterial_Dialog_FullscreenDialog);
|
||||||
|
|
||||||
this.initBarcode();
|
this.initBarcode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +113,6 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
|
|
||||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_input_quantity_v2, container, false);
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_input_quantity_v2, container, false);
|
||||||
mBindings.setLifecycleOwner(this);
|
mBindings.setLifecycleOwner(this);
|
||||||
|
|
||||||
mBindings.toolbar.setTitle("Inserimento articolo");
|
mBindings.toolbar.setTitle("Inserimento articolo");
|
||||||
|
|
||||||
MainApplication.appComponent
|
MainApplication.appComponent
|
||||||
@@ -141,7 +148,17 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
mBindings.inputQtaTotText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
mBindings.inputQtaTotText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
|
if (mDialogInputQuantityV2DTO.isSaveOnImeDone()) {
|
||||||
|
|
||||||
|
mBindings.inputNumCnfText.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||||
|
save();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
return mBindings.getRoot();
|
return mBindings.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,21 +211,41 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
|
|
||||||
UtilityObservable.addPropertyChanged(this.currentPartitaMag, (value) -> {
|
UtilityObservable.addPropertyChanged(this.currentPartitaMag, (value) -> {
|
||||||
if (this.mEnableDataCallback) {
|
if (this.mEnableDataCallback) {
|
||||||
this.mViewModel.setPartitaMag(value);
|
this.mViewModel.setPartitaMag(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
UtilityObservable.addPropertyChanged(this.currentNotes, (value) -> {
|
UtilityObservable.addPropertyChanged(this.currentDataScad, (value) -> {
|
||||||
if (this.mEnableDataCallback) {
|
if (this.mEnableDataCallback) {
|
||||||
this.mViewModel.setNote(value);
|
MtbAart mtbAart = this.mViewModel.getMtbAart();
|
||||||
|
if (value != null && mtbAart != null && mtbAart.getGgScadPartita() != null && mtbAart.getGgScadPartita() > 0) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DATE, mtbAart.getGgScadPartita());
|
||||||
|
Date minDataScad = calendar.getTime();
|
||||||
|
if (minDataScad.after(value) && value.after(new Date())) {
|
||||||
|
DialogSimpleMessageView
|
||||||
|
.makeWarningDialog(new SpannableString("La data selezionata è precedente alla data di scadenza consigliata per l'articolo scelto ( " + mtbAart.getGgScadPartita() + " giorni) . Continuare?"), null, () -> {
|
||||||
|
this.mViewModel.setDataScad(value);
|
||||||
|
}, () -> {
|
||||||
|
this.currentDataScad.set(null);
|
||||||
|
})
|
||||||
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
} else {
|
||||||
|
this.mViewModel.setDataScad(value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.mViewModel.setDataScad(value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
UtilityObservable.addPropertyChanged(this.currentDataScad, (value) -> {
|
UtilityObservable.addPropertyChanged(this.currentNotes, (value) -> {
|
||||||
if (this.mEnableDataCallback) {
|
if (this.mEnableDataCallback) {
|
||||||
this.mViewModel.setDataScad(value);
|
this.mViewModel.setNote(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -339,6 +376,18 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
this.mViewModel.shouldAskDataScad = this.mDialogInputQuantityV2DTO.isDataScadMandatory();
|
this.mViewModel.shouldAskDataScad = this.mDialogInputQuantityV2DTO.isDataScadMandatory();
|
||||||
this.enabledNotes.set(this.mDialogInputQuantityV2DTO.isNotesAllowed());
|
this.enabledNotes.set(this.mDialogInputQuantityV2DTO.isNotesAllowed());
|
||||||
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
|
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
|
||||||
|
this.currentTaraArticolo.set(this.mViewModel.getMtbAart().getTaraKg());
|
||||||
|
|
||||||
|
if (this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd() != null) {
|
||||||
|
this.currentTextNumCnfToTake.set(this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().intValue());
|
||||||
|
int qtaText = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().intValue() % this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().intValue();
|
||||||
|
this.currentTextNumPezziToTake.set(qtaText);
|
||||||
|
} else {
|
||||||
|
this.currentTextNumCnfToTake.set(0);
|
||||||
|
this.currentTextNumPezziToTake.set(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -364,11 +413,17 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
this.currentPartitaMag.set(this.mViewModel.getPartitaMag());
|
this.currentPartitaMag.set(this.mViewModel.getPartitaMag());
|
||||||
this.currentNotes.set(this.mViewModel.getNote());
|
this.currentNotes.set(this.mViewModel.getNote());
|
||||||
this.currentDataScad.set(this.mViewModel.getDataScad());
|
this.currentDataScad.set(this.mViewModel.getDataScad());
|
||||||
|
|
||||||
this.currentNumCnf.set(this.mViewModel.getNumCnf());
|
this.currentNumCnf.set(this.mViewModel.getNumCnf());
|
||||||
this.currentQtaCnf.set(this.mViewModel.getQtaCnf());
|
this.currentQtaCnf.set(this.mViewModel.getQtaCnf());
|
||||||
this.currentQtaTot.set(this.mViewModel.getQtaTot());
|
this.currentQtaTot.set(this.mViewModel.getQtaTot());
|
||||||
|
|
||||||
|
MtbAart articolo = this.mViewModel.getMtbAart();
|
||||||
|
if (articolo != null && !articolo.isFlagQtaCnfFissaBoolean()) {
|
||||||
|
BigDecimal taraTot = this.mViewModel.getNumCnf().multiply(articolo.getTaraKg());
|
||||||
|
this.currentTaraTot.set(taraTot);
|
||||||
|
this.currentPesoLordo.set(this.mViewModel.getQtaTot().add(taraTot));
|
||||||
|
}
|
||||||
|
|
||||||
this.mBindings.executePendingBindings();
|
this.mBindings.executePendingBindings();
|
||||||
|
|
||||||
this.mEnableDataCallback = true;
|
this.mEnableDataCallback = true;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
private String internalNote;
|
private String internalNote;
|
||||||
private Date internalDataScad;
|
private Date internalDataScad;
|
||||||
|
|
||||||
private RunnableArgsWithReturn<DialogInputQuantityV2ViewModel,String> suggestPartitaMagRunnable;
|
private RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> suggestPartitaMagRunnable;
|
||||||
|
|
||||||
private boolean canOverflowOrderQuantity;
|
private boolean canOverflowOrderQuantity;
|
||||||
private boolean canPartitaMagBeChanged;
|
private boolean canPartitaMagBeChanged;
|
||||||
@@ -102,7 +102,7 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
this.internalQtaTot = totalQtaOrd;
|
this.internalQtaTot = totalQtaOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shouldAskDataScad == null){
|
if (this.shouldAskDataScad == null) {
|
||||||
this.shouldAskDataScad = mtbAart.get().isFlagTracciabilitaBoolean() && mtbAart.get().getGgScadPartita() != null && mtbAart.get().getGgScadPartita() > 0;
|
this.shouldAskDataScad = mtbAart.get().isFlagTracciabilitaBoolean() && mtbAart.get().getGgScadPartita() != null && mtbAart.get().getGgScadPartita() > 0;
|
||||||
}
|
}
|
||||||
this.shouldShowDataScad = this.shouldAskDataScad || this.internalDataScad != null;
|
this.shouldShowDataScad = this.shouldAskDataScad || this.internalDataScad != null;
|
||||||
@@ -151,7 +151,7 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(canPartitaMagBeChanged) {
|
if (canPartitaMagBeChanged) {
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
if (!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||||
this.setPartitaMag(ean128Model.BatchLot);
|
this.setPartitaMag(ean128Model.BatchLot);
|
||||||
@@ -334,10 +334,11 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
this.internalQtaTot = UtilityBigDecimal.multiply(newValue, this.internalQtaCnf);
|
this.internalQtaTot = UtilityBigDecimal.multiply(newValue, this.internalQtaCnf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UPDATE_QTA_TOT:if (!this.blockedQtaTot.get() && this.internalQtaCnf != null)
|
case UPDATE_QTA_TOT:
|
||||||
this.internalQtaTot = UtilityBigDecimal.multiply(newValue, this.internalQtaCnf);
|
if (!this.blockedQtaTot.get() && this.internalQtaCnf != null)
|
||||||
else if (!this.blockedQtaCnf.get() && !this.mtbAart.get().isFlagQtaCnfFissaBoolean() && this.internalQtaTot != null)
|
this.internalQtaTot = UtilityBigDecimal.multiply(newValue, this.internalQtaCnf);
|
||||||
this.internalQtaCnf = UtilityBigDecimal.divide(internalQtaTot, newValue);
|
else if (!this.blockedQtaCnf.get() && !this.mtbAart.get().isFlagQtaCnfFissaBoolean() && this.internalQtaTot != null)
|
||||||
|
this.internalQtaCnf = UtilityBigDecimal.divide(internalQtaTot, newValue);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -403,13 +404,13 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
} else if (mtbAart.get().isFlagTracciabilitaBoolean() && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
} else if (mtbAart.get().isFlagTracciabilitaBoolean() && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||||
if (suggestPartitaMagRunnable != null){
|
if (suggestPartitaMagRunnable != null) {
|
||||||
internalPartitaMag = suggestPartitaMagRunnable.run(this);
|
internalPartitaMag = suggestPartitaMagRunnable.run(this);
|
||||||
if (internalPartitaMag == null){
|
if (internalPartitaMag == null) {
|
||||||
this.mListener.onError(new InvalidBatchLotException());
|
this.mListener.onError(new InvalidBatchLotException());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
this.mListener.onError(new InvalidBatchLotException());
|
this.mListener.onError(new InvalidBatchLotException());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -480,11 +481,16 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DialogInputQuantityV2ViewModel setSuggestPartitaMagRunnable(RunnableArgsWithReturn<DialogInputQuantityV2ViewModel,String> suggestPartitaMagRunnable) {
|
public DialogInputQuantityV2ViewModel setSuggestPartitaMagRunnable(RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> suggestPartitaMagRunnable) {
|
||||||
this.suggestPartitaMagRunnable = suggestPartitaMagRunnable;
|
this.suggestPartitaMagRunnable = suggestPartitaMagRunnable;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MtbAart getMtbAart() {
|
||||||
|
return this.mtbAart.get();
|
||||||
|
}
|
||||||
|
|
||||||
public interface Listener {
|
public interface Listener {
|
||||||
void onDataChanged();
|
void onDataChanged();
|
||||||
|
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu;
|
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
|
|
||||||
|
|
||||||
public class NoteAggiuntiveLUDialog {
|
|
||||||
|
|
||||||
private Dialog mDialog;
|
|
||||||
|
|
||||||
public static Dialog make(Context context, final RunnableArgs<String> onComplete, final Runnable onAbort) {
|
|
||||||
return new NoteAggiuntiveLUDialog(context, onComplete, onAbort).mDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
private NoteAggiuntiveLUDialog(Context context, final RunnableArgs<String> onComplete, final Runnable onAbort){
|
|
||||||
|
|
||||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
|
||||||
DialogNoteAggiuntiveNuovaUlBinding bindings = DataBindingUtil.inflate(inflater, R.layout.dialog_note_aggiuntive_nuova_ul, null, false);
|
|
||||||
|
|
||||||
mDialog = new Dialog(context);
|
|
||||||
mDialog.setContentView(bindings.getRoot());
|
|
||||||
|
|
||||||
mDialog.setCanceledOnTouchOutside(false);
|
|
||||||
mDialog.setCancelable(false);
|
|
||||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
|
|
||||||
bindings.buttonConfirm.setOnClickListener(v -> {
|
|
||||||
mDialog.dismiss();
|
|
||||||
if(onComplete != null) onComplete.run(bindings.additionalNotesText.getText().toString());
|
|
||||||
});
|
|
||||||
|
|
||||||
bindings.buttonAbort.setOnClickListener(v -> {
|
|
||||||
mDialog.dismiss();
|
|
||||||
if(onAbort != null) onAbort.run();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -8,6 +8,7 @@ import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
|||||||
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
@@ -17,6 +18,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
|
||||||
public class DialogScanOrCreateLUViewModel {
|
public class DialogScanOrCreateLUViewModel {
|
||||||
@@ -62,6 +64,8 @@ public class DialogScanOrCreateLUViewModel {
|
|||||||
this.executeEtichettaAnonima(barcodeScanDTO, onComplete);
|
this.executeEtichettaAnonima(barcodeScanDTO, onComplete);
|
||||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
this.executeEAN128(barcodeScanDTO, onComplete);
|
this.executeEAN128(barcodeScanDTO, onComplete);
|
||||||
|
} else if (UtilityBarcode.isEan13(barcodeScanDTO)) {
|
||||||
|
this.executeEAN13(barcodeScanDTO, onComplete);
|
||||||
} else {
|
} else {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}
|
}
|
||||||
@@ -73,8 +77,12 @@ public class DialogScanOrCreateLUViewModel {
|
|||||||
MtbDepoPosizione foundPosizione = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
MtbDepoPosizione foundPosizione = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
||||||
.filter(x -> x.getPosizione().equalsIgnoreCase(barcodeScanDTO.getStringValue()))
|
.filter(x -> x.getPosizione().equalsIgnoreCase(barcodeScanDTO.getStringValue()))
|
||||||
.single();
|
.single();
|
||||||
|
this.executePosizione(foundPosizione, onComplete);
|
||||||
|
|
||||||
this.mPosizioniRESTConsumer.getBancaliInPosizione(foundPosizione, mtbColtList -> {
|
}
|
||||||
|
|
||||||
|
private void executePosizione(MtbDepoPosizione posizione, Runnable onComplete) {
|
||||||
|
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
||||||
|
|
||||||
if (mtbColtList == null || mtbColtList.size() == 0) {
|
if (mtbColtList == null || mtbColtList.size() == 0) {
|
||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
@@ -88,7 +96,6 @@ public class DialogScanOrCreateLUViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -96,7 +103,7 @@ 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) {
|
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);
|
||||||
@@ -158,6 +165,22 @@ public class DialogScanOrCreateLUViewModel {
|
|||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void executeEAN13(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
this.mArticoloRESTConsumer.getByBarcodeProd(barcodeScanDTO.getStringValue(), articoli -> {
|
||||||
|
if (articoli.size() == 1) {
|
||||||
|
MtbAart articolo = articoli.get(0);
|
||||||
|
MtbDepoPosizione posizione = UtilityPosizione.getFromCache(articolo.getPosizione());
|
||||||
|
if (posizione != null && posizione.isFlagMonoCollo()) {
|
||||||
|
this.executePosizione(posizione, onComplete);
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
private void sendOnLUVenditaConfirmRequired(RunnableArgs<Boolean> onConfirm) {
|
private void sendOnLUVenditaConfirmRequired(RunnableArgs<Boolean> onConfirm) {
|
||||||
if (this.mListener != null) mListener.onLUVenditaConfirmRequired(onConfirm);
|
if (this.mListener != null) mListener.onLUVenditaConfirmRequired(onConfirm);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,170 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.versamento_automatico_ul_done;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogVersamentoAutomaticoUlDoneBinding;
|
||||||
|
|
||||||
|
public class DialogVersamentoAutomaticoULDoneView extends BaseDialogFragment {
|
||||||
|
|
||||||
|
public final VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO;
|
||||||
|
private final Runnable mOnDismiss;
|
||||||
|
|
||||||
|
private DialogVersamentoAutomaticoUlDoneBinding mBindings;
|
||||||
|
|
||||||
|
public static DialogVersamentoAutomaticoULDoneView newInstance(@NotNull VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, @NotNull Runnable onDismiss) {
|
||||||
|
return new DialogVersamentoAutomaticoULDoneView(versamentoAutomaticoULResponseDTO, onDismiss);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DialogVersamentoAutomaticoULDoneView(@NotNull VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, @NotNull Runnable onDismiss) {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.versamentoAutomaticoULResponseDTO = versamentoAutomaticoULResponseDTO;
|
||||||
|
this.mOnDismiss = onDismiss;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_versamento_automatico_ul_done, container, false);
|
||||||
|
mBindings.setLifecycleOwner(this);
|
||||||
|
|
||||||
|
getDialog().setCanceledOnTouchOutside(false);
|
||||||
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
|
||||||
|
UtilityDialog.setTo95PercentWidth(requireContext(), this);
|
||||||
|
|
||||||
|
mBindings.setView(this);
|
||||||
|
|
||||||
|
this.initTitle();
|
||||||
|
this.initContent();
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
|
||||||
|
if (mOnDismiss != null) {
|
||||||
|
this.mOnDismiss.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initTitle() {
|
||||||
|
int colorBackgroundTitle = -1;
|
||||||
|
|
||||||
|
if (versamentoAutomaticoULResponseDTO.getFailed() == null || versamentoAutomaticoULResponseDTO.getFailed().isEmpty()) {
|
||||||
|
//SUCCESS
|
||||||
|
colorBackgroundTitle = ContextCompat.getColor(requireContext(), R.color.green_300);
|
||||||
|
} else {
|
||||||
|
//WARNING
|
||||||
|
colorBackgroundTitle = ContextCompat.getColor(requireContext(), R.color.yellow_600);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mBindings.base.setBackgroundColor(colorBackgroundTitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initContent() {
|
||||||
|
String text;
|
||||||
|
|
||||||
|
if (versamentoAutomaticoULResponseDTO.getFailed() == null || versamentoAutomaticoULResponseDTO.getFailed().isEmpty()) {
|
||||||
|
//SUCCESS
|
||||||
|
text = "Versamento completato con successo";
|
||||||
|
} else {
|
||||||
|
//WARNING
|
||||||
|
text = "Il sistema non è riuscito a versare <b>" + versamentoAutomaticoULResponseDTO.getFailed().size() +
|
||||||
|
" " + getResources().getQuantityString(R.plurals.articles, versamentoAutomaticoULResponseDTO.getFailed().size()) + "</b>";
|
||||||
|
}
|
||||||
|
|
||||||
|
mBindings.descriptionText.setText(Html.fromHtml(text));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// var notCompletedListAdapter = new BaseAdapter() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
//
|
||||||
|
// var mtbColr = versamentoAutomaticoULResponseDTO.getFailed().get(position);
|
||||||
|
//
|
||||||
|
// var inflater = LayoutInflater.from(requireContext());
|
||||||
|
// DialogVersamentoAutomaticoUlDoneNotCompletedListItemBinding binding = null;
|
||||||
|
//
|
||||||
|
// if(convertView == null) {
|
||||||
|
// binding = DataBindingUtil.inflate(inflater, R.layout.dialog_versamento_automatico_ul_done__not_completed_list_item, parent, false);
|
||||||
|
// } else {
|
||||||
|
// binding = DataBindingUtil.findBinding(convertView);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// binding.setItem(mtbColr);
|
||||||
|
//
|
||||||
|
// convertView = binding.getRoot();
|
||||||
|
//
|
||||||
|
// //Setting qty with unt_mis
|
||||||
|
// if (!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
|
// String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// if (mtbColr.getMtbAart() != null) {
|
||||||
|
// text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// binding.qtaTextview.setText(text);
|
||||||
|
// } else {
|
||||||
|
// binding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return convertView;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public long getItemId(int position) {
|
||||||
|
// return position;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public Object getItem(int position) {
|
||||||
|
// return position;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public int getCount() {
|
||||||
|
// return versamentoAutomaticoULResponseDTO.getFailed().size();
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// mBindings.detailsNotCompletedList.setAdapter(notCompletedListAdapter);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// public void toggleDetailVisibility() {
|
||||||
|
// mBindings.detailsContainer.toggle(true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
|
||||||
|
|
||||||
<solid android:color="@color/orange_600" />
|
|
||||||
|
|
||||||
<padding
|
|
||||||
android:left="1dp"
|
|
||||||
android:right="1dp"
|
|
||||||
android:top="1dp" />
|
|
||||||
|
|
||||||
<corners android:radius="5dp" />
|
|
||||||
</shape>
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
|
||||||
<solid android:color="@color/gray_600" />
|
<solid android:color="@color/white" />
|
||||||
|
|
||||||
<padding
|
<padding
|
||||||
android:left="6dp"
|
android:left="6dp"
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
|
||||||
<solid android:color="@android:color/white" />
|
|
||||||
<stroke android:width="1dip" android:color="#969696"/>
|
|
||||||
|
|
||||||
<!-- The radius makes the corners rounded -->
|
|
||||||
<corners
|
|
||||||
android:radius="8dp" >
|
|
||||||
</corners>
|
|
||||||
</shape>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
|
||||||
|
|
||||||
<solid android:color="#ebebeb" />
|
|
||||||
|
|
||||||
<padding
|
|
||||||
android:left="4dp"
|
|
||||||
android:right="4dp"
|
|
||||||
android:top="4dp" />
|
|
||||||
|
|
||||||
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp" />
|
|
||||||
</shape>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="rectangle">
|
|
||||||
<corners
|
|
||||||
android:topLeftRadius="16dp"
|
|
||||||
android:topRightRadius="16dp" />
|
|
||||||
<padding android:top="16dp" />
|
|
||||||
<solid android:color="@color/white" />
|
|
||||||
|
|
||||||
</shape>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<shape
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="oval">
|
|
||||||
|
|
||||||
<solid
|
|
||||||
android:color="#0074E4"/>
|
|
||||||
|
|
||||||
<size
|
|
||||||
android:width="100dp"
|
|
||||||
android:height="100dp"/>
|
|
||||||
</shape>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
|
||||||
|
|
||||||
<solid android:color="@android:color/white" />
|
|
||||||
|
|
||||||
<padding
|
|
||||||
android:left="1dp"
|
|
||||||
android:right="1dp"
|
|
||||||
android:top="1dp" />
|
|
||||||
|
|
||||||
<corners android:radius="500dp" />
|
|
||||||
</shape>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
|
||||||
|
|
||||||
<solid
|
|
||||||
android:color="@color/white_bg_alpha" />
|
|
||||||
|
|
||||||
<padding
|
|
||||||
android:left="1dp"
|
|
||||||
android:right="1dp"
|
|
||||||
android:top="1dp" />
|
|
||||||
|
|
||||||
<corners android:radius="500dp" />
|
|
||||||
</shape>
|
|
||||||
7
app/src/main/res/drawable/dialog_card_child_bg.xml
Normal file
7
app/src/main/res/drawable/dialog_card_child_bg.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
|
||||||
|
<corners android:radius="20dp" />
|
||||||
|
</shape>
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<solid android:color="@color/black_semi_transparent"/>
|
|
||||||
<padding
|
|
||||||
android:left="16dp"
|
|
||||||
android:top="4dp"
|
|
||||||
android:right="16dp"
|
|
||||||
android:bottom="4dp"/>
|
|
||||||
<corners
|
|
||||||
android:radius="2dp"/>
|
|
||||||
</shape>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<solid android:color="@color/colorAccent"/>
|
|
||||||
<corners
|
|
||||||
android:bottomLeftRadius="50dp"
|
|
||||||
android:bottomRightRadius="0dp"
|
|
||||||
android:topLeftRadius="50dp"
|
|
||||||
android:topRightRadius="50dp"/>
|
|
||||||
</shape>
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M7.41,8.59L12,13.17l4.59,-4.58L18,10l-6,6 -6,-6 1.41,-1.41z"/>
|
||||||
|
</vector>
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
<vector android:height="76dp" android:tint="#FFFFFF"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
android:width="24dp"
|
||||||
android:width="76dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
android:height="24dp"
|
||||||
<path android:fillColor="#FF000000" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z"/>
|
android:tint="#FFFFFF"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z" />
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
5
app/src/main/res/drawable/ic_location_24.xml
Normal file
5
app/src/main/res/drawable/ic_location_24.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
|
||||||
|
</vector>
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<item android:id="@android:id/background">
|
|
||||||
<shape>
|
|
||||||
<corners android:radius="6.5dp" />
|
|
||||||
|
|
||||||
<solid android:color="@android:color/white" />
|
|
||||||
|
|
||||||
<stroke
|
|
||||||
android:width="1dp"
|
|
||||||
android:color="@android:color/darker_gray" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
</layer-list>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<gradient
|
|
||||||
android:angle="90"
|
|
||||||
android:endColor="@android:color/transparent"
|
|
||||||
android:startColor="#64000000"/>
|
|
||||||
</shape>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="rectangle">
|
|
||||||
<gradient
|
|
||||||
android:angle="135"
|
|
||||||
android:centerColor="#4CAF50"
|
|
||||||
android:endColor="#2E7D32"
|
|
||||||
android:startColor="#81C784"
|
|
||||||
android:type="linear" />
|
|
||||||
</shape>
|
|
||||||
@@ -13,6 +13,10 @@
|
|||||||
|
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.R" />
|
||||||
|
|
||||||
|
<import type="androidx.core.content.ContextCompat" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="viewmodel"
|
name="viewmodel"
|
||||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ViewModel" />
|
type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ViewModel" />
|
||||||
@@ -27,10 +31,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:background="@android:color/white"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:cardCornerRadius="12dp"
|
app:cardCornerRadius="12dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp">
|
||||||
android:background="@android:color/white">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -179,6 +183,94 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:visibility="@{view.currentTextNumCnfToTake > 0 || view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/qta_ord_text_panel"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/badge_round_corner"
|
||||||
|
android:backgroundTint="@color/light_blue_100"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="12dp"
|
||||||
|
android:paddingVertical="4dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:src="@drawable/ic_info_78dp"
|
||||||
|
android:tint="@color/gray_600" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="@{view.currentTextNumCnfToTake.toString()}"
|
||||||
|
android:textColor="@color/gray_600"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="@{view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}"
|
||||||
|
tools:text="1" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="@{@plurals/item_package(view.currentTextNumCnfToTake)}"
|
||||||
|
android:textColor="@color/gray_600"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="@{view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}"
|
||||||
|
tools:text="conf" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="e"
|
||||||
|
android:textColor="@color/gray_600"
|
||||||
|
android:visibility="@{view.currentTextNumPezziToTake > 0 && view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="@{view.currentTextNumPezziToTake.toString()}"
|
||||||
|
android:textColor="@color/gray_600"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="@{view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}"
|
||||||
|
tools:text="4" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:text="@{@plurals/pieces(view.currentTextNumPezziToTake)}"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="@color/gray_600"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="@{view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}"
|
||||||
|
tools:text="Pezzi" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -194,7 +286,7 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginEnd="2dp"
|
android:layout_marginEnd="2dp"
|
||||||
android:layout_weight="0.5"
|
android:layout_weight="0.5"
|
||||||
android:background="@drawable/badge_gray_round_corner"
|
android:background="@drawable/badge_round_corner"
|
||||||
android:backgroundTint="@color/green_600"
|
android:backgroundTint="@color/green_600"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
@@ -293,7 +385,7 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:layout_weight="0.5"
|
android:layout_weight="0.5"
|
||||||
android:background="@drawable/badge_gray_round_corner"
|
android:background="@drawable/badge_round_corner"
|
||||||
android:backgroundTint="@color/colorPrimary"
|
android:backgroundTint="@color/colorPrimary"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
@@ -409,9 +501,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? 1f : 2f}"
|
android:layout_weight="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? 1f : 2f}"
|
||||||
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
|
|
||||||
android:enabled="@{view.enabledChangePartitaMag}"
|
android:enabled="@{view.enabledChangePartitaMag}"
|
||||||
android:paddingEnd="4dp"
|
android:paddingEnd="4dp"
|
||||||
|
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
|
||||||
tools:layout_weight="1">
|
tools:layout_weight="1">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
@@ -521,8 +613,8 @@
|
|||||||
style="@style/TextInputEditText.OutlinePrimary"
|
style="@style/TextInputEditText.OutlinePrimary"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/tot_qty"
|
|
||||||
android:digits="0123456789"
|
android:digits="0123456789"
|
||||||
|
android:hint="@string/tot_qty"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
app:binding="@{view.currentQtaTot}" />
|
app:binding="@{view.currentQtaTot}" />
|
||||||
|
|
||||||
@@ -536,7 +628,89 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
>
|
android:visibility="@{viewmodel.mtbAart.isFlagQtaCnfFissaBoolean() ? View.GONE : View.VISIBLE}"
|
||||||
|
android:weightSum="3">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/input_tara_ped_layout"
|
||||||
|
style="@style/TextInputLayout.OutlinePrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:enabled="false"
|
||||||
|
android:focusableInTouchMode="false"
|
||||||
|
android:paddingEnd="4dp"
|
||||||
|
tools:layout_weight="1">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/input_tara_ped_text"
|
||||||
|
style="@style/TextInputEditText.OutlinePrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:enabled="false"
|
||||||
|
android:hint="@string/tare_art"
|
||||||
|
android:inputType="number"
|
||||||
|
android:textColor="@color/gray_400"
|
||||||
|
app:binding="@{view.currentTaraArticolo}" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/input_tara_col_layout"
|
||||||
|
style="@style/TextInputLayout.OutlinePrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:enabled="false"
|
||||||
|
android:focusableInTouchMode="false"
|
||||||
|
android:paddingEnd="4dp">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/input_tara_col_text"
|
||||||
|
style="@style/TextInputEditText.OutlinePrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:enabled="false"
|
||||||
|
android:hint="@string/tare_pckg"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:textColor="@color/gray_400"
|
||||||
|
app:binding="@{view.currentTaraTot}" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/input_peso_lordo_layout"
|
||||||
|
style="@style/TextInputLayout.OutlinePrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:enabled="@{view.enabledPesoLordo}"
|
||||||
|
android:focusableInTouchMode="false"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
tools:layout_weight="1">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/input_peso_lordo_text"
|
||||||
|
style="@style/TextInputEditText.OutlinePrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/LU_weight"
|
||||||
|
android:inputType="number"
|
||||||
|
android:textColor="@{ContextCompat.getColor(context, view.enabledQtaCnf ? android.R.color.black : R.color.gray_400)}"
|
||||||
|
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
|
||||||
|
app:binding="@{view.currentPesoLordo}" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/input_note_layout"
|
android:id="@+id/input_note_layout"
|
||||||
@@ -544,8 +718,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:enabled="@{view.enabledNotes}"
|
android:enabled="@{view.enabledNotes}"
|
||||||
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
|
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }">
|
||||||
>
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/input_note_text"
|
android:id="@+id/input_note_text"
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/badge1_round_corner"
|
android:background="@drawable/badge_round_corner"
|
||||||
|
android:backgroundTint="@color/colorPrimary"
|
||||||
android:paddingLeft="6dp"
|
android:paddingLeft="6dp"
|
||||||
android:paddingTop="2dp"
|
android:paddingTop="2dp"
|
||||||
android:paddingRight="6dp"
|
android:paddingRight="6dp"
|
||||||
@@ -39,7 +40,8 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:background="@drawable/badge2_round_corner"
|
android:background="@drawable/badge_round_corner"
|
||||||
|
android:backgroundTint="@color/orange_600"
|
||||||
android:paddingLeft="6dp"
|
android:paddingLeft="6dp"
|
||||||
android:paddingTop="2dp"
|
android:paddingTop="2dp"
|
||||||
android:paddingRight="6dp"
|
android:paddingRight="6dp"
|
||||||
@@ -48,6 +50,37 @@
|
|||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:text="BADGE 2" />
|
tools:text="BADGE 2" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/badge3_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:background="@drawable/badge_round_corner"
|
||||||
|
android:backgroundTint="@color/light_blue_500"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="12dp"
|
||||||
|
android:layout_height="12dp"
|
||||||
|
android:src="@drawable/ic_location_24"
|
||||||
|
android:tint="@color/white"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/badge3"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="POSIZIONE" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:id="@+id/primary_unt_mis"
|
android:id="@+id/primary_unt_mis"
|
||||||
@@ -104,12 +137,12 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/descrizione"
|
android:id="@+id/descrizione"
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_toStartOf="@id/secondary_unt_mis"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_toStartOf="@id/secondary_unt_mis"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
tools:text="DESCRIZIONE" />
|
tools:text="DESCRIZIONE" />
|
||||||
@@ -117,12 +150,12 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:id="@+id/secondary_unt_mis"
|
android:id="@+id/secondary_unt_mis"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:alpha="0.8"
|
||||||
android:gravity="end"
|
android:gravity="end"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal">
|
||||||
android:alpha="0.8">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/sec_qta_evasa"
|
android:id="@+id/sec_qta_evasa"
|
||||||
|
|||||||
@@ -26,221 +26,172 @@
|
|||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<RelativeLayout
|
|
||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/full_white"
|
||||||
|
android:minHeight="?attr/actionBarSize">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
app:layout_collapseMode="pin" />
|
||||||
|
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:id="@+id/filter_chips"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/full_white"
|
android:scrollbars="none">
|
||||||
android:minHeight="?attr/actionBarSize">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<com.google.android.material.chip.ChipGroup
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/filter_chips_group"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="wrap_content"
|
||||||
app:layout_collapseMode="pin"
|
android:paddingStart="8dp"
|
||||||
style="@style/AppTheme.NewMaterial.Text" />
|
android:paddingEnd="8dp"
|
||||||
|
app:chipSpacing="8dp"
|
||||||
|
app:singleSelection="true" />
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/accettazione_picking_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="72dp"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/accettazione_empty_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:alpha="0.3"
|
||||||
|
app:visibility="@{accettazioneView.noItemsToPick}">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline_empty_top"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintGuide_percent="0.2" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline_empty_left"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.15" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline_empty_right"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.85" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||||
|
|
||||||
<net.cachapa.expandablelayout.ExpandableLayout
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/filtered_arts_in_list_expandable_layout"
|
android:layout_width="72dp"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:el_duration="400"
|
android:adjustViewBounds="true"
|
||||||
app:el_expanded="false">
|
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||||
|
|
||||||
<RelativeLayout
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:paddingBottom="12dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_toStartOf="@+id/remove_art_filter_list"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/filtered_arts_in_list" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/description_filter_text"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="COD_ART_HERE" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/remove_art_filter_list"
|
|
||||||
style="@style/Button.DangerOutline"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:onClick="@{() -> accettazioneView.removeListFilter()}"
|
|
||||||
android:text="@string/remove_filter_button"
|
|
||||||
app:strokeColor="@color/red_600" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</net.cachapa.expandablelayout.ExpandableLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/accettazione_picking_list"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:paddingBottom="72dp"
|
|
||||||
android:scrollbars="vertical" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/accettazione_empty_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:alpha="0.3"
|
|
||||||
app:visibility="@{accettazioneView.noItemsToPick}">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline_empty_top"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintGuide_percent="0.2" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline_empty_left"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintGuide_percent="0.15" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline_empty_right"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintGuide_percent="0.85" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:orientation="vertical"
|
android:text="@string/no_item_to_pick_text"
|
||||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
android:textColor="@android:color/black"
|
||||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
android:textSize="18sp" />
|
||||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:layout_width="72dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:src="@drawable/ic_playlist_add_check_24dp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<com.github.clans.fab.FloatingActionMenu
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/accettazione_ordine_inevaso_fab"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:gravity="center_horizontal"
|
android:layout_height="match_parent"
|
||||||
android:text="@string/no_item_to_pick_text"
|
android:layout_alignParentBottom="true"
|
||||||
android:textColor="@android:color/black"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:textSize="18sp" />
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
</LinearLayout>
|
app:visibility="@{accettazioneView.noLUPresent}"
|
||||||
|
fab:menu_animationDelayPerItem="50"
|
||||||
|
fab:menu_backgroundColor="@color/white_bg_alpha"
|
||||||
|
fab:menu_buttonSpacing="0dp"
|
||||||
|
fab:menu_colorNormal="@color/colorSecondary"
|
||||||
|
fab:menu_colorPressed="@color/colorSecondaryDark"
|
||||||
|
fab:menu_fab_size="normal"
|
||||||
|
fab:menu_labels_colorNormal="@color/white"
|
||||||
|
fab:menu_labels_colorPressed="@color/white_pressed"
|
||||||
|
fab:menu_labels_colorRipple="#66FFFFFF"
|
||||||
|
fab:menu_labels_cornerRadius="3dp"
|
||||||
|
fab:menu_labels_hideAnimation="@anim/fab_slide_out_to_right"
|
||||||
|
fab:menu_labels_margin="0dp"
|
||||||
|
fab:menu_labels_padding="8dp"
|
||||||
|
fab:menu_labels_paddingBottom="4dp"
|
||||||
|
fab:menu_labels_paddingLeft="8dp"
|
||||||
|
fab:menu_labels_paddingRight="8dp"
|
||||||
|
fab:menu_labels_paddingTop="4dp"
|
||||||
|
fab:menu_labels_position="left"
|
||||||
|
fab:menu_labels_showAnimation="@anim/fab_slide_in_from_right"
|
||||||
|
fab:menu_labels_showShadow="true"
|
||||||
|
fab:menu_labels_textColor="@color/black_semi_transparent"
|
||||||
|
fab:menu_labels_textSize="18sp"
|
||||||
|
fab:menu_openDirection="up"
|
||||||
|
fab:menu_shadowColor="#66000000"
|
||||||
|
fab:menu_shadowRadius="4dp"
|
||||||
|
fab:menu_shadowXOffset="1dp"
|
||||||
|
fab:menu_shadowYOffset="3dp"
|
||||||
|
fab:menu_showShadow="true">
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<com.github.clans.fab.FloatingActionButton
|
||||||
|
android:id="@+id/accettazione_ordine_inevaso_fab_item1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_box"
|
||||||
|
app:fab_colorNormal="@color/white"
|
||||||
|
app:fab_colorPressed="@color/white_pressed"
|
||||||
|
app:fab_colorRipple="#66FFFFFF"
|
||||||
|
app:onClick="@{() -> accettazioneView.showCreatedUL()}"
|
||||||
|
fab:fab_label="@string/action_show_created_ul" />
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionMenu
|
<com.github.clans.fab.FloatingActionButton
|
||||||
android:id="@+id/accettazione_ordine_inevaso_fab"
|
android:id="@+id/accettazione_ordine_inevaso_fab_item2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:src="@drawable/ic_add_24dp"
|
||||||
app:visibility="@{accettazioneView.noLUPresent}"
|
app:fab_colorNormal="@color/white"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:fab_colorPressed="@color/white_pressed"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:fab_colorRipple="#66FFFFFF"
|
||||||
fab:menu_animationDelayPerItem="50"
|
app:onClick="@{() -> accettazioneView.createNewLU()}"
|
||||||
fab:menu_backgroundColor="@color/white_bg_alpha"
|
fab:fab_label="@string/action_create_ul" />
|
||||||
fab:menu_buttonSpacing="0dp"
|
|
||||||
fab:menu_colorNormal="@color/colorSecondary"
|
|
||||||
fab:menu_colorPressed="@color/colorSecondaryDark"
|
|
||||||
fab:menu_fab_size="normal"
|
|
||||||
fab:menu_labels_colorNormal="@color/white"
|
|
||||||
fab:menu_labels_colorPressed="@color/white_pressed"
|
|
||||||
fab:menu_labels_colorRipple="#66FFFFFF"
|
|
||||||
fab:menu_labels_cornerRadius="3dp"
|
|
||||||
fab:menu_labels_hideAnimation="@anim/fab_slide_out_to_right"
|
|
||||||
fab:menu_labels_margin="0dp"
|
|
||||||
fab:menu_labels_padding="8dp"
|
|
||||||
fab:menu_labels_paddingBottom="4dp"
|
|
||||||
fab:menu_labels_paddingLeft="8dp"
|
|
||||||
fab:menu_labels_paddingRight="8dp"
|
|
||||||
fab:menu_labels_paddingTop="4dp"
|
|
||||||
fab:menu_labels_position="left"
|
|
||||||
fab:menu_labels_showAnimation="@anim/fab_slide_in_from_right"
|
|
||||||
fab:menu_labels_showShadow="true"
|
|
||||||
fab:menu_labels_textColor="@color/black_semi_transparent"
|
|
||||||
fab:menu_labels_textSize="18sp"
|
|
||||||
fab:menu_openDirection="up"
|
|
||||||
fab:menu_shadowColor="#66000000"
|
|
||||||
fab:menu_shadowRadius="4dp"
|
|
||||||
fab:menu_shadowXOffset="1dp"
|
|
||||||
fab:menu_shadowYOffset="3dp"
|
|
||||||
fab:menu_showShadow="true">
|
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionButton
|
</com.github.clans.fab.FloatingActionMenu>
|
||||||
android:id="@+id/accettazione_ordine_inevaso_fab_item1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:src="@drawable/ic_box"
|
|
||||||
app:fab_colorNormal="@color/white"
|
|
||||||
app:fab_colorPressed="@color/white_pressed"
|
|
||||||
app:fab_colorRipple="#66FFFFFF"
|
|
||||||
app:onClick="@{() -> accettazioneView.showCreatedUL()}"
|
|
||||||
fab:fab_label="@string/action_show_created_ul" />
|
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionButton
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
android:id="@+id/accettazione_ordine_inevaso_fab_item2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:src="@drawable/ic_add_24dp"
|
|
||||||
app:fab_colorNormal="@color/white"
|
|
||||||
app:fab_colorPressed="@color/white_pressed"
|
|
||||||
app:fab_colorRipple="#66FFFFFF"
|
|
||||||
app:onClick="@{() -> accettazioneView.createNewLU()}"
|
|
||||||
fab:fab_label="@string/action_create_ul" />
|
|
||||||
|
|
||||||
</com.github.clans.fab.FloatingActionMenu>
|
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,8 @@
|
|||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/badge1_round_corner"
|
android:background="@drawable/badge_round_corner"
|
||||||
|
android:backgroundTint="@color/colorPrimary"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingLeft="6dp"
|
android:paddingLeft="6dp"
|
||||||
android:paddingTop="2dp"
|
android:paddingTop="2dp"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user