Implementato flag per gestire la qta suggerita in accettazione bolle

This commit is contained in:
Giuseppe Scorrano 2024-03-11 17:32:09 +01:00
parent 8b432d1b19
commit 5c505e2fe1
7 changed files with 40 additions and 27 deletions

View File

@ -20,7 +20,6 @@ public class DBSettingsModel {
private boolean enableCheckPartitaMagCheckPickingV; private boolean enableCheckPartitaMagCheckPickingV;
private boolean flagMultiClienteOrdV; private boolean flagMultiClienteOrdV;
private boolean flagUseCodAnagAziendale; private boolean flagUseCodAnagAziendale;
private String defaultCausaleRettificaGiacenze;
private boolean flagAskClienteInPickingLibero; private boolean flagAskClienteInPickingLibero;
private boolean flagPickLiberoAllowEmptyCliente; private boolean flagPickLiberoAllowEmptyCliente;
@ -28,7 +27,6 @@ public class DBSettingsModel {
private boolean flagCanAutoOpenNewULAccettazione; private boolean flagCanAutoOpenNewULAccettazione;
private boolean flagCanAddExtraQuantitySpedizione; private boolean flagCanAddExtraQuantitySpedizione;
private boolean flagEnableCheckDepositoSpedizione; private boolean flagEnableCheckDepositoSpedizione;
private boolean flagUseNewPickingListSpedizione;
private boolean flagVersamentoDirettoProduzione; private boolean flagVersamentoDirettoProduzione;
private boolean flagAskPesoColloSpedizione; private boolean flagAskPesoColloSpedizione;
private boolean flagForceAllToColli; private boolean flagForceAllToColli;
@ -75,6 +73,7 @@ public class DBSettingsModel {
private boolean flagDeleteRowOnClose = false; private boolean flagDeleteRowOnClose = false;
private boolean flagAllowBarcodeFornitore = false; private boolean flagAllowBarcodeFornitore = false;
private boolean flagShowInfo = false; private boolean flagShowInfo = false;
private boolean flagAccettazioneBollaUseQtaOrd = true;
public boolean isFlagSpedizioneEnableFakeGiacenza() { public boolean isFlagSpedizioneEnableFakeGiacenza() {
return flagSpedizioneEnableFakeGiacenza; return flagSpedizioneEnableFakeGiacenza;
@ -616,4 +615,12 @@ public class DBSettingsModel {
this.flagShowInfo = flagShowInfo; this.flagShowInfo = flagShowInfo;
return this; return this;
} }
public boolean isFlagAccettazioneBollaUseQtaOrd() {
return flagAccettazioneBollaUseQtaOrd;
}
public void setFlagAccettazioneBollaUseQtaOrd(boolean flagAccettazioneBollaUseQtaOrd) {
this.flagAccettazioneBollaUseQtaOrd = flagAccettazioneBollaUseQtaOrd;
}
} }

View File

@ -505,6 +505,12 @@ public class SettingsManager {
.setKeySection("FLAG_ALLOW_BARCODE_FORNITORE") .setKeySection("FLAG_ALLOW_BARCODE_FORNITORE")
.setSetter(dbSettingsModelIstance::setFlagAllowBarcodeFornitore) .setSetter(dbSettingsModelIstance::setFlagAllowBarcodeFornitore)
.setDefaultValue(false)); .setDefaultValue(false));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("ACCETTAZIONE_BOLLA")
.setKeySection("FLAG_USE_QTA_ORD")
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaUseQtaOrd)
.setDefaultValue(true));
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep(); String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();

View File

@ -153,7 +153,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
// this.initFilters(); // this.initFilters();
this.initFab(); this.initFab();
boolean useQtaBolla = SettingsManager.iDB().isFlagAccettazioneUseQtaOrd(); boolean useQtaBolla = SettingsManager.iDB().isFlagAccettazioneBollaUseQtaOrd();
mViewModel.setListeners(this); mViewModel.setListeners(this);
mViewModel.init( mViewModel.init(

View File

@ -420,9 +420,9 @@ public class AccettazioneBollaPickingViewModel {
public void manageDispatchBollaRow(final PickingObjectDTO pickingObjectDTO) { public void manageDispatchBollaRow(final PickingObjectDTO pickingObjectDTO) {
String partitaMag = null; String partitaMag = null;
if(pickingObjectDTO.getTempPickData() != null){ if (pickingObjectDTO.getTempPickData() != null) {
if(pickingObjectDTO.getTempPickData().getManualPickDTO() != null){ if (pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
if(pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag() != null){ if (pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag() != null) {
partitaMag = pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag().getPartitaMag(); partitaMag = pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag().getPartitaMag();
} }
} }
@ -550,11 +550,15 @@ public class AccettazioneBollaPickingViewModel {
initialQtaTot = mtbAart.getQtaCnf(); initialQtaTot = mtbAart.getQtaCnf();
} }
if (!this.mUseQtaBolla && if (!this.mUseQtaBolla) {
UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) && if (UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) &&
UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) { UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana(); initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
initialQtaTot = initialNumCnf.multiply(initialQtaCnf); initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
} else if(UtilityBigDecimal.greaterThan(initialNumCnf, BigDecimal.ONE) && pickingObjectDTO.getMtbAart().isFlagQtaCnfFissaBoolean()) {
initialNumCnf = BigDecimal.ONE;
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
}
} }
if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) { if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
@ -603,7 +607,8 @@ public class AccettazioneBollaPickingViewModel {
} }
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) { public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal
qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) { if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
resetMatchedRows(); resetMatchedRows();
@ -691,7 +696,8 @@ public class AccettazioneBollaPickingViewModel {
}); });
} }
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) { private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal
qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
this.sendOnLoadingStarted(); this.sendOnLoadingStarted();
MtbColr mtbColrClone = (MtbColr) mtbColrToUpdate.clone(); MtbColr mtbColrClone = (MtbColr) mtbColrToUpdate.clone();
@ -998,12 +1004,14 @@ public class AccettazioneBollaPickingViewModel {
if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete); if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete);
} }
private void notifyVersamentoAutomaticoResult(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) { private void notifyVersamentoAutomaticoResult(VersamentoAutomaticoULResponseDTO
versamentoAutomaticoULResponseDTO, Runnable onComplete) {
if (this.mListener != null) if (this.mListener != null)
mListener.onULVersata(versamentoAutomaticoULResponseDTO, onComplete); mListener.onULVersata(versamentoAutomaticoULResponseDTO, onComplete);
} }
private void sendOnUnknownBarcodeScanned(String barocde, RunnableArgs<String> onComplete, Runnable onAbort) { private void sendOnUnknownBarcodeScanned(String
barocde, RunnableArgs<String> onComplete, Runnable onAbort) {
if (this.mListener != null) if (this.mListener != null)
mListener.onUnknownBarcodeScanned(barocde, onComplete, onAbort); mListener.onUnknownBarcodeScanned(barocde, onComplete, onAbort);
} }

View File

@ -189,15 +189,7 @@ public class VersamentoMerceViewModel {
} else { } else {
if (mtbColt == null) { if (mtbColt == null) {
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> { this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
onComplete.run(); pickMerceULtoUL(mtbColtAnonimo, onComplete);
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
if (codMdepIsValid) {
pickMerceULtoUL(mtbColtAnonimo, onComplete);
} else this.sendError(new InvalidCodMdepException());
}, this::sendError); }, this::sendError);
} else { } else {
@ -228,7 +220,7 @@ public class VersamentoMerceViewModel {
.filter(x -> x.getQtaCol().floatValue() > 0) .filter(x -> x.getQtaCol().floatValue() > 0)
.toList(); .toList();
if (mtbColrsToPick.size() == 0) { if (mtbColrsToPick.isEmpty()) {
this.sendError(new NoArtsInLUException()); this.sendError(new NoArtsInLUException());
return; return;
} }

View File

@ -3,7 +3,7 @@
buildscript { buildscript {
ext { ext {
kotlin_version = '1.9.0' kotlin_version = '1.9.0'
agp_version = '8.2.2' agp_version = '8.3.0'
} }
repositories { repositories {

View File

@ -1,6 +1,6 @@
#Mon Feb 13 15:14:43 CET 2023 #Mon Feb 13 15:14:43 CET 2023
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME