Fix su calcolo qta_da_evadere nel caso in cui si chiudono più UL consecutive
This commit is contained in:
parent
bb9846aaee
commit
be43d64176
@ -12,6 +12,8 @@ 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.ListaRettificaGiacenzeModelBinding;
|
||||
|
||||
public class RettificaGiacenzeMainListAdapter extends RecyclerView.Adapter<RettificaGiacenzeMainListAdapter.ViewHolder> {
|
||||
@ -58,12 +60,23 @@ public class RettificaGiacenzeMainListAdapter extends RecyclerView.Adapter<Retti
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(RettificaGiacenzeMainListAdapter.ViewHolder holder, int position) {
|
||||
MtbColr item = mDataset.get(position);
|
||||
holder.bind(item);
|
||||
MtbColr mtbColr = mDataset.get(position);
|
||||
holder.bind(mtbColr);
|
||||
|
||||
//Setting qty with unt_mis
|
||||
if(mtbColr.getMtbAart() != null) {
|
||||
if (mtbColr.getMtbAart().isFlagQtaCnfFissa()) {
|
||||
holder.mViewDataBinding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getQtaCol()) + (!UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : ""));
|
||||
} else {
|
||||
holder.mViewDataBinding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + mContext.getString(R.string.unt_mis_col));
|
||||
}
|
||||
} else {
|
||||
holder.mViewDataBinding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getQtaCol()));
|
||||
}
|
||||
|
||||
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
||||
if(mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(item, position);
|
||||
mOnItemClickListener.onItemClick(mtbColr, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -112,7 +125,7 @@ public class RettificaGiacenzeMainListAdapter extends RecyclerView.Adapter<Retti
|
||||
};
|
||||
|
||||
|
||||
void checkIfEmpty() {
|
||||
private void checkIfEmpty() {
|
||||
if (mEmptyView != null) {
|
||||
final boolean emptyViewVisible = getItemCount() == 0;
|
||||
mEmptyView.setVisibility(emptyViewVisible ? View.VISIBLE : View.GONE);
|
||||
|
||||
@ -56,6 +56,7 @@ import it.integry.integrywmsnative.gest.rettifica_giacenze.core.RettificaGiacenz
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.adapter.AutoCompleteFornitoreAdapter;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.adapter.RettificaGiacenzeMainListAdapter;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.dto.FornitoreDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLU;
|
||||
@ -505,26 +506,19 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
if (thereIsAnyRowInUL()) {
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(SettingsManager.iDB().getDefaultCausaleRettificaGiacenze()) && saveCausale) {
|
||||
posizionaCollo(() ->
|
||||
saveCausaleRettificaGiacenze(progress, () -> {
|
||||
if (!mtbColt.get().getDisablePrint()) {
|
||||
printCollo(progress);
|
||||
} else {
|
||||
progress.dismiss();
|
||||
resetMtbColt(openNewOne);
|
||||
}
|
||||
}), progress::dismiss, ex ->
|
||||
UtilityExceptions.defaultException(mContext, ex, progress)
|
||||
);
|
||||
saveCausaleRettificaGiacenze(progress, () -> {
|
||||
posizionaCollo(() -> postSaveOperations(openNewOne, progress),
|
||||
() -> {
|
||||
progress.dismiss();
|
||||
resetMtbColt(openNewOne);
|
||||
},
|
||||
ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
posizionaCollo(() -> {
|
||||
if (!mtbColt.get().getDisablePrint()) {
|
||||
printCollo(progress);
|
||||
} else {
|
||||
progress.dismiss();
|
||||
resetMtbColt(openNewOne);
|
||||
}
|
||||
postSaveOperations(openNewOne, progress);
|
||||
}, () -> {
|
||||
progress.dismiss();
|
||||
resetMtbColt(openNewOne);
|
||||
@ -541,6 +535,16 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void postSaveOperations(boolean openNewOne, Dialog progressDialog) {
|
||||
if (!mtbColt.get().getDisablePrint()) {
|
||||
printCollo(progressDialog);
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
resetMtbColt(openNewOne);
|
||||
}
|
||||
}
|
||||
|
||||
private void saveCausaleRettificaGiacenze(Dialog progress, Runnable onComplete) {
|
||||
|
||||
final MtbCols mtbCols = new MtbCols()
|
||||
@ -562,6 +566,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
DialogCommon.showRestError(mContext, ex, onComplete::run);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1166,7 +1166,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
// }
|
||||
|
||||
} else {
|
||||
dto.setQtaTot(tmpPickData.getQtaTot());
|
||||
dto.setQtaTot(qtaDaEvadere.floatValue() < tmpPickData.getQtaTot().floatValue() ? qtaDaEvadere : tmpPickData.getQtaTot());
|
||||
dto.setMaxQta(tmpPickData.getQtaTot());
|
||||
|
||||
if(tmpPickData.getNumCnf() != null) {
|
||||
|
||||
@ -41,4 +41,10 @@ public class DialogCommon {
|
||||
null, onPositiveClick).show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void showRestError(@NotNull Context context, Exception ex, @Nullable Runnable onPositiveClick) {
|
||||
DialogSimpleMessageHelper.makeErrorDialog(context,
|
||||
new SpannableString(ex.getMessage()), null, onPositiveClick).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,16 +23,18 @@
|
||||
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">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mart"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{mtbColr.codMart}"
|
||||
@ -42,6 +44,7 @@
|
||||
tools:text="COD MART" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/diacod"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{`(` + mtbColr.mtbAart.diacod + `)`}"
|
||||
@ -49,10 +52,28 @@
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_toEndOf="@id/cod_mart"
|
||||
android:visibility="@{(mtbColr.mtbAart != null && !UtilityString.isNullOrEmpty(mtbColr.mtbAart.diacod)) ? View.VISIBLE : View.GONE}"
|
||||
tools:text="(12345)" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<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="@{mtbColr.mtbAart != null && !mtbColr.mtbAart.isFlagQtaCnfFissa() ? 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
|
||||
@ -90,6 +111,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"
|
||||
@ -98,10 +120,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" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user