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 flagMultiClienteOrdV;
private boolean flagUseCodAnagAziendale;
private String defaultCausaleRettificaGiacenze;
private boolean flagAskClienteInPickingLibero;
private boolean flagPickLiberoAllowEmptyCliente;
@ -28,7 +27,6 @@ public class DBSettingsModel {
private boolean flagCanAutoOpenNewULAccettazione;
private boolean flagCanAddExtraQuantitySpedizione;
private boolean flagEnableCheckDepositoSpedizione;
private boolean flagUseNewPickingListSpedizione;
private boolean flagVersamentoDirettoProduzione;
private boolean flagAskPesoColloSpedizione;
private boolean flagForceAllToColli;
@ -75,6 +73,7 @@ public class DBSettingsModel {
private boolean flagDeleteRowOnClose = false;
private boolean flagAllowBarcodeFornitore = false;
private boolean flagShowInfo = false;
private boolean flagAccettazioneBollaUseQtaOrd = true;
public boolean isFlagSpedizioneEnableFakeGiacenza() {
return flagSpedizioneEnableFakeGiacenza;
@ -616,4 +615,12 @@ public class DBSettingsModel {
this.flagShowInfo = flagShowInfo;
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")
.setSetter(dbSettingsModelIstance::setFlagAllowBarcodeFornitore)
.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();

View File

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

View File

@ -550,11 +550,15 @@ public class AccettazioneBollaPickingViewModel {
initialQtaTot = mtbAart.getQtaCnf();
}
if (!this.mUseQtaBolla &&
UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) &&
if (!this.mUseQtaBolla) {
if (UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) &&
UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
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) {
@ -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)) {
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();
MtbColr mtbColrClone = (MtbColr) mtbColrToUpdate.clone();
@ -998,12 +1004,14 @@ public class AccettazioneBollaPickingViewModel {
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)
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)
mListener.onUnknownBarcodeScanned(barocde, onComplete, onAbort);
}

View File

@ -189,15 +189,7 @@ public class VersamentoMerceViewModel {
} else {
if (mtbColt == null) {
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
onComplete.run();
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);
} else {
@ -228,7 +220,7 @@ public class VersamentoMerceViewModel {
.filter(x -> x.getQtaCol().floatValue() > 0)
.toList();
if (mtbColrsToPick.size() == 0) {
if (mtbColrsToPick.isEmpty()) {
this.sendError(new NoArtsInLUException());
return;
}

View File

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

View File

@ -1,6 +1,6 @@
#Mon Feb 13 15:14:43 CET 2023
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
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME