Compare commits
39 Commits
v1.18.3(23
...
v1.19.1(24
| Author | SHA1 | Date | |
|---|---|---|---|
| 1951d8e2a4 | |||
| 420fdf6b4c | |||
| a14a593e4f | |||
| 5d7ffa02c4 | |||
| 4942807104 | |||
| 20dafb1250 | |||
| eb0746de0c | |||
| 2e255e0c47 | |||
| 6baebda5e1 | |||
| 8f943829ec | |||
| bd19d8c1a2 | |||
| 3e79d0a07a | |||
| d2111e36ee | |||
| 47a1ab8223 | |||
| 45df794280 | |||
| 7a9bd15cfa | |||
| f902439086 | |||
| e7334d358b | |||
| 262986f02c | |||
| 76188aa792 | |||
| eb67d2fc65 | |||
| 6e176c0b7f | |||
| 83b2327247 | |||
| 7605c4d70a | |||
| 5a8935675c | |||
| 1645fba77c | |||
| 6929a386db | |||
| 93c3350cb2 | |||
| 2b97faaa65 | |||
| 9260379c5f | |||
| 35e7fd60be | |||
| 1bbe5818f8 | |||
| 65d372c04c | |||
| be1c5ecd0b | |||
| 30e16fb765 | |||
| effff99e9a | |||
| c40bb8d7b0 | |||
| a7063c70eb | |||
| 512f5b0de3 |
16
.idea/deploymentTargetDropDown.xml
generated
Normal file
16
.idea/deploymentTargetDropDown.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetsSelectedWithDialog>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetsSelectedWithDialog>
|
||||
</component>
|
||||
</project>
|
||||
4
.idea/runConfigurations/app_base.xml
generated
4
.idea/runConfigurations/app_base.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app_base" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||
<module name="WMS_Native.app" />
|
||||
<module name="WMS.app" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
@@ -8,7 +8,7 @@
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic_agricoper,WMS_Native.dynamic_frudis,WMS_Native.dynamic_gramm,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_saporiveri_pv,WMS_Native.dynamic_vgalimenti,dynamic_frudis,dynamic_gramm,dynamic_ime,dynamic_saporiveri,dynamic_saporiveri_pv,dynamic_vgalimenti" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic_vgalimenti" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
|
||||
4
.idea/runConfigurations/app_vglimenti.xml
generated
4
.idea/runConfigurations/app_vglimenti.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app_vglimenti" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||
<module name="WMS_Native.app" />
|
||||
<module name="WMS.app" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
@@ -8,7 +8,7 @@
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic__base,WMS_Native.dynamic_agricoper,WMS_Native.dynamic_frudis,WMS_Native.dynamic_gramm,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_saporiveri_pv,dynamic__base,dynamic_frudis,dynamic_gramm,dynamic_ime,dynamic_saporiveri,dynamic_saporiveri_pv" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic__base" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
|
||||
@@ -6,8 +6,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 233
|
||||
def appVersionName = '1.18.3'
|
||||
def appVersionCode = 242
|
||||
def appVersionName = '1.19.1'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -103,12 +103,12 @@ dependencies {
|
||||
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
||||
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.3.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
@@ -120,7 +120,7 @@ dependencies {
|
||||
implementation 'org.apache.commons:commons-text:1.9'
|
||||
|
||||
//MVVM
|
||||
def dagger2_version = '2.29.1'
|
||||
def dagger2_version = '2.35.1'
|
||||
api "com.google.dagger:dagger:$dagger2_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||
@@ -156,6 +156,10 @@ dependencies {
|
||||
implementation project(':keyobardemulatorscannerlibrary')
|
||||
androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
|
||||
androidTestImplementation 'org.testng:testng:7.4.0'
|
||||
|
||||
|
||||
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
||||
implementation 'org.reflections:reflections:0.10.2'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -81,14 +81,14 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ArticoloRESTConsumer provideArticoloRESTConsumer() {
|
||||
return new ArticoloRESTConsumer();
|
||||
ArticoloRESTConsumer provideArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new ArticoloRESTConsumer(systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer) {
|
||||
return new DepositoRESTConsumer(entityRESTConsumer);
|
||||
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new DepositoRESTConsumer(entityRESTConsumer, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
@@ -50,7 +50,6 @@ public class AppContext {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initSettings() {
|
||||
Stash.init(mApplicationContext);
|
||||
SettingsManager.init(mApplicationContext);
|
||||
@@ -80,5 +79,4 @@ public class AppContext {
|
||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class MainContext {
|
||||
}
|
||||
|
||||
public void logout(Runnable onLoggedOut) {
|
||||
menuService.invalidateCache();
|
||||
UtilityThread.executeParallel(() -> {
|
||||
SettingsManager.i().setUser(null);
|
||||
SettingsManager.i().setUserSession(null);
|
||||
|
||||
@@ -104,5 +104,9 @@ public class BindableBoolean implements Observable {
|
||||
notifyChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void toggle() {
|
||||
set(!get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -477,7 +477,7 @@ public class Converters {
|
||||
|
||||
|
||||
@BindingAdapter("visibility")
|
||||
public static void bindView(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||
public static void bindViewVisibility(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
}
|
||||
@@ -492,6 +492,38 @@ public class Converters {
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter({"reverse_visibility"})
|
||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
}
|
||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("reverse_visibility")
|
||||
public static void bindViewReverseVisibility(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
}
|
||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("android:layout_weight")
|
||||
public static void setLayoutWeight(View view, final Float weight) {
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import androidx.databinding.Observable;
|
||||
|
||||
public abstract class OnGeneralChangedCallback extends Observable.OnPropertyChangedCallback implements Runnable{
|
||||
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
run();
|
||||
}
|
||||
|
||||
// public abstract void run();
|
||||
|
||||
}
|
||||
@@ -73,4 +73,9 @@ public class MenuService {
|
||||
}
|
||||
}
|
||||
|
||||
public void invalidateCache() {
|
||||
this.mInternalCachedMenu = null;
|
||||
this.mInternalCachedFlatMenu = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -540,13 +540,13 @@ public class MtbColt extends EntityBase {
|
||||
|
||||
try {
|
||||
whereCond.append("(");
|
||||
whereCond.append(String.format("dtb_ordt.gestione = %s AND dtb_ordt.data_ord = %s and dtb_ordt.num_ord = %s",
|
||||
whereCond.append(String.format("d.g = %s AND d.d = %s and d.n = %s",
|
||||
UtilityDB.valueToString(x.getGestioneOrd()),
|
||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
||||
UtilityDB.valueToString(x.getNumOrd())));
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(x.getDataConsS())) {
|
||||
whereCond.append(String.format(" AND dtb_ordr.data_cons = %s",
|
||||
whereCond.append(String.format(" AND dr.dc = %s",
|
||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
||||
}
|
||||
|
||||
@@ -554,8 +554,6 @@ public class MtbColt extends EntityBase {
|
||||
if(i < filtroOrdineDtos.size()-1) {
|
||||
whereCond.append(" OR ");
|
||||
}
|
||||
|
||||
//whereCond.append("<DTB_ORDT COND=\"OR\"><GESTIONE type=\"V\">" + x.getGestioneOrd() + "</GESTIONE><DATA_ORD type=\"D\">" + UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH) + "</DATA_ORD><NUM_ORD type=\"N\">" + x.getNumOrd() + "</NUM_ORD></DTB_ORDT>");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -36,12 +36,12 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
||||
private String flagTipoNegozio;
|
||||
private String codMdepReso;
|
||||
|
||||
|
||||
public MtbDepo() {
|
||||
type = "mtb_depo";
|
||||
}
|
||||
|
||||
protected MtbDepo(Parcel in) {
|
||||
type = "mtb_depo";
|
||||
codMdep = in.readString();
|
||||
descrizione = in.readString();
|
||||
flagVal = in.readString();
|
||||
@@ -357,4 +357,19 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
||||
this.codMdepReso = codMdepReso;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
MtbDepo mtbDepo = (MtbDepo) o;
|
||||
|
||||
return getCodMdep().equals(mtbDepo.getCodMdep());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getCodMdep().hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
public class MtbGrup extends EntityBase {
|
||||
|
||||
private String codMgrp;
|
||||
private String descrizione;
|
||||
private String flagValMag;
|
||||
private String logoWeb;
|
||||
private String criterioVal;
|
||||
private String tipoMgrp;
|
||||
|
||||
public MtbGrup() {
|
||||
this.type = "mtb_grup";
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public MtbGrup setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbGrup setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagValMag() {
|
||||
return flagValMag;
|
||||
}
|
||||
|
||||
public MtbGrup setFlagValMag(String flagValMag) {
|
||||
this.flagValMag = flagValMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLogoWeb() {
|
||||
return logoWeb;
|
||||
}
|
||||
|
||||
public MtbGrup setLogoWeb(String logoWeb) {
|
||||
this.logoWeb = logoWeb;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCriterioVal() {
|
||||
return criterioVal;
|
||||
}
|
||||
|
||||
public MtbGrup setCriterioVal(String criterioVal) {
|
||||
this.criterioVal = criterioVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTipoMgrp() {
|
||||
return tipoMgrp;
|
||||
}
|
||||
|
||||
public MtbGrup setTipoMgrp(String tipoMgrp) {
|
||||
this.tipoMgrp = tipoMgrp;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
@@ -50,6 +51,7 @@ public class RESTBuilder {
|
||||
|
||||
Gson gson = new GsonBuilder()
|
||||
.setDateFormat("dd/MM/yyyy HH:mm:ss")
|
||||
.excludeFieldsWithModifiers(Modifier.TRANSIENT)
|
||||
.create();
|
||||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
|
||||
@@ -2,15 +2,21 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.annimon.stream.Collectors;
|
||||
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.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@@ -18,6 +24,11 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
public ArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
public void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
@@ -86,4 +97,21 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getArtsGroups(List<String> groupsToFind, RunnableArgs<List<MtbGrup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var whereCondMap = Stream.of(groupsToFind)
|
||||
.map(x -> {
|
||||
HashMap<String, Object> vars = new HashMap<>();
|
||||
vars.put("cod_mgrp", x);
|
||||
return vars;
|
||||
})
|
||||
.toList();
|
||||
|
||||
var whereCond = " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -12,9 +16,17 @@ import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||
public class DepositoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final EntityRESTConsumer entityRESTConsumer;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
public DepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer) {
|
||||
public DepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||
this.entityRESTConsumer = entityRESTConsumer;
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
public void getAll(RunnableArgs<List<MtbDepo>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbDepo>>() {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_depo", typeOfObjectsList, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
@@ -11,12 +11,12 @@ import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.BuildConfig;
|
||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Call;
|
||||
@@ -32,26 +32,6 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public void getAvailablePrinters(String codMdep, final RunnableArgs<List<String>> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
printerService.getAvailablePrinters(codMdep).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||
analyzeAnswer(response, "GetAvailablePrinters", printers -> {
|
||||
onComplete.run(printers != null ? Stream.of(printers).withoutNulls().toList() : null);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
||||
Log.e("GetAvailablePrinters", t.toString());
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getAvailablePrinters(String codMdep, Type printerType, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String printerTypeStr = printerType != null ? printerType.toString() : null;
|
||||
@@ -75,50 +55,43 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void printCollo(String printerName, MtbColt testataColloToPrint, int quantity, String reportName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void printCollo(Type printerType, MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
if (UtilityString.isNullOrEmpty(printerName)) {
|
||||
onFailed.run(new Exception("Nessuna stampante configurata: valore null"));
|
||||
return;
|
||||
}
|
||||
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
printerService.printCollo(
|
||||
printerName,
|
||||
testataColloToPrint.getDataColloS(),
|
||||
testataColloToPrint.getGestione(),
|
||||
testataColloToPrint.getSerCollo(),
|
||||
testataColloToPrint.getNumCollo(),
|
||||
quantity,
|
||||
reportName)
|
||||
Call<ServiceRESTResponse<Object>> callable = null;
|
||||
if (printerType != null)
|
||||
callable = printerService.printCollo(printerType.toString(), testataColloToPrint);
|
||||
else
|
||||
callable = printerService.printCollo(testataColloToPrint);
|
||||
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "printCollo", data -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
callable.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "printCollo", data -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
if (t.getMessage().contains("Printer not found")) {
|
||||
onFailed.run(new NoPrintersFoundException());
|
||||
} else onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
if (t.getMessage().contains("Printer not found")) {
|
||||
onFailed.run(new NoPrintersFoundException());
|
||||
} else onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
// if(BuildConfig.DEBUG) {
|
||||
// onComplete.run();
|
||||
// return;
|
||||
// }
|
||||
if (BuildConfig.DEBUG) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
JasperDTO jasperDTO = new JasperDTO();
|
||||
jasperDTO.setReportName(reportName);
|
||||
|
||||
@@ -2,20 +2,16 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface PrinterRESTConsumerService {
|
||||
|
||||
@POST("getAvailablePrinters")
|
||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters();
|
||||
|
||||
@POST("getAvailablePrinters")
|
||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep);
|
||||
|
||||
@@ -23,19 +19,6 @@ public interface PrinterRESTConsumerService {
|
||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep, @Query("printerType") String printerType);
|
||||
|
||||
|
||||
@POST("pkgPrintLabel")
|
||||
@FormUrlEncoded
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Query("printerName") String printerName,
|
||||
@Field("dataCollo") String dataCollo,
|
||||
@Field("gestione") String gestione,
|
||||
@Field("serCollo") String serCollo,
|
||||
@Field("numCollo") int numCollo,
|
||||
@Query("printQuantity") int printQuantity,
|
||||
@Query("reportName") String reportName
|
||||
);
|
||||
|
||||
|
||||
@POST("processPrintReport")
|
||||
Call<ServiceRESTResponse<Object>> processPrintReport(
|
||||
@Query("printerName") String printerName,
|
||||
@@ -43,4 +26,16 @@ public interface PrinterRESTConsumerService {
|
||||
@Body JasperDTO jasperDTO
|
||||
);
|
||||
|
||||
|
||||
@POST("wms/printEtichettaSSCC")
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Query("printerType") String printerType,
|
||||
@Body MtbColt mtbColtToPrint
|
||||
);
|
||||
|
||||
@POST("wms/printEtichettaSSCC")
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Body MtbColt mtbColtToPrint
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class _BaseRESTConsumer {
|
||||
}
|
||||
} else {
|
||||
if (response.code() == 404) {
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata");
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
|
||||
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||
} else {
|
||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest.model;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
@@ -43,9 +44,7 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
private boolean flagEvaso;
|
||||
private String nomeAgente;
|
||||
private String codJfas;
|
||||
|
||||
|
||||
|
||||
private List<AvailableClassMerc> availableClassMerc;
|
||||
|
||||
public Integer getIdViaggio() {
|
||||
return idViaggio;
|
||||
@@ -363,6 +362,16 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<AvailableClassMerc> getAvailableClassMerc() {
|
||||
return availableClassMerc;
|
||||
}
|
||||
|
||||
public OrdineUscitaInevasoDTO setAvailableClassMerc(List<AvailableClassMerc> availableClassMerc) {
|
||||
this.availableClassMerc = availableClassMerc;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
@@ -382,4 +391,28 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
result = 31 * result + getGestione().hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static class AvailableClassMerc {
|
||||
|
||||
private String codMgrp;
|
||||
private List<String> codMsgr;
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public AvailableClassMerc setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getCodMsgr() {
|
||||
return codMsgr;
|
||||
}
|
||||
|
||||
public AvailableClassMerc setCodMsgr(List<String> codMsgr) {
|
||||
this.codMsgr = codMsgr;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
public class UtilityBoolean {
|
||||
|
||||
public static int toInt(boolean bool) {
|
||||
return bool ? 1 : 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import android.text.Html;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
@@ -16,6 +17,9 @@ import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
public class UtilityExceptions {
|
||||
|
||||
private static final Class<? extends Exception>[] FIREBASE_IGNORED_EXCEPTIONS = new Class[] {
|
||||
|
||||
};
|
||||
|
||||
public static void defaultException(Context context, Exception ex, Dialog progressDialog) {
|
||||
defaultException(context, ex);
|
||||
@@ -55,7 +59,10 @@ public class UtilityExceptions {
|
||||
.show(fm, "tag");
|
||||
}
|
||||
|
||||
if (!BuildConfig.DEBUG) {
|
||||
boolean toIgnore = ex.getClass().getName().startsWith("it.integry.integrywmsnative") ||
|
||||
Stream.of(FIREBASE_IGNORED_EXCEPTIONS).anyMatch(x -> x.isAssignableFrom(ex.getClass()));
|
||||
|
||||
if (!BuildConfig.DEBUG && !toIgnore) {
|
||||
if (sendEmail) UtilityLogger.errorMe(ex);
|
||||
FirebaseCrashlytics.getInstance().recordException(ex);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import it.integry.integrywmsnative.core.exception.InvalidLUMultiGestioneExceptio
|
||||
import it.integry.integrywmsnative.core.exception.InvalidOrderTypeException;
|
||||
import it.integry.integrywmsnative.core.exception.LUScanNotGrantedException;
|
||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.expansion.AtomicBigDecimal;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
@@ -37,7 +36,6 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
@@ -532,10 +530,10 @@ public class AccettazionePickingViewModel {
|
||||
dataScad = c.getTime();
|
||||
}
|
||||
|
||||
if(partitaMag == null && dataScad == null) {
|
||||
if (partitaMag == null && dataScad == null) {
|
||||
HistoryMtbAartDTO historyMtbAartDTO = this.getHistoryItemIfExists(pickingObjectDTO.getMtbAart().getCodMart());
|
||||
|
||||
if(historyMtbAartDTO != null) {
|
||||
if (historyMtbAartDTO != null) {
|
||||
partitaMag = historyMtbAartDTO.getPartitaMag();
|
||||
dataScad = historyMtbAartDTO.getDataScad();
|
||||
}
|
||||
@@ -788,25 +786,13 @@ public class AccettazionePickingViewModel {
|
||||
}
|
||||
|
||||
private void printCollo(Runnable onComplete) {
|
||||
this.mPrinterRESTConsumer.getAvailablePrinters(mDefaultCodMdep, PrinterRESTConsumer.Type.SECONDARIA, printerList -> {
|
||||
|
||||
if (printerList == null || printerList.size() == 0) {
|
||||
this.sendError(new NoPrintersFoundException());
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO);
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerList.get(0),
|
||||
mCurrentMtbColt,
|
||||
1,
|
||||
reportName, () -> {
|
||||
this.sendLUSuccessfullyPrinted();
|
||||
onComplete.run();
|
||||
}, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
}, this::sendError);
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
PrinterRESTConsumer.Type.SECONDARIA,
|
||||
mCurrentMtbColt,
|
||||
() -> {
|
||||
this.sendLUSuccessfullyPrinted();
|
||||
onComplete.run();
|
||||
}, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,8 @@ import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ui.ContenutoBancaleListAdapter;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
@@ -144,39 +142,21 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
public void printUL() {
|
||||
this.bindings.contenutoBancaleFab.close(true);
|
||||
this.onLoadingStarted();
|
||||
try {
|
||||
this.mPrinterRESTConsumer.printCollo(mPrinterType, mtbColt.get(),
|
||||
() -> {
|
||||
this.onLoadingEnded();
|
||||
|
||||
this.mPrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().getUserSession().getDepo().getCodMdep(), mPrinterType, value -> {
|
||||
if (value.size() > 0) {
|
||||
|
||||
try {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum());
|
||||
reportName = mReportName != null ? mReportName : reportName;
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(value.get(0),
|
||||
mtbColt.get(),
|
||||
1,
|
||||
reportName,
|
||||
() -> {
|
||||
this.onLoadingEnded();
|
||||
|
||||
Resources res = this.getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageView
|
||||
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}, this::onError);
|
||||
|
||||
} catch (Exception ex) {
|
||||
this.onError(ex);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.onLoadingEnded();
|
||||
String errorMessage = "Nessuna stampante configurata";
|
||||
this.onError(new Exception(errorMessage));
|
||||
}
|
||||
}, this::onError);
|
||||
Resources res = this.getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageView
|
||||
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}, this::onError);
|
||||
|
||||
} catch (Exception ex) {
|
||||
this.onError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -97,13 +97,13 @@ public class MainActivity extends BaseActivity
|
||||
mBinding.appBarMain.mainSearch.setVisibility(View.GONE);
|
||||
|
||||
initGestMenu();
|
||||
if(savedInstanceState == null) openMain();
|
||||
if (savedInstanceState == null) openMain();
|
||||
|
||||
init();
|
||||
|
||||
}
|
||||
|
||||
private void startLoginActivity(){
|
||||
private void startLoginActivity() {
|
||||
this.finish();
|
||||
Intent myIntent = new Intent(this, LoginActivity.class);
|
||||
startActivity(myIntent);
|
||||
@@ -170,7 +170,7 @@ public class MainActivity extends BaseActivity
|
||||
|
||||
BaseMenuConfiguration.MenuItem menuItem = getMenuItem(id);
|
||||
|
||||
if(menuItem != null) {
|
||||
if (menuItem != null) {
|
||||
fragment = menuItem.getFragmentFactory().run();
|
||||
this.adaptViewToFragment(fragment);
|
||||
} else {
|
||||
@@ -205,24 +205,30 @@ public class MainActivity extends BaseActivity
|
||||
private void initGestMenu() {
|
||||
Menu menu = mBinding.navView.getMenu();
|
||||
|
||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||
|
||||
if(customConfiguration == null) return;
|
||||
|
||||
BaseMenuConfiguration menuConfiguration = customConfiguration.getConfig(BaseCustomConfiguration.Keys.MENU_CONFIGURATION);
|
||||
List<MenuConfiguration.MenuGroup> menuGroups = menuConfiguration.getGroups();
|
||||
|
||||
menu.add(R.id.nav_home, R.id.nav_home, 0, R.string.home)
|
||||
.setIcon(R.drawable.ic_black_home);
|
||||
|
||||
for(MenuConfiguration.MenuGroup menuGroup : menuGroups) {
|
||||
MenuConfiguration baseMenuConfiguration = new MenuConfiguration();
|
||||
List<MenuConfiguration.MenuGroup> menuGroups = baseMenuConfiguration.getGroups();
|
||||
|
||||
SubMenu subMenu = menu.addSubMenu(menuGroup.getGroupText());
|
||||
for (MenuConfiguration.MenuGroup menuGroup : menuGroups) {
|
||||
try {
|
||||
|
||||
for(MenuConfiguration.MenuItem menuItem : menuGroup.getItems()) {
|
||||
subMenu
|
||||
.add(menuGroup.getGroupId(), menuItem.getID(), 0, menuItem.getTitleText())
|
||||
.setIcon(menuItem.getDrawerIcon());
|
||||
if (menuService.isGroupEnabled(menuGroup)) {
|
||||
SubMenu subMenu = menu.addSubMenu(menuGroup.getGroupText());
|
||||
|
||||
for (MenuConfiguration.MenuItem menuItem : menuGroup.getItems()) {
|
||||
|
||||
if(menuService.isItemEnabled(menuItem)) {
|
||||
subMenu
|
||||
.add(menuGroup.getGroupId(), menuItem.getID(), 0, menuItem.getTitleText())
|
||||
.setIcon(menuItem.getDrawerIcon());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,15 +247,15 @@ public class MainActivity extends BaseActivity
|
||||
|
||||
BaseMenuConfiguration.MenuItem menuItemToReturn = null;
|
||||
|
||||
for(MenuConfiguration.MenuGroup menuGroup : menuGroups) {
|
||||
for(MenuConfiguration.MenuItem menuItem : menuGroup.getItems()) {
|
||||
if(menuId == menuItem.getID()) {
|
||||
for (MenuConfiguration.MenuGroup menuGroup : menuGroups) {
|
||||
for (MenuConfiguration.MenuItem menuItem : menuGroup.getItems()) {
|
||||
if (menuId == menuItem.getID()) {
|
||||
menuItemToReturn = menuItem;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(menuItemToReturn != null) break;
|
||||
if (menuItemToReturn != null) break;
|
||||
}
|
||||
|
||||
|
||||
@@ -269,13 +275,13 @@ public class MainActivity extends BaseActivity
|
||||
public void pop() {
|
||||
|
||||
int count = getSupportFragmentManager().getBackStackEntryCount();
|
||||
for(int i = 0; i < count; i++) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
getSupportFragmentManager().popBackStack();
|
||||
}
|
||||
}
|
||||
|
||||
private void adaptViewToFragment(Fragment fragment){
|
||||
if(fragment instanceof ISearcableFragment) {
|
||||
private void adaptViewToFragment(Fragment fragment) {
|
||||
if (fragment instanceof ISearcableFragment) {
|
||||
mBinding.appBarMain.mainSearch.setOnQueryTextListener((SearchView.OnQueryTextListener) fragment);
|
||||
mBinding.appBarMain.mainSearch.setVisibility(View.VISIBLE);
|
||||
mBinding.appBarMain.mainSearch.setOnSearchClickListener(v -> {
|
||||
@@ -301,7 +307,7 @@ public class MainActivity extends BaseActivity
|
||||
}
|
||||
|
||||
|
||||
if(fragment instanceof ITitledFragment && !(fragment instanceof MainFragment)) {
|
||||
if (fragment instanceof ITitledFragment && !(fragment instanceof MainFragment)) {
|
||||
mBinding.appBarMain.toolbarTitleCenteredLayout.setVisibility(View.GONE);
|
||||
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.VISIBLE);
|
||||
((ITitledFragment) fragment).onCreateActionBar(mBinding.appBarMain.toolbarTitleLeft, this);
|
||||
@@ -314,19 +320,19 @@ public class MainActivity extends BaseActivity
|
||||
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if(fragment instanceof IScrollableFragment) {
|
||||
if (fragment instanceof IScrollableFragment) {
|
||||
((IScrollableFragment) fragment).setScrollToolbar(mBinding.appBarMain.elevatedToolbar);
|
||||
((IScrollableFragment) fragment).addOnPreDestroy(() -> {
|
||||
mBinding.appBarMain.elevatedToolbar.resetAll();
|
||||
});
|
||||
}
|
||||
|
||||
if(fragment instanceof ISelectAllFragment && ((ISelectAllFragment)fragment).isSelectAllButtonEnabled()) {
|
||||
if (fragment instanceof ISelectAllFragment && ((ISelectAllFragment) fragment).isSelectAllButtonEnabled()) {
|
||||
mBinding.appBarMain.mainSelectAll.setVisibility(View.VISIBLE);
|
||||
mBinding.appBarMain.mainSelectAll.setOnClickListener(new OnSingleClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v) {
|
||||
((ISelectAllFragment)fragment).onSelectAll();
|
||||
((ISelectAllFragment) fragment).onSelectAll();
|
||||
}
|
||||
});
|
||||
((ISelectAllFragment) fragment).addOnPreDestroy(() -> {
|
||||
@@ -335,16 +341,16 @@ public class MainActivity extends BaseActivity
|
||||
});
|
||||
}
|
||||
|
||||
if(fragment instanceof IFilterableFragment) {
|
||||
if (fragment instanceof IFilterableFragment) {
|
||||
mBinding.appBarMain.mainFilter.setVisibility(View.VISIBLE);
|
||||
mBinding.appBarMain.mainFilter.setOnClickListener(new OnSingleClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v) {
|
||||
((IFilterableFragment)fragment).onFilterClick();
|
||||
((IFilterableFragment) fragment).onFilterClick();
|
||||
}
|
||||
});
|
||||
|
||||
((IFilterableFragment)fragment).addOnPreDestroy(() -> {
|
||||
((IFilterableFragment) fragment).addOnPreDestroy(() -> {
|
||||
mBinding.appBarMain.mainFilter.setVisibility(View.GONE);
|
||||
mBinding.appBarMain.mainFilter.setOnClickListener(null);
|
||||
});
|
||||
@@ -354,14 +360,14 @@ public class MainActivity extends BaseActivity
|
||||
}
|
||||
}
|
||||
|
||||
private void changeContentFragment(Fragment fragment, boolean addToBackStack){
|
||||
private void changeContentFragment(Fragment fragment, boolean addToBackStack) {
|
||||
if (fragment != null) {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
FragmentTransaction ft = fragmentManager
|
||||
.beginTransaction()
|
||||
.replace(R.id.frame_container, fragment);
|
||||
|
||||
if(addToBackStack) ft.addToBackStack(fragment.getTag());
|
||||
if (addToBackStack) ft.addToBackStack(fragment.getTag());
|
||||
|
||||
ft.commit();
|
||||
//fragmentManager.executePendingTransactions();
|
||||
@@ -370,11 +376,7 @@ public class MainActivity extends BaseActivity
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void init(){
|
||||
private void init() {
|
||||
|
||||
// ServerStatusChecker.getInstance().addCallback(value -> {
|
||||
// if(value && (!mIsOnline || firstCheckExecution)){
|
||||
|
||||
@@ -24,11 +24,9 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.IOrdiniVendita;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverDTO;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
@@ -113,7 +111,6 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
|
||||
init();
|
||||
initGestMenu();
|
||||
// initGestMenuOLD();
|
||||
initVersion();
|
||||
}
|
||||
|
||||
@@ -296,40 +293,6 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
|
||||
}
|
||||
|
||||
private void initGestMenuOLD() {
|
||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||
if (customConfiguration == null) {
|
||||
// MainApplication.exit();
|
||||
}
|
||||
|
||||
BaseMenuConfiguration menuConfiguration = customConfiguration.getConfig(BaseCustomConfiguration.Keys.MENU_CONFIGURATION);
|
||||
List<MenuConfiguration.MenuGroup> menuGroups = menuConfiguration.getGroups();
|
||||
|
||||
int menuSpanCount = 2;
|
||||
if(UtilityDimension.getDisplayInchs(this.getActivity()) > 8) menuSpanCount = 4;
|
||||
else if(UtilityDimension.getDisplayInchs(this.getActivity()) > 6.5) menuSpanCount = 3;
|
||||
|
||||
for (MenuConfiguration.MenuGroup menuGroup : menuGroups) {
|
||||
FragmentMainMenuGroupLayoutBinding groupBinding = DataBindingUtil.inflate(mLayoutInflater, R.layout.fragment_main_menu_group_layout, null, false);
|
||||
|
||||
String title = this.getResources().getString(menuGroup.getGroupText());
|
||||
groupBinding.generalDashboardGroupTitle.setText(title);
|
||||
|
||||
MenuListAdapter menuListAdapter = new MenuListAdapter(getContext(), menuGroup.getItems());
|
||||
|
||||
groupBinding.mainList.setLayoutManager(new GridLayoutManager(getContext(), menuSpanCount));
|
||||
groupBinding.mainList.setAdapter(menuListAdapter);
|
||||
groupBinding.mainList.setNestedScrollingEnabled(false);
|
||||
|
||||
menuListAdapter.setClickListener((view, position) -> {
|
||||
onMenuClick(menuGroup.getItems().get(position));
|
||||
});
|
||||
|
||||
mBindings.menuContainer.addView(groupBinding.getRoot());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void onMenuClick(MenuConfiguration.MenuItem menuItem) {
|
||||
((MainActivity) getActivity()).setMenuItem(menuItem.getID());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAgenteLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutomezzoLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterViaggioLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
|
||||
public class OrdiniUscitaElencoBindings {
|
||||
|
||||
|
||||
public static final int DEPOSITO_FILTER_ID = 0;
|
||||
public static final int VIAGGIO_FILTER_ID = 1;
|
||||
public static final int NUM_ORD_FILTER_ID = 2;
|
||||
public static final int CLIENTE_FILTER_ID = 3;
|
||||
public static final int VETTORE_FILTER_ID = 4;
|
||||
public static final int AUTOMEZZO_FILTER_ID = 5;
|
||||
public static final int PAESE_FILTER_ID = 6;
|
||||
public static final int AGENTE_FILTER_ID = 7;
|
||||
public static final int TERM_CONS_FILTER_ID = 8;
|
||||
public static final int DATA_CONS_FILTER_ID = 9;
|
||||
public static final int GRUPPO_MERC_FILTER_ID = 10;
|
||||
|
||||
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {{
|
||||
put(DEPOSITO_FILTER_ID, new FilterChipDTO()
|
||||
.setID(DEPOSITO_FILTER_ID)
|
||||
.setFilterChipText("Deposito")
|
||||
.setFilterLayoutView(new FilterDepositoLayoutView()));
|
||||
|
||||
put(VIAGGIO_FILTER_ID, new FilterChipDTO()
|
||||
.setID(VIAGGIO_FILTER_ID)
|
||||
.setFilterChipText("Viaggio")
|
||||
.setFilterLayoutView(new FilterViaggioLayoutView()));
|
||||
|
||||
put(NUM_ORD_FILTER_ID, new FilterChipDTO()
|
||||
.setID(NUM_ORD_FILTER_ID)
|
||||
.setFilterChipText("Numero ordine")
|
||||
.setFilterLayoutView(new FilterNumeroOrdineLayoutView()));
|
||||
|
||||
put(CLIENTE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(CLIENTE_FILTER_ID)
|
||||
.setFilterChipText("Cliente")
|
||||
.setFilterLayoutView(new FilterClienteLayoutView()));
|
||||
|
||||
put(VETTORE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(VETTORE_FILTER_ID)
|
||||
.setFilterChipText("Vettore")
|
||||
.setFilterLayoutView(new FilterVettoreLayoutView()));
|
||||
|
||||
put(AUTOMEZZO_FILTER_ID, new FilterChipDTO()
|
||||
.setID(AUTOMEZZO_FILTER_ID)
|
||||
.setFilterChipText("Automezzo")
|
||||
.setFilterLayoutView(new FilterAutomezzoLayoutView()));
|
||||
|
||||
put(PAESE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(PAESE_FILTER_ID)
|
||||
.setFilterChipText("Paese")
|
||||
.setFilterLayoutView(new FilterPaeseLayoutView()));
|
||||
|
||||
put(AGENTE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(AGENTE_FILTER_ID)
|
||||
.setFilterChipText("Agente")
|
||||
.setFilterLayoutView(new FilterAgenteLayoutView()));
|
||||
|
||||
put(TERM_CONS_FILTER_ID, new FilterChipDTO()
|
||||
.setID(TERM_CONS_FILTER_ID)
|
||||
.setFilterChipText("Termini consegna")
|
||||
.setFilterLayoutView(new FilterTermConsLayoutView()));
|
||||
|
||||
put(DATA_CONS_FILTER_ID, new FilterChipDTO()
|
||||
.setID(DATA_CONS_FILTER_ID)
|
||||
.setFilterChipText("Data consegna"));
|
||||
|
||||
put(GRUPPO_MERC_FILTER_ID, new FilterChipDTO()
|
||||
.setID(GRUPPO_MERC_FILTER_ID)
|
||||
.setFilterChipText("Gruppo merceologico")
|
||||
.setFilterLayoutView(new FilterGruppoMercLayoutView()));
|
||||
}};
|
||||
|
||||
}
|
||||
@@ -15,9 +15,12 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.material.datepicker.MaterialDatePicker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -29,33 +32,55 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.OnGeneralChangedCallback;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentMainOrdiniUscitaBinding;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzatoView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzatoViewModel;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAgenteLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutomezzoLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterViaggioLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.VenditaFiltroOrdiniViewModel;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.ui.OrdiniUscitaElencoAdapter;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.ui.OrdiniUscitaElencoListModel;
|
||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneActivity;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.BaseDialogRowInfoView;
|
||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ISelectAllFragment, IFilterableFragment, OrdiniUscitaElencoViewModel.Listener {
|
||||
public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ISelectAllFragment, OrdiniUscitaElencoViewModel.Listener {
|
||||
|
||||
public BindableBoolean fabVisible = new BindableBoolean(false);
|
||||
|
||||
@Inject
|
||||
DepositoRESTConsumer mDepositoRESTConsumer;
|
||||
|
||||
@Inject
|
||||
ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
|
||||
@Inject
|
||||
OrdiniUscitaElencoViewModel mViewModel;
|
||||
|
||||
@@ -73,6 +98,8 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
|
||||
private List<MtbDepo> mtbDepoCache;
|
||||
private List<MtbGrup> mtbGrupCache;
|
||||
|
||||
public OrdiniUscitaElencoFragment() {
|
||||
// Required empty public constructor
|
||||
@@ -125,15 +152,21 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
this.initRecyclerView();
|
||||
this.initBarcodeReader();
|
||||
|
||||
this.initFilters();
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.initMtbDepoCache(() -> {
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
mViewModel.init(codMdep, mCurrentGestioneOrd, mCurrentGestioneCol, mCurrentSegnoCol);
|
||||
});
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
mViewModel.init(codMdep, mCurrentGestioneOrd, mCurrentGestioneCol, mCurrentSegnoCol);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,7 +184,12 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
boolean canSelectMultipleOrdini = SettingsManager.iDB().isFlagSpedizioneCanSelectMultipleOrders();
|
||||
boolean canSelectMultipleClienti = SettingsManager.iDB().isFlagMultiClienteOrdV();
|
||||
|
||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), v -> this.refreshList(null));
|
||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), v -> {
|
||||
this.onLoadingStarted();
|
||||
this.initMtbGrupsCache(this::onLoadingEnded);
|
||||
|
||||
this.refreshList(null);
|
||||
});
|
||||
|
||||
OrdiniUscitaElencoAdapter ordiniUscitaElencoAdapter =
|
||||
new OrdiniUscitaElencoAdapter(getActivity(), mOrdiniInevasiMutableData)
|
||||
@@ -187,8 +225,8 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
this.mBindings.venditaMainList.setAdapter(ordiniUscitaElencoAdapter);
|
||||
this.mBindings.venditaMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
||||
if (mToolbar != null)
|
||||
mToolbar.setRecyclerView(this.mBindings.venditaMainList);
|
||||
// if (mToolbar != null)
|
||||
// mToolbar.setRecyclerView(this.mBindings.venditaMainList);
|
||||
}
|
||||
|
||||
private void initBarcodeReader() {
|
||||
@@ -199,6 +237,444 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
private void initFilters() {
|
||||
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshList(null);
|
||||
}
|
||||
};
|
||||
|
||||
mAppliedFilterViewModel.getCurrentDepositoPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentIdViaggioPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentClientePredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentVettorePredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentAutomezzoPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentPaesePredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentAgentePredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentTermConsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentDataConsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
|
||||
for (var filterChipDTO : OrdiniUscitaElencoBindings.AVAILABLE_FILTERS.entrySet()) {
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(
|
||||
requireActivity(),
|
||||
filterChipDTO.getValue().getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO.getValue()));
|
||||
|
||||
switch (filterChipDTO.getKey()) {
|
||||
case OrdiniUscitaElencoBindings.DEPOSITO_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentDepositoPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentDepositoPredicate().get() == null) {
|
||||
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.getCurrentDepositoPredicate().set(null));
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.VIAGGIO_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentIdViaggioPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentIdViaggioPredicate().get() == null) {
|
||||
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.getCurrentIdViaggioPredicate().set(null));
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.NUM_ORD_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentNumOrdsPredicate().get() == null) {
|
||||
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.getCurrentNumOrdsPredicate().set(null));
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.CLIENTE_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentClientePredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentClientePredicate().get() == null) {
|
||||
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.getCurrentClientePredicate().set(null));
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.VETTORE_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentVettorePredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentVettorePredicate().get() == null) {
|
||||
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.getCurrentVettorePredicate().set(null));
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.AUTOMEZZO_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentAutomezzoPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentAutomezzoPredicate().get() == null) {
|
||||
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.getCurrentAutomezzoPredicate().set(null));
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.PAESE_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentPaesePredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentPaesePredicate().get() == null) {
|
||||
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.getCurrentPaesePredicate().set(null));
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.AGENTE_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentAgentePredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentAgentePredicate().get() == null) {
|
||||
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.getCurrentAgentePredicate().set(null));
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.TERM_CONS_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentTermConsPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentTermConsPredicate().get() == null) {
|
||||
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.getCurrentTermConsPredicate().set(null));
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.DATA_CONS_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentDataConsPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentDataConsPredicate().get() == null) {
|
||||
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.setDataConsegnaFilter(null);
|
||||
mAppliedFilterViewModel.getCurrentDataConsPredicate().set(null);
|
||||
});
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.GRUPPO_MERC_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentGruppoMercPredicate().get() == null) {
|
||||
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.setGruppoMercFilter(null);
|
||||
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().set(null);
|
||||
});
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||
if (filterChipDTO.getID() == OrdiniUscitaElencoBindings.DATA_CONS_FILTER_ID) {
|
||||
var datePicker =
|
||||
MaterialDatePicker.Builder.datePicker()
|
||||
.setTitleText(filterChipDTO.getFilterChipText())
|
||||
.setSelection(this.mAppliedFilterViewModel.getSelectedDataCons() != null ? this.mAppliedFilterViewModel.getSelectedDataCons().getTime() : null)
|
||||
.build();
|
||||
|
||||
datePicker.addOnPositiveButtonClickListener(selection -> {
|
||||
this.mAppliedFilterViewModel.setDataConsegnaFilter(new Date(selection));
|
||||
});
|
||||
datePicker.show(requireActivity().getSupportFragmentManager(), "TAG");
|
||||
return;
|
||||
}
|
||||
|
||||
filterChipDTO
|
||||
.getFilterLayoutView()
|
||||
.setFilterName(filterChipDTO.getFilterChipText())
|
||||
.setContext(requireActivity());
|
||||
|
||||
var filterLayoutView = filterChipDTO
|
||||
.getFilterLayoutView();
|
||||
|
||||
switch (filterChipDTO.getID()) {
|
||||
case OrdiniUscitaElencoBindings.DEPOSITO_FILTER_ID:
|
||||
((FilterDepositoLayoutView) filterLayoutView)
|
||||
.setAllCodMdeps(mAppliedFilterViewModel.getAllCodMdeps(mtbDepoCache))
|
||||
.setAvailableCodMdeps(mAppliedFilterViewModel.getAvailableCodMdeps(mtbDepoCache))
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setDepositoFilter)
|
||||
.setPreSelectedCodMdeps(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentDepositoPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentDepositoPredicate().get())
|
||||
.map(x -> Stream.of(mtbDepoCache).filter(y -> x.getCodMdep().equalsIgnoreCase(y.getCodMdep())).findFirst().get())
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.VIAGGIO_FILTER_ID:
|
||||
((FilterViaggioLayoutView) filterLayoutView)
|
||||
.setAllIDViaggio(mAppliedFilterViewModel.getAllIDViaggio())
|
||||
.setAvailableIDViaggio(mAppliedFilterViewModel.getAvailableIDViaggio())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setIDViaggioFilter)
|
||||
.setPreSelectedIDViaggio(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentIdViaggioPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentIdViaggioPredicate().get())
|
||||
.map(OrdineUscitaInevasoDTO::getIdViaggio)
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.NUM_ORD_FILTER_ID:
|
||||
((FilterNumeroOrdineLayoutView) filterLayoutView)
|
||||
.setAllNumOrds(mAppliedFilterViewModel.getAllNumOrds())
|
||||
.setAvailableNumOrds(mAppliedFilterViewModel.getAvailableNumOrds())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setNumOrdFilter)
|
||||
.setPreSelectedNumOrds(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentNumOrdsPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentNumOrdsPredicate().get())
|
||||
.map(OrdineUscitaInevasoDTO::getNumOrd)
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.CLIENTE_FILTER_ID:
|
||||
((FilterClienteLayoutView) filterLayoutView)
|
||||
.setAllClienti(mAppliedFilterViewModel.getAllClienti())
|
||||
.setAvailableClienti(mAppliedFilterViewModel.getAvailableClienti())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setClienteFilter)
|
||||
.setPreSelectedClienti(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentClientePredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentClientePredicate().get())
|
||||
.map(OrdineUscitaInevasoDTO::getRagSocOrd)
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.VETTORE_FILTER_ID:
|
||||
((FilterVettoreLayoutView) filterLayoutView)
|
||||
.setAllVettori(mAppliedFilterViewModel.getAllVettori())
|
||||
.setAvailableVettori(mAppliedFilterViewModel.getAvailableVettori())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setVettoreFilter)
|
||||
.setPreSelectedVettori(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentVettorePredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentVettorePredicate().get())
|
||||
.map(x -> x.getCodVvet() + (!UtilityString.isNullOrEmpty(x.getCodVvet()) ? " - " + x.getDescrizioneVettore() : ""))
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.AUTOMEZZO_FILTER_ID:
|
||||
((FilterAutomezzoLayoutView) filterLayoutView)
|
||||
.setAllAutomezzi(mAppliedFilterViewModel.getAllAutomezzi())
|
||||
.setAvailableAutomezzi(mAppliedFilterViewModel.getAvailableAutomezzi())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setAutomezzoFilter)
|
||||
.setPreSelectedAutomezzi(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentAutomezzoPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentAutomezzoPredicate().get())
|
||||
.map(OrdineUscitaInevasoDTO::getDescrizioneAuto)
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.PAESE_FILTER_ID:
|
||||
((FilterPaeseLayoutView) filterLayoutView)
|
||||
.setAllPaesi(mAppliedFilterViewModel.getAllPaesi())
|
||||
.setAvailablePaesi(mAppliedFilterViewModel.getAvailablePaesi())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setPaeseFilter)
|
||||
.setPreSelectedPaesi(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentPaesePredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentPaesePredicate().get())
|
||||
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.AGENTE_FILTER_ID:
|
||||
((FilterAgenteLayoutView) filterLayoutView)
|
||||
.setAllAgenti(mAppliedFilterViewModel.getAllAgenti())
|
||||
.setAvailableAgenti(mAppliedFilterViewModel.getAvailableAgenti())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setAgenteFilter)
|
||||
.setPreSelectedAgenti(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentAgentePredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentAgentePredicate().get())
|
||||
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.TERM_CONS_FILTER_ID:
|
||||
((FilterTermConsLayoutView) filterLayoutView)
|
||||
.setAllTermCons(mAppliedFilterViewModel.getAllTermCons())
|
||||
.setAvailableTermCons(mAppliedFilterViewModel.getAvailableTermCons())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setTerminiConsegnaFilter)
|
||||
.setPreSelectedTermCons(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentTermConsPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentTermConsPredicate().get())
|
||||
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case OrdiniUscitaElencoBindings.GRUPPO_MERC_FILTER_ID:
|
||||
((FilterGruppoMercLayoutView) filterLayoutView)
|
||||
.setAllGroupMerc(mAppliedFilterViewModel.getAllGruppoMerc(mtbGrupCache))
|
||||
.setAvailableGroupMerc(mAppliedFilterViewModel.getAvailableGruppoMerc(mtbGrupCache))
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setGruppoMercFilter)
|
||||
.setPreSelectedGroupMerc(mAppliedFilterViewModel.getSelectedMtbGrup());
|
||||
break;
|
||||
}
|
||||
|
||||
filterLayoutView.show(requireActivity().getSupportFragmentManager(), "TAG");
|
||||
}
|
||||
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
@@ -210,20 +686,35 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
};
|
||||
|
||||
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
||||
List<OrdiniUscitaElencoDTO> tmpList = null;
|
||||
this.onLoadingStarted();
|
||||
|
||||
if(filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mAppliedFilterViewModel != null) {
|
||||
mAppliedFilterViewModel.init(mViewModel.getOrderList().getValue());
|
||||
mAppliedFilterViewModel.applyAllTests();
|
||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getOrderList().getValue();
|
||||
}
|
||||
//new Thread(() -> {
|
||||
|
||||
// requireActivity().runOnUiThread(() -> {
|
||||
List<OrdiniUscitaElencoDTO> tmpList;
|
||||
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mAppliedFilterViewModel != null) {
|
||||
mAppliedFilterViewModel.init(mViewModel.getOrderList().getValue());
|
||||
mAppliedFilterViewModel.applyAllTests();
|
||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getOrderList().getValue();
|
||||
}
|
||||
|
||||
var list = convertDataModelToListModel(tmpList);
|
||||
|
||||
this.mOrdiniInevasiMutableData.clear();
|
||||
this.mOrdiniInevasiMutableData.addAll(list);
|
||||
|
||||
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||
// });
|
||||
|
||||
this.onLoadingEnded();
|
||||
//}).start();
|
||||
|
||||
this.mOrdiniInevasiMutableData.clear();
|
||||
this.mOrdiniInevasiMutableData.addAll(convertDataModelToListModel(tmpList));
|
||||
}
|
||||
|
||||
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
||||
@@ -285,7 +776,7 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
.map(OrdiniUscitaElencoListModel::getOriginalModel)
|
||||
.toList();
|
||||
|
||||
this.mViewModel.loadPicking(selectedOrders);
|
||||
this.mViewModel.loadPicking(selectedOrders, this.mAppliedFilterViewModel.getSelectedMtbGrup());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -334,25 +825,46 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
}
|
||||
|
||||
|
||||
private DialogVenditaFiltroAvanzatoViewModel mAppliedFilterViewModel;
|
||||
private final VenditaFiltroOrdiniViewModel mAppliedFilterViewModel = new VenditaFiltroOrdiniViewModel();
|
||||
|
||||
@Override
|
||||
public void onFilterClick() {
|
||||
DialogVenditaFiltroAvanzatoView.make(
|
||||
getActivity(),
|
||||
this.mViewModel.getOrderList().getValue(),
|
||||
mAppliedFilterViewModel,
|
||||
|
||||
filter -> {
|
||||
|
||||
mAppliedFilterViewModel = filter;
|
||||
refreshList(null);
|
||||
|
||||
}).show();
|
||||
}
|
||||
// @Override
|
||||
// public void onFilterClick() {
|
||||
// DialogVenditaFiltroAvanzatoView.make(
|
||||
// getActivity(),
|
||||
// this.mViewModel.getOrderList().getValue(),
|
||||
// mAppliedFilterViewModel,
|
||||
//
|
||||
// filter -> {
|
||||
//
|
||||
// mAppliedFilterViewModel = filter;
|
||||
// refreshList(null);
|
||||
//
|
||||
// }).show();
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||
this.mOnPreDestroyList.add(onPreDestroy);
|
||||
}
|
||||
|
||||
|
||||
private void initMtbDepoCache(Runnable onComplete) {
|
||||
this.mDepositoRESTConsumer.getAll(mtbDepos -> {
|
||||
this.mtbDepoCache = mtbDepos;
|
||||
onComplete.run();
|
||||
}, this::onError);
|
||||
}
|
||||
|
||||
|
||||
private void initMtbGrupsCache(Runnable onComplete) {
|
||||
var codMgrpArts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
||||
.flatMap(x -> Stream.of(x.getAvailableClassMerc()))
|
||||
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
||||
.toList();
|
||||
|
||||
this.mArticoloRESTConsumer.getArtsGroups(codMgrpArts, mtbGrupCache -> {
|
||||
this.mtbGrupCache = mtbGrupCache;
|
||||
onComplete.run();
|
||||
}, this::onError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
@@ -81,7 +82,7 @@ public class OrdiniUscitaElencoViewModel {
|
||||
|
||||
long forcedDelaySecs = (new Date().getTime() - loadingStartDate.getTime()) / 1000;
|
||||
|
||||
if(2 - forcedDelaySecs > 0) {
|
||||
if (2 - forcedDelaySecs > 0) {
|
||||
try {
|
||||
Thread.sleep((2 - forcedDelaySecs) * 1000);
|
||||
} catch (Exception ignored) {
|
||||
@@ -96,14 +97,14 @@ public class OrdiniUscitaElencoViewModel {
|
||||
}
|
||||
|
||||
|
||||
public void loadPicking(List<OrdiniUscitaElencoDTO> selectedOrders) {
|
||||
public void loadPicking(List<OrdiniUscitaElencoDTO> selectedOrders, List<MtbGrup> mtbGrupToFilter) {
|
||||
List<GestioneEnum> foundGestioni = Stream.of(selectedOrders)
|
||||
.map(OrdineUscitaInevasoDTO::getGestioneEnum)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(foundGestioni != null && foundGestioni.size() > 1) {
|
||||
if (foundGestioni != null && foundGestioni.size() > 1) {
|
||||
this.sendError(new InvalidLUMultiGestioneException());
|
||||
return;
|
||||
}
|
||||
@@ -115,7 +116,7 @@ public class OrdiniUscitaElencoViewModel {
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(foundCodMdep != null && foundCodMdep.size() > 1) {
|
||||
if (foundCodMdep != null && foundCodMdep.size() > 1) {
|
||||
this.sendError(new InvalidLUMultiCodMdepException());
|
||||
return;
|
||||
}
|
||||
@@ -129,12 +130,20 @@ public class OrdiniUscitaElencoViewModel {
|
||||
|
||||
this.mOrdiniRESTConsumer.retrieveListaArticoliFromOrdiniUscita(selectedOrdersBase, sitArts -> {
|
||||
|
||||
if(mtbGrupToFilter != null && !mtbGrupToFilter.isEmpty()) {
|
||||
sitArts = Stream.of(sitArts)
|
||||
.filter(x -> Stream.of(mtbGrupToFilter).map(MtbGrup::getCodMgrp).anyMatch(y -> y.equalsIgnoreCase(x.getCodMgrp())))
|
||||
.toList();
|
||||
}
|
||||
|
||||
List<SitArtOrdDTO> finalSitArts = sitArts;
|
||||
|
||||
this.mOrdiniRESTConsumer.getBancaliGiaRegistrati(
|
||||
Stream.of(selectedOrdersBase).map(x -> (OrdineInevasoDTO) x).toList(),
|
||||
mCurrentGestioneCol,
|
||||
mCurrentSegnoCol,
|
||||
mtbColtList -> {
|
||||
this.sendOnOrdersDispatched(selectedOrdersBase, sitArts, mtbColtList);
|
||||
this.sendOnOrdersDispatched(selectedOrdersBase, finalSitArts, mtbColtList);
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
@@ -149,11 +158,11 @@ public class OrdiniUscitaElencoViewModel {
|
||||
this.sendOnOrderFiltered(orderList);
|
||||
};
|
||||
|
||||
if(UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
||||
if (UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
||||
this.executeEtichettaOrdineV(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||
} else if(UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||
} else if(UtilityBarcode.isEtichetta128(barcodeScanDTO)){
|
||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
this.executeEtichettaEan128(barcodeScanDTO, onBarcodeScanComplete);
|
||||
} else {
|
||||
onComplete.run();
|
||||
@@ -161,7 +170,6 @@ public class OrdiniUscitaElencoViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void executeEtichettaOrdineV(String barcode, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||
String gestione = "";
|
||||
|
||||
@@ -198,13 +206,13 @@ public class OrdiniUscitaElencoViewModel {
|
||||
private void executeEtichettaLU(String SSCC, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||
|
||||
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||
|
||||
if(mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) {
|
||||
if (mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) {
|
||||
//GET BY COMMESSA COLLO
|
||||
this.mOrdiniUscitaElencoRESTConsumer.getOrdiniFromCommessaCollo(mCurrentCodMdep, mtbColt, orderList -> {
|
||||
|
||||
if(orderList != null && orderList.size() > 0) {
|
||||
if (orderList != null && orderList.size() > 0) {
|
||||
List<Integer> numOrds = Stream.of(orderList)
|
||||
.map(DtbOrdt::getNumOrd)
|
||||
.toList();
|
||||
@@ -235,14 +243,15 @@ public class OrdiniUscitaElencoViewModel {
|
||||
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||
String barcodeProd = null;
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Content)) barcodeProd = ean128Model.Content;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
|
||||
barcodeProd = ean128Model.Content;
|
||||
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)){
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||
this.executeEtichettaLU(ean128Model.Sscc, onComplete);
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
@@ -280,7 +289,8 @@ public class OrdiniUscitaElencoViewModel {
|
||||
}
|
||||
|
||||
private void sendOnOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts) {
|
||||
if (this.mListener != null) mListener.onOrdersDispatched(orders, sitArts, alreadyRegisteredMtbColts);
|
||||
if (this.mListener != null)
|
||||
mListener.onOrdersDispatched(orders, sitArts, alreadyRegisteredMtbColts);
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.LayoutFilterAgenteBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterAgenteLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterAgenteBinding mBindings;
|
||||
|
||||
private List<String> allAgenti;
|
||||
private List<String> availableAgenti;
|
||||
private List<String> preSelectedAgenti = new ArrayList<>();
|
||||
private List<String> hiddenAgenti = 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_agente, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenAgenti = Stream.of(allAgenti)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_agente__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
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().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllAgenti())
|
||||
.filter(x -> !hiddenAgenti.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedAgenti.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableAgenti.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<String> getAllAgenti() {
|
||||
return allAgenti;
|
||||
}
|
||||
|
||||
public FilterAgenteLayoutView setAllAgenti(List<String> allAgenti) {
|
||||
this.allAgenti = allAgenti;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getAvailableAgenti() {
|
||||
return availableAgenti;
|
||||
}
|
||||
|
||||
public FilterAgenteLayoutView setAvailableAgenti(List<String> availableAgenti) {
|
||||
this.availableAgenti = availableAgenti;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPreSelectedAgenti() {
|
||||
return preSelectedAgenti;
|
||||
}
|
||||
|
||||
public FilterAgenteLayoutView setPreSelectedAgenti(List<String> preSelectedAgenti) {
|
||||
this.preSelectedAgenti = preSelectedAgenti;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterAgenteLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
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,164 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.LayoutFilterAutomezzoBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterAutomezzoLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterAutomezzoBinding mBindings;
|
||||
|
||||
private List<String> allAutomezzi;
|
||||
private List<String> availableAutomezzi;
|
||||
private List<String> preSelectedAutomezzi = new ArrayList<>();
|
||||
private List<String> hiddenAutomezzi = new ArrayList<>();
|
||||
private 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_automezzo, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenAutomezzi = Stream.of(allAutomezzi)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_automezzo__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
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().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllAutomezzi())
|
||||
.filter(x -> !hiddenAutomezzi.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedAutomezzi.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableAutomezzi.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<String> getAllAutomezzi() {
|
||||
return allAutomezzi;
|
||||
}
|
||||
|
||||
public FilterAutomezzoLayoutView setAllAutomezzi(List<String> allAutomezzi) {
|
||||
this.allAutomezzi = allAutomezzi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getAvailableAutomezzi() {
|
||||
return availableAutomezzi;
|
||||
}
|
||||
|
||||
public FilterAutomezzoLayoutView setAvailableAutomezzi(List<String> availableAutomezzi) {
|
||||
this.availableAutomezzi = availableAutomezzi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPreSelectedAutomezzi() {
|
||||
return preSelectedAutomezzi;
|
||||
}
|
||||
|
||||
public FilterAutomezzoLayoutView setPreSelectedAutomezzi(List<String> preSelectedAutomezzi) {
|
||||
this.preSelectedAutomezzi = preSelectedAutomezzi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterAutomezzoLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
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,164 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.LayoutFilterClienteBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterClienteLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterClienteBinding mBindings;
|
||||
|
||||
private List<String> allClienti;
|
||||
private List<String> availableClienti;
|
||||
private List<String> preSelectedClienti = new ArrayList<>();
|
||||
private List<String> hiddenClienti = 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_cliente, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenClienti = Stream.of(allClienti)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_cliente__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
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().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllClienti())
|
||||
.filter(x -> !hiddenClienti.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedClienti.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableClienti.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<String> getAllClienti() {
|
||||
return allClienti;
|
||||
}
|
||||
|
||||
public FilterClienteLayoutView setAllClienti(List<String> allClienti) {
|
||||
this.allClienti = allClienti;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getAvailableClienti() {
|
||||
return availableClienti;
|
||||
}
|
||||
|
||||
public FilterClienteLayoutView setAvailableClienti(List<String> availableClienti) {
|
||||
this.availableClienti = availableClienti;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPreSelectedClienti() {
|
||||
return preSelectedClienti;
|
||||
}
|
||||
|
||||
public FilterClienteLayoutView setPreSelectedClienti(List<String> preSelectedClienti) {
|
||||
this.preSelectedClienti = preSelectedClienti;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterClienteLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
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,167 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.model.MtbDepo;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.LayoutFilterDepositoBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterDepositoLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterDepositoBinding mBindings;
|
||||
|
||||
private List<MtbDepo> allCodMdeps;
|
||||
private List<MtbDepo> availableCodMdeps;
|
||||
private List<MtbDepo> preSelectedCodMdeps = new ArrayList<>();
|
||||
private List<MtbDepo> hiddenDepos = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<MtbDepo>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_deposito, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenDepos = Stream.of(allCodMdeps)
|
||||
.filter(x -> !x.getCodMdep().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||
!x.getDescrizione().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_deposito__list_item)
|
||||
.into(this.mBindings.recyclerviewDepositi);
|
||||
|
||||
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().getCodMdep().compareToIgnoreCase(x.getOriginalModel().getCodMdep())))
|
||||
.reversed();
|
||||
|
||||
|
||||
listModel.setValue(Stream.of(getAllCodMdeps())
|
||||
.filter(x -> !hiddenDepos.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedCodMdeps.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableCodMdeps.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
public List<MtbDepo> getAllCodMdeps() {
|
||||
return allCodMdeps;
|
||||
}
|
||||
|
||||
public FilterDepositoLayoutView setAllCodMdeps(List<MtbDepo> allCodMdeps) {
|
||||
this.allCodMdeps = allCodMdeps;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbDepo> getAvailableCodMdeps() {
|
||||
return availableCodMdeps;
|
||||
}
|
||||
|
||||
public FilterDepositoLayoutView setAvailableCodMdeps(List<MtbDepo> availableCodMdeps) {
|
||||
this.availableCodMdeps = availableCodMdeps;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbDepo> getPreSelectedCodMdeps() {
|
||||
return preSelectedCodMdeps;
|
||||
}
|
||||
|
||||
public FilterDepositoLayoutView setPreSelectedCodMdeps(List<MtbDepo> preSelectedCodMdeps) {
|
||||
this.preSelectedCodMdeps = preSelectedCodMdeps;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<MtbDepo>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterDepositoLayoutView setOnFilterApplied(RunnableArgs<List<MtbDepo>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static class ListModel {
|
||||
private BindableBoolean selected = new BindableBoolean();
|
||||
private BindableBoolean enabled = new BindableBoolean();
|
||||
private MtbDepo 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 MtbDepo getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public ListModel setOriginalModel(MtbDepo originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.LayoutFilterGruppoMercBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterGruppoMercLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterGruppoMercBinding mBindings;
|
||||
|
||||
private List<MtbGrup> allGroupMerc;
|
||||
private List<MtbGrup> availableGroupMerc;
|
||||
private List<MtbGrup> preSelectedGroupMerc = new ArrayList<>();
|
||||
private List<MtbGrup> hiddenGroupMerc = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<MtbGrup>> onFilterApplied;
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_gruppo_merc, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenGroupMerc = Stream.of(allGroupMerc)
|
||||
.filter(x -> !x.getCodMgrp().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||
!x.getDescrizione().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_gruppo_merc__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
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().getCodMgrp().compareTo(x.getOriginalModel().getCodMgrp())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllGroupMerc())
|
||||
.filter(x -> !hiddenGroupMerc.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedGroupMerc.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableGroupMerc.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<MtbGrup> getAllGroupMerc() {
|
||||
return allGroupMerc;
|
||||
}
|
||||
|
||||
public FilterGruppoMercLayoutView setAllGroupMerc(List<MtbGrup> allGroupMerc) {
|
||||
this.allGroupMerc = allGroupMerc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbGrup> getAvailableGroupMerc() {
|
||||
return availableGroupMerc;
|
||||
}
|
||||
|
||||
public FilterGruppoMercLayoutView setAvailableGroupMerc(List<MtbGrup> availableGroupMerc) {
|
||||
this.availableGroupMerc = availableGroupMerc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbGrup> getPreSelectedGroupMerc() {
|
||||
return preSelectedGroupMerc;
|
||||
}
|
||||
|
||||
public FilterGruppoMercLayoutView setPreSelectedGroupMerc(List<MtbGrup> preSelectedGroupMerc) {
|
||||
this.preSelectedGroupMerc = preSelectedGroupMerc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<MtbGrup>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterGruppoMercLayoutView setOnFilterApplied(RunnableArgs<List<MtbGrup>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static class ListModel {
|
||||
private BindableBoolean selected = new BindableBoolean();
|
||||
private BindableBoolean enabled = new BindableBoolean();
|
||||
private MtbGrup 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 MtbGrup getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public ListModel setOriginalModel(MtbGrup originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.LayoutFilterNumeroOrdineBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterNumeroOrdineLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterNumeroOrdineBinding mBindings;
|
||||
|
||||
private List<Integer> allNumOrds;
|
||||
private List<Integer> availableNumOrds;
|
||||
private List<Integer> preSelectedNumOrds = new ArrayList<>();
|
||||
private List<Integer> hiddenNumOrds = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<Integer>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_numero_ordine, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenNumOrds = Stream.of(allNumOrds)
|
||||
.filter(x -> !x.toString().contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_numero_ordine__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
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().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllNumOrds())
|
||||
.filter(x -> !hiddenNumOrds.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedNumOrds.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableNumOrds.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<Integer> getAllNumOrds() {
|
||||
return allNumOrds;
|
||||
}
|
||||
|
||||
public FilterNumeroOrdineLayoutView setAllNumOrds(List<Integer> allIDViaggio) {
|
||||
this.allNumOrds = allIDViaggio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<Integer> getAvailableNumOrds() {
|
||||
return availableNumOrds;
|
||||
}
|
||||
|
||||
public FilterNumeroOrdineLayoutView setAvailableNumOrds(List<Integer> availableIDViaggio) {
|
||||
this.availableNumOrds = availableIDViaggio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<Integer> getPreSelectedNumOrds() {
|
||||
return preSelectedNumOrds;
|
||||
}
|
||||
|
||||
public FilterNumeroOrdineLayoutView setPreSelectedNumOrds(List<Integer> preSelectedIDViaggio) {
|
||||
this.preSelectedNumOrds = preSelectedIDViaggio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<Integer>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterNumeroOrdineLayoutView setOnFilterApplied(RunnableArgs<List<Integer>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static class ListModel {
|
||||
private BindableBoolean selected = new BindableBoolean();
|
||||
private BindableBoolean enabled = new BindableBoolean();
|
||||
private Integer 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 Integer getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public ListModel setOriginalModel(Integer originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.LayoutFilterPaeseBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterPaeseLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterPaeseBinding mBindings;
|
||||
|
||||
private List<String> allPaesi;
|
||||
private List<String> availablePaesi;
|
||||
private List<String> preSelectedPaesi = new ArrayList<>();
|
||||
private List<String> hiddenPaesi = 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_paese, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenPaesi = Stream.of(allPaesi)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_paese__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
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().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllPaesi())
|
||||
.filter(x -> !hiddenPaesi.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedPaesi.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availablePaesi.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<String> getAllPaesi() {
|
||||
return allPaesi;
|
||||
}
|
||||
|
||||
public FilterPaeseLayoutView setAllPaesi(List<String> allPaesi) {
|
||||
this.allPaesi = allPaesi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getAvailablePaesi() {
|
||||
return availablePaesi;
|
||||
}
|
||||
|
||||
public FilterPaeseLayoutView setAvailablePaesi(List<String> availablePaesi) {
|
||||
this.availablePaesi = availablePaesi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPreSelectedPaesi() {
|
||||
return preSelectedPaesi;
|
||||
}
|
||||
|
||||
public FilterPaeseLayoutView setPreSelectedPaesi(List<String> preSelectedPaesi) {
|
||||
this.preSelectedPaesi = preSelectedPaesi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterPaeseLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
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,165 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.LayoutFilterTermConsBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterTermConsLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterTermConsBinding mBindings;
|
||||
|
||||
private List<String> allTermCons;
|
||||
private List<String> availableTermCons;
|
||||
private List<String> preSelectedTermCons = new ArrayList<>();
|
||||
private List<String> hiddenSelectedTermCons = 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_term_cons, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenSelectedTermCons = Stream.of(allTermCons)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_term_cons__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
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().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllTermCons())
|
||||
.filter(x -> !hiddenSelectedTermCons.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedTermCons.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableTermCons.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<String> getAllTermCons() {
|
||||
return allTermCons;
|
||||
}
|
||||
|
||||
public FilterTermConsLayoutView setAllTermCons(List<String> allTermCons) {
|
||||
this.allTermCons = allTermCons;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getAvailableTermCons() {
|
||||
return availableTermCons;
|
||||
}
|
||||
|
||||
public FilterTermConsLayoutView setAvailableTermCons(List<String> availableTermCons) {
|
||||
this.availableTermCons = availableTermCons;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPreSelectedTermCons() {
|
||||
return preSelectedTermCons;
|
||||
}
|
||||
|
||||
public FilterTermConsLayoutView setPreSelectedTermCons(List<String> preSelectedTermCons) {
|
||||
this.preSelectedTermCons = preSelectedTermCons;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterTermConsLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
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,166 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.LayoutFilterVettoreBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterVettoreLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterVettoreBinding mBindings;
|
||||
|
||||
private List<String> allVettori;
|
||||
private List<String> availableVettori;
|
||||
private List<String> preSelectedVettori = new ArrayList<>();
|
||||
private List<String> hiddenSelectedVettori = 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_vettore, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenSelectedVettori = Stream.of(allVettori)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_vettore__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
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().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllVettori())
|
||||
.filter(x -> !hiddenSelectedVettori.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedVettori.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableVettori.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<String> getAllVettori() {
|
||||
return allVettori;
|
||||
}
|
||||
|
||||
public FilterVettoreLayoutView setAllVettori(List<String> allVettori) {
|
||||
this.allVettori = allVettori;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getAvailableVettori() {
|
||||
return availableVettori;
|
||||
}
|
||||
|
||||
public FilterVettoreLayoutView setAvailableVettori(List<String> availableVettori) {
|
||||
this.availableVettori = availableVettori;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPreSelectedVettori() {
|
||||
return preSelectedVettori;
|
||||
}
|
||||
|
||||
public FilterVettoreLayoutView setPreSelectedVettori(List<String> preSelectedVettori) {
|
||||
this.preSelectedVettori = preSelectedVettori;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterVettoreLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
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,165 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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.LayoutFilterViaggioBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterViaggioLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterViaggioBinding mBindings;
|
||||
|
||||
private List<Integer> allIDViaggio;
|
||||
private List<Integer> availableIDViaggio;
|
||||
private List<Integer> preSelectedIDViaggio = new ArrayList<>();
|
||||
private List<Integer> hiddenIDViaggio = new ArrayList<>();
|
||||
private MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<Integer>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_viaggio, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenIDViaggio = Stream.of(allIDViaggio)
|
||||
.filter(x -> !x.toString().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_viaggio__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
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().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllIDViaggio())
|
||||
.filter(x -> !hiddenIDViaggio.contains(x))
|
||||
.map(x -> new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedIDViaggio.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableIDViaggio.contains(x)))
|
||||
.setOriginalModel(x))
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<Integer> getAllIDViaggio() {
|
||||
return allIDViaggio;
|
||||
}
|
||||
|
||||
public FilterViaggioLayoutView setAllIDViaggio(List<Integer> allIDViaggio) {
|
||||
this.allIDViaggio = allIDViaggio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<Integer> getAvailableIDViaggio() {
|
||||
return availableIDViaggio;
|
||||
}
|
||||
|
||||
public FilterViaggioLayoutView setAvailableIDViaggio(List<Integer> availableIDViaggio) {
|
||||
this.availableIDViaggio = availableIDViaggio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<Integer> getPreSelectedIDViaggio() {
|
||||
return preSelectedIDViaggio;
|
||||
}
|
||||
|
||||
public FilterViaggioLayoutView setPreSelectedIDViaggio(List<Integer> preSelectedIDViaggio) {
|
||||
this.preSelectedIDViaggio = preSelectedIDViaggio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<Integer>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterViaggioLayoutView setOnFilterApplied(RunnableArgs<List<Integer>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static class ListModel {
|
||||
private BindableBoolean selected = new BindableBoolean();
|
||||
private BindableBoolean enabled = new BindableBoolean();
|
||||
private Integer 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 Integer getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public ListModel setOriginalModel(Integer originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,708 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters;
|
||||
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.annimon.stream.function.Predicate;
|
||||
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoDTO;
|
||||
|
||||
public class VenditaFiltroOrdiniViewModel {
|
||||
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentDepositoPredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentIdViaggioPredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentNumOrdsPredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentClientePredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentDataConsPredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentTermConsPredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentVettorePredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentAgentePredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentAutomezzoPredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentPaesePredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentGruppoMercPredicate = new ObservableField<>();
|
||||
|
||||
private Date selectedDataCons = null;
|
||||
private List<MtbGrup> selectedMtbGrup = new ArrayList<>();
|
||||
|
||||
private List<OrdiniUscitaElencoDTO> initialOrderList;
|
||||
private final MutableLiveData<List<OrdiniUscitaElencoDTO>> currentFilteredOrderList = new MutableLiveData<>();
|
||||
|
||||
public void init(List<OrdiniUscitaElencoDTO> initialList) {
|
||||
this.initialOrderList = initialList;
|
||||
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<OrdiniUscitaElencoDTO>> getMutableFilteredOrderList() {
|
||||
return this.currentFilteredOrderList;
|
||||
}
|
||||
|
||||
public void setIDViaggioFilter(List<Integer> idViaggio) {
|
||||
if (idViaggio == null || idViaggio.isEmpty()) currentIdViaggioPredicate.set(null);
|
||||
else {
|
||||
currentIdViaggioPredicate.set(o -> idViaggio.contains(o.getIdViaggio()));
|
||||
}
|
||||
}
|
||||
|
||||
public void setDepositoFilter(List<MtbDepo> mtbDepoList) {
|
||||
if (mtbDepoList == null || mtbDepoList.isEmpty()) currentDepositoPredicate.set(null);
|
||||
else {
|
||||
List<String> codMdeps = Stream.of(mtbDepoList).map(MtbDepo::getCodMdep).toList();
|
||||
currentDepositoPredicate.set(o -> codMdeps.contains(o.getCodMdep()));
|
||||
}
|
||||
}
|
||||
|
||||
public void setNumOrdFilter(List<Integer> numOrds) {
|
||||
if (numOrds == null || numOrds.isEmpty()) currentNumOrdsPredicate.set(null);
|
||||
else {
|
||||
currentNumOrdsPredicate.set(o -> numOrds.contains(o.getNumOrd()));
|
||||
}
|
||||
}
|
||||
|
||||
public void setClienteFilter(List<String> clienti) {
|
||||
if (clienti == null || clienti.isEmpty()) currentClientePredicate.set(null);
|
||||
else {
|
||||
currentClientePredicate.set(o -> clienti.contains(o.getRagSocOrd()));
|
||||
}
|
||||
}
|
||||
|
||||
public void setTerminiConsegnaFilter(List<String> terminiConsegna) {
|
||||
if (terminiConsegna == null || terminiConsegna.isEmpty())
|
||||
currentTermConsPredicate.set(null);
|
||||
else {
|
||||
currentTermConsPredicate.set(o -> terminiConsegna.contains(o.getTermCons()));
|
||||
}
|
||||
}
|
||||
|
||||
public void setVettoreFilter(List<String> vettore) {
|
||||
if (vettore == null || vettore.isEmpty()) currentVettorePredicate.set(null);
|
||||
else {
|
||||
currentVettorePredicate.set(o -> vettore.contains(o.getCodVvet() + (!UtilityString.isNullOrEmpty(o.getCodVvet()) ? " - " + o.getDescrizioneVettore() : "")));
|
||||
}
|
||||
}
|
||||
|
||||
public void setAutomezzoFilter(List<String> automezzi) {
|
||||
if (automezzi == null || automezzi.isEmpty()) currentAutomezzoPredicate.set(null);
|
||||
else {
|
||||
currentAutomezzoPredicate.set(o -> automezzi.contains(o.getDescrizioneAuto()));
|
||||
}
|
||||
}
|
||||
|
||||
public void setDataConsegnaFilter(Date dataConsegna) {
|
||||
this.selectedDataCons = dataConsegna;
|
||||
|
||||
if (dataConsegna == null) currentDataConsPredicate.set(null);
|
||||
else {
|
||||
currentDataConsPredicate.set(o -> DateUtils.isSameDay(o.getDataConsD(), dataConsegna));
|
||||
}
|
||||
}
|
||||
|
||||
public void setAgenteFilter(List<String> agenti) {
|
||||
if (agenti == null || agenti.isEmpty()) currentAgentePredicate.set(null);
|
||||
else {
|
||||
currentAgentePredicate.set(o -> agenti.contains(o.getNomeAgente()));
|
||||
}
|
||||
}
|
||||
|
||||
public void setPaeseFilter(List<String> paesi) {
|
||||
if (paesi == null || paesi.isEmpty()) currentPaesePredicate.set(null);
|
||||
else {
|
||||
currentPaesePredicate.set(o -> paesi.contains(o.getCitta()));
|
||||
}
|
||||
}
|
||||
|
||||
public void setGruppoMercFilter(List<MtbGrup> mtbGrupList) {
|
||||
if (mtbGrupList == null || mtbGrupList.isEmpty()) {
|
||||
currentGruppoMercPredicate.set(null);
|
||||
this.selectedMtbGrup = new ArrayList<>();
|
||||
}
|
||||
else {
|
||||
this.selectedMtbGrup = mtbGrupList;
|
||||
var mtbGrups = Stream.of(mtbGrupList).map(MtbGrup::getCodMgrp).toList();
|
||||
currentGruppoMercPredicate.set(o -> Stream.of(o.getAvailableClassMerc())
|
||||
.anyMatch(x -> mtbGrups.contains(x.getCodMgrp())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Date getSelectedDataCons() {
|
||||
return selectedDataCons;
|
||||
}
|
||||
|
||||
public List<MtbGrup> getSelectedMtbGrup() {
|
||||
return selectedMtbGrup;
|
||||
}
|
||||
|
||||
public void applyAllTests() {
|
||||
|
||||
List<OrdiniUscitaElencoDTO> returnList = null;
|
||||
|
||||
if (currentNumOrdsPredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null &&
|
||||
currentIdViaggioPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
returnList = this.initialOrderList;
|
||||
} else {
|
||||
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
);
|
||||
|
||||
returnList = tmpStream.toList();
|
||||
}
|
||||
|
||||
this.currentFilteredOrderList.setValue(returnList);
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentDepositoPredicate() {
|
||||
return currentDepositoPredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentIdViaggioPredicate() {
|
||||
return currentIdViaggioPredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentNumOrdsPredicate() {
|
||||
return currentNumOrdsPredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentClientePredicate() {
|
||||
return currentClientePredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentDataConsPredicate() {
|
||||
return currentDataConsPredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentTermConsPredicate() {
|
||||
return currentTermConsPredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentVettorePredicate() {
|
||||
return currentVettorePredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentAgentePredicate() {
|
||||
return currentAgentePredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentAutomezzoPredicate() {
|
||||
return currentAutomezzoPredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentPaesePredicate() {
|
||||
return currentPaesePredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentGruppoMercPredicate() {
|
||||
return currentGruppoMercPredicate;
|
||||
}
|
||||
|
||||
public List<MtbDepo> getAllCodMdeps(List<MtbDepo> mtbDepoFullList) {
|
||||
List<String> codMdeps = Stream.of(initialOrderList)
|
||||
.map(OrdineInevasoDTO::getCodMdep)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
return Stream.of(Objects.requireNonNull(mtbDepoFullList))
|
||||
.filter(x -> codMdeps.contains(x.getCodMdep()))
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sortBy(MtbDepo::getCodMdep)
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<MtbDepo> getAvailableCodMdeps(List<MtbDepo> mtbDepoFullList) {
|
||||
|
||||
if (currentNumOrdsPredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentIdViaggioPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
return getAllCodMdeps(mtbDepoFullList);
|
||||
} else {
|
||||
List<String> availableCodMdeps = Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineInevasoDTO::getCodMdep)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
return Stream.of(Objects.requireNonNull(mtbDepoFullList))
|
||||
.filter(x -> availableCodMdeps.contains(x.getCodMdep()))
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sortBy(MtbDepo::getCodMdep)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<Integer> getAllIDViaggio() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> x.getIdViaggio() != null)
|
||||
.sortBy(x -> -x.getIdViaggio())
|
||||
.map(x -> x.getIdViaggio() != null ? x.getIdViaggio() : null)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<Integer> getAvailableIDViaggio() {
|
||||
|
||||
if (currentNumOrdsPredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
return getAllIDViaggio();
|
||||
} else {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineUscitaInevasoDTO::getIdViaggio)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<Integer> getAllNumOrds() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> x.getNumOrd() != null)
|
||||
.sortBy(x -> -x.getNumOrd())
|
||||
.map(x -> x.getNumOrd() != null ? x.getNumOrd() : null)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<Integer> getAvailableNumOrds() {
|
||||
|
||||
if (currentIdViaggioPredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
return getAllNumOrds();
|
||||
} else {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineUscitaInevasoDTO::getNumOrd)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<String> getAllClienti() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getRagSocOrd()))
|
||||
.sortBy(OrdineUscitaInevasoDTO::getRagSocOrd)
|
||||
.map(OrdineUscitaInevasoDTO::getRagSocOrd)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailableClienti() {
|
||||
|
||||
if (currentIdViaggioPredicate.get() == null &&
|
||||
currentNumOrdsPredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
return getAllClienti();
|
||||
} else {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineUscitaInevasoDTO::getRagSocOrd)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<String> getAllVettori() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getCodVvet()))
|
||||
.sortBy(OrdineUscitaInevasoDTO::getCodVvet)
|
||||
.map(x -> x.getCodVvet() + (!UtilityString.isNullOrEmpty(x.getCodVvet()) ? " - " + x.getDescrizioneVettore() : ""))
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailableVettori() {
|
||||
|
||||
if (currentIdViaggioPredicate.get() == null &&
|
||||
currentNumOrdsPredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
return getAllVettori();
|
||||
} else {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
)
|
||||
.map(x -> x.getCodVvet() + (!UtilityString.isNullOrEmpty(x.getCodVvet()) ? " - " + x.getDescrizioneVettore() : ""))
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<String> getAllAutomezzi() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getDescrizioneAuto()))
|
||||
.sortBy(OrdineUscitaInevasoDTO::getDescrizioneAuto)
|
||||
.map(OrdineUscitaInevasoDTO::getDescrizioneAuto)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailableAutomezzi() {
|
||||
|
||||
if (currentIdViaggioPredicate.get() == null &&
|
||||
currentNumOrdsPredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
return getAllAutomezzi();
|
||||
} else {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineUscitaInevasoDTO::getDescrizioneAuto)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<String> getAllPaesi() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getCitta()))
|
||||
.sortBy(OrdineUscitaInevasoDTO::getCitta)
|
||||
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailablePaesi() {
|
||||
|
||||
if (currentIdViaggioPredicate.get() == null &&
|
||||
currentNumOrdsPredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
List<String> all = getAllPaesi();
|
||||
return all;
|
||||
} else {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<String> getAllAgenti() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getNomeAgente()))
|
||||
.sortBy(OrdineUscitaInevasoDTO::getNomeAgente)
|
||||
.map(OrdineUscitaInevasoDTO::getNomeAgente)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailableAgenti() {
|
||||
|
||||
if (currentIdViaggioPredicate.get() == null &&
|
||||
currentNumOrdsPredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
List<String> all = getAllAgenti();
|
||||
return all;
|
||||
} else {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineUscitaInevasoDTO::getNomeAgente)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<String> getAllTermCons() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getTermCons()))
|
||||
.sortBy(OrdineUscitaInevasoDTO::getTermCons)
|
||||
.map(OrdineUscitaInevasoDTO::getTermCons)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailableTermCons() {
|
||||
|
||||
if (currentIdViaggioPredicate.get() == null &&
|
||||
currentNumOrdsPredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null
|
||||
) {
|
||||
return getAllTermCons();
|
||||
} else {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineUscitaInevasoDTO::getTermCons)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<MtbGrup> getAllGruppoMerc(List<MtbGrup> mtbGrupFullList) {
|
||||
var codMgrp = Stream.of(initialOrderList)
|
||||
.flatMap(ordiniUscitaElencoDTO -> Stream.of(ordiniUscitaElencoDTO.getAvailableClassMerc()))
|
||||
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
return Stream.of(Objects.requireNonNull(mtbGrupFullList))
|
||||
.filter(x -> codMgrp.contains(x.getCodMgrp()))
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sortBy(MtbGrup::getDescrizione)
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<MtbGrup> getAvailableGruppoMerc(List<MtbGrup> mtbGrupFullList) {
|
||||
|
||||
if (currentNumOrdsPredicate.get() == null &&
|
||||
currentClientePredicate.get() == null &&
|
||||
currentDataConsPredicate.get() == null &&
|
||||
currentTermConsPredicate.get() == null &&
|
||||
currentVettorePredicate.get() == null &&
|
||||
currentAutomezzoPredicate.get() == null &&
|
||||
currentIdViaggioPredicate.get() == null &&
|
||||
currentAgentePredicate.get() == null &&
|
||||
currentPaesePredicate.get() == null &&
|
||||
currentDepositoPredicate.get() == null
|
||||
) {
|
||||
return getAllGruppoMerc(mtbGrupFullList);
|
||||
} else {
|
||||
List<String> availableCodMgrups = Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x)))
|
||||
)
|
||||
.flatMap(x -> Stream.of(x.getAvailableClassMerc()))
|
||||
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
return Stream.of(Objects.requireNonNull(mtbGrupFullList))
|
||||
.filter(x -> availableCodMgrups.contains(x.getCodMgrp()))
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sortBy(MtbGrup::getDescrizione)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -19,7 +19,6 @@ import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLUException;
|
||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILUBaseOperationsListener;
|
||||
@@ -30,7 +29,6 @@ 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.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
@@ -209,26 +207,17 @@ public class PickingResiViewModel {
|
||||
if (!shouldPrint) {
|
||||
onComplete.run();
|
||||
} else {
|
||||
this.mPrinterRESTConsumer.getAvailablePrinters(mDefaultCodMdepOfLU, PrinterRESTConsumer.Type.PRIMARIA, printerList -> {
|
||||
if (printerList == null || printerList.size() == 0) {
|
||||
this.sendError(new NoPrintersFoundException());
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
singlePrint(mtbColtToPrint, printerList.get(0), onComplete, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
}, this::sendError);
|
||||
singlePrint(mtbColtToPrint, onComplete, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
PrinterRESTConsumer.Type.PRIMARIA,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
onComplete, onFailed);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
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.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
@@ -109,8 +108,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void dispatchItem(HistoryVersamentoProdULDTO item, MtbColt sourceMtbColt) {
|
||||
BigDecimal qtaDaEvadere = BigDecimal.ZERO;
|
||||
BigDecimal numCnfDaEvadere = BigDecimal.ZERO;
|
||||
@@ -214,8 +211,8 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
UtilityBigDecimal.divide(mtbColtScarico.getMtbColr().get(0).getQtaCol(), mtbColtScarico.getMtbColr().get(0).getNumCnf()));
|
||||
}
|
||||
|
||||
for(int i = 0; i < mtbColtScarico.getMtbColr().size(); i++) {
|
||||
if(mtbColtScarico.getMtbColr().get(i).getQtaCol().equals(BigDecimal.ZERO)) {
|
||||
for (int i = 0; i < mtbColtScarico.getMtbColr().size(); i++) {
|
||||
if (mtbColtScarico.getMtbColr().get(i).getQtaCol().equals(BigDecimal.ZERO)) {
|
||||
mtbColtScarico.getMtbColr().remove(i);
|
||||
i--;
|
||||
}
|
||||
@@ -288,39 +285,19 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
|
||||
private void printCollo(MtbColt mtbColtToPrint, Runnable onComplete) {
|
||||
|
||||
this.mPrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().getUserSession().getDepo().getCodMdep(), PrinterRESTConsumer.Type.PRIMARIA, printerList -> {
|
||||
|
||||
if (printerList.size() > 0) {
|
||||
try {
|
||||
singlePrint(mtbColtToPrint, printerList.get(0), () -> {
|
||||
onComplete.run();
|
||||
}, ex -> this.sendOnLUPrintError(ex, onComplete));
|
||||
|
||||
} catch (Exception ex) {
|
||||
this.sendError(ex);
|
||||
onComplete.run();
|
||||
}
|
||||
} else {
|
||||
this.sendOnNoLUFound(onComplete);
|
||||
}
|
||||
}, this::sendError);
|
||||
singlePrint(mtbColtToPrint, onComplete, ex -> this.sendOnLUPrintError(ex, onComplete));
|
||||
}
|
||||
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
PrinterRESTConsumer.Type.PRIMARIA,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onAbort);
|
||||
onComplete, onAbort);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public MutableLiveData<List<HistoryVersamentoProdULDTO>> getOrderList() {
|
||||
return mUlList;
|
||||
}
|
||||
@@ -359,7 +336,8 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
private void sendOnLURequest(boolean canLUBeCreated, boolean shouldCheckIfDocExist, RunnableArgss<MtbColt, Boolean> onComplete) {
|
||||
if(this.mListener != null) mListener.onLURequest(canLUBeCreated, shouldCheckIfDocExist, onComplete);
|
||||
if (this.mListener != null)
|
||||
mListener.onLURequest(canLUBeCreated, shouldCheckIfDocExist, onComplete);
|
||||
}
|
||||
|
||||
private void sendOnLUPrintError(Exception ex, Runnable onComplete) {
|
||||
@@ -375,7 +353,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
@@ -136,13 +136,13 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
||||
String text = "Stai per eliminare l'articolo <b> " + articoloOrdine.getDescrizione() + "</b> dall'ordine, <br> sei sicuro?";
|
||||
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(Html.fromHtml(text)), null, () -> this.runOnUiThread(() -> {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(this);
|
||||
this.openProgress();
|
||||
mhelper.removeArticoloFromOrdine(articoloOrdine, () -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
runOnUiThread(this::fetchArticoli);
|
||||
}, e -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
runOnUiThread(() -> UtilityExceptions.defaultException(this, e));
|
||||
});
|
||||
}), () -> {
|
||||
@@ -159,16 +159,16 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
||||
private void onScanSuccessful(BarcodeScanDTO dto) {
|
||||
mBinding.closeActivityFab.close(false);
|
||||
BarcodeManager.disable();
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(this);
|
||||
this.openProgress();
|
||||
mhelper.checkArticolo(
|
||||
mOrdine,
|
||||
dto.getStringValue(),
|
||||
articoloOrdine -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
addArticolo(articoloOrdine);
|
||||
},
|
||||
e -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
handleException(e);
|
||||
}
|
||||
);
|
||||
@@ -199,9 +199,9 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void fetchArticoli() {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(this);
|
||||
this.openProgress();
|
||||
mhelper.loadArticoli(mOrdine, articoli -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
mArticoli = articoli;
|
||||
runOnUiThread(() -> {
|
||||
mAdapter.updateItems(mArticoli);
|
||||
@@ -218,22 +218,22 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
public void exportOrdine() {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(this);
|
||||
this.openProgress();
|
||||
PVOrdiniAcquistoRESTConsumer.saveOrdine(mOrdine, mArticoli, mGriglia, (ordine) -> {
|
||||
|
||||
mOrdineRepository.updateOrder(ordine, ord -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
runOnUiThread(() -> {
|
||||
Toast.makeText(this, "Ordine salvato con successo", Toast.LENGTH_SHORT).show();
|
||||
onBackPressed();
|
||||
});
|
||||
}, e -> runOnUiThread(() -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(this, e);
|
||||
}));
|
||||
|
||||
}, e -> runOnUiThread(() -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(this, e);
|
||||
}));
|
||||
}
|
||||
@@ -247,16 +247,16 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
||||
public void manualSearch(){
|
||||
BarcodeManager.disable();
|
||||
DialogSimpleInputHelper.makeInputDialog(this,"Inserisci il codice a barre/codice articolo da cercare",codice->{
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(this);
|
||||
this.openProgress();
|
||||
mhelper.checkArticolo(
|
||||
mOrdine,
|
||||
codice,
|
||||
articoloOrdine -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
addArticolo(articoloOrdine);
|
||||
},
|
||||
e -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
handleException(e);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -36,6 +36,7 @@ public class EditArticoloDialog {
|
||||
private ArticoloOrdine mSavedArt;
|
||||
|
||||
private boolean mLockedInput = false;
|
||||
private Dialog mCurrentProgress;
|
||||
|
||||
|
||||
public static Dialog make(Activity context, PVEditOrderHelper helper, ArticoloOrdine articolo, RunnableArgs<ArticoloOrdine> onDialogDismiss) {
|
||||
@@ -128,7 +129,7 @@ public class EditArticoloDialog {
|
||||
}
|
||||
|
||||
public void saveAndExit() {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
this.openProgress();
|
||||
try {
|
||||
float qtaOrd = Float.parseFloat(mBinding.qtaTot.getText().toString());
|
||||
if (qtaOrd <= 0) {
|
||||
@@ -138,12 +139,12 @@ public class EditArticoloDialog {
|
||||
|
||||
} catch (Exception e) {
|
||||
mContext.runOnUiThread(() -> UtilityExceptions.defaultException(mContext, e));
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
return;
|
||||
}
|
||||
mHelper.saveArticoloToOrdine(mArticolo, () -> {
|
||||
mSavedArt = mArticolo;
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
mDialog.dismiss();
|
||||
}, e -> mContext.runOnUiThread(() -> UtilityExceptions.defaultException(mContext, e)));
|
||||
}
|
||||
@@ -157,4 +158,20 @@ public class EditArticoloDialog {
|
||||
mDialog.dismiss();
|
||||
}
|
||||
|
||||
protected void openProgress() {
|
||||
mContext.runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
mContext.runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
private OrdineAcquistoPvHelper mHelper;
|
||||
private Griglia mGriglia;
|
||||
private OrdineAcquistoPvOpenListAdapter mAdapter;
|
||||
private Dialog mCurrentProgress;
|
||||
private final List<OrdineWrapper> mRenderedOrderList = new ArrayList<>();
|
||||
private boolean mRedirectToNewOrder = true;
|
||||
|
||||
@@ -80,7 +81,6 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
.inject(this);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static PVOrdiniAcquistoGrigliaFragment newInstance() {
|
||||
@@ -134,13 +134,13 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
}
|
||||
|
||||
private void fetchOrders() {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(getActivity(), getString(R.string.ordini_a_aperti_progress));
|
||||
this.openProgress();
|
||||
|
||||
mOrdineRepository.selectAllOpenOrders(mGriglia, (ordini) -> getActivity().runOnUiThread(() -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
setOrdini(ordini);
|
||||
}), (e) -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
String errorMessage = e.getMessage();
|
||||
getActivity().runOnUiThread(() -> DialogSimpleMessageView
|
||||
.makeErrorDialog(new SpannableString(errorMessage), null, null)
|
||||
@@ -201,15 +201,15 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
String text = "Stai per eliminare un ordine sei sicuro?";
|
||||
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(Html.fromHtml(text)), null, () -> getActivity().runOnUiThread(() -> {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||
this.openProgress();
|
||||
mHelper.deleteOrder(ordine, () -> {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
Toast.makeText(getActivity(), "Ordine eliminato!", Toast.LENGTH_SHORT).show();
|
||||
fetchOrders();
|
||||
});
|
||||
}, e -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
getActivity().runOnUiThread(() -> UtilityExceptions.defaultException(getActivity(), e));
|
||||
});
|
||||
}), () -> {
|
||||
@@ -222,12 +222,15 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
}
|
||||
|
||||
public void createNewOrder() {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(getActivity(), getString(R.string.ordini_a_aperti_progress));
|
||||
this.openProgress();
|
||||
mHelper.createNewOrder(mGriglia, order -> {
|
||||
progress.dismiss();
|
||||
this.closeProgress();
|
||||
getActivity().runOnUiThread(() -> editOrdine(order));
|
||||
|
||||
}, e -> getActivity().runOnUiThread(() -> UtilityExceptions.defaultException(getActivity(), e, progress)));
|
||||
}, e -> getActivity().runOnUiThread(() -> {
|
||||
UtilityExceptions.defaultException(getActivity(), e);
|
||||
this.closeProgress();
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -256,4 +259,22 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||
this.mOnPreDestroyList.add(onPreDestroy);
|
||||
}
|
||||
|
||||
protected void openProgress() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public class DialogScanLisA {
|
||||
private Activity mContext;
|
||||
|
||||
private BaseDialog mDialog;
|
||||
private Dialog mCurrentProgress;
|
||||
|
||||
private DialogScanCodiceGrigliaBinding mBinding;
|
||||
|
||||
@@ -78,11 +79,11 @@ public class DialogScanLisA {
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
final Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
this.openProgress();
|
||||
Context context = mContext;
|
||||
RunnableArgs<Exception> mOnError = exception -> {
|
||||
mContext.runOnUiThread(() -> {
|
||||
progressDialog.dismiss();
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(context, exception);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
@@ -90,7 +91,7 @@ public class DialogScanLisA {
|
||||
|
||||
RunnableArgs<Griglia> onGrigliaAvailable = griglia -> {
|
||||
mContext.runOnUiThread(() -> {
|
||||
progressDialog.dismiss();
|
||||
this.closeProgress();
|
||||
mGriglia = griglia;
|
||||
mDialog.dismiss();
|
||||
});
|
||||
@@ -109,4 +110,20 @@ public class DialogScanLisA {
|
||||
|
||||
};
|
||||
|
||||
protected void openProgress() {
|
||||
mContext.runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
mContext.runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
@@ -26,7 +25,6 @@ import it.integry.integrywmsnative.core.model.MtbCols;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
@@ -35,8 +33,8 @@ import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.rest.RettificaGiacenzeRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.dto.FornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.rest.RettificaGiacenzeRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
@@ -88,10 +86,10 @@ public class RettificaGiacenzeViewModel {
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
this.sendOnLUOpenRequest((mtbColt, created) -> {
|
||||
this.mCurrentMtbColt = mtbColt;
|
||||
this.mIsCreatedLU = created;
|
||||
this.mCurrentMtbColt = mtbColt;
|
||||
this.mIsCreatedLU = created;
|
||||
|
||||
this.sendLUOpened(mtbColt);
|
||||
this.sendLUOpened(mtbColt);
|
||||
});
|
||||
}, this::sendError);
|
||||
}
|
||||
@@ -113,7 +111,7 @@ public class RettificaGiacenzeViewModel {
|
||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||
|
||||
} else if(UtilityBarcode.isEtichettaArt(barcodeScanDTO)){
|
||||
} else if (UtilityBarcode.isEtichettaArt(barcodeScanDTO)) {
|
||||
this.searchArtInt(barcodeScanDTO.getStringValue(), onComplete);
|
||||
|
||||
} else {
|
||||
@@ -153,7 +151,7 @@ public class RettificaGiacenzeViewModel {
|
||||
}
|
||||
|
||||
this.mArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
|
||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||
this.dispatchArt(mtbAartList.get(0), pickData);
|
||||
@@ -183,7 +181,7 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
dispatchArts(listaArts);
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
@@ -230,8 +228,8 @@ public class RettificaGiacenzeViewModel {
|
||||
if (mtbAart.isFlagQtaCnfFissaBoolean()) {
|
||||
qtaCnfDaPrelevare = mtbAart.getQtaCnf();
|
||||
|
||||
if(manualPickDTO.isEanPeso()) {
|
||||
if(mtbAart.getUntMisRifPeso() == MtbAart.UntMisRifPesoEnum.M) {
|
||||
if (manualPickDTO.isEanPeso()) {
|
||||
if (mtbAart.getUntMisRifPeso() == MtbAart.UntMisRifPesoEnum.M) {
|
||||
if (UtilityBigDecimal.equalsTo(mtbAart.getPesoKg(), BigDecimal.ZERO)) {
|
||||
this.sendError(new InvalidPesoKGException());
|
||||
} else {
|
||||
@@ -245,9 +243,10 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
|
||||
if (qtaColDaPrelevare != null && numCnfDaPrelevare == null) {
|
||||
if(!mtbAart.isFlagQtaCnfFissaBoolean()) {
|
||||
if (!mtbAart.isFlagQtaCnfFissaBoolean()) {
|
||||
numCnfDaPrelevare = UtilityBigDecimal.divideAndRoundToInteger(qtaColDaPrelevare, mtbAart.getQtaCnf());
|
||||
if(UtilityBigDecimal.equalsTo(numCnfDaPrelevare, BigDecimal.ZERO)) numCnfDaPrelevare = BigDecimal.ONE;
|
||||
if (UtilityBigDecimal.equalsTo(numCnfDaPrelevare, BigDecimal.ZERO))
|
||||
numCnfDaPrelevare = BigDecimal.ONE;
|
||||
qtaCnfDaPrelevare = UtilityBigDecimal.divide(qtaColDaPrelevare, numCnfDaPrelevare);
|
||||
} else {
|
||||
numCnfDaPrelevare = UtilityBigDecimal.divideToInteger(qtaColDaPrelevare, mtbAart.getQtaCnf());
|
||||
@@ -274,7 +273,7 @@ public class RettificaGiacenzeViewModel {
|
||||
initialQtaTot = UtilityBigDecimal.multiply(initialNumCnf, initialQtaCnf);
|
||||
}
|
||||
|
||||
if(dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||
if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||
dataScad = UtilityDate.getDateInstance();
|
||||
Calendar c = new GregorianCalendar();
|
||||
c.setTime(dataScad);
|
||||
@@ -323,35 +322,35 @@ public class RettificaGiacenzeViewModel {
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
// if (!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||
mtbColr
|
||||
.setQtaCol(BigDecimal.ZERO)
|
||||
.setNumCnf(BigDecimal.ZERO)
|
||||
.setDataCollo(mCurrentMtbColt.getDataColloS())
|
||||
.setNumCollo(mCurrentMtbColt.getNumCollo())
|
||||
.setGestione(mCurrentMtbColt.getGestione())
|
||||
.setSerCollo(mCurrentMtbColt.getSerCollo());
|
||||
mtbColr
|
||||
.setQtaCol(BigDecimal.ZERO)
|
||||
.setNumCnf(BigDecimal.ZERO)
|
||||
.setDataCollo(mCurrentMtbColt.getDataColloS())
|
||||
.setNumCollo(mCurrentMtbColt.getNumCollo())
|
||||
.setGestione(mCurrentMtbColt.getGestione())
|
||||
.setSerCollo(mCurrentMtbColt.getSerCollo());
|
||||
|
||||
|
||||
mColliMagazzinoRESTConsumer.creaRettificaCollo(mtbColr,
|
||||
numCnf,
|
||||
qtaTot,
|
||||
savedMtbColr -> {
|
||||
mtbColr
|
||||
.setQtaCol(savedMtbColr.getQtaCol())
|
||||
.setQtaCnf(savedMtbColr.getQtaCnf())
|
||||
.setNumCnf(savedMtbColr.getNumCnf())
|
||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
mColliMagazzinoRESTConsumer.creaRettificaCollo(mtbColr,
|
||||
numCnf,
|
||||
qtaTot,
|
||||
savedMtbColr -> {
|
||||
mtbColr
|
||||
.setQtaCol(savedMtbColr.getQtaCol())
|
||||
.setQtaCnf(savedMtbColr.getQtaCnf())
|
||||
.setNumCnf(savedMtbColr.getNumCnf())
|
||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
this.mAnyEditDone = true;
|
||||
this.mAnyEditDone = true;
|
||||
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (shouldCloseLU) closeLU(true, null);
|
||||
}, this::sendError);
|
||||
if (shouldCloseLU) closeLU(true, null);
|
||||
}, this::sendError);
|
||||
// } else {
|
||||
// mtbColr
|
||||
// .setQtaCol(qtaTot)
|
||||
@@ -394,7 +393,7 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
public void closeLU(boolean saveCausale, Runnable onComplete) {
|
||||
if (mCurrentMtbColt == null) {
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -414,7 +413,7 @@ public class RettificaGiacenzeViewModel {
|
||||
mCurrentMtbColt, () -> {
|
||||
this.sendLUPositionChangeRequest((shouldChangePosition, mtbDepoPosizione) -> {
|
||||
|
||||
if(shouldChangePosition) {
|
||||
if (shouldChangePosition) {
|
||||
this.savePosizione(mtbDepoPosizione, () -> {
|
||||
this.mAnyEditDone = false;
|
||||
postSaveBehaviour(onComplete);
|
||||
@@ -440,7 +439,6 @@ public class RettificaGiacenzeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void saveCausaleRettificaGiacenze(Runnable onComplete) {
|
||||
final MtbCols mtbCols = new MtbCols()
|
||||
.setCausale(this.mDefaultCausale);
|
||||
@@ -466,18 +464,18 @@ public class RettificaGiacenzeViewModel {
|
||||
}
|
||||
|
||||
private void postSaveBehaviour(Runnable onComplete) {
|
||||
if(!mCurrentMtbColt.getDisablePrint()) {
|
||||
if (!mCurrentMtbColt.getDisablePrint()) {
|
||||
printLU(() -> {
|
||||
this.mCurrentMtbColt = null;
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
});
|
||||
} else {
|
||||
this.mCurrentMtbColt = null;
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,26 +489,14 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
private void printLU(Runnable onComplete) {
|
||||
this.sendLUPrintRequest(shouldPrint -> {
|
||||
|
||||
if(!shouldPrint) {
|
||||
if (!shouldPrint) {
|
||||
onComplete.run();
|
||||
} else {
|
||||
this.mPrinterRESTConsumer.getAvailablePrinters(this.mCurrentCodMdep, printerList -> {
|
||||
|
||||
if (printerList == null || printerList.size() == 0) {
|
||||
this.sendError(new NoPrintersFoundException());
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mCurrentMtbColt.getGestioneEnum());
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(printerList.get(0), mCurrentMtbColt, 1, reportName, () -> {
|
||||
this.sendLUSuccessfullyPrinted();
|
||||
onComplete.run();
|
||||
}, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
|
||||
}, this::sendError);
|
||||
this.mPrinterRESTConsumer.printCollo(null, mCurrentMtbColt, () -> {
|
||||
this.sendLUSuccessfullyPrinted();
|
||||
onComplete.run();
|
||||
}, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -551,27 +537,27 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
// if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||
mtbColrToUpdate,
|
||||
numCnf,
|
||||
qtaTot,
|
||||
savedMtbColr -> {
|
||||
mtbColrToUpdate
|
||||
.setQtaCol(qtaTot)
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setNumCnf(numCnf)
|
||||
.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||
mtbColrToUpdate,
|
||||
numCnf,
|
||||
qtaTot,
|
||||
savedMtbColr -> {
|
||||
mtbColrToUpdate
|
||||
.setQtaCol(qtaTot)
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setNumCnf(numCnf)
|
||||
.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
|
||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||
this.mCurrentMtbColt.getMtbColr().add(mtbColrToUpdate);
|
||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||
this.mCurrentMtbColt.getMtbColr().add(mtbColrToUpdate);
|
||||
|
||||
this.mAnyEditDone = true;
|
||||
this.mAnyEditDone = true;
|
||||
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
},
|
||||
this::sendError
|
||||
);
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
},
|
||||
this::sendError
|
||||
);
|
||||
|
||||
// } else {
|
||||
//
|
||||
@@ -621,17 +607,17 @@ public class RettificaGiacenzeViewModel {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
// if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||
mtbColrToDelete,
|
||||
BigDecimal.ZERO,
|
||||
BigDecimal.ZERO,
|
||||
savedMtbColr -> {
|
||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendOnRowSaved();
|
||||
},
|
||||
this::sendError
|
||||
);
|
||||
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||
mtbColrToDelete,
|
||||
BigDecimal.ZERO,
|
||||
BigDecimal.ZERO,
|
||||
savedMtbColr -> {
|
||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendOnRowSaved();
|
||||
},
|
||||
this::sendError
|
||||
);
|
||||
// } else {
|
||||
// MtbColt mtbColt = new MtbColt()
|
||||
// .setNumCollo(mtbColrToDelete.getNumCollo())
|
||||
|
||||
@@ -195,16 +195,16 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
mEnableFakeGiacenza = !SettingsManager.iDB().isFlagSpedizioneEnableFakeGiacenza();
|
||||
mEnableFakeGiacenza = SettingsManager.iDB().isFlagSpedizioneEnableFakeGiacenza();
|
||||
boolean enableCheckPartitaMag = SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV();
|
||||
boolean canOverflowOrderQuantity = SettingsManager.iDB().isFlagCanAddExtraQuantitySpedizione();
|
||||
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
||||
boolean useQtaOrd = SettingsManager.iDB().isFlagSpedizioneUseQtaOrd();
|
||||
|
||||
if (mEnableFakeGiacenza) this.openProgress();
|
||||
if (!mEnableFakeGiacenza) this.openProgress();
|
||||
mViewmodel.init(
|
||||
codMdep,
|
||||
mEnableFakeGiacenza,
|
||||
!mEnableFakeGiacenza,
|
||||
enableCheckPartitaMag,
|
||||
shouldAskPesoLU,
|
||||
canOverflowOrderQuantity,
|
||||
@@ -311,7 +311,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
boolean anyLUPresent = x.getMtbColts() != null && x.getMtbColts().size() > 0;
|
||||
|
||||
spedizioneListModel.setActive(!mEnableFakeGiacenza || anyLUPresent);
|
||||
spedizioneListModel.setActive(mEnableFakeGiacenza || anyLUPresent);
|
||||
|
||||
|
||||
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
||||
@@ -326,7 +326,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
spedizioneListModel.setBadge2(x.getSitArtOrdDTO().getCodJcom());
|
||||
|
||||
if (!anyLUPresent) {
|
||||
spedizioneListModel.setGroupTitle(mEnableFakeGiacenza ? getString(R.string.picking_not_available) : "");
|
||||
spedizioneListModel.setGroupTitle(!mEnableFakeGiacenza ? getString(R.string.picking_not_available) : "");
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
spedizioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
@@ -472,7 +472,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
boolean anyLUPresent = x.getMtbColts() != null && x.getMtbColts().size() > 0;
|
||||
|
||||
spedizioneListModel.setActive(!mEnableFakeGiacenza || anyLUPresent);
|
||||
spedizioneListModel.setActive(mEnableFakeGiacenza || anyLUPresent);
|
||||
|
||||
|
||||
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
||||
@@ -775,7 +775,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||
UtilityExceptions.defaultException(this, ex);
|
||||
}
|
||||
|
||||
BarcodeManager.enable();
|
||||
|
||||
@@ -45,7 +45,6 @@ import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
@@ -937,8 +936,8 @@ public class SpedizioneViewModel {
|
||||
if (UtilityBigDecimal.lowerThan(qtaColDaPrelevare, BigDecimal.ZERO))
|
||||
qtaColDaPrelevare = BigDecimal.ZERO;
|
||||
|
||||
partitaMag = scannedMtbColr.getPartitaMag();
|
||||
dataScad = scannedMtbColr.getDataScadPartitaD();
|
||||
partitaMag = mtbColrToUse.getPartitaMag();
|
||||
dataScad = mtbColrToUse.getDataScadPartitaD();
|
||||
|
||||
} else if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
||||
//Oppure le info del barcode scansionato
|
||||
@@ -1722,42 +1721,29 @@ public class SpedizioneViewModel {
|
||||
if (!shouldPrint) {
|
||||
onComplete.run();
|
||||
} else {
|
||||
|
||||
this.mPrinterRESTConsumer.getAvailablePrinters(mDefaultCodMdep, PrinterRESTConsumer.Type.PRIMARIA, printerList -> {
|
||||
|
||||
if (printerList == null || printerList.size() == 0) {
|
||||
this.sendError(new NoPrintersFoundException());
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
cyclicPrint(mtbColtsToPrint.iterator(), printerList.get(0), onComplete, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
|
||||
}, this::sendError);
|
||||
cyclicPrint(PrinterRESTConsumer.Type.PRIMARIA, mtbColtsToPrint.iterator(), onComplete, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void cyclicPrint(@NotNull Iterator<MtbColt> sourceMtbColts, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
private void cyclicPrint(PrinterRESTConsumer.Type printerType, @NotNull Iterator<MtbColt> sourceMtbColts, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
if (sourceMtbColts.hasNext()) {
|
||||
singlePrint(sourceMtbColts.next(), printerName, () -> {
|
||||
cyclicPrint(sourceMtbColts, printerName, onComplete, onAbort);
|
||||
singlePrint(printerType, sourceMtbColts.next(), () -> {
|
||||
cyclicPrint(printerType, sourceMtbColts, onComplete, onAbort);
|
||||
}, onAbort);
|
||||
} else {
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||
|
||||
private void singlePrint(PrinterRESTConsumer.Type printerType, MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
printerType,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
onComplete,
|
||||
onFailed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package it.integry.integrywmsnative.ui.filter_chips;
|
||||
|
||||
public class FilterChipDTO {
|
||||
|
||||
private int ID;
|
||||
private String filterChipText;
|
||||
private FilterLayoutView filterLayoutView;
|
||||
|
||||
public int getID() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
public FilterChipDTO setID(int ID) {
|
||||
this.ID = ID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFilterChipText() {
|
||||
return filterChipText;
|
||||
}
|
||||
|
||||
public FilterChipDTO setFilterChipText(String filterChipText) {
|
||||
this.filterChipText = filterChipText;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FilterLayoutView getFilterLayoutView() {
|
||||
return filterLayoutView;
|
||||
}
|
||||
|
||||
public FilterChipDTO setFilterLayoutView(FilterLayoutView filterLayoutView) {
|
||||
this.filterLayoutView = filterLayoutView;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package it.integry.integrywmsnative.ui.filter_chips;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.chip.Chip;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class FilterChipView extends Chip {
|
||||
|
||||
public BindableString primaryText = new BindableString();
|
||||
|
||||
private final Context mContext;
|
||||
private Runnable onResetClicked;
|
||||
|
||||
private final ColorStateList defaultChipBackgroundColor;
|
||||
private final ColorStateList defaultChipTextColor;
|
||||
|
||||
public FilterChipView(Context context, String text, RunnableArgs<FilterChipView> onClicked) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
super.setText(text);
|
||||
|
||||
this.defaultChipBackgroundColor = getChipBackgroundColor();
|
||||
this.defaultChipTextColor = getTextColors();
|
||||
|
||||
setShapeAppearanceModel(
|
||||
getShapeAppearanceModel()
|
||||
.withCornerSize(4)
|
||||
.toBuilder()
|
||||
.build());
|
||||
|
||||
setChipMinHeight(getChipMinHeight() * 1.25f);
|
||||
|
||||
setOnCloseIconClickListener(v -> {
|
||||
if (onResetClicked != null) onResetClicked.run();
|
||||
});
|
||||
setOnClickListener(v -> onClicked.run(this));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void enableCloseIcon() {
|
||||
setCloseIconVisible(true);
|
||||
setTextColor(ContextCompat.getColor(this.mContext, android.R.color.white));
|
||||
setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(this.mContext, R.color.colorPrimary)));
|
||||
setCloseIconTint(ColorStateList.valueOf(ContextCompat.getColor(this.mContext, android.R.color.white)));
|
||||
}
|
||||
|
||||
public void disableCloseIcon() {
|
||||
setCloseIconVisible(false);
|
||||
setTextColor(defaultChipTextColor);
|
||||
setChipBackgroundColor(defaultChipBackgroundColor);
|
||||
// setCloseIconTint(ColorStateList.valueOf(ContextCompat.getColor(this.mContext, R.color.colorPrimary)));
|
||||
}
|
||||
|
||||
|
||||
public Runnable getOnResetClicked() {
|
||||
return onResetClicked;
|
||||
}
|
||||
|
||||
public FilterChipView setOnResetClicked(Runnable onResetClicked) {
|
||||
this.onResetClicked = onResetClicked;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package it.integry.integrywmsnative.ui.filter_chips;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public abstract class FilterLayoutView extends BottomSheetDialogFragment {
|
||||
|
||||
protected Context mContext;
|
||||
private final BindableString filterName = new BindableString();
|
||||
private final BindableBoolean enabledSearch = new BindableBoolean();
|
||||
|
||||
private SearchView mSearchView;
|
||||
private RunnableArgs<String> mOnFilterChanged;
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
if (mSearchView != null) this.initSearchView();
|
||||
}
|
||||
|
||||
protected void initSearchView() {
|
||||
|
||||
mSearchView.setOnSearchClickListener(v -> {
|
||||
this.setEnabledSearch(true);
|
||||
mSearchView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT));
|
||||
});
|
||||
|
||||
mSearchView.setOnCloseListener(() -> {
|
||||
setEnabledSearch(false);
|
||||
var layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_END);
|
||||
|
||||
mSearchView.setLayoutParams(layoutParams);
|
||||
return false;
|
||||
});
|
||||
|
||||
this.mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
if (mOnFilterChanged != null) mOnFilterChanged.run(newText);
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// mSearchView.setQuery("", true);
|
||||
// mSearchView.setIconified(true);
|
||||
// mSearchView.clearFocus();
|
||||
//
|
||||
// mSearchView.getRootView().invalidate();
|
||||
}
|
||||
|
||||
|
||||
public Context getContext() {
|
||||
return mContext;
|
||||
}
|
||||
|
||||
public FilterLayoutView setContext(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BindableString getFilterName() {
|
||||
return filterName;
|
||||
}
|
||||
|
||||
public FilterLayoutView setFilterName(String filterName) {
|
||||
this.filterName.set(filterName);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BindableBoolean getEnabledSearch() {
|
||||
return enabledSearch;
|
||||
}
|
||||
|
||||
public FilterLayoutView setEnabledSearch(boolean enabledSearch) {
|
||||
this.enabledSearch.set(enabledSearch);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FilterLayoutView setSearchView(SearchView searchView, RunnableArgs<String> onFilterChanged) {
|
||||
this.mSearchView = searchView;
|
||||
this.mOnFilterChanged = onFilterChanged;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
5
app/src/main/res/drawable/material_text_color.xml
Normal file
5
app/src/main/res/drawable/material_text_color.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:color="@android:color/darker_gray"/>
|
||||
<item android:color="@android:color/black"/>
|
||||
</selector>
|
||||
@@ -521,7 +521,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/tot_qty"
|
||||
android:inputType="numberDecimal"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.currentQtaTot}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@@ -515,7 +515,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/tot_qty"
|
||||
android:inputType="numberDecimal"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.currentQtaTot}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@@ -28,11 +28,78 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/filter_chips"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
android:background="@color/gray_050">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/filter_chips_group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
app:chipSpacing="8dp"
|
||||
app:singleSelection="true">
|
||||
|
||||
<!-- <com.google.android.material.chip.Chip-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:chipBackgroundColor="@color/colorPrimary"-->
|
||||
<!-- android:textColor="@android:color/white"-->
|
||||
<!-- app:closeIconEnabled="true"-->
|
||||
<!-- app:closeIconTint="@android:color/white"-->
|
||||
<!-- app:chipCornerRadius="4dp"-->
|
||||
<!-- android:text="Deposito" />-->
|
||||
|
||||
<!-- <com.google.android.material.chip.Chip-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:chipCornerRadius="4dp"-->
|
||||
<!-- android:text="Numero" />-->
|
||||
|
||||
<!-- <com.google.android.material.chip.Chip-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:chipCornerRadius="4dp"-->
|
||||
<!-- android:text="Viaggio" />-->
|
||||
|
||||
<!-- <com.google.android.material.chip.Chip-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:chipCornerRadius="4dp"-->
|
||||
<!-- android:text="Cliente" />-->
|
||||
|
||||
<!-- <com.google.android.material.chip.Chip-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:chipCornerRadius="4dp"-->
|
||||
<!-- android:text="Vettore" />-->
|
||||
|
||||
<!-- <com.google.android.material.chip.Chip-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:chipCornerRadius="4dp"-->
|
||||
<!-- android:text="Automezzo" />-->
|
||||
|
||||
<!-- <com.google.android.material.chip.Chip-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:chipCornerRadius="4dp"-->
|
||||
<!-- android:text="Paese" />-->
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
</HorizontalScrollView>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/vendita_main_list"
|
||||
android:scrollbars="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/filter_chips"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ordini_vendita_empty_view"
|
||||
@@ -64,25 +131,25 @@
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_playlist_add_check_24dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/no_orders_found_message"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp"
|
||||
android:text="@string/no_orders_found_message"/>
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<layout>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/mainOrange"
|
||||
@@ -34,12 +34,12 @@
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
tools:text="NOME GRUPPO"/>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
|
||||
114
app/src/main/res/layout/layout_filter_agente.xml
Normal file
114
app/src/main/res/layout/layout_filter_agente.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAgenteLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona l'agente che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="270dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
57
app/src/main/res/layout/layout_filter_agente__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_agente__list_item.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAgenteLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
114
app/src/main/res/layout/layout_filter_automezzo.xml
Normal file
114
app/src/main/res/layout/layout_filter_automezzo.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutomezzoLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona l'automezzo che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutomezzoLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
115
app/src/main/res/layout/layout_filter_cliente.xml
Normal file
115
app/src/main/res/layout/layout_filter_cliente.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il cliente che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
57
app/src/main/res/layout/layout_filter_cliente__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_cliente__list_item.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
114
app/src/main/res/layout/layout_filter_deposito.xml
Normal file
114
app/src/main/res/layout/layout_filter_deposito.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il deposito che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview_depositi"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel.codMdep}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" - "
|
||||
android:enabled="@{item.enabled}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(item.originalModel.descrizione) ? View.GONE : View.VISIBLE}"
|
||||
tools:text=" - "
|
||||
android:clickable="false" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel.descrizione}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(item.originalModel.descrizione) ? View.GONE : View.VISIBLE}"
|
||||
tools:text="Descrizione deposito"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
115
app/src/main/res/layout/layout_filter_gruppo_merc.xml
Normal file
115
app/src/main/res/layout/layout_filter_gruppo_merc.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il gruppo merceologico che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel.codMgrp}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" - "
|
||||
android:enabled="@{item.enabled}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(item.originalModel.descrizione) ? View.GONE : View.VISIBLE}"
|
||||
tools:text=" - "
|
||||
android:clickable="false" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel.descrizione}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(item.originalModel.descrizione) ? View.GONE : View.VISIBLE}"
|
||||
tools:text="Descrizione deposito"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
113
app/src/main/res/layout/layout_filter_numero_ordine.xml
Normal file
113
app/src/main/res/layout/layout_filter_numero_ordine.xml
Normal file
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il numero d'ordine che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</layout>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel.toString()}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
114
app/src/main/res/layout/layout_filter_paese.xml
Normal file
114
app/src/main/res/layout/layout_filter_paese.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona l'automezzo che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
57
app/src/main/res/layout/layout_filter_paese__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_paese__list_item.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
115
app/src/main/res/layout/layout_filter_term_cons.xml
Normal file
115
app/src/main/res/layout/layout_filter_term_cons.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona i termini di consegna che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
115
app/src/main/res/layout/layout_filter_vettore.xml
Normal file
115
app/src/main/res/layout/layout_filter_vettore.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il vettore che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
57
app/src/main/res/layout/layout_filter_vettore__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_vettore__list_item.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
115
app/src/main/res/layout/layout_filter_viaggio.xml
Normal file
115
app/src/main/res/layout/layout_filter_viaggio.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterViaggioLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il viaggio che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
57
app/src/main/res/layout/layout_filter_viaggio__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_viaggio__list_item.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterViaggioLayoutView.ListModel" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="@{item.enabled}"
|
||||
app:checked="@{item.selected}"
|
||||
android:clickable="false"/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="false">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{item.enabled}"
|
||||
android:text="@{item.originalModel.toString()}"
|
||||
tools:text="01"
|
||||
android:clickable="false" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
25
app/src/main/res/layout/single_filter_chip_view.xml
Normal file
25
app/src/main/res/layout/single_filter_chip_view.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipView" />
|
||||
</data>
|
||||
|
||||
<com.google.android.material.chip.Chip xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/chip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{view.primaryText}"
|
||||
android:textColor="@android:color/white"
|
||||
app:chipBackgroundColor="@color/colorPrimary"
|
||||
app:chipCornerRadius="4dp"
|
||||
app:closeIconEnabled="true"
|
||||
app:closeIconTint="@android:color/white"
|
||||
tools:text="Primary text" />
|
||||
|
||||
</layout>
|
||||
@@ -63,6 +63,7 @@
|
||||
<color name="green_900">#1b5e20</color>
|
||||
|
||||
|
||||
<color name="gray_050">#FAFAFA</color>
|
||||
<color name="gray_100">#F5F5F5</color>
|
||||
<color name="gray_200">#eeeeee</color>
|
||||
<color name="gray_300">#e0e0e0</color>
|
||||
|
||||
@@ -10,6 +10,13 @@
|
||||
|
||||
<item name="fontFamily">@font/google_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||
|
||||
<!-- Add these -->
|
||||
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
|
||||
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
|
||||
<item name="materialCalendarTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar</item>
|
||||
|
||||
<item name="bottomSheetDialogTheme">@style/CustomBottomSheetDialog</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
@@ -24,19 +31,19 @@
|
||||
<item name="android:textStyle">normal</item>
|
||||
</style>
|
||||
<style name="AppTheme.NewMaterial.Text.ExtraSmall" parent = "AppTheme.NewMaterial.Text">
|
||||
<item name="android:textColor">@color/gray_600</item>
|
||||
<item name="android:textColor">@drawable/material_text_color</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
<style name="AppTheme.NewMaterial.Text.Small" parent = "AppTheme.NewMaterial.Text">
|
||||
<item name="android:textColor">@color/gray_600</item>
|
||||
<item name="android:textColor">@drawable/material_text_color</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
<style name="AppTheme.NewMaterial.Text.Medium" parent = "AppTheme.NewMaterial.Text">
|
||||
<item name="android:textColor">@color/gray_600</item>
|
||||
<item name="android:textColor">@drawable/material_text_color</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
</style>
|
||||
<style name="AppTheme.NewMaterial.Text.Large" parent = "AppTheme.NewMaterial.Text">
|
||||
<item name="android:textColor">@color/gray_600</item>
|
||||
<item name="android:textColor">@drawable/material_text_color</item>
|
||||
<item name="android:textSize">22sp</item>
|
||||
</style>
|
||||
<style name="AppTheme.NewMaterial.Text.Badge" parent = "AppTheme.NewMaterial">
|
||||
@@ -125,6 +132,12 @@
|
||||
<item name="android:statusBarColor">@android:color/white</item>
|
||||
|
||||
<item name="fontFamily">@font/google_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||
|
||||
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
|
||||
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
|
||||
<item name="materialCalendarTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar</item>
|
||||
|
||||
<item name="bottomSheetDialogTheme">@style/CustomBottomSheetDialog</item>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -193,7 +206,21 @@
|
||||
<item name="titleTextAppearance">@style/AppTheme.NewMaterial.Text.ToolbarTitle</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomBottomSheetDialog" parent="@style/ThemeOverlay.MaterialComponents.BottomSheetDialog">
|
||||
<item name="bottomSheetStyle">@style/CustomBottomSheet</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomBottomSheet" parent="Widget.MaterialComponents.BottomSheet">
|
||||
<item name="shapeAppearanceOverlay">@style/CustomShapeAppearanceBottomSheetDialog</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomShapeAppearanceBottomSheetDialog" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSizeTopRight">16dp</item>
|
||||
<item name="cornerSizeTopLeft">16dp</item>
|
||||
<item name="cornerSizeBottomRight">0dp</item>
|
||||
<item name="cornerSizeBottomLeft">0dp</item>
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.0.2'
|
||||
classpath 'com.android.tools.build:gradle:7.0.3'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.3.5'
|
||||
classpath 'com.google.firebase:perf-plugin:1.3.5'
|
||||
|
||||
Reference in New Issue
Block a user