Finish v_1_4_0(58)

This commit is contained in:
Giuseppe Scorrano 2019-06-06 10:44:12 +02:00
commit 5fee31f594
10 changed files with 535 additions and 141 deletions

Binary file not shown.

View File

@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
android {
def appVersionCode = 57
def appVersionName = '1.3.1'
def appVersionCode = 58
def appVersionName = '1.4.0'
signingConfigs {
release {

View File

@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.di;
import androidx.annotation.ColorRes;
import androidx.annotation.IdRes;
import androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView;
import androidx.core.content.res.ResourcesCompat;
import androidx.databinding.BindingAdapter;
import androidx.databinding.BindingConversion;
@ -14,6 +15,7 @@ import androidx.appcompat.widget.AppCompatTextView;
import android.content.res.ColorStateList;
import android.util.Log;
import android.view.View;
import android.widget.AutoCompleteTextView;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
@ -82,6 +84,48 @@ public class Converters {
}
}
@BindingAdapter("app:binding")
public static void bindAutoCompleteTextView(AutoCompleteTextView view, final BindableString bindableString) {
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
if (pair == null || pair.first != bindableString) {
if (pair != null) {
view.removeTextChangedListener(pair.second);
}
TextWatcherAdapter watcher = new TextWatcherAdapter() {
@Override public void onTextChanged(CharSequence s, int start, int before, int count) {
bindableString.set(s.toString());
}
};
view.setTag(R.id.bound_observable, new Pair<>(bindableString, watcher));
view.addTextChangedListener(watcher);
}
String newValue = bindableString.get();
if (!view.getText().toString().equals(newValue)) {
view.setText(newValue);
}
}
@BindingAdapter("app:binding")
public static void bindAutoCompleteTextView(AppCompatMultiAutoCompleteTextView view, final BindableString bindableString) {
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
if (pair == null || pair.first != bindableString) {
if (pair != null) {
view.removeTextChangedListener(pair.second);
}
TextWatcherAdapter watcher = new TextWatcherAdapter() {
@Override public void onTextChanged(CharSequence s, int start, int before, int count) {
bindableString.set(s.toString());
}
};
view.setTag(R.id.bound_observable, new Pair<>(bindableString, watcher));
view.addTextChangedListener(watcher);
}
String newValue = bindableString.get();
if (!view.getText().toString().equals(newValue)) {
view.setText(newValue);
}
}
@BindingAdapter("app:binding")
public static void bindTextView(AppCompatTextView view, final BindableString bindableString) {
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);

View File

@ -25,21 +25,26 @@ import androidx.databinding.ObservableList;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.REST.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.REST.consumers.BarcodeRESTConsumer;
import it.integry.integrywmsnative.core.REST.consumers.ColliMagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
import it.integry.integrywmsnative.core.di.BindableBoolean;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
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.model.VtbDest;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.integrywmsnative.core.utility.UtilityNumber;
import it.integry.integrywmsnative.core.utility.UtilityProgress;
import it.integry.integrywmsnative.core.utility.UtilityString;
@ -51,6 +56,7 @@ import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskCliente;
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArts;
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
import it.integry.integrywmsnative.view.dialogs.input_quantity.QuantityDTO;
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
@ -243,8 +249,9 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
//Cerco tramite etichetta ean 128 (che può indicarmi una UL)
this.executeEtichettaEan128(data, progressDialog);
} else {
progressDialog.dismiss();
BarcodeManager.enable();
this.loadArticolo(data.getStringValue(), null, progressDialog);
// progressDialog.dismiss();
// BarcodeManager.enable();
}
}
@ -312,6 +319,114 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
}
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, ProgressDialog progressDialog) {
if(barcodeProd.length() == 14) {
// barcodeProd = UtilityBarcode.convertITF14toNeutral(barcodeProd);
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
}
ArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
if(mtbAartList != null && mtbAartList.size() > 0) {
this.dispatchArt(mtbAartList.get(0), ean128Model);
} else {
BarcodeManager.enable();
progressDialog.dismiss();
DialogSimpleMessageHelper.makeWarningDialog(mContext,
new SpannableString(mContext.getResources().getText(R.string.no_result_from_barcode)),
null, null)
.show();
}
}, ex -> {
BarcodeManager.enable();
UtilityExceptions.defaultException(mContext, ex, progressDialog);
});
}
private void dispatchArt(MtbAart mtbAart, Ean128Model ean128Model){
DialogInputQuantity.DTO qtaDto = new DialogInputQuantity.DTO();
qtaDto.setMtbAart(mtbAart);
qtaDto.setQtaCnf(mtbAart.getQtaCnf());
qtaDto.setNumCnf(1);
qtaDto.setQtaTot(mtbAart.getQtaCnf());
qtaDto.setQtaDaEvadere(new BigDecimal(-1));
qtaDto.setQtaDisponibile(new BigDecimal(-1));
qtaDto.setCanPartitaMagBeChanged(true);
qtaDto.setCanDataScadBeChanged(true);
if(ean128Model != null){
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
qtaDto.setBatchLot(ean128Model.BatchLot);
qtaDto.setCanPartitaMagBeChanged(false);
}
try {
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
qtaDto.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
qtaDto.setCanDataScadBeChanged(false);
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
qtaDto.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
qtaDto.setCanDataScadBeChanged(false);
}
} catch (Exception e) {
UtilityLogger.errorMe(e);
}
if(ean128Model.Count != null && ean128Model.Count > 0) {
qtaDto.setNumCnf(ean128Model.Count);
}
if (ean128Model.NetWeightKg != null && ean128Model.NetWeightKg > 0) {
qtaDto.setQtaTot(new BigDecimal(ean128Model.NetWeightKg));
} else {
qtaDto.setQtaTot(qtaDto.getQtaCnf().multiply(new BigDecimal(qtaDto.getNumCnf())));
}
qtaDto.setShouldAskDataScad(true);
}
DialogInputQuantity.makeBase(mContext, qtaDto, true, (quantityDTO) -> {
onPostDispatch(mtbAart, quantityDTO);
}, null).show();
}
private void onPostDispatch(MtbAart mtbAart, QuantityDTO quantityDTO) {
final MtbColr mtbColr = new MtbColr()
.setCodMart(mtbAart.getCodMart())
.setPartitaMag(quantityDTO.batchLot.get())
.setDataScadPartita(quantityDTO.expireDate)
.setQtaCol(quantityDTO.qtaTot.getBigDecimal())
.setDescrizione(mtbAart.getDescrizioneEstesa());
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
MtbColt cloneMtbColt = (MtbColt) mtbColt.get().clone();
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
cloneMtbColt.setMtbColr(new ObservableArrayList());
cloneMtbColt.getMtbColr().add(mtbColr);
saveLU(cloneMtbColt);
}
private void pickMerceULtoUL(MtbColt sourceMtbColt, MtbColt destMtbColt, ProgressDialog progressDialog) {
List<MtbColr> mtbColrsToPick = Stream.of(sourceMtbColt.getMtbColr())

View File

@ -10,6 +10,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.MultiAutoCompleteTextView;
import com.annimon.stream.Stream;
import com.annimon.stream.function.Predicate;
@ -40,6 +41,13 @@ public class DialogVenditaFiltroAvanzato {
private List<OrdineVenditaInevasoDTO> currentOrderList;
private List<OrdineVenditaInevasoDTO> currentFilteredOrderList;
private ArrayAdapter<String> arrayAdapterCodMdep;
private ArrayAdapter<String> arrayAdapterNumOrds;
private ArrayAdapter<String> arrayAdapterCliente;
private ArrayAdapter<String> arrayAdapterTermCons;
private ArrayAdapter<String> arrayAdapterVettore;
private ArrayAdapter<String> arrayAdapterAutomezzo;
private Predicate<OrdineVenditaInevasoDTO> currentDepositoPredicate = null;
private Predicate<OrdineVenditaInevasoDTO> currentNumOrdsPredicate = null;
private Predicate<OrdineVenditaInevasoDTO> currentClientePredicate = null;
@ -79,7 +87,8 @@ public class DialogVenditaFiltroAvanzato {
.setNeutralButton(context.getText(R.string.reset), null);
contentView.setViewmodel(viewModel);
initViewModel(viewModel, contentView);
// initViewModel(viewModel, contentView);
initViewModelNew(viewModel, contentView);
initView(contentView, viewModel);
currentAlert = alertDialog.create();
@ -137,69 +146,177 @@ public class DialogVenditaFiltroAvanzato {
datePickerDialog.show();
});
bindings.inputCodMdep.setVisibility(filtroOrdiniVendita.shoudShowCodMdepFilter() ? View.VISIBLE : View.GONE);
bindings.inputCodMdep.setOnClickListener(view -> {
AlertDialog.Builder builderSingle = new AlertDialog.Builder(currentContext);
builderSingle.setTitle(R.string.deposit);
arrayAdapterCodMdep = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
arrayAdapterCodMdep.addAll(getAvailableCodMdeps(false));
bindings.inputCodMdepNew.setVisibility(filtroOrdiniVendita.shoudShowCodMdepFilter() ? View.VISIBLE : View.GONE);
bindings.filledExposedDropdownCodMdep.setAdapter(arrayAdapterCodMdep);
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter(currentContext, android.R.layout.select_dialog_singlechoice);
arrayAdapter.addAll(getAvailableCodMdeps());
arrayAdapterNumOrds = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
arrayAdapterNumOrds.addAll(getAvailableNumOrds(false));
bindings.filledExposedDropdownNumOrds.setAdapter(arrayAdapterNumOrds);
bindings.filledExposedDropdownNumOrds.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
builderSingle.setAdapter(arrayAdapter, (dialogInterface, i) -> {
viewModel.deposito.set(arrayAdapter.getItem(i));
});
builderSingle.show();
arrayAdapterCliente = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
arrayAdapterCliente.addAll(getAvailableCliente(false));
bindings.filledExposedDropdownCliente.setAdapter(arrayAdapterCliente);
arrayAdapterTermCons = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
arrayAdapterTermCons.addAll(getAvailableTermCons(false));
bindings.filledExposedDropdownTermCons.setAdapter(arrayAdapterTermCons);
arrayAdapterVettore = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
arrayAdapterVettore.addAll(getAvailableVettori(false));
bindings.filledExposedDropdownVettore.setAdapter(arrayAdapterVettore);
arrayAdapterAutomezzo = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(false));
bindings.filledExposedDropdownAutomezzo.setAdapter(arrayAdapterAutomezzo);
viewModel.deposito.refresh();
viewModel.numOrds.refresh();
viewModel.cliente.refresh();
viewModel.terminiConsegna.refresh();
viewModel.vettore.refresh();
viewModel.automezzo.refresh();
}
private void initViewModelNew(DialogVenditaFiltroAvanzatoViewModel viewModel, DialogVenditaFiltroAvanzatoBinding bindings) {
BindableString.registerListener(viewModel.deposito, value -> {
if(UtilityString.isNullOrEmpty(value)) currentDepositoPredicate = null;
else {
currentDepositoPredicate = o -> o.getCodMdep().toLowerCase().equalsIgnoreCase(value);
}
refreshList();
arrayAdapterNumOrds.clear();
arrayAdapterNumOrds.addAll(getAvailableNumOrds(true));
arrayAdapterCliente.clear();
arrayAdapterCliente.addAll(getAvailableCliente(true));
arrayAdapterTermCons.clear();
arrayAdapterTermCons.addAll(getAvailableTermCons(true));
arrayAdapterVettore.clear();
arrayAdapterVettore.addAll(getAvailableVettori(true));
arrayAdapterAutomezzo.clear();
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
});
bindings.inputTermCons.setOnClickListener(view -> {
BindableString.registerListener(viewModel.numOrds, value -> {
if(UtilityString.isNullOrEmpty(value)) currentNumOrdsPredicate = null;
else {
String[] numOrdsSplitted = value.split("[,\\ ]");
AlertDialog.Builder builderSingle = new AlertDialog.Builder(currentContext);
builderSingle.setTitle(R.string.terms_of_delivery);
try{
List<Integer> numOrdsInteger = Stream.of(numOrdsSplitted)
.filter(x -> !UtilityString.isNullOrEmpty(x))
.map(Integer::parseInt).toList();
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter(currentContext, android.R.layout.select_dialog_singlechoice);
arrayAdapter.addAll(getAvailableTermCons());
currentNumOrdsPredicate = o -> numOrdsInteger.contains(o.getNumOrd());
} catch (NumberFormatException ex) {
currentNumOrdsPredicate = null;
}
}
builderSingle.setAdapter(arrayAdapter, (dialogInterface, i) -> {
viewModel.terminiConsegna.set(arrayAdapter.getItem(i));
});
builderSingle.show();
refreshList();
arrayAdapterCodMdep.clear();
arrayAdapterCodMdep.addAll(getAvailableCodMdeps(true));
arrayAdapterCliente.clear();
arrayAdapterCliente.addAll(getAvailableCliente(true));
arrayAdapterTermCons.clear();
arrayAdapterTermCons.addAll(getAvailableTermCons(true));
arrayAdapterVettore.clear();
arrayAdapterVettore.addAll(getAvailableVettori(true));
arrayAdapterAutomezzo.clear();
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
});
bindings.inputVettore.setOnClickListener(view -> {
BindableString.registerListener(viewModel.cliente, value -> {
if(UtilityString.isNullOrEmpty(value)) currentClientePredicate = null;
else {
currentClientePredicate = o -> o.getRagSocOrd().toLowerCase().contains(value.toLowerCase());
}
AlertDialog.Builder builderSingle = new AlertDialog.Builder(currentContext);
builderSingle.setTitle(R.string.carrier);
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter(currentContext, android.R.layout.select_dialog_singlechoice);
arrayAdapter.addAll(getAvailableVettori());
builderSingle.setAdapter(arrayAdapter, (dialogInterface, i) -> {
viewModel.vettore.set(arrayAdapter.getItem(i));
});
builderSingle.show();
refreshList();
arrayAdapterCodMdep.clear();
arrayAdapterCodMdep.addAll(getAvailableCodMdeps(true));
arrayAdapterNumOrds.clear();
arrayAdapterNumOrds.addAll(getAvailableNumOrds(true));
arrayAdapterTermCons.clear();
arrayAdapterTermCons.addAll(getAvailableTermCons(true));
arrayAdapterVettore.clear();
arrayAdapterVettore.addAll(getAvailableVettori(true));
arrayAdapterAutomezzo.clear();
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
});
bindings.inputAutomezzo.setOnClickListener(view -> {
BindableString.registerListener(viewModel.terminiConsegna, value -> {
if(UtilityString.isNullOrEmpty(value)) currentTermConsPredicate = null;
else {
currentTermConsPredicate = o -> !UtilityString.isNullOrEmpty(o.getTermCons()) && o.getTermCons().equalsIgnoreCase(value);
}
AlertDialog.Builder builderSingle = new AlertDialog.Builder(currentContext);
builderSingle.setTitle(R.string.vehicle);
refreshList();
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter(currentContext, android.R.layout.select_dialog_singlechoice);
arrayAdapter.addAll(getAvailableAutomezzi());
builderSingle.setAdapter(arrayAdapter, (dialogInterface, i) -> {
viewModel.automezzo.set(arrayAdapter.getItem(i));
arrayAdapterCodMdep.clear();
arrayAdapterCodMdep.addAll(getAvailableCodMdeps(true));
arrayAdapterNumOrds.clear();
arrayAdapterNumOrds.addAll(getAvailableNumOrds(true));
arrayAdapterCliente.clear();
arrayAdapterCliente.addAll(getAvailableCliente(true));
arrayAdapterVettore.clear();
arrayAdapterVettore.addAll(getAvailableVettori(true));
arrayAdapterAutomezzo.clear();
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
});
builderSingle.show();
BindableString.registerListener(viewModel.vettore, value -> {
if(UtilityString.isNullOrEmpty(value)) currentVettorePredicate = null;
else {
currentVettorePredicate = o -> (o.getCodVvet() + " - " + o.getDescrizioneVettore()).equalsIgnoreCase(value);
}
refreshList();
arrayAdapterCodMdep.clear();
arrayAdapterCodMdep.addAll(getAvailableCodMdeps(true));
arrayAdapterNumOrds.clear();
arrayAdapterNumOrds.addAll(getAvailableNumOrds(true));
arrayAdapterCliente.clear();
arrayAdapterCliente.addAll(getAvailableCliente(true));
arrayAdapterTermCons.clear();
arrayAdapterTermCons.addAll(getAvailableTermCons(true));
arrayAdapterAutomezzo.clear();
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
});
BindableString.registerListener(viewModel.automezzo, value -> {
if(UtilityString.isNullOrEmpty(value)) currentAutomezzoPredicate = null;
else {
currentAutomezzoPredicate = o -> !UtilityString.isNullOrEmpty(o.getDescrizioneAuto()) && o.getDescrizioneAuto().toLowerCase().contains(value);
}
refreshList();
arrayAdapterCodMdep.clear();
arrayAdapterCodMdep.addAll(getAvailableCodMdeps(true));
arrayAdapterNumOrds.clear();
arrayAdapterNumOrds.addAll(getAvailableNumOrds(true));
arrayAdapterCliente.clear();
arrayAdapterCliente.addAll(getAvailableCliente(true));
arrayAdapterTermCons.clear();
arrayAdapterTermCons.addAll(getAvailableTermCons(true));
arrayAdapterVettore.clear();
arrayAdapterVettore.addAll(getAvailableVettori(true));
});
}
private void initViewModel(DialogVenditaFiltroAvanzatoViewModel viewModel, DialogVenditaFiltroAvanzatoBinding bindings) {
firstInit = true;
@ -210,7 +327,6 @@ public class DialogVenditaFiltroAvanzato {
else {
String[] numOrdsSplitted = value.split("[,\\ ]");
try{
List<Integer> numOrdsInteger = Stream.of(numOrdsSplitted)
.filter(x -> !UtilityString.isNullOrEmpty(x))
@ -316,10 +432,10 @@ public class DialogVenditaFiltroAvanzato {
}
private List<String> getAvailableCodMdeps() {
private List<String> getAvailableCodMdeps(boolean skipRecalc) {
if(currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentTermConsPredicate == null){
currentFilteredOrderList = currentOrderList;
} else {
} else if(!skipRecalc){
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
.filter(x ->
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate != null && currentNumOrdsPredicate.test(x))) &&
@ -336,10 +452,50 @@ public class DialogVenditaFiltroAvanzato {
return Stream.of(currentFilteredOrderList).map(OrdineVenditaInevasoDTO::getCodMdep).distinct().withoutNulls().toList();
}
private List<String> getAvailableTermCons() {
private List<String> getAvailableCliente(boolean skipRecalc) {
if(currentNumOrdsPredicate == null && currentDepositoPredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentTermConsPredicate == null){
currentFilteredOrderList = currentOrderList;
} else if(!skipRecalc){
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
.filter(x ->
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate != null && currentNumOrdsPredicate.test(x))) &&
(currentDepositoPredicate == null || (currentDepositoPredicate != null && currentDepositoPredicate.test(x))) &&
(currentDataConsPredicate == null || (currentDataConsPredicate != null && currentDataConsPredicate.test(x))) &&
(currentVettorePredicate == null || (currentVettorePredicate != null && currentVettorePredicate.test(x))) &&
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate != null && currentAutomezzoPredicate.test(x))) &&
(currentTermConsPredicate == null || (currentTermConsPredicate != null && currentTermConsPredicate.test(x)))
);
currentFilteredOrderList = tmpStream.toList();
}
return Stream.of(currentFilteredOrderList).map(OrdineVenditaInevasoDTO::getRagSocOrd).distinct().withoutNulls().toList();
}
private List<String> getAvailableNumOrds(boolean skipRecalc) {
if(currentDepositoPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentTermConsPredicate == null){
currentFilteredOrderList = currentOrderList;
} else if(!skipRecalc){
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
.filter(x ->
(currentDepositoPredicate == null || (currentDepositoPredicate != null && currentDepositoPredicate.test(x))) &&
(currentClientePredicate == null || (currentClientePredicate != null && currentClientePredicate.test(x))) &&
(currentDataConsPredicate == null || (currentDataConsPredicate != null && currentDataConsPredicate.test(x))) &&
(currentVettorePredicate == null || (currentVettorePredicate != null && currentVettorePredicate.test(x))) &&
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate != null && currentAutomezzoPredicate.test(x))) &&
(currentTermConsPredicate == null || (currentTermConsPredicate != null && currentTermConsPredicate.test(x)))
);
currentFilteredOrderList = tmpStream.toList();
}
return Stream.of(currentFilteredOrderList).map(x -> x.getNumOrd().toString()).distinct().withoutNulls().toList();
}
private List<String> getAvailableTermCons(boolean skipRecalc) {
if(currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentDepositoPredicate == null){
currentFilteredOrderList = currentOrderList;
} else {
} else if(!skipRecalc){
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
.filter(x ->
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate != null && currentNumOrdsPredicate.test(x))) &&
@ -356,10 +512,10 @@ public class DialogVenditaFiltroAvanzato {
return Stream.of(currentFilteredOrderList).map(OrdineVenditaInevasoDTO::getTermCons).distinct().withoutNulls().toList();
}
private List<String> getAvailableVettori() {
private List<String> getAvailableVettori(boolean skipRecalc) {
if(currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentTermConsPredicate == null && currentAutomezzoPredicate == null && currentDepositoPredicate == null){
currentFilteredOrderList = currentOrderList;
} else {
} else if(!skipRecalc){
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
.filter(x ->
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate != null && currentNumOrdsPredicate.test(x))) &&
@ -376,10 +532,10 @@ public class DialogVenditaFiltroAvanzato {
return Stream.of(currentFilteredOrderList).filter(x -> x.getCodVvet() != null).map(x -> x.getCodVvet() + " - " + x.getDescrizioneVettore()).distinct().withoutNulls().toList();
}
private List<String> getAvailableAutomezzi() {
private List<String> getAvailableAutomezzi(boolean skipRecalc) {
if(currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentTermConsPredicate == null && currentVettorePredicate == null && currentDepositoPredicate == null){
currentFilteredOrderList = currentOrderList;
} else {
} else if(!skipRecalc){
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
.filter(x ->
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate != null && currentNumOrdsPredicate.test(x))) &&

View File

@ -45,7 +45,7 @@
android:layout_height="wrap_content"
android:hint="@string/customer">
<AutoCompleteTextView
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="@+id/filled_exposed_dropdown"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -45,7 +45,7 @@
android:layout_height="wrap_content"
android:hint="@string/recipient">
<AutoCompleteTextView
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="@+id/filled_exposed_dropdown"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -13,7 +13,9 @@
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
app:cardCornerRadius="12dp"
app:cardElevation="0dp">
<LinearLayout
android:layout_width="match_parent"
@ -21,72 +23,102 @@
android:orientation="vertical"
android:layout_margin="16dp">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:id="@+id/title_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="22sp"
style="@style/TextViewMaterial.DialogTitle"
android:text="@string/dialog_vendita_filtro_avanzato"
android:textStyle="bold"
android:textColor="@android:color/black"
android:gravity="center_horizontal"
android:layout_marginBottom="12dp"/>
<!--<com.google.android.material.textfield.TextInputLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--app:hintTextAppearance="@style/hint_text">-->
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_cod_mdep"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_cod_mdep_new"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
android:hint="@string/deposit"
android:focusable="false"
app:binding="@{viewmodel.deposito}"/>
android:hint="@string/deposit">
<!--</com.google.android.material.textfield.TextInputLayout>-->
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="@+id/filled_exposed_dropdown_cod_mdep"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
app:binding="@{viewmodel.deposito}" />
<!--<com.google.android.material.textfield.TextInputLayout-->
</com.google.android.material.textfield.TextInputLayout>
<!--<com.google.android.material.textfield.TextInputEditText-->
<!--android:id="@+id/input_cod_mdep"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--app:hintTextAppearance="@style/hint_text">-->
<!--android:inputType="textNoSuggestions"-->
<!--android:hint="@string/deposit"-->
<!--android:focusable="false"-->
<!--app:binding="@{viewmodel.deposito}"/>-->
<com.google.android.material.textfield.TextInputEditText
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_num_ords"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/num_ords">
<androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView
android:id="@+id/filled_exposed_dropdown_num_ords"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number|text"
android:hint="@string/num_ords"
android:singleLine="true"
android:ellipsize="end"
app:binding="@{viewmodel.numOrds}"/>
<!--</com.google.android.material.textfield.TextInputLayout>-->
</com.google.android.material.textfield.TextInputLayout>
<!--<com.google.android.material.textfield.TextInputLayout-->
<!--android:id="@+id/input_cliente"-->
<!--<com.google.android.material.textfield.TextInputEditText-->
<!--android:id="@+id/input_num_ords"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--app:hintTextAppearance="@style/hint_text">-->
<!--android:inputType="number|text"-->
<!--android:hint="@string/num_ords"-->
<!--app:binding="@{viewmodel.numOrds}"/>-->
<com.google.android.material.textfield.TextInputEditText
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_cliente"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/customer">
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="@+id/filled_exposed_dropdown_cliente"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
android:hint="@string/customer"
android:singleLine="true"
android:ellipsize="end"
app:binding="@{viewmodel.cliente}"/>
<!--</com.google.android.material.textfield.TextInputLayout>-->
</com.google.android.material.textfield.TextInputLayout>
<!--<com.google.android.material.textfield.TextInputLayout-->
<!--<com.google.android.material.textfield.TextInputEditText-->
<!--android:id="@+id/input_cliente"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--app:hintTextAppearance="@style/hint_text">-->
<!--android:inputType="textNoSuggestions"-->
<!--android:hint="@string/customer"-->
<!--app:binding="@{viewmodel.cliente}"/>-->
<com.google.android.material.textfield.TextInputEditText
@ -98,61 +130,100 @@
android:focusable="false"
app:binding="@{viewmodel.dataConsegna}"/>
<!--</com.google.android.material.textfield.TextInputLayout>-->
<!--<com.google.android.material.textfield.TextInputLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--app:hintTextAppearance="@style/hint_text">-->
<com.google.android.material.textfield.TextInputEditText
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_term_cons"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/terms_of_delivery">
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="@+id/filled_exposed_dropdown_term_cons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
android:hint="@string/terms_of_delivery"
android:focusable="false"
android:singleLine="true"
android:ellipsize="end"
app:binding="@{viewmodel.terminiConsegna}"/>
<!--</com.google.android.material.textfield.TextInputLayout>-->
</com.google.android.material.textfield.TextInputLayout>
<!--<com.google.android.material.textfield.TextInputLayout-->
<!--<com.google.android.material.textfield.TextInputEditText-->
<!--android:id="@+id/input_term_cons"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--app:hintTextAppearance="@style/hint_text">-->
<!--android:inputType="textNoSuggestions"-->
<!--android:hint="@string/terms_of_delivery"-->
<!--android:focusable="false"-->
<!--app:binding="@{viewmodel.terminiConsegna}"/>-->
<com.google.android.material.textfield.TextInputEditText
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_vettore"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/carrier">
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="@+id/filled_exposed_dropdown_vettore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
android:hint="@string/carrier"
android:focusable="false"
android:singleLine="true"
android:ellipsize="end"
app:binding="@{viewmodel.vettore}"/>
<!--</com.google.android.material.textfield.TextInputLayout>-->
</com.google.android.material.textfield.TextInputLayout>
<!--<com.google.android.material.textfield.TextInputLayout-->
<!--<com.google.android.material.textfield.TextInputEditText-->
<!--android:id="@+id/input_vettore"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--app:hintTextAppearance="@style/hint_text">-->
<!--android:inputType="textNoSuggestions"-->
<!--android:hint="@string/carrier"-->
<!--android:focusable="false"-->
<!--app:binding="@{viewmodel.vettore}"/>-->
<com.google.android.material.textfield.TextInputEditText
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_automezzo"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/vehicle">
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="@+id/filled_exposed_dropdown_automezzo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
android:hint="@string/vehicle"
android:focusable="false"
android:singleLine="true"
android:ellipsize="end"
app:binding="@{viewmodel.automezzo}"/>
<!--</com.google.android.material.textfield.TextInputLayout>-->
</com.google.android.material.textfield.TextInputLayout>
<!--<com.google.android.material.textfield.TextInputEditText-->
<!--android:id="@+id/input_automezzo"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:inputType="textNoSuggestions"-->
<!--android:hint="@string/vehicle"-->
<!--android:focusable="false"-->
<!--app:binding="@{viewmodel.automezzo}"/>-->
</LinearLayout>

View File

@ -0,0 +1,8 @@
<androidx.appcompat.widget.AppCompatTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="?attr/textAppearanceSubtitle1"
style="@style/AppTheme.NewMaterial.Text"/>

View File

@ -117,7 +117,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/guide_line_fornitore">
<AutoCompleteTextView
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="@+id/auto_complete_fornitori"
android:layout_width="match_parent"
android:layout_height="wrap_content"