[FEAT] Rimosso collo L in fase di accettazione

[BUG] Sistemato dialog di pick merce in fase di versamento
This commit is contained in:
Giuseppe Scorrano 2019-09-12 11:47:23 +02:00
parent 7403ac0a2d
commit 565b465462
13 changed files with 189 additions and 266 deletions

Binary file not shown.

View File

@ -6,7 +6,7 @@
<option name="DEPLOY_AS_INSTANT" value="false" /> <option name="DEPLOY_AS_INSTANT" value="false" />
<option name="ARTIFACT_NAME" value="" /> <option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" /> <option name="PM_INSTALL_OPTIONS" value="" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic__base,dynamic_vgalimenti" /> <option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic_ime,dynamic_vgalimenti" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" /> <option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" /> <option name="MODE" value="default_activity" />
<option name="CLEAR_LOGCAT" value="true" /> <option name="CLEAR_LOGCAT" value="true" />

View File

@ -46,6 +46,8 @@ 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;
@ -56,6 +58,12 @@ public class MtbColr extends EntityBase implements Parcelable {
} }
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();
@ -576,4 +584,22 @@ public class MtbColr extends EntityBase implements Parcelable {
this.rifPartitaMag = rifPartitaMag; this.rifPartitaMag = rifPartitaMag;
return this; 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

@ -62,6 +62,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,115 +867,61 @@ 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 = () -> { ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
@Override
public void onSuccess(MtbColt value) {
if(mtbColtOfAccettazione != null) {
mtbColr mtbColr
.setNumColloRif(mtbColtOfAccettazione.getNumCollo()) .setDataCollo(value.getDataColloS())
.setDataColloRif(mtbColtOfAccettazione.getDataColloD()) .setNumCollo(value.getNumCollo())
.setGestioneRif(mtbColtOfAccettazione.getGestione()) .setGestione(value.getGestione())
.setSerColloRif(mtbColtOfAccettazione.getSerCollo()) .setSerCollo(value.getSerCollo())
.setRiga(value.getMtbColr().get(0).getRiga())
.setUntMis(item.getMtbAart().getUntMis())
.setMtbAart(item.getMtbAart());
.setNumOrd(null) //item.setQtaRiservate(item.getQtaRiservate().add(mtbColr.getQtaCol()));
.setRigaOrd(null)
.setDataOrd((String) null)
.setRiga(null); getColloRef().getMtbColr().add(mtbColr);
refreshOrderBy(false);
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
progress.dismiss();
if(closeLU) onColloClosed(null);
} }
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() { @Override
@Override public void onFailed(Exception ex) {
public void onSuccess(MtbColt value) { UtilityExceptions.defaultException(mActivity, ex, progress);
}
mtbColr });
.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());
//item.setQtaRiservate(item.getQtaRiservate().add(mtbColr.getQtaCol()));
mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr().add(mtbColr);
refreshOrderBy(false);
FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
progress.dismiss();
if(closeLU) onColloClosed(null);
}
@Override
public void onFailed(Exception ex) {
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

@ -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

@ -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,54 +113,59 @@
</RelativeLayout> </RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/center_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/negative_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Button.PrimaryOutline"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/center_guideline"
android:text="@string/abort"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/positive_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Button.PrimaryFull"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="@id/center_guideline"
app:layout_constraintEnd_toEndOf="parent"
android:text="@string/confirm"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/negative_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Button.PrimaryOutline"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/center_guideline"
android:text="@string/abort"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/positive_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Button.PrimaryFull"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="@id/center_guideline"
app:layout_constraintEnd_toEndOf="parent"
android:text="@string/confirm"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>