[ESSEGRANDE] Modifiche per data_scad e inventari con righe a 0
This commit is contained in:
parent
dc46b36624
commit
ac6cca1eda
@ -2,7 +2,7 @@
|
|||||||
"formatVersion": 1,
|
"formatVersion": 1,
|
||||||
"database": {
|
"database": {
|
||||||
"version": 15,
|
"version": 15,
|
||||||
"identityHash": "a7eb741d99ba4b54e55ac41684d3207a",
|
"identityHash": "0609508b3a8434bb8d3e3cc99e766d67",
|
||||||
"entities": [
|
"entities": [
|
||||||
{
|
{
|
||||||
"tableName": "articoli_griglia",
|
"tableName": "articoli_griglia",
|
||||||
@ -192,7 +192,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tableName": "ordini",
|
"tableName": "ordini",
|
||||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ordine_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `data_ins` INTEGER, `annotazioni` TEXT, `transmitted` INTEGER NOT NULL, `transmission_date` INTEGER, `gestione` TEXT, `data_ord` INTEGER, `num_ord` INTEGER, `cod_mdep` TEXT, `id_griglia` INTEGER NOT NULL, `cod_alis` TEXT)",
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ordine_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `data_ins` INTEGER, `annotazioni` TEXT, `transmitted` INTEGER NOT NULL, `transmission_date` INTEGER, `gestione` TEXT, `data_ord` INTEGER, `num_ord` INTEGER, `cod_mdep` TEXT, `id_griglia` INTEGER, `cod_alis` TEXT)",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"fieldPath": "ordineId",
|
"fieldPath": "ordineId",
|
||||||
@ -252,7 +252,7 @@
|
|||||||
"fieldPath": "idGriglia",
|
"fieldPath": "idGriglia",
|
||||||
"columnName": "id_griglia",
|
"columnName": "id_griglia",
|
||||||
"affinity": "INTEGER",
|
"affinity": "INTEGER",
|
||||||
"notNull": true
|
"notNull": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldPath": "codAlis",
|
"fieldPath": "codAlis",
|
||||||
@ -1162,7 +1162,7 @@
|
|||||||
"views": [],
|
"views": [],
|
||||||
"setupQueries": [
|
"setupQueries": [
|
||||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'a7eb741d99ba4b54e55ac41684d3207a')"
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '0609508b3a8434bb8d3e3cc99e766d67')"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -53,9 +53,9 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void loadDocumentoAvailableArts(String codDtip, String codMgrp, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void loadDocumentoAvailableArts(String codDtip, String codMgrp, String codAnagForn, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||||
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp)
|
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp, codAnagForn)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> response) {
|
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> response) {
|
||||||
|
|||||||
@ -26,6 +26,7 @@ public interface DocumentiRESTConsumerService {
|
|||||||
@GET("wms/documento/arts")
|
@GET("wms/documento/arts")
|
||||||
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
||||||
@Query("codDtip") String codDtip,
|
@Query("codDtip") String codDtip,
|
||||||
@Query("codMgrp") String codMgrp);
|
@Query("codMgrp") String codMgrp,
|
||||||
|
@Query("codAnagForn") String codAnagForn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,15 +102,19 @@ public class DocInterniViewModel {
|
|||||||
this.productsFetched = false;
|
this.productsFetched = false;
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
documentRESTConsumer.loadDocumentoAvailableArts(this.getCodDtip(), this.getCodMgrp(), data -> {
|
documentRESTConsumer.loadDocumentoAvailableArts(
|
||||||
this.productsFetched = true;
|
this.getCodDtip(),
|
||||||
this.availableArts = data.getArts();
|
this.getCodMgrp(),
|
||||||
this.artsSize.set(this.availableArts.size());
|
this.getCodAnagForn(),
|
||||||
|
data -> {
|
||||||
|
this.productsFetched = true;
|
||||||
|
this.availableArts = data.getArts();
|
||||||
|
this.artsSize.set(this.availableArts.size());
|
||||||
|
|
||||||
if (this.docsFetched)
|
if (this.docsFetched)
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fetchDocuments() {
|
public void fetchDocuments() {
|
||||||
@ -159,6 +163,13 @@ public class DocInterniViewModel {
|
|||||||
return this.mtbGrup.getValue().getCodMgrp();
|
return this.mtbGrup.getValue().getCodMgrp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getCodAnagForn() {
|
||||||
|
if (this.fornitore.getValue() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.fornitore.getValue().getCodAnag();
|
||||||
|
}
|
||||||
|
|
||||||
public void editDocument(SqlMtbColt document) {
|
public void editDocument(SqlMtbColt document) {
|
||||||
this.mListener.onDocumentEditRequest(document, availableArts);
|
this.mListener.onDocumentEditRequest(document, availableArts);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -256,6 +256,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
.setSaveOnImeDone(true)
|
.setSaveOnImeDone(true)
|
||||||
.setPartitaMag(row.getPartitaMag())
|
.setPartitaMag(row.getPartitaMag())
|
||||||
.setDataScad(row.getDataScad())
|
.setDataScad(row.getDataScad())
|
||||||
|
.setCanInputZeroQuantity(true)
|
||||||
.setCanOverflowOrderQuantity(false)
|
.setCanOverflowOrderQuantity(false)
|
||||||
.setCanLUBeClosed(false)
|
.setCanLUBeClosed(false)
|
||||||
.setNotesAllowed(true)
|
.setNotesAllowed(true)
|
||||||
|
|||||||
@ -245,20 +245,32 @@ public class DocInterniEditFormViewModel {
|
|||||||
|
|
||||||
private void initCheckFornitore() {
|
private void initCheckFornitore() {
|
||||||
SqlMtbColt doc = this.document.getValue();
|
SqlMtbColt doc = this.document.getValue();
|
||||||
|
|
||||||
|
if (doc == null)
|
||||||
|
return;
|
||||||
|
|
||||||
boolean isCheckPartitaMag = false;
|
boolean isCheckPartitaMag = false;
|
||||||
if (doc != null && this.checkFornitoreRules != null) {
|
|
||||||
String key = doc.getCodAnag();
|
try {
|
||||||
if (doc.getCodVdes() != null && !doc.getCodVdes().isEmpty()) {
|
if (this.checkFornitoreRules != null && this.checkFornitoreRules.has("value")) {
|
||||||
key += "-" + doc.getCodVdes();
|
isCheckPartitaMag = this.checkFornitoreRules.getBoolean("value");
|
||||||
}
|
} else if (this.checkFornitoreRules != null) {
|
||||||
try {
|
String key = doc.getCodAnag();
|
||||||
if (this.checkFornitoreRules.has(key) && ((String) ((JSONObject) this.checkFornitoreRules.get(key)).get(doc.getCodDtipProvv())).equalsIgnoreCase("check-partitaMag")) {
|
if (doc.getCodVdes() != null && !doc.getCodVdes().isEmpty()) {
|
||||||
|
key += "-" + doc.getCodVdes();
|
||||||
|
}
|
||||||
|
if (this.checkFornitoreRules.has(key) &&
|
||||||
|
((String) ((JSONObject) this.checkFornitoreRules.get(key))
|
||||||
|
.get(doc.getCodDtipProvv()))
|
||||||
|
.equalsIgnoreCase("check-partitaMag")) {
|
||||||
isCheckPartitaMag = true;
|
isCheckPartitaMag = true;
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
this.sendError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.isCheckPartitaMag = isCheckPartitaMag;
|
this.isCheckPartitaMag = isCheckPartitaMag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -214,6 +214,7 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
|||||||
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
||||||
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
||||||
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
||||||
|
.setCanInputZeroQuantity(true)
|
||||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
.setCanLUBeClosed(canLUBeClosed)
|
.setCanLUBeClosed(canLUBeClosed)
|
||||||
|
|||||||
@ -33,6 +33,7 @@ public class DialogInputQuantityV2DTO {
|
|||||||
private BigDecimal totalNumCnfAvailable;
|
private BigDecimal totalNumCnfAvailable;
|
||||||
private BigDecimal qtaCnfAvailable;
|
private BigDecimal qtaCnfAvailable;
|
||||||
|
|
||||||
|
private boolean canInputZeroQuantity = false;
|
||||||
private boolean canPartitaMagBeChanged = true;
|
private boolean canPartitaMagBeChanged = true;
|
||||||
private boolean isDataScadMandatory = false;
|
private boolean isDataScadMandatory = false;
|
||||||
private boolean isNotesAllowed = false;
|
private boolean isNotesAllowed = false;
|
||||||
@ -214,6 +215,15 @@ public class DialogInputQuantityV2DTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCanInputZeroQuantity() {
|
||||||
|
return canInputZeroQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2DTO setCanInputZeroQuantity(boolean canInputZeroQuantity) {
|
||||||
|
this.canInputZeroQuantity = canInputZeroQuantity;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isCanPartitaMagBeChanged() {
|
public boolean isCanPartitaMagBeChanged() {
|
||||||
return canPartitaMagBeChanged;
|
return canPartitaMagBeChanged;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -165,6 +165,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
.setQtaCnfToBeTaken(mDialogInputQuantityV2DTO.getQtaCnfToBeTaken())
|
.setQtaCnfToBeTaken(mDialogInputQuantityV2DTO.getQtaCnfToBeTaken())
|
||||||
.setTotalNumCnfAvailable(mDialogInputQuantityV2DTO.getTotalNumCnfAvailable())
|
.setTotalNumCnfAvailable(mDialogInputQuantityV2DTO.getTotalNumCnfAvailable())
|
||||||
.setTotalQtaAvailable(mDialogInputQuantityV2DTO.getTotalQtaAvailable())
|
.setTotalQtaAvailable(mDialogInputQuantityV2DTO.getTotalQtaAvailable())
|
||||||
|
.setCanInputZeroQuantity(mDialogInputQuantityV2DTO.isCanInputZeroQuantity())
|
||||||
.setCanOverflowOrderQuantity(mDialogInputQuantityV2DTO.isCanOverflowOrderQuantity())
|
.setCanOverflowOrderQuantity(mDialogInputQuantityV2DTO.isCanOverflowOrderQuantity())
|
||||||
.setQtaCnfAvailable(mDialogInputQuantityV2DTO.getQtaCnfAvailable())
|
.setQtaCnfAvailable(mDialogInputQuantityV2DTO.getQtaCnfAvailable())
|
||||||
.setPartitaMag(mDialogInputQuantityV2DTO.getPartitaMag())
|
.setPartitaMag(mDialogInputQuantityV2DTO.getPartitaMag())
|
||||||
|
|||||||
@ -72,6 +72,7 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
|
|
||||||
private RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> suggestPartitaMagRunnable;
|
private RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> suggestPartitaMagRunnable;
|
||||||
|
|
||||||
|
private boolean canInputZeroQuantity;
|
||||||
private boolean canOverflowOrderQuantity;
|
private boolean canOverflowOrderQuantity;
|
||||||
private boolean canPartitaMagBeChanged;
|
private boolean canPartitaMagBeChanged;
|
||||||
private int onNumCnfInputChanged;
|
private int onNumCnfInputChanged;
|
||||||
@ -314,6 +315,11 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DialogInputQuantityV2ViewModel setCanInputZeroQuantity(boolean canInputZeroQuantity) {
|
||||||
|
this.canInputZeroQuantity = canInputZeroQuantity;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public DialogInputQuantityV2ViewModel setCanOverflowOrderQuantity(boolean canOverflowOrderQuantity) {
|
public DialogInputQuantityV2ViewModel setCanOverflowOrderQuantity(boolean canOverflowOrderQuantity) {
|
||||||
this.canOverflowOrderQuantity = canOverflowOrderQuantity;
|
this.canOverflowOrderQuantity = canOverflowOrderQuantity;
|
||||||
return this;
|
return this;
|
||||||
@ -443,8 +449,8 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
|
|
||||||
this.mListener.onError(new InvalidQtaCnfQuantityException());
|
this.mListener.onError(new InvalidQtaCnfQuantityException());
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mtbAart.get().isFlagTracciabilitaBoolean() && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
if (mtbAart.get().isFlagTracciabilitaBoolean() && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||||
if (suggestPartitaMagRunnable != null) {
|
if (suggestPartitaMagRunnable != null) {
|
||||||
internalPartitaMag = suggestPartitaMagRunnable.run(this);
|
internalPartitaMag = suggestPartitaMagRunnable.run(this);
|
||||||
@ -456,54 +462,54 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
this.mListener.onError(new InvalidBatchLotException());
|
this.mListener.onError(new InvalidBatchLotException());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shouldAskDataScad && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
if (this.shouldAskDataScad && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||||
|
|
||||||
this.mListener.onError(new InvalidBatchLotException());
|
this.mListener.onError(new InvalidBatchLotException());
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shouldAskDataScad && this.internalDataScad == null) {
|
if (this.shouldAskDataScad && this.internalDataScad == null) {
|
||||||
|
|
||||||
this.mListener.onError(new InvalidExpireDateException());
|
this.mListener.onError(new InvalidExpireDateException());
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfOrd)) {
|
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfOrd)) {
|
||||||
|
|
||||||
this.mListener.onError(new OverflowNumCnfOrderedQuantityException());
|
this.mListener.onError(new OverflowNumCnfOrderedQuantityException());
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfAvailable)) {
|
if (UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfAvailable)) {
|
||||||
|
|
||||||
this.mListener.onError(new OverflowNumCnfAvailableQuantityException());
|
this.mListener.onError(new OverflowNumCnfAvailableQuantityException());
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (this.internalNumCnf == null || this.internalQtaCnf == null || this.internalQtaTot == null ||
|
|
||||||
|
if (!this.canInputZeroQuantity && (this.internalNumCnf == null || this.internalQtaCnf == null || this.internalQtaTot == null ||
|
||||||
UtilityBigDecimal.equalsOrLowerThan(this.internalNumCnf, BigDecimal.ZERO) ||
|
UtilityBigDecimal.equalsOrLowerThan(this.internalNumCnf, BigDecimal.ZERO) ||
|
||||||
UtilityBigDecimal.equalsOrLowerThan(this.internalQtaCnf, BigDecimal.ZERO) ||
|
UtilityBigDecimal.equalsOrLowerThan(this.internalQtaCnf, BigDecimal.ZERO) ||
|
||||||
UtilityBigDecimal.equalsOrLowerThan(this.internalQtaTot, BigDecimal.ZERO)) {
|
UtilityBigDecimal.equalsOrLowerThan(this.internalQtaTot, BigDecimal.ZERO))) {
|
||||||
|
|
||||||
this.mListener.onError(new InvalidQuantityException());
|
this.mListener.onError(new InvalidQuantityException());
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
return false;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.8.0'
|
kotlin_version = '1.8.0'
|
||||||
agp_version = '8.1.0-alpha09'
|
agp_version = '8.1.0-alpha10'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user