Fix su dialogFragment
This commit is contained in:
parent
5b1f681a11
commit
adde82c191
@ -1,8 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
@ -15,6 +19,13 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
|
||||
public BaseDialogFragment() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
||||
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
|
||||
@ -25,7 +36,6 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private boolean isControlKey(KeyEvent keyEvent) {
|
||||
int keyCode = keyEvent.getKeyCode();
|
||||
return (
|
||||
|
||||
@ -120,7 +120,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
setSupportActionBar(this.mBindings.toolbar);
|
||||
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
mShowSecondaryUntMis = sharedPreferences.getBoolean("picking_enable_sec_unt_mis", true);
|
||||
mShowSecondaryUntMis = sharedPreferences.getBoolean("picking_ingresso_enable_sec_unt_mis", true);
|
||||
|
||||
this.initVars();
|
||||
this.initBarcodeReader();
|
||||
|
||||
@ -2,12 +2,14 @@ package it.integry.integrywmsnative.gest.spedizione;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
@ -94,6 +96,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
private boolean mEnableGiacenza;
|
||||
private boolean mFlagShowCodForn;
|
||||
private boolean mDivideByGrpMerc;
|
||||
private boolean mEnableQuantityReset;
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
|
||||
private ArrayList<SitArtOrdDTO> mSitArtOrd;
|
||||
@ -170,6 +173,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
mFlagShowCodForn = customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE);
|
||||
mDivideByGrpMerc = customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC);
|
||||
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
mEnableQuantityReset = sharedPreferences.getBoolean("picking_uscita_enable_quantity_reset", true);
|
||||
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setSpedizioneView(this);
|
||||
|
||||
@ -204,7 +210,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
mTestateOrdini,
|
||||
mColliRegistrati,
|
||||
reportNameSpedizioneChiudiOrdine,
|
||||
mGestioneCol, mSegnoCol, mDefaultCausaleUL);
|
||||
mGestioneCol, mSegnoCol, mDefaultCausaleUL,
|
||||
mEnableQuantityReset);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -94,6 +94,7 @@ public class SpedizioneViewModel {
|
||||
private boolean mShouldAskPesoLU;
|
||||
private String mReportNameSpedizioneChiudiOrdine;
|
||||
private boolean mIsNewLU;
|
||||
private boolean mEnableQuantityReset;
|
||||
|
||||
private MtbColt mCurrentMtbColt = null;
|
||||
|
||||
@ -135,7 +136,8 @@ public class SpedizioneViewModel {
|
||||
String reportNameSpedizioneChiudiOrdine,
|
||||
GestioneEnum gestioneCol,
|
||||
int segnoCol,
|
||||
Integer defaultCausaleUL) {
|
||||
Integer defaultCausaleUL,
|
||||
boolean enableQuantityReset) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
this.mDefaultCodMdep = codMdep;
|
||||
@ -147,6 +149,7 @@ public class SpedizioneViewModel {
|
||||
this.mShouldAskPesoLU = shouldAskPesoLU;
|
||||
this.mReportNameSpedizioneChiudiOrdine = reportNameSpedizioneChiudiOrdine;
|
||||
this.mDefaultCausaleOfUL = defaultCausaleUL;
|
||||
this.mEnableQuantityReset = enableQuantityReset;
|
||||
|
||||
if (enableGiacenza) {
|
||||
mOrdiniRestConsumerService.getSuggestedPickingList(this.mDefaultCodMdep, pickingList, pickingObjectList -> {
|
||||
@ -1674,6 +1677,7 @@ public class SpedizioneViewModel {
|
||||
this.mCurrentMtbColt = null;
|
||||
|
||||
|
||||
if(mEnableQuantityReset) {
|
||||
for (PickingObjectDTO pickingObjectDTO : mPickingList.getValue()) {
|
||||
|
||||
List<MtbColr> withdrawMtbColrList = pickingObjectDTO.getWithdrawMtbColrs();
|
||||
@ -1706,28 +1710,12 @@ public class SpedizioneViewModel {
|
||||
mtbColr.setQtaCol(mtbColr.getQtaCol().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
|
||||
|
||||
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
pickingObjectDTO.setWithdrawMtbColrs(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
this.mIsNewLU = false;
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<string name="accettazione_ordine_inevaso_title_multiple_order">Ordini di accettazione</string>
|
||||
<string name="vendita_title_fragment">Spedizione</string>
|
||||
<string name="rettifica_giacenze_fragment_title">Rettifica giacenze</string>
|
||||
<string name="prod_fabbisogno_linee_prod_title">Approvv. linee prod.</string>
|
||||
<string name="prod_fabbisogno_linee_prod_title">Approvvig. linee prod.</string>
|
||||
<string name="versamento_merce_fragment_title">Posizionamento merce</string>
|
||||
<string name="error">Errore</string>
|
||||
<string name="ops">Ops</string>
|
||||
|
||||
@ -5,10 +5,18 @@
|
||||
app:title="@string/accettazione_title_fragment"/>
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
app:key="picking_enable_sec_unt_mis"
|
||||
app:key="picking_ingresso_enable_sec_unt_mis"
|
||||
app:title="Abilita seconda unità di misura"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
<PreferenceCategory
|
||||
app:title="@string/vendita_title_fragment"/>
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
app:key="picking_uscita_enable_quantity_reset"
|
||||
app:title="Resetta le quantità ad ogni Chiudi UL"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
<!-- <Preference-->
|
||||
<!-- app:key="feedback"-->
|
||||
<!-- app:title="Send feedback"-->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user