Finish v1_12_8(137)
This commit is contained in:
commit
974ac63f3c
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 136
|
def appVersionCode = 137
|
||||||
def appVersionName = '1.12.7'
|
def appVersionName = '1.12.8'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import com.google.gson.JsonObject;
|
|||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -31,8 +32,8 @@ import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
|||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SingleValueDTO;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@ -269,6 +270,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setPartitaMag(original.getPartitaMag())
|
.setPartitaMag(original.getPartitaMag())
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
for (OrdineLavorazioneDTO ordLav : ordini) {
|
for (OrdineLavorazioneDTO ordLav : ordini) {
|
||||||
|
if (ordLav.getQtaColVersamento().getBigDecimal().compareTo(BigDecimal.ZERO) > 0){
|
||||||
MtbColr ordColr = (MtbColr) mtbColrClone.clone();
|
MtbColr ordColr = (MtbColr) mtbColrClone.clone();
|
||||||
ordColr.setQtaCol(ordLav.getQtaColVersamento().getBigDecimal());
|
ordColr.setQtaCol(ordLav.getQtaColVersamento().getBigDecimal());
|
||||||
ordColr.setNumCnf(ordLav.getNumCnfVersamento().getBigDecimal());
|
ordColr.setNumCnf(ordLav.getNumCnfVersamento().getBigDecimal());
|
||||||
@ -276,6 +278,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setNumOrd(ordLav.getNumOrdProd())
|
.setNumOrd(ordLav.getNumOrdProd())
|
||||||
.setRigaOrd(ordLav.getRigaOrdProd());
|
.setRigaOrd(ordLav.getRigaOrdProd());
|
||||||
newMtbColt.getMtbColr().add(ordColr);
|
newMtbColt.getMtbColr().add(ordColr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -675,4 +678,38 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void creaRettificaCollo(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MtbColr sourceMtbColr = (MtbColr) sourceMtbColrOriginal.clone();
|
||||||
|
sourceMtbColr.setRifPartitaMag(null);
|
||||||
|
sourceMtbColr.setMtbAart(null);
|
||||||
|
|
||||||
|
RettificaULDTO rettificaULDTO = new RettificaULDTO()
|
||||||
|
.setSourceMtbColr(sourceMtbColr)
|
||||||
|
.setNewNumCnf(newNumCnf)
|
||||||
|
.setNewQtaCol(newQtaTot);
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.creaRettificaCollo(
|
||||||
|
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
||||||
|
rettificaULDTO
|
||||||
|
).enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
analyzeAnswer(response, "GetBySSCC", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
if(onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.google.gson.JsonObject;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
@ -24,4 +25,7 @@ public interface ColliMagazzinoRESTConsumerService {
|
|||||||
@GET("getColliInBasket")
|
@GET("getColliInBasket")
|
||||||
Call<ServiceRESTResponse<List<MtbColt>>> getColliInBasket(@Query("codMdep") String codMdep);
|
Call<ServiceRESTResponse<List<MtbColt>>> getColliInBasket(@Query("codMdep") String codMdep);
|
||||||
|
|
||||||
|
@POST("creaRettificaCollo")
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,39 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
|
||||||
|
public class RettificaULDTO {
|
||||||
|
|
||||||
|
private MtbColr sourceMtbColr;
|
||||||
|
private BigDecimal newNumCnf;
|
||||||
|
private BigDecimal newQtaCol;
|
||||||
|
|
||||||
|
public MtbColr getSourceMtbColr() {
|
||||||
|
return sourceMtbColr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RettificaULDTO setSourceMtbColr(MtbColr sourceMtbColr) {
|
||||||
|
this.sourceMtbColr = sourceMtbColr;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNewNumCnf() {
|
||||||
|
return newNumCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RettificaULDTO setNewNumCnf(BigDecimal newNumCnf) {
|
||||||
|
this.newNumCnf = newNumCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNewQtaCol() {
|
||||||
|
return newQtaCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RettificaULDTO setNewQtaCol(BigDecimal newQtaCol) {
|
||||||
|
this.newQtaCol = newQtaCol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -22,6 +22,7 @@ import it.integry.integrywmsnative.R;
|
|||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
@ -224,7 +225,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
|
||||||
RunnableArgs<MtbColt> saveRunnable = mtbColt -> {
|
RunnableArgss<MtbColt, Boolean> saveRunnable = (mtbColt, createdLU) -> {
|
||||||
|
|
||||||
if(mtbColt != null) {
|
if(mtbColt != null) {
|
||||||
|
|
||||||
@ -287,7 +288,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(sourceMtbColt != null) saveRunnable.run(sourceMtbColt);
|
if(sourceMtbColt != null) saveRunnable.run(sourceMtbColt, false);
|
||||||
else DialogScanOrCreateLU.make(mContext, true, false, saveRunnable).show();
|
else DialogScanOrCreateLU.make(mContext, true, false, saveRunnable).show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,7 +86,7 @@ public class ProdVersamentoMaterialViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public void openLU() {
|
public void openLU() {
|
||||||
DialogScanOrCreateLU.make(mContext, false, false, true, false, mtbColt -> {
|
DialogScanOrCreateLU.make(mContext, false, false, true, false, (mtbColt, created) -> {
|
||||||
if (mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
((IPoppableActivity) mContext).pop();
|
((IPoppableActivity) mContext).pop();
|
||||||
} else if ((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE || mtbColt.getGestioneEnum() == GestioneEnum.VENDITA) && mtbColt.getSegno().equals(+1)) {
|
} else if ((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE || mtbColt.getGestioneEnum() == GestioneEnum.VENDITA) && mtbColt.getSegno().equals(+1)) {
|
||||||
|
|||||||
@ -59,6 +59,10 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
|||||||
mBinding.toolbar.setTitle(R.string.edit_order);
|
mBinding.toolbar.setTitle(R.string.edit_order);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
if (mOrdine == null) {
|
||||||
|
Toast.makeText(this, "Impossibile modificare ordine esportato", Toast.LENGTH_SHORT).show();
|
||||||
|
closeEdit();
|
||||||
|
}
|
||||||
if (mOrdine.isTransmitted()) {
|
if (mOrdine.isTransmitted()) {
|
||||||
Toast.makeText(this, "Impossibile modificare ordine esportato", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Impossibile modificare ordine esportato", Toast.LENGTH_SHORT).show();
|
||||||
closeEdit();
|
closeEdit();
|
||||||
|
|||||||
@ -86,6 +86,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
public BindableBoolean isFabVisible = new BindableBoolean();
|
public BindableBoolean isFabVisible = new BindableBoolean();
|
||||||
public BindableBoolean isMtbColtLoaded = new BindableBoolean();
|
public BindableBoolean isMtbColtLoaded = new BindableBoolean();
|
||||||
|
|
||||||
|
private boolean isCreatedLU = true;
|
||||||
|
|
||||||
|
|
||||||
public void init(Activity context, FragmentMainRettificaGiacenzeBinding binding, RettificaGiacenzeHelper helper) {
|
public void init(Activity context, FragmentMainRettificaGiacenzeBinding binding, RettificaGiacenzeHelper helper) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@ -93,8 +95,9 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
mHelper = helper;
|
mHelper = helper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMtbColt(MtbColt mtbColt) {
|
public void setMtbColt(MtbColt mtbColt, boolean isCreated) {
|
||||||
this.mtbColt.set(mtbColt);
|
this.mtbColt.set(mtbColt);
|
||||||
|
this.isCreatedLU = isCreated;
|
||||||
|
|
||||||
isFabVisible.set(mtbColt != null);
|
isFabVisible.set(mtbColt != null);
|
||||||
isMtbColtLoaded.set(mtbColt != null);
|
isMtbColtLoaded.set(mtbColt != null);
|
||||||
@ -420,14 +423,41 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
.setCodMart(mtbAart.getCodMart())
|
.setCodMart(mtbAart.getCodMart())
|
||||||
.setPartitaMag(quantityDTO.batchLot.get())
|
.setPartitaMag(quantityDTO.batchLot.get())
|
||||||
.setDataScadPartita(quantityDTO.expireDate)
|
.setDataScadPartita(quantityDTO.expireDate)
|
||||||
.setQtaCol(quantityDTO.qtaTot.getBigDecimal())
|
|
||||||
.setNumCnf(quantityDTO.numCnf.getBigDecimal())
|
|
||||||
.setDescrizione(mtbAart.getDescrizioneEstesa())
|
.setDescrizione(mtbAart.getDescrizioneEstesa())
|
||||||
.setCausale(MtbColr.Causale.RETTIFICA)
|
.setCausale(MtbColr.Causale.RETTIFICA)
|
||||||
.setUtente(SettingsManager.i().user.fullname);
|
.setUtente(SettingsManager.i().user.fullname);
|
||||||
|
|
||||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
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();
|
MtbColt cloneMtbColt = (MtbColt) mtbColt.get().clone();
|
||||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
|
||||||
@ -460,6 +490,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,11 +511,11 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void openLU() {
|
public void openLU() {
|
||||||
DialogScanOrCreateLU.make(mContext, true, false, mtbColt -> {
|
DialogScanOrCreateLU.make(mContext, true, false, (mtbColt, created) -> {
|
||||||
if (mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
((IPoppableActivity) mContext).pop();
|
((IPoppableActivity) mContext).pop();
|
||||||
} else {
|
} else {
|
||||||
setMtbColt(mtbColt);
|
setMtbColt(mtbColt, created);
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
@ -616,22 +647,47 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
|
|
||||||
DialogInputQuantity.makeBase(mContext, dto, true, value -> {
|
DialogInputQuantity.makeBase(mContext, dto, true, value -> {
|
||||||
|
|
||||||
BigDecimal qtaCol = value.qtaTot.getBigDecimal().subtract(mtbColrToEditClone.getQtaCol());
|
BigDecimal newQtaCol = value.qtaTot.getBigDecimal(); //.subtract(mtbColrToEditClone.getQtaCol());
|
||||||
|
BigDecimal newNumCnf = value.numCnf.getBigDecimal(); //.subtract(mtbColrToEditClone.getNumCnf());
|
||||||
|
|
||||||
if (qtaCol.compareTo(BigDecimal.ZERO) != 0) {
|
if (newQtaCol.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
if (newNumCnf.compareTo(BigDecimal.ZERO) == 0 && newQtaCol.compareTo(BigDecimal.ZERO) > 0)
|
||||||
|
newNumCnf = BigDecimal.ONE;
|
||||||
|
else if (newNumCnf.compareTo(BigDecimal.ZERO) == 0 && newQtaCol.compareTo(BigDecimal.ZERO) < 0)
|
||||||
|
newNumCnf = new BigDecimal(-1);
|
||||||
|
|
||||||
BigDecimal numCnf = value.numCnf.getBigDecimal().subtract(mtbColrToEditClone.getNumCnf());
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
if (numCnf.compareTo(BigDecimal.ZERO) == 0 && qtaCol.compareTo(BigDecimal.ZERO) > 0)
|
mtbColrToEditClone
|
||||||
numCnf = BigDecimal.ONE;
|
.setRiga(null);
|
||||||
else if (numCnf.compareTo(BigDecimal.ZERO) == 0 && qtaCol.compareTo(BigDecimal.ZERO) < 0)
|
|
||||||
numCnf = new BigDecimal(-1);
|
|
||||||
|
if (!isCreatedLU) {
|
||||||
|
BigDecimal finalNewNumCnf = newNumCnf;
|
||||||
|
ColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||||
|
mtbColrToEditClone,
|
||||||
|
newNumCnf,
|
||||||
|
newQtaCol,
|
||||||
|
() -> {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
mtbColt.get().getMtbColr().remove(index);
|
||||||
|
|
||||||
|
mtbColrToEditClone
|
||||||
|
.setQtaCol(newQtaCol)
|
||||||
|
.setNumCnf(finalNewNumCnf)
|
||||||
|
.setMtbAart(mtbColrToEdit.getMtbAart())
|
||||||
|
.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
|
||||||
|
mtbColt.get().getMtbColr().add(index, mtbColrToEditClone);
|
||||||
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progressDialog)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
|
||||||
mtbColrToEditClone
|
mtbColrToEditClone
|
||||||
.setRiga(null)
|
.setRiga(null)
|
||||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
.setDatetimeRow(UtilityDate.getDateInstance())
|
||||||
.setQtaCol(qtaCol)
|
.setQtaCol(newQtaCol)
|
||||||
.setNumCnf(numCnf)
|
.setNumCnf(newNumCnf)
|
||||||
.setUtente(SettingsManager.i().user.fullname)
|
.setUtente(SettingsManager.i().user.fullname)
|
||||||
.setCausale(MtbColr.Causale.RETTIFICA)
|
.setCausale(MtbColr.Causale.RETTIFICA)
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
@ -641,8 +697,6 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
mtbColtClone.getMtbColr().add(mtbColrToEditClone);
|
mtbColtClone.getMtbColr().add(mtbColrToEditClone);
|
||||||
mtbColtClone.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColtClone.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColtClone, valueNewMtbColt -> {
|
ColliMagazzinoRESTConsumer.saveCollo(mtbColtClone, valueNewMtbColt -> {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
mtbColt.get().getMtbColr().remove(index);
|
mtbColt.get().getMtbColr().remove(index);
|
||||||
@ -654,9 +708,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
|
||||||
mtbColt.get().getMtbColr().add(index, mtbColrToEditClone);
|
mtbColt.get().getMtbColr().add(index, mtbColrToEditClone);
|
||||||
}, ex -> {
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progressDialog));
|
||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, null).show();
|
}, null).show();
|
||||||
@ -683,6 +736,18 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
|
|
||||||
|
if (!isCreatedLU) {
|
||||||
|
ColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||||
|
mtbColrToDeleteClone,
|
||||||
|
BigDecimal.ZERO,
|
||||||
|
BigDecimal.ZERO,
|
||||||
|
() -> {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
mtbColt.get().getMtbColr().remove(mtbColrToDelete);
|
||||||
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progressDialog)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColtClone, value -> {
|
ColliMagazzinoRESTConsumer.saveCollo(mtbColtClone, value -> {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
mtbColt.get().getMtbColr().remove(mtbColrToDelete);
|
mtbColt.get().getMtbColr().remove(mtbColrToDelete);
|
||||||
@ -690,6 +755,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void printCollo(Dialog progress) {
|
private void printCollo(Dialog progress) {
|
||||||
|
|||||||
@ -68,7 +68,7 @@ public class VersamentoMerceViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void openLU() {
|
public void openLU() {
|
||||||
DialogScanOrCreateLU.make(mContext, true, false, true, false, mtbColt -> {
|
DialogScanOrCreateLU.make(mContext, true, false, true, false, (mtbColt, created) -> {
|
||||||
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)){
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import it.integry.integrywmsnative.R;
|
|||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
@ -45,7 +46,7 @@ public class DialogScanOrCreateLU {
|
|||||||
|
|
||||||
private DialogScanOrCreateLuBinding mBinding;
|
private DialogScanOrCreateLuBinding mBinding;
|
||||||
|
|
||||||
private RunnableArgs<MtbColt> mOnDialogDismiss;
|
private RunnableArgss<MtbColt, Boolean> mOnDialogDismiss;
|
||||||
|
|
||||||
private MtbColt currentMtbColt;
|
private MtbColt currentMtbColt;
|
||||||
|
|
||||||
@ -54,19 +55,19 @@ public class DialogScanOrCreateLU {
|
|||||||
private boolean mShouldCheckIfExistDoc = true;
|
private boolean mShouldCheckIfExistDoc = true;
|
||||||
|
|
||||||
|
|
||||||
public static Dialog make(final Context context, RunnableArgs<MtbColt> onDialogDismiss) {
|
public static Dialog make(final Context context, RunnableArgss<MtbColt, Boolean> onDialogDismiss) {
|
||||||
return new DialogScanOrCreateLU(context, false, true, true, true, onDialogDismiss).mDialog;
|
return new DialogScanOrCreateLU(context, false, true, true, true, onDialogDismiss).mDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dialog make(final Context context, boolean enableCreation, boolean shouldCheckIfExistDoc, RunnableArgs<MtbColt> onDialogDismiss) {
|
public static Dialog make(final Context context, boolean enableCreation, boolean shouldCheckIfExistDoc, RunnableArgss<MtbColt, Boolean> onDialogDismiss) {
|
||||||
return new DialogScanOrCreateLU(context, false, enableCreation, true, shouldCheckIfExistDoc, onDialogDismiss).mDialog;
|
return new DialogScanOrCreateLU(context, false, enableCreation, true, shouldCheckIfExistDoc, onDialogDismiss).mDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dialog make(final Context context, boolean enableBasket, boolean enableCreation, boolean checkResiduo, boolean shouldCheckIfExistDoc, RunnableArgs<MtbColt> onDialogDismiss) {
|
public static Dialog make(final Context context, boolean enableBasket, boolean enableCreation, boolean checkResiduo, boolean shouldCheckIfExistDoc, RunnableArgss<MtbColt, Boolean> onDialogDismiss) {
|
||||||
return new DialogScanOrCreateLU(context, enableBasket, enableCreation, checkResiduo, shouldCheckIfExistDoc, onDialogDismiss).mDialog;
|
return new DialogScanOrCreateLU(context, enableBasket, enableCreation, checkResiduo, shouldCheckIfExistDoc, onDialogDismiss).mDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DialogScanOrCreateLU(Context context, boolean enableBasket, boolean enableCreation, boolean checkResiduo, boolean shouldCheckIfExistDoc, RunnableArgs<MtbColt> onDialogDismiss) {
|
private DialogScanOrCreateLU(Context context, boolean enableBasket, boolean enableCreation, boolean checkResiduo, boolean shouldCheckIfExistDoc, RunnableArgss<MtbColt, Boolean> onDialogDismiss) {
|
||||||
mOnDialogDismiss = null;
|
mOnDialogDismiss = null;
|
||||||
currentMtbColt = null;
|
currentMtbColt = null;
|
||||||
mShouldCheckResiduo = checkResiduo;
|
mShouldCheckResiduo = checkResiduo;
|
||||||
@ -92,14 +93,14 @@ public class DialogScanOrCreateLU {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void init(RunnableArgs<MtbColt> onDialogDismiss) {
|
private void init(RunnableArgss<MtbColt, Boolean> onDialogDismiss) {
|
||||||
mOnDialogDismiss = onDialogDismiss;
|
mOnDialogDismiss = onDialogDismiss;
|
||||||
|
|
||||||
mBinding.createNewLuButton.setOnClickListener(v -> {
|
mBinding.createNewLuButton.setOnClickListener(v -> {
|
||||||
final Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
final Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.createColloLavorazione(+1, createdMtbColt -> {
|
ColliMagazzinoRESTConsumer.createColloLavorazione(+1, createdMtbColt -> {
|
||||||
sendMtbColt(createdMtbColt, progressDialog);
|
sendMtbColt(createdMtbColt, progressDialog, true);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
});
|
});
|
||||||
@ -107,7 +108,7 @@ public class DialogScanOrCreateLU {
|
|||||||
|
|
||||||
mBinding.viewBasket.setOnClickListener(v -> {
|
mBinding.viewBasket.setOnClickListener(v -> {
|
||||||
DialogBasketLU.make(mContext, mtbColt -> {
|
DialogBasketLU.make(mContext, mtbColt -> {
|
||||||
sendMtbColt(mtbColt, null);
|
sendMtbColt(mtbColt, null, false);
|
||||||
}).show();
|
}).show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -122,7 +123,7 @@ public class DialogScanOrCreateLU {
|
|||||||
BarcodeManager.removeCallback(barcodeIstanceID);
|
BarcodeManager.removeCallback(barcodeIstanceID);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
if(currentMtbColt == null) {
|
if(currentMtbColt == null) {
|
||||||
mOnDialogDismiss.run(null);
|
mOnDialogDismiss.run(null, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -162,7 +163,7 @@ public class DialogScanOrCreateLU {
|
|||||||
DialogCommon.showNoULFound(mContext, null);
|
DialogCommon.showNoULFound(mContext, null);
|
||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
ColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), mShouldCheckResiduo, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), mShouldCheckResiduo, false, mtbColt -> {
|
||||||
sendMtbColt(mtbColt, progressDialog);
|
sendMtbColt(mtbColt, progressDialog, false);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
@ -192,7 +193,7 @@ public class DialogScanOrCreateLU {
|
|||||||
ColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(barcodeScanDTO, GestioneEnum.LAVORAZIONE, createdMtbColt -> {
|
ColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(barcodeScanDTO, GestioneEnum.LAVORAZIONE, createdMtbColt -> {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
createdMtbColt.setDisablePrint(true);
|
createdMtbColt.setDisablePrint(true);
|
||||||
sendMtbColt(createdMtbColt, progressDialog);
|
sendMtbColt(createdMtbColt, progressDialog, true);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
@ -212,7 +213,7 @@ public class DialogScanOrCreateLU {
|
|||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
|
|
||||||
mtbColt.setDisablePrint(true);
|
mtbColt.setDisablePrint(true);
|
||||||
sendMtbColt(mtbColt, progressDialog);
|
sendMtbColt(mtbColt, progressDialog, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -243,7 +244,7 @@ public class DialogScanOrCreateLU {
|
|||||||
.show();
|
.show();
|
||||||
} else {
|
} else {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
sendMtbColt(mtbColt, progressDialog);
|
sendMtbColt(mtbColt, progressDialog, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -281,11 +282,11 @@ public class DialogScanOrCreateLU {
|
|||||||
null, null).show();
|
null, null).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendMtbColt(MtbColt mtbColtToSend, Dialog progressDialog) {
|
private void sendMtbColt(MtbColt mtbColtToSend, Dialog progressDialog, boolean created) {
|
||||||
currentMtbColt = mtbColtToSend;
|
currentMtbColt = mtbColtToSend;
|
||||||
if(progressDialog != null) progressDialog.dismiss();
|
if(progressDialog != null) progressDialog.dismiss();
|
||||||
mDialog.dismiss();
|
mDialog.dismiss();
|
||||||
mOnDialogDismiss.run(mtbColtToSend);
|
mOnDialogDismiss.run(mtbColtToSend, created);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user