Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
c5eec26f8d
@ -174,7 +174,8 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
BottomSheetMtbColrEditModalModule.class,
|
||||
DialogChooseArtsFromMtbAartListModule.class,
|
||||
MainSettingsModule.class,
|
||||
DialogInfoSituazioneArticoloModule.class
|
||||
DialogInfoSituazioneArticoloModule.class,
|
||||
DialogSelectDocRowsModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@ -258,8 +259,6 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogSelectDocInfoComponent.Factory dialogSelectDocInfoNewViewComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsComponent();
|
||||
|
||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||
|
||||
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||
@ -294,6 +293,8 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogInfoSituazioneArticoloComponent.Factory dialogInfoSituazioneArticoloComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsNewComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class NoResultFromCodMartException extends Exception {
|
||||
|
||||
public NoResultFromCodMartException() {
|
||||
super(UtilityResources.getString(R.string.no_result_from_cod_mart));
|
||||
}
|
||||
|
||||
public NoResultFromCodMartException(String codMart) {
|
||||
super(UtilityResources.getString(R.string.no_result_from_cod_mart) + " (" + codMart + ")");
|
||||
}
|
||||
}
|
||||
@ -68,28 +68,6 @@ public class MtbColt extends EntityBase {
|
||||
private Boolean disablePrint;
|
||||
private String ragSocCliente;
|
||||
|
||||
public void generaFiltroOrdine() throws Exception {
|
||||
|
||||
if (this.gestione == null) {
|
||||
throw new Exception("Impossibile creare il filtro dell'ordine se la gestione non è valorizzata");
|
||||
}
|
||||
|
||||
if (this.dataOrd == null) {
|
||||
throw new Exception("Impossibile creare il filtro dell'ordine se la data dell'ordine non è valorizzata");
|
||||
}
|
||||
|
||||
if (this.numOrd == null) {
|
||||
throw new Exception("Impossibile creare il filtro dell'ordine se il numero dell'ordine non è valorizzato");
|
||||
}
|
||||
|
||||
|
||||
Date dateOrd = UtilityDate.recognizeDate(this.dataOrd);
|
||||
String dateYMD = UtilityDate.formatDate(dateOrd, UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH);
|
||||
|
||||
this.filtroOrdini = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ROOT><FILTER><DTB_ORDT><GESTIONE type=\"V\">" + this.gestione + "</GESTIONE><DATA_ORD type=\"D\">" + dateYMD + "</DATA_ORD><NUM_ORD type=\"N\">" + this.numOrd + "</NUM_ORD></DTB_ORDT></FILTER></ROOT>";
|
||||
}
|
||||
|
||||
|
||||
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
||||
|
||||
public ObservableArrayList<MtbColr> getMtbColr() {
|
||||
|
||||
@ -24,6 +24,7 @@ import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityFirebase;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
|
||||
@Singleton
|
||||
public class SettingsManager {
|
||||
@ -108,6 +109,7 @@ public class SettingsManager {
|
||||
};
|
||||
|
||||
RunnableArgs<Exception> tmpOnFailed = ex -> {
|
||||
UtilityLogger.error(ex);
|
||||
perfTrace.putAttribute("failed", "true");
|
||||
if (!(ex instanceof SocketTimeoutException)) onFailed.run(ex);
|
||||
else
|
||||
@ -433,6 +435,12 @@ public class SettingsManager {
|
||||
} else if (clazz == Integer.class && value.getValue() != null) {
|
||||
return clazz.cast(Integer.parseInt(value.getValue()));
|
||||
}
|
||||
} else {
|
||||
if (clazz == Boolean.class) {
|
||||
return clazz.cast(Boolean.FALSE);
|
||||
} else if (clazz == Integer.class) {
|
||||
return clazz.cast(0);
|
||||
}
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
|
||||
@ -36,6 +36,10 @@ public class UtilityBarcode {
|
||||
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.EAN128;
|
||||
}
|
||||
|
||||
public static boolean isCode128(BarcodeScanDTO barcodeScanDTO) {
|
||||
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.CODE128;
|
||||
}
|
||||
|
||||
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
|
||||
return isEtichettaPosizione(barcodeScanDTO, true);
|
||||
}
|
||||
|
||||
@ -389,7 +389,7 @@ public class AccettazionePickingViewModel {
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if (codAnags != null && codAnags.size() == 1) {
|
||||
if (codAnags.size() == 1) {
|
||||
mtbColt.setCodAnag(codAnags.get(0));
|
||||
}
|
||||
|
||||
@ -399,7 +399,7 @@ public class AccettazionePickingViewModel {
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if (rifOrds != null && rifOrds.size() == 1) {
|
||||
if (rifOrds.size() == 1) {
|
||||
mtbColt.setRifOrd(rifOrds.get(0));
|
||||
}
|
||||
|
||||
@ -409,16 +409,9 @@ public class AccettazionePickingViewModel {
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if (numDataOrds != null && numDataOrds.size() == 1) {
|
||||
if (numDataOrds.size() == 1) {
|
||||
mtbColt.setNumOrd(mOrders.get(0).getNumero());
|
||||
mtbColt.setDataOrd(mOrders.get(0).getData());
|
||||
|
||||
try {
|
||||
mtbColt.generaFiltroOrdine();
|
||||
} catch (Exception ex) {
|
||||
this.sendError(ex);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, savedMtbColt -> {
|
||||
|
||||
@ -1,85 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
|
||||
public class DialogChooseRowFromListaDocRowsListModel {
|
||||
|
||||
private String codMart;
|
||||
private String descrizione;
|
||||
private String qtaOrdReadable;
|
||||
private String barcode;
|
||||
private boolean isNew;
|
||||
private SqlMtbColr originalModel;
|
||||
private BindableBoolean checked = new BindableBoolean(false);
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel() {
|
||||
}
|
||||
|
||||
public BindableBoolean getChecked() {
|
||||
return checked;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setChecked(BindableBoolean checked) {
|
||||
this.checked = checked;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void toggleCheck() {
|
||||
this.checked.set(!this.checked.get());
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getQtaOrdReadable() {
|
||||
return qtaOrdReadable;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setQtaOrdReadable(String qtaOrdReadable) {
|
||||
this.qtaOrdReadable = qtaOrdReadable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNew() {
|
||||
return isNew;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setNew(boolean aNew) {
|
||||
isNew = aNew;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SqlMtbColr getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setOriginalModel(SqlMtbColr originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -41,6 +41,7 @@ import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContabDocInterniEditBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipoDocDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsItemListModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
||||
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
||||
@ -184,7 +185,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
"Ricerca articolo",
|
||||
null,
|
||||
"Cod articolo / Barcode",
|
||||
barcodeProd -> this.viewModel.loadArticolo(barcodeProd, null), BarcodeManager::enable).show();
|
||||
barcodeProd -> this.viewModel.loadArticoloByCodMart(barcodeProd), BarcodeManager::enable).show();
|
||||
}
|
||||
|
||||
|
||||
@ -320,13 +321,22 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
|
||||
@Override
|
||||
public void onMultipleRowsFound(List<SqlMtbColr> rows, DocumentoArtDTO articolo) {
|
||||
DialogSelectDocRowsView.newInstance(rows, (row) -> {
|
||||
this.onLoadingEnded();
|
||||
if (row != null) {
|
||||
this.viewModel.dispatchRowEdit(row, articolo.isFlagTracciabilita(), articolo.isUntMisDigitale());
|
||||
}
|
||||
}
|
||||
).show(this.getSupportFragmentManager(), "dialogSelectDocRows");
|
||||
List<DialogSelectDocRowsItemListModel<Object>> dataset =
|
||||
Stream.of(rows)
|
||||
.map(x -> new DialogSelectDocRowsItemListModel<>()
|
||||
.setCodMart(x.getCodMart())
|
||||
.setBarcode(x.getCodBarre())
|
||||
.setOriginalModel(x)
|
||||
.setNew(x.getId() < 1)
|
||||
.setDescrizione(x.getDescrizione())
|
||||
.setQtaOrd(BigDecimal.valueOf(x.getQtaCol()))
|
||||
.setUntMisOrd(x.getUntMis()))
|
||||
.toList();
|
||||
|
||||
DialogSelectDocRowsView.newInstance(dataset, data -> {
|
||||
this.viewModel.dispatchRowEdit((SqlMtbColr) data.getOriginalModel(), articolo.isFlagTracciabilita(), articolo.isUntMisDigitale());
|
||||
}, () -> {})
|
||||
.show(this.getSupportFragmentManager(), "dialogSelectDocRowsNew");
|
||||
}
|
||||
|
||||
private MtbColr sqlToEntity(SqlMtbColr sqlMtbColr) {
|
||||
@ -358,7 +368,6 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void showInfoArtDialog() {
|
||||
var listaMtbAart = Stream.of(this.viewModel.getProductsList())
|
||||
.map(x -> new MtbAart()
|
||||
|
||||
@ -4,7 +4,6 @@ import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
@ -21,6 +20,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromCodMartException;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
@ -129,16 +129,28 @@ public class DocInterniEditFormViewModel {
|
||||
this.listener.onDocumentHoldRequest();
|
||||
}
|
||||
|
||||
public void loadArticolo(String barcodeProd, Ean128Model ean128Model) {
|
||||
public void loadArticoloByCodMart(String codMart) {
|
||||
var matchedArt = Stream.of(productsList)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
|
||||
if (matchedArt == null) {
|
||||
this.sendError(new NoResultFromCodMartException(codMart));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
loadArticolo(matchedArt, null);
|
||||
}
|
||||
|
||||
public void loadArticoloByBarcode(String barcodeProd, Ean128Model ean128Model) {
|
||||
DocumentoArtDTO matchedArt;
|
||||
String usedBarcode = null;
|
||||
|
||||
String leftBarcode = StringUtils.leftPad(barcodeProd, 13, '0');
|
||||
|
||||
matchedArt = Stream.of(productsList)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(barcodeProd) ||
|
||||
leftBarcode.equalsIgnoreCase(x.getCodMart()) ||
|
||||
x.getBarcode().contains(barcodeProd))
|
||||
.filter(x -> x.getBarcode().contains(barcodeProd))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
@ -151,15 +163,17 @@ public class DocInterniEditFormViewModel {
|
||||
return;
|
||||
}
|
||||
|
||||
List<SqlMtbColr> rows = this.getRowsForArticolo(matchedArt, usedBarcode);
|
||||
loadArticolo(matchedArt, usedBarcode);
|
||||
}
|
||||
|
||||
private void loadArticolo(DocumentoArtDTO documentoArtDTO, String usedBarcode) {
|
||||
List<SqlMtbColr> rows = this.getRowsForArticolo(documentoArtDTO, usedBarcode);
|
||||
|
||||
if (rows.size() > 1) {
|
||||
this.listener.onMultipleRowsFound(rows, matchedArt);
|
||||
this.listener.onMultipleRowsFound(rows, documentoArtDTO);
|
||||
} else {
|
||||
this.dispatchRowEdit(rows.get(0), matchedArt.isFlagTracciabilita(), matchedArt.isUntMisDigitale());
|
||||
this.dispatchRowEdit(rows.get(0), documentoArtDTO.isFlagTracciabilita(), documentoArtDTO.isUntMisDigitale());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private List<SqlMtbColr> getRowsForArticolo(DocumentoArtDTO articolo, String barcode) {
|
||||
@ -298,12 +312,15 @@ public class DocInterniEditFormViewModel {
|
||||
}
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO) {
|
||||
if (UtilityBarcode.isEanPeso(barcodeScanDTO)) {
|
||||
if(UtilityBarcode.isCode128(barcodeScanDTO)) {
|
||||
this.loadArticoloByCodMart(barcodeScanDTO.getStringValue());
|
||||
|
||||
} else if (UtilityBarcode.isEanPeso(barcodeScanDTO)) {
|
||||
//Cerco tramite etichetta ean peso
|
||||
this.executeEtichettaEanPeso(barcodeScanDTO);
|
||||
|
||||
} else {
|
||||
this.loadArticolo(barcodeScanDTO.getStringValue(), null);
|
||||
this.loadArticoloByBarcode(barcodeScanDTO.getStringValue(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,7 +328,7 @@ public class DocInterniEditFormViewModel {
|
||||
private void executeEtichettaEanPeso(BarcodeScanDTO barcodeScanDTO) {
|
||||
try {
|
||||
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(barcodeScanDTO.getStringValue());
|
||||
this.loadArticolo(ean13PesoModel.getPrecode(), ean13PesoModel.toEan128());
|
||||
this.loadArticoloByBarcode(ean13PesoModel.getPrecode(), ean13PesoModel.toEan128());
|
||||
} catch (Exception ex) {
|
||||
this.sendError(ex);
|
||||
}
|
||||
|
||||
@ -10,7 +10,5 @@ public interface DialogSelectDocRowsComponent {
|
||||
DialogSelectDocRowsComponent create();
|
||||
}
|
||||
|
||||
|
||||
void inject(DialogSelectDocRowsView dialogSelectDocInfoView);
|
||||
|
||||
void inject(DialogSelectDocRowsView dialogSelectDocRowsView);
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
|
||||
public class DialogSelectDocRowsItemListModel<T> {
|
||||
|
||||
private String codMart;
|
||||
private String descrizione;
|
||||
private BigDecimal qtaOrd;
|
||||
private String untMisOrd;
|
||||
private String barcode;
|
||||
private boolean isNew;
|
||||
private T originalModel;
|
||||
private BindableBoolean checked = new BindableBoolean(false);
|
||||
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setQtaOrd(BigDecimal qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMisOrd() {
|
||||
return untMisOrd;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setUntMisOrd(String untMisOrd) {
|
||||
this.untMisOrd = untMisOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNew() {
|
||||
return isNew;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setNew(boolean aNew) {
|
||||
isNew = aNew;
|
||||
return this;
|
||||
}
|
||||
|
||||
public T getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setOriginalModel(T originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BindableBoolean getChecked() {
|
||||
return checked;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setChecked(BindableBoolean checked) {
|
||||
this.checked = checked;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,14 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = DialogSelectDocRowsComponent.class)
|
||||
public class DialogSelectDocRowsModule {
|
||||
|
||||
@Provides
|
||||
DialogSelectDocRowsViewModel providesDialogSelectDocRowsNewViewModel() {
|
||||
return new DialogSelectDocRowsViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,143 +1,131 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
import com.ravikoradiya.liveadapter.Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.databinding.DialogChooseRowFromListaDocRowsLayoutBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DialogChooseRowFromListaDocRowsListModel;
|
||||
import kotlin.Unit;
|
||||
import it.integry.integrywmsnative.databinding.DialogSelectDocRowsBinding;
|
||||
import it.integry.integrywmsnative.databinding.DialogSelectDocRowsItemModelBinding;
|
||||
|
||||
/** @noinspection rawtypes*/
|
||||
public class DialogSelectDocRowsView extends BaseDialogFragment {
|
||||
|
||||
private final RunnableArgs<SqlMtbColr> onRowSelected;
|
||||
private final List<SqlMtbColr> listArts;
|
||||
private final MutableLiveData<List<DialogChooseRowFromListaDocRowsListModel>> listModels = new MutableLiveData<>();
|
||||
private DialogChooseRowFromListaDocRowsLayoutBinding binding;
|
||||
public MutableLiveData<SqlMtbColr> selectedRow = new MutableLiveData<>();
|
||||
|
||||
public static DialogSelectDocRowsView newInstance(
|
||||
List<SqlMtbColr> listArts,
|
||||
RunnableArgs<SqlMtbColr> onDismiss
|
||||
) {
|
||||
return new DialogSelectDocRowsView(listArts, onDismiss);
|
||||
@Inject
|
||||
DialogSelectDocRowsViewModel mViewModel;
|
||||
|
||||
private DialogSelectDocRowsBinding mBindings;
|
||||
private Context mContext;
|
||||
|
||||
private final List<DialogSelectDocRowsItemListModel<Object>> listArts;
|
||||
private final RunnableArgs<DialogSelectDocRowsItemListModel> onConfirm;
|
||||
private final Runnable onAbort;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static DialogSelectDocRowsView newInstance(List<DialogSelectDocRowsItemListModel<Object>> listArts,
|
||||
RunnableArgs<DialogSelectDocRowsItemListModel> onConfirm,
|
||||
Runnable onAbort) {
|
||||
return new DialogSelectDocRowsView(listArts, onConfirm, onAbort);
|
||||
}
|
||||
|
||||
private DialogSelectDocRowsView(List<DialogSelectDocRowsItemListModel<Object>> listArts,
|
||||
RunnableArgs<DialogSelectDocRowsItemListModel> onConfirm,
|
||||
Runnable onAbort) {
|
||||
super();
|
||||
|
||||
this.listArts = listArts;
|
||||
this.onConfirm = onConfirm;
|
||||
this.onAbort = onAbort;
|
||||
}
|
||||
|
||||
|
||||
private DialogSelectDocRowsView(List<SqlMtbColr> listArts, RunnableArgs<SqlMtbColr> onDismiss) {
|
||||
super();
|
||||
this.onRowSelected = onDismiss;
|
||||
this.listArts = listArts;
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
this.mContext = requireContext();
|
||||
|
||||
mBindings = DialogSelectDocRowsBinding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialogSelectDocRowsNewComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
setCancelable(false);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(isCancelable())
|
||||
.setPositiveButton(R.string.confirm, null)
|
||||
.setNegativeButton(R.string.abort, null)
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
super.onShow(dialogInterface);
|
||||
|
||||
this.listArts.get(0).getChecked().set(true);
|
||||
this.initRecyclerView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
if (onRowSelected != null) onRowSelected.run(this.selectedRow.getValue());
|
||||
|
||||
final DialogSelectDocRowsItemListModel<Object> selectedItem = Stream.of(listArts)
|
||||
.filter(x -> x.getChecked().get())
|
||||
.findFirstOrElse(null);
|
||||
|
||||
if(selectedItem != null)
|
||||
this.onConfirm.run(selectedItem);
|
||||
else this.onAbort.run();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_row_from_lista_doc_rows_layout, container, false);
|
||||
binding.setLifecycleOwner(this);
|
||||
MainApplication
|
||||
.appComponent
|
||||
.dialogSelectDocRowsComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
binding.setView(this);
|
||||
private void initRecyclerView() {
|
||||
var itemType = new Type<DialogSelectDocRowsItemListModel, DialogSelectDocRowsItemModelBinding>(R.layout.dialog_select_doc_rows__item_model, BR.row);
|
||||
// itemType.areItemSame((oldItem, newItem) -> Objects.equals(oldItem.getId(), newItem.getId()));
|
||||
itemType.areContentsTheSame(DialogSelectDocRowsItemListModel::equals);
|
||||
itemType.onClick(x -> {
|
||||
resetChecks();
|
||||
x.getBinding().getRow().getChecked().set(true);
|
||||
|
||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
initView();
|
||||
this.refreshList();
|
||||
|
||||
|
||||
binding.positiveButton.setOnClickListener(view -> {
|
||||
getDialog().dismiss();
|
||||
return null;
|
||||
});
|
||||
|
||||
binding.negativeButton.setOnClickListener(view -> {
|
||||
this.selectedRow.setValue(null);
|
||||
getDialog().dismiss();
|
||||
});
|
||||
|
||||
|
||||
this.onLoadingEnded();
|
||||
return binding.getRoot();
|
||||
new LiveAdapter(listArts)
|
||||
.map(DialogSelectDocRowsItemListModel.class, itemType)
|
||||
.into(this.mBindings.itemList);
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
var list = Stream.of(this.listArts).map(row -> {
|
||||
DialogChooseRowFromListaDocRowsListModel model = new DialogChooseRowFromListaDocRowsListModel();
|
||||
model.setCodMart(row.getCodMart());
|
||||
model.setBarcode(row.getCodMart());
|
||||
model.setOriginalModel(row);
|
||||
model.setNew(row.getId() < 1);
|
||||
model.setDescrizione(row.getDescrizione());
|
||||
model.setQtaOrdReadable(row.getQtaCol() + "\n" + row.getUntMis());
|
||||
model.getChecked().addOnPropertyChangedCallback(() -> {
|
||||
this.checkRow(row, model.getChecked().get());
|
||||
});
|
||||
return model;
|
||||
}).toList();
|
||||
this.listModels.postValue(list);
|
||||
|
||||
}
|
||||
|
||||
private void checkRow(SqlMtbColr row, boolean checked) {
|
||||
if (checked) {
|
||||
this.selectedRow.setValue(row);
|
||||
var models = this.listModels.getValue();
|
||||
if (models != null && !models.isEmpty()) {
|
||||
Stream.of(models).filter(model -> model.getOriginalModel().getId() != row.getId()).forEach(model -> {
|
||||
model.getChecked().set(false);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
var selectedRow = this.selectedRow.getValue();
|
||||
if (selectedRow != null && selectedRow.getId() == row.getId()) {
|
||||
this.selectedRow.setValue(null);
|
||||
}
|
||||
private void resetChecks() {
|
||||
for (var item : listArts) {
|
||||
item.getChecked().set(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
initArrayAdapters();
|
||||
}
|
||||
|
||||
private void initArrayAdapters() {
|
||||
|
||||
new LiveAdapter(listModels, getViewLifecycleOwner(), BR.row)
|
||||
.map(DialogChooseRowFromListaDocRowsListModel.class, R.layout.dialog_choose_row_from_lista_doc_rows__item_model)
|
||||
.onNoData(noData -> {
|
||||
binding.emptyView.setVisibility(noData ? View.VISIBLE : View.GONE);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
).into(binding.listaDocRows);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||
|
||||
public class DialogSelectDocRowsViewModel {
|
||||
|
||||
}
|
||||
@ -1,141 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView" />
|
||||
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/base_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/buttons"
|
||||
android:layout_below="@id/title_container"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center"
|
||||
android:padding="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/no_item_to_pick_text"
|
||||
android:textColor="@color/empty_view_gray"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/lista_doc_rows"
|
||||
android:layout_width="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/title_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/doc_interni_select_row_to_edit" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/center_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/negative_button"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/abort"
|
||||
app:layout_constrainedHeight="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/center_guideline"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/positive_button"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:layout_constrainedHeight="true"
|
||||
android:enabled="@{view.selectedRow != null}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/center_guideline"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
43
app/src/main/res/layout/dialog_select_doc_rows.xml
Normal file
43
app/src/main/res/layout/dialog_select_doc_rows.xml
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingVertical="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:singleLine="false"
|
||||
android:maxLines="2"
|
||||
android:text="@string/doc_interni_select_row_to_edit" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/item_list"
|
||||
android:layout_width="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:layout_height="wrap_content"
|
||||
tools:listitem="@layout/dialog_select_doc_rows__item_model"
|
||||
tools:itemCount="5"/>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
@ -1,55 +1,54 @@
|
||||
<?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">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
|
||||
<variable
|
||||
name="row"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.dto.DialogChooseRowFromListaDocRowsListModel" />
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsItemListModel" />
|
||||
</data>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_marginVertical="2dp"
|
||||
android:background="@drawable/bg_checked_layout"
|
||||
app:backgroundTintResID="@{row.checked.get() ? R.color.bg_checked_layout : android.R.color.transparent}"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:onClick="@{() -> row.checked.toggle()}"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:onClick="@{() -> row.toggleCheck()}">
|
||||
app:backgroundTintResID="@{row.checked.get() ? R.color.bg_checked_layout : android.R.color.transparent}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
<androidx.appcompat.widget.AppCompatRadioButton
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:minWidth="0dp"
|
||||
android:minHeight="0dp"
|
||||
android:clickable="false"
|
||||
app:checked="@{row.checked}" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/qta_box"
|
||||
android:layout_toEndOf="@id/checkbox"
|
||||
android:layout_toStartOf="@id/qta_box">
|
||||
android:layout_marginStart="4dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
@ -58,11 +57,10 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/bottom_sheet_actions_delete_btn"
|
||||
android:id="@+id/icon_new"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="@android:color/white"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:src="@drawable/ic_baseline_new_24"
|
||||
@ -71,6 +69,7 @@
|
||||
android:visibility="@{row.isNew ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mart_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{row.codMart}"
|
||||
@ -79,16 +78,18 @@
|
||||
android:textStyle="bold"
|
||||
tools:text="COD MART" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{row.barcode}"
|
||||
android:textColor="@color/red_600"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="0000000000000" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{row.barcode}"
|
||||
android:textColor="@color/red_600"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_below="@id/cod_mart_label"
|
||||
tools:text="0000000000000" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@ -105,33 +106,44 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/qta_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true">
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="6dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/qta_textview"
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@{UtilityNumber.decimalToString(row.qtaOrd)}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:text="@{row.qtaOrdReadable}"
|
||||
tools:text="280.45\nCONF" />
|
||||
tools:text="280.45" />
|
||||
|
||||
</RelativeLayout>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@{row.untMisOrd}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
tools:text="CONF" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@ -213,6 +213,7 @@
|
||||
|
||||
<string name="already_used_anonymous_barcode"><![CDATA[L\'etichetta scansionata è stata già utilizzata]]></string>
|
||||
<string name="no_result_from_barcode">Il barcode scansionato non ha fornito alcun risultato</string>
|
||||
<string name="no_result_from_cod_mart">Il codice articolo non ha fornito alcun risultato</string>
|
||||
<string name="multiple_results_from_barcode">Il barcode scansionato ha fornito multipli risultati</string>
|
||||
<string name="no_doc_type_selected">Nessun tipo documento selezionato</string>
|
||||
|
||||
|
||||
@ -217,6 +217,7 @@
|
||||
|
||||
<string name="already_used_anonymous_barcode">The scanned label has already been used</string>
|
||||
<string name="no_result_from_barcode">The scanned barcode did not produce any results</string>
|
||||
<string name="no_result_from_cod_mart">The item code did not produce any results</string>
|
||||
<string name="please_open_lu">Before continuing open new LU</string>
|
||||
<string name="multiple_results_from_barcode">The scanned barcode produced multiple results</string>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user