Finish v1_7_4(81)

This commit is contained in:
Giuseppe Scorrano 2019-09-12 18:50:51 +02:00
commit ab9cf3b64c
19 changed files with 515 additions and 311 deletions

Binary file not shown.

View File

@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
android { android {
def appVersionCode = 80 def appVersionCode = 81
def appVersionName = '1.7.3' def appVersionName = '1.7.4'
signingConfigs { signingConfigs {
release { release {
@ -99,26 +99,26 @@ dependencies {
implementation 'com.google.firebase:firebase-crash:16.2.1' implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-perf:19.0.0' implementation 'com.google.firebase:firebase-perf:19.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'androidx.appcompat:appcompat:1.1.0-rc01' implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha09' implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta03' implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04'
implementation 'androidx.preference:preference:1.1.0-rc01' implementation 'androidx.preference:preference:1.1.0'
implementation 'com.squareup.okhttp3:okhttp:4.1.0' implementation 'com.squareup.okhttp3:okhttp:4.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.6.1' implementation 'com.squareup.retrofit2:retrofit:2.6.1'
implementation 'com.squareup.retrofit2:converter-gson:2.6.1' implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
implementation 'com.annimon:stream:1.2.1' implementation 'com.annimon:stream:1.2.1'
implementation 'androidx.lifecycle:lifecycle-runtime:2.0.0' implementation 'androidx.lifecycle:lifecycle-runtime:2.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.0.0' implementation 'androidx.lifecycle:lifecycle-common-java8:2.1.0'
//kapt "androidx.lifecycle:lifecycle-compiler:2.0.0" //kapt "androidx.lifecycle:lifecycle-compiler:2.0.0"
implementation 'com.danielpuiu:ghostfish:2.0.0' implementation 'com.danielpuiu:ghostfish:2.0.0'
annotationProcessor "com.danielpuiu:ghostfish-compiler:2.0.0" annotationProcessor "com.danielpuiu:ghostfish-compiler:2.0.0"
//MVVM //MVVM
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation "androidx.lifecycle:lifecycle-common-java8:2.0.0" implementation "androidx.lifecycle:lifecycle-common-java8:2.1.0"
implementation 'com.jakewharton.rxbinding2:rxbinding:2.2.0' implementation 'com.jakewharton.rxbinding2:rxbinding:2.2.0'
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.2.0' implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.2.0'
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.2.0' implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.2.0'

View File

@ -46,14 +46,24 @@ public class MtbColr extends EntityBase implements Parcelable {
private String dataScadPartita; private String dataScadPartita;
private String descrizione; private String descrizione;
private String untMis; private String untMis;
private Integer causale;
private String utente;
private MtbAart mtbAart; private MtbAart mtbAart;
private MtbPartitaMag rifPartitaMag;
public MtbColr() { public MtbColr() {
type = "mtb_colr"; type = "mtb_colr";
} }
public static class Causale {
public static final int DEFAULT = 0;
public static final int RETTIFICA = 1;
public static final int VERSAMENTO = 2;
}
protected MtbColr(Parcel in) { protected MtbColr(Parcel in) {
type = "mtb_colr"; type = "mtb_colr";
gestione = in.readString(); gestione = in.readString();
@ -564,4 +574,32 @@ public class MtbColr extends EntityBase implements Parcelable {
this.mtbAart = mtbAart; this.mtbAart = mtbAart;
return this; return this;
} }
public MtbPartitaMag getRifPartitaMag() {
return rifPartitaMag;
}
public MtbColr setRifPartitaMag(MtbPartitaMag rifPartitaMag) {
this.rifPartitaMag = rifPartitaMag;
return this;
}
public Integer getCausale() {
return causale;
}
public MtbColr setCausale(Integer causale) {
this.causale = causale;
return this;
}
public String getUtente() {
return utente;
}
public MtbColr setUtente(String utente) {
this.utente = utente;
return this;
}
} }

View File

@ -56,7 +56,7 @@ public class MtbColt extends EntityBase {
private BigDecimal larghezzaCm; private BigDecimal larghezzaCm;
private BigDecimal altezzaCm; private BigDecimal altezzaCm;
public List<MtbCols> mtbCols; private List<MtbCols> mtbCols;
private Boolean disablePrint; private Boolean disablePrint;
private String ragSocCliente; private String ragSocCliente;

View File

@ -0,0 +1,240 @@
package it.integry.integrywmsnative.core.model;
import java.math.BigDecimal;
import java.util.Date;
import it.integry.integrywmsnative.core.utility.UtilityDate;
public class MtbPartitaMag {
private String codMart;
private String partitaMag;
private String descrizione;
private String dataIns;
private String dataScad;
private Integer scelta;
private BigDecimal costoUntUmMag;
private BigDecimal valUntUmMag;
private BigDecimal taraCnfKg;
private BigDecimal qtaCnf;
private String flagImballoArendere;
private String flagStato;
private String codDiviCont;
private BigDecimal cambioDiviCont;
private String barcode;
private String note;
private BigDecimal rapConv2;
private BigDecimal rapConv3;
private String posizione;
private String dataAggPrz;
private String partitaMagSec;
private BigDecimal qtaAttesa;
public String getCodMart() {
return codMart;
}
public MtbPartitaMag setCodMart(String codMart) {
this.codMart = codMart;
return this;
}
public String getPartitaMag() {
return partitaMag;
}
public MtbPartitaMag setPartitaMag(String partitaMag) {
this.partitaMag = partitaMag;
return this;
}
public String getDescrizione() {
return descrizione;
}
public MtbPartitaMag setDescrizione(String descrizione) {
this.descrizione = descrizione;
return this;
}
public String getDataIns() {
return dataIns;
}
public MtbPartitaMag setDataIns(String dataIns) {
this.dataIns = dataIns;
return this;
}
public String getDataScadS() {
return dataScad;
}
public Date getDataScadD() {
return UtilityDate.recognizeDateWithExceptionHandler(getDataScadS());
}
public MtbPartitaMag setDataScad(String dataScad) {
this.dataScad = dataScad;
return this;
}
public MtbPartitaMag setDataScad(Date dataScad) {
this.dataScad = UtilityDate.formatDate(dataScad, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
return this;
}
public Integer getScelta() {
return scelta;
}
public MtbPartitaMag setScelta(Integer scelta) {
this.scelta = scelta;
return this;
}
public BigDecimal getCostoUntUmMag() {
return costoUntUmMag;
}
public MtbPartitaMag setCostoUntUmMag(BigDecimal costoUntUmMag) {
this.costoUntUmMag = costoUntUmMag;
return this;
}
public BigDecimal getValUntUmMag() {
return valUntUmMag;
}
public MtbPartitaMag setValUntUmMag(BigDecimal valUntUmMag) {
this.valUntUmMag = valUntUmMag;
return this;
}
public BigDecimal getTaraCnfKg() {
return taraCnfKg;
}
public MtbPartitaMag setTaraCnfKg(BigDecimal taraCnfKg) {
this.taraCnfKg = taraCnfKg;
return this;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}
public MtbPartitaMag setQtaCnf(BigDecimal qtaCnf) {
this.qtaCnf = qtaCnf;
return this;
}
public String getFlagImballoArendere() {
return flagImballoArendere;
}
public MtbPartitaMag setFlagImballoArendere(String flagImballoArendere) {
this.flagImballoArendere = flagImballoArendere;
return this;
}
public String getFlagStato() {
return flagStato;
}
public MtbPartitaMag setFlagStato(String flagStato) {
this.flagStato = flagStato;
return this;
}
public String getCodDiviCont() {
return codDiviCont;
}
public MtbPartitaMag setCodDiviCont(String codDiviCont) {
this.codDiviCont = codDiviCont;
return this;
}
public BigDecimal getCambioDiviCont() {
return cambioDiviCont;
}
public MtbPartitaMag setCambioDiviCont(BigDecimal cambioDiviCont) {
this.cambioDiviCont = cambioDiviCont;
return this;
}
public String getBarcode() {
return barcode;
}
public MtbPartitaMag setBarcode(String barcode) {
this.barcode = barcode;
return this;
}
public String getNote() {
return note;
}
public MtbPartitaMag setNote(String note) {
this.note = note;
return this;
}
public BigDecimal getRapConv2() {
return rapConv2;
}
public MtbPartitaMag setRapConv2(BigDecimal rapConv2) {
this.rapConv2 = rapConv2;
return this;
}
public BigDecimal getRapConv3() {
return rapConv3;
}
public MtbPartitaMag setRapConv3(BigDecimal rapConv3) {
this.rapConv3 = rapConv3;
return this;
}
public String getPosizione() {
return posizione;
}
public MtbPartitaMag setPosizione(String posizione) {
this.posizione = posizione;
return this;
}
public String getDataAggPrz() {
return dataAggPrz;
}
public MtbPartitaMag setDataAggPrz(String dataAggPrz) {
this.dataAggPrz = dataAggPrz;
return this;
}
public String getPartitaMagSec() {
return partitaMagSec;
}
public MtbPartitaMag setPartitaMagSec(String partitaMagSec) {
this.partitaMagSec = partitaMagSec;
return this;
}
public BigDecimal getQtaAttesa() {
return qtaAttesa;
}
public MtbPartitaMag setQtaAttesa(BigDecimal qtaAttesa) {
this.qtaAttesa = qtaAttesa;
return this;
}
}

View File

@ -38,6 +38,12 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
public static void saveCollo(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback){ public static void saveCollo(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback){
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
mtbColtToSave.getMtbColr().get(i)
.setMtbAart(null)
.setRifPartitaMag(null);
}
EntityRESTConsumer.processEntity(mtbColtToSave, callback, MtbColt.class); EntityRESTConsumer.processEntity(mtbColtToSave, callback, MtbColt.class);
} }
@ -45,6 +51,13 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
public static void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed){ public static void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed){
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
mtbColtToSave.getMtbColr().get(i)
.setMtbAart(null)
.setRifPartitaMag(null);
}
EntityRESTConsumer.processEntity(mtbColtToSave, new ISimpleOperationCallback<MtbColt>() { EntityRESTConsumer.processEntity(mtbColtToSave, new ISimpleOperationCallback<MtbColt>() {
@Override @Override
public void onSuccess(MtbColt value) { public void onSuccess(MtbColt value) {
@ -62,6 +75,16 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
public static void saveColli(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed){ public static void saveColli(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed){
for(MtbColt mtbColt : mtbColtsToSave) {
mtbColt.setMtbCols(null);
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
mtbColt.getMtbColr().get(i)
.setMtbAart(null)
.setRifPartitaMag(null);
}
}
EntityRESTConsumer.processEntityList(mtbColtsToSave, new ISimpleOperationCallback<List<MtbColt>>() { EntityRESTConsumer.processEntityList(mtbColtsToSave, new ISimpleOperationCallback<List<MtbColt>>() {
@Override @Override
public void onSuccess(List<MtbColt> value) { public void onSuccess(List<MtbColt> value) {

View File

@ -75,7 +75,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
private GestioneEnum defaultGestioneOfUL = null; private GestioneEnum defaultGestioneOfUL = null;
private MtbColt mtbColtOfAccettazione = null; // private MtbColt mtbColtOfAccettazione = null;
public AccettazioneOrdineAccettazioneInevasoViewModel(AccettazioneOrdineInevasoActivity activity, ArticoliInColloBottomSheetViewModel articoliInColloBottomSheetViewModel, List<OrdineAccettazioneDTO> orders) { public AccettazioneOrdineAccettazioneInevasoViewModel(AccettazioneOrdineInevasoActivity activity, ArticoliInColloBottomSheetViewModel articoliInColloBottomSheetViewModel, List<OrdineAccettazioneDTO> orders) {
this.mActivity = activity; this.mActivity = activity;
@ -451,62 +451,40 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
String defaultPosAccettazione = ""; String defaultPosAccettazione = "";
if(defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value)) defaultPosAccettazione = defaultPosAccettazioneDTO.value; if(defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value)) defaultPosAccettazione = defaultPosAccettazioneDTO.value;
MtbColt mtbColt = new MtbColt();
MtbColt mtbColtOfBarcode = new MtbColt(); mtbColt
mtbColtOfBarcode.initDefaultFields(); .initDefaultFields()
mtbColtOfBarcode .setGestione(defaultGestioneOfUL)
.setGestione(GestioneEnum.LAVORAZIONE)
.setAnnotazioni(noteString) .setAnnotazioni(noteString)
.setPosizione(defaultPosAccettazione) .setPosizione(defaultPosAccettazione)
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE); .setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
if(customNumCollo != null) { if(customNumCollo != null) {
mtbColtOfBarcode.setNumCollo(customNumCollo); mtbColt.setNumCollo(customNumCollo);
} }
if(!UtilityString.isNullOrEmpty(customSerCollo)) { if(!UtilityString.isNullOrEmpty(customSerCollo)) {
mtbColtOfBarcode.setSerCollo(customSerCollo); mtbColt.setSerCollo(customSerCollo);
} }
MtbColt mtbColtAccettazione = null;
if(defaultGestioneOfUL == GestioneEnum.ACQUISTO){
mtbColtAccettazione = (MtbColt) mtbColtOfBarcode.clone();
mtbColtAccettazione.setGestione(GestioneEnum.ACQUISTO);
mtbColtAccettazione
.setNumCollo(null)
.setSerCollo(null);
}
MtbColt mtbColtToAddRefs = mtbColtAccettazione != null ? mtbColtAccettazione : mtbColtOfBarcode;
List<String> codAnags = List<String> codAnags =
stream(mOrders) stream(mOrders)
.select(c -> c.getCodAnag()) .select(OrdineAccettazioneDTO::getCodAnag)
.distinct() .distinct()
.toList(); .toList();
if(codAnags != null && codAnags.size() == 1){ if(codAnags != null && codAnags.size() == 1){
mtbColtToAddRefs.setCodAnag(codAnags.get(0)); mtbColt.setCodAnag(codAnags.get(0));
mtbColtOfBarcode.setCodAnag(codAnags.get(0));
} }
List<String> rifOrds = List<String> rifOrds =
stream(mOrders) stream(mOrders)
.select(c -> c.getRifOrd()) .select(OrdineAccettazioneDTO::getRifOrd)
.distinct() .distinct()
.toList(); .toList();
if(rifOrds != null && rifOrds.size() == 1){ if(rifOrds != null && rifOrds.size() == 1){
mtbColtToAddRefs.setRifOrd(rifOrds.get(0)); mtbColt.setRifOrd(rifOrds.get(0));
} }
List<String> numDataOrds = List<String> numDataOrds =
@ -516,11 +494,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
.toList(); .toList();
if(numDataOrds != null && numDataOrds.size() == 1){ if(numDataOrds != null && numDataOrds.size() == 1){
mtbColtToAddRefs.setNumOrd(mOrders.get(0).getNumero()); mtbColt.setNumOrd(mOrders.get(0).getNumero());
mtbColtToAddRefs.setDataOrd(mOrders.get(0).getData()); mtbColt.setDataOrd(mOrders.get(0).getData());
try { try {
mtbColtToAddRefs.generaFiltroOrdine(); mtbColt.generaFiltroOrdine();
} catch (Exception ex) { } catch (Exception ex) {
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(ex.getMessage()), null, null).show(); DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(ex.getMessage()), null, null).show();
return; return;
@ -528,8 +506,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
} }
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, new ISimpleOperationCallback<MtbColt>() {
Runnable saveColloOfBarcode = () -> ColliMagazzinoRESTConsumer.saveCollo(mtbColtOfBarcode, new ISimpleOperationCallback<MtbColt>() {
@Override @Override
public void onSuccess(MtbColt value) { public void onSuccess(MtbColt value) {
@ -545,15 +522,6 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT); FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
// new StatusBarAlert.Builder(mActivity)
// .autoHide(true)
// .withDuration(2500)
// .showProgress(false)
// .withText(R.string.data_saved)
// .withAlertColor(R.color.mainGreen)
// .build();
if(onComplete != null) onComplete.run(); if(onComplete != null) onComplete.run();
} }
@ -563,41 +531,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
UtilityExceptions.defaultException(mActivity, ex, finalProgress); UtilityExceptions.defaultException(mActivity, ex, finalProgress);
} }
}); });
if(mtbColtAccettazione != null) {
ColliMagazzinoRESTConsumer.saveCollo(mtbColtAccettazione, new ISimpleOperationCallback<MtbColt>() {
@Override
public void onSuccess(MtbColt value) {
value
.setDisablePrint(disablePrint)
.setMtbColr(new ObservableArrayList<>());
value.setMtbCols(null);
mtbColtOfAccettazione = value;
saveColloOfBarcode.run();
}
@Override
public void onFailed(Exception ex) {
UtilityExceptions.defaultException(mActivity, ex, finalProgress);
}
});
} else {
saveColloOfBarcode.run();
}
}, ex -> UtilityExceptions.defaultException(mActivity, ex, finalProgress)); }, ex -> UtilityExceptions.defaultException(mActivity, ex, finalProgress));
} }
@Override @Override
@ -738,30 +673,21 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
private void deleteCollo(ProgressDialog progress, Runnable onComplete) { private void deleteCollo(ProgressDialog progress, Runnable onComplete) {
ColliMagazzinoRESTConsumer.deleteCollo(getColloRef(), () -> {
Runnable deleteCollo = () -> ColliMagazzinoRESTConsumer.deleteCollo(mtbColtOfAccettazione, () -> { mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
resetUL();
isFabVisible.set(true); isFabVisible.set(true);
progress.dismiss(); progress.dismiss();
if(onComplete != null) onComplete.run(); if(onComplete != null) onComplete.run();
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)); }, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
if(mtbColtOfAccettazione != null) {
ColliMagazzinoRESTConsumer.deleteCollo(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
deleteCollo.run();
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
} else {
deleteCollo.run();
}
} }
public boolean thereIsAnOpenedUL() { public boolean thereIsAnOpenedUL() {
return getColloRef() != null; return getColloRef() != null;
} }
public boolean thereIsAnyRowInUL() { public boolean thereIsAnyRowInUL() {
return getColloRef() != null && return getColloRef() != null &&
getColloRef().getMtbColr() != null && getColloRef().getMtbColr() != null &&
@ -854,7 +780,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
BigDecimal qtaColliPedana = item.mtbAart.getColliPedana().multiply(item.mtbAart.getQtaCnf()); BigDecimal qtaColliPedana = item.mtbAart.getColliPedana().multiply(item.mtbAart.getQtaCnf());
if(qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) { if(qtaColliPedana.floatValue() > 0 && qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) {
qtaDaEvadere = qtaColliPedana; qtaDaEvadere = qtaColliPedana;
} else { } else {
qtaDaEvadere = totalQtaDaEvadere; qtaDaEvadere = totalQtaDaEvadere;
@ -941,28 +867,12 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE); mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
MtbColt cloneMtbColt = (MtbColt) mArticoliInColloBottomSheetViewModel.mtbColt.get().clone(); MtbColt cloneMtbColt = (MtbColt) getColloRef().clone();
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP); cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
cloneMtbColt.setMtbColr(new ObservableArrayList()); cloneMtbColt.setMtbColr(new ObservableArrayList());
cloneMtbColt.getMtbColr().add(mtbColr); cloneMtbColt.getMtbColr().add(mtbColr);
Runnable saveRiga = () -> {
if(mtbColtOfAccettazione != null) {
mtbColr
.setNumColloRif(mtbColtOfAccettazione.getNumCollo())
.setDataColloRif(mtbColtOfAccettazione.getDataColloD())
.setGestioneRif(mtbColtOfAccettazione.getGestione())
.setSerColloRif(mtbColtOfAccettazione.getSerCollo())
.setNumOrd(null)
.setRigaOrd(null)
.setDataOrd((String) null)
.setRiga(null);
}
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() { ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
@Override @Override
public void onSuccess(MtbColt value) { public void onSuccess(MtbColt value) {
@ -978,10 +888,10 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
//item.setQtaRiservate(item.getQtaRiservate().add(mtbColr.getQtaCol())); //item.setQtaRiservate(item.getQtaRiservate().add(mtbColr.getQtaCol()));
mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr().add(mtbColr); getColloRef().getMtbColr().add(mtbColr);
refreshOrderBy(false); refreshOrderBy(false);
FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT); FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
progress.dismiss(); progress.dismiss();
if(closeLU) onColloClosed(null); if(closeLU) onColloClosed(null);
@ -992,64 +902,26 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
UtilityExceptions.defaultException(mActivity, ex, progress); UtilityExceptions.defaultException(mActivity, ex, progress);
} }
}); });
};
if(mtbColtOfAccettazione != null) {
MtbColr cloneMtbColr = (MtbColr) mtbColr.clone();
MtbColt cloneMtbColtOfAccettazione = (MtbColt) mtbColtOfAccettazione.clone();
cloneMtbColtOfAccettazione.setOperation(CommonModelConsts.OPERATION.NO_OP);
cloneMtbColtOfAccettazione.setMtbColr(new ObservableArrayList());
cloneMtbColtOfAccettazione.getMtbColr().add(cloneMtbColr);
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColtOfAccettazione, new ISimpleOperationCallback<MtbColt>() {
@Override
public void onSuccess(MtbColt value) {
cloneMtbColr
.setDataCollo(value.getDataColloS())
.setNumCollo(value.getNumCollo())
.setGestione(value.getGestione())
.setSerCollo(value.getSerCollo())
.setRiga(value.getMtbColr().get(0).getRiga())
.setUntMis(item.getMtbAart().getUntMis())
.setMtbAart(item.getMtbAart());
mtbColtOfAccettazione.getMtbColr().add(cloneMtbColr);
saveRiga.run();
}
@Override
public void onFailed(Exception ex) {
UtilityExceptions.defaultException(mActivity, ex, progress);
}
});
} else {
saveRiga.run();
}
} }
private MtbColt getColloRef() { private MtbColt getColloRef() {
return mtbColtOfAccettazione != null ? mtbColtOfAccettazione : mArticoliInColloBottomSheetViewModel.mtbColt.get(); return mArticoliInColloBottomSheetViewModel.mtbColt.get();
} }
private void resetUL() { private void resetUL() {
mArticoliInColloBottomSheetViewModel.mtbColt.set(null); mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
mtbColtOfAccettazione = null;
} }
private void onRowEdited(MtbColr oldValue, MtbColr newValue) { private void onRowEdited(MtbColr oldValue, MtbColr newValue) {
if(mtbColtOfAccettazione != null) { if(getColloRef() != null) {
ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity); ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
MtbColr mtbColrToEditOfAccettazione = Stream.of(mtbColtOfAccettazione.getMtbColr()) MtbColr mtbColrToEditOfAccettazione = Stream.of(getColloRef().getMtbColr())
.filter(x -> x.getQtaCol().compareTo(oldValue.getQtaCol()) == 0 && .filter(x -> x.getQtaCol().compareTo(oldValue.getQtaCol()) == 0 &&
x.getCodMart().equalsIgnoreCase(oldValue.getCodMart()) && x.getCodMart().equalsIgnoreCase(oldValue.getCodMart()) &&
x.getPartitaMag().equalsIgnoreCase(oldValue.getPartitaMag()) && x.getPartitaMag().equalsIgnoreCase(oldValue.getPartitaMag()) &&
@ -1077,11 +949,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
private void onRowDeleted(MtbColr deletedValue) { private void onRowDeleted(MtbColr deletedValue) {
if(mtbColtOfAccettazione != null) { if(getColloRef() != null) {
ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity); ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
MtbColr mtbColrToDeleteOfAccettazione = Stream.of(mtbColtOfAccettazione.getMtbColr()) MtbColr mtbColrToDeleteOfAccettazione = Stream.of(getColloRef().getMtbColr())
.filter(x -> x.getQtaCol().compareTo(deletedValue.getQtaCol()) == 0 && .filter(x -> x.getQtaCol().compareTo(deletedValue.getQtaCol()) == 0 &&
x.getCodMart().equalsIgnoreCase(deletedValue.getCodMart()) && x.getCodMart().equalsIgnoreCase(deletedValue.getCodMart()) &&
x.getPartitaMag().equalsIgnoreCase(deletedValue.getPartitaMag()) && x.getPartitaMag().equalsIgnoreCase(deletedValue.getPartitaMag()) &&
@ -1090,7 +962,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
.get(); .get();
ColliMagazzinoRESTConsumer.deleteRiga(mtbColrToDeleteOfAccettazione, () -> { ColliMagazzinoRESTConsumer.deleteRiga(mtbColrToDeleteOfAccettazione, () -> {
mtbColtOfAccettazione.getMtbColr().remove(mtbColrToDeleteOfAccettazione); getColloRef().getMtbColr().remove(mtbColrToDeleteOfAccettazione);
progress.dismiss(); progress.dismiss();
this.refreshOrderBy(false); this.refreshOrderBy(false);

View File

@ -67,7 +67,6 @@ public class PickingResiActivity extends AppCompatActivity implements IOnColloC
private String mDefaultGestioneOfUL; private String mDefaultGestioneOfUL;
private String mDefaultCodAnagOfUL; private String mDefaultCodAnagOfUL;
private String mDefaultCodMDepOfUL;
private Integer mDefaultSegnoOfUL; private Integer mDefaultSegnoOfUL;
public static void startActivity(Context context, List<DocumentoResoDTO> documentoResoDTOList, Integer segno) { public static void startActivity(Context context, List<DocumentoResoDTO> documentoResoDTOList, Integer segno) {
@ -182,16 +181,6 @@ public class PickingResiActivity extends AppCompatActivity implements IOnColloC
throw new Exception("Sono stati caricati documenti con diversi codici anagrafici"); throw new Exception("Sono stati caricati documenti con diversi codici anagrafici");
} else mDefaultCodAnagOfUL = foundCodAnags.get(0); } else mDefaultCodAnagOfUL = foundCodAnags.get(0);
List<String> foundCodMdeps = Stream.of(this.mDocumentiResiList)
.map(DocumentoResoDTO::getCodMdep)
.distinct()
.toList();
if(foundCodMdeps.size() > 1) {
throw new Exception("Sono stati caricati documenti con diversi codici deposito");
} else mDefaultCodMDepOfUL = foundCodMdeps.get(0);
} }
@ -217,7 +206,7 @@ public class PickingResiActivity extends AppCompatActivity implements IOnColloC
mtbColt .setGestione(mDefaultGestioneOfUL) mtbColt .setGestione(mDefaultGestioneOfUL)
.setSegno(mDefaultSegnoOfUL) .setSegno(mDefaultSegnoOfUL)
.setCodAnag(mDefaultCodAnagOfUL) .setCodAnag(mDefaultCodAnagOfUL)
.setCodMdep(mDefaultCodMDepOfUL) .setCodMdep(SettingsManager.i().userSession.depo.getCodMdep())
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE); .setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);

View File

@ -46,7 +46,7 @@ public class ProdVersamentoMaterialViewModel {
public void openLU() { public void openLU() {
DialogScanOrCreateLU.make(mContext, true, false, mtbColt -> { DialogScanOrCreateLU.make(mContext, true, true, false, mtbColt -> {
if(mtbColt == null) { if(mtbColt == null) {
((IPoppableActivity)mContext).pop(); ((IPoppableActivity)mContext).pop();
} else if((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(+1)){ } else if((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(+1)){

View File

@ -418,7 +418,9 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
.setPartitaMag(quantityDTO.batchLot.get()) .setPartitaMag(quantityDTO.batchLot.get())
.setDataScadPartita(quantityDTO.expireDate) .setDataScadPartita(quantityDTO.expireDate)
.setQtaCol(quantityDTO.qtaTot.getBigDecimal()) .setQtaCol(quantityDTO.qtaTot.getBigDecimal())
.setDescrizione(mtbAart.getDescrizioneEstesa()); .setDescrizione(mtbAart.getDescrizioneEstesa())
.setCausale(MtbColr.Causale.RETTIFICA)
.setUtente(SettingsManager.i().user.fullname);
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE); mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
@ -445,14 +447,6 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT); FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
// new StatusBarAlert.Builder(mContext)
// .autoHide(true)
// .withDuration(2500)
// .showProgress(false)
// .withText(R.string.data_saved)
// .withAlertColor(R.color.mainGreen)
// .build();
resetTexts(); resetTexts();
progress.dismiss(); progress.dismiss();
} }
@ -624,6 +618,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
.setRiga(null) .setRiga(null)
.setDatetimeRow(UtilityDate.getDateInstance()) .setDatetimeRow(UtilityDate.getDateInstance())
.setQtaCol(value.qtaTot.getBigDecimal().subtract(mtbColrToEditClone.getQtaCol())) .setQtaCol(value.qtaTot.getBigDecimal().subtract(mtbColrToEditClone.getQtaCol()))
.setUtente(SettingsManager.i().user.fullname)
.setCausale(MtbColr.Causale.RETTIFICA)
.setOperation(CommonModelConsts.OPERATION.INSERT); .setOperation(CommonModelConsts.OPERATION.INSERT);
MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone(); MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone();
@ -659,6 +655,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
.setRiga(null) .setRiga(null)
.setDatetimeRow(UtilityDate.getDateInstance()) .setDatetimeRow(UtilityDate.getDateInstance())
.setQtaCol(mtbColrToDeleteClone.getQtaCol().multiply(new BigDecimal(-1))) .setQtaCol(mtbColrToDeleteClone.getQtaCol().multiply(new BigDecimal(-1)))
.setUtente(SettingsManager.i().user.fullname)
.setCausale(MtbColr.Causale.RETTIFICA)
.setOperation(CommonModelConsts.OPERATION.INSERT); .setOperation(CommonModelConsts.OPERATION.INSERT);
MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone(); MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone();

View File

@ -15,13 +15,13 @@ public class UltimeConsegneFornitoreRESTConsumer {
public static void getUltimeConsegneFornitori(String codMdep, String codAnag, String codMart, RunnableArgs<ArrayList<DocumentoResoDTO>> onComplete, RunnableArgs<Exception> onFailed) { public static void getUltimeConsegneFornitori(String codMdep, String codAnag, String codMart, RunnableArgs<ArrayList<DocumentoResoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
int numberOfConsegnePerCli = 10; int numberOfConsegnePerForn = 10;
int numberOfDayToAnalyze = 90; int numberOfDayToAnalyze = 90;
String sql = "SELECT consegne.*, " + String sql = "SELECT consegne.*, " +
" rag_soc " + " rag_soc " +
"FROM WMS_GetUltimeConsegneFornitori(" + "FROM WMS_GetUltimeConsegneFornitori(" +
UtilityDB.valueToString(numberOfConsegnePerCli) + ", " + UtilityDB.valueToString(numberOfConsegnePerForn) + ", " +
UtilityDB.valueToString(codAnag) + ", " + UtilityDB.valueToString(codAnag) + ", " +
UtilityDB.valueToString(codMart) + ", " + UtilityDB.valueToString(codMart) + ", " +
UtilityDB.valueToString(codMdep) + ", " + UtilityDB.valueToString(codMdep) + ", " +

View File

@ -7,6 +7,7 @@ import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
import it.integry.integrywmsnative.core.rest.model.Ean128Model; import it.integry.integrywmsnative.core.rest.model.Ean128Model;
import it.integry.integrywmsnative.core.model.MtbAart; import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbColr; import it.integry.integrywmsnative.core.model.MtbColr;
@ -483,22 +484,11 @@ public class PickingObjectDTO implements Parcelable {
} }
public static class PickData { public static class PickData {
private String batchLot;
private BigDecimal qtaTot; private BigDecimal qtaTot;
private BigDecimal qtaCnf; private BigDecimal qtaCnf;
private BigDecimal numCnf; private BigDecimal numCnf;
private Date dataScad;
private MtbColt sourceMtbColt; private MtbColt sourceMtbColt;
private MtbPartitaMag mtbPartitaMag;
public String getBatchLot() {
return batchLot;
}
public PickData setBatchLot(String batchLot) {
this.batchLot = batchLot;
return this;
}
public BigDecimal getQtaTot() { public BigDecimal getQtaTot() {
return qtaTot; return qtaTot;
@ -527,15 +517,6 @@ public class PickingObjectDTO implements Parcelable {
return this; return this;
} }
public Date getDataScad() {
return dataScad;
}
public PickData setDataScad(Date dataScad) {
this.dataScad = dataScad;
return this;
}
public MtbColt getSourceMtbColt() { public MtbColt getSourceMtbColt() {
return sourceMtbColt; return sourceMtbColt;
} }
@ -545,21 +526,32 @@ public class PickingObjectDTO implements Parcelable {
return this; return this;
} }
public MtbPartitaMag getMtbPartitaMag() {
return mtbPartitaMag;
}
public PickData setMtbPartitaMag(MtbPartitaMag mtbPartitaMag) {
this.mtbPartitaMag = mtbPartitaMag;
return this;
}
public static PickData fromEan128(Ean128Model ean128Model) { public static PickData fromEan128(Ean128Model ean128Model) {
PickingObjectDTO.PickData pickData = null; PickingObjectDTO.PickData pickData = null;
if(ean128Model != null){ if(ean128Model != null){
pickData = new PickingObjectDTO.PickData(); pickData = new PickingObjectDTO.PickData();
MtbPartitaMag mtbPartitaMag = new MtbPartitaMag();
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) { if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
pickData.setBatchLot(ean128Model.BatchLot); mtbPartitaMag.setPartitaMag(ean128Model.BatchLot);
} }
try { try {
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){ if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
pickData.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore)); mtbPartitaMag.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) { } else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
pickData.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry)); mtbPartitaMag.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
} }
} catch (Exception e) { } catch (Exception e) {
@ -567,6 +559,10 @@ public class PickingObjectDTO implements Parcelable {
} }
if(mtbPartitaMag.getPartitaMag() != null && mtbPartitaMag.getDataScadD() != null) {
pickData.setMtbPartitaMag(mtbPartitaMag);
}
if(ean128Model.Count != null && ean128Model.Count > 0) { if(ean128Model.Count != null && ean128Model.Count > 0) {
//if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) { //if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
pickData.setNumCnf(new BigDecimal(ean128Model.Count)); pickData.setNumCnf(new BigDecimal(ean128Model.Count));

View File

@ -689,8 +689,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
MtbColr matchRow = matchWithPartitaMag.get(k); MtbColr matchRow = matchWithPartitaMag.get(k);
PickingObjectDTO.PickData pickData = new PickingObjectDTO.PickData() PickingObjectDTO.PickData pickData = new PickingObjectDTO.PickData()
.setBatchLot(matchRow.getPartitaMag()) .setMtbPartitaMag(matchRow.getRifPartitaMag())
.setDataScad(matchRow.getDataScadPartitaD())
.setNumCnf(matchRow.getNumCnf()) .setNumCnf(matchRow.getNumCnf())
.setQtaCnf(matchRow.getQtaCnf()) .setQtaCnf(matchRow.getQtaCnf())
.setQtaTot(matchRow.getQtaCol()) .setQtaTot(matchRow.getQtaCol())
@ -713,8 +712,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
MtbColr matchRow = matchWithColloRow.get(k); MtbColr matchRow = matchWithColloRow.get(k);
PickingObjectDTO.PickData pickData = new PickingObjectDTO.PickData() PickingObjectDTO.PickData pickData = new PickingObjectDTO.PickData()
.setBatchLot(matchRow.getPartitaMag()) .setMtbPartitaMag(matchRow.getRifPartitaMag())
.setDataScad(matchRow.getDataScadPartitaD())
.setNumCnf(matchRow.getNumCnf()) .setNumCnf(matchRow.getNumCnf())
.setQtaCnf(matchRow.getQtaCnf()) .setQtaCnf(matchRow.getQtaCnf())
.setQtaTot(matchRow.getQtaCol()) .setQtaTot(matchRow.getQtaCol())
@ -753,7 +751,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
if(SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV()) { if(SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV()) {
List<PickingObjectDTO> matchWithPartitaMag = Stream.of(matchPickingObject) List<PickingObjectDTO> matchWithPartitaMag = Stream.of(matchPickingObject)
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbAart.getCodMart()) && .filter(x -> x.getCodMart().equalsIgnoreCase(mtbAart.getCodMart()) &&
(pickData != null && Objects.equals(x.getPartitaMag(), pickData.getBatchLot()))).toList(); (pickData != null && Objects.equals(x.getPartitaMag(), pickData.getMtbPartitaMag().getPartitaMag()))).toList();
matchPickingObject = matchWithPartitaMag; matchPickingObject = matchWithPartitaMag;
@ -1122,18 +1120,22 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
.setCanPartitaMagBeChanged(item.isDeactivated()) .setCanPartitaMagBeChanged(item.isDeactivated())
.setMaxQta(qtaDisponibile); .setMaxQta(qtaDisponibile);
boolean batchLotEnabled = true;
if(item.getTempPickData() != null) { if(item.getTempPickData() != null) {
PickingObjectDTO.PickData tmpPickData = item.getTempPickData(); PickingObjectDTO.PickData tmpPickData = item.getTempPickData();
if(!UtilityString.isNullOrEmpty(tmpPickData.getBatchLot())) { if(!UtilityString.isNullOrEmpty(tmpPickData.getMtbPartitaMag().getPartitaMag())) {
dto.setBatchLot(tmpPickData.getBatchLot()); dto.setBatchLot(tmpPickData.getMtbPartitaMag().getPartitaMag());
} }
if(tmpPickData.getDataScad() != null){ if(tmpPickData.getMtbPartitaMag().getDataScadD() != null){
dto.setDataScad(tmpPickData.getDataScad()); dto.setDataScad(tmpPickData.getMtbPartitaMag().getDataScadD());
dto.setShouldAskDataScad(true); dto.setShouldAskDataScad(true);
} }
batchLotEnabled = tmpPickData.getMtbPartitaMag().getFlagStato().equalsIgnoreCase("A");
boolean useQtaDaEvadere; boolean useQtaDaEvadere;
if(tmpPickData.getQtaTot() != null) { if(tmpPickData.getQtaTot() != null) {
@ -1165,7 +1167,14 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
} }
boolean canOverflowQuantity = SettingsManager.iDB().isFlagCanAddExtraQuantitySpedizione(); boolean canOverflowQuantity = SettingsManager.iDB().isFlagCanAddExtraQuantitySpedizione();
if(!batchLotEnabled) {
this.showBatchLotDisabledWarning(dto.getBatchLot(), () -> {
DialogInputQuantity.makeBase(mActivity, dto, canOverflowQuantity, (quantityDTO, closeUL) -> onOrdineRowDispatched(item, quantityDTO, closeUL), null).show(); DialogInputQuantity.makeBase(mActivity, dto, canOverflowQuantity, (quantityDTO, closeUL) -> onOrdineRowDispatched(item, quantityDTO, closeUL), null).show();
}, null);
} else {
DialogInputQuantity.makeBase(mActivity, dto, canOverflowQuantity, (quantityDTO, closeUL) -> onOrdineRowDispatched(item, quantityDTO, closeUL), null).show();
}
} }
} }
@ -1356,4 +1365,11 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
}); });
} }
private void showBatchLotDisabledWarning(String batchLot, Runnable onAccepted, Runnable onRejected) {
DialogSimpleMessageHelper.makeWarningDialog(mActivity, new SpannableString(String.format(mActivity.getText(R.string.batch_lot_not_enabled).toString(), batchLot)), null, onAccepted, onRejected).show();
}
} }

View File

@ -288,6 +288,8 @@ public class VersamentoMerceViewModel {
.setNumColloRif(null) .setNumColloRif(null)
.setSerColloRif(null) .setSerColloRif(null)
.setDataColloRif((String) null) .setDataColloRif((String) null)
.setCausale(MtbColr.Causale.VERSAMENTO)
.setUtente(SettingsManager.i().user.fullname)
.setQtaCol(stornoSourceMtbColr.getQtaCol().multiply(new BigDecimal(-1))); .setQtaCol(stornoSourceMtbColr.getQtaCol().multiply(new BigDecimal(-1)));
@ -306,12 +308,14 @@ public class VersamentoMerceViewModel {
.setGestione((String) null) .setGestione((String) null)
.setSerCollo(null) .setSerCollo(null)
.setNumCollo(null) .setNumCollo(null)
.setDataCollo(null); .setDataCollo(null)
.setCausale(MtbColr.Causale.VERSAMENTO)
.setUtente(SettingsManager.i().user.fullname);
mtbColrDestObservableField.add(cloneMtbColr); mtbColrDestObservableField.add(cloneMtbColr);
} }
clonedSourceTestata.setMtbColr(mtbColrSourceObservableField); if(mtbColrSourceObservableField.size() > 0) clonedSourceTestata.setMtbColr(mtbColrSourceObservableField);
clonedDestTestata.setMtbColr(mtbColrDestObservableField); clonedDestTestata.setMtbColr(mtbColrDestObservableField);
@ -401,7 +405,8 @@ public class VersamentoMerceViewModel {
mtbColt.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE); mtbColt.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) { for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
mtbColt.getMtbColr().get(i).setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE); mtbColt.getMtbColr().get(i)
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
} }
} }

View File

@ -77,19 +77,23 @@ public class DialogChooseArtsFromListaArts {
binding.setFilterStatus(filterStatus); binding.setFilterStatus(filterStatus);
binding.emptyView.setVisibility(listaMtbColr != null && listaMtbColr.size() > 0 ? View.GONE : View.VISIBLE); binding.emptyView.setVisibility(listaMtbColr != null && listaMtbColr.size() > 0 ? View.GONE : View.VISIBLE);
AlertDialog.Builder builder = new AlertDialog.Builder(context); // AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setPositiveButton(context.getResources().getText(R.string.confirm), (dialog, which) -> { // builder.setPositiveButton(context.getResources().getText(R.string.confirm), (dialog, which) -> {
mDialog.dismiss(); // mDialog.dismiss();
onPositiveClick(); // onPositiveClick();
}); // });
builder.setNegativeButton(context.getResources().getText(R.string.abort), (dialog, which) -> { // builder.setNegativeButton(context.getResources().getText(R.string.abort), (dialog, which) -> {
mDialog.dismiss(); // mDialog.dismiss();
onNegativeClick(); // onNegativeClick();Z
}); // });
//
// builder.setView(binding.getRoot());
//
// mDialog = builder.create();
builder.setView(binding.getRoot());
mDialog = builder.create(); mDialog = new Dialog(context);
mDialog.setContentView(binding.getRoot());
mDialog.setCanceledOnTouchOutside(false); mDialog.setCanceledOnTouchOutside(false);
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
@ -99,6 +103,16 @@ public class DialogChooseArtsFromListaArts {
initRemoveFilterButton(binding); initRemoveFilterButton(binding);
setupBarcode(); setupBarcode();
binding.positiveButton.setOnClickListener(v -> {
mDialog.dismiss();
onPositiveClick();
});
binding.negativeButton.setOnClickListener(v -> {
mDialog.dismiss();
onNegativeClick();
});
} }
private void initRecyclerView(DialogChooseArtsFromListaArtsLayoutBinding binding) { private void initRecyclerView(DialogChooseArtsFromListaArtsLayoutBinding binding) {

View File

@ -23,7 +23,7 @@
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:paddingStart="16dp" android:paddingStart="8dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingBottom="8dp" android:paddingBottom="8dp"

View File

@ -17,9 +17,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
app:cardCornerRadius="12dp"
app:cardElevation="0dp"> app:cardElevation="0dp">
<LinearLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -44,12 +45,14 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="24dp" android:paddingTop="24dp"
android:paddingBottom="24dp" android:paddingBottom="8dp"
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingEnd="8dp"> android:paddingEnd="8dp"
android:layout_alignParentTop="true"
android:layout_above="@id/buttons">
<TextView <TextView
android:id="@+id/title_text" android:id="@+id/title_text"
@ -78,7 +81,8 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_marginTop="8dp">
<LinearLayout <LinearLayout
android:id="@+id/empty_view" android:id="@+id/empty_view"
@ -109,11 +113,19 @@
</RelativeLayout> </RelativeLayout>
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/buttons" android:id="@+id/buttons"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp"> android:layout_alignParentBottom="true"
android:layout_marginTop="8dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:paddingBottom="8dp">
<androidx.constraintlayout.widget.Guideline <androidx.constraintlayout.widget.Guideline
android:id="@+id/center_guideline" android:id="@+id/center_guideline"
@ -153,10 +165,7 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> </RelativeLayout>
</LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View File

@ -248,4 +248,6 @@
<string name="shipped_on">Spedito il %s</string> <string name="shipped_on">Spedito il %s</string>
<string name="delivered_on">Consegnato il %s</string> <string name="delivered_on">Consegnato il %s</string>
<string name="batch_lot_not_enabled">Il lotto <b>%s</b> non è attivo. Continuare?</string>
</resources> </resources>

View File

@ -255,4 +255,6 @@
<string name="delivered_on">Delivered on %s</string> <string name="delivered_on">Delivered on %s</string>
<string name="title_dynamic_frudis">Frudis customizations</string> <string name="title_dynamic_frudis">Frudis customizations</string>
<string name="batch_lot_not_enabled">Batch lot <b>%s</b> is inactive. Continue?</string>
</resources> </resources>