Finish v1.36.07(400)
This commit is contained in:
commit
86507d41c7
14
.idea/runConfigurations/app.xml
generated
14
.idea/runConfigurations/app.xml
generated
@ -1,6 +1,6 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||||
<module name="WMS.app.main" />
|
<module name="WMS_Native.app.main" />
|
||||||
<option name="DEPLOY" value="true" />
|
<option name="DEPLOY" value="true" />
|
||||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||||
@ -9,7 +9,6 @@
|
|||||||
<option name="ALL_USERS" value="false" />
|
<option name="ALL_USERS" value="false" />
|
||||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||||
<option name="CLEAR_APP_STORAGE" value="false" />
|
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic__base,WMS.dynamic_vgalimenti" />
|
|
||||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||||
<option name="MODE" value="default_activity" />
|
<option name="MODE" value="default_activity" />
|
||||||
<option name="CLEAR_LOGCAT" value="false" />
|
<option name="CLEAR_LOGCAT" value="false" />
|
||||||
@ -25,6 +24,8 @@
|
|||||||
<option name="WORKING_DIR" value="" />
|
<option name="WORKING_DIR" value="" />
|
||||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||||
|
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||||
|
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||||
</Auto>
|
</Auto>
|
||||||
<Hybrid>
|
<Hybrid>
|
||||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||||
@ -32,14 +33,21 @@
|
|||||||
<option name="WORKING_DIR" value="" />
|
<option name="WORKING_DIR" value="" />
|
||||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||||
|
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||||
|
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||||
</Hybrid>
|
</Hybrid>
|
||||||
<Java />
|
<Java>
|
||||||
|
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||||
|
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||||
|
</Java>
|
||||||
<Native>
|
<Native>
|
||||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||||
<option name="SHOW_STATIC_VARS" value="true" />
|
<option name="SHOW_STATIC_VARS" value="true" />
|
||||||
<option name="WORKING_DIR" value="" />
|
<option name="WORKING_DIR" value="" />
|
||||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||||
|
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||||
|
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||||
</Native>
|
</Native>
|
||||||
<Profilers>
|
<Profilers>
|
||||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||||
|
|||||||
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 398
|
def appVersionCode = 400
|
||||||
def appVersionName = '1.36.05'
|
def appVersionName = '1.36.07'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
|
|||||||
@ -69,6 +69,7 @@ public class DBSettingsModel {
|
|||||||
private boolean flagCanAddUnknownBarcodesAccettazioneBolla = false;
|
private boolean flagCanAddUnknownBarcodesAccettazioneBolla = false;
|
||||||
private boolean flagEnableFastPickAccettazioneBolla = false;
|
private boolean flagEnableFastPickAccettazioneBolla = false;
|
||||||
private boolean flagDisableMandatoryTracciabilitaAccettazioneBolla = false;
|
private boolean flagDisableMandatoryTracciabilitaAccettazioneBolla = false;
|
||||||
|
private boolean flagOverflowQuantityWarning = false;
|
||||||
|
|
||||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||||
return flagSpedizioneEnableFakeGiacenza;
|
return flagSpedizioneEnableFakeGiacenza;
|
||||||
@ -556,4 +557,13 @@ public class DBSettingsModel {
|
|||||||
this.flagDisableMandatoryTracciabilitaAccettazioneBolla = flagDisableMandatoryTracciabilitaAccettazioneBolla;
|
this.flagDisableMandatoryTracciabilitaAccettazioneBolla = flagDisableMandatoryTracciabilitaAccettazioneBolla;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagOverflowQuantityWarning() {
|
||||||
|
return flagOverflowQuantityWarning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagOverflowQuantityWarning(boolean flagOverflowQuantityWarning) {
|
||||||
|
this.flagOverflowQuantityWarning = flagOverflowQuantityWarning;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -470,6 +470,12 @@ public class SettingsManager {
|
|||||||
.setKeySection("FLAG_DISABLE_MANDATORY_TRACCIABILITA")
|
.setKeySection("FLAG_DISABLE_MANDATORY_TRACCIABILITA")
|
||||||
.setSetter(dbSettingsModelIstance::setFlagDisableMandatoryTracciabilitaAccettazioneBolla)
|
.setSetter(dbSettingsModelIstance::setFlagDisableMandatoryTracciabilitaAccettazioneBolla)
|
||||||
.setDefaultValue(false));
|
.setDefaultValue(false));
|
||||||
|
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SPEDIZIONE")
|
||||||
|
.setKeySection("FLAG_OVERFLOW_QUANTITY_WARNING")
|
||||||
|
.setSetter(dbSettingsModelIstance::setFlagOverflowQuantityWarning)
|
||||||
|
.setDefaultValue(false));
|
||||||
|
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
|
|||||||
@ -333,13 +333,13 @@ public class AccettazioneBollaPickingViewModel {
|
|||||||
pickingObjectDTO.setTempPickData(pickData);
|
pickingObjectDTO.setTempPickData(pickData);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loadMatchedRows(matchPickingObject, mtbAart);
|
this.loadMatchedRows(matchPickingObject, mtbAart, pickData);
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadMatchedRows(List<PickingObjectDTO> matchedRows, MtbAart mtbAart) {
|
private void loadMatchedRows(List<PickingObjectDTO> matchedRows, MtbAart mtbAart, PickDataDTO pickDataDTO) {
|
||||||
if (matchedRows == null || matchedRows.size() == 0) {
|
if (matchedRows == null || matchedRows.size() == 0) {
|
||||||
manageNoArtFound(mtbAart);
|
manageNoArtFound(mtbAart, pickDataDTO);
|
||||||
} else if (matchedRows.size() == 1) {
|
} else if (matchedRows.size() == 1) {
|
||||||
this.manageDispatchBollaRow(matchedRows.get(0));
|
this.manageDispatchBollaRow(matchedRows.get(0));
|
||||||
} else {
|
} else {
|
||||||
@ -375,11 +375,12 @@ public class AccettazioneBollaPickingViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void manageNoArtFound(MtbAart mtbAart) {
|
private void manageNoArtFound(MtbAart mtbAart, PickDataDTO pickDataDTO) {
|
||||||
if (SettingsManager.iDB().isFlagCanAddUnknownItemsAccettazioneBolla()) {
|
if (SettingsManager.iDB().isFlagCanAddUnknownItemsAccettazioneBolla()) {
|
||||||
|
|
||||||
this.manageDispatchBollaRow(new PickingObjectDTO()
|
this.manageDispatchBollaRow(new PickingObjectDTO()
|
||||||
.setMtbAart(mtbAart));
|
.setMtbAart(mtbAart)
|
||||||
|
.setTempPickData(pickDataDTO));
|
||||||
} else
|
} else
|
||||||
this.sendError(new NoArtsFoundException());
|
this.sendError(new NoArtsFoundException());
|
||||||
}
|
}
|
||||||
@ -418,12 +419,21 @@ public class AccettazioneBollaPickingViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void manageDispatchBollaRow(final PickingObjectDTO pickingObjectDTO) {
|
public void manageDispatchBollaRow(final PickingObjectDTO pickingObjectDTO) {
|
||||||
|
String partitaMag = null;
|
||||||
|
if(pickingObjectDTO.getTempPickData() != null){
|
||||||
|
if(pickingObjectDTO.getTempPickData().getManualPickDTO() != null){
|
||||||
|
if(pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag() != null){
|
||||||
|
partitaMag = pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag().getPartitaMag();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (SettingsManager.iDB().isFlagEnableFastPickAccettazioneBolla()) {
|
if (SettingsManager.iDB().isFlagEnableFastPickAccettazioneBolla()) {
|
||||||
this.saveNewRow(pickingObjectDTO,
|
this.saveNewRow(pickingObjectDTO,
|
||||||
BigDecimal.ONE,
|
BigDecimal.ONE,
|
||||||
pickingObjectDTO.getMtbAart().getQtaCnf(),
|
pickingObjectDTO.getMtbAart().getQtaCnf(),
|
||||||
pickingObjectDTO.getMtbAart().getQtaCnf(),
|
pickingObjectDTO.getMtbAart().getQtaCnf(),
|
||||||
null,
|
partitaMag,
|
||||||
null,
|
null,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
|
||||||
@ -33,6 +34,17 @@ public class SitArtOrdDTO {
|
|||||||
private String descrizioneCommessa;
|
private String descrizioneCommessa;
|
||||||
private String termCons;
|
private String termCons;
|
||||||
private String descrizioneEstesaArt;
|
private String descrizioneEstesaArt;
|
||||||
|
private String descrizioneEstesaOrd;
|
||||||
|
private Date dataCons;
|
||||||
|
|
||||||
|
public String getDescrizioneEstesaOrd() {
|
||||||
|
return descrizioneEstesaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SitArtOrdDTO setDescrizioneEstesaOrd(String descrizioneEstesaOrd) {
|
||||||
|
this.descrizioneEstesaOrd = descrizioneEstesaOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getCodJcom() {
|
public String getCodJcom() {
|
||||||
return codJcom;
|
return codJcom;
|
||||||
@ -280,4 +292,13 @@ public class SitArtOrdDTO {
|
|||||||
this.descrizioneEstesaArt = descrizioneEstesaArt;
|
this.descrizioneEstesaArt = descrizioneEstesaArt;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getDataCons() {
|
||||||
|
return dataCons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SitArtOrdDTO setDataCons(Date dataCons) {
|
||||||
|
this.dataCons = dataCons;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,7 @@ import it.integry.integrywmsnative.core.report.ReportManager;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
@ -415,6 +416,8 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
|||||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
|
accettazioneOrdiniPickingListModel.setSubDescrizione1("Consegna: " + UtilityDate.formatDate(x.getSitArtOrdDTO().getDataCons(), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH));
|
||||||
|
|
||||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||||
if (x.getMtbAart() != null)
|
if (x.getMtbAart() != null)
|
||||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||||
@ -585,8 +588,9 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
|||||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneEstesaOrd());
|
||||||
|
|
||||||
if (x.getMtbAart() != null) {
|
if (x.getMtbAart() != null) {
|
||||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
|
||||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -788,7 +792,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaOrd, BigDecimal totalNumCnfOrd, BigDecimal qtaCnfOrd, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, String partitaMag, LocalDate dataScad, boolean canPartitaMagBeChanged, boolean canOverflowQuantity, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaOrd, BigDecimal totalNumCnfOrd, BigDecimal qtaCnfOrd, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, String partitaMag, LocalDate dataScad, boolean canPartitaMagBeChanged, boolean canOverflowQuantity, String customArtDescription, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||||
.setMtbAart(mtbAart)
|
.setMtbAart(mtbAart)
|
||||||
.setInitialNumCnf(initialNumCnf)
|
.setInitialNumCnf(initialNumCnf)
|
||||||
@ -807,7 +811,8 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
|||||||
.setDataScad(dataScad)
|
.setDataScad(dataScad)
|
||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
.setCanLUBeClosed(true)
|
.setCanLUBeClosed(true)
|
||||||
.setCanOverflowOrderQuantity(canOverflowQuantity);
|
.setCanOverflowOrderQuantity(canOverflowQuantity)
|
||||||
|
.setCustomArtDescription(customArtDescription);
|
||||||
|
|
||||||
if (!mDialogInputQuantityV2View.isVisible())
|
if (!mDialogInputQuantityV2View.isVisible())
|
||||||
mDialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
|
|||||||
@ -539,6 +539,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
partitaMag,
|
partitaMag,
|
||||||
dataScad,
|
dataScad,
|
||||||
true,
|
true,
|
||||||
|
pickingObjectDTO.getSitArtOrdDTO().getDescrizioneEstesaOrd(),
|
||||||
(pickedQuantityDTO, shouldCloseLU) -> {
|
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||||
this.saveNewRow(pickingObjectDTO,
|
this.saveNewRow(pickingObjectDTO,
|
||||||
pickedQuantityDTO.getNumCnf(),
|
pickedQuantityDTO.getNumCnf(),
|
||||||
@ -625,6 +626,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
mtbColrToEdit.getPartitaMag(),
|
mtbColrToEdit.getPartitaMag(),
|
||||||
mtbColrToEdit.getDataScadPartita(),
|
mtbColrToEdit.getDataScadPartita(),
|
||||||
true,
|
true,
|
||||||
|
null,
|
||||||
(pickedQuantityDTO, shouldCloseLU) -> {
|
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||||
|
|
||||||
this.saveEditedRow(mtbColrToEdit,
|
this.saveEditedRow(mtbColrToEdit,
|
||||||
@ -883,6 +885,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
String partitaMag,
|
String partitaMag,
|
||||||
LocalDate dataScad,
|
LocalDate dataScad,
|
||||||
boolean canPartitaMagBeChanged,
|
boolean canPartitaMagBeChanged,
|
||||||
|
String customArtDescription,
|
||||||
RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||||
if (this.mListener != null) mListener.onItemDispatched(pickingObjectDTO,
|
if (this.mListener != null) mListener.onItemDispatched(pickingObjectDTO,
|
||||||
mtbAart,
|
mtbAart,
|
||||||
@ -902,6 +905,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
dataScad,
|
dataScad,
|
||||||
canPartitaMagBeChanged,
|
canPartitaMagBeChanged,
|
||||||
true,
|
true,
|
||||||
|
customArtDescription,
|
||||||
onComplete);
|
onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -958,6 +962,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
LocalDate dataScad,
|
LocalDate dataScad,
|
||||||
boolean canPartitaMagBeChanged,
|
boolean canPartitaMagBeChanged,
|
||||||
boolean canOverflowQuantity,
|
boolean canOverflowQuantity,
|
||||||
|
String customArtDescription,
|
||||||
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
||||||
|
|
||||||
void onFilterCodMartApplied(String codMartToFilter);
|
void onFilterCodMartApplied(String codMartToFilter);
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import java.util.List;
|
|||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.AccettazioneOrdineInevasoMainListGroupHeaderBinding;
|
import it.integry.integrywmsnative.databinding.AccettazioneOrdineInevasoMainListGroupHeaderBinding;
|
||||||
@ -119,7 +120,10 @@ public class AccettazioneOrdiniPickingListAdapter extends SectionedRecyclerViewA
|
|||||||
|
|
||||||
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
||||||
holder.mBinding.descrizione.setTextColor(pickingObjectDTO.isDescrizionePresente() ? Color.BLACK : Color.GRAY);
|
holder.mBinding.descrizione.setTextColor(pickingObjectDTO.isDescrizionePresente() ? Color.BLACK : Color.GRAY);
|
||||||
|
holder.mBinding.descrizione.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getDescrizione()) ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
|
holder.mBinding.descrizioneSub1.setText(pickingObjectDTO.getSubDescrizione1());
|
||||||
|
holder.mBinding.descrizioneSub1.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getSubDescrizione1()) ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
holder.mBinding.badge1.setText(pickingObjectDTO.getBadge1());
|
holder.mBinding.badge1.setText(pickingObjectDTO.getBadge1());
|
||||||
holder.mBinding.badge2.setText(pickingObjectDTO.getBadge2());
|
holder.mBinding.badge2.setText(pickingObjectDTO.getBadge2());
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package it.integry.integrywmsnative.gest.accettazione_ordini_picking.ui;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.dto.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.dto.PickingObjectDTO;
|
||||||
|
|
||||||
|
|||||||
@ -93,6 +93,8 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
|||||||
//Load fabbisogno
|
//Load fabbisogno
|
||||||
this.mViewModel.loadFabbisogno(startDate, endDate, codMdep, this::startPickingActivity);
|
this.mViewModel.loadFabbisogno(startDate, endDate, codMdep, this::startPickingActivity);
|
||||||
// }
|
// }
|
||||||
|
}, () -> {
|
||||||
|
popMe();
|
||||||
})
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,20 +36,22 @@ public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment impleme
|
|||||||
DialogAskMagazzinoProssimitaViewModel mViewModel;
|
DialogAskMagazzinoProssimitaViewModel mViewModel;
|
||||||
|
|
||||||
private final RunnableArgsss<JtbFasi, Date, Date> mOnItemSelected;
|
private final RunnableArgsss<JtbFasi, Date, Date> mOnItemSelected;
|
||||||
|
private final Runnable mOnAbort;
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private DialogAskMagazzinoProssimitaBinding mBindings;
|
private DialogAskMagazzinoProssimitaBinding mBindings;
|
||||||
|
|
||||||
// private JtbFasi mSelectedItem;
|
// private JtbFasi mSelectedItem;
|
||||||
|
|
||||||
public static DialogAskMagazzinoProssimitaView newInstance(RunnableArgsss<JtbFasi, Date, Date> onItemSelected) {
|
public static DialogAskMagazzinoProssimitaView newInstance(RunnableArgsss<JtbFasi, Date, Date> onItemSelected, Runnable onAbort) {
|
||||||
return new DialogAskMagazzinoProssimitaView(onItemSelected);
|
return new DialogAskMagazzinoProssimitaView(onItemSelected, onAbort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private DialogAskMagazzinoProssimitaView(RunnableArgsss<JtbFasi, Date, Date> onItemSelected) {
|
private DialogAskMagazzinoProssimitaView(RunnableArgsss<JtbFasi, Date, Date> onItemSelected, Runnable onAbort) {
|
||||||
super();
|
super();
|
||||||
this.mOnItemSelected = onItemSelected;
|
this.mOnItemSelected = onItemSelected;
|
||||||
|
this.mOnAbort = onAbort;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@ -79,6 +81,7 @@ public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment impleme
|
|||||||
// } else {
|
// } else {
|
||||||
// FBToast.warningToast(mContext, getResources().getString(R.string.please_select_an_item), Toast.LENGTH_LONG);
|
// FBToast.warningToast(mContext, getResources().getString(R.string.please_select_an_item), Toast.LENGTH_LONG);
|
||||||
// }
|
// }
|
||||||
|
mOnItemSelected.run(null, mViewModel.startDate, mViewModel.endDate);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -86,6 +89,7 @@ public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment impleme
|
|||||||
@Override
|
@Override
|
||||||
public void onSingleClick(View v) {
|
public void onSingleClick(View v) {
|
||||||
getDialog().dismiss();
|
getDialog().dismiss();
|
||||||
|
mOnAbort.run();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -111,7 +115,6 @@ public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment impleme
|
|||||||
@Override
|
@Override
|
||||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
super.onDismiss(dialog);
|
super.onDismiss(dialog);
|
||||||
mOnItemSelected.run(null, mViewModel.startDate, mViewModel.endDate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final View.OnClickListener onStartDateClickListener = new OnSingleClickListener() {
|
private final View.OnClickListener onStartDateClickListener = new OnSingleClickListener() {
|
||||||
|
|||||||
@ -10,10 +10,17 @@ import java.util.List;
|
|||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoBufferRESTConsumerService;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ProdFabbisognoLineeProdRESTConsumer extends _BaseRESTConsumer {
|
public class ProdFabbisognoLineeProdRESTConsumer extends _BaseRESTConsumer {
|
||||||
@ -26,254 +33,20 @@ public class ProdFabbisognoLineeProdRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
public void loadFabbisogno(Date startDate, Date endDate, String codMdep, RunnableArgs<List<ProdFabbisognoLineeProdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void loadFabbisogno(Date startDate, Date endDate, String codMdep, RunnableArgs<List<ProdFabbisognoLineeProdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String sql = "WITH input_values AS ( " +
|
ProdFabbisognoLineeProdRESTConsumerService prodFabbisognoLineeProdRESTConsumerService = RESTBuilder.getService(ProdFabbisognoLineeProdRESTConsumerService.class);
|
||||||
" SELECT " + UtilityDB.valueToString(startDate) + " AS data_inizio, " +
|
prodFabbisognoLineeProdRESTConsumerService.loadFabbisogno(UtilityDate.formatDate(startDate, "yyyy-MM-dd"), UtilityDate.formatDate(endDate, "yyyy-MM-dd"), codMdep)
|
||||||
" " + UtilityDB.valueToString(endDate) + " AS data_fine, " +
|
.enqueue(new Callback<>() {
|
||||||
// " " + UtilityDB.valueToString(lineaProd) + " AS linea_prod, " +
|
@Override
|
||||||
" " + UtilityDB.valueToString(codMdep) + " AS cod_mdep)," +
|
public void onResponse(Call<ServiceRESTResponse<List<ProdFabbisognoLineeProdDTO>>> call,
|
||||||
" withdraw_mtb_colr AS ( " +
|
Response<ServiceRESTResponse<List<ProdFabbisognoLineeProdDTO>>> response) {
|
||||||
" SELECT cod_mart, " +
|
analyzeAnswer(response, "retrieveFabbisogno", onComplete, onFailed);
|
||||||
" SUM(ISNULL(qta_col, 0)) as qta_col, " +
|
}
|
||||||
" SUM(ISNULL(num_cnf, 0)) as num_cnf, " +
|
|
||||||
" mtb_colr.data_ord, " +
|
|
||||||
" mtb_colr.num_ord, " +
|
|
||||||
" mtb_colr.gestione " +
|
|
||||||
" FROM mtb_colr " +
|
|
||||||
" INNER JOIN mtb_colt mc on mtb_colr.gestione = mc.gestione and mtb_colr.data_collo = mc.data_collo and " +
|
|
||||||
" mtb_colr.ser_collo = mc.ser_collo and mtb_colr.num_collo = mc.num_collo " +
|
|
||||||
" WHERE segno = -1 " +
|
|
||||||
" AND cod_dtip IS NULL " +
|
|
||||||
" GROUP BY cod_mart, " +
|
|
||||||
" mtb_colr.data_ord, " +
|
|
||||||
" mtb_colr.num_ord, " +
|
|
||||||
" mtb_colr.gestione " +
|
|
||||||
" ), " +
|
|
||||||
" custom_mtb_colr AS (SELECT cod_mart, " +
|
|
||||||
" SUM(qta_col) AS qta_col, " +
|
|
||||||
" SUM(num_cnf) AS num_cnf, " +
|
|
||||||
" posizione " +
|
|
||||||
" FROM mvw_sitart_udc_det_inventario " +
|
|
||||||
" GROUP BY cod_mart, posizione), " +
|
|
||||||
" grouped_ord AS ( " +
|
|
||||||
" SELECT dtb_ordr.cod_mart, " +
|
|
||||||
" dtb_ordt.cod_jfas, " +
|
|
||||||
" dtb_ordt.cod_mdep, " +
|
|
||||||
" dtb_ordt.gestione, " +
|
|
||||||
" CONVERT(NUMERIC(15, 5), SUM(dtb_ordr.qta_ord * dtb_ordr.rap_conv) - " +
|
|
||||||
" SUM(dtb_ordr.qta_evasa * dtb_ordr.rap_conv)) AS qta_ord, " +
|
|
||||||
" SUM(dtb_ordr.num_cnf - dtb_ordr.num_cnf_evasa) AS num_cnf_ord, " +
|
|
||||||
" SUM(ISNULL(withdraw_mtb_colr.qta_col, 0)) AS qta_col_scaricata, " +
|
|
||||||
" SUM(ISNULL(withdraw_mtb_colr.num_cnf, 0)) AS num_cnf_scaricata " +
|
|
||||||
" FROM dtb_ordr " +
|
|
||||||
" INNER JOIN dtb_ordt on dtb_ordr.gestione = dtb_ordt.gestione AND " +
|
|
||||||
" dtb_ordr.data_ord = dtb_ordt.data_ord AND " +
|
|
||||||
" dtb_ordr.num_ord = dtb_ordt.num_ord " +
|
|
||||||
" LEFT OUTER JOIN withdraw_mtb_colr " +
|
|
||||||
" ON withdraw_mtb_colr.gestione = dtb_ordt.gestione AND " +
|
|
||||||
" withdraw_mtb_colr.num_ord = dtb_ordt.num_ord AND " +
|
|
||||||
" withdraw_mtb_colr.data_ord = dtb_ordt.data_ord AND " +
|
|
||||||
" withdraw_mtb_colr.cod_mart = dtb_ordr.cod_mart " +
|
|
||||||
" CROSS APPLY input_values " +
|
|
||||||
" WHERE dtb_ordt.gestione = 'L' " +
|
|
||||||
" AND flag_evaso = 'I' " +
|
|
||||||
" AND flag_evaso_prod = 'I' " +
|
|
||||||
" AND dtb_ordr.flag_evaso_forzato = 'N' " +
|
|
||||||
" AND flag_annulla = 'N' " +
|
|
||||||
" AND dtb_ordt.cod_mdep = input_values.cod_mdep " +
|
|
||||||
" AND dtb_ordt.data_ord BETWEEN input_values.data_inizio AND input_values.data_fine " +
|
|
||||||
" GROUP BY dtb_ordr.cod_mart, dtb_ordt.cod_jfas, dtb_ordt.cod_mdep, dtb_ordt.gestione " +
|
|
||||||
" ), " +
|
|
||||||
" tmp_ord AS (SELECT grouped_ord.cod_mart, " +
|
|
||||||
" mtb_aart.unt_mis, " +
|
|
||||||
" grouped_ord.cod_jfas, " +
|
|
||||||
" SUM(qta_ord) - SUM(qta_col_scaricata) AS qta_ord, " +
|
|
||||||
" SUM(num_cnf_ord) - SUM(num_cnf_scaricata) AS num_cnf_ord " +
|
|
||||||
" FROM grouped_ord " +
|
|
||||||
" INNER JOIN mtb_aart ON grouped_ord.cod_mart = mtb_aart.cod_mart " +
|
|
||||||
" CROSS APPLY input_values " +
|
|
||||||
" GROUP BY grouped_ord.cod_mart, mtb_aart.unt_mis, grouped_ord.cod_jfas " +
|
|
||||||
" ), " +
|
|
||||||
" ord_without_positioned_mtb_colt AS ( " +
|
|
||||||
" SELECT tmp_ord.cod_mart, " +
|
|
||||||
" tmp_ord.cod_jfas, " +
|
|
||||||
" ISNULL(custom_mtb_colr_on_linea.posizione, tmp_ord.cod_jfas) AS posizione, " +
|
|
||||||
" unt_mis, " +
|
|
||||||
" qta_ord AS qta_ord_calc, " +
|
|
||||||
" num_cnf_ord AS num_cnf_ord_calc, " +
|
|
||||||
" ISNULL(custom_mtb_colr_on_linea.qta_col, 0) AS qta_gia_posizionata, " +
|
|
||||||
" ISNULL(custom_mtb_colr_on_linea.num_cnf, 0) AS num_cnf_gia_posizionata, " +
|
|
||||||
" qta_ord - ISNULL(custom_mtb_colr_on_linea.qta_col, 0) AS qta_fabbisogno, " +
|
|
||||||
" num_cnf_ord - ISNULL(custom_mtb_colr_on_linea.num_cnf, 0) AS num_cnf_fabbisogno " +
|
|
||||||
" FROM tmp_ord " +
|
|
||||||
" INNER JOIN jrl_fase_posizioni ON tmp_ord.cod_jfas = jrl_fase_posizioni.cod_jfas " +
|
|
||||||
" AND tmp_ord.cod_jfas = jrl_fase_posizioni.posizione " +
|
|
||||||
" LEFT OUTER JOIN custom_mtb_colr custom_mtb_colr_on_linea " +
|
|
||||||
" ON tmp_ord.cod_mart = custom_mtb_colr_on_linea.cod_mart AND " +
|
|
||||||
" tmp_ord.cod_jfas = custom_mtb_colr_on_linea.posizione " +
|
|
||||||
" " +
|
|
||||||
" UNION ALL " +
|
|
||||||
" " +
|
|
||||||
" SELECT DISTINCT tmp_ord.cod_mart, " +
|
|
||||||
" null AS cod_jfas, " +
|
|
||||||
" jrl_fase_posizioni.posizione, " +
|
|
||||||
" unt_mis, " +
|
|
||||||
" 0 AS qta_ord_calc, " +
|
|
||||||
" 0 AS num_cnf_ord_calc, " +
|
|
||||||
" ISNULL(custom_mtb_colr_on_linea.qta_col, 0) AS qta_gia_posizionata, " +
|
|
||||||
" ISNULL(custom_mtb_colr_on_linea.num_cnf, 0) AS num_cnf_gia_posizionata, " +
|
|
||||||
" 0 AS qta_fabbisogno, " +
|
|
||||||
" 0 AS num_cnf_fabbisogno " +
|
|
||||||
" FROM tmp_ord " +
|
|
||||||
" INNER JOIN jrl_fase_posizioni ON tmp_ord.cod_jfas = jrl_fase_posizioni.cod_jfas " +
|
|
||||||
" AND tmp_ord.cod_jfas <> jrl_fase_posizioni.posizione " +
|
|
||||||
" " +
|
|
||||||
" " +
|
|
||||||
" LEFT OUTER JOIN custom_mtb_colr custom_mtb_colr_on_linea " +
|
|
||||||
" ON tmp_ord.cod_mart = custom_mtb_colr_on_linea.cod_mart AND " +
|
|
||||||
" jrl_fase_posizioni.posizione = custom_mtb_colr_on_linea.posizione " +
|
|
||||||
" ) " +
|
|
||||||
"SELECT cod_mart, " +
|
|
||||||
" unt_mis, " +
|
|
||||||
" input_values.data_inizio, " +
|
|
||||||
" input_values.data_fine, " +
|
|
||||||
" SUM(qta_ord_calc) AS qta_ord, " +
|
|
||||||
" SUM(num_cnf_ord_calc) AS num_cnf_ord, " +
|
|
||||||
" SUM(qta_gia_posizionata) AS qta_col_versata, " +
|
|
||||||
" SUM(num_cnf_gia_posizionata) AS num_cnf_versata, " +
|
|
||||||
" SUM(qta_ord_calc - qta_gia_posizionata) AS qta_fabbisogno, " +
|
|
||||||
" SUM(num_cnf_ord_calc - num_cnf_gia_posizionata) AS num_cnf_fabbisogno " +
|
|
||||||
"FROM ord_without_positioned_mtb_colt " +
|
|
||||||
"CROSS APPLY input_values " +
|
|
||||||
"GROUP BY cod_mart, unt_mis, input_values.data_inizio, input_values.data_fine " +
|
|
||||||
"HAVING SUM(qta_ord_calc - qta_gia_posizionata) > 0 AND SUM(num_cnf_ord_calc - num_cnf_gia_posizionata) > 0 " +
|
|
||||||
"ORDER BY cod_mart";
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<ProdFabbisognoLineeProdDTO>>> call, Throwable t) {
|
||||||
/*
|
onFailed.run(new Exception(t));
|
||||||
* Query splittata per cod_jfas (più pesante)
|
}
|
||||||
WITH input_values AS (SELECT '2021-02-15' AS data_inizio,
|
});
|
||||||
'2021-02-28' AS data_fine,
|
|
||||||
--'SC06' AS linea_prod,
|
|
||||||
'34' AS cod_mdep),
|
|
||||||
withdraw_mtb_colr AS (
|
|
||||||
SELECT cod_mart,
|
|
||||||
SUM(ISNULL(qta_col, 0)) as qta_col,
|
|
||||||
SUM(ISNULL(num_cnf, 0)) as num_cnf,
|
|
||||||
mtb_colr.data_ord,
|
|
||||||
mtb_colr.num_ord,
|
|
||||||
mtb_colr.gestione
|
|
||||||
FROM mtb_colr
|
|
||||||
INNER JOIN mtb_colt mc on mtb_colr.gestione = mc.gestione and mtb_colr.data_collo = mc.data_collo and
|
|
||||||
mtb_colr.ser_collo = mc.ser_collo and mtb_colr.num_collo = mc.num_collo
|
|
||||||
WHERE segno = -1
|
|
||||||
and cod_dtip IS NULL
|
|
||||||
GROUP BY cod_mart,
|
|
||||||
mtb_colr.data_ord,
|
|
||||||
mtb_colr.num_ord,
|
|
||||||
mtb_colr.gestione
|
|
||||||
),
|
|
||||||
custom_mtb_colr AS (SELECT cod_mart,
|
|
||||||
SUM(qta_col) AS qta_col,
|
|
||||||
SUM(num_cnf) AS num_cnf,
|
|
||||||
posizione
|
|
||||||
FROM mvw_sitart_udc_det_inventario
|
|
||||||
GROUP BY cod_mart, posizione),
|
|
||||||
grouped_ord AS (
|
|
||||||
SELECT dtb_ordr.cod_mart,
|
|
||||||
dtb_ordt.cod_jfas,
|
|
||||||
dtb_ordt.cod_mdep,
|
|
||||||
dtb_ordt.gestione,
|
|
||||||
CONVERT(NUMERIC(15, 5), SUM(dtb_ordr.qta_ord * dtb_ordr.rap_conv) -
|
|
||||||
SUM(dtb_ordr.qta_evasa * dtb_ordr.rap_conv)) AS qta_ord,
|
|
||||||
SUM(dtb_ordr.num_cnf - dtb_ordr.num_cnf_evasa) AS num_cnf_ord,
|
|
||||||
SUM(ISNULL(withdraw_mtb_colr.qta_col, 0)) AS qta_col_scaricata,
|
|
||||||
SUM(ISNULL(withdraw_mtb_colr.num_cnf, 0)) AS num_cnf_scaricata
|
|
||||||
FROM dtb_ordr
|
|
||||||
INNER JOIN dtb_ordt on dtb_ordr.gestione = dtb_ordt.gestione AND
|
|
||||||
dtb_ordr.data_ord = dtb_ordt.data_ord AND
|
|
||||||
dtb_ordr.num_ord = dtb_ordt.num_ord
|
|
||||||
LEFT OUTER JOIN withdraw_mtb_colr
|
|
||||||
ON withdraw_mtb_colr.gestione = dtb_ordt.gestione AND
|
|
||||||
withdraw_mtb_colr.num_ord = dtb_ordt.num_ord AND
|
|
||||||
withdraw_mtb_colr.data_ord = dtb_ordt.data_ord AND
|
|
||||||
withdraw_mtb_colr.cod_mart = dtb_ordr.cod_mart
|
|
||||||
CROSS APPLY input_values
|
|
||||||
WHERE dtb_ordt.gestione = 'L'
|
|
||||||
AND flag_evaso = 'I'
|
|
||||||
AND dtb_ordr.flag_evaso_forzato = 'N'
|
|
||||||
AND flag_annulla = 'N'
|
|
||||||
AND dtb_ordt.cod_mdep = input_values.cod_mdep
|
|
||||||
AND dtb_ordt.data_ord BETWEEN input_values.data_inizio AND input_values.data_fine
|
|
||||||
GROUP BY dtb_ordr.cod_mart, dtb_ordt.cod_jfas, dtb_ordt.cod_mdep, dtb_ordt.gestione
|
|
||||||
),
|
|
||||||
tmp_ord AS (SELECT grouped_ord.cod_mart,
|
|
||||||
mtb_aart.unt_mis,
|
|
||||||
grouped_ord.cod_jfas,
|
|
||||||
SUM(qta_ord) - SUM(qta_col_scaricata) AS qta_ord,
|
|
||||||
SUM(num_cnf_ord) - SUM(num_cnf_scaricata) AS num_cnf_ord
|
|
||||||
FROM grouped_ord
|
|
||||||
INNER JOIN mtb_aart ON grouped_ord.cod_mart = mtb_aart.cod_mart
|
|
||||||
CROSS APPLY input_values
|
|
||||||
GROUP BY grouped_ord.cod_mart, mtb_aart.unt_mis, grouped_ord.cod_jfas
|
|
||||||
),
|
|
||||||
ord_without_positioned_mtb_colt AS (
|
|
||||||
SELECT tmp_ord.cod_mart,
|
|
||||||
tmp_ord.cod_jfas,
|
|
||||||
ISNULL(custom_mtb_colr_on_linea.posizione, tmp_ord.cod_jfas) AS posizione,
|
|
||||||
unt_mis,
|
|
||||||
qta_ord AS qta_ord_calc,
|
|
||||||
num_cnf_ord AS num_cnf_ord_calc,
|
|
||||||
ISNULL(custom_mtb_colr_on_linea.qta_col, 0) AS qta_gia_posizionata,
|
|
||||||
ISNULL(custom_mtb_colr_on_linea.num_cnf, 0) AS num_cnf_gia_posizionata,
|
|
||||||
qta_ord - ISNULL(custom_mtb_colr_on_linea.qta_col, 0) AS qta_fabbisogno,
|
|
||||||
num_cnf_ord - ISNULL(custom_mtb_colr_on_linea.num_cnf, 0) AS num_cnf_fabbisogno
|
|
||||||
FROM tmp_ord
|
|
||||||
INNER JOIN jrl_fase_posizioni ON tmp_ord.cod_jfas = jrl_fase_posizioni.cod_jfas
|
|
||||||
AND tmp_ord.cod_jfas = jrl_fase_posizioni.posizione
|
|
||||||
LEFT OUTER JOIN custom_mtb_colr custom_mtb_colr_on_linea
|
|
||||||
ON tmp_ord.cod_mart = custom_mtb_colr_on_linea.cod_mart AND
|
|
||||||
tmp_ord.cod_jfas = custom_mtb_colr_on_linea.posizione
|
|
||||||
|
|
||||||
UNION ALL
|
|
||||||
|
|
||||||
SELECT DISTINCT tmp_ord.cod_mart,
|
|
||||||
null AS cod_jfas,
|
|
||||||
jrl_fase_posizioni.posizione,
|
|
||||||
unt_mis,
|
|
||||||
0 AS qta_ord_calc,
|
|
||||||
0 AS num_cnf_ord_calc,
|
|
||||||
ISNULL(custom_mtb_colr_on_linea.qta_col, 0) AS qta_gia_posizionata,
|
|
||||||
ISNULL(custom_mtb_colr_on_linea.num_cnf, 0) AS num_cnf_gia_posizionata,
|
|
||||||
0 AS qta_fabbisogno,
|
|
||||||
0 AS num_cnf_fabbisogno
|
|
||||||
FROM tmp_ord
|
|
||||||
INNER JOIN jrl_fase_posizioni ON tmp_ord.cod_jfas = jrl_fase_posizioni.cod_jfas
|
|
||||||
AND tmp_ord.cod_jfas <> jrl_fase_posizioni.posizione
|
|
||||||
|
|
||||||
|
|
||||||
LEFT OUTER JOIN custom_mtb_colr custom_mtb_colr_on_linea
|
|
||||||
ON tmp_ord.cod_mart = custom_mtb_colr_on_linea.cod_mart AND
|
|
||||||
jrl_fase_posizioni.posizione = custom_mtb_colr_on_linea.posizione
|
|
||||||
)
|
|
||||||
SELECT cod_mart,
|
|
||||||
cod_jfas,
|
|
||||||
posizione,
|
|
||||||
unt_mis,
|
|
||||||
qta_ord_calc AS qta_ord,
|
|
||||||
num_cnf_ord_calc AS num_cnf_ord,
|
|
||||||
qta_gia_posizionata AS qta_col_versata,
|
|
||||||
num_cnf_gia_posizionata AS num_cnf_versata,
|
|
||||||
qta_ord_calc - qta_gia_posizionata AS qta_fabbisogno,
|
|
||||||
num_cnf_ord_calc - num_cnf_gia_posizionata AS num_cnf_fabbisogno
|
|
||||||
FROM ord_without_positioned_mtb_colt
|
|
||||||
|
|
||||||
ORDER BY cod_mart, posizione
|
|
||||||
* */
|
|
||||||
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<ProdFabbisognoLineeProdDTO>>() {}.getType();
|
|
||||||
this.mSystemRESTConsumer.processSql(sql, typeOfObjectsList, onComplete, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface ProdFabbisognoLineeProdRESTConsumerService
|
||||||
|
{
|
||||||
|
@GET("wms/approvvigionamento/retrieveFabbisogno")
|
||||||
|
Call<ServiceRESTResponse<List<ProdFabbisognoLineeProdDTO>>> loadFabbisogno(@Query("startDate") String startDate,
|
||||||
|
@Query("endDate") String endDate,
|
||||||
|
@Query("codMdep") String codMdep);
|
||||||
|
}
|
||||||
@ -849,6 +849,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
.setPartitaMag(partitaMag)
|
.setPartitaMag(partitaMag)
|
||||||
.setDataScad(dataScad)
|
.setDataScad(dataScad)
|
||||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||||
|
.setWarnOnQuantityOverflow(SettingsManager.iDB().isFlagOverflowQuantityWarning())
|
||||||
.setCanLUBeClosed(true)
|
.setCanLUBeClosed(true)
|
||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
.setStatoPartitaMag(pickingObjectDTO != null ? pickingObjectDTO.getStatoArticoloDTO() : null)
|
.setStatoPartitaMag(pickingObjectDTO != null ? pickingObjectDTO.getStatoArticoloDTO() : null)
|
||||||
|
|||||||
@ -44,6 +44,7 @@ public class DialogInputQuantityV2DTO {
|
|||||||
private boolean saveOnImeDone = false;
|
private boolean saveOnImeDone = false;
|
||||||
private boolean notifyProductLotStatus = false;
|
private boolean notifyProductLotStatus = false;
|
||||||
private boolean disableTracciabilitaCheck = false;
|
private boolean disableTracciabilitaCheck = false;
|
||||||
|
private boolean warnOnQuantityOverflow = false;
|
||||||
|
|
||||||
private StatoArticoloDTO statoPartitaMag;
|
private StatoArticoloDTO statoPartitaMag;
|
||||||
|
|
||||||
@ -54,6 +55,8 @@ public class DialogInputQuantityV2DTO {
|
|||||||
|
|
||||||
private boolean canOverflowOrderQuantity;
|
private boolean canOverflowOrderQuantity;
|
||||||
|
|
||||||
|
private String customArtDescription;
|
||||||
|
|
||||||
public MtbAart getMtbAart() {
|
public MtbAart getMtbAart() {
|
||||||
return mtbAart;
|
return mtbAart;
|
||||||
}
|
}
|
||||||
@ -359,4 +362,22 @@ public class DialogInputQuantityV2DTO {
|
|||||||
this.disableTracciabilitaCheck = disableTracciabilitaCheck;
|
this.disableTracciabilitaCheck = disableTracciabilitaCheck;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCustomArtDescription() {
|
||||||
|
return customArtDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2DTO setCustomArtDescription(String customArtDescription) {
|
||||||
|
this.customArtDescription = customArtDescription;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWarnOnQuantityOverflow() {
|
||||||
|
return warnOnQuantityOverflow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2DTO setWarnOnQuantityOverflow(boolean warnOnQuantityOverflow) {
|
||||||
|
this.warnOnQuantityOverflow = warnOnQuantityOverflow;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,6 +48,7 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
@ -151,6 +152,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
|
|
||||||
this.mViewModel
|
this.mViewModel
|
||||||
.setMtbAart(mDialogInputQuantityV2DTO.getMtbAart())
|
.setMtbAart(mDialogInputQuantityV2DTO.getMtbAart())
|
||||||
|
.setArtDescription(UtilityString.isNull(mDialogInputQuantityV2DTO.getCustomArtDescription(), mDialogInputQuantityV2DTO.getMtbAart().getDescrizioneEstesa()))
|
||||||
.setInitialNumCnf(mDialogInputQuantityV2DTO.getInitialNumCnf())
|
.setInitialNumCnf(mDialogInputQuantityV2DTO.getInitialNumCnf())
|
||||||
.setInitialQtaCnf(mDialogInputQuantityV2DTO.getInitialQtaCnf())
|
.setInitialQtaCnf(mDialogInputQuantityV2DTO.getInitialQtaCnf())
|
||||||
.setInitialQtaTot(mDialogInputQuantityV2DTO.getInitialQtaTot())
|
.setInitialQtaTot(mDialogInputQuantityV2DTO.getInitialQtaTot())
|
||||||
@ -168,6 +170,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
.setTotalQtaAvailable(mDialogInputQuantityV2DTO.getTotalQtaAvailable())
|
.setTotalQtaAvailable(mDialogInputQuantityV2DTO.getTotalQtaAvailable())
|
||||||
.setCanInputZeroQuantity(mDialogInputQuantityV2DTO.isCanInputZeroQuantity())
|
.setCanInputZeroQuantity(mDialogInputQuantityV2DTO.isCanInputZeroQuantity())
|
||||||
.setCanOverflowOrderQuantity(mDialogInputQuantityV2DTO.isCanOverflowOrderQuantity())
|
.setCanOverflowOrderQuantity(mDialogInputQuantityV2DTO.isCanOverflowOrderQuantity())
|
||||||
|
.setWarnOnQuantityOverflow(mDialogInputQuantityV2DTO.isWarnOnQuantityOverflow())
|
||||||
.setQtaCnfAvailable(mDialogInputQuantityV2DTO.getQtaCnfAvailable())
|
.setQtaCnfAvailable(mDialogInputQuantityV2DTO.getQtaCnfAvailable())
|
||||||
.setPartitaMag(mDialogInputQuantityV2DTO.getPartitaMag())
|
.setPartitaMag(mDialogInputQuantityV2DTO.getPartitaMag())
|
||||||
.setNote(mDialogInputQuantityV2DTO.getNote())
|
.setNote(mDialogInputQuantityV2DTO.getNote())
|
||||||
@ -254,19 +257,23 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
};
|
};
|
||||||
|
|
||||||
public void save() {
|
public void save() {
|
||||||
if (this.mViewModel.validate()) {
|
this.mViewModel.validate(validated -> {
|
||||||
|
if (validated) {
|
||||||
this.mAbort = false;
|
this.mAbort = false;
|
||||||
dismiss();
|
dismiss();
|
||||||
this.mOnComplete.run(this.mViewModel.getResult(), false);
|
this.mOnComplete.run(this.mViewModel.getResult(), false);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveAndCloseLU() {
|
public void saveAndCloseLU() {
|
||||||
if (this.mViewModel.validate()) {
|
this.mViewModel.validate(validated -> {
|
||||||
|
if (validated) {
|
||||||
this.mAbort = false;
|
this.mAbort = false;
|
||||||
dismiss();
|
dismiss();
|
||||||
this.mOnComplete.run(this.mViewModel.getResult(), true);
|
this.mOnComplete.run(this.mViewModel.getResult(), true);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
@ -530,4 +537,13 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
.makeErrorDialog(new SpannableString(Html.fromHtml(ex.getMessage())), null, null)
|
.makeErrorDialog(new SpannableString(Html.fromHtml(ex.getMessage())), null, null)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onWarning(String text, RunnableArgs<Boolean> result) {
|
||||||
|
DialogSimpleMessageView.makeWarningDialog(new SpannableString(Html.fromHtml(text)),
|
||||||
|
null,
|
||||||
|
() -> result.run(true),
|
||||||
|
() -> result.run(false)
|
||||||
|
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,11 +3,14 @@ package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
|||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
@ -32,6 +35,7 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
private final int UPDATE_QTA_TOT = 2;
|
private final int UPDATE_QTA_TOT = 2;
|
||||||
|
|
||||||
public ObservableField<MtbAart> mtbAart = new ObservableField<>();
|
public ObservableField<MtbAart> mtbAart = new ObservableField<>();
|
||||||
|
public BindableString artDescription = new BindableString();
|
||||||
|
|
||||||
public ObservableField<Boolean> blockedNumCnf = new ObservableField<>();
|
public ObservableField<Boolean> blockedNumCnf = new ObservableField<>();
|
||||||
public ObservableField<Boolean> blockedQtaCnf = new ObservableField<>();
|
public ObservableField<Boolean> blockedQtaCnf = new ObservableField<>();
|
||||||
@ -78,6 +82,7 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
private int onNumCnfInputChanged;
|
private int onNumCnfInputChanged;
|
||||||
private int onQtaTotInputChanged;
|
private int onQtaTotInputChanged;
|
||||||
private boolean disableTracciabilitaCheck;
|
private boolean disableTracciabilitaCheck;
|
||||||
|
private boolean warnOnQuantityOverflow;
|
||||||
|
|
||||||
private Listener mListener;
|
private Listener mListener;
|
||||||
|
|
||||||
@ -236,6 +241,11 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ViewModel setArtDescription(String artDescription) {
|
||||||
|
this.artDescription.set(artDescription);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public DialogInputQuantityV2ViewModel setInitialNumCnf(BigDecimal initialNumCnf) {
|
public DialogInputQuantityV2ViewModel setInitialNumCnf(BigDecimal initialNumCnf) {
|
||||||
this.initialNumCnf = initialNumCnf;
|
this.initialNumCnf = initialNumCnf;
|
||||||
return this;
|
return this;
|
||||||
@ -326,6 +336,11 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ViewModel setWarnOnQuantityOverflow(boolean warnOnQuantityOverflow) {
|
||||||
|
this.warnOnQuantityOverflow = warnOnQuantityOverflow;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public DialogInputQuantityV2ViewModel setCanPartitaMagBeChanged(boolean canPartitaMagBeChanged) {
|
public DialogInputQuantityV2ViewModel setCanPartitaMagBeChanged(boolean canPartitaMagBeChanged) {
|
||||||
this.canPartitaMagBeChanged = canPartitaMagBeChanged;
|
this.canPartitaMagBeChanged = canPartitaMagBeChanged;
|
||||||
return this;
|
return this;
|
||||||
@ -450,11 +465,12 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
this.blockedQtaTot.set(false);
|
this.blockedQtaTot.set(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean validate() {
|
public void validate(RunnableArgs<Boolean> onValidated) {
|
||||||
if (this.internalQtaCnf == null || UtilityBigDecimal.equalsTo(this.internalQtaCnf, BigDecimal.ZERO)) {
|
if (this.internalQtaCnf == null || UtilityBigDecimal.equalsTo(this.internalQtaCnf, BigDecimal.ZERO)) {
|
||||||
|
|
||||||
this.mListener.onError(new InvalidQtaCnfQuantityException());
|
this.mListener.onError(new InvalidQtaCnfQuantityException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!disableTracciabilitaCheck && mtbAart.get().isFlagTracciabilitaBoolean() && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
if (!disableTracciabilitaCheck && mtbAart.get().isFlagTracciabilitaBoolean() && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||||
@ -462,51 +478,59 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
internalPartitaMag = suggestPartitaMagRunnable.run(this);
|
internalPartitaMag = suggestPartitaMagRunnable.run(this);
|
||||||
if (internalPartitaMag == null) {
|
if (internalPartitaMag == null) {
|
||||||
this.mListener.onError(new InvalidBatchLotException());
|
this.mListener.onError(new InvalidBatchLotException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.mListener.onError(new InvalidBatchLotException());
|
this.mListener.onError(new InvalidBatchLotException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shouldAskDataScad && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
if (this.shouldAskDataScad && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||||
|
|
||||||
this.mListener.onError(new InvalidBatchLotException());
|
this.mListener.onError(new InvalidBatchLotException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shouldAskDataScad && this.internalDataScad == null) {
|
if (this.shouldAskDataScad && this.internalDataScad == null) {
|
||||||
|
|
||||||
this.mListener.onError(new InvalidExpireDateException());
|
this.mListener.onError(new InvalidExpireDateException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalQtaTot, this.totalQtaOrd) &&
|
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalQtaTot, this.totalQtaOrd) &&
|
||||||
this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
||||||
|
|
||||||
this.mListener.onError(new OverflowQtaTotOrderedQuantityException());
|
this.mListener.onError(new OverflowQtaTotOrderedQuantityException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfOrd) &&
|
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfOrd) &&
|
||||||
!this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
!this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
||||||
|
|
||||||
this.mListener.onError(new OverflowNumCnfOrderedQuantityException());
|
this.mListener.onError(new OverflowNumCnfOrderedQuantityException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UtilityBigDecimal.greaterThan(this.internalQtaTot, this.totalQtaAvailable)) {
|
if (UtilityBigDecimal.greaterThan(this.internalQtaTot, this.totalQtaAvailable)) {
|
||||||
|
|
||||||
this.mListener.onError(new OverflowQtaTotAvailableQuantityException());
|
this.mListener.onError(new OverflowQtaTotAvailableQuantityException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfAvailable) &&
|
if (UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfAvailable) &&
|
||||||
!this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
!this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
||||||
|
|
||||||
this.mListener.onError(new OverflowNumCnfAvailableQuantityException());
|
this.mListener.onError(new OverflowNumCnfAvailableQuantityException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.canInputZeroQuantity && (this.internalNumCnf == null || this.internalQtaCnf == null || this.internalQtaTot == null ||
|
if (!this.canInputZeroQuantity && (this.internalNumCnf == null || this.internalQtaCnf == null || this.internalQtaTot == null ||
|
||||||
@ -515,17 +539,36 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
UtilityBigDecimal.equalsOrLowerThan(this.internalQtaTot, BigDecimal.ZERO))) {
|
UtilityBigDecimal.equalsOrLowerThan(this.internalQtaTot, BigDecimal.ZERO))) {
|
||||||
|
|
||||||
this.mListener.onError(new InvalidQuantityException());
|
this.mListener.onError(new InvalidQuantityException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isNoteMandatory() && (this.internalNote == null || this.internalNote.length() <= 0)) {
|
if (this.isNoteMandatory() && (this.internalNote == null || this.internalNote.length() <= 0)) {
|
||||||
this.mListener.onError(new InvalidNotesException());
|
this.mListener.onError(new InvalidNotesException());
|
||||||
return false;
|
onValidated.run(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(this.internalPartitaMag))
|
if (!UtilityString.isNullOrEmpty(this.internalPartitaMag))
|
||||||
this.internalPartitaMag = this.internalPartitaMag.toUpperCase();
|
this.internalPartitaMag = this.internalPartitaMag.toUpperCase();
|
||||||
return true;
|
|
||||||
|
//Gli ultimi due controlli sono in coda a causa della callBack di onWarning, non eseguirebbe i controlli messi dopo
|
||||||
|
|
||||||
|
if (this.warnOnQuantityOverflow && UtilityBigDecimal.greaterThan(this.internalQtaTot, this.totalQtaOrd) &&
|
||||||
|
this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
||||||
|
|
||||||
|
this.mListener.onWarning("Hai inserito una quantità superiore rispetto a quella presente nell'ordine. <br>Continuare?", onValidated);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.warnOnQuantityOverflow && UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfOrd) &&
|
||||||
|
!this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
||||||
|
|
||||||
|
this.mListener.onWarning("Hai inserito una quantità superiore rispetto a quella presente nell'ordine. <br>Continuare?", onValidated);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
onValidated.run(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DialogInputQuantityV2ResultDTO getResult() {
|
public DialogInputQuantityV2ResultDTO getResult() {
|
||||||
@ -536,7 +579,6 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
.setQtaCnf(this.internalQtaCnf)
|
.setQtaCnf(this.internalQtaCnf)
|
||||||
.setNote(this.internalNote)
|
.setNote(this.internalNote)
|
||||||
.setQtaTot(this.internalQtaTot);
|
.setQtaTot(this.internalQtaTot);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setListener(Listener listener) {
|
public void setListener(Listener listener) {
|
||||||
@ -570,5 +612,6 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
void onDataChanged();
|
void onDataChanged();
|
||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
void onWarning(String text, RunnableArgs<Boolean> result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,6 +147,18 @@
|
|||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
tools:text="DESCRIZIONE" />
|
tools:text="DESCRIZIONE" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/descrizione_sub_1"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_toStartOf="@id/secondary_unt_mis"
|
||||||
|
android:layout_below="@+id/descrizione"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="DATA ORD" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:id="@+id/secondary_unt_mis"
|
android:id="@+id/secondary_unt_mis"
|
||||||
|
|||||||
@ -108,7 +108,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:singleLine="false"
|
android:singleLine="false"
|
||||||
android:text="@{viewmodel.mtbAart.descrizioneEstesa}"
|
android:text="@{viewmodel.artDescription}"
|
||||||
tools:text="RAD 25 D H/L 200 - 10 EL B BIANCO" />
|
tools:text="RAD 25 D H/L 200 - 10 EL B BIANCO" />
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.9.0'
|
kotlin_version = '1.9.0'
|
||||||
agp_version = '8.1.2'
|
agp_version = '8.1.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user