Completata gestione della nuova Rettifica Giacenze
This commit is contained in:
parent
cff91c86fb
commit
c6adc453f6
@ -423,22 +423,47 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
.setCodMart(mtbAart.getCodMart())
|
||||
.setPartitaMag(quantityDTO.batchLot.get())
|
||||
.setDataScadPartita(quantityDTO.expireDate)
|
||||
.setQtaCol(quantityDTO.qtaTot.getBigDecimal())
|
||||
.setNumCnf(quantityDTO.numCnf.getBigDecimal())
|
||||
.setDescrizione(mtbAart.getDescrizioneEstesa())
|
||||
.setCausale(MtbColr.Causale.RETTIFICA)
|
||||
.setUtente(SettingsManager.i().user.fullname);
|
||||
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
if (!isCreatedLU) {
|
||||
mtbColr
|
||||
.setQtaCol(BigDecimal.ZERO)
|
||||
.setNumCnf(BigDecimal.ZERO)
|
||||
.setDataCollo(mtbColt.get().getDataColloS())
|
||||
.setNumCollo(mtbColt.get().getNumCollo())
|
||||
.setGestione(mtbColt.get().getGestione())
|
||||
.setSerCollo(mtbColt.get().getSerCollo());
|
||||
|
||||
ColliMagazzinoRESTConsumer.creaRettificaCollo(mtbColr,
|
||||
quantityDTO.numCnf.getBigDecimal(),
|
||||
quantityDTO.qtaTot.getBigDecimal(),
|
||||
() -> {
|
||||
mtbColr.setUntMis(mtbAart.getUntMis())
|
||||
.setMtbAart(mtbAart);
|
||||
|
||||
mtbColt.get().getMtbColr().add(mtbColr);
|
||||
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
resetTexts();
|
||||
progress.dismiss();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
});
|
||||
} else {
|
||||
mtbColr
|
||||
.setQtaCol(quantityDTO.qtaTot.getBigDecimal())
|
||||
.setNumCnf(quantityDTO.numCnf.getBigDecimal());
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mtbColt.get().clone();
|
||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
|
||||
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
||||
cloneMtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
// ColliMagazzinoRESTConsumer.creaRettificaCollo(mtbColr);
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||
@Override
|
||||
public void onSuccess(MtbColt value) {
|
||||
@ -465,6 +490,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user