Migliorato documento di reso quando effettuano le perdite
This commit is contained in:
parent
26ca580ba4
commit
44b9bc3fc1
@ -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);
|
||||
inventarioRESTConsumerService.checkFrumaDoc(fornitore, numDoc, dataDoc)
|
||||
inventarioRESTConsumerService.checkDocument(fornitore, numDoc,tipoDoc, dataDoc)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull Response<ServiceRESTResponse<Boolean>> response) {
|
||||
|
||||
@ -21,10 +21,11 @@ public interface DocumentiRESTConsumerService {
|
||||
@POST("createDocFromColli")
|
||||
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
|
||||
|
||||
@GET("wms/documento/checkFruma")
|
||||
Call<ServiceRESTResponse<Boolean>> checkFrumaDoc(
|
||||
@GET("wms/documento/checkDoc")
|
||||
Call<ServiceRESTResponse<Boolean>> checkDocument(
|
||||
@Query("fornitore") String fornitore,
|
||||
@Query("numDoc") String numDoc,
|
||||
@Query("tipoDoc") String tipoDoc,
|
||||
@Query("dataDoc") String dataDoc);
|
||||
|
||||
@GET("wms/documento/arts")
|
||||
|
||||
@ -76,13 +76,12 @@ public class DBSettingsModel {
|
||||
private boolean flagProduzioneShowInfo = false;
|
||||
private boolean flagAccettazioneBollaUseQtaOrd = true;
|
||||
private boolean flagWarningNewPartitaMag = false;
|
||||
|
||||
private boolean flagTracciamentoImballiCaricoEnabled = false;
|
||||
private boolean flagTracciamentoImballiScaricoEnabled = false;
|
||||
private boolean flagPickingLiberoEnableScanArt = false;
|
||||
private boolean flagAskDuplicateUDSSpedizione = false;
|
||||
|
||||
private boolean suggestDataScad = false;
|
||||
private String docInterniRequestNumDoc;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@ -695,4 +694,13 @@ public class DBSettingsModel {
|
||||
this.suggestDataScad = suggestDataScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDocInterniRequestNumDoc() {
|
||||
return docInterniRequestNumDoc;
|
||||
}
|
||||
|
||||
public DBSettingsModel setDocInterniRequestNumDoc(String docInterniRequestNumDoc) {
|
||||
this.docInterniRequestNumDoc = docInterniRequestNumDoc;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -557,6 +557,12 @@ public class SettingsManager {
|
||||
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();
|
||||
|
||||
|
||||
|
||||
@ -105,31 +105,34 @@ public class DocInterniViewModel {
|
||||
this.numDoc = selection.getNumDoc() != null ? selection.getNumDoc().toString() : null;
|
||||
this.note = selection.getNote();
|
||||
|
||||
if (dtbTipi.getCodDtip().equalsIgnoreCase("FRUMA")) {
|
||||
documentRESTConsumer.checkFrumaDocument(
|
||||
fornitore.getCodAnag(),
|
||||
numDoc,
|
||||
UtilityDate.formatDate(dataDoc, "yyyy/MM/dd"),
|
||||
data -> {
|
||||
if (!data) {
|
||||
this.sendWarning(UtilityResources.getString(R.string.no_doc_found_message), this::init);
|
||||
} else {
|
||||
action.run();
|
||||
this.sendOnLoadingStarted();
|
||||
fetchProducts(() -> {
|
||||
fetchDocuments(this::sendOnLoadingEnded);
|
||||
});
|
||||
}
|
||||
},
|
||||
this::sendError
|
||||
);
|
||||
} else {
|
||||
action.run();
|
||||
this.sendOnLoadingStarted();
|
||||
fetchProducts(() -> {
|
||||
fetchDocuments(this::sendOnLoadingEnded);
|
||||
});
|
||||
String codAnag = null;
|
||||
if (fornitore != null){
|
||||
codAnag = fornitore.getCodAnag();
|
||||
}
|
||||
|
||||
String codDtip = null;
|
||||
if (dtbTipi != null){
|
||||
codDtip = dtbTipi.getCodDtip();
|
||||
}
|
||||
|
||||
documentRESTConsumer.checkDocument(
|
||||
codAnag,
|
||||
numDoc,
|
||||
UtilityDate.formatDate(dataDoc, "yyyy/MM/dd"),
|
||||
codDtip,
|
||||
data -> {
|
||||
if (!data) {
|
||||
this.sendWarning(UtilityResources.getString(R.string.no_doc_found_message), this::init);
|
||||
} else {
|
||||
action.run();
|
||||
this.sendOnLoadingStarted();
|
||||
fetchProducts(() -> {
|
||||
fetchDocuments(this::sendOnLoadingEnded);
|
||||
});
|
||||
}
|
||||
},
|
||||
this::sendError
|
||||
);
|
||||
}
|
||||
|
||||
public void fetchProducts(Runnable onComplete) {
|
||||
|
||||
@ -3,10 +3,13 @@ package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
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.FornitoreRequiredException;
|
||||
@ -33,9 +36,11 @@ public class DialogSelectDocInfoViewModel extends ViewModel {
|
||||
private final MutableLiveData<Boolean> noteRequired = new MutableLiveData<>(false);
|
||||
|
||||
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 -> 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")));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user