This commit is contained in:
Giuseppe Scorrano 2020-10-16 15:32:15 +02:00
parent 6a39512e7b
commit 641fb3964d
4 changed files with 56 additions and 7 deletions

View File

@ -97,6 +97,7 @@ dependencies {
implementation 'com.google.firebase:firebase-perf' implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.firebase:firebase-crashlytics' implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.android.gms:play-services-basement:17.4.0'
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'

View File

@ -426,8 +426,18 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
spedizioneListModels.add(spedizioneListModel); spedizioneListModels.add(spedizioneListModel);
} else { } else {
BigDecimal qtaColOrdCounter = x.getSitArtOrdDTO().getQtaOrd();
BigDecimal numCnfOrdCounter = x.getSitArtOrdDTO().getNumCnfOrd();
for (MtbColt mtbColtToPick : x.getMtbColts()) { for (MtbColt mtbColtToPick : x.getMtbColts()) {
if(UtilityBigDecimal.equalsTo(qtaColOrdCounter, BigDecimal.ZERO) || UtilityBigDecimal.lowerThan(qtaColOrdCounter, BigDecimal.ZERO))
break;
if(UtilityBigDecimal.equalsTo(numCnfOrdCounter, BigDecimal.ZERO) || UtilityBigDecimal.lowerThan(numCnfOrdCounter, BigDecimal.ZERO))
break;
SpedizioneListModel cloneModel = (SpedizioneListModel) spedizioneListModel.clone(); SpedizioneListModel cloneModel = (SpedizioneListModel) spedizioneListModel.clone();
@ -441,11 +451,49 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) { if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
cloneModel.setUntMis("col"); cloneModel.setUntMis("col");
cloneModel.setQtaTot(mtbColrToDispatch != null ? mtbColrToDispatch.getNumCnf() : x.getSitArtOrdDTO().getNumCnfOrd());
cloneModel.setQtaEvasa(numCnfWithdrawRows.getBigDecimalValue()); BigDecimal numCnfOrdToSubstract = UtilityBigDecimal.getLowerBetween(mtbColrToDispatch.getNumCnf(), numCnfOrdCounter);
BigDecimal qtaTot = UtilityBigDecimal.getLowerBetween(mtbColrToDispatch.getNumCnf(), numCnfOrdCounter);
if(UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO) || UtilityBigDecimal.lowerThan(qtaTot, BigDecimal.ZERO)) continue;
cloneModel.setQtaTot(qtaTot);
numCnfOrdCounter = numCnfOrdCounter.subtract(numCnfOrdToSubstract);
BigDecimal qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
.filter(y -> y.getRefMtbColr() != null &&
y.getRefMtbColr().getNumCollo().equals(mtbColrToDispatch.getNumCollo()) &&
y.getRefMtbColr().getDataColloD().equals(mtbColrToDispatch.getDataColloD()) &&
y.getRefMtbColr().getSerCollo().equals(mtbColrToDispatch.getSerCollo()) &&
y.getRefMtbColr().getGestioneEnum().equals(mtbColrToDispatch.getGestioneEnum()) &&
UtilityString.equalsIgnoreCase(y.getRefMtbColr().getCodMart(), mtbColrToDispatch.getCodMart()) &&
UtilityString.equalsIgnoreCase(y.getRefMtbColr().getCodTagl(), mtbColrToDispatch.getCodTagl()) &&
UtilityString.equalsIgnoreCase(y.getRefMtbColr().getCodCol(), mtbColrToDispatch.getCodCol()))
.map(MtbColr::getNumCnf)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cloneModel.setQtaEvasa(qtaEvasa);
} else { } else {
cloneModel.setQtaTot(mtbColrToDispatch != null ? mtbColrToDispatch.getQtaCol() : x.getSitArtOrdDTO().getQtaOrd()); BigDecimal qtaOrdToSubstract = UtilityBigDecimal.getLowerBetween(mtbColrToDispatch.getQtaCol(), qtaColOrdCounter);
cloneModel.setQtaEvasa(qtaColWithdrawRows.getBigDecimalValue());
BigDecimal qtaTot = UtilityBigDecimal.getLowerBetween(mtbColrToDispatch.getQtaCol(), qtaColOrdCounter);
if(UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO) || UtilityBigDecimal.lowerThan(qtaTot, BigDecimal.ZERO)) continue;
cloneModel.setQtaTot(qtaTot);
qtaColOrdCounter = qtaColOrdCounter.subtract(qtaOrdToSubstract);
BigDecimal qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
.filter(y -> y.getRefMtbColr() != null &&
y.getRefMtbColr().getNumCollo().equals(mtbColrToDispatch.getNumCollo()) &&
y.getRefMtbColr().getDataColloD().equals(mtbColrToDispatch.getDataColloD()) &&
y.getRefMtbColr().getSerCollo().equals(mtbColrToDispatch.getSerCollo()) &&
y.getRefMtbColr().getGestioneEnum().equals(mtbColrToDispatch.getGestioneEnum()) &&
UtilityString.equalsIgnoreCase(y.getRefMtbColr().getCodMart(), mtbColrToDispatch.getCodMart()) &&
UtilityString.equalsIgnoreCase(y.getRefMtbColr().getCodTagl(), mtbColrToDispatch.getCodTagl()) &&
UtilityString.equalsIgnoreCase(y.getRefMtbColr().getCodCol(), mtbColrToDispatch.getCodCol()))
.map(MtbColr::getQtaCol)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cloneModel.setQtaEvasa(qtaEvasa);
if (x.getMtbAart() != null) if (x.getMtbAart() != null)
cloneModel.setUntMis(x.getMtbAart().getUntMis()); cloneModel.setUntMis(x.getMtbAart().getUntMis());
} }

View File

@ -473,10 +473,10 @@ public class DialogVenditaFiltroAvanzato {
return Stream return Stream
.of(currentFilteredOrderList) .of(currentFilteredOrderList)
.filter(x -> x.getIdViaggio() != null)
.sortBy(x -> -x.getIdViaggio())
.map(x -> x.getIdViaggio() != null ? x.getIdViaggio().toString() : null) .map(x -> x.getIdViaggio() != null ? x.getIdViaggio().toString() : null)
.withoutNulls()
.distinct() .distinct()
.sorted()
.toList(); .toList();
} }

View File

@ -77,7 +77,7 @@ public class DialogInputQuantityV2ViewModel {
this.internalQtaTot = totalQtaOrd; this.internalQtaTot = totalQtaOrd;
} }
this.shouldAskDataScad = mtbAart.get().isFlagQtaCnfFissaBoolean() && mtbAart.get().getGgScadPartita() != null && mtbAart.get().getGgScadPartita() > 0; this.shouldAskDataScad = mtbAart.get().isFlagTracciabilitaBoolean() && mtbAart.get().getGgScadPartita() != null && mtbAart.get().getGgScadPartita() > 0;
this.shouldShowDataScad = this.internalDataScad != null; this.shouldShowDataScad = this.internalDataScad != null;
this.blockedNumCnf.set(false); this.blockedNumCnf.set(false);