Compare commits
47 Commits
v1.13.20(1
...
v1.14.0(17
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b0a86bb81 | |||
| ebf2bd578e | |||
| f90e2acc3e | |||
| 035f058bc3 | |||
| 73e57e9430 | |||
| 13cc9f6053 | |||
| d9844315a3 | |||
| ade37f07d6 | |||
| f02e9921cb | |||
| e8ce7a9eeb | |||
| 61b0049a87 | |||
| 5c4d72dae2 | |||
| 39f52bf3dd | |||
| e50aa1f014 | |||
| b1d06605cd | |||
| ed55eb4279 | |||
| 9ac96ac8fd | |||
| 5be3fd9c25 | |||
| bab558252a | |||
| c256b39119 | |||
| af76627c50 | |||
| f9544566e9 | |||
| 4f02c3a4bc | |||
| ea8d8835cd | |||
| 61e07e8f76 | |||
| 962e1f7fa4 | |||
| 07d889bcd5 | |||
| 170db3eb0a | |||
| 856a807e3e | |||
| c56aa812ff | |||
| 770f014a70 | |||
| f6ff7aa80d | |||
| 4cd3e7e102 | |||
| 69bf5e319e | |||
| 88fe4d82cd | |||
| c8cd794cfc | |||
| 5dcc567eab | |||
| 89eafaf6ca | |||
| 6fc7f80ed4 | |||
| 2464d44222 | |||
| 96d544f2ad | |||
| e85ddc6580 | |||
| 89f6b9ce71 | |||
| c7d0ed1747 | |||
| b84b3c28f3 | |||
| 3a3bf4c2dd | |||
| 4809a96e5b |
@@ -7,8 +7,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 166
|
||||
def appVersionName = '1.13.20'
|
||||
def appVersionCode = 177
|
||||
def appVersionName = '1.14.0'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -102,8 +102,8 @@ dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.3.0-alpha03'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
|
||||
implementation 'com.google.android.material:material:1.3.0-alpha04'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||
|
||||
@@ -171,7 +171,7 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableString.get();
|
||||
String viewValue = view.getText().toString().trim();
|
||||
String viewValue = view.getText().toString();
|
||||
|
||||
if(!viewValue.equalsIgnoreCase(newValue)) {
|
||||
view.setText(newValue);
|
||||
|
||||
@@ -5,6 +5,6 @@ import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class NoPrintersFoundException extends Exception {
|
||||
public NoPrintersFoundException() {
|
||||
super(UtilityResources.getString(R.string.exception_printer_not_found));
|
||||
super(UtilityResources.getString(R.string.exception_no_printer_found));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.util.Log;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -11,6 +12,8 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.BuildConfig;
|
||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
@@ -89,7 +92,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||
analyzeAnswer(response, "GetAvailablePrinters", onComplete, onFailed);
|
||||
analyzeAnswer(response, "GetAvailablePrinters", printerList -> {
|
||||
printerList = Stream.of(printerList).filter(x -> !UtilityString.isNullOrEmpty(x)).toList();
|
||||
onComplete.run(printerList);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,7 +136,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "PrintCollo", data -> {
|
||||
analyzeAnswer(response, "printCollo", data -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
@@ -142,7 +148,38 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
} else onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
// if(BuildConfig.DEBUG) {
|
||||
// onComplete.run();
|
||||
// return;
|
||||
// }
|
||||
|
||||
JasperDTO jasperDTO = new JasperDTO();
|
||||
jasperDTO.setReportName(reportName);
|
||||
|
||||
Stream.of(params)
|
||||
.forEach(x -> jasperDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
||||
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
printerService
|
||||
.processPrintReport(printerName, quantity, jasperDTO)
|
||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "printReport", data -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
if(t.getMessage().contains("Printer not found")) {
|
||||
onFailed.run(new NoPrintersFoundException());
|
||||
} else onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
@@ -34,4 +36,11 @@ public interface PrinterRESTConsumerService {
|
||||
);
|
||||
|
||||
|
||||
@POST("processPrintReport")
|
||||
Call<ServiceRESTResponse<Object>> processPrintReport(
|
||||
@Query("printerName") String printerName,
|
||||
@Query("numberOfCopies") int printQuantity,
|
||||
@Body JasperDTO jasperDTO
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class JasperDTO {
|
||||
|
||||
private String reportName;
|
||||
private List<JasperPairDTO> params = new ArrayList<>();
|
||||
|
||||
public String getReportName() {
|
||||
return reportName;
|
||||
}
|
||||
|
||||
public JasperDTO setReportName(String reportName) {
|
||||
this.reportName = reportName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<JasperPairDTO> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public JasperDTO setParams(List<JasperPairDTO> params) {
|
||||
this.params = params;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
public class JasperPairDTO {
|
||||
|
||||
private String name;
|
||||
private Object value;
|
||||
|
||||
public JasperPairDTO(String name, Object value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public JasperPairDTO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public JasperPairDTO setValue(Object value) {
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ public class DBSettingsModel {
|
||||
private boolean flagSpedizioneEnableManualPick;
|
||||
private boolean flagSpedizioneCanSelectMultipleOrders;
|
||||
private String produzioneDefaultCodAnag;
|
||||
private String reportNameSpedizionChiudiOrdine;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -231,4 +232,13 @@ public class DBSettingsModel {
|
||||
this.produzioneDefaultCodAnag = produzioneDefaultCodAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getReportNameSpedizionChiudiOrdine() {
|
||||
return reportNameSpedizionChiudiOrdine;
|
||||
}
|
||||
|
||||
public DBSettingsModel setReportNameSpedizionChiudiOrdine(String reportNameSpedizionChiudiOrdine) {
|
||||
this.reportNameSpedizionChiudiOrdine = reportNameSpedizionChiudiOrdine;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +250,10 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_CAN_SELECT_MULTIPLE_ORDERS"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("REPORT_PACKING_LIST"));
|
||||
|
||||
|
||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||
@@ -271,6 +275,7 @@ public class SettingsManager {
|
||||
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
||||
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
}, onFailed);
|
||||
|
||||
@@ -246,7 +246,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
}
|
||||
|
||||
accettazioneListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfOrd());
|
||||
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
} else {
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
@@ -263,9 +263,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
}
|
||||
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneListModel);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_picking;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
@@ -50,6 +51,7 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.HistoryMtbAartDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.rest.AccettazionePickingRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
@@ -69,12 +71,14 @@ public class AccettazionePickingViewModel {
|
||||
|
||||
private List<OrdineAccettazioneInevasoDTO> mOrders;
|
||||
private List<SitArtOrdDTO> mSitArts;
|
||||
private MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
||||
private final MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
||||
|
||||
private MtbColt mCurrentMtbColt = null;
|
||||
private GestioneEnum defaultGestioneOfUL = null;
|
||||
private String mDefaultCodMdep = null;
|
||||
|
||||
private final List<HistoryMtbAartDTO> mHistoryUsedAarts = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
public AccettazionePickingViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
@@ -421,7 +425,7 @@ public class AccettazionePickingViewModel {
|
||||
|
||||
|
||||
public void dispatchOrdineRow(final PickingObjectDTO pickingObjectDTO) {
|
||||
if(this.mCurrentMtbColt == null) return;
|
||||
if (this.mCurrentMtbColt == null) return;
|
||||
|
||||
BigDecimal totalQtaOrd = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd();
|
||||
BigDecimal totalNumCnfOrd = pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd();
|
||||
@@ -436,8 +440,8 @@ public class AccettazionePickingViewModel {
|
||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||
});
|
||||
|
||||
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd().subtract(numCnfWithdrawRows.getBigDecimalValue());
|
||||
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd().subtract(qtaColWithdrawRows.getBigDecimalValue());
|
||||
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfDaEvadere().subtract(numCnfWithdrawRows.getBigDecimalValue());
|
||||
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaDaEvadere().subtract(qtaColWithdrawRows.getBigDecimalValue());
|
||||
BigDecimal qtaCnfDaEvadere = qtaCnfOrd;
|
||||
|
||||
numCnfDaEvadere = UtilityBigDecimal.getGreaterBetween(numCnfDaEvadere, BigDecimal.ZERO);
|
||||
@@ -510,12 +514,12 @@ public class AccettazionePickingViewModel {
|
||||
initialQtaTot = totalQtaOrd;
|
||||
}
|
||||
|
||||
if(UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||
if (UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) && UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||
}
|
||||
|
||||
if(dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||
if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||
dataScad = UtilityDate.getDateInstance();
|
||||
Calendar c = new GregorianCalendar();
|
||||
c.setTime(dataScad);
|
||||
@@ -523,6 +527,15 @@ public class AccettazionePickingViewModel {
|
||||
dataScad = c.getTime();
|
||||
}
|
||||
|
||||
if(partitaMag == null && dataScad == null) {
|
||||
HistoryMtbAartDTO historyMtbAartDTO = this.getHistoryItemIfExists(pickingObjectDTO.getMtbAart().getCodMart());
|
||||
|
||||
if(historyMtbAartDTO != null) {
|
||||
partitaMag = historyMtbAartDTO.getPartitaMag();
|
||||
dataScad = historyMtbAartDTO.getDataScad();
|
||||
}
|
||||
}
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
pickingObjectDTO,
|
||||
pickingObjectDTO.getMtbAart(),
|
||||
@@ -573,6 +586,8 @@ public class AccettazionePickingViewModel {
|
||||
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
||||
|
||||
|
||||
this.addHistoryItem(mtbColr);
|
||||
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||
@@ -668,6 +683,8 @@ public class AccettazionePickingViewModel {
|
||||
|
||||
mtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
this.addHistoryItem(mtbColr);
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||
|
||||
mtbColr.setNumCnf(numCnf)
|
||||
@@ -678,7 +695,7 @@ public class AccettazionePickingViewModel {
|
||||
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToUpdate))
|
||||
.findSingle();
|
||||
|
||||
if(pickingObjectDTO.isPresent()) {
|
||||
if (pickingObjectDTO.isPresent()) {
|
||||
pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToUpdate);
|
||||
pickingObjectDTO.get().getWithdrawMtbColrs().add(mtbColr);
|
||||
}
|
||||
@@ -813,6 +830,30 @@ public class AccettazionePickingViewModel {
|
||||
this.sendFilterRemoved();
|
||||
}
|
||||
|
||||
private void addHistoryItem(@NonNull MtbColr mtbColr) {
|
||||
Optional<HistoryMtbAartDTO> optional = Stream.of(this.mHistoryUsedAarts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
|
||||
.findFirst();
|
||||
|
||||
if (optional.isPresent()) {
|
||||
optional.get()
|
||||
.setPartitaMag(mtbColr.getPartitaMag())
|
||||
.setDataScad(mtbColr.getDataScadPartitaD());
|
||||
} else {
|
||||
this.mHistoryUsedAarts.add(new HistoryMtbAartDTO()
|
||||
.setCodMart(mtbColr.getCodMart())
|
||||
.setPartitaMag(mtbColr.getPartitaMag())
|
||||
.setDataScad(mtbColr.getDataScadPartitaD()));
|
||||
}
|
||||
}
|
||||
|
||||
private HistoryMtbAartDTO getHistoryItemIfExists(@NonNull String codMart) {
|
||||
Optional<HistoryMtbAartDTO> optional = Stream.of(this.mHistoryUsedAarts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart))
|
||||
.findFirst();
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_picking.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class HistoryMtbAartDTO {
|
||||
|
||||
private String codMart;
|
||||
private String partitaMag;
|
||||
private Date dataScad;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public HistoryMtbAartDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public HistoryMtbAartDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public HistoryMtbAartDTO setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -3,21 +3,22 @@ package it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel;
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
@@ -42,7 +43,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
private PrinterRESTConsumer.Type mPrinterType;
|
||||
private String mReportName;
|
||||
|
||||
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt, boolean canRecoverUL, PrinterRESTConsumer.Type printerType, String defaultReportName){
|
||||
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt, boolean canRecoverUL, PrinterRESTConsumer.Type printerType, String defaultReportName) {
|
||||
mContext = context;
|
||||
this.mtbColt = new ObservableField<>(mtbColt);
|
||||
this.isFabVisible.set(true);
|
||||
@@ -85,8 +86,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void recoverUL(){
|
||||
public void recoverUL() {
|
||||
Intent data = new Intent();
|
||||
String key = DataCache.addItem(mtbColt.get());
|
||||
data.putExtra("key", key);
|
||||
@@ -102,39 +102,37 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().getUserSession().getDepo().getCodMdep(), mPrinterType, value -> {
|
||||
|
||||
if(value.size() > 0) {
|
||||
if (value.size() > 0) {
|
||||
|
||||
try {
|
||||
ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum(), reportName -> {
|
||||
try {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum());
|
||||
|
||||
reportName = mReportName != null ? mReportName : reportName;
|
||||
reportName = mReportName != null ? mReportName : reportName;
|
||||
|
||||
PrinterRESTConsumer.printColloStatic(value.get(0),
|
||||
mtbColt.get(),
|
||||
1,
|
||||
reportName,
|
||||
() -> {
|
||||
progress.dismiss();
|
||||
PrinterRESTConsumer.printColloStatic(value.get(0),
|
||||
mtbColt.get(),
|
||||
1,
|
||||
reportName,
|
||||
() -> {
|
||||
progress.dismiss();
|
||||
|
||||
Resources res = mContext.getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
||||
}, ex -> UtilityExceptions.defaultException(mContext,ex, progress));
|
||||
Resources res = mContext.getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||
|
||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress)
|
||||
);
|
||||
} catch (Exception ex){
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
}
|
||||
|
||||
} else {
|
||||
progress.dismiss();
|
||||
String errorMessage = "Nessuna stampante configurata";
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(errorMessage), null, null).show();
|
||||
} catch (Exception ex) {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
}
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
});
|
||||
|
||||
} else {
|
||||
progress.dismiss();
|
||||
String errorMessage = "Nessuna stampante configurata";
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(errorMessage), null, null).show();
|
||||
}
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -216,15 +216,14 @@ public class PickingResiViewModel {
|
||||
}
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
private void postCloseOperations(MtbColt mtbColt, Runnable onComplete) {
|
||||
@@ -282,7 +281,6 @@ public class PickingResiViewModel {
|
||||
BigDecimal qtaCnfDoc = withdrawableDtbDocr.getQtaCnf();
|
||||
|
||||
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
withdrawableDtbDocr.getMtbAart(),
|
||||
totalNumCnfDoc,
|
||||
@@ -376,13 +374,13 @@ public class PickingResiViewModel {
|
||||
this.mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||
|
||||
mtbColr
|
||||
.setDataCollo(value.getDataColloS())
|
||||
.setNumCollo(value.getNumCollo())
|
||||
.setGestione(value.getGestione())
|
||||
.setSerCollo(value.getSerCollo())
|
||||
.setRiga(value.getMtbColr().get(0).getRiga())
|
||||
.setUntMis(withdrawableDtbDocr.getMtbAart().getUntMis())
|
||||
.setMtbAart(withdrawableDtbDocr.getMtbAart());
|
||||
.setDataCollo(value.getDataColloS())
|
||||
.setNumCollo(value.getNumCollo())
|
||||
.setGestione(value.getGestione())
|
||||
.setSerCollo(value.getSerCollo())
|
||||
.setRiga(value.getMtbColr().get(0).getRiga())
|
||||
.setUntMis(withdrawableDtbDocr.getMtbAart().getUntMis())
|
||||
.setMtbAart(withdrawableDtbDocr.getMtbAart());
|
||||
|
||||
withdrawableDtbDocr.getWithdrawRows().add(mtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
@@ -37,148 +37,18 @@ public class PickingResiRESTConsumer {
|
||||
for(int i = 0; i < documents.size(); i++) {
|
||||
HashMap<String, Object> filter = new HashMap<>();
|
||||
|
||||
filter.put("dtb_docr.data_doc", documents.get(i).getDataDocD());
|
||||
filter.put("dtb_docr.num_doc", documents.get(i).getNumDoc());
|
||||
filter.put("dtb_docr.ser_doc", documents.get(i).getSerDoc());
|
||||
filter.put("dtb_docr.cod_anag", documents.get(i).getCodAnag());
|
||||
filter.put("dtb_docr.cod_dtip", documents.get(i).getCodDtip());
|
||||
filter.put("data_doc", documents.get(i).getDataDocD());
|
||||
filter.put("num_doc", documents.get(i).getNumDoc());
|
||||
filter.put("ser_doc", documents.get(i).getSerDoc());
|
||||
filter.put("cod_anag", documents.get(i).getCodAnag());
|
||||
filter.put("cod_dtip", documents.get(i).getCodDtip());
|
||||
|
||||
filterCond.add(filter);
|
||||
}
|
||||
|
||||
String sql = "SELECT dtb_docr.[cod_anag]" +
|
||||
" ,dtb_docr.[cod_dtip]" +
|
||||
" ,dtb_docr.[data_doc]" +
|
||||
" ,dtb_docr.[ser_doc]" +
|
||||
" ,dtb_docr.[num_doc]" +
|
||||
" ,dtb_docr.[id_riga]" +
|
||||
" ,dtb_docr.[cod_mart]" +
|
||||
" ,dtb_docr.[descrizione]" +
|
||||
" ,dtb_docr.[unt_doc]" +
|
||||
" ,(dtb_docr.[rap_conv] / dtb_docr.[rap_conv]) as rap_conv" +
|
||||
" ,(dtb_docr.[qta_doc] * dtb_docr.[rap_conv]) - ISNULL(mtb_colr.qta_col, 0) as qta_doc" +
|
||||
" ,dtb_docr.[val_unt]" +
|
||||
" ,dtb_docr.[sconto5]" +
|
||||
" ,dtb_docr.[sconto6]" +
|
||||
" ,dtb_docr.[sconto7]" +
|
||||
" ,dtb_docr.[sconto8]" +
|
||||
" ,dtb_docr.[cod_aliq]" +
|
||||
" ,dtb_docr.[perc_prov]" +
|
||||
" ,dtb_docr.[val_prov]" +
|
||||
" ,dtb_docr.[data_ord]" +
|
||||
" ,dtb_docr.[num_ord]" +
|
||||
" ,dtb_docr.[riga_ord]" +
|
||||
" ,dtb_docr.[importo_riga]" +
|
||||
" ,dtb_docr.[cod_col]" +
|
||||
" ,dtb_docr.[cod_tagl]" +
|
||||
" ,dtb_docr.[cod_jcom]" +
|
||||
" ,dtb_docr.[cod_mdep]" +
|
||||
" ,dtb_docr.[perc_gest]" +
|
||||
" ,dtb_docr.[val_gest]" +
|
||||
" ,dtb_docr.[partita_mag]" +
|
||||
" ,dtb_docr.[val_unt_iva]" +
|
||||
" ,dtb_docr.[qta_cnf]" +
|
||||
" ,dtb_docr.[descrizione_estesa]" +
|
||||
" ,dtb_docr.[costo_unt]" +
|
||||
" ,dtb_docr.[perc_ispe]" +
|
||||
" ,dtb_docr.[val_ispe]" +
|
||||
" ,dtb_docr.[perc_promo]" +
|
||||
" ,dtb_docr.[val_promo]" +
|
||||
" ,dtb_docr.[perc_oneri]" +
|
||||
" ,dtb_docr.[val_oneri]" +
|
||||
" ,dtb_docr.[flag_evaso_forzato]" +
|
||||
" ,dtb_docr.[cod_dtip_comp]" +
|
||||
" ,dtb_docr.[data_doc_comp]" +
|
||||
" ,dtb_docr.[ser_doc_comp]" +
|
||||
" ,dtb_docr.[num_doc_comp]" +
|
||||
" ,dtb_docr.[cod_promo]" +
|
||||
" ,dtb_docr.[perc_prov2]" +
|
||||
" ,dtb_docr.[val_prov2]" +
|
||||
" ,dtb_docr.[cod_art_for]" +
|
||||
" ,dtb_docr.[unt_doc2]" +
|
||||
" ,dtb_docr.[qta_doc2]" +
|
||||
" ,dtb_docr.[unt_doc3]" +
|
||||
" ,dtb_docr.[qta_doc3]" +
|
||||
" ,dtb_docr.[num_cnf]" +
|
||||
" ,dtb_docr.[peso_lordo]" +
|
||||
" ,dtb_docr.[posizione]" +
|
||||
" ,dtb_docr.[cod_anag_comp]" +
|
||||
" ,dtb_docr.[cod_mtip]" +
|
||||
" ,dtb_docr.[matricola]" +
|
||||
" ,dtb_docr.[data_iniz_comp]" +
|
||||
" ,dtb_docr.[data_fine_comp]" +
|
||||
" ,dtb_docr.[cod_kit]" +
|
||||
" ,dtb_docr.[cod_alis]" +
|
||||
" ,dtb_docr.[data_ins_row]" +
|
||||
" ,dtb_docr.[note] " +
|
||||
" ,dtb_doct.[gestione] " +
|
||||
" ,mtb_partita_mag.[data_scad] as data_scad_partita_mag " +
|
||||
"FROM dtb_docr " +
|
||||
"INNER JOIN dtb_doct ON dtb_docr.num_doc = dtb_doct.num_doc AND dtb_docr.data_doc = dtb_doct.data_doc AND dtb_docr.cod_anag = dtb_doct.cod_anag AND dtb_docr.cod_dtip = dtb_doct.cod_dtip AND dtb_docr.ser_doc = dtb_doct.ser_doc " +
|
||||
"INNER JOIN mtb_aart ON dtb_docr.cod_mart = mtb_aart.cod_mart " +
|
||||
"LEFT OUTER JOIN mtb_partita_mag ON dtb_docr.cod_mart = mtb_partita_mag.cod_mart " +
|
||||
" AND dtb_docr.partita_mag = mtb_partita_mag.partita_mag " +
|
||||
"LEFT OUTER JOIN ctb_cont ON mtb_aart.cod_ccon_ricavi = ctb_cont.cod_ccon " +
|
||||
"LEFT OUTER JOIN ctb_grup ON ctb_cont.cod_cgrp = ctb_grup.cod_cgrp " +
|
||||
"LEFT OUTER JOIN (" +
|
||||
" SELECT gestione," +
|
||||
" cod_mart," +
|
||||
" cod_col," +
|
||||
" cod_tagl," +
|
||||
" SUM(qta_col) as qta_col," +
|
||||
" data_ord," +
|
||||
" num_ord," +
|
||||
" riga_ord," +
|
||||
" partita_mag," +
|
||||
" qta_cnf," +
|
||||
" gestione_rif," +
|
||||
" data_collo_rif," +
|
||||
" ser_collo_rif," +
|
||||
" num_collo_rif," +
|
||||
" cod_jcom," +
|
||||
" SUM(num_cnf) as num_cnf," +
|
||||
" cod_anag_doc," +
|
||||
" cod_dtip_doc," +
|
||||
" data_doc," +
|
||||
" ser_doc," +
|
||||
" num_doc," +
|
||||
" id_riga_doc" +
|
||||
" FROM mtb_colr" +
|
||||
" GROUP BY gestione," +
|
||||
" cod_barre," +
|
||||
" cod_mart," +
|
||||
" cod_col," +
|
||||
" cod_tagl," +
|
||||
" data_ord," +
|
||||
" num_ord," +
|
||||
" riga_ord," +
|
||||
" partita_mag," +
|
||||
" qta_cnf," +
|
||||
" gestione_rif," +
|
||||
" data_collo_rif," +
|
||||
" ser_collo_rif," +
|
||||
" num_collo_rif," +
|
||||
" cod_jcom," +
|
||||
" cod_anag_doc," +
|
||||
" cod_dtip_doc," +
|
||||
" data_doc," +
|
||||
" ser_doc," +
|
||||
" num_doc," +
|
||||
" id_riga_doc" +
|
||||
" ) mtb_colr" +
|
||||
" ON " +
|
||||
" dtb_docr.cod_anag = mtb_colr.cod_anag_doc AND " +
|
||||
" dtb_docr.cod_dtip = mtb_colr.cod_dtip_doc AND " +
|
||||
" dtb_docr.ser_doc = mtb_colr.ser_doc AND " +
|
||||
" dtb_docr.data_doc = mtb_colr.data_doc AND " +
|
||||
" dtb_docr.num_doc = mtb_colr.num_doc AND " +
|
||||
" dtb_docr.id_riga = mtb_colr.id_riga_doc " +
|
||||
String sql = "SELECT * FROM dvw_situazione_qta_docs " +
|
||||
"WHERE " +
|
||||
" (ctb_grup.sezione <> 1 OR ctb_grup.sezione IS NULL) AND " +
|
||||
" dtb_docr.[qta_doc] - ISNULL(mtb_colr.qta_col, 0) > 0 AND" +
|
||||
" ( " +
|
||||
UtilityQuery.concatFieldListInWhereCond(filterCond) +
|
||||
" ) " +
|
||||
"ORDER BY cod_mart";
|
||||
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initBarcode() {
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessfull(onScanSuccessful)
|
||||
@@ -97,13 +96,12 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
if(UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)){
|
||||
if (UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaUL(data, progressDialog);
|
||||
}
|
||||
|
||||
@@ -112,10 +110,10 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
private void executeEtichettaUL(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||
ColliMagazzinoRESTConsumer.getBySSCCStatic(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
||||
|
||||
if(mtbColt != null) {
|
||||
if (mtbColt != null) {
|
||||
|
||||
HistoryVersamentoProdULDTO historyVersamentoProdULRestDTO = this.getHistoryElementFromMtbColt(mtbColt);
|
||||
if(historyVersamentoProdULRestDTO != null) {
|
||||
if (historyVersamentoProdULRestDTO != null) {
|
||||
this.dispatchItem(historyVersamentoProdULRestDTO, mtbColt, progressDialog);
|
||||
} else {
|
||||
DialogCommon.showNoULFound(mContext, () -> {
|
||||
@@ -144,9 +142,9 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
x.getDataColloRif().equals(mtbColt.getDataColloS()) &&
|
||||
x.getSerColloRif().equalsIgnoreCase(mtbColt.getSerCollo()) &&
|
||||
x.getGestioneRif().equalsIgnoreCase(mtbColt.getGestione()))
|
||||
.toList();
|
||||
.toList();
|
||||
|
||||
if(filteredItems != null && filteredItems.size() > 0) {
|
||||
if (filteredItems != null && filteredItems.size() > 0) {
|
||||
return filteredItems.get(0);
|
||||
}
|
||||
|
||||
@@ -175,17 +173,14 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
DialogInputQuantity.makeBase(mContext, dto, false, quantity -> {
|
||||
onItemDispatched(item, quantity.qtaTot.getBigDecimal(), sourceMtbColt, dialogProgress);
|
||||
}, () -> {
|
||||
if(dialogProgress != null) dialogProgress.dismiss();
|
||||
if (dialogProgress != null) dialogProgress.dismiss();
|
||||
}).show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void onItemDispatched(HistoryVersamentoProdULDTO item, BigDecimal quantity, MtbColt sourceMtbColt, Dialog progress) {
|
||||
|
||||
if(progress == null) {
|
||||
if (progress == null) {
|
||||
progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
}
|
||||
Dialog finalProgress = progress;
|
||||
@@ -197,7 +192,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
.setGestione(item.getGestione())
|
||||
.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
for(HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
||||
for (HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
||||
BigDecimal qtaCol = quantity.multiply(new BigDecimal(-1).multiply(new BigDecimal(ordine.getPercentageHr()))).divide(new BigDecimal(100), 3, RoundingMode.HALF_EVEN);
|
||||
|
||||
final MtbColr mtbColrScarico = new MtbColr()
|
||||
@@ -220,18 +215,17 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
|
||||
RunnableArgss<MtbColt, Boolean> saveRunnable = (mtbColt, createdLU) -> {
|
||||
|
||||
if(mtbColt != null) {
|
||||
if (mtbColt != null) {
|
||||
|
||||
List<MtbColt> colliToSave = new ArrayList<>();
|
||||
boolean shouldPrint = false;
|
||||
|
||||
if(!Objects.equals(mtbColt.getNumCollo(), item.getNumColloRif()) ||
|
||||
if (!Objects.equals(mtbColt.getNumCollo(), item.getNumColloRif()) ||
|
||||
!Objects.equals(mtbColt.getSerCollo(), item.getSerColloRif()) ||
|
||||
!Objects.equals(mtbColt.getDataColloS(), item.getDataColloRif()) ||
|
||||
!Objects.equals(mtbColt.getGestione(), item.getGestioneRif())) {
|
||||
@@ -267,7 +261,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
if(finalShouldPrint) {
|
||||
if (finalShouldPrint) {
|
||||
printCollo(finalProgress, value.get(0), () -> {
|
||||
this.refreshAdapter();
|
||||
mOnRecuperoCompleted.run();
|
||||
@@ -287,7 +281,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
};
|
||||
|
||||
if(sourceMtbColt != null) saveRunnable.run(sourceMtbColt, false);
|
||||
if (sourceMtbColt != null) saveRunnable.run(sourceMtbColt, false);
|
||||
else DialogScanOrCreateLU.make(mContext, true, false, saveRunnable).show();
|
||||
|
||||
}
|
||||
@@ -329,21 +323,18 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||
|
||||
PrinterRESTConsumer.printColloStatic(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onAbort);
|
||||
PrinterRESTConsumer.printColloStatic(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onAbort);
|
||||
|
||||
}, onAbort);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void refreshAdapter() {
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
@@ -360,5 +351,4 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,8 @@ public class RettificaGiacenzeViewModel {
|
||||
private String mCurrentCodMdep;
|
||||
private boolean mIsCreatedLU;
|
||||
|
||||
private boolean mAnyEditDone = false;
|
||||
|
||||
@Inject
|
||||
public RettificaGiacenzeViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
@@ -350,10 +352,12 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
this.mAnyEditDone = true;
|
||||
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (shouldCloseLU) closeLU(false, null);
|
||||
if (shouldCloseLU) closeLU(true, null);
|
||||
}, this::sendError);
|
||||
} else {
|
||||
mtbColr
|
||||
@@ -380,10 +384,12 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
this.mAnyEditDone = true;
|
||||
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (shouldCloseLU) closeLU(false, null);
|
||||
if (shouldCloseLU) closeLU(true, null);
|
||||
}, this::sendError);
|
||||
}
|
||||
}
|
||||
@@ -417,9 +423,11 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
if(shouldChangePosition) {
|
||||
this.savePosizione(mtbDepoPosizione, () -> {
|
||||
this.mAnyEditDone = false;
|
||||
postSaveBehaviour(onComplete);
|
||||
});
|
||||
} else {
|
||||
this.mAnyEditDone = false;
|
||||
postSaveBehaviour(onComplete);
|
||||
}
|
||||
|
||||
@@ -427,7 +435,7 @@ public class RettificaGiacenzeViewModel {
|
||||
}, this::sendError);
|
||||
};
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(mDefaultCausale) && saveCausale) {
|
||||
if (!UtilityString.isNullOrEmpty(mDefaultCausale) && (saveCausale || mAnyEditDone)) {
|
||||
this.saveCausaleRettificaGiacenze(saveAction);
|
||||
} else {
|
||||
saveAction.run();
|
||||
@@ -564,6 +572,8 @@ public class RettificaGiacenzeViewModel {
|
||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||
this.mCurrentMtbColt.getMtbColr().add(mtbColrToUpdate);
|
||||
|
||||
this.mAnyEditDone = true;
|
||||
|
||||
this.sendOnRowSaved();
|
||||
},
|
||||
this::sendError
|
||||
@@ -602,6 +612,8 @@ public class RettificaGiacenzeViewModel {
|
||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||
this.mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
this.mAnyEditDone = true;
|
||||
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
public BindableBoolean noItemsToPick = new BindableBoolean(false);
|
||||
public BindableBoolean noLUPresent = new BindableBoolean(true);
|
||||
public BindableBoolean bottomSheetEnabled = new BindableBoolean(false);
|
||||
public BindableBoolean closeOrderButtonEnabled = new BindableBoolean(false);
|
||||
|
||||
private boolean mEnableGiacenza;
|
||||
private boolean mFlagShowCodForn;
|
||||
@@ -150,6 +151,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
this.initRecyclerView();
|
||||
|
||||
|
||||
String reportNameSpedizioneChiudiOrdine = SettingsManager.iDB().getReportNameSpedizionChiudiOrdine();
|
||||
closeOrderButtonEnabled.set(!UtilityString.isNullOrEmpty(reportNameSpedizioneChiudiOrdine));
|
||||
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
mEnableGiacenza = !SettingsManager.iDB().isFlagSpedizioneEnableFakeGiacenza();
|
||||
boolean enableCheckPartitaMag = SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV();
|
||||
@@ -157,7 +162,16 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
||||
|
||||
if (mEnableGiacenza) this.openProgress();
|
||||
mViewmodel.init(codMdep, mEnableGiacenza, enableCheckPartitaMag, shouldAskPesoLU, canOverflowOrderQuantity, mSitArtOrd, mTestateOrdini, mColliRegistrati);
|
||||
mViewmodel.init(
|
||||
codMdep,
|
||||
mEnableGiacenza,
|
||||
enableCheckPartitaMag,
|
||||
shouldAskPesoLU,
|
||||
canOverflowOrderQuantity,
|
||||
mSitArtOrd,
|
||||
mTestateOrdini,
|
||||
mColliRegistrati,
|
||||
reportNameSpedizioneChiudiOrdine);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -606,6 +620,12 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
}
|
||||
|
||||
|
||||
public void closeOrder() {
|
||||
this.mBindings.spedizioneFab.close(true);
|
||||
|
||||
this.mViewmodel.closeOrder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
this.openProgress();
|
||||
@@ -620,6 +640,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
public void onLUOpened(MtbColt mtbColt) {
|
||||
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
||||
noLUPresent.set(false);
|
||||
closeOrderButtonEnabled.set(false);
|
||||
|
||||
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
||||
@@ -630,6 +652,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
this.addExtraItemsEnabled.set(false);
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
closeOrderButtonEnabled.set(!UtilityString.isNullOrEmpty(SettingsManager.iDB().getReportNameSpedizionChiudiOrdine()));
|
||||
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -91,6 +92,7 @@ public class SpedizioneViewModel {
|
||||
private boolean mEnableCheckPartitaMag;
|
||||
private boolean mCanOverflowOrderQuantity;
|
||||
private boolean mShouldAskPesoLU;
|
||||
private String mReportNameSpedizioneChiudiOrdine;
|
||||
|
||||
private MtbColt mCurrentMtbColt = null;
|
||||
|
||||
@@ -125,7 +127,8 @@ public class SpedizioneViewModel {
|
||||
boolean canOverflowOrderQuantity,
|
||||
List<SitArtOrdDTO> pickingList,
|
||||
List<OrdineVenditaInevasoDTO> testateOrdini,
|
||||
List<MtbColt> colliRegistrati) {
|
||||
List<MtbColt> colliRegistrati,
|
||||
String reportNameSpedizioneChiudiOrdine) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
this.mDefaultCodMdep = codMdep;
|
||||
@@ -135,6 +138,7 @@ public class SpedizioneViewModel {
|
||||
this.mEnableCheckPartitaMag = enableCheckPartitaMag;
|
||||
this.mCanOverflowOrderQuantity = canOverflowOrderQuantity;
|
||||
this.mShouldAskPesoLU = shouldAskPesoLU;
|
||||
this.mReportNameSpedizioneChiudiOrdine = reportNameSpedizioneChiudiOrdine;
|
||||
|
||||
if (enableGiacenza) {
|
||||
mOrdiniRestConsumerService.getSuggestedPickingList(this.mDefaultCodMdep, pickingList, pickingObjectList -> {
|
||||
@@ -648,7 +652,23 @@ public class SpedizioneViewModel {
|
||||
if (matchedRows == null || matchedRows.size() == 0) {
|
||||
this.sendError(new NoArtsFoundException());
|
||||
} else if (matchedRows.size() == 1) {
|
||||
this.dispatchOrdineRow(matchedRows.get(0), matchedRows.get(0).getRefMtbColt());
|
||||
PickingObjectDTO matchedItem = matchedRows.get(0);
|
||||
|
||||
|
||||
if (matchedItem.getMtbColts() != null && matchedItem.getMtbColts().size() > 1) {
|
||||
|
||||
List<PickingObjectDTO> pickingList = mPickingList.getValue();
|
||||
|
||||
Stream.of(pickingList)
|
||||
.filter(x -> x != matchedItem)
|
||||
.forEach(x -> x.setHidden(true));
|
||||
|
||||
this.sendFilterApplied(null);
|
||||
this.getPickingList().postValue(pickingList);
|
||||
} else {
|
||||
this.dispatchOrdineRow(matchedItem, matchedItem.getRefMtbColt());
|
||||
}
|
||||
|
||||
} else {
|
||||
List<PickingObjectDTO> pickingList = mPickingList.getValue();
|
||||
|
||||
@@ -714,7 +734,7 @@ public class SpedizioneViewModel {
|
||||
|
||||
MtbColr refMtbColr = null;
|
||||
|
||||
if(refMtbColt != null && refMtbColt.getMtbColr().size() > 0) {
|
||||
if (scannedMtbColr != null && refMtbColt != null && refMtbColt.getMtbColr().size() > 0) {
|
||||
Optional<MtbColr> optionalMtbColr = Stream.of(refMtbColt.getMtbColr())
|
||||
.filter(y -> UtilityString.equalsIgnoreCase(y.getCodMart(), scannedMtbColr.getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(y.getCodTagl(), scannedMtbColr.getCodTagl()) &&
|
||||
@@ -722,7 +742,7 @@ public class SpedizioneViewModel {
|
||||
(!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(y.getPartitaMag(), scannedMtbColr.getPartitaMag()) || UtilityString.isNullOrEmpty(scannedMtbColr.getPartitaMag())))
|
||||
.findFirst();
|
||||
|
||||
if(optionalMtbColr.isPresent()) refMtbColr = optionalMtbColr.get();
|
||||
if (optionalMtbColr.isPresent()) refMtbColr = optionalMtbColr.get();
|
||||
}
|
||||
|
||||
MtbColr mtbColrToUse = refMtbColr != null ? refMtbColr : scannedMtbColr;
|
||||
@@ -1201,15 +1221,17 @@ public class SpedizioneViewModel {
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
|
||||
|
||||
mtbColr.setRefMtbColr(new MtbColr()
|
||||
.setCodMart(mtbColr.getCodMart())
|
||||
.setPartitaMag(mtbColr.getPartitaMag())
|
||||
.setCodTagl(mtbColr.getCodTagl())
|
||||
.setCodCol(mtbColr.getCodCol())
|
||||
.setNumCollo(refMtbColt.getNumCollo())
|
||||
.setDataCollo(refMtbColt.getDataColloS())
|
||||
.setSerCollo(refMtbColt.getSerCollo())
|
||||
.setGestione(refMtbColt.getGestione()));
|
||||
if (mEnableGiacenza) {
|
||||
mtbColr.setRefMtbColr(new MtbColr()
|
||||
.setCodMart(mtbColr.getCodMart())
|
||||
.setPartitaMag(mtbColr.getPartitaMag())
|
||||
.setCodTagl(mtbColr.getCodTagl())
|
||||
.setCodCol(mtbColr.getCodCol())
|
||||
.setNumCollo(refMtbColt.getNumCollo())
|
||||
.setDataCollo(refMtbColt.getDataColloS())
|
||||
.setSerCollo(refMtbColt.getSerCollo())
|
||||
.setGestione(refMtbColt.getGestione()));
|
||||
}
|
||||
|
||||
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
@@ -1412,15 +1434,14 @@ public class SpedizioneViewModel {
|
||||
}
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
@@ -1428,6 +1449,8 @@ public class SpedizioneViewModel {
|
||||
this.mCurrentMtbColt = mtbColt;
|
||||
mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(mtbColt, mTestateOrdini);
|
||||
|
||||
this.mCurrentMtbColt.generaFiltroOrdineFromDTO(mDefaultFiltroOrdine);
|
||||
|
||||
this.resetMatchedRows();
|
||||
this.sendLUOpened(this.mCurrentMtbColt);
|
||||
}
|
||||
@@ -1527,6 +1550,56 @@ public class SpedizioneViewModel {
|
||||
this.sendFilterRemoved();
|
||||
}
|
||||
|
||||
public void closeOrder() {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
Runnable onComplete = () -> this.sendOnLoadingEnded();
|
||||
|
||||
this.mPrinterRESTConsumer.getAvailablePrinters(mDefaultCodMdep, PrinterRESTConsumer.Type.PRIMARIA, printerList -> {
|
||||
|
||||
if (printerList == null || printerList.size() == 0) {
|
||||
this.sendError(new NoPrintersFoundException());
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
cyclicPrintPackingList(
|
||||
this.mTestateOrdini.iterator(),
|
||||
printerList.get(0),
|
||||
onComplete,
|
||||
ex -> this.sendLUPrintError(ex, onComplete));
|
||||
|
||||
}, this::sendError);
|
||||
|
||||
}
|
||||
|
||||
private void cyclicPrintPackingList(@NotNull Iterator<OrdineVenditaInevasoDTO> sourceTestateOrdineVenditaIterator, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
if (sourceTestateOrdineVenditaIterator.hasNext()) {
|
||||
singlePrintPackingList(sourceTestateOrdineVenditaIterator.next(), printerName, () -> {
|
||||
cyclicPrintPackingList(sourceTestateOrdineVenditaIterator, printerName, onComplete, onAbort);
|
||||
}, onAbort);
|
||||
} else {
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
private void singlePrintPackingList(OrdineVenditaInevasoDTO ordineVenditaInevasoDTO, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("gestione", ordineVenditaInevasoDTO.getGestione());
|
||||
params.put("num_ord", ordineVenditaInevasoDTO.getNumOrd());
|
||||
params.put("data_ord", UtilityDate.formatDate(ordineVenditaInevasoDTO.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_DASH));
|
||||
|
||||
this.mPrinterRESTConsumer.printReport(
|
||||
printerName,
|
||||
this.mReportNameSpedizioneChiudiOrdine,
|
||||
params,
|
||||
1,
|
||||
onComplete,
|
||||
onFailed);
|
||||
|
||||
}
|
||||
|
||||
public MutableLiveData<List<PickingObjectDTO>> getPickingList() {
|
||||
return mPickingList;
|
||||
}
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetBinding;
|
||||
|
||||
|
||||
public class ArticoliInColloBottomSheetHelper extends BottomSheetBehavior.BottomSheetCallback {
|
||||
|
||||
private AppCompatActivity mActivity;
|
||||
private FragmentArticoliInColloBottomSheetBinding mBinding;
|
||||
|
||||
private BottomSheetBehavior mBottomSheetBehavior;
|
||||
|
||||
|
||||
public ArticoliInColloBottomSheetHelper(AppCompatActivity context, FragmentArticoliInColloBottomSheetBinding binding){
|
||||
mActivity = context;
|
||||
mBinding = binding;
|
||||
|
||||
mBottomSheetBehavior = BottomSheetBehavior.from(mBinding.getRoot());
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
mBottomSheetBehavior.setBottomSheetCallback(this);
|
||||
|
||||
mBinding.appbarBottomSheet.setVisibility(View.INVISIBLE);
|
||||
|
||||
mBinding.toolbarBottomSheet.setNavigationIcon(R.drawable.ic_close_24dp);
|
||||
mBinding.toolbarBottomSheet.setNavigationOnClickListener(view -> {
|
||||
if(mBottomSheetBehavior.getState()==BottomSheetBehavior.STATE_EXPANDED) {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.tapActionLayout.setOnClickListener(v -> {
|
||||
if(mBottomSheetBehavior.getState()==BottomSheetBehavior.STATE_COLLAPSED) {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mBinding.articoliInColloCloseCollo.setText(mActivity.getText(R.string.action_close_ul));
|
||||
updateRigheNumber(0);
|
||||
|
||||
mBinding.articoliInColloSheetButton.setOnClickListener(view -> {
|
||||
if (mBottomSheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED) {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
} else {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void initCollo(MtbColt mtbColt){
|
||||
|
||||
mBinding.articoliInColloTitle.setText(String.format(mActivity.getText(R.string.articoli_in_collo_sheet_title).toString(), mtbColt.getNumCollo()));
|
||||
mBinding.articoliInColloDetailsDate.setText(mtbColt.getDataColloHumanLong());
|
||||
|
||||
|
||||
mBinding.articoliInColloDetailsPosizione.setText(mtbColt.getPosizione() != null ? mtbColt.getPosizione() : "N/A");
|
||||
}
|
||||
|
||||
public void updateRigheNumber(int newRigheNumber){
|
||||
mBinding.articoliInColloSheetButton.setText(newRigheNumber + " " + mActivity.getResources().getQuantityString(R.plurals.articles, newRigheNumber));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
||||
switch (newState) {
|
||||
case BottomSheetBehavior.STATE_HIDDEN:
|
||||
// mRootView.scrollTo(0, 0);
|
||||
break;
|
||||
case BottomSheetBehavior.STATE_EXPANDED:
|
||||
mBinding.appbarBottomSheet.setClickable(true);
|
||||
mBinding.appbarBottomSheet.setFocusable(true);
|
||||
mBinding.tapActionLayout.setClickable(false);
|
||||
mBinding.tapActionLayout.setFocusable(false);
|
||||
break;
|
||||
case BottomSheetBehavior.STATE_COLLAPSED:
|
||||
mBinding.appbarBottomSheet.setVisibility(View.INVISIBLE);
|
||||
mBinding.appbarBottomSheet.setClickable(false);
|
||||
mBinding.appbarBottomSheet.setFocusable(false);
|
||||
mBinding.tapActionLayout.setClickable(true);
|
||||
mBinding.tapActionLayout.setFocusable(true);
|
||||
break;
|
||||
case BottomSheetBehavior.STATE_DRAGGING:
|
||||
mBinding.appbarBottomSheet.setVisibility(View.VISIBLE);
|
||||
// mRootView.scrollTo(0, 0);
|
||||
break;
|
||||
case BottomSheetBehavior.STATE_SETTLING:
|
||||
mBinding.appbarBottomSheet.setVisibility(View.VISIBLE);
|
||||
// mRootView.scrollTo(0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isExpanded() {
|
||||
return mBottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED;
|
||||
}
|
||||
|
||||
public void expand() {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
}
|
||||
|
||||
public void collapse() {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
||||
mBinding.appbarBottomSheet.setAlpha(slideOffset);
|
||||
mBinding.tapActionLayout.setAlpha(1-slideOffset);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.interfaces;
|
||||
|
||||
public interface IOnColloClosedCallback {
|
||||
|
||||
void onColloClosed(Runnable onComplete, boolean shouldPrint);
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.interfaces;
|
||||
|
||||
public interface IOnSimpleListChangedCallback {
|
||||
|
||||
void onChange();
|
||||
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.databinding.ObservableList;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.WeakReferenceOnListChangedCallback;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetMtbcolrItemBinding;
|
||||
|
||||
public class ArticoliInColloBottomSheetMtbColrAdapter extends BaseAdapter {
|
||||
|
||||
|
||||
private final WeakReferenceOnListChangedCallback onListChangedCallback;
|
||||
private Context mContext;
|
||||
private ObservableField<MtbColt> mtbColt;
|
||||
|
||||
|
||||
public ArticoliInColloBottomSheetMtbColrAdapter(Context context, ObservableField<MtbColt> mtbColt) {
|
||||
super();
|
||||
this.mContext = context;
|
||||
this.mtbColt = mtbColt;
|
||||
this.onListChangedCallback = new WeakReferenceOnListChangedCallback(this);
|
||||
|
||||
this.mtbColt.get().getMtbColr().addOnListChangedCallback(onListChangedCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||
|
||||
FragmentArticoliInColloBottomSheetMtbcolrItemBinding binding = DataBindingUtil.inflate(inflater, R.layout.fragment_articoli_in_collo_bottom_sheet__mtbcolr_item, parent, false);
|
||||
|
||||
final MtbColr mtbColr = mtbColt.get().getMtbColr().get(position);
|
||||
binding.setMtbColr(mtbColr);
|
||||
|
||||
//Setting qty with unt_mis
|
||||
if(!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissaBoolean())){
|
||||
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
||||
|
||||
|
||||
if(mtbColr.getMtbAart() != null) {
|
||||
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
||||
}
|
||||
|
||||
binding.qtaTextview.setText(text);
|
||||
} else {
|
||||
binding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
|
||||
binding.executePendingBindings();
|
||||
|
||||
if(position % 2 == 1) binding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
if(mtbColt.get() != null && mtbColt.get().getMtbColr() != null) {
|
||||
|
||||
return mtbColt.get().getMtbColr().size();
|
||||
} else return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,247 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.viewmodel;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.databinding.Observable;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.text.SpannableString;
|
||||
import android.view.View;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetBinding;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.ArticoliInColloBottomSheetHelper;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnColloClosedCallback;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.view.ArticoliInColloBottomSheetMtbColrAdapter;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||
|
||||
public class ArticoliInColloBottomSheetViewModel {
|
||||
|
||||
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||
|
||||
private Context mContext;
|
||||
private ArticoliInColloBottomSheetHelper mArticoliInColloBottomSheetHelper;
|
||||
|
||||
private IOnColloClosedCallback onCloseColloCallback;
|
||||
|
||||
|
||||
private FragmentArticoliInColloBottomSheetBinding mBindings;
|
||||
|
||||
private BottomSheetBehavior mBottomSheetBehavior;
|
||||
|
||||
private RunnableArgs<MtbColr> mOnItemDeletedCallback;
|
||||
private RunnableArgss<MtbColr, MtbColr> mOnItemEditedCallback;
|
||||
|
||||
|
||||
public ArticoliInColloBottomSheetViewModel(AppCompatActivity context, final FragmentArticoliInColloBottomSheetBinding bindings){
|
||||
mContext = context;
|
||||
mBindings = bindings;
|
||||
mArticoliInColloBottomSheetHelper = new ArticoliInColloBottomSheetHelper(context, mBindings);
|
||||
|
||||
mBindings.setViewModel(this);
|
||||
|
||||
mtbColt.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
|
||||
if(mtbColt.get() != null) {
|
||||
|
||||
mBindings.linearListview.setAdapter(new ArticoliInColloBottomSheetMtbColrAdapter(mContext, mtbColt));
|
||||
|
||||
mBindings.linearListview.setOnItemClickListener((parent, view, position, id) -> {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
|
||||
onItemClicked.run(position);
|
||||
});
|
||||
|
||||
mArticoliInColloBottomSheetHelper.updateRigheNumber(mtbColt.get().getMtbColr().size());
|
||||
mArticoliInColloBottomSheetHelper.initCollo(mtbColt.get());
|
||||
|
||||
mtbColt.get().getMtbColr().addOnListChangedCallback(new SimpleListChangedCallback(() -> {
|
||||
mArticoliInColloBottomSheetHelper.updateRigheNumber(mtbColt.get().getMtbColr().size());
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
initBottomSheetActions();
|
||||
}
|
||||
|
||||
public void setOnItemEditedCallback(RunnableArgss<MtbColr, MtbColr> onItemEditedCallback) {
|
||||
this.mOnItemEditedCallback = onItemEditedCallback;
|
||||
}
|
||||
|
||||
public void setOnItemDeletedCallback(RunnableArgs<MtbColr> onItemDeletedCallback) {
|
||||
this.mOnItemDeletedCallback = onItemDeletedCallback;
|
||||
}
|
||||
|
||||
private void initBottomSheetActions() {
|
||||
mBindings.bg.setOnClickListener(v -> mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED));
|
||||
|
||||
mBottomSheetBehavior = BottomSheetBehavior.from(mBindings.bottomSheetActions);
|
||||
|
||||
mBottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
|
||||
@Override
|
||||
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
||||
if (newState == BottomSheetBehavior.STATE_COLLAPSED)
|
||||
mBindings.bg.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
||||
mBindings.bg.setVisibility(View.VISIBLE);
|
||||
mBindings.bg.setAlpha(slideOffset);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setOnCloseColloCallbackListener(final IOnColloClosedCallback onCloseColloCallback){
|
||||
this.onCloseColloCallback = onCloseColloCallback;
|
||||
}
|
||||
|
||||
|
||||
public void closeCurrentUL(){
|
||||
closeCurrentUL(null);
|
||||
}
|
||||
|
||||
public void closeCurrentUL(Runnable onComplete){
|
||||
if(onCloseColloCallback != null) onCloseColloCallback.onColloClosed(onComplete, true);
|
||||
}
|
||||
|
||||
public boolean isExpanded() {
|
||||
return mArticoliInColloBottomSheetHelper.isExpanded();
|
||||
}
|
||||
|
||||
public void expand() {
|
||||
mArticoliInColloBottomSheetHelper.expand();
|
||||
}
|
||||
|
||||
public void collapse() {
|
||||
mArticoliInColloBottomSheetHelper.collapse();
|
||||
}
|
||||
|
||||
|
||||
private RunnableArgs<Integer> onItemClicked = (position) -> {
|
||||
|
||||
MtbColr clickedItem = mtbColt.get().getMtbColr().get(position);
|
||||
|
||||
mBindings.bottomSheetActionsTitle.setText(clickedItem.getDescrizione());
|
||||
mBindings.bottomSheetActionsSubtitle.setText(clickedItem.getCodMart());
|
||||
|
||||
|
||||
//Setting qty with unt_mis
|
||||
if(clickedItem.getMtbAart() != null) {
|
||||
if (clickedItem.getMtbAart().isFlagQtaCnfFissaBoolean()) {
|
||||
mBindings.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getQtaCol()) + (!UtilityString.isNullOrEmpty(clickedItem.getMtbAart().getUntMis()) ? ("" + clickedItem.getMtbAart().getUntMis()) : ""));
|
||||
} else {
|
||||
mBindings.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getNumCnf()) + " " + mContext.getString(R.string.unt_mis_col));
|
||||
}
|
||||
} else {
|
||||
mBindings.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getQtaCol()));
|
||||
}
|
||||
|
||||
mBindings.bottomSheetActionsEditBtn.setOnClickListener(v -> onItemEdit(position));
|
||||
|
||||
mBindings.bottomSheetActionsDeleteBtn.setOnClickListener(v -> onItemDelete(position));
|
||||
};
|
||||
|
||||
private void onItemEdit(int position) {
|
||||
|
||||
MtbColr itemToEdit = mtbColt.get().getMtbColr().get(position);
|
||||
MtbColr cloneItemToEdit = (MtbColr) itemToEdit.clone();
|
||||
|
||||
MtbColr originalItem = (MtbColr) itemToEdit.clone();
|
||||
|
||||
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
|
||||
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
||||
.setBatchLot(itemToEdit.getPartitaMag())
|
||||
.setQtaDaEvadere(null)
|
||||
.setQtaOrd(null)
|
||||
.setMtbAart(itemToEdit.getMtbAart())
|
||||
.setCanPartitaMagBeChanged(false)
|
||||
.setQtaTot(itemToEdit.getQtaCol())
|
||||
.setMaxQta(itemToEdit.getQtaCol());
|
||||
|
||||
DialogInputQuantity.makeBase(mContext, dto, false, quantityDTO -> {
|
||||
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
|
||||
cloneItemToEdit.setQtaCol(quantityDTO.qtaTot.getBigDecimal());
|
||||
cloneItemToEdit.setNumCnf(quantityDTO.numCnf.getBigDecimal());
|
||||
|
||||
ColliMagazzinoRESTConsumer.updateRigaStatic(cloneItemToEdit, () ->{
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
|
||||
itemToEdit.setQtaCol(quantityDTO.qtaTot.getBigDecimal());
|
||||
itemToEdit.setNumCnf(quantityDTO.numCnf.getBigDecimal());
|
||||
|
||||
progress.dismiss();
|
||||
mtbColt.get().getMtbColr().set(position, itemToEdit);
|
||||
|
||||
if(mOnItemEditedCallback != null) mOnItemEditedCallback.run(originalItem, itemToEdit);
|
||||
},
|
||||
ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||
|
||||
}, null).show();
|
||||
}
|
||||
|
||||
private void onItemDelete(int position) {
|
||||
|
||||
|
||||
String text = mContext.getResources().getString(R.string.alert_delete_mtb_colr);
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(text), null, () -> {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone();
|
||||
mtbColtClone.setMtbColr(new ObservableArrayList<>());
|
||||
mtbColtClone.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
|
||||
MtbColr itemToDelete = (MtbColr) mtbColt.get().getMtbColr().get(position).clone();
|
||||
itemToDelete.setQtaCol(itemToDelete.getQtaCol().multiply(new BigDecimal(-1)));
|
||||
itemToDelete.setNumCnf(itemToDelete.getNumCnf().multiply(new BigDecimal(-1)));
|
||||
itemToDelete.setRiga(null);
|
||||
itemToDelete.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
mtbColtClone.getMtbColr().add(itemToDelete);
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtClone, (newMtbColt) -> {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
|
||||
MtbColr deletedItem = mtbColt.get().getMtbColr().get(position);
|
||||
mtbColt.get().getMtbColr().remove(deletedItem);
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
if(this.mOnItemDeletedCallback != null) this.mOnItemDeletedCallback.run(deletedItem);
|
||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||
}, null).show();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.viewmodel;
|
||||
|
||||
import androidx.databinding.ObservableList;
|
||||
|
||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnSimpleListChangedCallback;
|
||||
|
||||
public class SimpleListChangedCallback extends ObservableList.OnListChangedCallback {
|
||||
|
||||
private IOnSimpleListChangedCallback mOnSimpleListChangedCallback;
|
||||
|
||||
public SimpleListChangedCallback(IOnSimpleListChangedCallback onSimpleListChangedCallback) {
|
||||
mOnSimpleListChangedCallback = onSimpleListChangedCallback;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChanged(ObservableList sender) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeChanged(ObservableList sender, int positionStart, int itemCount) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeInserted(ObservableList sender, int positionStart, int itemCount) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeMoved(ObservableList sender, int fromPosition, int toPosition, int itemCount) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeRemoved(ObservableList sender, int positionStart, int itemCount) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="@color/colorPrimary">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,3h-4.18C14.4,1.84 13.3,1 12,1c-1.3,0 -2.4,0.84 -2.82,2L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM12,3c0.55,0 1,0.45 1,1s-0.45,1 -1,1 -1,-0.45 -1,-1 0.45,-1 1,-1zM10,17l-4,-4 1.41,-1.41L10,14.17l6.59,-6.59L18,9l-8,8z"/>
|
||||
</vector>
|
||||
@@ -265,7 +265,17 @@
|
||||
app:visibility="@{spedizioneView.noLUPresent}">
|
||||
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:id="@+id/spedizione_fab_item1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_baseline_assignment_turned_in_24"
|
||||
app:visibility="@{spedizioneView.closeOrderButtonEnabled}"
|
||||
app:fab_colorNormal="@color/white"
|
||||
app:fab_colorPressed="@color/white_pressed"
|
||||
app:fab_colorRipple="#66FFFFFF"
|
||||
app:fab_label="@string/action_close_order"
|
||||
app:onClick="@{() -> spedizioneView.closeOrder()}" />
|
||||
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_box"
|
||||
@@ -276,7 +286,6 @@
|
||||
app:onClick="@{() -> spedizioneView.showCreatedUL()}" />
|
||||
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:id="@+id/spedizione_fab_item2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_add_24dp"
|
||||
|
||||
@@ -1,540 +0,0 @@
|
||||
<?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>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="it.integry.integrywmsnative.view.bottomsheet.viewmodel.ArticoliInColloBottomSheetViewModel"
|
||||
/>
|
||||
<import type="android.view.View" />
|
||||
</data>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/bottom_sheet1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/white"
|
||||
app:behavior_peekHeight="?attr/actionBarSize"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
|
||||
app:behavior_hideable="false">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/tap_action_layout"
|
||||
android:padding="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:background="@android:color/white">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/articoli_in_collo_sheet_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_box"
|
||||
tools:text="2 REFERENCES"
|
||||
android:textStyle="bold"
|
||||
android:drawablePadding="12dp"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:elevation="0dp"
|
||||
android:textAllCaps="true"
|
||||
android:textSize="16sp"
|
||||
style="@style/AppTheme.NewMaterial.Text"/>
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/articoli_in_collo_close_collo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.DangerOutline"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/action_close_ul"
|
||||
android:onClick="@{() -> viewModel.closeCurrentUL()}"
|
||||
app:strokeColor="@color/red_600"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="4dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/details_text"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:textAllCaps="true"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<LinearLayout
|
||||
android:padding="15dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/date_text"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline1"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/articoli_in_collo_details_date"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/articoli_in_collo_details_posizione"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/position_text"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline2"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{viewModel.mtbColt.posizione}"
|
||||
style="@style/AppTheme.NewMaterial"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/prepared_by_text"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline3"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{viewModel.mtbColt.preparatoDa}"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/customer"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline4"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{viewModel.mtbColt.ragSocCliente}"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="4dp"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/already_read_articles"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:textAllCaps="true"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="14dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:visibility="@{viewModel.mtbColt == null || viewModel.mtbColt.mtbColr.size() == 0 ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:tint="@color/empty_view_gray"
|
||||
android:src="@drawable/ic_info_78dp"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/empty_rows_in_mtbcolt"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:textColor="@color/empty_view_gray"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.linearlistview.LinearListView
|
||||
android:id="@+id/linear_listview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical"
|
||||
app:dividerThickness="0.5dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar_bottom_sheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:alpha="0">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar_bottom_sheet"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:layout_width="match_parent"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="@android:color/white"
|
||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/articoli_in_collo_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="center"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Title"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle.DarkActionBar"
|
||||
tools:text="Num UL"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:visibility="gone"
|
||||
android:id="@+id/bg"
|
||||
android:background="#99000000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_sheet_actions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#fff"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="160dp"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_sheet_actions_quantity"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Descrizione articolo"
|
||||
android:textColor="#444"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:textStyle="bold"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="ABF52IL"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_actions_quantity"
|
||||
android:layout_width="wrap_content"
|
||||
android:gravity="end"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
tools:text="250 PZ"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_action"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.50" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_action"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:gravity="center">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/bottom_sheet_actions_edit_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@android:color/white"
|
||||
android:scaleX="1.5"
|
||||
android:scaleY="1.5"
|
||||
android:src="@drawable/ic_edit_24dp"
|
||||
android:tint="@color/green_600" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:text="@string/edit"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/guideline_action"
|
||||
android:gravity="center">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/bottom_sheet_actions_delete_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@android:color/white"
|
||||
android:scaleX="1.5"
|
||||
android:scaleY="1.5"
|
||||
android:src="@drawable/ic_delete_24dp"
|
||||
android:tint="@color/red_600" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:text="@string/delete"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
@@ -1,120 +0,0 @@
|
||||
<?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="android.view.View" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
<import type="it.integry.integrywmsnative.core.settings.SettingsManager" />
|
||||
<variable
|
||||
name="mtbColr"
|
||||
type="it.integry.integrywmsnative.core.model.MtbColr"/>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/qta_box"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{mtbColr.codMart}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="COD MART" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityNumber.decimalToString(mtbColr.qtaCol) + mtbColr.mtbAart.untMis}"
|
||||
android:visibility="@{SettingsManager.iDB().isFlagForceAllToColli() || (mtbColr.mtbAart != null && !mtbColr.mtbAart.flagQtaCnfFissaBoolean) ? View.VISIBLE : View.GONE}"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:background="@drawable/badge2_round_corner"
|
||||
android:textColor="@android:color/white"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="PESO KG" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@{mtbColr.getDescrizione()}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="Descrizione lunga articolo" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{`Lotto: ` + mtbColr.getPartitaMag()}"
|
||||
android:textSize="14sp"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColr.getPartitaMag()) ? View.INVISIBLE : View.VISIBLE}"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="Lotto: ABCDE" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/qta_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/qta_textview"
|
||||
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:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
android:textAllCaps="true"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="280.45\nCONF" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -317,7 +317,7 @@
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:onClick="@{() -> viewmodel.closeLU(false)}"
|
||||
android:onClick="@{() -> viewmodel.closeLU(true)}"
|
||||
android:tint="@android:color/white"
|
||||
app:visibility="@{view.thereIsAnOpenedUL}"
|
||||
app:srcCompat="@drawable/ic_check_black_24dp" />
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<string name="action_insert_quantity">Inserisci quantità</string>
|
||||
<string name="action_insert_weight">Inserisci peso</string>
|
||||
<string name="dialog_input_peso_lu_description">Inserisci le informazioni del TIPO UL e il peso NETTO e LORDO</string>
|
||||
<string name="action_close_order">Chiudi ordine</string>
|
||||
<string name="action_show_created_ul">Mostra UL già create</string>
|
||||
<string name="action_recover_ul">Recupera UL</string>
|
||||
<string name="action_print_ul">Stampa UL</string>
|
||||
@@ -257,6 +258,7 @@
|
||||
<string name="ultime_arrivi_fornitore_title">Ultimi arrivi</string>
|
||||
|
||||
<string name="exception_printer_not_found">Stampante non trovata</string>
|
||||
<string name="exception_no_printer_found">Nessuna stampante trovata</string>
|
||||
|
||||
<string name="action_select_all">Seleziona tutto</string>
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
<string name="action_create_ul">Create new LU</string>
|
||||
<string name="action_insert_quantity">Insert quantity</string>
|
||||
<string name="action_insert_weight">Insert weight</string>
|
||||
<string name="action_close_order">Close order</string>
|
||||
<string name="action_show_created_ul">Show already created LU</string>
|
||||
<string name="dialog_input_peso_lu_description">Insert info about LU TYPE and NET / GROSS weight</string>
|
||||
<string name="lu_info">LU\'s info</string>
|
||||
@@ -262,6 +263,7 @@
|
||||
<string name="ultime_arrivi_fornitore_title">Latest arrivals</string>
|
||||
|
||||
<string name="exception_printer_not_found">Printer not found</string>
|
||||
<string name="exception_no_printer_found">No printer found</string>
|
||||
|
||||
<string name="action_select_all">Select all</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user