[FRUDIS - VERSAMENTO MERCE]
- versamento merce su linea di produzione
This commit is contained in:
parent
afabbf8c96
commit
54142500aa
@ -0,0 +1,90 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableFloat;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsItemModel;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.choose_ordsLav_from_list.DialogChooseOrdsLavFromListItemModel;
|
||||||
|
|
||||||
|
public class CheckableOrdineLavoro {
|
||||||
|
|
||||||
|
|
||||||
|
private DialogChooseOrdsLavFromListItemModel item;
|
||||||
|
private BindableBoolean checked = new BindableBoolean(false);
|
||||||
|
private BindableBoolean hidden = new BindableBoolean(false);
|
||||||
|
private String testata;
|
||||||
|
|
||||||
|
public CheckableOrdineLavoro(DialogChooseOrdsLavFromListItemModel item) {
|
||||||
|
this.item = item;
|
||||||
|
this.item.getHidden().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
hidden.set(item.isHidden());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseOrdsLavFromListItemModel getItem() {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableOrdineLavoro setItem(DialogChooseOrdsLavFromListItemModel item) {
|
||||||
|
this.item = item;
|
||||||
|
|
||||||
|
this.item.getHidden().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
hidden.set(item.isHidden());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getChecked() {
|
||||||
|
return checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableOrdineLavoro setChecked(BindableBoolean checked) {
|
||||||
|
this.checked = checked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHidden() {
|
||||||
|
return hidden.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableOrdineLavoro setHidden(BindableBoolean hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableFloat getQtaCol() {
|
||||||
|
return item.getOrdineLav().getQtaColVersamento();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaCol(float qtaCnf) {
|
||||||
|
this.item.getOrdineLav().setQtaColVersamento(qtaCnf);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggleCheck() {
|
||||||
|
this.checked.set(!this.checked.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isChecked() {
|
||||||
|
return checked.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTestata() {
|
||||||
|
return testata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestata(String testata) {
|
||||||
|
this.testata = testata;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -37,14 +37,14 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public static void saveCollo(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback){
|
public static void saveCollo(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback) {
|
||||||
|
|
||||||
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
||||||
mtbColtToSave.getMtbColr().get(i)
|
mtbColtToSave.getMtbColr().get(i)
|
||||||
@ -57,7 +57,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed){
|
public static void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
||||||
|
|
||||||
mtbColtToSaveClone.setMtbColr(new ObservableArrayList<>());
|
mtbColtToSaveClone.setMtbColr(new ObservableArrayList<>());
|
||||||
@ -65,28 +65,28 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
||||||
mtbColtToSaveClone.getMtbColr().add(
|
mtbColtToSaveClone.getMtbColr().add(
|
||||||
((MtbColr) mtbColtToSave.getMtbColr().get(i).clone())
|
((MtbColr) mtbColtToSave.getMtbColr().get(i).clone())
|
||||||
.setMtbAart(null)
|
.setMtbAart(null)
|
||||||
.setRifPartitaMag(null));
|
.setRifPartitaMag(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<MtbColt>() {
|
EntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
}, MtbColt.class);
|
}, MtbColt.class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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) {
|
for (MtbColt mtbColt : mtbColtsToSave) {
|
||||||
mtbColt.setMtbCols(null);
|
mtbColt.setMtbCols(null);
|
||||||
|
|
||||||
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
|
||||||
@ -99,18 +99,18 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
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) {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
}, true, MtbColt.class);
|
}, true, MtbColt.class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveRigaCollo(MtbColr mtbColrToSave, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed){
|
public static void saveRigaCollo(MtbColr mtbColrToSave, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
mtbColrToSave.setMtbAart(null);
|
mtbColrToSave.setMtbAart(null);
|
||||||
mtbColrToSave.setRifPartitaMag(null);
|
mtbColrToSave.setRifPartitaMag(null);
|
||||||
@ -118,12 +118,12 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
EntityRESTConsumer.processEntity(mtbColrToSave, new ISimpleOperationCallback<MtbColr>() {
|
EntityRESTConsumer.processEntity(mtbColrToSave, new ISimpleOperationCallback<MtbColr>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColr value) {
|
public void onSuccess(MtbColr value) {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
}, MtbColr.class);
|
}, MtbColr.class);
|
||||||
|
|
||||||
@ -143,12 +143,12 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
saveCollo(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -188,17 +188,17 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
// .setCodVdes(null)
|
// .setCodVdes(null)
|
||||||
// .setOperation(CommonModelConsts.OPERATION.INSERT);
|
// .setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
if(posizione != null) {
|
if (posizione != null) {
|
||||||
newMtbColt
|
newMtbColt
|
||||||
.setPosizione(posizione.getPosizione());
|
.setPosizione(posizione.getPosizione());
|
||||||
|
|
||||||
if(posizione.isFlagLineaProduzione()) {
|
if (posizione.isFlagLineaProduzione()) {
|
||||||
newMtbColt
|
newMtbColt
|
||||||
.setCodJfas(posizione.getPosizione());
|
.setCodJfas(posizione.getPosizione());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < sourceMtbColt.getMtbColr().size(); i++) {
|
for (int i = 0; i < sourceMtbColt.getMtbColr().size(); i++) {
|
||||||
|
|
||||||
MtbColr mtbColrClone = (MtbColr) sourceMtbColt.getMtbColr().get(i).clone();
|
MtbColr mtbColrClone = (MtbColr) sourceMtbColt.getMtbColr().get(i).clone();
|
||||||
|
|
||||||
@ -222,12 +222,89 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
saveCollo(newMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(newMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void createColliScaricoDaOrdineLavorazione(MtbColt sourceMtbColt, MtbDepoPosizione posizione, List<OrdineLavorazioneDTO> ordini, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
MtbColt newMtbColt = new MtbColt()
|
||||||
|
.initDefaultFields()
|
||||||
|
.setCodAnag(null)
|
||||||
|
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||||
|
.setSegno(-1)
|
||||||
|
.setCodTcol(sourceMtbColt.getCodTcol())
|
||||||
|
.setPesoKg(sourceMtbColt.getPesoKg())
|
||||||
|
.setPesoNettoKg(sourceMtbColt.getPesoNettoKg())
|
||||||
|
.setLarghezzaCm(sourceMtbColt.getLarghezzaCm())
|
||||||
|
.setLunghezzaCm(sourceMtbColt.getLunghezzaCm())
|
||||||
|
.setAltezzaCm(sourceMtbColt.getAltezzaCm())
|
||||||
|
.setCodMdep(sourceMtbColt.getCodMdep())
|
||||||
|
.setDataVers(UtilityDate.getDateInstance())
|
||||||
|
.setOraFinePrep(UtilityDate.getDateInstance());
|
||||||
|
|
||||||
|
newMtbColt.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
|
|
||||||
|
if (posizione != null) {
|
||||||
|
newMtbColt
|
||||||
|
.setPosizione(posizione.getPosizione());
|
||||||
|
|
||||||
|
if (posizione.isFlagLineaProduzione()) {
|
||||||
|
newMtbColt
|
||||||
|
.setCodJfas(posizione.getPosizione());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (sourceMtbColt.getMtbColr().size() != 1) {
|
||||||
|
onFailed.run(new Exception());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MtbColr original = sourceMtbColt.getMtbColr().get(0);
|
||||||
|
MtbColr mtbColrClone = new MtbColr();
|
||||||
|
mtbColrClone
|
||||||
|
.setNumCollo(null)
|
||||||
|
.setDataCollo(null)
|
||||||
|
.setRiga(null)
|
||||||
|
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||||
|
.setDataColloRif(sourceMtbColt.getDataColloD())
|
||||||
|
.setNumColloRif(sourceMtbColt.getNumCollo())
|
||||||
|
.setGestioneRif(sourceMtbColt.getGestione())
|
||||||
|
.setSerColloRif(sourceMtbColt.getSerCollo())
|
||||||
|
.setCodMart(original.getCodMart())
|
||||||
|
.setCodCol(original.getCodCol())
|
||||||
|
.setCodTagl(original.getCodTagl())
|
||||||
|
.setPartitaMag(original.getPartitaMag())
|
||||||
|
.setNumCnf(original.getNumCnf())
|
||||||
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
for (OrdineLavorazioneDTO ordLav : ordini) {
|
||||||
|
MtbColr ordColr = (MtbColr) mtbColrClone.clone();
|
||||||
|
ordColr.setQtaCol(ordLav.getQtaColVersamento().getBigDecimal());
|
||||||
|
ordColr.setDataOrd(ordLav.getDataOrdProd())
|
||||||
|
.setNumOrd(ordLav.getNumOrdProd())
|
||||||
|
.setRigaOrd(ordLav.getRigaOrdProd());
|
||||||
|
newMtbColt.getMtbColr().add(ordColr);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
saveCollo(newMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColt value) {
|
||||||
|
if (onComplete != null) onComplete.run(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -248,15 +325,15 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
Integer customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcode);
|
Integer customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcode);
|
||||||
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
||||||
|
|
||||||
if(customNumCollo != null) {
|
if (customNumCollo != null) {
|
||||||
mtbColtToCreate.setNumCollo(customNumCollo);
|
mtbColtToCreate.setNumCollo(customNumCollo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(customSerCollo)) {
|
if (!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||||
mtbColtToCreate.setSerCollo(customSerCollo);
|
mtbColtToCreate.setSerCollo(customSerCollo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcode)) {
|
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcode)) {
|
||||||
onFailed.run(new Exception("Per continuare scansiona un'etichetta dell'anno corrente"));
|
onFailed.run(new Exception("Per continuare scansiona un'etichetta dell'anno corrente"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -267,29 +344,29 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
saveCollo(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed){
|
public static void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
||||||
|
|
||||||
saveCollo(mtbColtToDelete, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(mtbColtToDelete, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -306,34 +383,34 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.distribuisciCollo(distribuzioneColloDTO)
|
colliMagazzinoRESTConsumerService.distribuisciCollo(distribuzioneColloDTO)
|
||||||
.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
analyzeAnswerList(response, "DistribuzioneCollo", obj -> {
|
analyzeAnswerList(response, "DistribuzioneCollo", obj -> {
|
||||||
|
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
List<JsonObject> jsons = response.body().getEntityList();
|
List<JsonObject> jsons = response.body().getEntityList();
|
||||||
|
|
||||||
List<MtbColt> newList = new ArrayList<>();
|
List<MtbColt> newList = new ArrayList<>();
|
||||||
|
|
||||||
if(jsons != null) {
|
if (jsons != null) {
|
||||||
for (int i = 0; i < jsons.size(); i ++){
|
for (int i = 0; i < jsons.size(); i++) {
|
||||||
JsonObject jsonTmp = jsons.get(i);
|
JsonObject jsonTmp = jsons.get(i);
|
||||||
|
|
||||||
newList.add(gson.fromJson(jsonTmp, MtbColt.class));
|
newList.add(gson.fromJson(jsonTmp, MtbColt.class));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onComplete.run(newList);
|
||||||
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
onComplete.run(newList);
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
}, onFailed);
|
onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
@Override
|
|
||||||
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +421,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0){
|
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
List<String> codMarts = Stream.of(mtbColt.getMtbColr())
|
List<String> codMarts = Stream.of(mtbColt.getMtbColr())
|
||||||
.map(MtbColr::getCodMart)
|
.map(MtbColr::getCodMart)
|
||||||
.withoutNulls()
|
.withoutNulls()
|
||||||
@ -353,7 +430,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
|
|
||||||
ArticoloRESTConsumer.getByCodMart(codMarts, arts -> {
|
ArticoloRESTConsumer.getByCodMart(codMarts, arts -> {
|
||||||
|
|
||||||
if(arts != null && arts.size() > 0) {
|
if (arts != null && arts.size() > 0) {
|
||||||
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
|
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
|
||||||
|
|
||||||
MtbAart foundMtbAart = null;
|
MtbAart foundMtbAart = null;
|
||||||
@ -361,7 +438,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
List<MtbAart> mtbAartStream = Stream.of(arts)
|
List<MtbAart> mtbAartStream = Stream.of(arts)
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())).toList();
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())).toList();
|
||||||
|
|
||||||
if(mtbAartStream != null && mtbAartStream.size() > 0){
|
if (mtbAartStream != null && mtbAartStream.size() > 0) {
|
||||||
foundMtbAart = mtbAartStream.get(0);
|
foundMtbAart = mtbAartStream.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,7 +462,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
}, onFailed);
|
}, onFailed);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -403,10 +479,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
private static void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
if(sourceMtbColts.hasNext()){
|
if (sourceMtbColts.hasNext()) {
|
||||||
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
||||||
resultMtbColt.add(mtbColt);
|
resultMtbColt.add(mtbColt);
|
||||||
cyclicGetMultipleByTestate(sourceMtbColts, onlyResiduo, resultMtbColt, onComplete, onAbort);
|
cyclicGetMultipleByTestate(sourceMtbColts, onlyResiduo, resultMtbColt, onComplete, onAbort);
|
||||||
@ -419,7 +493,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
public static void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String ssccString = null;
|
String ssccString = null;
|
||||||
|
|
||||||
if(testata.getSerCollo().equalsIgnoreCase(CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE)){
|
if (testata.getSerCollo().equalsIgnoreCase(CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE)) {
|
||||||
ssccString = "U";
|
ssccString = "U";
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yy");
|
SimpleDateFormat sdf = new SimpleDateFormat("yy");
|
||||||
@ -454,32 +528,29 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void changePosizione(MtbColt testata, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public static void changePosizione(MtbColt testata, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
testata.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
testata.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
|
|
||||||
if(posizione == null) testata.setPosizione(null);
|
if (posizione == null) testata.setPosizione(null);
|
||||||
else testata.setPosizione(posizione.getPosizione());
|
else testata.setPosizione(posizione.getPosizione());
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveCollo(testata, new ISimpleOperationCallback<MtbColt>() {
|
ColliMagazzinoRESTConsumer.saveCollo(testata, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void deleteRiga(MtbColr mtbColrToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
public static void deleteRiga(MtbColr mtbColrToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed){
|
|
||||||
MtbColr newMtbColr = new MtbColr();
|
MtbColr newMtbColr = new MtbColr();
|
||||||
|
|
||||||
newMtbColr.setNumCollo(mtbColrToDelete.getNumCollo());
|
newMtbColr.setNumCollo(mtbColrToDelete.getNumCollo());
|
||||||
@ -494,40 +565,36 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
EntityRESTConsumer.processEntity(newMtbColr, new ISimpleOperationCallback<MtbColr>() {
|
EntityRESTConsumer.processEntity(newMtbColr, new ISimpleOperationCallback<MtbColr>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColr value) {
|
public void onSuccess(MtbColr value) {
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
}, MtbColr.class);
|
}, MtbColr.class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateRiga(MtbColr mtbColrToUpdate, Runnable onComplete, RunnableArgs<Exception> onFailed){
|
public static void updateRiga(MtbColr mtbColrToUpdate, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
mtbColrToUpdate.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
mtbColrToUpdate.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
|
|
||||||
EntityRESTConsumer.processEntity(mtbColrToUpdate, new ISimpleOperationCallback<MtbColr>() {
|
EntityRESTConsumer.processEntity(mtbColrToUpdate, new ISimpleOperationCallback<MtbColr>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColr value) {
|
public void onSuccess(MtbColr value) {
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
}, MtbColr.class);
|
}, MtbColr.class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void updateDataFine(Context context, Dialog progress, MtbColt mtbColt, Runnable onComplete) {
|
public static void updateDataFine(Context context, Dialog progress, MtbColt mtbColt, Runnable onComplete) {
|
||||||
|
|
||||||
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
||||||
@ -544,7 +611,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void doesColloContainsAnyRow(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void doesColloContainsAnyRow(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
HashMap<String, Object> params = new HashMap<>();
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
@ -558,12 +624,12 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
String query = "SELECT COUNT(*) as value FROM mtb_colr " +
|
String query = "SELECT COUNT(*) as value FROM mtb_colr " +
|
||||||
"WHERE " + whereCond;
|
"WHERE " + whereCond;
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<SingleValueDTO<Integer>>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<SingleValueDTO<Integer>>>() {
|
||||||
|
}.getType();
|
||||||
SystemRESTConsumer.<ArrayList<SingleValueDTO<Integer>>>processSql(query, typeOfObjectsList, data -> {
|
SystemRESTConsumer.<ArrayList<SingleValueDTO<Integer>>>processSql(query, typeOfObjectsList, data -> {
|
||||||
onComplete.run(data.get(0).getValue() > 0);
|
onComplete.run(data.get(0).getValue() > 0);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,31 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class MesRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public static void getOrdiniLavorazioneMateriale(String codJfas, String idMateriale, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
mesRESTConsumerService.getOrdiniLavorazioneMateriale(codJfas,idMateriale).enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "getAvailablePosizioni", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface MesRESTConsumerService {
|
||||||
|
|
||||||
|
|
||||||
|
@GET("mes/getOrdiniLavorazioneMateriale")
|
||||||
|
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazioneMateriale(@Query("codJfas") String codJfas, @Query("idMateriale") String idMateriale);
|
||||||
|
|
||||||
|
}
|
||||||
@ -27,6 +27,7 @@ public class DBSettingsModel {
|
|||||||
private boolean flagCanAddExtraQuantitySpedizione;
|
private boolean flagCanAddExtraQuantitySpedizione;
|
||||||
private boolean flagEnableCheckDepositoSpedizione;
|
private boolean flagEnableCheckDepositoSpedizione;
|
||||||
private boolean flagUseNewPickingListSpedizione;
|
private boolean flagUseNewPickingListSpedizione;
|
||||||
|
private boolean flagVersamentoDirettoProduzione;
|
||||||
private boolean flagAskPesoColloSpedizione;
|
private boolean flagAskPesoColloSpedizione;
|
||||||
private boolean flagForceAllToColli;
|
private boolean flagForceAllToColli;
|
||||||
|
|
||||||
@ -180,4 +181,13 @@ public class DBSettingsModel {
|
|||||||
this.flagUseNewPickingListSpedizione = flagUseNewPickingListSpedizione;
|
this.flagUseNewPickingListSpedizione = flagUseNewPickingListSpedizione;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagVersamentoDirettoProduzione() {
|
||||||
|
return flagVersamentoDirettoProduzione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagVersamentoDirettoProduzione(boolean flagVersamentoDirettoProduzione) {
|
||||||
|
this.flagVersamentoDirettoProduzione = flagVersamentoDirettoProduzione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -230,6 +230,10 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
.setKeySection("FLAG_USE_NEW_PICKING_LIST"));
|
.setKeySection("FLAG_USE_NEW_PICKING_LIST"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("PRODUZIONE")
|
||||||
|
.setKeySection("FLAG_VERSAMENTO_DIRETTO"));
|
||||||
|
|
||||||
|
|
||||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||||
@ -246,6 +250,7 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setFlagForceAllToColli(getValueFromList(list, "FLAG_FORCE_ALL_TO_COLLI", Boolean.class));
|
dbSettingsModelIstance.setFlagForceAllToColli(getValueFromList(list, "FLAG_FORCE_ALL_TO_COLLI", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagAskPesoColloSpedizione(getValueFromList(list, "FLAG_ASK_PESO_COLLO", Boolean.class));
|
dbSettingsModelIstance.setFlagAskPesoColloSpedizione(getValueFromList(list, "FLAG_ASK_PESO_COLLO", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagUseNewPickingListSpedizione(getValueFromList(list, "FLAG_USE_NEW_PICKING_LIST", Boolean.class));
|
dbSettingsModelIstance.setFlagUseNewPickingListSpedizione(getValueFromList(list, "FLAG_USE_NEW_PICKING_LIST", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setFlagVersamentoDirettoProduzione(getValueFromList(list, "FLAG_VERSAMENTO_DIRETTO", Boolean.class));
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
if(onComplete != null) onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
|
|||||||
@ -0,0 +1,457 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_versamento_materiale.dto;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableFloat;
|
||||||
|
import it.integry.integrywmsnative.core.exception.DateNotRecognizedException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.TimeNotRecognizedException;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
|
public class OrdineLavorazioneDTO {
|
||||||
|
|
||||||
|
private String dataOrdProd;
|
||||||
|
|
||||||
|
private Integer numOrdProd;
|
||||||
|
|
||||||
|
private Integer rigaOrdProd;
|
||||||
|
|
||||||
|
private String flagAvviabile;
|
||||||
|
|
||||||
|
private String untOrd;
|
||||||
|
|
||||||
|
private BigDecimal rapConv;
|
||||||
|
|
||||||
|
private Integer posRiga;
|
||||||
|
|
||||||
|
private BigDecimal numPezzi;
|
||||||
|
|
||||||
|
private BigDecimal numCnf;
|
||||||
|
|
||||||
|
private BigDecimal qtaCnf;
|
||||||
|
|
||||||
|
private Integer ggScadPartita;
|
||||||
|
|
||||||
|
private BigDecimal colliPedana;
|
||||||
|
|
||||||
|
private BigDecimal numPedane;
|
||||||
|
|
||||||
|
private String dataOrd;
|
||||||
|
|
||||||
|
private String flagEvasoProd;
|
||||||
|
|
||||||
|
private String gestione;
|
||||||
|
|
||||||
|
private Integer numOrd;
|
||||||
|
|
||||||
|
private String descrizioneProd;
|
||||||
|
|
||||||
|
private String codJfas;
|
||||||
|
|
||||||
|
private String partitaMag;
|
||||||
|
|
||||||
|
private String dataScad;
|
||||||
|
|
||||||
|
private String partitaMagSuggested;
|
||||||
|
|
||||||
|
private String dataScadSuggested;
|
||||||
|
|
||||||
|
private String codProd;
|
||||||
|
|
||||||
|
private Integer maxStep;
|
||||||
|
|
||||||
|
private String dataInizProd;
|
||||||
|
|
||||||
|
private String dataIniz;
|
||||||
|
|
||||||
|
private String dataFine;
|
||||||
|
|
||||||
|
private BigDecimal qtaProd;
|
||||||
|
|
||||||
|
private BigDecimal qtaTrasferite;
|
||||||
|
|
||||||
|
private String stato;
|
||||||
|
|
||||||
|
private String codTcolUl;
|
||||||
|
|
||||||
|
private String codAnag;
|
||||||
|
|
||||||
|
private String rifOrd;
|
||||||
|
|
||||||
|
private String codVdes;
|
||||||
|
|
||||||
|
private String codMdep;
|
||||||
|
|
||||||
|
private String codJcom;
|
||||||
|
|
||||||
|
private String noteLav;
|
||||||
|
|
||||||
|
private BigDecimal tempoTrascorso;
|
||||||
|
|
||||||
|
private String descCommessa;
|
||||||
|
|
||||||
|
private BigDecimal prodStd;
|
||||||
|
|
||||||
|
private Object mtbColtToEdit;
|
||||||
|
|
||||||
|
private int hrNum;
|
||||||
|
|
||||||
|
|
||||||
|
private BindableFloat qtaColVersamento = new BindableFloat();
|
||||||
|
|
||||||
|
public String getDataOrdProd() {
|
||||||
|
return dataOrdProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataOrdProd(String dataOrdProd) {
|
||||||
|
this.dataOrdProd = dataOrdProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumOrdProd() {
|
||||||
|
return numOrdProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumOrdProd(Integer numOrdProd) {
|
||||||
|
this.numOrdProd = numOrdProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRigaOrdProd() {
|
||||||
|
return rigaOrdProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRigaOrdProd(Integer rigaOrdProd) {
|
||||||
|
this.rigaOrdProd = rigaOrdProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPosRiga() {
|
||||||
|
return posRiga;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPosRiga(Integer posRiga) {
|
||||||
|
this.posRiga = posRiga;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataOrd() {
|
||||||
|
return dataOrd;
|
||||||
|
}
|
||||||
|
public Date getDateOrd() throws ParseException, TimeNotRecognizedException, DateNotRecognizedException {
|
||||||
|
return UtilityDate.recognizeDate(dataOrd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataOrd(String dataOrd) {
|
||||||
|
this.dataOrd = dataOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagEvasoProd() {
|
||||||
|
return flagEvasoProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlagEvasoProd(String flagEvasoProd) {
|
||||||
|
this.flagEvasoProd = flagEvasoProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumOrd() {
|
||||||
|
return numOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumOrd(Integer numOrd) {
|
||||||
|
this.numOrd = numOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneProd() {
|
||||||
|
return descrizioneProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizioneProd(String descrizioneProd) {
|
||||||
|
this.descrizioneProd = descrizioneProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxStep() {
|
||||||
|
return maxStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxStep(Integer maxStep) {
|
||||||
|
this.maxStep = maxStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataIniz() {
|
||||||
|
return dataIniz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataIniz(String dataIniz) {
|
||||||
|
this.dataIniz = dataIniz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataFine() {
|
||||||
|
return dataFine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataFine(String dataFine) {
|
||||||
|
this.dataFine = dataFine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaProd() {
|
||||||
|
return qtaProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaProd(BigDecimal qtaProd) {
|
||||||
|
this.qtaProd = qtaProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaTrasferite() {
|
||||||
|
return qtaTrasferite;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaTrasferite(BigDecimal qtaTrasferite) {
|
||||||
|
this.qtaTrasferite = qtaTrasferite;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStato() {
|
||||||
|
return stato;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStato(String stato) {
|
||||||
|
this.stato = stato;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUntOrd() {
|
||||||
|
return untOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUntOrd(String untOrd) {
|
||||||
|
this.untOrd = untOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getRapConv() {
|
||||||
|
return rapConv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRapConv(BigDecimal rapConv) {
|
||||||
|
this.rapConv = rapConv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumCnf() {
|
||||||
|
return numCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumCnf(BigDecimal numCnf) {
|
||||||
|
this.numCnf = numCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataScad() {
|
||||||
|
return dataScad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataScad(String dataScad) {
|
||||||
|
this.dataScad = dataScad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMagSuggested() {
|
||||||
|
return partitaMagSuggested;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartitaMagSuggested(String partitaMagSuggested) {
|
||||||
|
this.partitaMagSuggested = partitaMagSuggested;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataScadSuggested() {
|
||||||
|
return dataScadSuggested;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataScadSuggested(String dataScadSuggested) {
|
||||||
|
this.dataScadSuggested = dataScadSuggested;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodProd() {
|
||||||
|
return codProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodProd(String codProd) {
|
||||||
|
this.codProd = codProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataInizProd() {
|
||||||
|
return dataInizProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataInizProd(String dataInizProd) {
|
||||||
|
this.dataInizProd = dataInizProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTcolUl() {
|
||||||
|
return codTcolUl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodTcolUl(String codTcolUl) {
|
||||||
|
this.codTcolUl = codTcolUl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRifOrd() {
|
||||||
|
return rifOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRifOrd(String rifOrd) {
|
||||||
|
this.rifOrd = rifOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVdes() {
|
||||||
|
return codVdes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodVdes(String codVdes) {
|
||||||
|
this.codVdes = codVdes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJcom() {
|
||||||
|
return codJcom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodJcom(String codJcom) {
|
||||||
|
this.codJcom = codJcom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getColliPedana() {
|
||||||
|
return colliPedana;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColliPedana(BigDecimal colliPedana) {
|
||||||
|
this.colliPedana = colliPedana;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTempoTrascorso() {
|
||||||
|
return tempoTrascorso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTempoTrascorso(BigDecimal tempoTrascorso) {
|
||||||
|
this.tempoTrascorso = tempoTrascorso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescCommessa() {
|
||||||
|
return descCommessa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescCommessa(String descCommessa) {
|
||||||
|
this.descCommessa = descCommessa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getProdStd() {
|
||||||
|
return prodStd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProdStd(BigDecimal prodStd) {
|
||||||
|
this.prodStd = prodStd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagAvviabile() {
|
||||||
|
return flagAvviabile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlagAvviabile(String flagAvviabile) {
|
||||||
|
this.flagAvviabile = flagAvviabile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumPezzi() {
|
||||||
|
return numPezzi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumPezzi(BigDecimal numPezzi) {
|
||||||
|
this.numPezzi = numPezzi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumPedane() {
|
||||||
|
return numPedane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumPedane(BigDecimal numPedane) {
|
||||||
|
this.numPedane = numPedane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getMtbColtToEdit() {
|
||||||
|
return mtbColtToEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMtbColtToEdit(Object mtbColtToEdit) {
|
||||||
|
this.mtbColtToEdit = mtbColtToEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGgScadPartita() {
|
||||||
|
return ggScadPartita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGgScadPartita(Integer ggScadPartita) {
|
||||||
|
this.ggScadPartita = ggScadPartita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoteLav() {
|
||||||
|
return noteLav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoteLav(String noteLav) {
|
||||||
|
this.noteLav = noteLav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHrNum() {
|
||||||
|
return hrNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHrNum(int hrNum) {
|
||||||
|
this.hrNum = hrNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableFloat getQtaColVersamento() {
|
||||||
|
return qtaColVersamento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaColVersamento(float qtaColVersamento) {
|
||||||
|
this.qtaColVersamento.set(qtaColVersamento);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,28 +2,35 @@ package it.integry.integrywmsnative.gest.prod_versamento_materiale.viewmodel;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import java.util.List;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||||
|
import it.integry.integrywmsnative.core.model.CheckableOrdineLavoro;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
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;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.FragmentProdVersamentoMaterialeBinding;
|
import it.integry.integrywmsnative.databinding.FragmentProdVersamentoMaterialeBinding;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.core.ProdVersamentoMaterialHelper;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.core.ProdVersamentoMaterialHelper;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLU;
|
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLU;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.choose_ordsLav_from_list.DialogChooseOrdsLavFromList;
|
||||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
||||||
|
|
||||||
|
|
||||||
@ -51,11 +58,11 @@ public class ProdVersamentoMaterialViewModel {
|
|||||||
|
|
||||||
public void openLU() {
|
public void openLU() {
|
||||||
DialogScanOrCreateLU.make(mContext, true, true, false, mtbColt -> {
|
DialogScanOrCreateLU.make(mContext, true, true, false, mtbColt -> {
|
||||||
if(mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
((IPoppableActivity)mContext).pop();
|
((IPoppableActivity) mContext).pop();
|
||||||
} else if((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(+1)){
|
} else if ((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(+1)) {
|
||||||
|
|
||||||
if(mtbColt.getMtbColr() == null || mtbColt.getMtbColr().size() == 0) {
|
if (mtbColt.getMtbColr() == null || mtbColt.getMtbColr().size() == 0) {
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
new SpannableString(Html.fromHtml("E' stata scansionata una UL già vuota")),
|
new SpannableString(Html.fromHtml("E' stata scansionata una UL già vuota")),
|
||||||
null, this::openLU).show();
|
null, this::openLU).show();
|
||||||
@ -75,12 +82,28 @@ public class ProdVersamentoMaterialViewModel {
|
|||||||
private void choosePosition() {
|
private void choosePosition() {
|
||||||
DialogAskPositionOfLU.makeBase(mContext, null, true, (status, mtbDepoPosizione) -> {
|
DialogAskPositionOfLU.makeBase(mContext, null, true, (status, mtbDepoPosizione) -> {
|
||||||
|
|
||||||
if(status == DialogConsts.Results.ABORT) {
|
if (status == DialogConsts.Results.ABORT) {
|
||||||
((IPoppableActivity)mContext).pop();
|
((IPoppableActivity) mContext).pop();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (mtbDepoPosizione != null && mtbDepoPosizione.isFlagLineaProduzione() && mtbColt.get() != null) {
|
if (mtbDepoPosizione != null && mtbDepoPosizione.isFlagLineaProduzione() && mtbColt.get() != null) {
|
||||||
createColloScarico(mtbDepoPosizione);
|
if (!SettingsManager.iDB().isFlagVersamentoDirettoProduzione()) {
|
||||||
|
createColloScarico(mtbDepoPosizione);
|
||||||
|
} else {
|
||||||
|
if (mtbColt == null || mtbColt.get() == null || mtbColt.get().getMtbColr() == null || mtbColt.get().getMtbColr().size()<=0){
|
||||||
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
|
new SpannableString(Html.fromHtml("Il collo selezionato non presenta articoli versabili sulla linea.")),
|
||||||
|
null, this::openLU).show();
|
||||||
|
return;
|
||||||
|
}else if (mtbColt.get().getMtbColr().size() > 1){
|
||||||
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
|
new SpannableString(Html.fromHtml("Il collo selezionato contiene più articoli, per versarli in produzione vanno separati in colli differenti.")),
|
||||||
|
null, this::openLU).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MesRESTConsumer.getOrdiniLavorazioneMateriale(mtbDepoPosizione.getPosizione(), getIdMaterialeFromCollo(mtbColt.get()) ,ordini-> richiediOrdiniPerVersamento(ordini,mtbDepoPosizione), e-> DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
|
new SpannableString(Html.fromHtml(e.getMessage())),
|
||||||
|
null, this::openLU).show());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
new SpannableString(Html.fromHtml("Si è verificato un errore. Riprovare")),
|
new SpannableString(Html.fromHtml("Si è verificato un errore. Riprovare")),
|
||||||
@ -94,20 +117,20 @@ public class ProdVersamentoMaterialViewModel {
|
|||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getIdMaterialeFromCollo(MtbColt mtbColt) {
|
||||||
|
MtbAart articolo = mtbColt.getMtbColr().get(0).getMtbAart();
|
||||||
|
return UtilityString.isNullOrEmpty(articolo.getIdArtEqui())? articolo.getCodMart():articolo.getIdArtEqui();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void createColloScarico(MtbDepoPosizione mtbDepoPosizione) {
|
private void createColloScarico(MtbDepoPosizione mtbDepoPosizione) {
|
||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.createColloScaricoDaCarico(mtbColt.get(), mtbDepoPosizione, generatedMtbColt -> {
|
ColliMagazzinoRESTConsumer.createColloScaricoDaCarico(mtbColt.get(), mtbDepoPosizione, generatedMtbColt -> DialogCommon.showDataSaved(mContext, () -> {
|
||||||
DialogCommon.showDataSaved(mContext, () -> {
|
progressDialog.dismiss();
|
||||||
progressDialog.dismiss();
|
mOnVersamentoCompleted.run();
|
||||||
mOnVersamentoCompleted.run();
|
}), ex -> UtilityExceptions.defaultException(mContext, ex));
|
||||||
});
|
|
||||||
}, ex -> {
|
|
||||||
UtilityExceptions.defaultException(mContext, ex);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -120,5 +143,30 @@ public class ProdVersamentoMaterialViewModel {
|
|||||||
openLU();
|
openLU();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void richiediOrdiniPerVersamento(List<OrdineLavorazioneDTO> ordini, MtbDepoPosizione mtbDepoPosizione){
|
||||||
|
|
||||||
|
try {
|
||||||
|
DialogChooseOrdsLavFromList.make(mContext, mtbColt.get(), ordini, ordLavs -> {
|
||||||
|
if (ordLavs.size() > 0){
|
||||||
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
ColliMagazzinoRESTConsumer.createColliScaricoDaOrdineLavorazione(mtbColt.get(), mtbDepoPosizione, ordLavs, generatedMtbColt -> DialogCommon.showDataSaved(mContext, () -> {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
mOnVersamentoCompleted.run();
|
||||||
|
}), ex -> UtilityExceptions.defaultException(mContext, ex));
|
||||||
|
}else{
|
||||||
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
|
new SpannableString(Html.fromHtml("Nessun ordine selezionato!")),
|
||||||
|
null, this::openLU).show();
|
||||||
|
mOnVersamentoCompleted.run();
|
||||||
|
}
|
||||||
|
},()->{
|
||||||
|
mOnVersamentoCompleted.run();
|
||||||
|
}).show();
|
||||||
|
} catch (Exception e) {
|
||||||
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
|
new SpannableString(Html.fromHtml("Si è verificato un errore. Riprovare")),
|
||||||
|
null, this::openLU).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,108 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.choose_ordsLav_from_list;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.exception.DateNotRecognizedException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.TimeNotRecognizedException;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogChooseOrdsLavFromListLayoutBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
|
|
||||||
|
public class DialogChooseOrdsLavFromList {
|
||||||
|
|
||||||
|
private Context currentContext;
|
||||||
|
private Dialog mDialog;
|
||||||
|
|
||||||
|
private DialogChooseOrdsLavFromListAdapter currentAdapter;
|
||||||
|
|
||||||
|
private RunnableArgs<List<OrdineLavorazioneDTO>> mOnItemsChoosed;
|
||||||
|
private Runnable mOnAbort;
|
||||||
|
private MtbColt mMtbColt;
|
||||||
|
|
||||||
|
private List<DialogChooseOrdsLavFromListItemModel> mDataset;
|
||||||
|
|
||||||
|
public static Dialog make(final Context context, MtbColt collo, List<OrdineLavorazioneDTO> listaOrdini, RunnableArgs<List<OrdineLavorazioneDTO>> onItemsChoosed, Runnable onAbort) throws ParseException, TimeNotRecognizedException, DateNotRecognizedException {
|
||||||
|
return new DialogChooseOrdsLavFromList(context, collo, listaOrdini, onItemsChoosed, onAbort).mDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private DialogChooseOrdsLavFromList(Context context, MtbColt collo, List<OrdineLavorazioneDTO> listaOrdiniLavoro, RunnableArgs<List<OrdineLavorazioneDTO>> onItemsChoosed, Runnable onAbort) throws ParseException, TimeNotRecognizedException, DateNotRecognizedException {
|
||||||
|
currentContext = context;
|
||||||
|
mOnItemsChoosed = onItemsChoosed;
|
||||||
|
mOnAbort = onAbort;
|
||||||
|
mMtbColt = collo;
|
||||||
|
|
||||||
|
mDataset = new ArrayList<>();
|
||||||
|
|
||||||
|
if(listaOrdiniLavoro != null){
|
||||||
|
for (OrdineLavorazioneDTO ordineLav : listaOrdiniLavoro) {
|
||||||
|
mDataset.add(new DialogChooseOrdsLavFromListItemModel().setOrdineLav(ordineLav));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
DialogChooseOrdsLavFromListLayoutBinding binding = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_ords_lav_from_list_layout, null, false);
|
||||||
|
binding.setMtbColr(mMtbColt.getMtbColr().get(0));
|
||||||
|
|
||||||
|
binding.emptyView.setVisibility(mDataset != null && mDataset.size() > 0 ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
|
mDialog = new Dialog(context);
|
||||||
|
mDialog.setContentView(binding.getRoot());
|
||||||
|
mDialog.setCanceledOnTouchOutside(false);
|
||||||
|
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
|
||||||
|
|
||||||
|
initRecyclerView(binding);
|
||||||
|
|
||||||
|
binding.positiveButton.setOnClickListener(v -> {
|
||||||
|
mDialog.dismiss();
|
||||||
|
onPositiveClick();
|
||||||
|
});
|
||||||
|
|
||||||
|
binding.negativeButton.setOnClickListener(v -> {
|
||||||
|
mDialog.dismiss();
|
||||||
|
onNegativeClick();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initRecyclerView(DialogChooseOrdsLavFromListLayoutBinding binding) throws ParseException, TimeNotRecognizedException, DateNotRecognizedException {
|
||||||
|
binding.dialogChooseArtsFromListaArtMainList.setNestedScrollingEnabled(false);
|
||||||
|
|
||||||
|
binding.dialogChooseArtsFromListaArtMainList.setHasFixedSize(true);
|
||||||
|
|
||||||
|
binding.dialogChooseArtsFromListaArtMainList.setLayoutManager(new LinearLayoutManager(currentContext));
|
||||||
|
|
||||||
|
currentAdapter = new DialogChooseOrdsLavFromListAdapter(currentContext, mDataset, mMtbColt);
|
||||||
|
binding.dialogChooseArtsFromListaArtMainList.setAdapter(currentAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void onPositiveClick() {
|
||||||
|
if(mOnItemsChoosed != null) {
|
||||||
|
mOnItemsChoosed.run(currentAdapter.getSelectedItems());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void onNegativeClick() {
|
||||||
|
if(this.mOnAbort != null) mOnAbort.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,170 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.choose_ordsLav_from_list;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.exception.DateNotRecognizedException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.TimeNotRecognizedException;
|
||||||
|
import it.integry.integrywmsnative.core.model.CheckableOrdineLavoro;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogChooseOrdsLavFromListItemModelBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
|
|
||||||
|
public class DialogChooseOrdsLavFromListAdapter extends RecyclerView.Adapter<DialogChooseOrdsLavFromListAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
protected Context mContext;
|
||||||
|
|
||||||
|
private MtbColt mMtbColt;
|
||||||
|
private MtbColr mMtbColr;
|
||||||
|
private List<CheckableOrdineLavoro> mDataset;
|
||||||
|
private HashMap<CheckableOrdineLavoro, Integer> mDatasetPositions = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
public DialogChooseOrdsLavFromListAdapter(Context context, List<DialogChooseOrdsLavFromListItemModel> myDataset, MtbColt mtbColt) throws ParseException, TimeNotRecognizedException, DateNotRecognizedException {
|
||||||
|
mContext = context;
|
||||||
|
mMtbColt = mtbColt;
|
||||||
|
mMtbColr = mtbColt.getMtbColr().get(0);
|
||||||
|
if (myDataset != null) {
|
||||||
|
mDataset = Stream.of(myDataset)
|
||||||
|
.withoutNulls()
|
||||||
|
.map(CheckableOrdineLavoro::new).toList();
|
||||||
|
|
||||||
|
for (int i = 0; i < mDataset.size(); i++) {
|
||||||
|
final CheckableOrdineLavoro itemModel = mDataset.get(i);
|
||||||
|
OrdineLavorazioneDTO ordine = itemModel.getItem().getOrdineLav();
|
||||||
|
itemModel.setTestata(Html.fromHtml(String.format(mContext.getString(R.string.ord_testata), String.valueOf(ordine.getNumOrd()), UtilityDate.formatDate(ordine.getDateOrd(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN))).toString());
|
||||||
|
mDatasetPositions.put(itemModel, i);
|
||||||
|
|
||||||
|
itemModel.getHidden().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
onItemHidden(itemModel);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
itemModel.getChecked().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
onItemChecked(itemModel);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onItemHidden(CheckableOrdineLavoro itemModel) {
|
||||||
|
if (itemModel.isHidden()) {
|
||||||
|
mDataset.remove(itemModel);
|
||||||
|
} else {
|
||||||
|
mDataset.add(mDatasetPositions.get(itemModel), itemModel);
|
||||||
|
}
|
||||||
|
calculateMtbColtShare();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
private void onItemChecked(CheckableOrdineLavoro itemModel) {
|
||||||
|
if (!itemModel.isChecked()){
|
||||||
|
itemModel.setQtaCol(0);
|
||||||
|
}
|
||||||
|
calculateMtbColtShare();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void calculateMtbColtShare() {
|
||||||
|
MtbColr mtbColr = mMtbColt.getMtbColr().get(0);
|
||||||
|
BigDecimal residuo = mtbColr.getQtaCol();
|
||||||
|
BigDecimal offset = BigDecimal.ZERO.add(residuo);
|
||||||
|
|
||||||
|
|
||||||
|
List<CheckableOrdineLavoro> ordiniSelezionati = getSelectedData();
|
||||||
|
|
||||||
|
int totalHr = Stream.of(ordiniSelezionati).mapToInt(x -> x.getItem().getOrdineLav().getHrNum()).sum();
|
||||||
|
for (CheckableOrdineLavoro c : ordiniSelezionati) {
|
||||||
|
float perc = (c.getItem().getOrdineLav().getHrNum() * 100)/ totalHr;
|
||||||
|
BigDecimal used = residuo.multiply(BigDecimal.valueOf(perc)).divide(BigDecimal.valueOf(100)).setScale(0,BigDecimal.ROUND_HALF_DOWN);
|
||||||
|
offset = offset.subtract(used);
|
||||||
|
c.setQtaCol(used.floatValue());
|
||||||
|
}
|
||||||
|
if (ordiniSelezionati.size() > 0 && offset.floatValue() > 0){
|
||||||
|
Optional<CheckableOrdineLavoro> majorOrder = Stream.of(ordiniSelezionati).max((o1,o2)-> Integer.compare(o1.getItem().getOrdineLav().getHrNum(),o2.getItem().getOrdineLav().getHrNum()));
|
||||||
|
if (!majorOrder.isEmpty()){
|
||||||
|
majorOrder.get().setQtaCol(majorOrder.get().getQtaCol().get()+offset.floatValue());
|
||||||
|
}else{
|
||||||
|
ordiniSelezionati.get(0).setQtaCol(ordiniSelezionati.get(0).getQtaCol().get()+offset.floatValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
protected DialogChooseOrdsLavFromListItemModelBinding mViewDataBinding;
|
||||||
|
|
||||||
|
|
||||||
|
public ViewHolder(DialogChooseOrdsLavFromListItemModelBinding v) {
|
||||||
|
super(v.getRoot());
|
||||||
|
mViewDataBinding = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void bind(CheckableOrdineLavoro checkableOrdineLavoro, MtbColr mtbColr) {
|
||||||
|
mViewDataBinding.setCheckableOrdineLav(checkableOrdineLavoro);
|
||||||
|
mViewDataBinding.setMtbColr(mtbColr);
|
||||||
|
mViewDataBinding.executePendingBindings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DialogChooseOrdsLavFromListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
// create a new view
|
||||||
|
DialogChooseOrdsLavFromListItemModelBinding viewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.dialog_choose_ords_lav_from_list__item_model, parent, false);
|
||||||
|
|
||||||
|
return new ViewHolder(viewDataBinding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(DialogChooseOrdsLavFromListAdapter.ViewHolder holder, int position) {
|
||||||
|
CheckableOrdineLavoro item = mDataset.get(position);
|
||||||
|
holder.bind(item, mMtbColr);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewRecycled(DialogChooseOrdsLavFromListAdapter.ViewHolder holder) {
|
||||||
|
super.onViewRecycled(holder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mDataset.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<OrdineLavorazioneDTO> getSelectedItems() {
|
||||||
|
return Stream.of(mDataset)
|
||||||
|
.filter(y -> y.getChecked().get())
|
||||||
|
.map(x -> x.getItem().getOrdineLav()).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CheckableOrdineLavoro> getSelectedData() {
|
||||||
|
return Stream.of(mDataset)
|
||||||
|
.filter(y -> y.getChecked().get())
|
||||||
|
.map(x -> x).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.choose_ordsLav_from_list;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
|
|
||||||
|
public class DialogChooseOrdsLavFromListItemModel {
|
||||||
|
|
||||||
|
private OrdineLavorazioneDTO ordineLav;
|
||||||
|
private BindableBoolean hidden = new BindableBoolean(false);
|
||||||
|
|
||||||
|
public OrdineLavorazioneDTO getOrdineLav() {
|
||||||
|
return ordineLav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseOrdsLavFromListItemModel setOrdineLav(OrdineLavorazioneDTO ordineLav) {
|
||||||
|
this.ordineLav= ordineLav;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHidden() {
|
||||||
|
return hidden.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseOrdsLavFromListItemModel setHidden(boolean hidden) {
|
||||||
|
this.hidden.set(hidden);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="it.integry.integrywmsnative.R" />
|
||||||
|
<import type="android.view.View" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||||
|
<variable
|
||||||
|
name="checkableOrdineLav"
|
||||||
|
type="it.integry.integrywmsnative.core.model.CheckableOrdineLavoro"/>
|
||||||
|
<variable
|
||||||
|
name="mtbColr"
|
||||||
|
type="it.integry.integrywmsnative.core.model.MtbColr"/>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:background="@drawable/bg_checked_layout"
|
||||||
|
app:backgroundTintResID="@{checkableOrdineLav.checked.get() ? R.color.bg_checked_layout : android.R.color.transparent}"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:onClick="@{() -> checkableOrdineLav.toggleCheck()}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatCheckBox
|
||||||
|
android:id="@+id/checkbox"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
app:checked="@{checkableOrdineLav.checked}"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_toEndOf="@id/checkbox"
|
||||||
|
android:layout_toStartOf="@id/qta_box">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{checkableOrdineLav.getTestata()}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="N° X del dd/mm/yyyy" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@{checkableOrdineLav.item.ordineLav.codProd +' '+ checkableOrdineLav.item.ordineLav.descrizioneProd}"
|
||||||
|
android:textColor="@android:color/secondary_text_light"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="150303-010 CAVOLO VERZA 6 PZ PL NERA 604018" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@{checkableOrdineLav.item.ordineLav.partitaMag}"
|
||||||
|
android:textColor="@android:color/holo_red_light"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="Lotto: 35119F0038" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/qta_box"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/badge1_round_corner"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:text="@{UtilityNumber.decimalToString(checkableOrdineLav.qtaCol.get()) + (mtbColr.mtbAart != null && !UtilityString.isNullOrEmpty(mtbColr.mtbAart.untMis) ? `\n` + mtbColr.mtbAart.untMis : ``)}"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="15\nKG" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,232 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<data>
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||||
|
<variable
|
||||||
|
name="mtbColr"
|
||||||
|
type="it.integry.integrywmsnative.core.model.MtbColr"/>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/base_root"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
app:cardCornerRadius="12dp"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!--<RelativeLayout-->
|
||||||
|
<!--android:id="@+id/title_container"-->
|
||||||
|
<!--android:layout_width="match_parent"-->
|
||||||
|
<!--android:layout_height="wrap_content"-->
|
||||||
|
<!--android:background="@color/light_blue_300"-->
|
||||||
|
<!--android:gravity="center_horizontal">-->
|
||||||
|
|
||||||
|
<!--<androidx.appcompat.widget.AppCompatImageView-->
|
||||||
|
<!--android:id="@+id/title_icon"-->
|
||||||
|
<!--android:layout_width="wrap_content"-->
|
||||||
|
<!--android:layout_height="wrap_content"-->
|
||||||
|
<!--android:src="@drawable/ic_error_white_24dp"-->
|
||||||
|
<!--android:layout_margin="24dp"/>-->
|
||||||
|
|
||||||
|
<!--</RelativeLayout>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/TextViewMaterial.DialogTitle"
|
||||||
|
android:text="@string/distribute_ul"
|
||||||
|
android:gravity="center_horizontal"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/gray_detail_background_round8"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/article"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/cod_alis"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="CAVOLO VERZA"
|
||||||
|
android:text="@{mtbColr.mtbAart.descrizione}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/batch_lot"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/descr_lis"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="35119F0038"
|
||||||
|
android:text="@{mtbColr.partitaMag}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="italic" />
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/quantity"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/qta_col"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="385 PZ"
|
||||||
|
android:text="@{UtilityNumber.decimalToString(mtbColr.qtaCol)+ ' ' + mtbColr.mtbAart.untMis}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="italic" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/empty_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="16dp">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/no_item_to_pick_text"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@color/empty_view_gray"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/dialog_choose_arts_from_lista_art__main_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:weightSum="1">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/negative_button"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Button.PrimaryOutline"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:paddingStart="3dp"
|
||||||
|
android:paddingEnd="3dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/left_buttons_guideline"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
|
||||||
|
android:text="@string/abort"/>
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/positive_button"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:paddingEnd="3dp"
|
||||||
|
android:paddingStart="3dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/right_buttons_guideline"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:text="@string/confirm"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</layout>
|
||||||
@ -10,8 +10,9 @@
|
|||||||
<string name="completed">Completato</string>
|
<string name="completed">Completato</string>
|
||||||
<string name="ord_acq_testata"><![CDATA[N° <b>%s</b> del <b>%s</b>]]></string>
|
<string name="ord_acq_testata"><![CDATA[N° <b>%s</b> del <b>%s</b>]]></string>
|
||||||
<string name="ord_ven_testata"><![CDATA[N° <b>%s</b> del <b>%s</b>]]></string>
|
<string name="ord_ven_testata"><![CDATA[N° <b>%s</b> del <b>%s</b>]]></string>
|
||||||
|
<string name="ord_testata"><![CDATA[N° <b>%s</b> del <b>%s</b>]]></string>
|
||||||
<string name="ord_ven_testata_data_cons"><![CDATA[Cons <b>%s</b>]]></string>
|
<string name="ord_ven_testata_data_cons"><![CDATA[Cons <b>%s</b>]]></string>
|
||||||
<string name="search">Cerca...</string>
|
<string name="search">Cerca…</string>
|
||||||
<string name="login">Login</string>
|
<string name="login">Login</string>
|
||||||
<string name="accettazione_title_fragment">Accettazione</string>
|
<string name="accettazione_title_fragment">Accettazione</string>
|
||||||
<string name="accettazione_ordine_inevaso_title_empty">Ordine di accettazione</string>
|
<string name="accettazione_ordine_inevaso_title_empty">Ordine di accettazione</string>
|
||||||
@ -296,4 +297,7 @@
|
|||||||
<string name="choose_action">Seleziona una azione</string>
|
<string name="choose_action">Seleziona una azione</string>
|
||||||
<string name="delete">Elimina</string>
|
<string name="delete">Elimina</string>
|
||||||
<string name="edit">Modifica</string>
|
<string name="edit">Modifica</string>
|
||||||
|
<string name="distribute_ul">Distribuisci quantità</string>
|
||||||
|
<string name="article">Articolo</string>
|
||||||
|
<string name="title_dynamic_saporiveri">Personalizzazione SaporiVeri</string>
|
||||||
</resources>
|
</resources>
|
||||||
@ -49,6 +49,7 @@
|
|||||||
<string name="permission_request_message">Permissions are required for app to work properly</string>
|
<string name="permission_request_message">Permissions are required for app to work properly</string>
|
||||||
<string name="ord_acq_testata"><![CDATA[#<b>%s</b> of <b>%s</b>]]></string>
|
<string name="ord_acq_testata"><![CDATA[#<b>%s</b> of <b>%s</b>]]></string>
|
||||||
<string name="ord_ven_testata"><![CDATA[#<b>%s</b> of <b>%s</b>]]></string>
|
<string name="ord_ven_testata"><![CDATA[#<b>%s</b> of <b>%s</b>]]></string>
|
||||||
|
<string name="ord_testata"><![CDATA[#<b>%s</b> of <b>%s</b>]]></string>
|
||||||
<string name="ord_ven_testata_data_cons"><![CDATA[Ship <b>%s</b>]]></string>
|
<string name="ord_ven_testata_data_cons"><![CDATA[Ship <b>%s</b>]]></string>
|
||||||
<string name="accettazione_title_fragment">Check in</string>
|
<string name="accettazione_title_fragment">Check in</string>
|
||||||
<string name="accettazione_ordine_inevaso_title_empty">Check in order</string>
|
<string name="accettazione_ordine_inevaso_title_empty">Check in order</string>
|
||||||
@ -302,4 +303,6 @@
|
|||||||
<string name="delete">Delete</string>
|
<string name="delete">Delete</string>
|
||||||
<string name="edit">Edit</string>
|
<string name="edit">Edit</string>
|
||||||
<string name="title_dynamic_saporiveri">SaporVeri Customization</string>
|
<string name="title_dynamic_saporiveri">SaporVeri Customization</string>
|
||||||
|
<string name="distribute_ul">Distribute quantity</string>
|
||||||
|
<string name="article">Article</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user