Compare commits
12 Commits
v1.45.00(4
...
v1.45.03(4
| Author | SHA1 | Date | |
|---|---|---|---|
| bb21441c3d | |||
| 12b1b89713 | |||
| 4d29e2ab41 | |||
| 2e37e874c3 | |||
| c99e32998b | |||
| 22ce078c74 | |||
| a93d80b2e2 | |||
| fa7d561189 | |||
| 2c59e9beec | |||
| 01af72bd2f | |||
| 2f42958394 | |||
| fba3801994 |
2
.idea/deploymentTargetSelector.xml
generated
2
.idea/deploymentTargetSelector.xml
generated
@@ -4,7 +4,7 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2025-03-06T12:39:02.626545300Z">
|
||||
<DropdownSelection timestamp="2025-03-17T09:16:48.549771200Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=21088B8EFD" />
|
||||
|
||||
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 482
|
||||
def appVersionName = '1.45.00'
|
||||
def appVersionCode = 485
|
||||
def appVersionName = '1.45.03'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Gravity;
|
||||
|
||||
@@ -690,4 +691,15 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmAnomalie(int anomalie, RunnableArgs<Boolean> onConfirm) {
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(Html.fromHtml(String.format(getString(R.string.confirm_anomalie), anomalie))),
|
||||
null, () -> {
|
||||
onConfirm.run(true);
|
||||
}, () -> {
|
||||
onConfirm.run(false);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
}
|
||||
@@ -643,7 +643,6 @@ public class AccettazioneBollaPickingViewModel {
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setNumCnf(numCnf)
|
||||
.setPartitaMag(partitaMag)
|
||||
// .setCodJcom(pickingObjectDTO.getSitBollaAccettazione().getCodJcom())
|
||||
.setDataDoc(sitBolla != null ? sitBolla.getDataDoc() : firstAvailableBolla.getDataDoc())
|
||||
.setNumDoc(sitBolla != null ? sitBolla.getNumDoc() : firstAvailableBolla.getNumDoc())
|
||||
.setCodDtip(sitBolla != null ? sitBolla.getCodDtip() : firstAvailableBolla.getCodDtip())
|
||||
@@ -662,7 +661,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
|
||||
pickingObjectDTO.getWithdrawMtbColrs().add(insertedMtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(insertedMtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(0, insertedMtbColr);
|
||||
|
||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||
resetMatchedRows();
|
||||
@@ -801,21 +800,42 @@ public class AccettazioneBollaPickingViewModel {
|
||||
} else {
|
||||
CloseUDCRequestDTO closeUDCRequestDTO = new CloseUDCRequestDTO()
|
||||
.setMtbColt(mCurrentMtbColt);
|
||||
mColliCaricoRESTConsumer.closeUDC(closeUDCRequestDTO, closeUDCResponse -> {
|
||||
|
||||
Runnable onVersamentoCompleted = () -> {
|
||||
managePrintCollo(this::postCloseOperations);
|
||||
ObservableArrayList<MtbColr> mtbColr = mCurrentMtbColt.getMtbColr();
|
||||
List<PickingObjectDTO> pickingList = getPickingList().getValue();
|
||||
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
};
|
||||
int listCount = pickingList != null ? pickingList.size() : 0;
|
||||
int anomalie = listCount > 0 ? listCount - mtbColr.size() : 0;
|
||||
|
||||
manageVersamentoAutomatico(onVersamentoCompleted);
|
||||
}, this::sendError);
|
||||
if (anomalie == 0){
|
||||
closeUdc(closeUDCRequestDTO);
|
||||
} else {
|
||||
onConfirmAnomalie(anomalie, canBeClose -> {
|
||||
if (canBeClose) {
|
||||
closeUdc(closeUDCRequestDTO);
|
||||
} else {
|
||||
this.sendOnLoadingEnded();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void closeUdc(CloseUDCRequestDTO closeUDCRequestDTO){
|
||||
mColliCaricoRESTConsumer.closeUDC(closeUDCRequestDTO, closeUDCResponse -> {
|
||||
|
||||
Runnable onVersamentoCompleted = () -> {
|
||||
managePrintCollo(this::postCloseOperations);
|
||||
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
};
|
||||
|
||||
manageVersamentoAutomatico(onVersamentoCompleted);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void manageVersamentoAutomatico(Runnable onComplete) {
|
||||
|
||||
if (!SettingsManager.iDB().isFlagAccettazioneBollaAskVersamentoAutomatico()) {
|
||||
@@ -1038,6 +1058,9 @@ public class AccettazioneBollaPickingViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
private void onConfirmAnomalie(int anomalie, RunnableArgs<Boolean> onConfirm){
|
||||
if (this.mListener != null) mListener.onConfirmAnomalie(anomalie, onConfirm);
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener, ILUPrintListener, ILUBaseOperationsListener {
|
||||
|
||||
@@ -1075,6 +1098,8 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
void onUnknownBarcodeScanned(String barcode, RunnableArgs<String> done, Runnable abort);
|
||||
|
||||
void onConfirmAnomalie(int anomalie, RunnableArgs<Boolean> onConfirm);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,12 +2,10 @@ package it.integry.integrywmsnative.gest.accettazione_bolla_picking.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
@@ -17,7 +15,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
@@ -65,29 +62,10 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
|
||||
this.mShowSecondaryUntMis = showSecondaryUntMis;
|
||||
|
||||
mutableDataSet.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||
@RequiresApi(api = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
@Override
|
||||
public void onChanged(ObservableList sender) {
|
||||
List<AccettazioneBollaPickingListModel> listaOrdinata = new ArrayList<>();
|
||||
if (!sender.isEmpty()) {
|
||||
listaOrdinata = new ArrayList<>(sender);
|
||||
|
||||
Collections.sort(listaOrdinata, (a, b) -> {
|
||||
|
||||
boolean condA = a.getQtaEvasa().floatValue() > 0;
|
||||
boolean condB = b.getQtaEvasa().floatValue() > 0;
|
||||
|
||||
if (condA && !condB) {
|
||||
return -1;
|
||||
} else if (!condA && condB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
mDataset.clear();
|
||||
mDataset.addAll(listaOrdinata);
|
||||
mDataset.addAll(sender);
|
||||
notifyDataSetChanged();
|
||||
notifyDataChanged();
|
||||
}
|
||||
|
||||
@@ -268,46 +268,49 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
|
||||
@Override
|
||||
public void onFornitoriLoaded(ArrayList<FornitoreDTO> fornitoriList) {
|
||||
AutoCompleteFornitoreAdapter autoCompleteFornitoreAdapter = new AutoCompleteFornitoreAdapter(getActivity(), fornitoriList);
|
||||
mBinding.autoCompleteFornitori.setAdapter(autoCompleteFornitoreAdapter);
|
||||
mBinding.autoCompleteFornitori.setDropDownWidth(getActivity().getResources().getDisplayMetrics().widthPixels);
|
||||
handler.post(() -> {
|
||||
|
||||
mBinding.inputCodArtDescrForn.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
resetAllError();
|
||||
AutoCompleteFornitoreAdapter autoCompleteFornitoreAdapter = new AutoCompleteFornitoreAdapter(getActivity(), fornitoriList);
|
||||
mBinding.autoCompleteFornitori.setAdapter(autoCompleteFornitoreAdapter);
|
||||
mBinding.autoCompleteFornitori.setDropDownWidth(getActivity().getResources().getDisplayMetrics().widthPixels);
|
||||
|
||||
if (UtilityString.isNullOrEmpty(mBinding.autoCompleteFornitori.getText().toString())) {
|
||||
setError(mBinding.autoCompleteFornitoriLayout, getActivity().getResources().getText(R.string.error).toString());
|
||||
mBinding.inputCodArtDescrForn.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
resetAllError();
|
||||
|
||||
if (UtilityString.isNullOrEmpty(mBinding.autoCompleteFornitori.getText().toString())) {
|
||||
setError(mBinding.autoCompleteFornitoriLayout, getActivity().getResources().getText(R.string.error).toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrForn.getText().toString())) {
|
||||
setError(mBinding.layoutCodArtDescrForn, getActivity().getResources().getText(R.string.error).toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
mViewModel.searchArtFor(
|
||||
mBinding.autoCompleteFornitori.getText().toString(),
|
||||
mBinding.inputCodArtDescrForn.getText().toString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
if (UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrForn.getText().toString())) {
|
||||
setError(mBinding.layoutCodArtDescrForn, getActivity().getResources().getText(R.string.error).toString());
|
||||
|
||||
mBinding.inputCodArtDescrInt.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
resetAllError();
|
||||
|
||||
if (UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrInt.getText().toString())) {
|
||||
setError(mBinding.layoutCodArtDescrInt, getActivity().getResources().getText(R.string.error).toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
mViewModel.searchArtInt(mBinding.inputCodArtDescrInt.getText().toString(), null, null);
|
||||
return true;
|
||||
}
|
||||
|
||||
mViewModel.searchArtFor(
|
||||
mBinding.autoCompleteFornitori.getText().toString(),
|
||||
mBinding.inputCodArtDescrForn.getText().toString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
mBinding.inputCodArtDescrInt.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
resetAllError();
|
||||
|
||||
if (UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrInt.getText().toString())) {
|
||||
setError(mBinding.layoutCodArtDescrInt, getActivity().getResources().getText(R.string.error).toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
mViewModel.searchArtInt(mBinding.inputCodArtDescrInt.getText().toString(), null, null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -339,21 +342,25 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
|
||||
@Override
|
||||
public void onLUOpened(MtbColt mtbColt) {
|
||||
initAdapter();
|
||||
handler.post(() -> {
|
||||
initAdapter();
|
||||
|
||||
this.currentMtbColtObs.set(mtbColt);
|
||||
thereIsAnOpenedUL.set(true);
|
||||
this.currentMtbColtObs.set(mtbColt);
|
||||
thereIsAnOpenedUL.set(true);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUClosed() {
|
||||
destroyAdapter();
|
||||
handler.post(() -> {
|
||||
destroyAdapter();
|
||||
|
||||
this.currentMtbColtObs.set(null);
|
||||
thereIsAnOpenedUL.set(false);
|
||||
this.currentMtbColtObs.set(null);
|
||||
thereIsAnOpenedUL.set(false);
|
||||
|
||||
this.mViewModel.requestLU();
|
||||
/*if (getActivity() != null) ((IPoppableActivity) getActivity()).pop();*/
|
||||
this.mViewModel.requestLU();
|
||||
/*if (getActivity() != null) ((IPoppableActivity) getActivity()).pop();*/
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -456,7 +463,7 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
@Override
|
||||
public void onRowSaved() {
|
||||
Snackbar.make(getView(), R.string.data_saved, Snackbar.LENGTH_SHORT)
|
||||
.setBackgroundTint(getResources().getColor(R. color. green_500))
|
||||
.setBackgroundTint(getResources().getColor(R.color.green_500))
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Gravity;
|
||||
@@ -96,6 +97,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
@Inject
|
||||
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||
|
||||
@Inject
|
||||
Handler handler;
|
||||
|
||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||
|
||||
private final ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList<>();
|
||||
@@ -715,30 +719,36 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
};
|
||||
|
||||
public void addExtraItem() {
|
||||
DialogScanArtView
|
||||
.newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColr) -> {
|
||||
if (status == DialogConsts.Results.YES) {
|
||||
this.mViewmodel.dispatchExtraItem(mtbAart, ean128Model, mtbColr);
|
||||
}
|
||||
}, pickMagazzinoAutomaticoPosizione -> {
|
||||
this.onLoadingStarted();
|
||||
this.mViewmodel.executeEmptyMagazzinoAutomaticoRequest(pickMagazzinoAutomaticoPosizione, this::onLoadingEnded);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
handler.post(() -> {
|
||||
DialogScanArtView
|
||||
.newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColr) -> {
|
||||
if (status == DialogConsts.Results.YES) {
|
||||
this.mViewmodel.dispatchExtraItem(mtbAart, ean128Model, mtbColr);
|
||||
}
|
||||
}, pickMagazzinoAutomaticoPosizione -> {
|
||||
this.onLoadingStarted();
|
||||
this.mViewmodel.executeEmptyMagazzinoAutomaticoRequest(pickMagazzinoAutomaticoPosizione, this::onLoadingEnded);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
|
||||
public void startManualSearch() {
|
||||
BarcodeManager.disable();
|
||||
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre", codice -> {
|
||||
handler.post(() -> {
|
||||
BarcodeManager.disable();
|
||||
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre", codice -> {
|
||||
|
||||
this.onScanSuccessful.run(new BarcodeScanDTO().setStringValue(codice).setType(BarcodeType.CODE128));
|
||||
BarcodeManager.enable();
|
||||
this.onScanSuccessful.run(new BarcodeScanDTO().setStringValue(codice).setType(BarcodeType.CODE128));
|
||||
BarcodeManager.enable();
|
||||
|
||||
}, BarcodeManager::enable).show();
|
||||
}, BarcodeManager::enable).show();
|
||||
});
|
||||
}
|
||||
|
||||
public void removeListFilter() {
|
||||
this.mViewmodel.resetMatchedRows();
|
||||
handler.post(() -> {
|
||||
this.mViewmodel.resetMatchedRows();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -754,26 +764,30 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
|
||||
public void trackPackaging() {
|
||||
this.fabPopupMenu.dismiss();
|
||||
handler.post(() -> {
|
||||
this.fabPopupMenu.dismiss();
|
||||
|
||||
DialogTracciamentoImballiView.newInstance(imballiData -> {
|
||||
DialogTracciamentoImballiView.newInstance(imballiData -> {
|
||||
|
||||
if (imballiData != null && !imballiData.isEmpty()) {
|
||||
DialogAskVettoreView.newInstance(mViewmodel.getDefaultVettore(), vettoreData -> {
|
||||
mViewmodel.registraImballi(vettoreData, imballiData);
|
||||
})
|
||||
.show(getSupportFragmentManager(), DialogAskVettoreView.class.getName());
|
||||
}
|
||||
}).show(getSupportFragmentManager(), DialogTracciamentoImballiView.class.getName());
|
||||
if (imballiData != null && !imballiData.isEmpty()) {
|
||||
DialogAskVettoreView.newInstance(mViewmodel.getDefaultVettore(), vettoreData -> {
|
||||
mViewmodel.registraImballi(vettoreData, imballiData);
|
||||
})
|
||||
.show(getSupportFragmentManager(), DialogAskVettoreView.class.getName());
|
||||
}
|
||||
}).show(getSupportFragmentManager(), DialogTracciamentoImballiView.class.getName());
|
||||
});
|
||||
}
|
||||
|
||||
public void showCreatedUL() {
|
||||
this.fabPopupMenu.dismiss();
|
||||
handler.post(() -> {
|
||||
this.fabPopupMenu.dismiss();
|
||||
|
||||
ArrayList<MtbColt> createdMtbColts = this.mViewmodel.getCreatedMtbColts();
|
||||
ArrayList<MtbColt> createdMtbColts = this.mViewmodel.getCreatedMtbColts();
|
||||
|
||||
Intent myIntent = ListaBancaliActivity.createIntent(this, createdMtbColts, true, false);
|
||||
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||
Intent myIntent = ListaBancaliActivity.createIntent(this, createdMtbColts, true, false);
|
||||
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -785,50 +799,60 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
@Override
|
||||
public void onLUOpened(MtbColt mtbColt) {
|
||||
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
||||
noLUPresent.set(false);
|
||||
handler.post(() -> {
|
||||
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
||||
noLUPresent.set(false);
|
||||
|
||||
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
|
||||
.setBackgroundTint(getResources().getColor(R. color. green_500))
|
||||
.show();
|
||||
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
|
||||
.setBackgroundTint(getResources().getColor(R.color.green_500))
|
||||
.show();
|
||||
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUClosed() {
|
||||
this.addExtraItemsEnabled.set(false);
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
handler.post(() -> {
|
||||
this.addExtraItemsEnabled.set(false);
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUPesoRequired(String codTcol, BigDecimal netWeightKG, BigDecimal grossWeightKG, RunnableArgsss<String, BigDecimal, BigDecimal> onComplete) {
|
||||
DialogInputPesoLUView.newInstance(null, new BigDecimal(50), new BigDecimal(55), (newCodTcol, newNetWeight, newGrossWeight) -> {
|
||||
onComplete.run(newCodTcol, netWeightKG, grossWeightKG);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
handler.post(() -> {
|
||||
DialogInputPesoLUView.newInstance(null, new BigDecimal(50), new BigDecimal(55), (newCodTcol, newNetWeight, newGrossWeight) -> {
|
||||
onComplete.run(newCodTcol, netWeightKG, grossWeightKG);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUSuccessullyPrinted() {
|
||||
Resources res = getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageView
|
||||
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
handler.post(() -> {
|
||||
Resources res = getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageView
|
||||
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUPrintRequest(RunnableArgs<Boolean> onComplete) {
|
||||
DialogYesNoView.newInstance(getString(R.string.action_print),
|
||||
String.format(getString(R.string.message_print_packing_list), "Packing List"),
|
||||
result -> {
|
||||
onComplete.run(result == DialogConsts.Results.YES);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "dialog-print");
|
||||
handler.post(() -> {
|
||||
DialogYesNoView.newInstance(getString(R.string.action_print),
|
||||
String.format(getString(R.string.message_print_packing_list), "Packing List"),
|
||||
result -> {
|
||||
onComplete.run(result == DialogConsts.Results.YES);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "dialog-print");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -845,41 +869,49 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
@Override
|
||||
public void onFilterApplied(String newValue) {
|
||||
this.mBindings.filteredArtsInListExpandableLayout.expand(true);
|
||||
this.mBindings.descriptionFilterText.setText(!UtilityString.isNullOrEmpty(newValue) ? newValue : "");
|
||||
handler.post(() -> {
|
||||
this.mBindings.filteredArtsInListExpandableLayout.expand(true);
|
||||
this.mBindings.descriptionFilterText.setText(!UtilityString.isNullOrEmpty(newValue) ? newValue : "");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFilterRemoved() {
|
||||
this.mBindings.filteredArtsInListExpandableLayout.collapse(true);
|
||||
this.mBindings.descriptionFilterText.setText("");
|
||||
handler.post(() -> {
|
||||
this.mBindings.filteredArtsInListExpandableLayout.collapse(true);
|
||||
this.mBindings.descriptionFilterText.setText("");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
handler.post(() -> {
|
||||
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex, boolean useSnackbar) {
|
||||
this.onLoadingEnded();
|
||||
handler.post(() -> {
|
||||
this.onLoadingEnded();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
if(useSnackbar)
|
||||
Snackbar.make(mBindings.getRoot(), Objects.requireNonNull(ex.getMessage()), Snackbar.LENGTH_LONG).show();
|
||||
else
|
||||
UtilityExceptions.defaultException(this, ex);
|
||||
}
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
if (useSnackbar)
|
||||
Snackbar.make(mBindings.getRoot(), Objects.requireNonNull(ex.getMessage()), Snackbar.LENGTH_LONG).show();
|
||||
else
|
||||
UtilityExceptions.defaultException(this, ex);
|
||||
}
|
||||
|
||||
BarcodeManager.enable();
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1057,7 +1089,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
@Override
|
||||
public void onRowSaved() {
|
||||
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
|
||||
.setBackgroundTint(getResources().getColor(R. color. green_500))
|
||||
.setBackgroundTint(getResources().getColor(R.color.green_500))
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package it.integry.integrywmsnative.gest.spedizione;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
@@ -38,7 +42,9 @@ public class SpedizioneModule {
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
MagazzinoAutomaticoRESTConsumer magazzinoAutomaticoRESTConsumer,
|
||||
ImballiRESTConsumer imballiRESTConsumer,
|
||||
MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
MagazzinoRESTConsumer magazzinoRESTConsumer,
|
||||
ExecutorService executorService,
|
||||
Handler handler) {
|
||||
return new SpedizioneViewModel(articoloRESTConsumer,
|
||||
barcodeRESTConsumer,
|
||||
colliDataRecoverService,
|
||||
@@ -51,7 +57,9 @@ public class SpedizioneModule {
|
||||
colliLavorazioneRESTConsumer,
|
||||
magazzinoAutomaticoRESTConsumer,
|
||||
imballiRESTConsumer,
|
||||
magazzinoRESTConsumer);
|
||||
magazzinoRESTConsumer,
|
||||
executorService,
|
||||
handler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.gest.spedizione;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
@@ -14,6 +16,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -140,9 +143,13 @@ public class SpedizioneViewModel {
|
||||
private final MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer;
|
||||
private final ImballiRESTConsumer mImballiRESTConsumer;
|
||||
|
||||
private final ExecutorService executorService;
|
||||
private final Handler handler;
|
||||
|
||||
private ColliScaricoRESTConsumerInterface mColliScaricoRESTConsumer;
|
||||
private MagazzinoRESTConsumer magazzinoRESTConsumer;
|
||||
|
||||
|
||||
@Inject
|
||||
public SpedizioneViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
@@ -156,7 +163,9 @@ public class SpedizioneViewModel {
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer,
|
||||
ImballiRESTConsumer imballiRESTConsumer,
|
||||
MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
MagazzinoRESTConsumer magazzinoRESTConsumer,
|
||||
ExecutorService executorService,
|
||||
Handler handler) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mColliDataRecoverService = colliDataRecoverService;
|
||||
@@ -170,6 +179,8 @@ public class SpedizioneViewModel {
|
||||
this.mMagazzinoAutomaticoRESTConsumer = mMagazzinoAutomaticoRESTConsumer;
|
||||
this.mImballiRESTConsumer = imballiRESTConsumer;
|
||||
this.magazzinoRESTConsumer = magazzinoRESTConsumer;
|
||||
this.executorService = executorService;
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
|
||||
@@ -674,7 +685,7 @@ public class SpedizioneViewModel {
|
||||
this.executeEtichettaLU(ean128Model.Sscc, onComplete);
|
||||
|
||||
} else {
|
||||
if(SettingsManager.iDB().isFlagSpedizioneEnableManualPick()) {
|
||||
if (SettingsManager.iDB().isFlagSpedizioneEnableManualPick()) {
|
||||
PickDataDTO pickDataDTO = PickDataDTO.fromEan128(ean128Model);
|
||||
this.loadArticolo(barcodeProd, pickDataDTO, onComplete);
|
||||
|
||||
@@ -1480,10 +1491,10 @@ public class SpedizioneViewModel {
|
||||
|
||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||
if (removeFilters)
|
||||
resetMatchedRows();
|
||||
else
|
||||
//Refresh della lista forzato
|
||||
this.mPickingList.postValue(this.mPickingList.getValue());
|
||||
resetMatchedRows();
|
||||
else
|
||||
//Refresh della lista forzato
|
||||
this.mPickingList.postValue(this.mPickingList.getValue());
|
||||
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
@@ -1518,7 +1529,7 @@ public class SpedizioneViewModel {
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(newTipoUL) && newMtbTcol == null) {
|
||||
if (!UtilityString.isNullOrEmpty(newTipoUL) && newMtbTcol == null) {
|
||||
this.sendError(new Exception("Impossibile riconoscere il tipo UL " + newTipoUL));
|
||||
onComplete.run();
|
||||
return;
|
||||
@@ -2015,12 +2026,14 @@ public class SpedizioneViewModel {
|
||||
}
|
||||
|
||||
public void resetMatchedRows() {
|
||||
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
||||
pickingObjectDTO.setTempPickData(null).setHidden(false);
|
||||
}
|
||||
handler.post(() -> {
|
||||
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
||||
pickingObjectDTO.setTempPickData(null).setHidden(false);
|
||||
}
|
||||
|
||||
this.mPickingList.postValue(this.mPickingList.getValue());
|
||||
this.sendFilterRemoved();
|
||||
this.mPickingList.postValue(this.mPickingList.getValue());
|
||||
this.sendFilterRemoved();
|
||||
});
|
||||
}
|
||||
|
||||
public void closeOrder() {
|
||||
|
||||
@@ -12,13 +12,10 @@ import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
|
||||
|
||||
public class BottomSheetFragmentLUContentViewModel {
|
||||
|
||||
|
||||
|
||||
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||
public ObservableField<String> pesoKg = new ObservableField<>();
|
||||
public ObservableField<String> pesoNettoKg = new ObservableField<>();
|
||||
private Listener mListener;
|
||||
private MtbColrListener mMtbColrListener;
|
||||
|
||||
public void closeCurrentLU() {
|
||||
if (this.mListener != null) this.mListener.onBottomSheetLUClose();
|
||||
@@ -42,11 +39,6 @@ public class BottomSheetFragmentLUContentViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetFragmentLUContentViewModel setMtbColrListener(MtbColrListener mtbColrListener) {
|
||||
this.mMtbColrListener = mtbColrListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void refreshPesi() {
|
||||
MtbColt collo = this.mtbColt.get();
|
||||
if (collo == null) return;
|
||||
@@ -77,8 +69,4 @@ public class BottomSheetFragmentLUContentViewModel {
|
||||
|
||||
void onBottomSheetLUClose();
|
||||
}
|
||||
|
||||
public interface MtbColrListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +217,7 @@
|
||||
<string name="settings_category">Impostazioni</string>
|
||||
<string name="check_box_preference_title">Check box</string>
|
||||
<string name="check_box_preference_summary">This is a regular preference</string>
|
||||
<string name="confirm_anomalie"><![CDATA[Sono state riscontrate <b>%d</b> anomalie. Continuare?]]></string>
|
||||
|
||||
<string name="alert_delete_UL">Stai per eliminare una UL. Confermi?</string>
|
||||
<string name="alert_delete_mtb_colr">Stai per eliminare una riga. Confermi?</string>
|
||||
|
||||
@@ -216,6 +216,7 @@
|
||||
<string name="settings_category">Settings</string>
|
||||
<string name="check_box_preference_title">Check box</string>
|
||||
<string name="check_box_preference_summary">This is a regular preference</string>
|
||||
<string name="confirm_anomalie"><![CDATA[<b>%d</b> anomalies were found. To continue?]]></string>
|
||||
|
||||
<string name="alert_delete_UL">Are you sure you want to delete this UL? Please confirm</string>
|
||||
<string name="alert_delete_mtb_colr">Are you sure to delete? Please confirm</string>
|
||||
|
||||
Reference in New Issue
Block a user