Implementata view bottom sheet per contenuto UL
This commit is contained in:
parent
f619dece3b
commit
f0bbc60ab6
@ -124,7 +124,6 @@ dependencies {
|
|||||||
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
|
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
|
||||||
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
|
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
|
||||||
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
||||||
implementation 'com.github.andrefrsousa:SuperBottomSheet:1.2.1@aar'
|
|
||||||
implementation 'com.fede987:status-bar-alert:1.0.1'
|
implementation 'com.fede987:status-bar-alert:1.0.1'
|
||||||
implementation 'com.fxn769:stash:1.2'
|
implementation 'com.fxn769:stash:1.2'
|
||||||
testImplementation 'junit:junit:4.13'
|
testImplementation 'junit:junit:4.13'
|
||||||
|
|||||||
@ -7,7 +7,9 @@ import javax.inject.Singleton;
|
|||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
public class MainApplicationModule {
|
public class MainApplicationModule {
|
||||||
@ -30,5 +32,17 @@ public class MainApplicationModule {
|
|||||||
return new OrdiniRESTConsumer();
|
return new OrdiniRESTConsumer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer() {
|
||||||
|
return new ColliMagazzinoRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
PrinterRESTConsumer providePrinterRESTConsumer() {
|
||||||
|
return new PrinterRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,6 @@ import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
|||||||
|
|
||||||
public interface IOrdiniVendita {
|
public interface IOrdiniVendita {
|
||||||
|
|
||||||
void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed);
|
void distribuisciCollo(MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import it.integry.integrywmsnative.BuildConfig;
|
|||||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecover;
|
import it.integry.integrywmsnative.core.data_recover.ColliDataRecover;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.settings.Stash;
|
import it.integry.integrywmsnative.core.settings.Stash;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||||
@ -59,6 +60,7 @@ public class AppContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initUtilities() {
|
private void initUtilities() {
|
||||||
|
UtilityContext.initApplicationContext(mContext);
|
||||||
UtilityResources.init(mContext);
|
UtilityResources.init(mContext);
|
||||||
UtilityToast.init(mContext);
|
UtilityToast.init(mContext);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,19 @@ public class BindableBoolean implements Observable {
|
|||||||
}
|
}
|
||||||
mCallbacks.add(callback);
|
mCallbacks.add(callback);
|
||||||
}
|
}
|
||||||
|
public void addOnPropertyChangedCallback(@NonNull Runnable callback) {
|
||||||
|
synchronized (this) {
|
||||||
|
if (mCallbacks == null) {
|
||||||
|
mCallbacks = new PropertyChangeRegistry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mCallbacks.add(new OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
callback.run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeOnPropertyChangedCallback(@NonNull OnPropertyChangedCallback callback) {
|
public void removeOnPropertyChangedCallback(@NonNull OnPropertyChangedCallback callback) {
|
||||||
|
|||||||
@ -3,7 +3,13 @@ package it.integry.integrywmsnative.core.di;
|
|||||||
import androidx.databinding.BaseObservable;
|
import androidx.databinding.BaseObservable;
|
||||||
|
|
||||||
public class BindableInteger extends BaseObservable {
|
public class BindableInteger extends BaseObservable {
|
||||||
Integer value;
|
Integer mValue;
|
||||||
|
|
||||||
|
public BindableInteger() {}
|
||||||
|
|
||||||
|
public BindableInteger(int startValue) {
|
||||||
|
this.mValue = startValue;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer get() {
|
public Integer get() {
|
||||||
return get(true);
|
return get(true);
|
||||||
@ -11,21 +17,21 @@ public class BindableInteger extends BaseObservable {
|
|||||||
|
|
||||||
public Integer get(boolean defaultIfNull) {
|
public Integer get(boolean defaultIfNull) {
|
||||||
|
|
||||||
if(value == null){
|
if(mValue == null){
|
||||||
if(defaultIfNull) return 0;
|
if(defaultIfNull) return 0;
|
||||||
else return null;
|
else return null;
|
||||||
} else return value;
|
} else return mValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(Integer value) {
|
public void set(Integer value) {
|
||||||
if (!Objects.equals(this.value, value)) {
|
if (!Objects.equals(this.mValue, value)) {
|
||||||
this.value = value;
|
this.mValue = value;
|
||||||
notifyChange();
|
notifyChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return value == null;
|
return mValue == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,17 +10,21 @@ import androidx.databinding.BindingConversion;
|
|||||||
import androidx.constraintlayout.widget.Guideline;
|
import androidx.constraintlayout.widget.Guideline;
|
||||||
|
|
||||||
import com.google.android.material.textfield.TextInputEditText;
|
import com.google.android.material.textfield.TextInputEditText;
|
||||||
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
import androidx.core.util.Pair;
|
import androidx.core.util.Pair;
|
||||||
import androidx.appcompat.widget.AppCompatCheckBox;
|
import androidx.appcompat.widget.AppCompatCheckBox;
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
|
||||||
|
import android.app.DatePickerDialog;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AutoCompleteTextView;
|
import android.widget.AutoCompleteTextView;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
@ -28,6 +32,9 @@ import android.widget.RadioGroup;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import androidx.databinding.Observable;
|
import androidx.databinding.Observable;
|
||||||
@ -36,15 +43,20 @@ import androidx.lifecycle.MutableLiveData;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
|
||||||
public class Converters {
|
public class Converters {
|
||||||
|
|
||||||
|
|
||||||
@BindingConversion
|
@BindingConversion
|
||||||
public static String convertBindableToString(BindableString bindableString) {
|
public static String convertBindableToString(BindableString bindableString) {
|
||||||
return bindableString.get();
|
if(bindableString != null) return bindableString.get();
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@BindingConversion
|
@BindingConversion
|
||||||
@ -52,6 +64,33 @@ public class Converters {
|
|||||||
return bindableBoolean.get();
|
return bindableBoolean.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BindingConversion
|
||||||
|
public static boolean convertObservableToBoolean(ObservableField<Boolean> bindableBoolean) {
|
||||||
|
return bindableBoolean.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("binding")
|
||||||
|
public static void bindEditText(AppCompatTextView view, final BindableInteger bindableInteger) {
|
||||||
|
Pair<BindableInteger, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != bindableInteger) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
if(bindableInteger != null) bindableInteger.set(Integer.parseInt(s.toString()));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(bindableInteger, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
}
|
||||||
|
String newValue = bindableInteger != null && bindableInteger.get() != null ? bindableInteger.get().toString() : "0";
|
||||||
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
|
view.setText(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@BindingAdapter("binding")
|
@BindingAdapter("binding")
|
||||||
public static void bindEditText(EditText view, final BindableString bindableString) {
|
public static void bindEditText(EditText view, final BindableString bindableString) {
|
||||||
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
@ -97,7 +136,7 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@BindingAdapter("binding")
|
@BindingAdapter("binding")
|
||||||
public static void bindTextInputEditText(TextInputEditText view, final ObservableField<BigDecimal> observableBigDecimal) {
|
public static void bindTextInputEditTextBigDecimal(TextInputEditText view, final ObservableField<BigDecimal> observableBigDecimal) {
|
||||||
Pair<ObservableField<BigDecimal>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
Pair<ObservableField<BigDecimal>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
if (pair == null || pair.first != observableBigDecimal) {
|
if (pair == null || pair.first != observableBigDecimal) {
|
||||||
if (pair != null) {
|
if (pair != null) {
|
||||||
@ -122,6 +161,77 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("binding")
|
||||||
|
public static void bindTextInputEditTextString(TextInputEditText view, final ObservableField<String> observableString) {
|
||||||
|
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != observableString) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
observableString.set(s.toString());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(observableString, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
}
|
||||||
|
String newValue = observableString.get();
|
||||||
|
String viewValue = view.getText().toString().trim();
|
||||||
|
|
||||||
|
if(!viewValue.equalsIgnoreCase(newValue)) {
|
||||||
|
view.setText(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter({"binding"})
|
||||||
|
public static void bindTextInputEditTextDate(TextInputEditText view, final ObservableField<Date> observableDate) {
|
||||||
|
Pair<ObservableField<Date>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != observableDate) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(observableDate, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
|
||||||
|
RunnableArgs<View> onClick = v -> {
|
||||||
|
// Get Current Date
|
||||||
|
Calendar c = UtilityDate.getCalendarInstance();
|
||||||
|
|
||||||
|
if(observableDate.get() != null) {
|
||||||
|
c.setTime(observableDate.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
int mYear = c.get(Calendar.YEAR);
|
||||||
|
int mMonth = c.get(Calendar.MONTH);
|
||||||
|
int mDay = c.get(Calendar.DAY_OF_MONTH);
|
||||||
|
|
||||||
|
DatePickerDialog datePickerDialog = new DatePickerDialog(view.getContext(),
|
||||||
|
(cView, year, month, day) -> {
|
||||||
|
Date resultDate = new GregorianCalendar(year, month, day).getTime();
|
||||||
|
view.setText(UtilityDate.formatDate(resultDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
|
observableDate.set(resultDate);
|
||||||
|
}, mYear, mMonth, mDay);
|
||||||
|
datePickerDialog.show();
|
||||||
|
};
|
||||||
|
|
||||||
|
//Adding click-listener
|
||||||
|
view.setOnClickListener(onClick::run);
|
||||||
|
if(view.getParent() != null && view.getParent().getParent() != null && view.getParent().getParent() instanceof TextInputLayout) {
|
||||||
|
((FrameLayout)view.getParent()).setOnClickListener(onClick::run);
|
||||||
|
((TextInputLayout) view.getParent().getParent()).setOnClickListener(onClick::run);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Date newValue = observableDate.get();
|
||||||
|
view.setText(UtilityDate.formatDate(newValue, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
|
}
|
||||||
|
|
||||||
@BindingAdapter("binding")
|
@BindingAdapter("binding")
|
||||||
public static void bindAutoCompleteTextView(AutoCompleteTextView view, final BindableString bindableString) {
|
public static void bindAutoCompleteTextView(AutoCompleteTextView view, final BindableString bindableString) {
|
||||||
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
@ -292,6 +402,22 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @BindingAdapter("visibility")
|
||||||
|
// public static void bindView(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.VISIBLE : View.GONE);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// view.setVisibility(bindableBoolean.get() ? View.VISIBLE : View.GONE);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
@BindingAdapter("android:layout_weight")
|
@BindingAdapter("android:layout_weight")
|
||||||
public static void setLayoutWeight(View view, final Float weight) {
|
public static void setLayoutWeight(View view, final Float weight) {
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
import androidx.core.util.Pair;
|
||||||
|
import androidx.databinding.BindingAdapter;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||||
|
|
||||||
|
public class ViewConverters {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@BindingAdapter("singleClick")
|
||||||
|
public static void bindViewSingleClick(View view, final Runnable callback) {
|
||||||
|
view.setFocusable(true);
|
||||||
|
view.setClickable(true);
|
||||||
|
view.setOnClickListener(new OnSingleClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onSingleClick(View v) {
|
||||||
|
callback.run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import android.util.Config;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of {@link View.OnClickListener} that ignores subsequent clicks that happen too quickly after the first one.<br/>
|
||||||
|
* To use this class, implement {@link #onSingleClick(View)} instead of {@link View.OnClickListener#onClick(View)}.
|
||||||
|
*/
|
||||||
|
public abstract class OnSingleClickListener implements View.OnClickListener {
|
||||||
|
private static final String TAG = OnSingleClickListener.class.getSimpleName();
|
||||||
|
|
||||||
|
private static final long MIN_DELAY_MS = 500;
|
||||||
|
|
||||||
|
private long mLastClickTime;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void onClick(View v) {
|
||||||
|
long lastClickTime = mLastClickTime;
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
mLastClickTime = now;
|
||||||
|
if (now - lastClickTime < MIN_DELAY_MS) {
|
||||||
|
// Too fast: ignore
|
||||||
|
if (Config.LOGD) Log.d(TAG, "onClick Clicked too quickly: ignored");
|
||||||
|
} else {
|
||||||
|
// Register the click
|
||||||
|
onSingleClick(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a view has been clicked.
|
||||||
|
*
|
||||||
|
* @param v The view that was clicked.
|
||||||
|
*/
|
||||||
|
public abstract void onSingleClick(View v);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wraps an {@link View.OnClickListener} into an {@link OnSingleClickListener}.<br/>
|
||||||
|
* The argument's {@link View.OnClickListener#onClick(View)} method will be called when a single click is registered.
|
||||||
|
*
|
||||||
|
* @param onClickListener The listener to wrap.
|
||||||
|
* @return the wrapped listener.
|
||||||
|
*/
|
||||||
|
public static View.OnClickListener wrap(final View.OnClickListener onClickListener) {
|
||||||
|
return new OnSingleClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onSingleClick(View v) {
|
||||||
|
onClickListener.onClick(v);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableList;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
public class WeakReferenceOnListChangedCallback extends ObservableList.OnListChangedCallback {
|
||||||
|
|
||||||
|
private final WeakReference<BaseAdapter> adapterReference;
|
||||||
|
|
||||||
|
public WeakReferenceOnListChangedCallback(BaseAdapter baseAdapter) {
|
||||||
|
this.adapterReference = new WeakReference<>(baseAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChanged(ObservableList sender) {
|
||||||
|
BaseAdapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeChanged(ObservableList sender, int positionStart, int itemCount) {
|
||||||
|
BaseAdapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeInserted(ObservableList sender, int positionStart, int itemCount) {
|
||||||
|
BaseAdapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeMoved(ObservableList sender, int fromPosition, int toPosition, int itemCount) {
|
||||||
|
BaseAdapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeRemoved(ObservableList sender, int positionStart, int itemCount) {
|
||||||
|
BaseAdapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -98,7 +98,7 @@ public class MtbAart extends EntityBase{
|
|||||||
this.type = "mtb_aart";
|
this.type = "mtb_aart";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFlagTracciabilita() {
|
public boolean isFlagTracciabilitaBoolean() {
|
||||||
return flagTracciabilita != null && flagTracciabilita.equalsIgnoreCase("S");
|
return flagTracciabilita != null && flagTracciabilita.equalsIgnoreCase("S");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,13 +13,14 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
@ -32,7 +33,6 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
|||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SingleValueDTO;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@ -44,9 +44,10 @@ import retrofit2.Call;
|
|||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public static void saveCollo(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback) {
|
public static void saveColloStatic(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback) {
|
||||||
|
|
||||||
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
||||||
mtbColtToSave.getMtbColr().get(i)
|
mtbColtToSave.getMtbColr().get(i)
|
||||||
@ -58,8 +59,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtToSave, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
public static void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void saveColloStatic(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
||||||
mtbColtToSave.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColtToSave.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
@ -143,7 +147,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
|
|
||||||
saveCollo(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
saveColloStatic(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if (onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
@ -206,7 +210,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
saveCollo(newMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
saveColloStatic(newMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if (onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
@ -281,7 +285,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
saveCollo(newMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
saveColloStatic(newMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if (onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
@ -326,7 +330,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
mtbColtToCreate
|
mtbColtToCreate
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
saveCollo(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
saveColloStatic(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if (onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
@ -339,11 +343,15 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliMagazzinoRESTConsumer.deleteColloStatic(mtbColtToDelete, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void deleteColloStatic(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
||||||
|
|
||||||
saveCollo(mtbColtToDelete, new ISimpleOperationCallback<MtbColt>() {
|
saveColloStatic(mtbColtToDelete, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if (onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
@ -399,7 +407,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(ssccString, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getBySSCCStatic(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||||
@Override
|
@Override
|
||||||
@ -415,8 +427,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -467,7 +477,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getMultipleByTestate(List<MtbColt> testate, boolean onlyResiduo, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getMultipleByTestate(List<MtbColt> testate, boolean onlyResiduo, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliMagazzinoRESTConsumer.getMultipleByTestateStatic(testate, onlyResiduo, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getMultipleByTestateStatic(List<MtbColt> testate, boolean onlyResiduo, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ArrayList<MtbColt> resultMtbColt = new ArrayList<>();
|
ArrayList<MtbColt> resultMtbColt = new ArrayList<>();
|
||||||
cyclicGetMultipleByTestate(testate.iterator(), onlyResiduo, resultMtbColt, () -> {
|
cyclicGetMultipleByTestate(testate.iterator(), onlyResiduo, resultMtbColt, () -> {
|
||||||
onComplete.run(resultMtbColt);
|
onComplete.run(resultMtbColt);
|
||||||
@ -477,7 +491,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
private static void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
private static void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
if (sourceMtbColts.hasNext()) {
|
if (sourceMtbColts.hasNext()) {
|
||||||
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
getByTestataStatic(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
||||||
resultMtbColt.add(mtbColt);
|
resultMtbColt.add(mtbColt);
|
||||||
cyclicGetMultipleByTestate(sourceMtbColts, onlyResiduo, resultMtbColt, onComplete, onAbort);
|
cyclicGetMultipleByTestate(sourceMtbColts, onlyResiduo, resultMtbColt, onComplete, onAbort);
|
||||||
}, onAbort);
|
}, onAbort);
|
||||||
@ -486,7 +500,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliMagazzinoRESTConsumer.getByTestataStatic(testata, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getByTestataStatic(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String ssccString = null;
|
String ssccString = null;
|
||||||
|
|
||||||
if (testata.getSerCollo().equalsIgnoreCase(CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE)) {
|
if (testata.getSerCollo().equalsIgnoreCase(CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE)) {
|
||||||
@ -520,7 +538,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
ssccString += "0";
|
ssccString += "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
getBySSCC(ssccString, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
getBySSCCStatic(ssccString, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -531,7 +549,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
if (posizione == null) testata.setPosizione(null);
|
if (posizione == null) testata.setPosizione(null);
|
||||||
else testata.setPosizione(posizione.getPosizione());
|
else testata.setPosizione(posizione.getPosizione());
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(testata, new ISimpleOperationCallback<MtbColt>() {
|
ColliMagazzinoRESTConsumer.saveColloStatic(testata, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if (onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
@ -590,25 +608,30 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliMagazzinoRESTConsumer.updateDataFineStatic(mtbColt, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
public static void updateDataFine(Context context, Dialog progress, MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public static void updateDataFineStatic(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
||||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
cloneMtbColt.setOraFinePrep(UtilityDate.getDateInstance());
|
cloneMtbColt.setOraFinePrep(UtilityDate.getDateInstance());
|
||||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(cloneMtbColt, value -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(context, ex, progress);
|
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if(onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void canLUBeDeleted(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliMagazzinoRESTConsumer.canLUBeDeletedStatic(mtbColt, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
public static void canLUBeDeleted(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void canLUBeDeletedStatic(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
HashMap<String, Object> params = new HashMap<>();
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
params.put("mtb_colt.gestione", mtbColt.getGestione());
|
params.put("mtb_colt.gestione", mtbColt.getGestione());
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import com.annimon.stream.Stream;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
@ -18,6 +20,7 @@ import retrofit2.Call;
|
|||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public enum Type {
|
public enum Type {
|
||||||
@ -26,7 +29,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getAvailablePrinters(final ISimpleOperationCallback<List<String>> callback) {
|
public static void getAvailablePrintersStatic(final ISimpleOperationCallback<List<String>> callback) {
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
printerService.getAvailablePrinters().enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
printerService.getAvailablePrinters().enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
@Override
|
@Override
|
||||||
@ -42,7 +45,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getAvailablePrinters(String codMdep, final ISimpleOperationCallback<List<String>> callback) {
|
public static void getAvailablePrintersStatic(String codMdep, final ISimpleOperationCallback<List<String>> callback) {
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
printerService.getAvailablePrinters(codMdep).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
printerService.getAvailablePrinters(codMdep).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
@ -71,7 +74,11 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getAvailablePrinters(String codMdep, Type printerType, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getAvailablePrinters(String codMdep, Type printerType, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
PrinterRESTConsumer.getAvailablePrintersStatic(codMdep, printerType, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getAvailablePrintersStatic(String codMdep, Type printerType, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
String printerTypeStr = printerType != null ? printerType.toString() : null;
|
String printerTypeStr = printerType != null ? printerType.toString() : null;
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@ public class SitArtOrdDTO {
|
|||||||
private BigDecimal qtaCnfOrd;
|
private BigDecimal qtaCnfOrd;
|
||||||
private String idViaggio;
|
private String idViaggio;
|
||||||
private String codMdep;
|
private String codMdep;
|
||||||
|
private boolean flagEnablePickManuale;
|
||||||
|
|
||||||
public String getCodJcom() {
|
public String getCodJcom() {
|
||||||
return codJcom;
|
return codJcom;
|
||||||
@ -125,4 +126,13 @@ public class SitArtOrdDTO {
|
|||||||
this.codMdep = codMdep;
|
this.codMdep = codMdep;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagEnablePickManuale() {
|
||||||
|
return flagEnablePickManuale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SitArtOrdDTO setFlagEnablePickManuale(boolean flagEnablePickManuale) {
|
||||||
|
this.flagEnablePickManuale = flagEnablePickManuale;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
public class UtilityContext {
|
||||||
|
|
||||||
|
private static Context mApplicationContext;
|
||||||
|
|
||||||
|
public static void initApplicationContext(Context context) {
|
||||||
|
mApplicationContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Context getApplicationContext() {
|
||||||
|
return mApplicationContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -259,7 +259,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
|
|
||||||
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), false, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(barcodeScanDTO.getStringValue(), false, false, mtbColt -> {
|
||||||
|
|
||||||
if (mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
||||||
@ -499,7 +499,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, new ISimpleOperationCallback<MtbColt>() {
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
|
|
||||||
@ -567,7 +567,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
progress.show();
|
progress.show();
|
||||||
|
|
||||||
if (thereIsAnyRowInUL()) {
|
if (thereIsAnyRowInUL()) {
|
||||||
ColliMagazzinoRESTConsumer.updateDataFine(mActivity, progress, getColloRef(), () -> {
|
ColliMagazzinoRESTConsumer.updateDataFineStatic(getColloRef(), () -> {
|
||||||
if (shouldPrint) printCollo(progress, onComplete);
|
if (shouldPrint) printCollo(progress, onComplete);
|
||||||
else {
|
else {
|
||||||
postCloseOperations(onComplete);
|
postCloseOperations(onComplete);
|
||||||
@ -593,7 +593,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.SECONDARIA, value -> {
|
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.SECONDARIA, value -> {
|
||||||
|
|
||||||
if (value.size() > 0) {
|
if (value.size() > 0) {
|
||||||
try {
|
try {
|
||||||
@ -643,7 +643,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
|
|
||||||
private void deleteCollo(Dialog progress, Runnable onComplete) {
|
private void deleteCollo(Dialog progress, Runnable onComplete) {
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.deleteCollo(getColloRef(), () -> {
|
ColliMagazzinoRESTConsumer.deleteColloStatic(getColloRef(), () -> {
|
||||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||||
|
|
||||||
isFabVisible.set(true);
|
isFabVisible.set(true);
|
||||||
@ -839,7 +839,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
|||||||
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
||||||
cloneMtbColt.getMtbColr().add(mtbColr);
|
cloneMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
ColliMagazzinoRESTConsumer.saveColloStatic(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
|
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.gest.contenuto_bancale.ui;
|
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import com.andrefrsousa.superbottomsheet.SuperBottomSheetFragment;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
|
|
||||||
public class ContenutoBancaleBottomPanel extends SuperBottomSheetFragment {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
||||||
super.onCreateView(inflater, container, savedInstanceState);
|
|
||||||
return inflater.inflate(R.layout.fragment_contenuto_bancale, container, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getCornerRadius() {
|
|
||||||
if(getContext() != null) return getContext().getResources().getDimension(R.dimen.bottom_sheet_round16);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getStatusBarColor() {
|
|
||||||
return Color.RED;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel;
|
package it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
@ -101,7 +100,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
mContext.bindings.contenutoBancaleFab.close(true);
|
mContext.bindings.contenutoBancaleFab.close(true);
|
||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), mPrinterType, value -> {
|
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().userSession.depo.getCodMdep(), mPrinterType, value -> {
|
||||||
|
|
||||||
if(value.size() > 0) {
|
if(value.size() > 0) {
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.gest.lista_bancali.viewmodel;
|
package it.integry.integrywmsnative.gest.lista_bancali.viewmodel;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
@ -58,7 +57,7 @@ public class ListaBancaliViewModel implements IRecyclerItemClicked<MtbColt> {
|
|||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ColliMagazzinoRESTConsumer.getByTestata(item, true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getByTestataStatic(item, true, false, mtbColt -> {
|
||||||
|
|
||||||
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
|
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
|
||||||
mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
|
mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
|
||||||
|
|||||||
@ -166,8 +166,8 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
|
|
||||||
IOrdiniVendita ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA);
|
IOrdiniVendita ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.updateDataFine(getActivity(), null, recoveredMtbColt, () -> {
|
ColliMagazzinoRESTConsumer.updateDataFineStatic(recoveredMtbColt, () -> {
|
||||||
ordiniVendita.distribuisciCollo(null, recoveredMtbColt, recoveredMtbColtDto.getTestateOrdini(),
|
ordiniVendita.distribuisciCollo(recoveredMtbColt, recoveredMtbColtDto.getTestateOrdini(),
|
||||||
mtbColts -> {
|
mtbColts -> {
|
||||||
ColliDataRecover.closeSession(recoveredMtbColtID);
|
ColliDataRecover.closeSession(recoveredMtbColtID);
|
||||||
|
|
||||||
@ -224,6 +224,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
|
|
||||||
private void initGestMenu() {
|
private void initGestMenu() {
|
||||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||||
|
if(customConfiguration != null) {
|
||||||
BaseMenuConfiguration menuConfiguration = customConfiguration.getConfig(BaseCustomConfiguration.Keys.MENU_CONFIGURATION);
|
BaseMenuConfiguration menuConfiguration = customConfiguration.getConfig(BaseCustomConfiguration.Keys.MENU_CONFIGURATION);
|
||||||
List<MenuConfiguration.MenuGroup> menuGroups = menuConfiguration.getGroups();
|
List<MenuConfiguration.MenuGroup> menuGroups = menuConfiguration.getGroups();
|
||||||
|
|
||||||
@ -247,6 +248,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
mBindings.menuContainer.addView(groupBinding.getRoot());
|
mBindings.menuContainer.addView(groupBinding.getRoot());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void onMenuClick(MenuConfiguration.MenuItem menuItem) {
|
private void onMenuClick(MenuConfiguration.MenuItem menuItem) {
|
||||||
((MainActivity) getActivity()).setMenuItem(menuItem.getID());
|
((MainActivity) getActivity()).setMenuItem(menuItem.getID());
|
||||||
|
|||||||
@ -27,7 +27,6 @@ import it.integry.integrywmsnative.R;
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
@ -50,7 +49,6 @@ import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.FragmentPickingLiberoBinding;
|
import it.integry.integrywmsnative.databinding.FragmentPickingLiberoBinding;
|
||||||
import it.integry.integrywmsnative.gest.picking_libero.core.PickingLiberoListAdapter;
|
import it.integry.integrywmsnative.gest.picking_libero.core.PickingLiberoListAdapter;
|
||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskCliente;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskCliente;
|
||||||
@ -273,7 +271,7 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
|
|
||||||
|
|
||||||
private void executeEtichettaLU(String sscc, Dialog progressDialog) {
|
private void executeEtichettaLU(String sscc, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColtScanned -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(sscc, true, false, mtbColtScanned -> {
|
||||||
|
|
||||||
if(mtbColtScanned == null) {
|
if(mtbColtScanned == null) {
|
||||||
DialogCommon.showNoULFound(mContext, () -> {
|
DialogCommon.showNoULFound(mContext, () -> {
|
||||||
@ -561,7 +559,7 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColtToSave, value -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtToSave, value -> {
|
||||||
mtbColt.get().getMtbColr().addAll(mtbColtToSave.getMtbColr());
|
mtbColt.get().getMtbColr().addAll(mtbColtToSave.getMtbColr());
|
||||||
|
|
||||||
for(int i = 0; i < mtbColt.get().getMtbColr().size(); i++) {
|
for(int i = 0; i < mtbColt.get().getMtbColr().size(); i++) {
|
||||||
@ -628,7 +626,7 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
mtbColt.setCodVdes(vtbDest.getCodVdes());
|
mtbColt.setCodVdes(vtbDest.getCodVdes());
|
||||||
}
|
}
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, savedMtbColt -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColt, savedMtbColt -> {
|
||||||
savedMtbColt.setMtbColr(new ObservableArrayList<>());
|
savedMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
setULToCurrentContext(savedMtbColt);
|
setULToCurrentContext(savedMtbColt);
|
||||||
|
|
||||||
@ -657,7 +655,7 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
if(thereIsAnyRowInUL.get()) {
|
if(thereIsAnyRowInUL.get()) {
|
||||||
ColliMagazzinoRESTConsumer.updateDataFine(mContext, progress, this.mtbColt.get(), () -> {
|
ColliMagazzinoRESTConsumer.updateDataFineStatic(this.mtbColt.get(), () -> {
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
setULToCurrentContext(null);
|
setULToCurrentContext(null);
|
||||||
}, null);
|
}, null);
|
||||||
@ -715,7 +713,7 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
|
|||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColtClone, value -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtClone, value -> {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
mtbColt.get().getMtbColr().remove(mtbColrToDelete);
|
mtbColt.get().getMtbColr().remove(mtbColrToDelete);
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progressDialog));
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progressDialog));
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.gest.picking_resi;
|
package it.integry.integrywmsnative.gest.picking_resi;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
@ -230,7 +229,7 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
|
|||||||
|
|
||||||
|
|
||||||
Dialog finalProgress = progress;
|
Dialog finalProgress = progress;
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColt, value -> {
|
||||||
|
|
||||||
value.setDisablePrint(disablePrint);
|
value.setDisablePrint(disablePrint);
|
||||||
|
|
||||||
@ -324,7 +323,7 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
|
|||||||
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
||||||
cloneMtbColt.getMtbColr().add(mtbColr);
|
cloneMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(cloneMtbColt, value -> {
|
||||||
|
|
||||||
mtbColr
|
mtbColr
|
||||||
.setDataCollo(value.getDataColloS())
|
.setDataCollo(value.getDataColloS())
|
||||||
@ -368,9 +367,7 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
|
|||||||
MtbColt currentLU = currentMtbColt.get();
|
MtbColt currentLU = currentMtbColt.get();
|
||||||
|
|
||||||
Runnable postNoteSave = () -> {
|
Runnable postNoteSave = () -> {
|
||||||
ColliMagazzinoRESTConsumer.updateDataFine(
|
ColliMagazzinoRESTConsumer.updateDataFineStatic(
|
||||||
this,
|
|
||||||
progress,
|
|
||||||
currentLU,
|
currentLU,
|
||||||
() -> printCollo(progress, currentMtbColt.get(), onComplete),
|
() -> printCollo(progress, currentMtbColt.get(), onComplete),
|
||||||
ex -> UtilityExceptions.defaultException(this, ex, progress));
|
ex -> UtilityExceptions.defaultException(this, ex, progress));
|
||||||
@ -379,7 +376,7 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
|
|||||||
if(!UtilityString.isNullOrEmpty(noteString)) {
|
if(!UtilityString.isNullOrEmpty(noteString)) {
|
||||||
currentLU.setAnnotazioni(noteString);
|
currentLU.setAnnotazioni(noteString);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(currentLU, mtbColt -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(currentLU, mtbColt -> {
|
||||||
postNoteSave.run();
|
postNoteSave.run();
|
||||||
}, ex -> UtilityExceptions.defaultException(this, ex, progress));
|
}, ex -> UtilityExceptions.defaultException(this, ex, progress));
|
||||||
} else postNoteSave.run();
|
} else postNoteSave.run();
|
||||||
@ -428,7 +425,7 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
|
|||||||
DialogAskShouldPrint.make(this, "Packing List", shouldPrint -> {
|
DialogAskShouldPrint.make(this, "Packing List", shouldPrint -> {
|
||||||
|
|
||||||
if(shouldPrint) {
|
if(shouldPrint) {
|
||||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.PRIMARIA, printerList -> {
|
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.PRIMARIA, printerList -> {
|
||||||
|
|
||||||
if (printerList.size() > 0) {
|
if (printerList.size() > 0) {
|
||||||
try {
|
try {
|
||||||
@ -512,7 +509,7 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
|
|||||||
|
|
||||||
private void deleteCollo(Dialog progress, Runnable onComplete) {
|
private void deleteCollo(Dialog progress, Runnable onComplete) {
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.deleteCollo(currentMtbColt.get(), () -> {
|
ColliMagazzinoRESTConsumer.deleteColloStatic(currentMtbColt.get(), () -> {
|
||||||
setULToCurrentContext(null);
|
setULToCurrentContext(null);
|
||||||
|
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
|
|||||||
@ -38,7 +38,6 @@ import it.integry.integrywmsnative.databinding.FragmentProdRecuperoMaterialeBind
|
|||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.HistoryULsListAdapter;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.HistoryULsListAdapter;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.ProdRecuperoMaterialeHelper;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.ProdRecuperoMaterialeHelper;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||||
@ -110,7 +109,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private void executeEtichettaUL(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
private void executeEtichettaUL(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt != null) {
|
if(mtbColt != null) {
|
||||||
|
|
||||||
@ -295,7 +294,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
|
|
||||||
private void printCollo(Dialog progress, MtbColt mtbColtToPrint, Runnable onComplete) {
|
private void printCollo(Dialog progress, MtbColt mtbColtToPrint, Runnable onComplete) {
|
||||||
|
|
||||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.PRIMARIA, printerList -> {
|
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.PRIMARIA, printerList -> {
|
||||||
|
|
||||||
if (printerList.size() > 0) {
|
if (printerList.size() > 0) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package it.integry.integrywmsnative.gest.rettifica_giacenze.viewmodel;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
@ -434,7 +433,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
||||||
cloneMtbColt.getMtbColr().add(mtbColr);
|
cloneMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
ColliMagazzinoRESTConsumer.saveColloStatic(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
|
|
||||||
@ -560,7 +559,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
cloneMtbColt.setMtbCols(new ArrayList<>());
|
cloneMtbColt.setMtbCols(new ArrayList<>());
|
||||||
cloneMtbColt.getMtbCols().add(mtbCols);
|
cloneMtbColt.getMtbCols().add(mtbCols);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, mtbColt -> onComplete.run(), ex -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(cloneMtbColt, mtbColt -> onComplete.run(), ex -> {
|
||||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||||
DialogCommon.showRestError(mContext, ex, onComplete::run);
|
DialogCommon.showRestError(mContext, ex, onComplete::run);
|
||||||
});
|
});
|
||||||
@ -643,7 +642,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColtClone, valueNewMtbColt -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtClone, valueNewMtbColt -> {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
mtbColt.get().getMtbColr().remove(index);
|
mtbColt.get().getMtbColr().remove(index);
|
||||||
|
|
||||||
@ -683,7 +682,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColtClone, value -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtClone, value -> {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
mtbColt.get().getMtbColr().remove(mtbColrToDelete);
|
mtbColt.get().getMtbColr().remove(mtbColrToDelete);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
@ -697,7 +696,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
this.showAskPrint(shouldPrint -> {
|
this.showAskPrint(shouldPrint -> {
|
||||||
|
|
||||||
if (shouldPrint) {
|
if (shouldPrint) {
|
||||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), new ISimpleOperationCallback<List<String>>() {
|
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().userSession.depo.getCodMdep(), new ISimpleOperationCallback<List<String>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<String> value) {
|
public void onSuccess(List<String> value) {
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ public class SettingsPreferenceFragment extends PreferenceFragmentCompat impleme
|
|||||||
@Override
|
@Override
|
||||||
public void onCreatePreferences(Bundle bundle, String s) {
|
public void onCreatePreferences(Bundle bundle, String s) {
|
||||||
|
|
||||||
PrinterRESTConsumer.getAvailablePrinters(new ISimpleOperationCallback<List<String>>() {
|
PrinterRESTConsumer.getAvailablePrintersStatic(new ISimpleOperationCallback<List<String>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(final List<String> availablePrinters) {
|
public void onSuccess(final List<String> availablePrinters) {
|
||||||
initScreen(availablePrinters);
|
initScreen(availablePrinters);
|
||||||
|
|||||||
@ -402,7 +402,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
};
|
};
|
||||||
|
|
||||||
private void executeEtichettaAnonimaNotOpenedLU(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
private void executeEtichettaAnonimaNotOpenedLU(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt == null) {
|
if(mtbColt == null) {
|
||||||
|
|
||||||
@ -454,7 +454,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString("Nessuna UL trovata"), null, BarcodeManager::enable).show();
|
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString("Nessuna UL trovata"), null, BarcodeManager::enable).show();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getByTestataStatic(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
searchArtFromUL(mtbColt, progressDialog);
|
searchArtFromUL(mtbColt, progressDialog);
|
||||||
} else {
|
} else {
|
||||||
@ -491,7 +491,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
|
|
||||||
|
|
||||||
private void executeEtichettaLU(String SSCC, Dialog progressDialog) {
|
private void executeEtichettaLU(String SSCC, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
|
|
||||||
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
@ -813,7 +813,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
mtbColt.generaFiltroOrdineFromDTO(defaultFiltroOrdine);
|
mtbColt.generaFiltroOrdineFromDTO(defaultFiltroOrdine);
|
||||||
|
|
||||||
Dialog finalProgress = progress;
|
Dialog finalProgress = progress;
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColt, value -> {
|
||||||
|
|
||||||
mtbColt
|
mtbColt
|
||||||
.setNumCollo(value.getNumCollo())
|
.setNumCollo(value.getNumCollo())
|
||||||
@ -858,13 +858,11 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
|
|
||||||
final MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
final MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.canLUBeDeleted(currentMtbColt, canBeDeleted -> {
|
ColliMagazzinoRESTConsumer.canLUBeDeletedStatic(currentMtbColt, canBeDeleted -> {
|
||||||
|
|
||||||
if(!canBeDeleted) {
|
if(!canBeDeleted) {
|
||||||
Runnable saveAction = () -> {
|
Runnable saveAction = () -> {
|
||||||
ColliMagazzinoRESTConsumer.updateDataFine(
|
ColliMagazzinoRESTConsumer.updateDataFineStatic(
|
||||||
mActivity,
|
|
||||||
progress,
|
|
||||||
currentMtbColt,
|
currentMtbColt,
|
||||||
() -> distribuisciCollo(progress, (generatedMtbColts) -> {
|
() -> distribuisciCollo(progress, (generatedMtbColts) -> {
|
||||||
if(shouldPrint) printCollo(progress, generatedMtbColts, onComplete);
|
if(shouldPrint) printCollo(progress, generatedMtbColts, onComplete);
|
||||||
@ -911,13 +909,11 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
|
|
||||||
IOrdiniVendita ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA);
|
IOrdiniVendita ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA);
|
||||||
|
|
||||||
ordiniVendita.distribuisciCollo(progress, cloneMtbColt, mTestateOrdini, mtbColts -> {
|
ordiniVendita.distribuisciCollo(cloneMtbColt, mTestateOrdini, mtbColts -> {
|
||||||
|
|
||||||
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.getMultipleByTestate(mtbColts, true, mtbColtsReloaded -> {
|
ColliMagazzinoRESTConsumer.getMultipleByTestateStatic(mtbColts, true, onComplete::run, ex -> {
|
||||||
onComplete.run(mtbColtsReloaded);
|
|
||||||
}, ex -> {
|
|
||||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -930,7 +926,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
DialogAskShouldPrint.make(mActivity, "Packing List", shouldPrint -> {
|
DialogAskShouldPrint.make(mActivity, "Packing List", shouldPrint -> {
|
||||||
|
|
||||||
if(shouldPrint) {
|
if(shouldPrint) {
|
||||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.PRIMARIA, value -> {
|
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.PRIMARIA, value -> {
|
||||||
|
|
||||||
if (value.size() > 0) {
|
if (value.size() > 0) {
|
||||||
try {
|
try {
|
||||||
@ -979,22 +975,22 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ReportManager.getRightReportNameByGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
ReportManager.getRightReportNameByGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
||||||
|
|
||||||
PrinterRESTConsumer.printCollo(
|
PrinterRESTConsumer.printCollo(
|
||||||
printerName,
|
printerName,
|
||||||
mtbColtToPrint,
|
mtbColtToPrint,
|
||||||
1,
|
1,
|
||||||
reportName, onComplete, onAbort);
|
reportName, onComplete, onFailed);
|
||||||
|
|
||||||
}, onAbort);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void deleteCollo(Dialog progress, Runnable onComplete) {
|
private void deleteCollo(Dialog progress, Runnable onComplete) {
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.deleteCollo(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
|
ColliMagazzinoRESTConsumer.deleteColloStatic(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
|
||||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||||
|
|
||||||
isFabVisible.set(true);
|
isFabVisible.set(true);
|
||||||
@ -1326,7 +1322,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
|
|
||||||
|
|
||||||
private void onOrdineRowSave(PickingObjectDTOOld item, MtbColt cloneMtbColt, boolean closeUL, boolean hasTipoCollo, Dialog progress) {
|
private void onOrdineRowSave(PickingObjectDTOOld item, MtbColt cloneMtbColt, boolean closeUL, boolean hasTipoCollo, Dialog progress) {
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(cloneMtbColt, value -> {
|
||||||
|
|
||||||
MtbColr mtbColr = cloneMtbColt.getMtbColr().get(0);
|
MtbColr mtbColr = cloneMtbColt.getMtbColr().get(0);
|
||||||
|
|
||||||
@ -1446,7 +1442,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
||||||
cloneMtbColt.getMtbColr().add(mtbColr);
|
cloneMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(cloneMtbColt, value -> {
|
||||||
|
|
||||||
mtbColr
|
mtbColr
|
||||||
.setDataCollo(value.getDataColloS())
|
.setDataCollo(value.getDataColloS())
|
||||||
|
|||||||
@ -7,18 +7,14 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.zxing.BarcodeFormat;
|
|
||||||
import com.google.zxing.Result;
|
|
||||||
import com.kroegerama.kaiteki.bcode.BarcodeResultListener;
|
|
||||||
import com.kroegerama.kaiteki.bcode.ui.BarcodeBottomSheet;
|
|
||||||
import com.tfb.fbtoast.FBToast;
|
import com.tfb.fbtoast.FBToast;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@ -34,14 +30,17 @@ import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
|||||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.AtomicBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.ActivitySpedizioneBinding;
|
import it.integry.integrywmsnative.databinding.ActivitySpedizioneBinding;
|
||||||
@ -49,25 +48,34 @@ import it.integry.integrywmsnative.gest.spedizione_new.core.SpedizioneListAdapte
|
|||||||
import it.integry.integrywmsnative.gest.spedizione_new.core.SpedizioneListModel;
|
import it.integry.integrywmsnative.gest.spedizione_new.core.SpedizioneListModel;
|
||||||
import it.integry.integrywmsnative.gest.spedizione_new.model.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.spedizione_new.model.PickingObjectDTO;
|
||||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
||||||
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||||
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.exceptions.BottomSheetFragmentViewNotInitializedException;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_should_print.DialogAskShouldPrint;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||||
import it.integry.integrywmsnative.view.dialogs.camera_barcode_reader.DialogCameraBarcodeReader;
|
import it.integry.integrywmsnative.view.dialogs.camera_barcode_reader.DialogCameraBarcodeReader;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_peso_lu.DialogInputPeso;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ResultDTO;
|
||||||
|
|
||||||
public class SpedizioneActivity extends AppCompatActivity implements SpedizioneViewModel.Listeners, BarcodeResultListener {
|
public class SpedizioneActivity extends AppCompatActivity implements SpedizioneViewModel.Listeners, BottomSheetFragmentLUContentViewModel.Listener {
|
||||||
|
|
||||||
private ActivitySpedizioneBinding mBindings;
|
private ActivitySpedizioneBinding mBindings;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
SpedizioneViewModel mViewmodel;
|
SpedizioneViewModel mViewmodel;
|
||||||
|
|
||||||
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
private ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList();
|
private ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList();
|
||||||
|
|
||||||
|
|
||||||
public BindableBoolean addExtraItemsEnabled = new BindableBoolean(false);
|
public BindableBoolean addExtraItemsEnabled = new BindableBoolean(false);
|
||||||
public BindableBoolean noItemsToPick = new BindableBoolean(false);
|
public BindableBoolean noItemsToPick = new BindableBoolean(false);
|
||||||
public BindableBoolean noLUPresent = new BindableBoolean(true);
|
public BindableBoolean noLUPresent = new BindableBoolean(true);
|
||||||
|
public BindableBoolean bottomSheetEnabled = new BindableBoolean(false);
|
||||||
|
|
||||||
private boolean mEnableGiacenza;
|
private boolean mEnableGiacenza;
|
||||||
private boolean mFlagShowCodForn;
|
private boolean mFlagShowCodForn;
|
||||||
@ -78,6 +86,7 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
private ArrayList<MtbColt> mColliRegistrati;
|
private ArrayList<MtbColt> mColliRegistrati;
|
||||||
|
|
||||||
private Dialog mCurrentProgress;
|
private Dialog mCurrentProgress;
|
||||||
|
private boolean mShouldCloseActivity;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -96,7 +105,7 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
|
|
||||||
spedizioneComponent.inject(this);
|
spedizioneComponent.inject(this);
|
||||||
|
|
||||||
mViewmodel.addListeners(this);
|
mViewmodel.setListeners(this);
|
||||||
|
|
||||||
setSupportActionBar(mBindings.toolbar);
|
setSupportActionBar(mBindings.toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
@ -107,6 +116,12 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
mBindings.setLifecycleOwner(this);
|
mBindings.setLifecycleOwner(this);
|
||||||
mBindings.setSpedizioneView(this);
|
mBindings.setSpedizioneView(this);
|
||||||
|
|
||||||
|
mBindings.bottomSheetLuContent.init(mBindings.bottomSheetLuContent);
|
||||||
|
mBottomSheetFragmentLUContentViewModel = mBindings.bottomSheetLuContent.getViewModelInstance();
|
||||||
|
mBottomSheetFragmentLUContentViewModel.setListener(this);
|
||||||
|
|
||||||
|
|
||||||
|
this.initVars();
|
||||||
this.initBarcodeReader();
|
this.initBarcodeReader();
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
|
||||||
@ -115,9 +130,10 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
mEnableGiacenza = !SettingsManager.iDB().isFlagSpedizioneEnableFakeGiacenza();
|
mEnableGiacenza = !SettingsManager.iDB().isFlagSpedizioneEnableFakeGiacenza();
|
||||||
boolean enableCheckPartitaMag = SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV();
|
boolean enableCheckPartitaMag = SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV();
|
||||||
boolean canOverflowOrderQuantity = SettingsManager.iDB().isFlagCanAddExtraQuantitySpedizione();
|
boolean canOverflowOrderQuantity = SettingsManager.iDB().isFlagCanAddExtraQuantitySpedizione();
|
||||||
|
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
||||||
|
|
||||||
if (mEnableGiacenza) mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
if (mEnableGiacenza) mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
||||||
mViewmodel.init(codMdep, mEnableGiacenza, enableCheckPartitaMag, mSitArtOrd, mTestateOrdini, canOverflowOrderQuantity);
|
mViewmodel.init(codMdep, mEnableGiacenza, enableCheckPartitaMag, shouldAskPesoLU, canOverflowOrderQuantity, mSitArtOrd, mTestateOrdini, mColliRegistrati);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -126,6 +142,27 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
|
||||||
|
if (this.mBindings.bottomSheetLuContent.isExpanded()) {
|
||||||
|
this.mBindings.bottomSheetLuContent.collapse();
|
||||||
|
} else if (!noLUPresent.get()) {
|
||||||
|
this.mShouldCloseActivity = true;
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
this.mViewmodel.closeLU(true);
|
||||||
|
} else {
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initVars() {
|
||||||
|
this.noLUPresent.addOnPropertyChangedCallback(() -> {
|
||||||
|
this.bottomSheetEnabled.set(!this.noLUPresent.get());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void initBarcodeReader() {
|
private void initBarcodeReader() {
|
||||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
.setOnScanSuccessfull(onScanSuccessful)
|
.setOnScanSuccessfull(onScanSuccessful)
|
||||||
@ -144,7 +181,7 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
this.mBindings.spedizionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
this.mBindings.spedizionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
spedizioneListAdapter.setOnItemClicked(clickedItem -> {
|
spedizioneListAdapter.setOnItemClicked(clickedItem -> {
|
||||||
if (!noLUPresent.get() && SettingsManager.iDB().isFlagSpedizioneEnableManualPick()) {
|
if (!noLUPresent.get() && SettingsManager.iDB().isFlagSpedizioneEnableManualPick() && clickedItem.getSitArtOrdDTO().isFlagEnablePickManuale()) {
|
||||||
this.mViewmodel.dispatchOrdineRow(clickedItem);
|
this.mViewmodel.dispatchOrdineRow(clickedItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -187,14 +224,27 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
|
|
||||||
spedizioneListModel.setActive(!mEnableGiacenza || anyLUPresent);
|
spedizioneListModel.setActive(!mEnableGiacenza || anyLUPresent);
|
||||||
|
|
||||||
|
|
||||||
|
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
||||||
|
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal();
|
||||||
|
|
||||||
|
Stream.of(x.getWithdrawMtbColr())
|
||||||
|
.forEach(row -> {
|
||||||
|
numCnfWithdrawRows.addAndGet(row.getNumCnf());
|
||||||
|
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
if (!anyLUPresent) {
|
if (!anyLUPresent) {
|
||||||
spedizioneListModel.setGroupTitle(mEnableGiacenza ? getString(R.string.picking_not_available) : "");
|
spedizioneListModel.setGroupTitle(mEnableGiacenza ? getString(R.string.picking_not_available) : "");
|
||||||
|
|
||||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
spedizioneListModel.setUntMis("col");
|
spedizioneListModel.setUntMis("col");
|
||||||
spedizioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfOrd());
|
spedizioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfOrd());
|
||||||
|
spedizioneListModel.setQtaEvasa(numCnfWithdrawRows.getBigDecimalValue());
|
||||||
} else {
|
} else {
|
||||||
spedizioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaOrd());
|
spedizioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaOrd());
|
||||||
|
spedizioneListModel.setQtaEvasa(qtaColWithdrawRows.getBigDecimalValue());
|
||||||
if (x.getMtbAart() != null)
|
if (x.getMtbAart() != null)
|
||||||
spedizioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
spedizioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||||
}
|
}
|
||||||
@ -219,8 +269,10 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
cloneModel.setUntMis("col");
|
cloneModel.setUntMis("col");
|
||||||
cloneModel.setQtaTot(mtbColrToDispatch != null ? mtbColrToDispatch.getNumCnf() : x.getSitArtOrdDTO().getNumCnfOrd());
|
cloneModel.setQtaTot(mtbColrToDispatch != null ? mtbColrToDispatch.getNumCnf() : x.getSitArtOrdDTO().getNumCnfOrd());
|
||||||
|
cloneModel.setQtaEvasa(numCnfWithdrawRows.getBigDecimalValue());
|
||||||
} else {
|
} else {
|
||||||
cloneModel.setQtaTot(mtbColrToDispatch != null ? mtbColrToDispatch.getQtaCol() : x.getSitArtOrdDTO().getQtaOrd());
|
cloneModel.setQtaTot(mtbColrToDispatch != null ? mtbColrToDispatch.getQtaCol() : x.getSitArtOrdDTO().getQtaOrd());
|
||||||
|
cloneModel.setQtaEvasa(qtaColWithdrawRows.getBigDecimalValue());
|
||||||
if (x.getMtbAart() != null)
|
if (x.getMtbAart() != null)
|
||||||
cloneModel.setUntMis(x.getMtbAart().getUntMis());
|
cloneModel.setUntMis(x.getMtbAart().getUntMis());
|
||||||
}
|
}
|
||||||
@ -258,6 +310,7 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
.anyMatch(x -> !x.isHidden());
|
.anyMatch(x -> !x.isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
|
|
||||||
@ -294,6 +347,8 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
|
|
||||||
|
|
||||||
public void createNewUL() {
|
public void createNewUL() {
|
||||||
|
this.mBindings.spedizioneFab.close(true);
|
||||||
|
|
||||||
mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
||||||
|
|
||||||
this.mViewmodel.createNewLU(null, null, () -> {
|
this.mViewmodel.createNewLU(null, null, () -> {
|
||||||
@ -303,7 +358,7 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showCreatedUL() {
|
public void showCreatedUL() {
|
||||||
|
this.mBindings.spedizioneFab.close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -319,11 +374,54 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
public void onLUCreated(MtbColt mtbColt) {
|
public void onLUCreated(MtbColt mtbColt) {
|
||||||
noLUPresent.set(false);
|
noLUPresent.set(false);
|
||||||
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
|
|
||||||
|
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLUClosing() {
|
||||||
|
mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUClosed() {
|
public void onLUClosed() {
|
||||||
|
if (mCurrentProgress != null) {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
|
|
||||||
noLUPresent.set(true);
|
noLUPresent.set(true);
|
||||||
|
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||||
|
|
||||||
|
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLUPositionRequired(RunnableArgs<MtbDepoPosizione> onComplete) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLUPesoRequired(String codTcol, BigDecimal netWeightKG, BigDecimal grossWeightKG, RunnableArgsss<String, BigDecimal, BigDecimal> onComplete) {
|
||||||
|
DialogInputPeso.make(this, codTcol, netWeightKG, grossWeightKG, (newCodTcol, newNetWeight, newGrossWeight) -> {
|
||||||
|
onComplete.run(newCodTcol, netWeightKG, grossWeightKG);
|
||||||
|
}).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLUPrintRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
|
DialogAskShouldPrint.make(this, "Packing List", onComplete).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
|
DialogSimpleMessageHelper.makeErrorDialog(
|
||||||
|
this,
|
||||||
|
new SpannableString(ex.getMessage()),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
R.string.button_ignore_print,
|
||||||
|
onComplete).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -340,12 +438,17 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
|
if (mCurrentProgress != null) {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
|
|
||||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemDispatched(MtbAart mtbAart,
|
public void onItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||||
BigDecimal totalQtaOrd,
|
BigDecimal totalQtaOrd,
|
||||||
BigDecimal totalNumCnfOrd,
|
BigDecimal totalNumCnfOrd,
|
||||||
BigDecimal qtaCnfOrd,
|
BigDecimal qtaCnfOrd,
|
||||||
@ -355,9 +458,11 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
BigDecimal totalQtaAvailable,
|
BigDecimal totalQtaAvailable,
|
||||||
BigDecimal totalNumCnfAvailable,
|
BigDecimal totalNumCnfAvailable,
|
||||||
BigDecimal qtaCnfAvailable,
|
BigDecimal qtaCnfAvailable,
|
||||||
|
String partitaMag,
|
||||||
|
Date dataScad,
|
||||||
boolean canOverflowOrderQuantity) {
|
boolean canOverflowOrderQuantity) {
|
||||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||||
.setMtbAart(mtbAart)
|
.setMtbAart(pickingObjectDTO.getMtbAart())
|
||||||
.setTotalQtaOrd(totalQtaOrd)
|
.setTotalQtaOrd(totalQtaOrd)
|
||||||
.setTotalNumCnfOrd(totalNumCnfOrd)
|
.setTotalNumCnfOrd(totalNumCnfOrd)
|
||||||
.setQtaCnfOrd(qtaCnfOrd)
|
.setQtaCnfOrd(qtaCnfOrd)
|
||||||
@ -367,22 +472,41 @@ public class SpedizioneActivity extends AppCompatActivity implements SpedizioneV
|
|||||||
.setTotalQtaAvailable(totalQtaAvailable)
|
.setTotalQtaAvailable(totalQtaAvailable)
|
||||||
.setTotalNumCnfAvailable(totalNumCnfAvailable)
|
.setTotalNumCnfAvailable(totalNumCnfAvailable)
|
||||||
.setQtaCnfAvailable(qtaCnfAvailable)
|
.setQtaCnfAvailable(qtaCnfAvailable)
|
||||||
|
.setPartitaMag(partitaMag)
|
||||||
|
.setDataScad(dataScad)
|
||||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity);
|
.setCanOverflowOrderQuantity(canOverflowOrderQuantity);
|
||||||
|
|
||||||
DialogInputQuantityV2
|
DialogInputQuantityV2
|
||||||
.newInstance(dialogInputQuantityV2DTO)
|
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> this.onDialogInputQuantityResult(pickingObjectDTO, resultDTO, shouldCloseLU))
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void onDialogInputQuantityResult(PickingObjectDTO pickingObjectDTO, DialogInputQuantityV2ResultDTO resultDTO, boolean shouldCloseLU) {
|
||||||
public boolean onBarcodeResult(@NotNull Result result) {
|
mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
||||||
String a = "";
|
|
||||||
|
|
||||||
return true;
|
this.mViewmodel.saveRow(
|
||||||
|
pickingObjectDTO,
|
||||||
|
resultDTO.getNumCnf(),
|
||||||
|
resultDTO.getQtaCnf(),
|
||||||
|
resultDTO.getQtaTot(),
|
||||||
|
resultDTO.getPartitaMag(),
|
||||||
|
resultDTO.getDataScad(),
|
||||||
|
shouldCloseLU
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBarcodeScanCancelled() {
|
public void onRowSaved() {
|
||||||
|
if (mCurrentProgress != null) {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBottomSheetLUClose() {
|
||||||
|
this.mViewmodel.closeLU(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,15 +6,24 @@ import dagger.Module;
|
|||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
import it.integry.integrywmsnative.MainApplicationModule;
|
import it.integry.integrywmsnative.MainApplicationModule;
|
||||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
@Module(includes = {MainApplicationModule.class})
|
@Module(includes = {MainApplicationModule.class})
|
||||||
public class SpedizioneModule {
|
public class SpedizioneModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
SpedizioneViewModel providesSpedizioneViewModel(ColliDataRecoverService colliDataRecoverService, OrdiniRESTConsumer ordiniRESTConsumer) {
|
BottomSheetFragmentLUContentViewModel providesBottomSheetFragmentLUContentViewModel() {
|
||||||
return new SpedizioneViewModel(colliDataRecoverService, ordiniRESTConsumer);
|
return new BottomSheetFragmentLUContentViewModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
SpedizioneViewModel providesSpedizioneViewModel(ColliDataRecoverService colliDataRecoverService, OrdiniRESTConsumer ordiniRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, PrinterRESTConsumer printerRESTConsumer) {
|
||||||
|
return new SpedizioneViewModel(colliDataRecoverService, ordiniRESTConsumer, colliMagazzinoRESTConsumer, printerRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,17 @@
|
|||||||
package it.integry.integrywmsnative.gest.spedizione_new;
|
package it.integry.integrywmsnative.gest.spedizione_new;
|
||||||
|
|
||||||
import android.os.Handler;
|
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@ -18,9 +19,12 @@ import javax.inject.Inject;
|
|||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
|
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||||
|
import it.integry.integrywmsnative.core.class_router.interfaces.IOrdiniVendita;
|
||||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||||
import it.integry.integrywmsnative.core.expansion.AtomicBigDecimal;
|
import it.integry.integrywmsnative.core.expansion.AtomicBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||||
import it.integry.integrywmsnative.core.model.FiltroOrdineDTO;
|
import it.integry.integrywmsnative.core.model.FiltroOrdineDTO;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
@ -29,18 +33,22 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.spedizione_new.exceptions.CurrentMonoLUPositionIsNotCorrectException;
|
import it.integry.integrywmsnative.gest.spedizione_new.exceptions.CurrentMonoLUPositionIsNotCorrectException;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione_new.exceptions.NoPrintersFoundException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione_new.exceptions.OrdersLoadException;
|
import it.integry.integrywmsnative.gest.spedizione_new.exceptions.OrdersLoadException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione_new.exceptions.NoArtsFoundException;
|
import it.integry.integrywmsnative.gest.spedizione_new.exceptions.NoArtsFoundException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione_new.exceptions.NoLUFoundException;
|
import it.integry.integrywmsnative.gest.spedizione_new.exceptions.NoLUFoundException;
|
||||||
@ -56,8 +64,9 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
private List<OrdineVenditaInevasoDTO> mTestateOrdini;
|
private List<OrdineVenditaInevasoDTO> mTestateOrdini;
|
||||||
private MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
private MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
||||||
|
private List<MtbColt> mColliRegistrati = new ArrayList<>();
|
||||||
|
|
||||||
private List<Listeners> mListeners = new ArrayList<>();
|
private Listeners mListeners;
|
||||||
|
|
||||||
private GestioneEnum mDefaultGestioneOfUL = null;
|
private GestioneEnum mDefaultGestioneOfUL = null;
|
||||||
private String mDefaultCodMdep = null;
|
private String mDefaultCodMdep = null;
|
||||||
@ -72,26 +81,43 @@ public class SpedizioneViewModel {
|
|||||||
private boolean mEnableGiacenza;
|
private boolean mEnableGiacenza;
|
||||||
private boolean mEnableCheckPartitaMag;
|
private boolean mEnableCheckPartitaMag;
|
||||||
private boolean mCanOverflowOrderQuantity;
|
private boolean mCanOverflowOrderQuantity;
|
||||||
|
private boolean mShouldAskPesoLU;
|
||||||
|
|
||||||
private MtbColt mCurrentMtbColt = null;
|
private MtbColt mCurrentMtbColt = null;
|
||||||
|
|
||||||
private Integer mMtbColtSessionID;
|
private Integer mMtbColtSessionID;
|
||||||
private final ColliDataRecoverService mColliDataRecoverService;
|
private final ColliDataRecoverService mColliDataRecoverService;
|
||||||
private final OrdiniRESTConsumer mOrdiniRestConsumerService;
|
private final OrdiniRESTConsumer mOrdiniRestConsumerService;
|
||||||
|
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||||
|
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SpedizioneViewModel(ColliDataRecoverService colliDataRecoverService, OrdiniRESTConsumer ordiniRESTConsumer) {
|
public SpedizioneViewModel(ColliDataRecoverService colliDataRecoverService,
|
||||||
|
OrdiniRESTConsumer ordiniRESTConsumer,
|
||||||
|
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||||
|
PrinterRESTConsumer printerRESTConsumer) {
|
||||||
this.mColliDataRecoverService = colliDataRecoverService;
|
this.mColliDataRecoverService = colliDataRecoverService;
|
||||||
this.mOrdiniRestConsumerService = ordiniRESTConsumer;
|
this.mOrdiniRestConsumerService = ordiniRESTConsumer;
|
||||||
|
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||||
|
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void init(String codMdep, boolean enableGiacenza, boolean enableCheckPartitaMag, List<SitArtOrdDTO> pickingList, List<OrdineVenditaInevasoDTO> testateOrdini, boolean canOverflowOrderQuantity) {
|
public void init(String codMdep,
|
||||||
|
boolean enableGiacenza,
|
||||||
|
boolean enableCheckPartitaMag,
|
||||||
|
boolean shouldAskPesoLU,
|
||||||
|
boolean canOverflowOrderQuantity,
|
||||||
|
List<SitArtOrdDTO> pickingList,
|
||||||
|
List<OrdineVenditaInevasoDTO> testateOrdini,
|
||||||
|
List<MtbColt> colliRegistrati) {
|
||||||
this.mDefaultCodMdep = codMdep;
|
this.mDefaultCodMdep = codMdep;
|
||||||
this.mTestateOrdini = testateOrdini;
|
this.mTestateOrdini = testateOrdini;
|
||||||
|
this.mColliRegistrati = colliRegistrati;
|
||||||
this.mEnableGiacenza = enableGiacenza;
|
this.mEnableGiacenza = enableGiacenza;
|
||||||
this.mEnableCheckPartitaMag = enableCheckPartitaMag;
|
this.mEnableCheckPartitaMag = enableCheckPartitaMag;
|
||||||
this.mCanOverflowOrderQuantity = canOverflowOrderQuantity;
|
this.mCanOverflowOrderQuantity = canOverflowOrderQuantity;
|
||||||
|
this.mShouldAskPesoLU = shouldAskPesoLU;
|
||||||
|
|
||||||
if (enableGiacenza) {
|
if (enableGiacenza) {
|
||||||
mOrdiniRestConsumerService.getSuggestedPickingList(this.mDefaultCodMdep, pickingList, pickingObjectList -> {
|
mOrdiniRestConsumerService.getSuggestedPickingList(this.mDefaultCodMdep, pickingList, pickingObjectList -> {
|
||||||
@ -132,11 +158,7 @@ public class SpedizioneViewModel {
|
|||||||
})
|
})
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
new Handler()
|
|
||||||
.postDelayed(() -> {
|
|
||||||
onComplete.run(pickingList);
|
onComplete.run(pickingList);
|
||||||
}, 1);
|
|
||||||
// onComplete.run(pickingList);
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,30 +266,46 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
|
|
||||||
private void sendDatasetLoaded() {
|
private void sendDatasetLoaded() {
|
||||||
for (Listeners listener : mListeners) listener.onDatasetLoaded();
|
if(this.mListeners != null) mListeners.onDatasetLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendError(Exception ex) {
|
private void sendError(Exception ex) {
|
||||||
for (Listeners listener : mListeners) listener.onError(ex);
|
if(this.mListeners != null) mListeners.onError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendLUCreated(MtbColt mtbColt) {
|
private void sendLUCreated(MtbColt mtbColt) {
|
||||||
for (Listeners listener : mListeners) listener.onLUCreated(mtbColt);
|
if(this.mListeners != null) mListeners.onLUCreated(mtbColt);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendLUPesoRequired(String codTcol, BigDecimal netWeightKG, BigDecimal grossWeightKG, RunnableArgsss<String, BigDecimal, BigDecimal> onComplete) {
|
||||||
|
if(this.mListeners != null) mListeners.onLUPesoRequired(codTcol, netWeightKG, grossWeightKG, onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendLUPrintRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
|
if(this.mListeners != null) mListeners.onLUPrintRequest(onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
|
if(this.mListeners != null) mListeners.onLUPrintError(ex, onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendLUClosing() {
|
||||||
|
if(this.mListeners != null) mListeners.onLUClosing();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendLUClosed() {
|
private void sendLUClosed() {
|
||||||
for (Listeners listener : mListeners) listener.onLUClosed();
|
if(this.mListeners != null) mListeners.onLUClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendFilterApplied(String newValue) {
|
private void sendFilterApplied(String newValue) {
|
||||||
for (Listeners listener : mListeners) listener.onFilterApplied(newValue);
|
if(this.mListeners != null) mListeners.onFilterApplied(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendFilterRemoved() {
|
private void sendFilterRemoved() {
|
||||||
for (Listeners listener : mListeners) listener.onFilterRemoved();
|
if(this.mListeners != null) mListeners.onFilterRemoved();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendOnItemDispatched(MtbAart mtbAart,
|
private void sendOnItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||||
BigDecimal totalQtaOrd,
|
BigDecimal totalQtaOrd,
|
||||||
BigDecimal totalNumCnfOrd,
|
BigDecimal totalNumCnfOrd,
|
||||||
BigDecimal qtaCnfOrd,
|
BigDecimal qtaCnfOrd,
|
||||||
@ -277,9 +315,26 @@ public class SpedizioneViewModel {
|
|||||||
BigDecimal totalQtaAvailable,
|
BigDecimal totalQtaAvailable,
|
||||||
BigDecimal totalNumCnfAvailable,
|
BigDecimal totalNumCnfAvailable,
|
||||||
BigDecimal qtaCnfAvailable,
|
BigDecimal qtaCnfAvailable,
|
||||||
|
String partitaMag,
|
||||||
|
Date dataScad,
|
||||||
boolean canOverflowOrderQuantity) {
|
boolean canOverflowOrderQuantity) {
|
||||||
for (Listeners listener : mListeners)
|
if(this.mListeners != null) mListeners.onItemDispatched(pickingObjectDTO,
|
||||||
listener.onItemDispatched(mtbAart, totalQtaOrd, totalNumCnfOrd, qtaCnfOrd, totalQtaToBeTaken, totalNumCnfToBeTaken, qtaCnfToBeTaken, totalQtaAvailable, totalNumCnfAvailable, qtaCnfAvailable, canOverflowOrderQuantity);
|
totalQtaOrd,
|
||||||
|
totalNumCnfOrd,
|
||||||
|
qtaCnfOrd,
|
||||||
|
totalQtaToBeTaken,
|
||||||
|
totalNumCnfToBeTaken,
|
||||||
|
qtaCnfToBeTaken,
|
||||||
|
totalQtaAvailable,
|
||||||
|
totalNumCnfAvailable,
|
||||||
|
qtaCnfAvailable,
|
||||||
|
partitaMag,
|
||||||
|
dataScad,
|
||||||
|
canOverflowOrderQuantity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnRowSaved() {
|
||||||
|
if(this.mListeners != null) mListeners.onRowSaved();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
@ -339,7 +394,7 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
|
|
||||||
private void executeEtichettaAnonimaNotOpenedLU(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
private void executeEtichettaAnonimaNotOpenedLU(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
||||||
|
|
||||||
if (mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
|
|
||||||
@ -376,7 +431,7 @@ public class SpedizioneViewModel {
|
|||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
searchArtFromUL(mtbColt, onComplete);
|
searchArtFromUL(mtbColt, onComplete);
|
||||||
} else {
|
} else {
|
||||||
@ -401,7 +456,7 @@ public class SpedizioneViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void executeEtichettaLU(String SSCC, Runnable onComplete) {
|
private void executeEtichettaLU(String SSCC, Runnable onComplete) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
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) {
|
||||||
searchArtFromUL(mtbColt, onComplete);
|
searchArtFromUL(mtbColt, onComplete);
|
||||||
@ -604,6 +659,9 @@ public class SpedizioneViewModel {
|
|||||||
BigDecimal totalNumCnfAvailable = null;
|
BigDecimal totalNumCnfAvailable = null;
|
||||||
BigDecimal qtaCnfAvailable = null;
|
BigDecimal qtaCnfAvailable = null;
|
||||||
|
|
||||||
|
String partitaMag = null;
|
||||||
|
Date dataScad = null;
|
||||||
|
|
||||||
|
|
||||||
//TODO: Al posto di prelevare la prima riga bisognerebbe controllare se c'è ne una che corrisponde con la partita richiesta
|
//TODO: Al posto di prelevare la prima riga bisognerebbe controllare se c'è ne una che corrisponde con la partita richiesta
|
||||||
MtbColr mtbColrToDispatch = pickingObjectDTO.getTempPickData() != null &&
|
MtbColr mtbColrToDispatch = pickingObjectDTO.getTempPickData() != null &&
|
||||||
@ -636,6 +694,9 @@ public class SpedizioneViewModel {
|
|||||||
if (UtilityBigDecimal.lowerThan(qtaColDaPrelevare, BigDecimal.ZERO))
|
if (UtilityBigDecimal.lowerThan(qtaColDaPrelevare, BigDecimal.ZERO))
|
||||||
qtaColDaPrelevare = BigDecimal.ZERO;
|
qtaColDaPrelevare = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
partitaMag = mtbColrToDispatch.getPartitaMag();
|
||||||
|
dataScad = mtbColrToDispatch.getDataScadPartitaD();
|
||||||
|
|
||||||
} else if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
} else if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
||||||
//Oppure le info del barcode scansionato
|
//Oppure le info del barcode scansionato
|
||||||
PickDataDTO.ManualPickDTO manualPickDTO = pickingObjectDTO.getTempPickData().getManualPickDTO();
|
PickDataDTO.ManualPickDTO manualPickDTO = pickingObjectDTO.getTempPickData().getManualPickDTO();
|
||||||
@ -659,19 +720,25 @@ public class SpedizioneViewModel {
|
|||||||
qtaColDaPrelevare = UtilityBigDecimal.multiply(numCnfDaPrelevare, qtaCnfDaPrelevare);
|
qtaColDaPrelevare = UtilityBigDecimal.multiply(numCnfDaPrelevare, qtaCnfDaPrelevare);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (manualPickDTO.getMtbPartitaMag() != null) {
|
||||||
|
partitaMag = manualPickDTO.getMtbPartitaMag().getPartitaMag();
|
||||||
|
dataScad = manualPickDTO.getMtbPartitaMag().getDataScadD();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendOnItemDispatched(
|
this.sendOnItemDispatched(
|
||||||
pickingObjectDTO.getMtbAart(),
|
pickingObjectDTO,
|
||||||
totalQtaOrd,
|
qtaDaEvadere,
|
||||||
totalNumCnfOrd,
|
numCnfDaEvadere,
|
||||||
qtaCnfOrd,
|
qtaCnfDaEvadere,
|
||||||
qtaColDaPrelevare,
|
qtaColDaPrelevare,
|
||||||
numCnfDaPrelevare,
|
numCnfDaPrelevare,
|
||||||
qtaCnfDaPrelevare,
|
qtaCnfDaPrelevare,
|
||||||
totalQtaAvailable,
|
totalQtaAvailable,
|
||||||
totalNumCnfAvailable,
|
totalNumCnfAvailable,
|
||||||
qtaCnfAvailable,
|
qtaCnfAvailable,
|
||||||
|
partitaMag,
|
||||||
|
dataScad,
|
||||||
mCanOverflowOrderQuantity);
|
mCanOverflowOrderQuantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -696,7 +763,7 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
mtbColt.generaFiltroOrdineFromDTO(mDefaultFiltroOrdine);
|
mtbColt.generaFiltroOrdineFromDTO(mDefaultFiltroOrdine);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
mColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
||||||
mtbColt
|
mtbColt
|
||||||
.setNumCollo(value.getNumCollo())
|
.setNumCollo(value.getNumCollo())
|
||||||
.setDataCollo(value.getDataColloS())
|
.setDataCollo(value.getDataColloS())
|
||||||
@ -712,6 +779,241 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void saveRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||||
|
final MtbColr mtbColr = new MtbColr()
|
||||||
|
.setCodMart(pickingObjectDTO.getSitArtOrdDTO().getCodMart())
|
||||||
|
.setPartitaMag(partitaMag)
|
||||||
|
.setQtaCol(qtaTot)
|
||||||
|
.setQtaCnf(qtaCnf)
|
||||||
|
.setNumCnf(numCnf)
|
||||||
|
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
||||||
|
.setDatetimeRow(UtilityDate.getDateInstance());
|
||||||
|
|
||||||
|
//TODO: Al posto di prelevare la prima riga bisognerebbe controllare se c'è ne una che corrisponde con la partita richiesta
|
||||||
|
MtbColr mtbColrToDispatch = pickingObjectDTO.getTempPickData() != null &&
|
||||||
|
pickingObjectDTO.getTempPickData().getSourceMtbColt() != null &&
|
||||||
|
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr() != null &&
|
||||||
|
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().size() > 0 ?
|
||||||
|
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null;
|
||||||
|
|
||||||
|
if (mtbColrToDispatch != null) {
|
||||||
|
mtbColr
|
||||||
|
.setCodJcom(UtilityString.empty2null(mtbColrToDispatch.getCodJcom()))
|
||||||
|
.setSerColloRif(UtilityString.empty2null(mtbColrToDispatch.getSerCollo()))
|
||||||
|
.setNumColloRif(mtbColrToDispatch.getNumCollo())
|
||||||
|
.setGestioneRif(UtilityString.empty2null(mtbColrToDispatch.getGestione()))
|
||||||
|
.setDataColloRif(UtilityString.empty2null(mtbColrToDispatch.getDataColloS()));
|
||||||
|
|
||||||
|
if (mCurrentMtbColt.getCodTcol() == null &&
|
||||||
|
mCurrentMtbColt.getPesoKg() == null &&
|
||||||
|
mCurrentMtbColt.getPesoNettoKg() == null) {
|
||||||
|
|
||||||
|
MtbColt sourceMtbColt = pickingObjectDTO.getTempPickData().getSourceMtbColt();
|
||||||
|
|
||||||
|
mCurrentMtbColt.setCodTcol(sourceMtbColt.getCodTcol());
|
||||||
|
mCurrentMtbColt.setPesoKg(sourceMtbColt.getPesoKg());
|
||||||
|
mCurrentMtbColt.setPesoNettoKg(sourceMtbColt.getPesoNettoKg());
|
||||||
|
}
|
||||||
|
} else if (mEnableGiacenza && pickingObjectDTO.getMtbColts() != null && pickingObjectDTO.getMtbColts().size() > 0) {
|
||||||
|
// Vecchia logica di aggancio UL
|
||||||
|
// mtbColr
|
||||||
|
// .setCodJcom(UtilityString.empty2null(item.getCodJcom()))
|
||||||
|
// .setSerColloRif(UtilityString.empty2null(item.getSerCollo()))
|
||||||
|
// .setNumColloRif(item.getNumCollo())
|
||||||
|
// .setGestioneRif(UtilityString.empty2null(item.getGestione()))
|
||||||
|
// .setDataColloRif(UtilityString.empty2null(item.getDataColloS()));
|
||||||
|
}
|
||||||
|
|
||||||
|
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
|
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
|
|
||||||
|
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
||||||
|
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
||||||
|
|
||||||
|
boolean shouldPrint = true;
|
||||||
|
|
||||||
|
//Se è l'unico articolo del collo (controllo se è uguale a 0 perché ancora non è stato aggiunto nella lista delle righe)
|
||||||
|
if (shouldCloseLU && mCurrentMtbColt.getMtbColr().size() == 0) {
|
||||||
|
shouldPrint = false;
|
||||||
|
// if(UtilityString.isNullOrEmpty(cloneMtbColt.getCodTcol())) {
|
||||||
|
// cloneMtbColt.setCodTcol(pickingObjectDTO.getSitArtOrdDTO().getCodTcol());
|
||||||
|
// cloneMtbColt.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean finalShouldPrint = shouldPrint;
|
||||||
|
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||||
|
|
||||||
|
mtbColr
|
||||||
|
.setDataCollo(value.getDataColloS())
|
||||||
|
.setNumCollo(value.getNumCollo())
|
||||||
|
.setGestione(value.getGestione())
|
||||||
|
.setSerCollo(value.getSerCollo())
|
||||||
|
.setRiga(value.getMtbColr().get(0).getRiga())
|
||||||
|
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
|
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
|
||||||
|
pickingObjectDTO.getWithdrawMtbColr().add(mtbColr);
|
||||||
|
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
|
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||||
|
resetMatchedRows();
|
||||||
|
|
||||||
|
this.sendOnRowSaved();
|
||||||
|
|
||||||
|
if (shouldCloseLU) closeLU(finalShouldPrint);
|
||||||
|
}, this::sendError);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void closeLU(boolean shouldPrint) {
|
||||||
|
if (mCurrentMtbColt == null) return;
|
||||||
|
|
||||||
|
this.sendLUClosing();
|
||||||
|
|
||||||
|
mColliMagazzinoRESTConsumer.canLUBeDeleted(mCurrentMtbColt, canBeDeleted -> {
|
||||||
|
|
||||||
|
if (canBeDeleted) {
|
||||||
|
deleteLU(this::sendLUClosed);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Runnable saveAction = () -> {
|
||||||
|
mColliMagazzinoRESTConsumer.updateDataFine(
|
||||||
|
mCurrentMtbColt, () -> distribuisciLU((generatedMtbColts) -> {
|
||||||
|
if (shouldPrint)
|
||||||
|
printCollo(generatedMtbColts, () -> this.postCloseOperations(generatedMtbColts));
|
||||||
|
else {
|
||||||
|
postCloseOperations(generatedMtbColts);
|
||||||
|
}
|
||||||
|
}), this::sendError);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (mShouldAskPesoLU) {
|
||||||
|
this.sendLUPesoRequired(mCurrentMtbColt.getCodTcol(),
|
||||||
|
mCurrentMtbColt.getPesoNettoKg(),
|
||||||
|
mCurrentMtbColt.getPesoKg(),
|
||||||
|
(newCodTcol, newNetWeight, newGrossWeight) -> {
|
||||||
|
|
||||||
|
mCurrentMtbColt.setCodTcol(newCodTcol);
|
||||||
|
mCurrentMtbColt.setPesoNettoKg(newNetWeight);
|
||||||
|
mCurrentMtbColt.setPesoKg(newGrossWeight);
|
||||||
|
|
||||||
|
saveAction.run();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
saveAction.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void distribuisciLU(RunnableArgs<List<MtbColt>> onComplete) {
|
||||||
|
|
||||||
|
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
|
|
||||||
|
IOrdiniVendita ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA);
|
||||||
|
|
||||||
|
ordiniVendita.distribuisciCollo(cloneMtbColt, mTestateOrdini, mtbColts -> {
|
||||||
|
|
||||||
|
mColliMagazzinoRESTConsumer.getMultipleByTestate(mtbColts, true, onComplete, this::sendError);
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printCollo(List<MtbColt> mtbColtsToPrint, Runnable onComplete) {
|
||||||
|
this.sendLUPrintRequest(shouldPrint -> {
|
||||||
|
|
||||||
|
if (!shouldPrint) {
|
||||||
|
onComplete.run();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cyclicPrint(@NotNull Iterator<MtbColt> sourceMtbColts, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
|
if (sourceMtbColts.hasNext()) {
|
||||||
|
singlePrint(sourceMtbColts.next(), printerName, () -> {
|
||||||
|
cyclicPrint(sourceMtbColts, printerName, onComplete, onAbort);
|
||||||
|
}, onAbort);
|
||||||
|
} else {
|
||||||
|
onComplete.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ReportManager.getRightReportNameByGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
||||||
|
|
||||||
|
PrinterRESTConsumer.printCollo(
|
||||||
|
printerName,
|
||||||
|
mtbColtToPrint,
|
||||||
|
1,
|
||||||
|
reportName, onComplete, onFailed);
|
||||||
|
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void postCloseOperations(List<MtbColt> mtbColtList) {
|
||||||
|
this.mColliRegistrati.addAll(mtbColtList);
|
||||||
|
|
||||||
|
mColliDataRecoverService.closeSession(mMtbColtSessionID);
|
||||||
|
this.mCurrentMtbColt = null;
|
||||||
|
|
||||||
|
|
||||||
|
for(PickingObjectDTO pickingObjectDTO : mPickingList.getValue()) {
|
||||||
|
|
||||||
|
List<MtbColr> withdrawMtbColrList = pickingObjectDTO.getWithdrawMtbColr();
|
||||||
|
|
||||||
|
for(MtbColr withdrawMtbColr : withdrawMtbColrList) {
|
||||||
|
pickingObjectDTO.getSitArtOrdDTO().setNumCnfOrd(pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd().subtract(withdrawMtbColr.getNumCnf()));
|
||||||
|
pickingObjectDTO.getSitArtOrdDTO().setQtaOrd(pickingObjectDTO.getSitArtOrdDTO().getQtaOrd().subtract(withdrawMtbColr.getQtaCol()));
|
||||||
|
|
||||||
|
Stream.of(pickingObjectDTO.getMtbColts())
|
||||||
|
.filter(x -> Objects.equals(x.getNumCollo(), withdrawMtbColr.getNumColloRif()) &&
|
||||||
|
x.getDataColloS().equals(withdrawMtbColr.getDataColloRifS()) &&
|
||||||
|
x.getSerCollo().equalsIgnoreCase(withdrawMtbColr.getSerColloRif()) &&
|
||||||
|
x.getGestione().equalsIgnoreCase(withdrawMtbColr.getGestioneRif()))
|
||||||
|
.forEach(x -> {
|
||||||
|
List<MtbColr> mtbColrList = x.getMtbColr();
|
||||||
|
|
||||||
|
// Stream.of(mtbColrList)
|
||||||
|
// .filter(y -> y.getCodMart().equalsIgnoreCase(withdrawMtbColr.getCodMart()) &&
|
||||||
|
// UtilityString.equalsIgnoreCase(y.getPartitaMag(), withdrawMtbColr.getPartitaMag()) &&
|
||||||
|
// UtilityString.equalsIgnoreCase(y.getCodCol(), withdrawMtbColr.getCodCol()) &&
|
||||||
|
// UtilityString.equalsIgnoreCase(y.getCodTagl(), withdrawMtbColr.getCodTagl()))
|
||||||
|
// .for
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteLU(Runnable onComplete) {
|
||||||
|
mColliMagazzinoRESTConsumer.deleteCollo(mCurrentMtbColt, () -> {
|
||||||
|
mCurrentMtbColt = null;
|
||||||
|
if (onComplete != null) onComplete.run();
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
public void resetMatchedRows() {
|
public void resetMatchedRows() {
|
||||||
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
||||||
pickingObjectDTO
|
pickingObjectDTO
|
||||||
@ -727,8 +1029,8 @@ public class SpedizioneViewModel {
|
|||||||
return mPickingList;
|
return mPickingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpedizioneViewModel addListeners(Listeners mListeners) {
|
public SpedizioneViewModel setListeners(Listeners listeners) {
|
||||||
this.mListeners.add(mListeners);
|
this.mListeners = listeners;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -737,15 +1039,25 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
void onLUCreated(MtbColt mtbColt);
|
void onLUCreated(MtbColt mtbColt);
|
||||||
|
|
||||||
|
void onLUClosing();
|
||||||
|
|
||||||
void onLUClosed();
|
void onLUClosed();
|
||||||
|
|
||||||
|
void onLUPositionRequired(RunnableArgs<MtbDepoPosizione> onComplete);
|
||||||
|
|
||||||
|
void onLUPesoRequired(String codTcol, BigDecimal netWeightKG, BigDecimal grossWeightKG, RunnableArgsss<String, BigDecimal, BigDecimal> onComplete);
|
||||||
|
|
||||||
|
void onLUPrintRequest(RunnableArgs<Boolean> onComplete);
|
||||||
|
|
||||||
|
void onLUPrintError(Exception ex, Runnable onComplete);
|
||||||
|
|
||||||
void onFilterApplied(String newValue);
|
void onFilterApplied(String newValue);
|
||||||
|
|
||||||
void onFilterRemoved();
|
void onFilterRemoved();
|
||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
|
||||||
void onItemDispatched(MtbAart mtbAart,
|
void onItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||||
BigDecimal totalQtaOrd,
|
BigDecimal totalQtaOrd,
|
||||||
BigDecimal totalNumCnfOrd,
|
BigDecimal totalNumCnfOrd,
|
||||||
BigDecimal qtaCnfOrd,
|
BigDecimal qtaCnfOrd,
|
||||||
@ -755,7 +1067,11 @@ public class SpedizioneViewModel {
|
|||||||
BigDecimal totalQtaAvailable,
|
BigDecimal totalQtaAvailable,
|
||||||
BigDecimal totalNumCnfAvailable,
|
BigDecimal totalNumCnfAvailable,
|
||||||
BigDecimal qtaCnfAvailable,
|
BigDecimal qtaCnfAvailable,
|
||||||
|
String partitaMag,
|
||||||
|
Date dataScad,
|
||||||
boolean canOverflowOrderQuantity);
|
boolean canOverflowOrderQuantity);
|
||||||
|
|
||||||
|
void onRowSaved();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,6 +94,7 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
|
|||||||
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||||
SpedizioneListModel pickingObjectDTO = this.mDataset.get(nextItemPosition);
|
SpedizioneListModel pickingObjectDTO = this.mDataset.get(nextItemPosition);
|
||||||
|
|
||||||
|
subheaderHolder.mBinding.spedizioneGroupTitle.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getGroupTitle()) ? View.GONE : View.VISIBLE);
|
||||||
subheaderHolder.mBinding.spedizioneGroupTitle.setText(pickingObjectDTO.getGroupTitle());
|
subheaderHolder.mBinding.spedizioneGroupTitle.setText(pickingObjectDTO.getGroupTitle());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,6 +102,16 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
|
|||||||
public void onBindItemViewHolder(final SpedizioneListAdapter.SingleItemViewHolder holder, final int position) {
|
public void onBindItemViewHolder(final SpedizioneListAdapter.SingleItemViewHolder holder, final int position) {
|
||||||
SpedizioneListModel pickingObjectDTO = this.mDataset.get(position);
|
SpedizioneListModel pickingObjectDTO = this.mDataset.get(position);
|
||||||
|
|
||||||
|
if (pickingObjectDTO.getQtaEvasa().subtract(pickingObjectDTO.getQtaTot()).floatValue() >= 0) {
|
||||||
|
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.green_500_with_alpha));
|
||||||
|
} else if (pickingObjectDTO.getQtaEvasa().floatValue() > 0) {
|
||||||
|
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.orange_600_with_alpha));
|
||||||
|
} else if (position % 2 == 1) {
|
||||||
|
holder.mBinding.getRoot().setBackgroundColor(Color.WHITE);
|
||||||
|
} else {
|
||||||
|
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
|
||||||
|
}
|
||||||
|
|
||||||
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
||||||
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
||||||
holder.mBinding.badge1.setBackground(mContext.getResources().getDrawable(!pickingObjectDTO.isActive() ? R.drawable.badge_gray_round_corner : R.drawable.badge1_round_corner));
|
holder.mBinding.badge1.setBackground(mContext.getResources().getDrawable(!pickingObjectDTO.isActive() ? R.drawable.badge_gray_round_corner : R.drawable.badge1_round_corner));
|
||||||
@ -128,7 +139,8 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
|
|||||||
holder.mBinding.untMis.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getUntMis()) ? View.GONE : View.VISIBLE);
|
holder.mBinding.untMis.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getUntMis()) ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
holder.mBinding.getRoot().setOnClickListener(v -> {
|
holder.mBinding.getRoot().setOnClickListener(v -> {
|
||||||
if(this.mOnItemClicked != null) this.mOnItemClicked.run(pickingObjectDTO.getOriginalModel());
|
if (this.mOnItemClicked != null)
|
||||||
|
this.mOnItemClicked.run(pickingObjectDTO.getOriginalModel());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.spedizione_new.exceptions;
|
||||||
|
|
||||||
|
public class NoPrintersFoundException extends Exception {
|
||||||
|
public NoPrintersFoundException() {
|
||||||
|
super("Nessuna stampante configurata");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,7 +2,6 @@ package it.integry.integrywmsnative.gest.vendita.viewmodel;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
@ -149,7 +148,7 @@ public class VenditaViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void executeEtichettaLU(String SSCC, Dialog progressDialog) {
|
private void executeEtichettaLU(String SSCC, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
|
|
||||||
|
|||||||
@ -128,7 +128,7 @@ public class VersamentoMerceViewModel {
|
|||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
DialogCommon.showNoULFound(mContext, null);
|
DialogCommon.showNoULFound(mContext, null);
|
||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
ColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getByTestataStatic(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
|
||||||
//TAKE HERE
|
//TAKE HERE
|
||||||
pickMerceULtoUL(mtbColt, progressDialog);
|
pickMerceULtoUL(mtbColt, progressDialog);
|
||||||
@ -184,7 +184,7 @@ public class VersamentoMerceViewModel {
|
|||||||
|
|
||||||
|
|
||||||
private void executeEtichettaLU(String sscc, boolean isAnonima, Dialog progressDialog) {
|
private void executeEtichettaLU(String sscc, boolean isAnonima, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(sscc, true, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt == null && !isAnonima) {
|
if(mtbColt == null && !isAnonima) {
|
||||||
DialogCommon.showNoULFound(mContext, null);
|
DialogCommon.showNoULFound(mContext, null);
|
||||||
|
|||||||
@ -0,0 +1,101 @@
|
|||||||
|
package it.integry.integrywmsnative.view.bottom_sheet__lu_content;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.WeakReferenceOnListChangedCallback;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.BottomSheetFragmentLuContentListItemBinding;
|
||||||
|
|
||||||
|
public class BottomSheetFragmentLUContentListAdapter extends BaseAdapter {
|
||||||
|
|
||||||
|
private final WeakReferenceOnListChangedCallback onListChangedCallback;
|
||||||
|
private Context mContext;
|
||||||
|
private ObservableField<MtbColt> mtbColt;
|
||||||
|
|
||||||
|
public BottomSheetFragmentLUContentListAdapter(Context context, ObservableField<MtbColt> mtbColt) {
|
||||||
|
super();
|
||||||
|
this.mContext = context;
|
||||||
|
this.mtbColt = mtbColt;
|
||||||
|
this.onListChangedCallback = new WeakReferenceOnListChangedCallback(this);
|
||||||
|
|
||||||
|
this.mtbColt.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
onLUChangedCallback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void onLUChangedCallback() {
|
||||||
|
if(this.mtbColt.get() != null) {
|
||||||
|
this.mtbColt.get().getMtbColr().addOnListChangedCallback(onListChangedCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
|
||||||
|
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||||
|
|
||||||
|
BottomSheetFragmentLuContentListItemBinding binding = DataBindingUtil.inflate(inflater, R.layout.bottom_sheet_fragment__lu_content__list_item, parent, false);
|
||||||
|
|
||||||
|
final MtbColr mtbColr = mtbColt.get().getMtbColr().get(position);
|
||||||
|
binding.setMtbColr(mtbColr);
|
||||||
|
|
||||||
|
//Setting qty with unt_mis
|
||||||
|
if(!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissaBoolean())){
|
||||||
|
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
||||||
|
|
||||||
|
|
||||||
|
if(mtbColr.getMtbAart() != null) {
|
||||||
|
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.qtaTextview.setText(text);
|
||||||
|
} else {
|
||||||
|
binding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
binding.executePendingBindings();
|
||||||
|
|
||||||
|
if(position % 2 == 1) binding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
|
||||||
|
|
||||||
|
return binding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getItem(int position) {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
if(mtbColt.get() != null && mtbColt.get().getMtbColr() != null) {
|
||||||
|
|
||||||
|
return mtbColt.get().getMtbColr().size();
|
||||||
|
} else return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,195 @@
|
|||||||
|
package it.integry.integrywmsnative.view.bottom_sheet__lu_content;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
import androidx.databinding.ObservableList;
|
||||||
|
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.BottomSheetFragmentLuContentBinding;
|
||||||
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.exceptions.BottomSheetFragmentViewNotInitializedException;
|
||||||
|
|
||||||
|
public class BottomSheetFragmentLUContentView extends ConstraintLayout {
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
private BottomSheetBehavior mBottomSheetBehavior;
|
||||||
|
|
||||||
|
private BottomSheetFragmentLuContentBinding mBinding;
|
||||||
|
private BottomSheetFragmentLUContentViewModel mViewModel;
|
||||||
|
|
||||||
|
private BottomSheetFragmentLUContentListAdapter mAdapter;
|
||||||
|
|
||||||
|
|
||||||
|
public BottomSheetFragmentLUContentView(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetFragmentLUContentView(Context context, @Nullable AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
this.mContext = context;
|
||||||
|
|
||||||
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
mBinding = DataBindingUtil.inflate(inflater, R.layout.bottom_sheet_fragment__lu_content, this, true);
|
||||||
|
|
||||||
|
|
||||||
|
mViewModel = new BottomSheetFragmentLUContentViewModel();
|
||||||
|
mBinding.setViewModel(mViewModel);
|
||||||
|
|
||||||
|
this.initAdapter();
|
||||||
|
this.initCallbacks();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetFragmentLUContentView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
this(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetFragmentLUContentView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||||
|
this(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetFragmentLUContentViewModel getViewModelInstance() {
|
||||||
|
return mViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(View view) {
|
||||||
|
this.mBottomSheetBehavior = BottomSheetBehavior.from(view);
|
||||||
|
|
||||||
|
this.mBottomSheetBehavior.addBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
|
||||||
|
@Override
|
||||||
|
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
||||||
|
onStateChangedCallback(mapState(newState));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
||||||
|
onSlideCallback(1 - slideOffset);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initAdapter() {
|
||||||
|
this.mAdapter = new BottomSheetFragmentLUContentListAdapter(this.mContext, this.mViewModel.getObservableMtbColt());
|
||||||
|
this.mBinding.linearListview.setAdapter(this.mAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initCallbacks() {
|
||||||
|
this.mViewModel.getObservableMtbColt().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
if(mViewModel.getObservableMtbColt().get() != null) {
|
||||||
|
onMtbColrItemChanged();
|
||||||
|
|
||||||
|
mViewModel.getObservableMtbColt().get().getMtbColr().addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onChanged(ObservableList sender) {
|
||||||
|
onMtbColrItemChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onMtbColrItemChanged() {
|
||||||
|
List<MtbColr> mtbColrs = mViewModel.getObservableMtbColt().get().getMtbColr();
|
||||||
|
mBinding.textviewArtCounter.setText(String.valueOf(mtbColrs.size()));
|
||||||
|
mBinding.textviewArtDescription.setText(mContext.getResources().getQuantityString(R.plurals.articles, mtbColrs.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private State mapState(int stateInt) {
|
||||||
|
if(stateInt == BottomSheetBehavior.STATE_DRAGGING) return State.DRAGGING;
|
||||||
|
if(stateInt == BottomSheetBehavior.STATE_SETTLING) return State.SETTLING;
|
||||||
|
if(stateInt == BottomSheetBehavior.STATE_EXPANDED) return State.EXPANDED;
|
||||||
|
if(stateInt == BottomSheetBehavior.STATE_COLLAPSED) return State.COLLAPSED;
|
||||||
|
if(stateInt == BottomSheetBehavior.STATE_HIDDEN) return State.HIDDEN;
|
||||||
|
if(stateInt == BottomSheetBehavior.STATE_HALF_EXPANDED) return State.HALF_EXPANDED;
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public State getState() {
|
||||||
|
if(this.mBottomSheetBehavior == null) {
|
||||||
|
UtilityLogger.errorMe(new BottomSheetFragmentViewNotInitializedException());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mapState(this.mBottomSheetBehavior.getState());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isExpanded() {
|
||||||
|
return this.getState() == State.EXPANDED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCollapsed() {
|
||||||
|
return this.getState() == State.COLLAPSED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void expand() {
|
||||||
|
if(this.mBottomSheetBehavior == null) {
|
||||||
|
UtilityLogger.errorMe(new BottomSheetFragmentViewNotInitializedException());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void collapse() {
|
||||||
|
if(this.mBottomSheetBehavior == null) {
|
||||||
|
UtilityLogger.errorMe(new BottomSheetFragmentViewNotInitializedException());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onStateChangedCallback(State newState) {
|
||||||
|
switch (newState) {
|
||||||
|
case EXPANDED:
|
||||||
|
this.mBinding.btnCloseLu.setClickable(false);
|
||||||
|
this.mBinding.btnCloseLu.setFocusable(false);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case COLLAPSED:
|
||||||
|
this.mBinding.btnCloseLu.setClickable(true);
|
||||||
|
this.mBinding.btnCloseLu.setFocusable(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onSlideCallback(float slideOffset) {
|
||||||
|
this.mBinding.btnCloseLu.setAlpha(slideOffset);
|
||||||
|
// mBinding.tapActionLayout.setAlpha(1-slideOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void toggle() {
|
||||||
|
if(isExpanded()) collapse();
|
||||||
|
else expand();
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum State {
|
||||||
|
DRAGGING,
|
||||||
|
SETTLING,
|
||||||
|
EXPANDED,
|
||||||
|
COLLAPSED,
|
||||||
|
HIDDEN,
|
||||||
|
HALF_EXPANDED
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
package it.integry.integrywmsnative.view.bottom_sheet__lu_content;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
public class BottomSheetFragmentLUContentViewModel {
|
||||||
|
|
||||||
|
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||||
|
private Listener mListener;
|
||||||
|
|
||||||
|
public void closeCurrentLU() {
|
||||||
|
if(this.mListener != null) this.mListener.onBottomSheetLUClose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetFragmentLUContentViewModel setMtbColt(MtbColt mtbColt) {
|
||||||
|
this.mtbColt.set(mtbColt);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<MtbColt> getObservableMtbColt() {
|
||||||
|
return this.mtbColt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetFragmentLUContentViewModel setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Listener {
|
||||||
|
void onBottomSheetLUClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.view.bottom_sheet__lu_content.exceptions;
|
||||||
|
|
||||||
|
public class BottomSheetFragmentViewNotInitializedException extends Exception {
|
||||||
|
public BottomSheetFragmentViewNotInitializedException() {
|
||||||
|
super("Please call init() method before accessing to View state");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -13,6 +13,7 @@ import androidx.databinding.ObservableList;
|
|||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.WeakReferenceOnListChangedCallback;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
@ -89,52 +90,5 @@ public class ArticoliInColloBottomSheetMtbColrAdapter extends BaseAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class WeakReferenceOnListChangedCallback extends ObservableList.OnListChangedCallback {
|
|
||||||
|
|
||||||
private final WeakReference<BaseAdapter> adapterReference;
|
|
||||||
|
|
||||||
public WeakReferenceOnListChangedCallback(BaseAdapter baseAdapter) {
|
|
||||||
this.adapterReference = new WeakReference<>(baseAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onChanged(ObservableList sender) {
|
|
||||||
BaseAdapter adapter = adapterReference.get();
|
|
||||||
if (adapter != null) {
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeChanged(ObservableList sender, int positionStart, int itemCount) {
|
|
||||||
BaseAdapter adapter = adapterReference.get();
|
|
||||||
if (adapter != null) {
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeInserted(ObservableList sender, int positionStart, int itemCount) {
|
|
||||||
BaseAdapter adapter = adapterReference.get();
|
|
||||||
if (adapter != null) {
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeMoved(ObservableList sender, int fromPosition, int toPosition, int itemCount) {
|
|
||||||
BaseAdapter adapter = adapterReference.get();
|
|
||||||
if (adapter != null) {
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeRemoved(ObservableList sender, int positionStart, int itemCount) {
|
|
||||||
BaseAdapter adapter = adapterReference.get();
|
|
||||||
if (adapter != null) {
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -225,7 +225,7 @@ public class ArticoliInColloBottomSheetViewModel {
|
|||||||
|
|
||||||
mtbColtClone.getMtbColr().add(itemToDelete);
|
mtbColtClone.getMtbColr().add(itemToDelete);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColtClone, (newMtbColt) -> {
|
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtClone, (newMtbColt) -> {
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||||
|
|
||||||
MtbColr deletedItem = mtbColt.get().getMtbColr().get(position);
|
MtbColr deletedItem = mtbColt.get().getMtbColr().get(position);
|
||||||
|
|||||||
@ -372,7 +372,7 @@ public class DialogInputQuantity {
|
|||||||
quantityDTO.canDataScadBeChanged.set(dto.isCanDataScadBeChanged());
|
quantityDTO.canDataScadBeChanged.set(dto.isCanDataScadBeChanged());
|
||||||
}
|
}
|
||||||
|
|
||||||
quantityDTO.shouldAskDataScad.set(dto.mtbAart.isFlagTracciabilita() && dto.mtbAart.getGgScadPartita() != null && dto.mtbAart.getGgScadPartita() > 0);
|
quantityDTO.shouldAskDataScad.set(dto.mtbAart.isFlagTracciabilitaBoolean() && dto.mtbAart.getGgScadPartita() != null && dto.mtbAart.getGgScadPartita() > 0);
|
||||||
|
|
||||||
if(dto.getShouldAskDataScad() != null) {
|
if(dto.getShouldAskDataScad() != null) {
|
||||||
quantityDTO.shouldAskDataScad.set(dto.getShouldAskDataScad());
|
quantityDTO.shouldAskDataScad.set(dto.getShouldAskDataScad());
|
||||||
@ -688,7 +688,7 @@ public class DialogInputQuantity {
|
|||||||
|
|
||||||
|
|
||||||
private void onConfirm(Context context, QuantityDTO quantityDTO, RunnableArgss<QuantityDTO, Boolean> dialogCallback, boolean closeUL){
|
private void onConfirm(Context context, QuantityDTO quantityDTO, RunnableArgss<QuantityDTO, Boolean> dialogCallback, boolean closeUL){
|
||||||
if(currentDTO.mtbAart.isFlagTracciabilita() && (quantityDTO.batchLot == null || quantityDTO.batchLot.get().trim().length() == 0)){
|
if(currentDTO.mtbAart.isFlagTracciabilitaBoolean() && (quantityDTO.batchLot == null || quantityDTO.batchLot.get().trim().length() == 0)){
|
||||||
|
|
||||||
showBatchLotErrorPrompt(context);
|
showBatchLotErrorPrompt(context);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -15,8 +16,11 @@ import androidx.fragment.app.DialogFragment;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||||
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
||||||
@ -25,21 +29,26 @@ public class DialogInputQuantityV2 extends DialogFragment implements DialogInput
|
|||||||
|
|
||||||
private DialogInputQuantityV2ViewModel mViewModel;
|
private DialogInputQuantityV2ViewModel mViewModel;
|
||||||
private DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
private DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
||||||
|
private RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
|
||||||
|
|
||||||
|
public ObservableField<String> currentPartitaMag = new ObservableField<>();
|
||||||
|
public ObservableField<Date> currentDataScad = new ObservableField<>();
|
||||||
|
|
||||||
public ObservableField<BigDecimal> currentNumCnf = new ObservableField<>();
|
public ObservableField<BigDecimal> currentNumCnf = new ObservableField<>();
|
||||||
public ObservableField<BigDecimal> currentQtaCnf = new ObservableField<>();
|
public ObservableField<BigDecimal> currentQtaCnf = new ObservableField<>();
|
||||||
public ObservableField<BigDecimal> currentQtaTot = new ObservableField<>();
|
public ObservableField<BigDecimal> currentQtaTot = new ObservableField<>();
|
||||||
|
|
||||||
|
public Context context;
|
||||||
|
|
||||||
private boolean mEnableDataCallback = true;
|
private boolean mEnableDataCallback = true;
|
||||||
|
|
||||||
public static DialogInputQuantityV2 newInstance(@NotNull DialogInputQuantityV2DTO dialogInputQuantityV2DTO) {
|
public static DialogInputQuantityV2 newInstance(@NotNull DialogInputQuantityV2DTO dialogInputQuantityV2DTO, RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> onComplete) {
|
||||||
return new DialogInputQuantityV2(dialogInputQuantityV2DTO);
|
return new DialogInputQuantityV2(dialogInputQuantityV2DTO, onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DialogInputQuantityV2(@NotNull DialogInputQuantityV2DTO dialogInputQuantityV2DTO) {
|
private DialogInputQuantityV2(@NotNull DialogInputQuantityV2DTO dialogInputQuantityV2DTO, RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> onComplete) {
|
||||||
this.mDialogInputQuantityV2DTO = dialogInputQuantityV2DTO;
|
this.mDialogInputQuantityV2DTO = dialogInputQuantityV2DTO;
|
||||||
|
this.mOnComplete = onComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -51,6 +60,8 @@ public class DialogInputQuantityV2 extends DialogFragment implements DialogInput
|
|||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
this.context = getActivity();
|
||||||
|
|
||||||
DialogInputQuantityV2Binding bindings = DataBindingUtil.inflate(inflater, R.layout.dialog_input_quantity_v2, container, false);
|
DialogInputQuantityV2Binding bindings = DataBindingUtil.inflate(inflater, R.layout.dialog_input_quantity_v2, container, false);
|
||||||
|
|
||||||
bindings.toolbar.setTitle("Inserimento articolo");
|
bindings.toolbar.setTitle("Inserimento articolo");
|
||||||
@ -66,19 +77,36 @@ public class DialogInputQuantityV2 extends DialogFragment implements DialogInput
|
|||||||
.setTotalNumCnfAvailable(mDialogInputQuantityV2DTO.getTotalNumCnfAvailable())
|
.setTotalNumCnfAvailable(mDialogInputQuantityV2DTO.getTotalNumCnfAvailable())
|
||||||
.setTotalQtaAvailable(mDialogInputQuantityV2DTO.getTotalQtaAvailable())
|
.setTotalQtaAvailable(mDialogInputQuantityV2DTO.getTotalQtaAvailable())
|
||||||
.setCanOverflowOrderQuantity(mDialogInputQuantityV2DTO.isCanOverflowOrderQuantity())
|
.setCanOverflowOrderQuantity(mDialogInputQuantityV2DTO.isCanOverflowOrderQuantity())
|
||||||
.setQtaCnfAvailable(mDialogInputQuantityV2DTO.getQtaCnfAvailable());
|
.setQtaCnfAvailable(mDialogInputQuantityV2DTO.getQtaCnfAvailable())
|
||||||
|
.setPartitaMag(mDialogInputQuantityV2DTO.getPartitaMag())
|
||||||
|
.setDataScad(mDialogInputQuantityV2DTO.getDataScad());
|
||||||
|
|
||||||
bindings.setView(this);
|
bindings.setView(this);
|
||||||
bindings.setViewmodel(this.mViewModel);
|
bindings.setViewmodel(this.mViewModel);
|
||||||
|
|
||||||
MtbUntMis mtbUntMis = mDialogInputQuantityV2DTO.getMtbAart().getMtbUntMis() != null && mDialogInputQuantityV2DTO.getMtbAart().getMtbUntMis().size() > 0 ? mDialogInputQuantityV2DTO.getMtbAart().getMtbUntMis().get(0) : null;
|
MtbUntMis mtbUntMis = mDialogInputQuantityV2DTO.getMtbAart().getMtbUntMis() != null && mDialogInputQuantityV2DTO.getMtbAart().getMtbUntMis().size() > 0 ? mDialogInputQuantityV2DTO.getMtbAart().getMtbUntMis().get(0) : null;
|
||||||
if(!(mtbUntMis != null && mtbUntMis.isFlagDig())) {
|
if (!(mtbUntMis != null && mtbUntMis.isFlagDig())) {
|
||||||
bindings.inputQtaTotText.setInputType(InputType.TYPE_CLASS_NUMBER|InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
bindings.inputQtaTotText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return bindings.getRoot();
|
return bindings.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dismiss() {
|
||||||
|
super.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save() {
|
||||||
|
this.mOnComplete.run(this.mViewModel.getResult(), false);
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveAndCloseLU() {
|
||||||
|
this.mOnComplete.run(this.mViewModel.getResult(), true);
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
@ -90,19 +118,19 @@ public class DialogInputQuantityV2 extends DialogFragment implements DialogInput
|
|||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
UtilityObservable.addPropertyChanged(this.currentNumCnf, (value) -> {
|
UtilityObservable.addPropertyChanged(this.currentNumCnf, (value) -> {
|
||||||
if(this.mEnableDataCallback) {
|
if (this.mEnableDataCallback) {
|
||||||
this.mViewModel.setNumCnf(value);
|
this.mViewModel.setNumCnf(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
UtilityObservable.addPropertyChanged(this.currentQtaCnf, (value) -> {
|
UtilityObservable.addPropertyChanged(this.currentQtaCnf, (value) -> {
|
||||||
if(this.mEnableDataCallback) {
|
if (this.mEnableDataCallback) {
|
||||||
this.mViewModel.setQtaCnf(value);
|
this.mViewModel.setQtaCnf(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
UtilityObservable.addPropertyChanged(this.currentQtaTot, (value) -> {
|
UtilityObservable.addPropertyChanged(this.currentQtaTot, (value) -> {
|
||||||
if(this.mEnableDataCallback) {
|
if (this.mEnableDataCallback) {
|
||||||
this.mViewModel.setQtaTot(value);
|
this.mViewModel.setQtaTot(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -112,6 +140,9 @@ public class DialogInputQuantityV2 extends DialogFragment implements DialogInput
|
|||||||
public void onDataChanged() {
|
public void onDataChanged() {
|
||||||
this.mEnableDataCallback = false;
|
this.mEnableDataCallback = false;
|
||||||
|
|
||||||
|
this.currentPartitaMag.set(this.mViewModel.getPartitaMag());
|
||||||
|
this.currentDataScad.set(this.mViewModel.getDataScad());
|
||||||
|
|
||||||
this.currentNumCnf.set(this.mViewModel.getNumCnf());
|
this.currentNumCnf.set(this.mViewModel.getNumCnf());
|
||||||
this.currentQtaCnf.set(this.mViewModel.getQtaCnf());
|
this.currentQtaCnf.set(this.mViewModel.getQtaCnf());
|
||||||
this.currentQtaTot.set(this.mViewModel.getQtaTot());
|
this.currentQtaTot.set(this.mViewModel.getQtaTot());
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
|
||||||
@ -20,6 +21,9 @@ public class DialogInputQuantityV2DTO {
|
|||||||
private BigDecimal totalNumCnfAvailable;
|
private BigDecimal totalNumCnfAvailable;
|
||||||
private BigDecimal qtaCnfAvailable;
|
private BigDecimal qtaCnfAvailable;
|
||||||
|
|
||||||
|
private String partitaMag;
|
||||||
|
private Date dataScad;
|
||||||
|
|
||||||
private boolean canOverflowOrderQuantity;
|
private boolean canOverflowOrderQuantity;
|
||||||
|
|
||||||
public MtbAart getMtbAart() {
|
public MtbAart getMtbAart() {
|
||||||
@ -112,6 +116,24 @@ public class DialogInputQuantityV2DTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2DTO setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScad() {
|
||||||
|
return dataScad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2DTO setDataScad(Date dataScad) {
|
||||||
|
this.dataScad = dataScad;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isCanOverflowOrderQuantity() {
|
public boolean isCanOverflowOrderQuantity() {
|
||||||
return canOverflowOrderQuantity;
|
return canOverflowOrderQuantity;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,59 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class DialogInputQuantityV2ResultDTO {
|
||||||
|
|
||||||
|
private String partitaMag;
|
||||||
|
private Date dataScad;
|
||||||
|
|
||||||
|
private BigDecimal numCnf;
|
||||||
|
private BigDecimal qtaCnf;
|
||||||
|
private BigDecimal qtaTot;
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ResultDTO setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScad() {
|
||||||
|
return dataScad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ResultDTO setDataScad(Date dataScad) {
|
||||||
|
this.dataScad = dataScad;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumCnf() {
|
||||||
|
return numCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ResultDTO setNumCnf(BigDecimal numCnf) {
|
||||||
|
this.numCnf = numCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ResultDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaTot() {
|
||||||
|
return qtaTot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ResultDTO setQtaTot(BigDecimal qtaTot) {
|
||||||
|
this.qtaTot = qtaTot;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
|||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
@ -28,6 +29,9 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
private BigDecimal internalQtaCnf;
|
private BigDecimal internalQtaCnf;
|
||||||
private BigDecimal internalQtaTot;
|
private BigDecimal internalQtaTot;
|
||||||
|
|
||||||
|
private String internalPartitaMag;
|
||||||
|
private Date internalDataScad;
|
||||||
|
|
||||||
private boolean canOverflowOrderQuantity;
|
private boolean canOverflowOrderQuantity;
|
||||||
|
|
||||||
private Listener mListener;
|
private Listener mListener;
|
||||||
@ -52,6 +56,13 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
this.mListener.onDataChanged();
|
this.mListener.onDataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return internalPartitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScad() {
|
||||||
|
return internalDataScad;
|
||||||
|
}
|
||||||
|
|
||||||
public BigDecimal getNumCnf() {
|
public BigDecimal getNumCnf() {
|
||||||
return this.internalNumCnf;
|
return this.internalNumCnf;
|
||||||
@ -120,6 +131,15 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ViewModel setPartitaMag(String internalPartitaMag) {
|
||||||
|
this.internalPartitaMag = internalPartitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ViewModel setDataScad(Date internalDataScad) {
|
||||||
|
this.internalDataScad = internalDataScad;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void setNumCnf(BigDecimal newValue) {
|
public void setNumCnf(BigDecimal newValue) {
|
||||||
this.internalNumCnf = newValue;
|
this.internalNumCnf = newValue;
|
||||||
@ -169,6 +189,16 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
this.mListener.onDataChanged();
|
this.mListener.onDataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ResultDTO getResult() {
|
||||||
|
return new DialogInputQuantityV2ResultDTO()
|
||||||
|
.setPartitaMag(this.internalPartitaMag)
|
||||||
|
.setDataScad(this.internalDataScad)
|
||||||
|
.setNumCnf(this.internalNumCnf)
|
||||||
|
.setQtaCnf(this.internalQtaCnf)
|
||||||
|
.setQtaTot(this.internalQtaTot);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void setListener(Listener listener) {
|
public void setListener(Listener listener) {
|
||||||
this.mListener = listener;
|
this.mListener = listener;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import android.app.Dialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.os.Build;
|
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -13,10 +12,7 @@ import androidx.databinding.DataBindingUtil;
|
|||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
@ -161,7 +157,7 @@ public class DialogScanOrCreateLU {
|
|||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
DialogCommon.showNoULFound(mContext, null);
|
DialogCommon.showNoULFound(mContext, null);
|
||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
ColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), mShouldCheckResiduo, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getByTestataStatic(mtbColtList.get(0), mShouldCheckResiduo, false, mtbColt -> {
|
||||||
sendMtbColt(mtbColt, progressDialog);
|
sendMtbColt(mtbColt, progressDialog);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
@ -185,7 +181,7 @@ public class DialogScanOrCreateLU {
|
|||||||
|
|
||||||
|
|
||||||
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), mShouldCheckResiduo, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(barcodeScanDTO.getStringValue(), mShouldCheckResiduo, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt == null) {
|
if(mtbColt == null) {
|
||||||
|
|
||||||
@ -229,7 +225,7 @@ public class DialogScanOrCreateLU {
|
|||||||
|
|
||||||
if(ean128Model != null && !UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
if(ean128Model != null && !UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.getBySSCC(ean128Model.Sscc, mShouldCheckResiduo, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(ean128Model.Sscc, mShouldCheckResiduo, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt != null) {
|
if(mtbColt != null) {
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,11 @@
|
|||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
|
|
||||||
<import type="it.integry.integrywmsnative.BuildConfig" />
|
<import type="it.integry.integrywmsnative.BuildConfig" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
@ -15,13 +17,19 @@
|
|||||||
</data>
|
</data>
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/full_white"
|
android:background="@color/full_white"
|
||||||
android:fitsSystemWindows="false"
|
android:fitsSystemWindows="false"
|
||||||
tools:context=".gest.spedizione_new.SpedizioneActivity">
|
tools:context=".gest.spedizione_new.SpedizioneActivity">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -36,17 +44,15 @@
|
|||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="?attr/actionBarSize"
|
android:background="@color/full_white"
|
||||||
android:background="@color/full_white">
|
android:minHeight="?attr/actionBarSize">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_height="?attr/actionBarSize"
|
style="@style/AppTheme.NewMaterial.Text"
|
||||||
app:layout_collapseMode="pin"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
style="@style/AppTheme.NewMaterial.Text">
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
app:layout_collapseMode="pin">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
@ -54,37 +60,35 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:background="@drawable/ripple_effect"
|
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
|
android:background="@drawable/ripple_effect"
|
||||||
android:src="@drawable/ic_add_24dp"
|
android:src="@drawable/ic_add_24dp"
|
||||||
android:tint="@color/colorPrimaryGray"
|
android:tint="@color/colorPrimaryGray"
|
||||||
app:visibility="@{spedizioneView.addExtraItemsEnabled}"/>
|
app:visibility="@{spedizioneView.addExtraItemsEnabled}" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:background="@drawable/ripple_effect"
|
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:src="@drawable/ic_black_barcode"
|
android:background="@drawable/ripple_effect"
|
||||||
android:onClick="@{() -> spedizioneView.startManualSearch()}"
|
android:onClick="@{() -> spedizioneView.startManualSearch()}"
|
||||||
|
android:src="@drawable/ic_black_barcode"
|
||||||
android:tint="@color/colorPrimaryGray"
|
android:tint="@color/colorPrimaryGray"
|
||||||
android:visibility="@{BuildConfig.DEBUG ? View.VISIBLE : View.GONE}"/>
|
android:visibility="@{BuildConfig.DEBUG ? View.VISIBLE : View.GONE}" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:background="@drawable/ripple_effect"
|
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:src="@drawable/ic_photo_camera_black_24dp"
|
android:background="@drawable/ripple_effect"
|
||||||
android:onClick="@{() -> spedizioneView.startCameraBarcode()}"
|
android:onClick="@{() -> spedizioneView.startCameraBarcode()}"
|
||||||
|
android:src="@drawable/ic_photo_camera_black_24dp"
|
||||||
android:tint="@color/colorPrimaryGray"
|
android:tint="@color/colorPrimaryGray"
|
||||||
android:visibility="@{BuildConfig.DEBUG ? View.VISIBLE : View.GONE}"/>
|
android:visibility="@{BuildConfig.DEBUG ? View.VISIBLE : View.GONE}" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
@ -106,10 +110,10 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="12dp"
|
|
||||||
android:paddingLeft="8dp"
|
android:paddingLeft="8dp"
|
||||||
android:paddingRight="8dp">
|
android:paddingTop="12dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:paddingBottom="12dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -119,38 +123,35 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/filtered_arts_in_list"
|
android:text="@string/filtered_arts_in_list" />
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/description_filter_text"
|
android:id="@+id/description_filter_text"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:ellipsize="end"
|
tools:text="COD_ART_HERE" />
|
||||||
android:maxLines="1"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
|
||||||
tools:text="COD_ART_HERE"/>
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/remove_art_filter_list"
|
android:id="@+id/remove_art_filter_list"
|
||||||
|
style="@style/Button.DangerOutline"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Button.DangerOutline"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:text="@string/remove_filter_button"
|
|
||||||
android:onClick="@{() -> spedizioneView.removeListFilter()}"
|
android:onClick="@{() -> spedizioneView.removeListFilter()}"
|
||||||
app:strokeColor="@color/red_600"/>
|
android:text="@string/remove_filter_button"
|
||||||
|
app:strokeColor="@color/red_600" />
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -162,9 +163,9 @@
|
|||||||
android:id="@+id/spedizione_picking_list"
|
android:id="@+id/spedizione_picking_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scrollbars="vertical"
|
android:clipToPadding="false"
|
||||||
android:paddingBottom="72dp"
|
android:paddingBottom="72dp"
|
||||||
android:clipToPadding="false"/>
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -200,25 +201,25 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center_horizontal"
|
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_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:layout_width="72dp"
|
android:layout_width="72dp"
|
||||||
android:layout_height="wrap_content"
|
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
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/no_item_to_pick_text"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp" />
|
||||||
android:text="@string/no_item_to_pick_text"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@ -228,7 +229,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
app:visibility="@{spedizioneView.noLUPresent}"
|
|
||||||
app:layout_anchor="@+id/spedizione_empty_view"
|
app:layout_anchor="@+id/spedizione_empty_view"
|
||||||
app:layout_anchorGravity="center"
|
app:layout_anchorGravity="center"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@ -260,7 +260,8 @@
|
|||||||
app:menu_shadowRadius="4dp"
|
app:menu_shadowRadius="4dp"
|
||||||
app:menu_shadowXOffset="1dp"
|
app:menu_shadowXOffset="1dp"
|
||||||
app:menu_shadowYOffset="3dp"
|
app:menu_shadowYOffset="3dp"
|
||||||
app:menu_showShadow="true">
|
app:menu_showShadow="true"
|
||||||
|
app:visibility="@{spedizioneView.noLUPresent}">
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionButton
|
<com.github.clans.fab.FloatingActionButton
|
||||||
android:id="@+id/spedizione_fab_item1"
|
android:id="@+id/spedizione_fab_item1"
|
||||||
@ -289,10 +290,21 @@
|
|||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView
|
||||||
|
android:id="@+id/bottom_sheet_lu_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:visibility="@{spedizioneView.bottomSheetEnabled}"
|
||||||
|
app:behavior_hideable="false"
|
||||||
|
app:behavior_peekHeight="66dp"
|
||||||
|
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" />
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
384
app/src/main/res/layout/bottom_sheet_fragment__lu_content.xml
Normal file
384
app/src/main/res/layout/bottom_sheet_fragment__lu_content.xml
Normal file
@ -0,0 +1,384 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<import type="android.view.View" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="viewModel"
|
||||||
|
type="it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="view"
|
||||||
|
type="it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/bottom_sheet"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#ffffffff"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:cardElevation="4dp">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/white">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/title_layout"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="66dp"
|
||||||
|
android:background="@color/colorAccent"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:clickable="true"
|
||||||
|
android:onClick="@{() -> view.toggle()}"
|
||||||
|
android:focusable="true">
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/indicator_view"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:background="@drawable/badge_gray_round_corner"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:alpha="0.5"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/colorAccent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/indicator_view">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:tint="@android:color/white"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:srcCompat="@drawable/ic_box" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/textview_art_counter"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/imageView"
|
||||||
|
tools:text="2" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/textview_art_description"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="@string/article"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/imageView" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btn_close_lu"
|
||||||
|
style="@style/Button.DangerFull"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
app:singleClick="@{() -> viewModel.closeCurrentLU()}"
|
||||||
|
android:text="@string/action_close_ul"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/indicator_view"
|
||||||
|
app:strokeColor="@color/red_600" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lu_detail_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/title_layout">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="@string/details_text"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="15dp">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.40" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:text="@string/date_text"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline1"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/articoli_in_collo_details_date"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline1"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="TextView" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.40" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/articoli_in_collo_details_posizione"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:text="@string/position_text"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline2"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:text="@{viewModel.mtbColt.posizione}"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline2"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="TextView" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.40" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:text="@string/prepared_by_text"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline3"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:text="@{viewModel.mtbColt.preparatoDa}"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline3"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="TextView" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.40" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:text="@string/customer"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline4"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:text="@{viewModel.mtbColt.ragSocCliente}"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline4"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="TextView" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/separator_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:background="#ededed"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/lu_detail_layout" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/separator_view">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="@string/already_read_articles"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="14dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:visibility="@{viewModel.mtbColt == null || viewModel.mtbColt.mtbColr.size() == 0 ? View.VISIBLE : View.GONE}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_info_78dp"
|
||||||
|
android:tint="@color/empty_view_gray" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/empty_rows_in_mtbcolt"
|
||||||
|
android:textColor="@color/empty_view_gray"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<com.linearlistview.LinearListView
|
||||||
|
android:id="@+id/linear_listview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:dividerThickness="0.5dp" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="android.view.View" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.settings.SettingsManager" />
|
||||||
|
<variable
|
||||||
|
name="mtbColr"
|
||||||
|
type="it.integry.integrywmsnative.core.model.MtbColr"/>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/qta_box"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{mtbColr.codMart}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
tools:text="COD MART" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{UtilityNumber.decimalToString(mtbColr.qtaCol) + mtbColr.mtbAart.untMis}"
|
||||||
|
android:visibility="@{SettingsManager.iDB().isFlagForceAllToColli() || (mtbColr.mtbAart != null && !mtbColr.mtbAart.flagQtaCnfFissaBoolean) ? View.VISIBLE : View.GONE}"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:paddingStart="6dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:background="@drawable/badge2_round_corner"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
tools:text="PESO KG" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@{mtbColr.getDescrizione()}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
tools:text="Descrizione lunga articolo" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{`Lotto: ` + mtbColr.getPartitaMag()}"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:visibility="@{UtilityString.isNullOrEmpty(mtbColr.getPartitaMag()) ? View.INVISIBLE : View.VISIBLE}"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
tools:text="Lotto: ABCDE" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/qta_box"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/qta_textview"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/badge1_round_corner"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
tools:text="280.45\nCONF" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@ -16,6 +16,7 @@
|
|||||||
<variable
|
<variable
|
||||||
name="viewmodel"
|
name="viewmodel"
|
||||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ViewModel" />
|
type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ViewModel" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="view"
|
name="view"
|
||||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2" />
|
type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2" />
|
||||||
@ -366,6 +367,57 @@
|
|||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:background="@color/gray_400" />
|
android:background="@color/gray_400" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="2">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/input_partita_mag_layout"
|
||||||
|
style="@style/TextInputLayout.OutlinePrimary"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="@{viewmodel.mtbAart.flagTracciabilitaBoolean && viewmodel.mtbAart.ggScadPartita != null && viewmodel.mtbAart.ggScadPartita > 0 ? 1f : 2f}"
|
||||||
|
android:paddingEnd="4dp"
|
||||||
|
tools:layout_weight="1">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/input_partita_mag_text"
|
||||||
|
style="@style/TextInputEditText.OutlinePrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/batch_lot"
|
||||||
|
android:inputType="text"
|
||||||
|
app:binding="@{view.currentPartitaMag}" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/input_data_scad_layout"
|
||||||
|
style="@style/TextInputLayout.OutlinePrimary"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="@{viewmodel.mtbAart.flagTracciabilitaBoolean && viewmodel.mtbAart.ggScadPartita != null && viewmodel.mtbAart.ggScadPartita > 0 ? View.VISIBLE : View.GONE}"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/input_data_scad_text"
|
||||||
|
style="@style/TextInputEditText.OutlinePrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/expire_date"
|
||||||
|
android:focusableInTouchMode="false"
|
||||||
|
app:binding="@{view.currentDataScad}"
|
||||||
|
android:inputType="text" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -385,11 +437,11 @@
|
|||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/input_num_cnf_text"
|
android:id="@+id/input_num_cnf_text"
|
||||||
style="@style/TextInputEditText.OutlinePrimary"
|
style="@style/TextInputEditText.OutlinePrimary"
|
||||||
app:binding="@{view.currentNumCnf}"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/num_pcks"
|
android:hint="@string/num_pcks"
|
||||||
android:inputType="number" />
|
android:inputType="number"
|
||||||
|
app:binding="@{view.currentNumCnf}" />
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
@ -424,11 +476,11 @@
|
|||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/input_qta_tot_text"
|
android:id="@+id/input_qta_tot_text"
|
||||||
style="@style/TextInputEditText.OutlinePrimary"
|
style="@style/TextInputEditText.OutlinePrimary"
|
||||||
app:binding="@{view.currentQtaTot}"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/tot_qty"
|
android:hint="@string/tot_qty"
|
||||||
android:inputType="numberDecimal" />
|
android:inputType="numberDecimal"
|
||||||
|
app:binding="@{view.currentQtaTot}" />
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
@ -450,6 +502,7 @@
|
|||||||
android:layout_marginStart="0dp"
|
android:layout_marginStart="0dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:layout_weight="0.4"
|
android:layout_weight="0.4"
|
||||||
|
android:onClick="@{() -> view.saveAndCloseLU()}"
|
||||||
android:text="@string/action_close_ul"
|
android:text="@string/action_close_ul"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
@ -464,6 +517,7 @@
|
|||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:layout_weight="0.3"
|
android:layout_weight="0.3"
|
||||||
|
android:onClick="@{() -> view.dismiss()}"
|
||||||
android:paddingEnd="3dp"
|
android:paddingEnd="3dp"
|
||||||
app:icon="@drawable/ic_close_24dp"
|
app:icon="@drawable/ic_close_24dp"
|
||||||
app:iconGravity="textStart"
|
app:iconGravity="textStart"
|
||||||
@ -478,6 +532,7 @@
|
|||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:layout_marginEnd="0dp"
|
android:layout_marginEnd="0dp"
|
||||||
android:layout_weight="0.3"
|
android:layout_weight="0.3"
|
||||||
|
android:onClick="@{() -> view.save()}"
|
||||||
android:paddingEnd="3dp"
|
android:paddingEnd="3dp"
|
||||||
app:icon="@drawable/ic_save_24"
|
app:icon="@drawable/ic_save_24"
|
||||||
app:iconGravity="textStart"
|
app:iconGravity="textStart"
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/show_sheet"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="1000dp"
|
|
||||||
android:text="Hello World!"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
@ -30,7 +30,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'androidx.core:core-ktx:1.1.0'
|
implementation 'androidx.core:core-ktx:1.1.0'
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
|
||||||
implementation 'com.google.android.material:material:1.1.0-alpha10'
|
implementation 'com.google.android.material:material:1.1.0-alpha10'
|
||||||
|
|
||||||
api 'androidx.camera:camera-core:1.0.0-alpha03'
|
api 'androidx.camera:camera-core:1.0.0-alpha03'
|
||||||
|
|||||||
@ -10,7 +10,7 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.1'
|
classpath 'com.android.tools.build:gradle:3.6.2'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.google.gms:google-services:4.3.3'
|
classpath 'com.google.gms:google-services:4.3.3'
|
||||||
classpath 'com.google.firebase:perf-plugin:1.3.1'
|
classpath 'com.google.firebase:perf-plugin:1.3.1'
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
// UtilityToast.showToast("Avviato metodo in Frudis");
|
// UtilityToast.showToast("Avviato metodo in Frudis");
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||||
|
|||||||
@ -16,7 +16,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||||
|
|||||||
@ -16,7 +16,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
//UtilityToast.showToast("Avviato metodo in SaporiVeriPv");
|
//UtilityToast.showToast("Avviato metodo in SaporiVeriPv");
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
|||||||
public class OrdiniVendita implements IOrdiniVendita {
|
public class OrdiniVendita implements IOrdiniVendita {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void distribuisciCollo(MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
String codMdepOrder = testateOrdini.get(0).getCodMdep();
|
String codMdepOrder = testateOrdini.get(0).getCodMdep();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user