Fix su dialogFragment
This commit is contained in:
parent
5b1f681a11
commit
adde82c191
@ -1,8 +1,12 @@
|
|||||||
package it.integry.integrywmsnative.core.expansion;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.DialogFragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
@ -15,6 +19,13 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
|
|
||||||
public BaseDialogFragment() {
|
public BaseDialogFragment() {
|
||||||
super();
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||||
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(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) {
|
private boolean isControlKey(KeyEvent keyEvent) {
|
||||||
int keyCode = keyEvent.getKeyCode();
|
int keyCode = keyEvent.getKeyCode();
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -120,7 +120,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
setSupportActionBar(this.mBindings.toolbar);
|
setSupportActionBar(this.mBindings.toolbar);
|
||||||
|
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
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.initVars();
|
||||||
this.initBarcodeReader();
|
this.initBarcodeReader();
|
||||||
|
|||||||
@ -2,12 +2,14 @@ package it.integry.integrywmsnative.gest.spedizione;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
@ -94,6 +96,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
private boolean mEnableGiacenza;
|
private boolean mEnableGiacenza;
|
||||||
private boolean mFlagShowCodForn;
|
private boolean mFlagShowCodForn;
|
||||||
private boolean mDivideByGrpMerc;
|
private boolean mDivideByGrpMerc;
|
||||||
|
private boolean mEnableQuantityReset;
|
||||||
private int barcodeScannerIstanceID = -1;
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
|
||||||
private ArrayList<SitArtOrdDTO> mSitArtOrd;
|
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);
|
mFlagShowCodForn = customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE);
|
||||||
mDivideByGrpMerc = customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC);
|
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.setLifecycleOwner(this);
|
||||||
mBindings.setSpedizioneView(this);
|
mBindings.setSpedizioneView(this);
|
||||||
|
|
||||||
@ -204,7 +210,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
mTestateOrdini,
|
mTestateOrdini,
|
||||||
mColliRegistrati,
|
mColliRegistrati,
|
||||||
reportNameSpedizioneChiudiOrdine,
|
reportNameSpedizioneChiudiOrdine,
|
||||||
mGestioneCol, mSegnoCol, mDefaultCausaleUL);
|
mGestioneCol, mSegnoCol, mDefaultCausaleUL,
|
||||||
|
mEnableQuantityReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -94,6 +94,7 @@ public class SpedizioneViewModel {
|
|||||||
private boolean mShouldAskPesoLU;
|
private boolean mShouldAskPesoLU;
|
||||||
private String mReportNameSpedizioneChiudiOrdine;
|
private String mReportNameSpedizioneChiudiOrdine;
|
||||||
private boolean mIsNewLU;
|
private boolean mIsNewLU;
|
||||||
|
private boolean mEnableQuantityReset;
|
||||||
|
|
||||||
private MtbColt mCurrentMtbColt = null;
|
private MtbColt mCurrentMtbColt = null;
|
||||||
|
|
||||||
@ -135,7 +136,8 @@ public class SpedizioneViewModel {
|
|||||||
String reportNameSpedizioneChiudiOrdine,
|
String reportNameSpedizioneChiudiOrdine,
|
||||||
GestioneEnum gestioneCol,
|
GestioneEnum gestioneCol,
|
||||||
int segnoCol,
|
int segnoCol,
|
||||||
Integer defaultCausaleUL) {
|
Integer defaultCausaleUL,
|
||||||
|
boolean enableQuantityReset) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
this.mDefaultCodMdep = codMdep;
|
this.mDefaultCodMdep = codMdep;
|
||||||
@ -147,6 +149,7 @@ public class SpedizioneViewModel {
|
|||||||
this.mShouldAskPesoLU = shouldAskPesoLU;
|
this.mShouldAskPesoLU = shouldAskPesoLU;
|
||||||
this.mReportNameSpedizioneChiudiOrdine = reportNameSpedizioneChiudiOrdine;
|
this.mReportNameSpedizioneChiudiOrdine = reportNameSpedizioneChiudiOrdine;
|
||||||
this.mDefaultCausaleOfUL = defaultCausaleUL;
|
this.mDefaultCausaleOfUL = defaultCausaleUL;
|
||||||
|
this.mEnableQuantityReset = enableQuantityReset;
|
||||||
|
|
||||||
if (enableGiacenza) {
|
if (enableGiacenza) {
|
||||||
mOrdiniRestConsumerService.getSuggestedPickingList(this.mDefaultCodMdep, pickingList, pickingObjectList -> {
|
mOrdiniRestConsumerService.getSuggestedPickingList(this.mDefaultCodMdep, pickingList, pickingObjectList -> {
|
||||||
@ -1674,59 +1677,44 @@ public class SpedizioneViewModel {
|
|||||||
this.mCurrentMtbColt = null;
|
this.mCurrentMtbColt = null;
|
||||||
|
|
||||||
|
|
||||||
for (PickingObjectDTO pickingObjectDTO : mPickingList.getValue()) {
|
if(mEnableQuantityReset) {
|
||||||
|
for (PickingObjectDTO pickingObjectDTO : mPickingList.getValue()) {
|
||||||
|
|
||||||
List<MtbColr> withdrawMtbColrList = pickingObjectDTO.getWithdrawMtbColrs();
|
List<MtbColr> withdrawMtbColrList = pickingObjectDTO.getWithdrawMtbColrs();
|
||||||
|
|
||||||
for (MtbColr withdrawMtbColr : withdrawMtbColrList) {
|
for (MtbColr withdrawMtbColr : withdrawMtbColrList) {
|
||||||
pickingObjectDTO.getSitArtOrdDTO().setNumCnfOrd(pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd().subtract(withdrawMtbColr.getNumCnf()));
|
pickingObjectDTO.getSitArtOrdDTO().setNumCnfOrd(pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd().subtract(withdrawMtbColr.getNumCnf()));
|
||||||
pickingObjectDTO.getSitArtOrdDTO().setQtaOrd(pickingObjectDTO.getSitArtOrdDTO().getQtaOrd().subtract(withdrawMtbColr.getQtaCol()));
|
pickingObjectDTO.getSitArtOrdDTO().setQtaOrd(pickingObjectDTO.getSitArtOrdDTO().getQtaOrd().subtract(withdrawMtbColr.getQtaCol()));
|
||||||
|
|
||||||
|
|
||||||
if (pickingObjectDTO.getMtbColts() != null) {
|
if (pickingObjectDTO.getMtbColts() != null) {
|
||||||
|
|
||||||
Optional<MtbColr> optionalMtbColrReference = Stream.of(pickingObjectDTO.getMtbColts())
|
Optional<MtbColr> optionalMtbColrReference = Stream.of(pickingObjectDTO.getMtbColts())
|
||||||
.filter(y -> withdrawMtbColr.getRefMtbColr() != null &&
|
.filter(y -> withdrawMtbColr.getRefMtbColr() != null &&
|
||||||
withdrawMtbColr.getRefMtbColr().getNumCollo().equals(y.getNumCollo()) &&
|
withdrawMtbColr.getRefMtbColr().getNumCollo().equals(y.getNumCollo()) &&
|
||||||
withdrawMtbColr.getRefMtbColr().getDataColloD().equals(y.getDataColloD()) &&
|
withdrawMtbColr.getRefMtbColr().getDataColloD().equals(y.getDataColloD()) &&
|
||||||
withdrawMtbColr.getRefMtbColr().getSerCollo().equals(y.getSerCollo()) &&
|
withdrawMtbColr.getRefMtbColr().getSerCollo().equals(y.getSerCollo()) &&
|
||||||
withdrawMtbColr.getRefMtbColr().getGestioneEnum().equals(y.getGestioneEnum()) &&
|
withdrawMtbColr.getRefMtbColr().getGestioneEnum().equals(y.getGestioneEnum()) &&
|
||||||
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodMart(), y.getMtbColr() != null && y.getMtbColr().size() > 0 ? y.getMtbColr().get(0).getCodMart() : null) &&
|
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodMart(), y.getMtbColr() != null && y.getMtbColr().size() > 0 ? y.getMtbColr().get(0).getCodMart() : null) &&
|
||||||
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodTagl(), y.getMtbColr() != null && y.getMtbColr().size() > 0 ? y.getMtbColr().get(0).getCodTagl() : null) &&
|
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodTagl(), y.getMtbColr() != null && y.getMtbColr().size() > 0 ? y.getMtbColr().get(0).getCodTagl() : null) &&
|
||||||
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodCol(), y.getMtbColr() != null && y.getMtbColr().size() > 0 ? y.getMtbColr().get(0).getCodCol() : null))
|
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodCol(), y.getMtbColr() != null && y.getMtbColr().size() > 0 ? y.getMtbColr().get(0).getCodCol() : null))
|
||||||
.map(y -> y.getMtbColr().get(0))
|
.map(y -> y.getMtbColr().get(0))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
|
|
||||||
if (optionalMtbColrReference.isPresent()) {
|
if (optionalMtbColrReference.isPresent()) {
|
||||||
//looking for real refMtbColr instance
|
//looking for real refMtbColr instance
|
||||||
MtbColr mtbColr = optionalMtbColrReference.get();
|
MtbColr mtbColr = optionalMtbColrReference.get();
|
||||||
|
|
||||||
|
mtbColr.setNumCnf(mtbColr.getNumCnf().subtract(withdrawMtbColr.getNumCnf()));
|
||||||
|
mtbColr.setQtaCol(mtbColr.getQtaCol().subtract(withdrawMtbColr.getQtaCol()));
|
||||||
|
}
|
||||||
|
|
||||||
mtbColr.setNumCnf(mtbColr.getNumCnf().subtract(withdrawMtbColr.getNumCnf()));
|
|
||||||
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<>());
|
pickingObjectDTO.setWithdrawMtbColrs(new ArrayList<>());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mIsNewLU = false;
|
this.mIsNewLU = false;
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
<string name="accettazione_ordine_inevaso_title_multiple_order">Ordini di accettazione</string>
|
<string name="accettazione_ordine_inevaso_title_multiple_order">Ordini di accettazione</string>
|
||||||
<string name="vendita_title_fragment">Spedizione</string>
|
<string name="vendita_title_fragment">Spedizione</string>
|
||||||
<string name="rettifica_giacenze_fragment_title">Rettifica giacenze</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="versamento_merce_fragment_title">Posizionamento merce</string>
|
||||||
<string name="error">Errore</string>
|
<string name="error">Errore</string>
|
||||||
<string name="ops">Ops</string>
|
<string name="ops">Ops</string>
|
||||||
|
|||||||
@ -5,10 +5,18 @@
|
|||||||
app:title="@string/accettazione_title_fragment"/>
|
app:title="@string/accettazione_title_fragment"/>
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreferenceCompat
|
||||||
app:key="picking_enable_sec_unt_mis"
|
app:key="picking_ingresso_enable_sec_unt_mis"
|
||||||
app:title="Abilita seconda unità di misura"
|
app:title="Abilita seconda unità di misura"
|
||||||
app:defaultValue="true"/>
|
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-->
|
<!-- <Preference-->
|
||||||
<!-- app:key="feedback"-->
|
<!-- app:key="feedback"-->
|
||||||
<!-- app:title="Send feedback"-->
|
<!-- app:title="Send feedback"-->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user