Fix su logica di richiesta lotto in Spedizione nel caso di più lotti presenti in una UL
This commit is contained in:
parent
3fddb6bcf7
commit
4a79b6c1bf
@ -25,7 +25,7 @@ public class UtilityBarcode {
|
||||
int currentYear = calendar.get(Calendar.YEAR);
|
||||
|
||||
String fullYear = "20" + UtilityBarcode.getAnnoColloFromULAnonima(barcode);
|
||||
return fullYear.equalsIgnoreCase("" + currentYear);
|
||||
return fullYear.equalsIgnoreCase(String.valueOf(currentYear));
|
||||
}
|
||||
|
||||
public static boolean isEtichetta128(BarcodeScanDTO barcodeScanDTO) {
|
||||
|
||||
@ -838,16 +838,16 @@ public class SpedizioneViewModel {
|
||||
.toList();
|
||||
|
||||
//Controllo se una delle partite combacia con quella che voglio evadere
|
||||
if (refMtbColr != null && refMtbColr.getMtbPartitaMag() != null) {
|
||||
MtbPartitaMag refMtbPartitaMag = refMtbColr.getMtbPartitaMag();
|
||||
|
||||
Optional<MtbPartitaMag> matchPartitaMag = Stream.of(availableBatchLots).filter(availableBatchLot -> refMtbPartitaMag.getPartitaMag().equalsIgnoreCase(availableBatchLot.getPartitaMag())).findFirst();
|
||||
|
||||
if (matchPartitaMag.isPresent()) {
|
||||
availableBatchLots.clear();
|
||||
availableBatchLots.add(refMtbPartitaMag);
|
||||
}
|
||||
}
|
||||
// if (refMtbColr != null && refMtbColr.getMtbPartitaMag() != null) {
|
||||
// MtbPartitaMag refMtbPartitaMag = refMtbColr.getMtbPartitaMag();
|
||||
//
|
||||
// Optional<MtbPartitaMag> matchPartitaMag = Stream.of(availableBatchLots).filter(availableBatchLot -> refMtbPartitaMag.getPartitaMag().equalsIgnoreCase(availableBatchLot.getPartitaMag())).findFirst();
|
||||
//
|
||||
// if (matchPartitaMag.isPresent()) {
|
||||
// availableBatchLots.clear();
|
||||
// availableBatchLots.add(refMtbPartitaMag);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (availableBatchLots.size() > 1) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
@ -17,7 +17,7 @@ public class DialogAskLineaProdViewModel {
|
||||
|
||||
MtbDepoPosizione foundPosizione = UtilityPosizione.getFromCache(data.getStringValue());
|
||||
|
||||
if (!foundPosizione.isFlagLineaProduzione()) {
|
||||
if (foundPosizione == null || !foundPosizione.isFlagLineaProduzione()) {
|
||||
this.sendError(new InvalidLineaProdBarcodeException(data.getStringValue()));
|
||||
onComplete.run();
|
||||
return;
|
||||
|
||||
@ -1,20 +1,18 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.choose_batch_lot;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -52,30 +50,37 @@ public class DialogChooseBatchLotView extends BaseDialogFragment {
|
||||
this.mOnItemSelected = onItemSelected;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NonNull
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
this.mContext = getActivity();
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
this.mContext = requireContext();
|
||||
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_batch_lot, container, false);
|
||||
mBindings = DialogChooseBatchLotBinding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialogChooseBatchLotComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
mBindings.setView(this);
|
||||
mBindings.setViewmodel(this.mViewModel);
|
||||
|
||||
getDialog().setCanceledOnTouchOutside(false);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
setCancelable(false);
|
||||
|
||||
return mBindings.getRoot();
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(isCancelable())
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
alertDialog.setOnDismissListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
super.onShow(dialogInterface);
|
||||
|
||||
this.initRecyclerView();
|
||||
}
|
||||
|
||||
@ -5,21 +5,10 @@
|
||||
|
||||
<data>
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityBigDecimal" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="viewmodel"
|
||||
type="it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotViewModel" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotView" />
|
||||
</data>
|
||||
|
||||
|
||||
@ -28,55 +17,37 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="16dp">
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:src="@drawable/ic_error_white_24dp"
|
||||
app:tint="?colorPrimary" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/light_blue_300"
|
||||
android:gravity="center_horizontal">
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/select_batch_lot" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="24dp"
|
||||
android:src="@drawable/ic_error_white_24dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingRight="24dp"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/select_batch_lot" />
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user