Migliorato documento di reso quando effettuano le perdite

This commit is contained in:
Marco Elefante 2024-09-03 10:19:07 +02:00
parent 26ca580ba4
commit 44b9bc3fc1
6 changed files with 54 additions and 31 deletions

View File

@ -51,9 +51,9 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
}); });
} }
public void checkFrumaDocument(String fornitore, String numDoc, String dataDoc, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) { public void checkDocument(String fornitore, String numDoc, String dataDoc, String tipoDoc, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class); var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
inventarioRESTConsumerService.checkFrumaDoc(fornitore, numDoc, dataDoc) inventarioRESTConsumerService.checkDocument(fornitore, numDoc,tipoDoc, dataDoc)
.enqueue(new Callback<>() { .enqueue(new Callback<>() {
@Override @Override
public void onResponse(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull Response<ServiceRESTResponse<Boolean>> response) { public void onResponse(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull Response<ServiceRESTResponse<Boolean>> response) {

View File

@ -21,10 +21,11 @@ public interface DocumentiRESTConsumerService {
@POST("createDocFromColli") @POST("createDocFromColli")
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli); Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
@GET("wms/documento/checkFruma") @GET("wms/documento/checkDoc")
Call<ServiceRESTResponse<Boolean>> checkFrumaDoc( Call<ServiceRESTResponse<Boolean>> checkDocument(
@Query("fornitore") String fornitore, @Query("fornitore") String fornitore,
@Query("numDoc") String numDoc, @Query("numDoc") String numDoc,
@Query("tipoDoc") String tipoDoc,
@Query("dataDoc") String dataDoc); @Query("dataDoc") String dataDoc);
@GET("wms/documento/arts") @GET("wms/documento/arts")

View File

@ -76,13 +76,12 @@ public class DBSettingsModel {
private boolean flagProduzioneShowInfo = false; private boolean flagProduzioneShowInfo = false;
private boolean flagAccettazioneBollaUseQtaOrd = true; private boolean flagAccettazioneBollaUseQtaOrd = true;
private boolean flagWarningNewPartitaMag = false; private boolean flagWarningNewPartitaMag = false;
private boolean flagTracciamentoImballiCaricoEnabled = false; private boolean flagTracciamentoImballiCaricoEnabled = false;
private boolean flagTracciamentoImballiScaricoEnabled = false; private boolean flagTracciamentoImballiScaricoEnabled = false;
private boolean flagPickingLiberoEnableScanArt = false; private boolean flagPickingLiberoEnableScanArt = false;
private boolean flagAskDuplicateUDSSpedizione = false; private boolean flagAskDuplicateUDSSpedizione = false;
private boolean suggestDataScad = false; private boolean suggestDataScad = false;
private String docInterniRequestNumDoc;
public boolean isFlagSpedizioneEnableFakeGiacenza() { public boolean isFlagSpedizioneEnableFakeGiacenza() {
return flagSpedizioneEnableFakeGiacenza; return flagSpedizioneEnableFakeGiacenza;
@ -695,4 +694,13 @@ public class DBSettingsModel {
this.suggestDataScad = suggestDataScad; this.suggestDataScad = suggestDataScad;
return this; return this;
} }
public String getDocInterniRequestNumDoc() {
return docInterniRequestNumDoc;
}
public DBSettingsModel setDocInterniRequestNumDoc(String docInterniRequestNumDoc) {
this.docInterniRequestNumDoc = docInterniRequestNumDoc;
return this;
}
} }

View File

@ -557,6 +557,12 @@ public class SettingsManager {
dbSettingsModelIstance.setFlagTracciamentoImballiScaricoEnabled(!UtilityString.isNullOrEmpty(data)); dbSettingsModelIstance.setFlagTracciamentoImballiScaricoEnabled(!UtilityString.isNullOrEmpty(data));
})); }));
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
.setGestName("PVM")
.setSection("DOC_INTERNI")
.setKeySection("REQUEST_NUM_DOC")
.setSetter(dbSettingsModelIstance::setDocInterniRequestNumDoc));
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep(); String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();

View File

@ -105,11 +105,21 @@ public class DocInterniViewModel {
this.numDoc = selection.getNumDoc() != null ? selection.getNumDoc().toString() : null; this.numDoc = selection.getNumDoc() != null ? selection.getNumDoc().toString() : null;
this.note = selection.getNote(); this.note = selection.getNote();
if (dtbTipi.getCodDtip().equalsIgnoreCase("FRUMA")) { String codAnag = null;
documentRESTConsumer.checkFrumaDocument( if (fornitore != null){
fornitore.getCodAnag(), codAnag = fornitore.getCodAnag();
}
String codDtip = null;
if (dtbTipi != null){
codDtip = dtbTipi.getCodDtip();
}
documentRESTConsumer.checkDocument(
codAnag,
numDoc, numDoc,
UtilityDate.formatDate(dataDoc, "yyyy/MM/dd"), UtilityDate.formatDate(dataDoc, "yyyy/MM/dd"),
codDtip,
data -> { data -> {
if (!data) { if (!data) {
this.sendWarning(UtilityResources.getString(R.string.no_doc_found_message), this::init); this.sendWarning(UtilityResources.getString(R.string.no_doc_found_message), this::init);
@ -123,13 +133,6 @@ public class DocInterniViewModel {
}, },
this::sendError this::sendError
); );
} else {
action.run();
this.sendOnLoadingStarted();
fetchProducts(() -> {
fetchDocuments(this::sendOnLoadingEnded);
});
}
} }
public void fetchProducts(Runnable onComplete) { public void fetchProducts(Runnable onComplete) {

View File

@ -3,10 +3,13 @@ package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModel;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityString; import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.exception.DocumentRequiredException; import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.exception.DocumentRequiredException;
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.exception.FornitoreRequiredException; import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.exception.FornitoreRequiredException;
@ -33,9 +36,11 @@ public class DialogSelectDocInfoViewModel extends ViewModel {
private final MutableLiveData<Boolean> noteRequired = new MutableLiveData<>(false); private final MutableLiveData<Boolean> noteRequired = new MutableLiveData<>(false);
public DialogSelectDocInfoViewModel() { public DialogSelectDocInfoViewModel() {
List<String> requestNumDocList = Arrays.asList(SettingsManager.iDB().getDocInterniRequestNumDoc().split("\\|"));
tipoDoc.observeForever(val -> fornitoreRequired.postValue(val != null && (val.getGestioneDoc().equals("T") || val.getGestioneDoc().equals("A") || (val.getGestioneDoc().equals("P") && !val.getGestione().equals("L"))))); tipoDoc.observeForever(val -> fornitoreRequired.postValue(val != null && (val.getGestioneDoc().equals("T") || val.getGestioneDoc().equals("A") || (val.getGestioneDoc().equals("P") && !val.getGestione().equals("L")))));
tipoDoc.observeForever(val -> documentRequired.postValue(val != null && val.getGestioneDoc().equalsIgnoreCase("P") && !val.getGestione().equalsIgnoreCase("L"))); tipoDoc.observeForever(val -> documentRequired.postValue(val != null && (val.getGestioneDoc().equalsIgnoreCase("P") && !val.getGestione().equalsIgnoreCase("L")) || requestNumDocList.contains(Objects.requireNonNull(val).getCodDtip())));
tipoDoc.observeForever(val -> noteRequired.postValue(val != null && val.getGestioneDoc().equals("P") && val.getGestione().equals("L"))); tipoDoc.observeForever(val -> noteRequired.postValue(val != null && val.getGestioneDoc().equals("P") && val.getGestione().equals("L")));
} }