Implementate unt_mis in base al flagQtaCnfFissa degli articoli.
This commit is contained in:
parent
58b0db488d
commit
9ab77bab3c
@ -11,12 +11,14 @@ import android.view.ViewGroup;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.ListaContenutoBancaleListModelBinding;
|
||||
|
||||
public class ContenutoBancaleListAdapter extends RecyclerView.Adapter<ContenutoBancaleListAdapter.ViewHolder> {
|
||||
|
||||
|
||||
protected Context mContext;
|
||||
protected static Context mContext;
|
||||
protected ObservableArrayList<MtbColr> mDataset;
|
||||
|
||||
private IRecyclerItemClicked<MtbColr> mOnItemClickListener;
|
||||
@ -32,6 +34,18 @@ public class ContenutoBancaleListAdapter extends RecyclerView.Adapter<ContenutoB
|
||||
|
||||
public void bind(MtbColr mtbColr) {
|
||||
mViewDataBinding.setMtbColr(mtbColr);
|
||||
|
||||
|
||||
if(mtbColr.getMtbAart() != null) {
|
||||
if (mtbColr.getMtbAart().isFlagQtaCnfFissa()) {
|
||||
mViewDataBinding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getQtaCol()) + (!UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : ""));
|
||||
} else {
|
||||
mViewDataBinding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + mContext.getString(R.string.unt_mis_col));
|
||||
}
|
||||
} else {
|
||||
mViewDataBinding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getQtaCol()));
|
||||
}
|
||||
|
||||
mViewDataBinding.executePendingBindings();
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,7 +186,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
Dialog finalProgress = progress;
|
||||
|
||||
|
||||
final MtbColt mtbColtScarico = new MtbColt()
|
||||
.setDataCollo(item.getDataCollo())
|
||||
.setSerCollo(item.getSerCollo())
|
||||
@ -205,8 +204,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
.setGestioneRif(item.getGestioneRif())
|
||||
.setSerColloRif(item.getSerColloRif());
|
||||
|
||||
|
||||
|
||||
mtbColrScarico.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
mtbColtScarico.getMtbColr().add(mtbColrScarico);
|
||||
@ -216,7 +213,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
if(mtbColt != null) {
|
||||
|
||||
|
||||
List<MtbColt> colliToSave = new ArrayList<>();
|
||||
boolean shouldPrint = false;
|
||||
|
||||
@ -271,11 +267,9 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
UtilityExceptions.defaultException(mContext, ex, finalProgress);
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
finalProgress.dismiss();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
if(sourceMtbColt != null) saveRunnable.run(sourceMtbColt);
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
package it.integry.integrywmsnative.gest.vendita.dto;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@ -16,7 +13,7 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
public class PickingObjectDTO implements Parcelable {
|
||||
public class PickingObjectDTO {
|
||||
|
||||
private Integer numCollo;
|
||||
private String gestione;
|
||||
@ -35,7 +32,7 @@ public class PickingObjectDTO implements Parcelable {
|
||||
private String partitaMag;
|
||||
private BigDecimal qtaOrd;
|
||||
private BigDecimal numCnfCollo;
|
||||
private BigDecimal numCnf;
|
||||
private BigDecimal numCnfOrd;
|
||||
private String codAlis;
|
||||
private BigDecimal colliPedana;
|
||||
private BigDecimal qtaDisponibileCollo;
|
||||
@ -51,165 +48,6 @@ public class PickingObjectDTO implements Parcelable {
|
||||
|
||||
private ArrayList<MtbColr> withdrawRows = new ArrayList<>();
|
||||
|
||||
protected PickingObjectDTO(Parcel in) {
|
||||
if (in.readByte() == 0) {
|
||||
numCollo = null;
|
||||
} else {
|
||||
numCollo = in.readInt();
|
||||
}
|
||||
gestione = in.readString();
|
||||
serCollo = in.readString();
|
||||
descrizioneEstesa = in.readString();
|
||||
codJcom = in.readString();
|
||||
codMart = in.readString();
|
||||
posizione = in.readString();
|
||||
dataCollo = in.readString();
|
||||
if (in.readByte() == 0) {
|
||||
idViaggio = null;
|
||||
} else {
|
||||
idViaggio = in.readInt();
|
||||
}
|
||||
codTagl = in.readString();
|
||||
codCol = in.readString();
|
||||
dataScad = in.readString();
|
||||
codArtFor = in.readString();
|
||||
partitaMag = in.readString();
|
||||
codAlis = in.readString();
|
||||
hidden = in.readByte() == 0x00 ? null : in.readByte() != 0x00;
|
||||
deactivated = in.readByte() == 0x00 ? null : in.readByte() != 0x00;
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
qtaCollo = null;
|
||||
} else {
|
||||
qtaCollo = new BigDecimal(in.readFloat());
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
qtaOrd = null;
|
||||
} else {
|
||||
qtaOrd = new BigDecimal(in.readFloat());
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numCnf = null;
|
||||
} else {
|
||||
numCnf = new BigDecimal(in.readFloat());
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numCnfCollo = null;
|
||||
} else {
|
||||
numCnfCollo = new BigDecimal(in.readFloat());
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
qtaDisponibileCollo = null;
|
||||
} else {
|
||||
qtaDisponibileCollo = new BigDecimal(in.readFloat());
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numCnfDisponibileCollo = null;
|
||||
} else {
|
||||
numCnfDisponibileCollo = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
|
||||
mtbAart = (MtbAart) in.readValue(MtbAart.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
if (numCollo == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numCollo);
|
||||
}
|
||||
dest.writeString(gestione);
|
||||
dest.writeString(serCollo);
|
||||
dest.writeString(descrizioneEstesa);
|
||||
dest.writeString(codJcom);
|
||||
dest.writeString(codMart);
|
||||
dest.writeString(posizione);
|
||||
dest.writeString(dataCollo);
|
||||
if (idViaggio == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(idViaggio);
|
||||
}
|
||||
dest.writeString(codTagl);
|
||||
dest.writeString(codCol);
|
||||
dest.writeString(dataScad);
|
||||
dest.writeString(codArtFor);
|
||||
dest.writeString(partitaMag);
|
||||
dest.writeString(codAlis);
|
||||
if (hidden == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeByte((byte) (hidden ? 0x01 : 0x00));
|
||||
}
|
||||
if (deactivated == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeByte((byte) (deactivated ? 0x01 : 0x00));
|
||||
}
|
||||
|
||||
if (qtaCollo == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeFloat(qtaCollo.floatValue());
|
||||
}
|
||||
if (qtaOrd == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeFloat(qtaOrd.floatValue());
|
||||
}
|
||||
if (numCnf == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeFloat(numCnf.floatValue());
|
||||
}
|
||||
if (numCnfCollo == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeFloat(numCnfCollo.floatValue());
|
||||
}
|
||||
if (qtaDisponibileCollo == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeFloat(qtaDisponibileCollo.floatValue());
|
||||
}
|
||||
if (numCnfDisponibileCollo == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeFloat(numCnfDisponibileCollo.floatValue());
|
||||
}
|
||||
|
||||
dest.writeValue(mtbAart);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<PickingObjectDTO> CREATOR = new Creator<PickingObjectDTO>() {
|
||||
@Override
|
||||
public PickingObjectDTO createFromParcel(Parcel in) {
|
||||
return new PickingObjectDTO(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PickingObjectDTO[] newArray(int size) {
|
||||
return new PickingObjectDTO[size];
|
||||
}
|
||||
};
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
@ -384,12 +222,12 @@ public class PickingObjectDTO implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnf() {
|
||||
return numCnf;
|
||||
public BigDecimal getNumCnfOrd() {
|
||||
return numCnfOrd;
|
||||
}
|
||||
|
||||
public PickingObjectDTO setNumCnf(BigDecimal numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
public PickingObjectDTO setNumCnfOrd(BigDecimal numCnfOrd) {
|
||||
this.numCnfOrd = numCnfOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@ -200,7 +200,8 @@ public class MainListOrdineVenditaInevasoAdapter extends RecyclerView.Adapter<Ma
|
||||
final TextView qtaTot = groupModelView.findViewById(R.id.vendita_ordine_inevaso_main_list_group_item_qta_tot);
|
||||
qtaTot.setText(UtilityNumber.decimalToString(rowItem.getQtaOrdinata()));
|
||||
|
||||
|
||||
final TextView untMis = groupModelView.findViewById(R.id.vendita_ordine_inevaso_main_list_group_item_unt_mis);
|
||||
untMis.setText(rowItem.getUntMis());
|
||||
|
||||
|
||||
|
||||
|
||||
@ -149,7 +149,14 @@ public class VenditaOrdineInevasoHelper {
|
||||
}
|
||||
|
||||
rowModel.setQtaRiservata(getRigaQuantityEvasa(currentItem, mtbColrs));
|
||||
rowModel.setQtaOrdinata(currentItem.getNumCollo() != null ? currentItem.getQtaCollo() : currentItem.getQtaOrd());
|
||||
|
||||
if(currentItem.getMtbAart().isFlagQtaCnfFissa()) {
|
||||
rowModel.setUntMis(currentItem.getMtbAart().getUntMis());
|
||||
rowModel.setQtaOrdinata(currentItem.getNumCollo() != null ? currentItem.getQtaCollo() : currentItem.getQtaOrd());
|
||||
} else {
|
||||
rowModel.setUntMis("col");
|
||||
rowModel.setQtaOrdinata(currentItem.getNumCollo() != null ? currentItem.getNumCnfDisponibileCollo() : currentItem.getNumCnfOrd());
|
||||
}
|
||||
|
||||
rowModel.setOriginalModel(currentItem);
|
||||
|
||||
@ -166,16 +173,8 @@ public class VenditaOrdineInevasoHelper {
|
||||
BigDecimal currentQtaEvasa = BigDecimal.ZERO;
|
||||
|
||||
if(mtbColrs != null) {
|
||||
|
||||
|
||||
// List<MtbColr> filteredMtbColrs = Stream.of(mtbColrs).filter(
|
||||
// x -> x.getCodMart().equalsIgnoreCase(item.getCodMart()) &&
|
||||
// ((x.getCodJcom() == null && item.getCodJcom() == null) || (x.getCodJcom() != null && x.getCodJcom().equalsIgnoreCase(item.getCodJcom()))) &&
|
||||
// (!SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() || (SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() && ((x.getPartitaMag() == null && item.getPartitaMag() == null) || (x.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(item.getPartitaMag()))))) &&
|
||||
// ((x.getNumColloRif() == null && item.getNumCollo() == null) || (x.getNumColloRif() != null && x.getNumColloRif().equals(item.getNumCollo())))).toList();
|
||||
|
||||
for (MtbColr mtbColr : item.getWithdrawRows()) {
|
||||
currentQtaEvasa = currentQtaEvasa.add(mtbColr.getQtaCol());
|
||||
currentQtaEvasa = currentQtaEvasa.add(item.getMtbAart().isFlagQtaCnfFissa() ? mtbColr.getQtaCol() : mtbColr.getNumCnf());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ public class VenditaOrdineInevasoListViewModel {
|
||||
private String subDescrizione2;
|
||||
private BigDecimal qtaRiservata;
|
||||
private BigDecimal qtaOrdinata;
|
||||
private String untMis;
|
||||
|
||||
private PickingObjectDTO originalModel;
|
||||
|
||||
@ -101,6 +102,15 @@ public class VenditaOrdineInevasoListViewModel {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public SubItem setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -66,8 +66,6 @@ public class ArticoliInColloBottomSheetHelper extends BottomSheetBehavior.Bottom
|
||||
|
||||
|
||||
mBinding.articoliInColloDetailsPosizione.setText(mtbColt.getPosizione() != null ? mtbColt.getPosizione() : "N/A");
|
||||
// mBindings.articoliInColloDetailsPreparatoDa.setText(mtbColt.getPreparatoDa() != null ? mtbColt.getPreparatoDa() : "N/A");
|
||||
|
||||
}
|
||||
|
||||
public void updateRigheNumber(int newRigheNumber){
|
||||
|
||||
@ -0,0 +1,135 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.view;
|
||||
|
||||
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.ObservableField;
|
||||
import androidx.databinding.ObservableList;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetMtbcolrItemBinding;
|
||||
|
||||
public class ArticoliInColloBottomSheetMtbColrAdapter extends BaseAdapter {
|
||||
|
||||
|
||||
private final WeakReferenceOnListChangedCallback onListChangedCallback;
|
||||
private Context mContext;
|
||||
private ObservableField<MtbColt> mtbColt;
|
||||
|
||||
|
||||
public ArticoliInColloBottomSheetMtbColrAdapter(Context context, ObservableField<MtbColt> mtbColt) {
|
||||
super();
|
||||
this.mContext = context;
|
||||
this.mtbColt = mtbColt;
|
||||
this.onListChangedCallback = new WeakReferenceOnListChangedCallback(this);
|
||||
|
||||
this.mtbColt.get().getMtbColr().addOnListChangedCallback(onListChangedCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||
|
||||
FragmentArticoliInColloBottomSheetMtbcolrItemBinding binding = DataBindingUtil.inflate(inflater, R.layout.fragment_articoli_in_collo_bottom_sheet__mtbcolr_item, parent, false);
|
||||
|
||||
final MtbColr mtbColr = mtbColt.get().getMtbColr().get(position);
|
||||
binding.setMtbColr(mtbColr);
|
||||
|
||||
//Setting qty with unt_mis
|
||||
if(mtbColr.getMtbAart() != null) {
|
||||
if (mtbColr.getMtbAart().isFlagQtaCnfFissa()) {
|
||||
binding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getQtaCol()) + (!UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : ""));
|
||||
} else {
|
||||
binding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + mContext.getString(R.string.unt_mis_col));
|
||||
}
|
||||
} else {
|
||||
binding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getQtaCol()));
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36,6 +36,7 @@ import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomShee
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetMtbcolrItemBinding;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.ArticoliInColloBottomSheetHelper;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnColloClosedCallback;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.view.ArticoliInColloBottomSheetMtbColrAdapter;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||
|
||||
@ -64,21 +65,13 @@ public class ArticoliInColloBottomSheetViewModel {
|
||||
|
||||
mBindings.setViewModel(this);
|
||||
|
||||
// ShapeAppearanceModel shapeAppearanceModel = new ShapeAppearanceModel();
|
||||
//
|
||||
// shapeAppearanceModel.setTopLeftCorner(CornerFamily.ROUNDED, 6);
|
||||
// shapeAppearanceModel.setTopRightCorner(CornerFamily.ROUNDED, 6);
|
||||
//
|
||||
// MaterialShapeDrawable materialShapeDrawable = new MaterialShapeDrawable(shapeAppearanceModel);
|
||||
// mBindings.getRoot().setBackground(materialShapeDrawable);
|
||||
|
||||
mtbColt.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
|
||||
if(mtbColt.get() != null) {
|
||||
|
||||
mBindings.linearListview.setAdapter(new ArticoliInColloBottomSheetMtbColrAdapter());
|
||||
mBindings.linearListview.setAdapter(new ArticoliInColloBottomSheetMtbColrAdapter(mContext, mtbColt));
|
||||
|
||||
mBindings.linearListview.setOnItemClickListener((parent, view, position, id) -> {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
@ -192,6 +185,7 @@ public class ArticoliInColloBottomSheetViewModel {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
itemToEdit.setQtaCol(quantityDTO.qtaTot.getBigDecimal());
|
||||
itemToEdit.setNumCnf(quantityDTO.numCnf.getBigDecimal());
|
||||
|
||||
ColliMagazzinoRESTConsumer.updateRiga(itemToEdit, () ->{
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
@ -232,101 +226,6 @@ public class ArticoliInColloBottomSheetViewModel {
|
||||
}
|
||||
|
||||
|
||||
public class ArticoliInColloBottomSheetMtbColrAdapter extends BaseAdapter {
|
||||
|
||||
|
||||
private final WeakReferenceOnListChangedCallback onListChangedCallback;
|
||||
|
||||
public ArticoliInColloBottomSheetMtbColrAdapter() {
|
||||
super();
|
||||
this.onListChangedCallback = new WeakReferenceOnListChangedCallback(this);
|
||||
|
||||
mtbColt.get().getMtbColr().addOnListChangedCallback(onListChangedCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||
|
||||
FragmentArticoliInColloBottomSheetMtbcolrItemBinding binding = DataBindingUtil.inflate(inflater, R.layout.fragment_articoli_in_collo_bottom_sheet__mtbcolr_item, parent, false);
|
||||
|
||||
final MtbColr item = mtbColt.get().getMtbColr().get(position);
|
||||
binding.setMtbColr(item);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
android:layout_gravity="end"
|
||||
android:background="@drawable/ripple_effect"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_search_black_24dp"
|
||||
android:src="@drawable/ic_black_barcode"
|
||||
android:visibility="@{BuildConfig.DEBUG ? View.VISIBLE : View.GONE}"
|
||||
android:onClick="@{() -> viewmodel.manualSearch()}"
|
||||
android:tint="@color/colorPrimaryGray"/>
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
android:textStyle="bold"
|
||||
android:drawablePadding="12dp"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
@ -57,19 +57,6 @@
|
||||
android:textSize="16sp"
|
||||
style="@style/AppTheme.NewMaterial.Text"/>
|
||||
|
||||
<!--<Button-->
|
||||
<!--android:id="@+id/articoli_in_collo_close_collo"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:text="@string/action_close_ul"-->
|
||||
<!--android:textSize="16sp"-->
|
||||
<!--android:layout_alignParentEnd="true"-->
|
||||
<!--android:theme="@style/white_button"-->
|
||||
<!--android:drawableEnd="@drawable/ic_close_red_24dp"-->
|
||||
<!--android:drawablePadding="8dp"-->
|
||||
<!--android:onClick="@{() -> viewModel.closeCurrentUL()}"-->
|
||||
<!--android:drawableTint="@color/red_600"-->
|
||||
<!--android:textColor="@color/red_600"/>-->
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
@ -84,23 +71,6 @@
|
||||
android:onClick="@{() -> viewModel.closeCurrentUL()}"
|
||||
app:strokeColor="@color/red_600"/>
|
||||
|
||||
<!--<android.support.v7.widget.AppCompatButton-->
|
||||
<!--android:id="@+id/articoli_in_collo_close_collo"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
<!--android:drawableEnd="@drawable/ic_close_red_24dp"-->
|
||||
<!--android:drawableTint="@color/red_600"-->
|
||||
<!--android:text="@string/action_close_ul"-->
|
||||
<!--android:textColor="@color/red_600"-->
|
||||
<!--android:paddingTop="8dp"-->
|
||||
<!--android:paddingBottom="8dp"-->
|
||||
<!--android:paddingLeft="16dp"-->
|
||||
<!--android:paddingRight="16dp"-->
|
||||
<!--android:elevation="0dp"-->
|
||||
<!--android:theme="@style/white_button"-->
|
||||
<!--android:layout_alignParentEnd="true"-->
|
||||
<!--android:textSize="16sp"-->
|
||||
<!--android:onClick="@{() -> viewModel.closeCurrentUL()}"/>-->
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -314,6 +284,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/already_read_articles"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:textAllCaps="true"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
@ -356,6 +327,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical"
|
||||
app:dividerThickness="0.5dp" />
|
||||
|
||||
@ -409,9 +381,11 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="center"
|
||||
android:text="Cioccolato"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Title"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle.DarkActionBar"
|
||||
tools:text="Num UL"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@ -451,6 +425,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_sheet_actions_quantity"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
@ -460,30 +435,31 @@
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Descrizione articolo"
|
||||
android:textColor="#444"
|
||||
android:textSize="18dp"
|
||||
android:maxLines="1"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:paddingRight="8dp"
|
||||
android:textStyle="bold" />
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:textStyle="bold"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="ABF52IL"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_actions_quantity"
|
||||
android:layout_width="wrap_content"
|
||||
android:gravity="right"
|
||||
android:gravity="end"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:textSize="15dp"
|
||||
tools:text="250 PZ"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@ -504,6 +480,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_action"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:gravity="center">
|
||||
@ -530,6 +507,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/guideline_action"
|
||||
android:gravity="center">
|
||||
|
||||
@ -34,19 +34,19 @@
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="COD MART" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toLeftOf="@id/posizione_collo"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@{mtbColr.getDescrizione()}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="Descrizione lunga articolo" />
|
||||
|
||||
|
||||
@ -56,6 +56,7 @@
|
||||
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>
|
||||
@ -72,6 +73,7 @@
|
||||
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"
|
||||
@ -80,10 +82,11 @@
|
||||
android:paddingTop="2dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@{UtilityNumber.decimalToString(mtbColr.getQtaCol()) + (mtbColr.mtbAart != null && !UtilityString.isNullOrEmpty(mtbColr.mtbAart.untMis) ? `\n` + mtbColr.mtbAart.untMis : ``)}"
|
||||
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>
|
||||
|
||||
@ -84,6 +84,7 @@
|
||||
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"
|
||||
@ -92,10 +93,10 @@
|
||||
android:paddingTop="2dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@{UtilityNumber.decimalToString(mtbColr.getQtaCol()) + (mtbColr.mtbAart != null && !UtilityString.isNullOrEmpty(mtbColr.mtbAart.untMis) ? `\n` + mtbColr.mtbAart.untMis : ``)}"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
android:textAllCaps="true"
|
||||
tools:text="280.45\nCONF"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
android:id="@+id/vendita_ordine_inevaso_main_list_group_item_qta_evasa"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/green_700"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
@ -73,6 +73,17 @@
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
tools:text="QTA"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/vendita_ordine_inevaso_main_list_group_item_unt_mis"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textAllCaps="true"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="cnf"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -85,9 +85,10 @@
|
||||
<item quantity="other">pezzi</item>
|
||||
</plurals>
|
||||
<plurals name="item_package">
|
||||
<item quantity="one">confezione</item>
|
||||
<item quantity="other">confezioni</item>
|
||||
<item quantity="one">collo</item>
|
||||
<item quantity="other">colli</item>
|
||||
</plurals>
|
||||
<string name="unt_mis_col">col</string>
|
||||
<string name="action_close_ul">Chiudi UL</string>
|
||||
<string name="already_read_articles">Articoli presenti</string>
|
||||
<string name="orders">Ordini</string>
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
<item quantity="one">package</item>
|
||||
<item quantity="other">packages</item>
|
||||
</plurals>
|
||||
<string name="unt_mis_col">pkg</string>
|
||||
<string name="app_name" translatable="false">Integry WMS</string>
|
||||
<string name="integry" translatable="false">Integry</string>
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
|
||||
@ -52,6 +52,12 @@
|
||||
<item name="android:textColor">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NewMaterial.Text.ToolbarTitle.DarkActionBar" parent="AppTheme.NewMaterial.Text">
|
||||
<item name="android:textSize">20sp</item>
|
||||
<!--<item name="android:textColor">#5F6368</item>-->
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NewMaterial.Text.ListDivider" parent="AppTheme.NewMaterial.Text">
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:textColor">#5F6368</item>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user