Finish v1_7_4(81)
This commit is contained in:
commit
ab9cf3b64c
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 80
|
||||
def appVersionName = '1.7.3'
|
||||
def appVersionCode = 81
|
||||
def appVersionName = '1.7.4'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@ -99,26 +99,26 @@ dependencies {
|
||||
implementation 'com.google.firebase:firebase-crash:16.2.1'
|
||||
implementation 'com.google.firebase:firebase-perf:19.0.0'
|
||||
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 '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.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta03'
|
||||
implementation 'androidx.preference:preference:1.1.0-rc01'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04'
|
||||
implementation 'androidx.preference:preference:1.1.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.1.0'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
|
||||
implementation 'com.annimon:stream:1.2.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime:2.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime:2.1.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.1.0'
|
||||
//kapt "androidx.lifecycle:lifecycle-compiler:2.0.0"
|
||||
implementation 'com.danielpuiu:ghostfish:2.0.0'
|
||||
annotationProcessor "com.danielpuiu:ghostfish-compiler:2.0.0"
|
||||
//MVVM
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
|
||||
implementation "androidx.lifecycle:lifecycle-common-java8:2.0.0"
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
|
||||
implementation "androidx.lifecycle:lifecycle-common-java8:2.1.0"
|
||||
implementation 'com.jakewharton.rxbinding2:rxbinding:2.2.0'
|
||||
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.2.0'
|
||||
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.2.0'
|
||||
|
||||
@ -46,14 +46,24 @@ public class MtbColr extends EntityBase implements Parcelable {
|
||||
private String dataScadPartita;
|
||||
private String descrizione;
|
||||
private String untMis;
|
||||
private Integer causale;
|
||||
private String utente;
|
||||
|
||||
private MtbAart mtbAart;
|
||||
|
||||
private MtbPartitaMag rifPartitaMag;
|
||||
|
||||
public MtbColr() {
|
||||
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) {
|
||||
type = "mtb_colr";
|
||||
gestione = in.readString();
|
||||
@ -564,4 +574,32 @@ public class MtbColr extends EntityBase implements Parcelable {
|
||||
this.mtbAart = mtbAart;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ public class MtbColt extends EntityBase {
|
||||
private BigDecimal larghezzaCm;
|
||||
private BigDecimal altezzaCm;
|
||||
|
||||
public List<MtbCols> mtbCols;
|
||||
private List<MtbCols> mtbCols;
|
||||
|
||||
private Boolean disablePrint;
|
||||
private String ragSocCliente;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -38,6 +38,12 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
@ -45,6 +51,13 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
||||
|
||||
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>() {
|
||||
@Override
|
||||
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){
|
||||
|
||||
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>>() {
|
||||
@Override
|
||||
public void onSuccess(List<MtbColt> value) {
|
||||
|
||||
@ -75,7 +75,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
private GestioneEnum defaultGestioneOfUL = null;
|
||||
|
||||
private MtbColt mtbColtOfAccettazione = null;
|
||||
// private MtbColt mtbColtOfAccettazione = null;
|
||||
|
||||
public AccettazioneOrdineAccettazioneInevasoViewModel(AccettazioneOrdineInevasoActivity activity, ArticoliInColloBottomSheetViewModel articoliInColloBottomSheetViewModel, List<OrdineAccettazioneDTO> orders) {
|
||||
this.mActivity = activity;
|
||||
@ -451,62 +451,40 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
String defaultPosAccettazione = "";
|
||||
if(defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value)) defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
||||
|
||||
|
||||
MtbColt mtbColtOfBarcode = new MtbColt();
|
||||
mtbColtOfBarcode.initDefaultFields();
|
||||
mtbColtOfBarcode
|
||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
mtbColt
|
||||
.initDefaultFields()
|
||||
.setGestione(defaultGestioneOfUL)
|
||||
.setAnnotazioni(noteString)
|
||||
.setPosizione(defaultPosAccettazione)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
|
||||
|
||||
if(customNumCollo != null) {
|
||||
mtbColtOfBarcode.setNumCollo(customNumCollo);
|
||||
mtbColt.setNumCollo(customNumCollo);
|
||||
}
|
||||
|
||||
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 =
|
||||
stream(mOrders)
|
||||
.select(c -> c.getCodAnag())
|
||||
.select(OrdineAccettazioneDTO::getCodAnag)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(codAnags != null && codAnags.size() == 1){
|
||||
mtbColtToAddRefs.setCodAnag(codAnags.get(0));
|
||||
mtbColtOfBarcode.setCodAnag(codAnags.get(0));
|
||||
mtbColt.setCodAnag(codAnags.get(0));
|
||||
}
|
||||
|
||||
List<String> rifOrds =
|
||||
stream(mOrders)
|
||||
.select(c -> c.getRifOrd())
|
||||
.select(OrdineAccettazioneDTO::getRifOrd)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(rifOrds != null && rifOrds.size() == 1){
|
||||
mtbColtToAddRefs.setRifOrd(rifOrds.get(0));
|
||||
mtbColt.setRifOrd(rifOrds.get(0));
|
||||
}
|
||||
|
||||
List<String> numDataOrds =
|
||||
@ -516,11 +494,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.toList();
|
||||
|
||||
if(numDataOrds != null && numDataOrds.size() == 1){
|
||||
mtbColtToAddRefs.setNumOrd(mOrders.get(0).getNumero());
|
||||
mtbColtToAddRefs.setDataOrd(mOrders.get(0).getData());
|
||||
mtbColt.setNumOrd(mOrders.get(0).getNumero());
|
||||
mtbColt.setDataOrd(mOrders.get(0).getData());
|
||||
|
||||
try {
|
||||
mtbColtToAddRefs.generaFiltroOrdine();
|
||||
mtbColt.generaFiltroOrdine();
|
||||
} catch (Exception ex) {
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(ex.getMessage()), null, null).show();
|
||||
return;
|
||||
@ -528,8 +506,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
|
||||
|
||||
Runnable saveColloOfBarcode = () -> ColliMagazzinoRESTConsumer.saveCollo(mtbColtOfBarcode, new ISimpleOperationCallback<MtbColt>() {
|
||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||
@Override
|
||||
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);
|
||||
|
||||
|
||||
// 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();
|
||||
|
||||
}
|
||||
@ -563,41 +531,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
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));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -738,30 +673,21 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
private void deleteCollo(ProgressDialog progress, Runnable onComplete) {
|
||||
|
||||
|
||||
Runnable deleteCollo = () -> ColliMagazzinoRESTConsumer.deleteCollo(mtbColtOfAccettazione, () -> {
|
||||
resetUL();
|
||||
ColliMagazzinoRESTConsumer.deleteCollo(getColloRef(), () -> {
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||
|
||||
isFabVisible.set(true);
|
||||
|
||||
progress.dismiss();
|
||||
if(onComplete != null) onComplete.run();
|
||||
}, 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() {
|
||||
return getColloRef() != null;
|
||||
}
|
||||
|
||||
public boolean thereIsAnyRowInUL() {
|
||||
return getColloRef() != null &&
|
||||
getColloRef().getMtbColr() != null &&
|
||||
@ -854,7 +780,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
BigDecimal qtaColliPedana = item.mtbAart.getColliPedana().multiply(item.mtbAart.getQtaCnf());
|
||||
|
||||
if(qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) {
|
||||
if(qtaColliPedana.floatValue() > 0 && qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) {
|
||||
qtaDaEvadere = qtaColliPedana;
|
||||
} else {
|
||||
qtaDaEvadere = totalQtaDaEvadere;
|
||||
@ -941,28 +867,12 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
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.setMtbColr(new ObservableArrayList());
|
||||
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>() {
|
||||
@Override
|
||||
public void onSuccess(MtbColt value) {
|
||||
@ -978,7 +888,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
//item.setQtaRiservate(item.getQtaRiservate().add(mtbColr.getQtaCol()));
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr().add(mtbColr);
|
||||
getColloRef().getMtbColr().add(mtbColr);
|
||||
refreshOrderBy(false);
|
||||
|
||||
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
@ -992,64 +902,26 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
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() {
|
||||
return mtbColtOfAccettazione != null ? mtbColtOfAccettazione : mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
return mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
}
|
||||
|
||||
private void resetUL() {
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||
mtbColtOfAccettazione = null;
|
||||
}
|
||||
|
||||
private void onRowEdited(MtbColr oldValue, MtbColr newValue) {
|
||||
|
||||
if(mtbColtOfAccettazione != null) {
|
||||
if(getColloRef() != null) {
|
||||
|
||||
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 &&
|
||||
x.getCodMart().equalsIgnoreCase(oldValue.getCodMart()) &&
|
||||
x.getPartitaMag().equalsIgnoreCase(oldValue.getPartitaMag()) &&
|
||||
@ -1077,11 +949,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
private void onRowDeleted(MtbColr deletedValue) {
|
||||
|
||||
if(mtbColtOfAccettazione != null) {
|
||||
if(getColloRef() != null) {
|
||||
|
||||
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 &&
|
||||
x.getCodMart().equalsIgnoreCase(deletedValue.getCodMart()) &&
|
||||
x.getPartitaMag().equalsIgnoreCase(deletedValue.getPartitaMag()) &&
|
||||
@ -1090,7 +962,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.get();
|
||||
|
||||
ColliMagazzinoRESTConsumer.deleteRiga(mtbColrToDeleteOfAccettazione, () -> {
|
||||
mtbColtOfAccettazione.getMtbColr().remove(mtbColrToDeleteOfAccettazione);
|
||||
getColloRef().getMtbColr().remove(mtbColrToDeleteOfAccettazione);
|
||||
|
||||
progress.dismiss();
|
||||
this.refreshOrderBy(false);
|
||||
|
||||
@ -67,7 +67,6 @@ public class PickingResiActivity extends AppCompatActivity implements IOnColloC
|
||||
|
||||
private String mDefaultGestioneOfUL;
|
||||
private String mDefaultCodAnagOfUL;
|
||||
private String mDefaultCodMDepOfUL;
|
||||
private Integer mDefaultSegnoOfUL;
|
||||
|
||||
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");
|
||||
} 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)
|
||||
.setSegno(mDefaultSegnoOfUL)
|
||||
.setCodAnag(mDefaultCodAnagOfUL)
|
||||
.setCodMdep(mDefaultCodMDepOfUL)
|
||||
.setCodMdep(SettingsManager.i().userSession.depo.getCodMdep())
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ public class ProdVersamentoMaterialViewModel {
|
||||
|
||||
|
||||
public void openLU() {
|
||||
DialogScanOrCreateLU.make(mContext, true, false, mtbColt -> {
|
||||
DialogScanOrCreateLU.make(mContext, true, true, false, mtbColt -> {
|
||||
if(mtbColt == null) {
|
||||
((IPoppableActivity)mContext).pop();
|
||||
} else if((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(+1)){
|
||||
|
||||
@ -418,7 +418,9 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
.setPartitaMag(quantityDTO.batchLot.get())
|
||||
.setDataScadPartita(quantityDTO.expireDate)
|
||||
.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);
|
||||
|
||||
@ -445,14 +447,6 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
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();
|
||||
progress.dismiss();
|
||||
}
|
||||
@ -624,6 +618,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
.setRiga(null)
|
||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
||||
.setQtaCol(value.qtaTot.getBigDecimal().subtract(mtbColrToEditClone.getQtaCol()))
|
||||
.setUtente(SettingsManager.i().user.fullname)
|
||||
.setCausale(MtbColr.Causale.RETTIFICA)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
|
||||
MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone();
|
||||
@ -659,6 +655,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
.setRiga(null)
|
||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
||||
.setQtaCol(mtbColrToDeleteClone.getQtaCol().multiply(new BigDecimal(-1)))
|
||||
.setUtente(SettingsManager.i().user.fullname)
|
||||
.setCausale(MtbColr.Causale.RETTIFICA)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
|
||||
MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone();
|
||||
|
||||
@ -15,13 +15,13 @@ public class UltimeConsegneFornitoreRESTConsumer {
|
||||
|
||||
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;
|
||||
|
||||
String sql = "SELECT consegne.*, " +
|
||||
" rag_soc " +
|
||||
"FROM WMS_GetUltimeConsegneFornitori(" +
|
||||
UtilityDB.valueToString(numberOfConsegnePerCli) + ", " +
|
||||
UtilityDB.valueToString(numberOfConsegnePerForn) + ", " +
|
||||
UtilityDB.valueToString(codAnag) + ", " +
|
||||
UtilityDB.valueToString(codMart) + ", " +
|
||||
UtilityDB.valueToString(codMdep) + ", " +
|
||||
|
||||
@ -7,6 +7,7 @@ import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
@ -483,22 +484,11 @@ public class PickingObjectDTO implements Parcelable {
|
||||
}
|
||||
|
||||
public static class PickData {
|
||||
private String batchLot;
|
||||
private BigDecimal qtaTot;
|
||||
private BigDecimal qtaCnf;
|
||||
private BigDecimal numCnf;
|
||||
private Date dataScad;
|
||||
private MtbColt sourceMtbColt;
|
||||
|
||||
|
||||
public String getBatchLot() {
|
||||
return batchLot;
|
||||
}
|
||||
|
||||
public PickData setBatchLot(String batchLot) {
|
||||
this.batchLot = batchLot;
|
||||
return this;
|
||||
}
|
||||
private MtbPartitaMag mtbPartitaMag;
|
||||
|
||||
public BigDecimal getQtaTot() {
|
||||
return qtaTot;
|
||||
@ -527,15 +517,6 @@ public class PickingObjectDTO implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public PickData setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColt getSourceMtbColt() {
|
||||
return sourceMtbColt;
|
||||
}
|
||||
@ -545,21 +526,32 @@ public class PickingObjectDTO implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbPartitaMag getMtbPartitaMag() {
|
||||
return mtbPartitaMag;
|
||||
}
|
||||
|
||||
public PickData setMtbPartitaMag(MtbPartitaMag mtbPartitaMag) {
|
||||
this.mtbPartitaMag = mtbPartitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static PickData fromEan128(Ean128Model ean128Model) {
|
||||
PickingObjectDTO.PickData pickData = null;
|
||||
|
||||
if(ean128Model != null){
|
||||
pickData = new PickingObjectDTO.PickData();
|
||||
|
||||
|
||||
MtbPartitaMag mtbPartitaMag = new MtbPartitaMag();
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||
pickData.setBatchLot(ean128Model.BatchLot);
|
||||
mtbPartitaMag.setPartitaMag(ean128Model.BatchLot);
|
||||
}
|
||||
|
||||
try {
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
|
||||
pickData.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
|
||||
mtbPartitaMag.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
|
||||
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
||||
pickData.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
|
||||
mtbPartitaMag.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
|
||||
}
|
||||
|
||||
} 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(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||
pickData.setNumCnf(new BigDecimal(ean128Model.Count));
|
||||
|
||||
@ -689,8 +689,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
MtbColr matchRow = matchWithPartitaMag.get(k);
|
||||
|
||||
PickingObjectDTO.PickData pickData = new PickingObjectDTO.PickData()
|
||||
.setBatchLot(matchRow.getPartitaMag())
|
||||
.setDataScad(matchRow.getDataScadPartitaD())
|
||||
.setMtbPartitaMag(matchRow.getRifPartitaMag())
|
||||
.setNumCnf(matchRow.getNumCnf())
|
||||
.setQtaCnf(matchRow.getQtaCnf())
|
||||
.setQtaTot(matchRow.getQtaCol())
|
||||
@ -713,8 +712,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
MtbColr matchRow = matchWithColloRow.get(k);
|
||||
PickingObjectDTO.PickData pickData = new PickingObjectDTO.PickData()
|
||||
.setBatchLot(matchRow.getPartitaMag())
|
||||
.setDataScad(matchRow.getDataScadPartitaD())
|
||||
.setMtbPartitaMag(matchRow.getRifPartitaMag())
|
||||
.setNumCnf(matchRow.getNumCnf())
|
||||
.setQtaCnf(matchRow.getQtaCnf())
|
||||
.setQtaTot(matchRow.getQtaCol())
|
||||
@ -753,7 +751,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
if(SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV()) {
|
||||
List<PickingObjectDTO> matchWithPartitaMag = Stream.of(matchPickingObject)
|
||||
.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;
|
||||
|
||||
@ -1122,18 +1120,22 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.setCanPartitaMagBeChanged(item.isDeactivated())
|
||||
.setMaxQta(qtaDisponibile);
|
||||
|
||||
boolean batchLotEnabled = true;
|
||||
|
||||
if(item.getTempPickData() != null) {
|
||||
PickingObjectDTO.PickData tmpPickData = item.getTempPickData();
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(tmpPickData.getBatchLot())) {
|
||||
dto.setBatchLot(tmpPickData.getBatchLot());
|
||||
if(!UtilityString.isNullOrEmpty(tmpPickData.getMtbPartitaMag().getPartitaMag())) {
|
||||
dto.setBatchLot(tmpPickData.getMtbPartitaMag().getPartitaMag());
|
||||
}
|
||||
|
||||
if(tmpPickData.getDataScad() != null){
|
||||
dto.setDataScad(tmpPickData.getDataScad());
|
||||
if(tmpPickData.getMtbPartitaMag().getDataScadD() != null){
|
||||
dto.setDataScad(tmpPickData.getMtbPartitaMag().getDataScadD());
|
||||
dto.setShouldAskDataScad(true);
|
||||
}
|
||||
|
||||
batchLotEnabled = tmpPickData.getMtbPartitaMag().getFlagStato().equalsIgnoreCase("A");
|
||||
|
||||
boolean useQtaDaEvadere;
|
||||
|
||||
if(tmpPickData.getQtaTot() != null) {
|
||||
@ -1165,7 +1167,14 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
boolean canOverflowQuantity = SettingsManager.iDB().isFlagCanAddExtraQuantitySpedizione();
|
||||
|
||||
if(!batchLotEnabled) {
|
||||
this.showBatchLotDisabledWarning(dto.getBatchLot(), () -> {
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -288,6 +288,8 @@ public class VersamentoMerceViewModel {
|
||||
.setNumColloRif(null)
|
||||
.setSerColloRif(null)
|
||||
.setDataColloRif((String) null)
|
||||
.setCausale(MtbColr.Causale.VERSAMENTO)
|
||||
.setUtente(SettingsManager.i().user.fullname)
|
||||
|
||||
.setQtaCol(stornoSourceMtbColr.getQtaCol().multiply(new BigDecimal(-1)));
|
||||
|
||||
@ -306,12 +308,14 @@ public class VersamentoMerceViewModel {
|
||||
.setGestione((String) null)
|
||||
.setSerCollo(null)
|
||||
.setNumCollo(null)
|
||||
.setDataCollo(null);
|
||||
.setDataCollo(null)
|
||||
.setCausale(MtbColr.Causale.VERSAMENTO)
|
||||
.setUtente(SettingsManager.i().user.fullname);
|
||||
|
||||
mtbColrDestObservableField.add(cloneMtbColr);
|
||||
}
|
||||
|
||||
clonedSourceTestata.setMtbColr(mtbColrSourceObservableField);
|
||||
if(mtbColrSourceObservableField.size() > 0) clonedSourceTestata.setMtbColr(mtbColrSourceObservableField);
|
||||
clonedDestTestata.setMtbColr(mtbColrDestObservableField);
|
||||
|
||||
|
||||
@ -401,7 +405,8 @@ public class VersamentoMerceViewModel {
|
||||
mtbColt.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -77,19 +77,23 @@ public class DialogChooseArtsFromListaArts {
|
||||
binding.setFilterStatus(filterStatus);
|
||||
binding.emptyView.setVisibility(listaMtbColr != null && listaMtbColr.size() > 0 ? View.GONE : View.VISIBLE);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setPositiveButton(context.getResources().getText(R.string.confirm), (dialog, which) -> {
|
||||
mDialog.dismiss();
|
||||
onPositiveClick();
|
||||
});
|
||||
builder.setNegativeButton(context.getResources().getText(R.string.abort), (dialog, which) -> {
|
||||
mDialog.dismiss();
|
||||
onNegativeClick();
|
||||
});
|
||||
// AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
// builder.setPositiveButton(context.getResources().getText(R.string.confirm), (dialog, which) -> {
|
||||
// mDialog.dismiss();
|
||||
// onPositiveClick();
|
||||
// });
|
||||
// builder.setNegativeButton(context.getResources().getText(R.string.abort), (dialog, which) -> {
|
||||
// mDialog.dismiss();
|
||||
// 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.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
@ -99,6 +103,16 @@ public class DialogChooseArtsFromListaArts {
|
||||
initRemoveFilterButton(binding);
|
||||
|
||||
setupBarcode();
|
||||
|
||||
binding.positiveButton.setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
onPositiveClick();
|
||||
});
|
||||
|
||||
binding.negativeButton.setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
onNegativeClick();
|
||||
});
|
||||
}
|
||||
|
||||
private void initRecyclerView(DialogChooseArtsFromListaArtsLayoutBinding binding) {
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
|
||||
@ -17,9 +17,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
@ -44,12 +45,14 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingBottom="24dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp">
|
||||
android:paddingEnd="8dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_above="@id/buttons">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
@ -78,7 +81,8 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/empty_view"
|
||||
@ -109,11 +113,19 @@
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/buttons"
|
||||
android:layout_width="match_parent"
|
||||
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
|
||||
android:id="@+id/center_guideline"
|
||||
@ -153,10 +165,7 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
@ -248,4 +248,6 @@
|
||||
|
||||
<string name="shipped_on">Spedito 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>
|
||||
@ -255,4 +255,6 @@
|
||||
<string name="delivered_on">Delivered on %s</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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user