Finish v1_11_4(123)
This commit is contained in:
commit
8cc2e66b5c
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 121
|
||||
def appVersionName = '1.11.2'
|
||||
def appVersionCode = 123
|
||||
def appVersionName = '1.11.4'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"></activity>
|
||||
<activity android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity" />
|
||||
<activity
|
||||
android:name=".gest.picking_resi.PickingResiActivity"
|
||||
android:label="@string/activity_ultime_consegne_title"
|
||||
|
||||
@ -0,0 +1,398 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class GtbAnag {
|
||||
|
||||
private String codAnag;
|
||||
private String ragSoc;
|
||||
private String indirizzo;
|
||||
private String cap;
|
||||
private String citta;
|
||||
private String prov;
|
||||
private String nazione;
|
||||
private String telefono;
|
||||
private String fax;
|
||||
private String partIva;
|
||||
private String codFisc;
|
||||
private String note;
|
||||
private String personaRif;
|
||||
private String allegato;
|
||||
private String eMail;
|
||||
private String eMailPec;
|
||||
private String flagPersonaFg;
|
||||
private String sesso;
|
||||
private String codCentroAzi;
|
||||
private String codRuop;
|
||||
private Date dataNascita;
|
||||
private String luogoNascita;
|
||||
private String provNascita;
|
||||
private String nome;
|
||||
private String ragSoc2;
|
||||
private Integer classeMerito;
|
||||
private Date dataIns;
|
||||
private String numCell;
|
||||
private String cciaa;
|
||||
private String tipoAzienda;
|
||||
private String cuuPa;
|
||||
private String cognome;
|
||||
private String diacod;
|
||||
private BigDecimal lat;
|
||||
private BigDecimal lng;
|
||||
private String flagInformativa;
|
||||
private String flagConsenso;
|
||||
private String precode;
|
||||
private Boolean insDestinatario;
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public GtbAnag setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRagSoc() {
|
||||
return ragSoc;
|
||||
}
|
||||
|
||||
public GtbAnag setRagSoc(String ragSoc) {
|
||||
this.ragSoc = ragSoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return indirizzo;
|
||||
}
|
||||
|
||||
public GtbAnag setIndirizzo(String indirizzo) {
|
||||
this.indirizzo = indirizzo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCap() {
|
||||
return cap;
|
||||
}
|
||||
|
||||
public GtbAnag setCap(String cap) {
|
||||
this.cap = cap;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCitta() {
|
||||
return citta;
|
||||
}
|
||||
|
||||
public GtbAnag setCitta(String citta) {
|
||||
this.citta = citta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProv() {
|
||||
return prov;
|
||||
}
|
||||
|
||||
public GtbAnag setProv(String prov) {
|
||||
this.prov = prov;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNazione() {
|
||||
return nazione;
|
||||
}
|
||||
|
||||
public GtbAnag setNazione(String nazione) {
|
||||
this.nazione = nazione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTelefono() {
|
||||
return telefono;
|
||||
}
|
||||
|
||||
public GtbAnag setTelefono(String telefono) {
|
||||
this.telefono = telefono;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFax() {
|
||||
return fax;
|
||||
}
|
||||
|
||||
public GtbAnag setFax(String fax) {
|
||||
this.fax = fax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartIva() {
|
||||
return partIva;
|
||||
}
|
||||
|
||||
public GtbAnag setPartIva(String partIva) {
|
||||
this.partIva = partIva;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodFisc() {
|
||||
return codFisc;
|
||||
}
|
||||
|
||||
public GtbAnag setCodFisc(String codFisc) {
|
||||
this.codFisc = codFisc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public GtbAnag setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPersonaRif() {
|
||||
return personaRif;
|
||||
}
|
||||
|
||||
public GtbAnag setPersonaRif(String personaRif) {
|
||||
this.personaRif = personaRif;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAllegato() {
|
||||
return allegato;
|
||||
}
|
||||
|
||||
public GtbAnag setAllegato(String allegato) {
|
||||
this.allegato = allegato;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String geteMail() {
|
||||
return eMail;
|
||||
}
|
||||
|
||||
public GtbAnag seteMail(String eMail) {
|
||||
this.eMail = eMail;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String geteMailPec() {
|
||||
return eMailPec;
|
||||
}
|
||||
|
||||
public GtbAnag seteMailPec(String eMailPec) {
|
||||
this.eMailPec = eMailPec;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagPersonaFg() {
|
||||
return flagPersonaFg;
|
||||
}
|
||||
|
||||
public GtbAnag setFlagPersonaFg(String flagPersonaFg) {
|
||||
this.flagPersonaFg = flagPersonaFg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSesso() {
|
||||
return sesso;
|
||||
}
|
||||
|
||||
public GtbAnag setSesso(String sesso) {
|
||||
this.sesso = sesso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodCentroAzi() {
|
||||
return codCentroAzi;
|
||||
}
|
||||
|
||||
public GtbAnag setCodCentroAzi(String codCentroAzi) {
|
||||
this.codCentroAzi = codCentroAzi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodRuop() {
|
||||
return codRuop;
|
||||
}
|
||||
|
||||
public GtbAnag setCodRuop(String codRuop) {
|
||||
this.codRuop = codRuop;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataNascita() {
|
||||
return dataNascita;
|
||||
}
|
||||
|
||||
public GtbAnag setDataNascita(Date dataNascita) {
|
||||
this.dataNascita = dataNascita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLuogoNascita() {
|
||||
return luogoNascita;
|
||||
}
|
||||
|
||||
public GtbAnag setLuogoNascita(String luogoNascita) {
|
||||
this.luogoNascita = luogoNascita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProvNascita() {
|
||||
return provNascita;
|
||||
}
|
||||
|
||||
public GtbAnag setProvNascita(String provNascita) {
|
||||
this.provNascita = provNascita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNome() {
|
||||
return nome;
|
||||
}
|
||||
|
||||
public GtbAnag setNome(String nome) {
|
||||
this.nome = nome;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRagSoc2() {
|
||||
return ragSoc2;
|
||||
}
|
||||
|
||||
public GtbAnag setRagSoc2(String ragSoc2) {
|
||||
this.ragSoc2 = ragSoc2;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getClasseMerito() {
|
||||
return classeMerito;
|
||||
}
|
||||
|
||||
public GtbAnag setClasseMerito(Integer classeMerito) {
|
||||
this.classeMerito = classeMerito;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataIns() {
|
||||
return dataIns;
|
||||
}
|
||||
|
||||
public GtbAnag setDataIns(Date dataIns) {
|
||||
this.dataIns = dataIns;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNumCell() {
|
||||
return numCell;
|
||||
}
|
||||
|
||||
public GtbAnag setNumCell(String numCell) {
|
||||
this.numCell = numCell;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCciaa() {
|
||||
return cciaa;
|
||||
}
|
||||
|
||||
public GtbAnag setCciaa(String cciaa) {
|
||||
this.cciaa = cciaa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTipoAzienda() {
|
||||
return tipoAzienda;
|
||||
}
|
||||
|
||||
public GtbAnag setTipoAzienda(String tipoAzienda) {
|
||||
this.tipoAzienda = tipoAzienda;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCuuPa() {
|
||||
return cuuPa;
|
||||
}
|
||||
|
||||
public GtbAnag setCuuPa(String cuuPa) {
|
||||
this.cuuPa = cuuPa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCognome() {
|
||||
return cognome;
|
||||
}
|
||||
|
||||
public GtbAnag setCognome(String cognome) {
|
||||
this.cognome = cognome;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDiacod() {
|
||||
return diacod;
|
||||
}
|
||||
|
||||
public GtbAnag setDiacod(String diacod) {
|
||||
this.diacod = diacod;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public GtbAnag setLat(BigDecimal lat) {
|
||||
this.lat = lat;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getLng() {
|
||||
return lng;
|
||||
}
|
||||
|
||||
public GtbAnag setLng(BigDecimal lng) {
|
||||
this.lng = lng;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagInformativa() {
|
||||
return flagInformativa;
|
||||
}
|
||||
|
||||
public GtbAnag setFlagInformativa(String flagInformativa) {
|
||||
this.flagInformativa = flagInformativa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagConsenso() {
|
||||
return flagConsenso;
|
||||
}
|
||||
|
||||
public GtbAnag setFlagConsenso(String flagConsenso) {
|
||||
this.flagConsenso = flagConsenso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPrecode() {
|
||||
return precode;
|
||||
}
|
||||
|
||||
public GtbAnag setPrecode(String precode) {
|
||||
this.precode = precode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getInsDestinatario() {
|
||||
return insDestinatario;
|
||||
}
|
||||
|
||||
public GtbAnag setInsDestinatario(Boolean insDestinatario) {
|
||||
this.insDestinatario = insDestinatario;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -33,6 +33,7 @@ import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.SingleValueDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
@ -173,22 +174,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
newMtbColt.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
|
||||
// MtbColt cloneUL = ((MtbColt) sourceMtbColt.clone());
|
||||
//
|
||||
// cloneUL.setMtbCols(null)
|
||||
// .setNumCollo(null)
|
||||
// .setDataCollo((String) null)
|
||||
// .setSegno(-1)
|
||||
// .setGestione(GestioneEnum.LAVORAZIONE)
|
||||
// .setDataVers(null)
|
||||
// .setDataDoc(null)
|
||||
// .setNumDoc(null)
|
||||
// .setSerDoc(null)
|
||||
// .setCodDtip(null)
|
||||
// .setCodAnag(null)
|
||||
// .setCodVdes(null)
|
||||
// .setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
|
||||
if (posizione != null) {
|
||||
newMtbColt
|
||||
.setPosizione(posizione.getPosizione());
|
||||
@ -421,15 +406,42 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
||||
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||
List<String> codMarts = Stream.of(mtbColt.getMtbColr())
|
||||
List<MtbColt> mtbColtList = new ArrayList<>();
|
||||
mtbColtList.add(mtbColt);
|
||||
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
||||
} else {
|
||||
onComplete.run(mtbColt);
|
||||
}
|
||||
|
||||
}, onFailed);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
List<String> codMarts = new ArrayList<>();
|
||||
|
||||
for (MtbColt mtbColt : mtbColts) {
|
||||
codMarts.addAll(Stream.of(mtbColt.getMtbColr())
|
||||
.map(MtbColr::getCodMart)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.toList();
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
ArticoloRESTConsumer.getByCodMart(codMarts, arts -> {
|
||||
|
||||
if (arts != null && arts.size() > 0) {
|
||||
for (MtbColt mtbColt : mtbColts) {
|
||||
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
|
||||
|
||||
MtbAart foundMtbAart = null;
|
||||
@ -447,27 +459,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
mtbColr.setNumCollo(mtbColt.getNumCollo());
|
||||
mtbColr.setDataCollo(mtbColt.getDataColloS());
|
||||
}
|
||||
|
||||
|
||||
onComplete.run(mtbColt);
|
||||
}
|
||||
}
|
||||
|
||||
onComplete.run(mtbColts);
|
||||
}, onFailed);
|
||||
|
||||
} else {
|
||||
onComplete.run(mtbColt);
|
||||
}
|
||||
|
||||
}, onFailed);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getMultipleByTestate(List<MtbColt> testate, boolean onlyResiduo, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
@ -631,4 +627,23 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
||||
analyzeAnswer(response, "GetBySSCC", mtbColts -> {
|
||||
fillMtbAartsOfMtbColts(mtbColts, onComplete, onFailed);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<MtbColt>>> call, Throwable t) {
|
||||
if(onFailed != null) onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,11 +2,14 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
@ -18,4 +21,7 @@ public interface ColliMagazzinoRESTConsumerService {
|
||||
@POST("getColloByBarcode")
|
||||
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);
|
||||
|
||||
@GET("getColliInBasket")
|
||||
Call<ServiceRESTResponse<List<MtbColt>>> getColliInBasket(@Query("codMdep") String codMdep);
|
||||
|
||||
}
|
||||
|
||||
@ -22,20 +22,125 @@ public class SettingsModel {
|
||||
public String codAzienda;
|
||||
public String host;
|
||||
public int port;
|
||||
|
||||
public String getCodAzienda() {
|
||||
return codAzienda;
|
||||
}
|
||||
|
||||
public Server setCodAzienda(String codAzienda) {
|
||||
this.codAzienda = codAzienda;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public Server setHost(String host) {
|
||||
this.host = host;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public Server setPort(int port) {
|
||||
this.port = port;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class User {
|
||||
public String username;
|
||||
public String password;
|
||||
public String fullname;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public User setUsername(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public User setPassword(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFullname() {
|
||||
return fullname;
|
||||
}
|
||||
|
||||
public User setFullname(String fullname) {
|
||||
this.fullname = fullname;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class UserSession {
|
||||
public String profileDB;
|
||||
public AvailableCodMdepsDTO depo;
|
||||
public Integer defaultOrdinamentoPickingAccettazione = 0;
|
||||
// public String codMdep;
|
||||
|
||||
public String getProfileDB() {
|
||||
return profileDB;
|
||||
}
|
||||
|
||||
public UserSession setProfileDB(String profileDB) {
|
||||
this.profileDB = profileDB;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AvailableCodMdepsDTO getDepo() {
|
||||
return depo;
|
||||
}
|
||||
|
||||
public UserSession setDepo(AvailableCodMdepsDTO depo) {
|
||||
this.depo = depo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getDefaultOrdinamentoPickingAccettazione() {
|
||||
return defaultOrdinamentoPickingAccettazione;
|
||||
}
|
||||
|
||||
public UserSession setDefaultOrdinamentoPickingAccettazione(Integer defaultOrdinamentoPickingAccettazione) {
|
||||
this.defaultOrdinamentoPickingAccettazione = defaultOrdinamentoPickingAccettazione;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Server getServer() {
|
||||
return server;
|
||||
}
|
||||
|
||||
public SettingsModel setServer(Server server) {
|
||||
this.server = server;
|
||||
return this;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public SettingsModel setUser(User user) {
|
||||
this.user = user;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UserSession getUserSession() {
|
||||
return userSession;
|
||||
}
|
||||
|
||||
public SettingsModel setUserSession(UserSession userSession) {
|
||||
this.userSession = userSession;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,8 +44,8 @@ public class UpdatesManager {
|
||||
.setDisplay(Display.DIALOG)
|
||||
.setUpdateFrom(UpdateFrom.JSON)
|
||||
.setUpdateJSON(currentVersionUrl)
|
||||
.setButtonDoNotShowAgain(null)
|
||||
.setButtonUpdateClickListener((dialog, which) -> {
|
||||
|
||||
installAPK(context, currentDownloadUrl);
|
||||
});
|
||||
appUpdater.start();
|
||||
|
||||
@ -74,12 +74,25 @@ public class ContenutoBancaleListAdapter extends RecyclerView.Adapter<ContenutoB
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ContenutoBancaleListAdapter.ViewHolder holder, int position) {
|
||||
MtbColr item = mDataset.get(position);
|
||||
holder.bind(item);
|
||||
MtbColr mtbColr = mDataset.get(position);
|
||||
holder.bind(mtbColr);
|
||||
|
||||
//Setting qty with unt_mis
|
||||
if(!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissa())){
|
||||
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
||||
|
||||
if(mtbColr.getMtbAart() != null) {
|
||||
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
||||
}
|
||||
|
||||
holder.mViewDataBinding.qtaTextview.setText(text);
|
||||
} else {
|
||||
holder.mViewDataBinding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
||||
if(mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(item, position);
|
||||
mOnItemClickListener.onItemClick(mtbColr, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -288,7 +288,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
};
|
||||
|
||||
if(sourceMtbColt != null) saveRunnable.run(sourceMtbColt);
|
||||
else DialogScanOrCreateLU.make(mContext, false, false, saveRunnable).show();
|
||||
else DialogScanOrCreateLU.make(mContext, true, false, saveRunnable).show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -95,7 +95,8 @@ public class ChooseOrdsLavFromListAdapter extends RecyclerView.Adapter<ChooseOrd
|
||||
MtbColr mtbColr = mMtbColt.getMtbColr().get(0);
|
||||
BigDecimal residuoCol = mtbColr.getQtaCol();
|
||||
BigDecimal residuoCnf = mtbColr.getNumCnf();
|
||||
BigDecimal offset = BigDecimal.ZERO.add(residuoCol);
|
||||
BigDecimal offsetCol = BigDecimal.ZERO.add(residuoCol);
|
||||
BigDecimal offsetCnf = BigDecimal.ZERO.add(residuoCnf);
|
||||
mtbColr.setQtaCnf(mtbColr.getQtaCol().divide(mtbColr.getNumCnf(),5,BigDecimal.ROUND_HALF_UP));
|
||||
|
||||
List<CheckableOrdineLavoro> ordiniSelezionati = getSelectedData();
|
||||
@ -103,23 +104,40 @@ public class ChooseOrdsLavFromListAdapter extends RecyclerView.Adapter<ChooseOrd
|
||||
for (CheckableOrdineLavoro c : ordiniSelezionati) {
|
||||
BigDecimal usedCol, usedCnf;
|
||||
float perc = (c.getItem().getOrdineLav().getHrNum() * 100) / totalHr;
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (mtbColr.getMtbAart() != null && !mtbColr.getMtbAart().isFlagQtaCnfFissa())) {
|
||||
usedCnf = residuoCnf.multiply(BigDecimal.valueOf(perc)).divide(BigDecimal.valueOf(100)).setScale(0, BigDecimal.ROUND_CEILING);
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (mtbColr.getMtbAart() != null && !mtbColr.getMtbAart().isFlagQtaCnfFissa()) ){
|
||||
usedCnf = residuoCnf.multiply(BigDecimal.valueOf(perc)).divide(BigDecimal.valueOf(100)).setScale(0, BigDecimal.ROUND_FLOOR);
|
||||
if (usedCnf.compareTo(BigDecimal.ZERO) <= 0 && offsetCnf.compareTo(BigDecimal.ZERO) > 0){
|
||||
usedCnf = BigDecimal.ONE;
|
||||
}
|
||||
usedCol = usedCnf.multiply(mtbColr.getQtaCnf()).setScale(0,BigDecimal.ROUND_FLOOR);
|
||||
} else {
|
||||
usedCol = residuoCol.multiply(BigDecimal.valueOf(perc)).divide(BigDecimal.valueOf(100)).setScale(0, BigDecimal.ROUND_FLOOR);
|
||||
usedCnf = usedCol.divide(mtbColr.getQtaCnf()).setScale(0, BigDecimal.ROUND_CEILING);
|
||||
if (usedCol.compareTo(BigDecimal.ZERO) <= 0 && offsetCol.compareTo(BigDecimal.ZERO) > 0){
|
||||
usedCol = BigDecimal.ONE;
|
||||
}
|
||||
offset = offset.subtract(usedCol);
|
||||
usedCnf = usedCol.divide(mtbColr.getQtaCnf()).setScale(3, BigDecimal.ROUND_FLOOR);
|
||||
}
|
||||
offsetCol = offsetCol.subtract(usedCol);
|
||||
offsetCnf = offsetCnf.subtract(usedCnf);
|
||||
c.setQtaCol(usedCol.floatValue());
|
||||
c.setNumCnf(usedCnf.floatValue());
|
||||
}
|
||||
if (ordiniSelezionati.size() > 0 && offset.floatValue() != 0) {
|
||||
if (ordiniSelezionati.size() > 0) {
|
||||
CheckableOrdineLavoro majorOrder = Stream.of(ordiniSelezionati).max((o1, o2) -> Integer.compare(o1.getItem().getOrdineLav().getHrNum(), o2.getItem().getOrdineLav().getHrNum())).get();
|
||||
if (majorOrder == null) {
|
||||
majorOrder = ordiniSelezionati.get(0);
|
||||
}
|
||||
majorOrder.setQtaCol(majorOrder.getQtaCol().get() + offset.floatValue());
|
||||
if (offsetCnf.floatValue() != 0 || offsetCol.floatValue() != 0){
|
||||
if ( SettingsManager.iDB().isFlagForceAllToColli() || (mtbColr.getMtbAart() != null && !mtbColr.getMtbAart().isFlagQtaCnfFissa())) {
|
||||
majorOrder.setNumCnf(majorOrder.getNumCnf().get() + offsetCnf.floatValue());
|
||||
majorOrder.setQtaCol(majorOrder.getQtaCol().get() + offsetCol.floatValue());
|
||||
} else {
|
||||
majorOrder.setQtaCol(majorOrder.getQtaCol().get() + offsetCol.floatValue());
|
||||
majorOrder.setNumCnf(majorOrder.getQtaCol().get() / mtbColr.getQtaCnf().floatValue());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ public class ProdVersamentoMaterialViewModel {
|
||||
|
||||
|
||||
public void openLU() {
|
||||
DialogScanOrCreateLU.make(mContext, true, true, false, mtbColt -> {
|
||||
DialogScanOrCreateLU.make(mContext, false, false, true, false, mtbColt -> {
|
||||
if (mtbColt == null) {
|
||||
((IPoppableActivity) mContext).pop();
|
||||
} else if ((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(+1)) {
|
||||
|
||||
@ -67,10 +67,8 @@ public class RettificaGiacenzeMainListAdapter extends RecyclerView.Adapter<Retti
|
||||
|
||||
//Setting qty with unt_mis
|
||||
if(!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissa())){
|
||||
|
||||
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
||||
|
||||
|
||||
if(mtbColr.getMtbAart() != null) {
|
||||
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
||||
}
|
||||
|
||||
@ -478,7 +478,7 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
public void openLU() {
|
||||
DialogScanOrCreateLU.make(mContext, false, false, mtbColt -> {
|
||||
DialogScanOrCreateLU.make(mContext, true, false, mtbColt -> {
|
||||
if(mtbColt == null) {
|
||||
((IPoppableActivity)mContext).pop();
|
||||
} else {
|
||||
|
||||
@ -21,7 +21,9 @@ import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.GtbAnag;
|
||||
import it.integry.integrywmsnative.core.rest.model.DocumentoResoDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
@ -32,30 +34,30 @@ public class DialogUltimeConsegneFiltroAvanzato {
|
||||
private AlertDialog mAlert;
|
||||
private Context mContext;
|
||||
private DialogUltimeConsegneFiltroAvanzatoViewModel mBaseViewModel;
|
||||
private RunnableArgss<List<DocumentoResoDTO>, DialogUltimeConsegneFiltroAvanzatoViewModel> mOnDismiss;
|
||||
private RunnableArgs<DialogUltimeConsegneFiltroAvanzatoViewModel> mOnDismiss;
|
||||
|
||||
|
||||
|
||||
private ArrayAdapter<String> arrayAdapterRagSoc;
|
||||
|
||||
private List<DocumentoResoDTO> mItems;
|
||||
private List<DocumentoResoDTO> mFilteredItems;
|
||||
private List<GtbAnag> mItems;
|
||||
private List<GtbAnag> mFilteredItems;
|
||||
|
||||
private Predicate<DocumentoResoDTO> currentRagSocPredicate = null;
|
||||
private Predicate<DocumentoResoDTO> currentDataDocPredicate = null;
|
||||
private Predicate<GtbAnag> currentRagSocPredicate = null;
|
||||
private Predicate<GtbAnag> currentDataDocPredicate = null;
|
||||
|
||||
public static AlertDialog make(final Context context,
|
||||
final List<DocumentoResoDTO> items,
|
||||
final List<GtbAnag> items,
|
||||
DialogUltimeConsegneFiltroAvanzatoViewModel baseViewModel,
|
||||
RunnableArgss<List<DocumentoResoDTO>, DialogUltimeConsegneFiltroAvanzatoViewModel> onDismiss) {
|
||||
RunnableArgs<DialogUltimeConsegneFiltroAvanzatoViewModel> onDismiss) {
|
||||
return new DialogUltimeConsegneFiltroAvanzato(context, items, baseViewModel, onDismiss).mAlert;
|
||||
}
|
||||
|
||||
|
||||
public DialogUltimeConsegneFiltroAvanzato(final Context context,
|
||||
final List<DocumentoResoDTO> items,
|
||||
final List<GtbAnag> items,
|
||||
DialogUltimeConsegneFiltroAvanzatoViewModel baseViewModel,
|
||||
RunnableArgss<List<DocumentoResoDTO>, DialogUltimeConsegneFiltroAvanzatoViewModel> onDismiss) {
|
||||
RunnableArgs<DialogUltimeConsegneFiltroAvanzatoViewModel> onDismiss) {
|
||||
mContext = context;
|
||||
mItems = items;
|
||||
mBaseViewModel = baseViewModel;
|
||||
@ -89,7 +91,7 @@ public class DialogUltimeConsegneFiltroAvanzato {
|
||||
|
||||
|
||||
mAlert.setOnDismissListener(dialogInterface -> {
|
||||
if(mOnDismiss != null) mOnDismiss.run(mFilteredItems, viewModel);
|
||||
if(mOnDismiss != null) mOnDismiss.run(viewModel);
|
||||
});
|
||||
|
||||
refreshList();
|
||||
@ -144,26 +146,13 @@ public class DialogUltimeConsegneFiltroAvanzato {
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
BindableString.resetListeners(viewModel.dataDoc);
|
||||
BindableString.registerListener(viewModel.dataDoc, value -> {
|
||||
if (UtilityString.isNullOrEmpty(value)) currentDataDocPredicate = null;
|
||||
else {
|
||||
currentDataDocPredicate = o -> o.getDataDocD().equals(viewModel.dataDocDate);
|
||||
}
|
||||
|
||||
refreshList();
|
||||
|
||||
arrayAdapterRagSoc.clear();
|
||||
arrayAdapterRagSoc.addAll(getAvailableRagSocs(true));
|
||||
});
|
||||
}
|
||||
|
||||
private List<String> getAvailableRagSocs(boolean skipRecalc) {
|
||||
if(currentDataDocPredicate == null){
|
||||
mFilteredItems = mItems;
|
||||
} else if(!skipRecalc){
|
||||
Stream<DocumentoResoDTO> tmpStream = Stream.of(mItems)
|
||||
Stream<GtbAnag> tmpStream = Stream.of(mItems)
|
||||
.filter(x ->
|
||||
(currentDataDocPredicate == null || (currentDataDocPredicate.test(x)))
|
||||
);
|
||||
@ -171,7 +160,7 @@ public class DialogUltimeConsegneFiltroAvanzato {
|
||||
mFilteredItems = tmpStream.toList();
|
||||
}
|
||||
|
||||
return Stream.of(mFilteredItems).map(DocumentoResoDTO::getRagSoc).distinct().withoutNulls().toList();
|
||||
return Stream.of(mFilteredItems).map(x -> x.getCodAnag() + " - " + x.getRagSoc()).distinct().withoutNulls().toList();
|
||||
}
|
||||
|
||||
|
||||
@ -180,7 +169,7 @@ public class DialogUltimeConsegneFiltroAvanzato {
|
||||
if(currentRagSocPredicate == null && currentDataDocPredicate == null){
|
||||
mFilteredItems = mItems;
|
||||
} else {
|
||||
Stream<DocumentoResoDTO> tmpStream = Stream.of(mItems)
|
||||
Stream<GtbAnag> tmpStream = Stream.of(mItems)
|
||||
.filter(x ->
|
||||
(currentRagSocPredicate == null || (currentRagSocPredicate.test(x))) &&
|
||||
(currentDataDocPredicate== null || (currentDataDocPredicate.test(x)))
|
||||
|
||||
@ -8,6 +8,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.GtbAnag;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
@ -22,7 +23,27 @@ import it.integry.integrywmsnative.core.rest.model.DocumentoResoDTO;
|
||||
|
||||
public class UltimeConsegneClienteRESTConsumer {
|
||||
|
||||
public static void getUltimeConsegneClienti(String codMdep, String codAnag, String codMart, int limitConsegnePerCli, int limitDays, RunnableArgs<ArrayList<DocumentoResoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public static void getAvailableCodAnagClienti(RunnableArgs<List<GtbAnag>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String sql = "SELECT DISTINCT gtb_anag.cod_anag, gtb_anag.rag_soc " +
|
||||
"FROM gtb_anag " +
|
||||
"INNER JOIN vtb_clie ON vtb_clie.cod_anag = gtb_anag.cod_anag " +
|
||||
"WHERE flag_stato = 'A'";
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<GtbAnag>>() {}.getType();
|
||||
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<GtbAnag>>() {
|
||||
@Override
|
||||
public void onSuccess(ArrayList<GtbAnag> value) {
|
||||
if(onComplete != null) onComplete.run(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getUltimeConsegneClienti(String codMdep, String codAnag, String codMart, Integer limitConsegnePerCli, int limitDays, RunnableArgs<ArrayList<DocumentoResoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String sql = "SELECT consegne.*, " +
|
||||
" rag_soc," +
|
||||
|
||||
@ -7,12 +7,14 @@ import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.GtbAnag;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
@ -31,49 +33,33 @@ public class UltimeConsegneClienteViewModel {
|
||||
private List<DocumentoResoDTO> mItems;
|
||||
private List<DocumentoResoDTO> mRenderedItems = new ArrayList<>();
|
||||
|
||||
private List<GtbAnag> mAvailableGtbAnags = null;
|
||||
|
||||
private DialogUltimeConsegneFiltroAvanzato.DialogUltimeConsegneFiltroAvanzatoViewModel mAppliedFilterViewModel;
|
||||
|
||||
public UltimeConsegneClienteViewModel(Context context, FragmentMainUltimeConsegneClienteBinding binding) {
|
||||
this.mContext = context;
|
||||
this.mBinding = binding;
|
||||
|
||||
this.initList();
|
||||
|
||||
this.mBinding.mainFab.hide();
|
||||
this.mBinding.mainFab.setOnClickListener(v -> {
|
||||
dispatchConsegne();
|
||||
});
|
||||
|
||||
openFilterDialog();
|
||||
}
|
||||
|
||||
public void openFilterDialog() {
|
||||
DialogUltimeConsegneFiltroAvanzato.make(mContext, mItems, mAppliedFilterViewModel, (filteredOrderList, filter) -> {
|
||||
mAppliedFilterViewModel = filter;
|
||||
|
||||
if(filteredOrderList != null){
|
||||
|
||||
refreshItems(filteredOrderList);
|
||||
}
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
private void initList() {
|
||||
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
UltimeConsegneClienteRESTConsumer.getUltimeConsegneClienti(
|
||||
SettingsManager.i().userSession.depo.getCodMdep(),
|
||||
null,
|
||||
null,
|
||||
100,
|
||||
365,
|
||||
consegne -> {
|
||||
this.mItems = consegne;
|
||||
|
||||
this.initDataAdapter(consegne);
|
||||
refreshItems(consegne);
|
||||
|
||||
UltimeConsegneClienteRESTConsumer.getAvailableCodAnagClienti(gtbAnags -> {
|
||||
mAvailableGtbAnags = gtbAnags;
|
||||
progressDialog.dismiss();
|
||||
|
||||
DialogUltimeConsegneFiltroAvanzato.make(mContext, gtbAnags, mAppliedFilterViewModel, (filter) -> {
|
||||
mAppliedFilterViewModel = filter;
|
||||
refreshItems();
|
||||
}).show();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
});
|
||||
@ -90,12 +76,43 @@ public class UltimeConsegneClienteViewModel {
|
||||
|
||||
}
|
||||
|
||||
private void refreshItems(List<DocumentoResoDTO> items){
|
||||
mBinding.emptyView.setVisibility((items != null && items.size() > 0) ? View.GONE : View.VISIBLE);
|
||||
private void refreshItems(){
|
||||
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
||||
String currentCodAnagFilter = null;
|
||||
|
||||
Optional<GtbAnag> singleGtbAnag = Stream.of(mAvailableGtbAnags)
|
||||
.filter(x -> (x.getCodAnag() + " - " + x.getRagSoc()).equals(currentAnagFilter))
|
||||
.findSingle();
|
||||
|
||||
if(singleGtbAnag.isPresent()) {
|
||||
currentCodAnagFilter = singleGtbAnag.get().getCodAnag();
|
||||
}
|
||||
|
||||
UltimeConsegneClienteRESTConsumer.getUltimeConsegneClienti(
|
||||
SettingsManager.i().userSession.depo.getCodMdep(),
|
||||
currentCodAnagFilter,
|
||||
null,
|
||||
null,
|
||||
365,
|
||||
consegne -> {
|
||||
|
||||
this.mItems = consegne;
|
||||
|
||||
this.initDataAdapter(consegne);
|
||||
mBinding.emptyView.setVisibility((this.mItems != null && this.mItems.size() > 0) ? View.GONE : View.VISIBLE);
|
||||
|
||||
mRenderedItems.clear();
|
||||
if(items != null) mRenderedItems.addAll(items);
|
||||
if(this.mItems != null) mRenderedItems.addAll(this.mItems);
|
||||
mAdapter.updateItems(mRenderedItems);
|
||||
|
||||
progressDialog.dismiss();
|
||||
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
});
|
||||
}
|
||||
|
||||
private void onSingleSelectionChanged(DocumentoResoDTO dto) {
|
||||
|
||||
@ -14,6 +14,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -21,6 +22,7 @@ import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
||||
import it.integry.integrywmsnative.core.model.GtbAnag;
|
||||
import it.integry.integrywmsnative.core.rest.model.DocumentoResoDTO;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
@ -30,6 +32,7 @@ import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.databinding.FragmentUltimiArriviFornitoreBinding;
|
||||
import it.integry.integrywmsnative.gest.picking_resi.PickingResiActivity;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.core.UltimiArriviFornitoreListAdapter;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.core.UltimiArriviFornitoreViewModel;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.dialog.DialogUltimiArriviFornitoreFiltroAvanzato;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.rest.UltimiArriviFornitoreRESTConsumer;
|
||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
@ -42,14 +45,7 @@ public class UltimiArriviFornitoreFragment extends Fragment implements ITitledFr
|
||||
private Runnable mOnPreDestroy;
|
||||
private ElevatedToolbar mToolbar;
|
||||
|
||||
private FragmentUltimiArriviFornitoreBinding mBinding;
|
||||
|
||||
private List<DocumentoResoDTO> mItems;
|
||||
private List<DocumentoResoDTO> mRenderedItems = new ArrayList<>();
|
||||
|
||||
private UltimiArriviFornitoreListAdapter mAdapter;
|
||||
|
||||
private DialogUltimiArriviFornitoreFiltroAvanzato.DialogUltimiArriviFiltroAvanzatoViewModel mAppliedFilterViewModel;
|
||||
private UltimiArriviFornitoreViewModel mViewModel;
|
||||
|
||||
public UltimiArriviFornitoreFragment() {
|
||||
// Required empty public constructor
|
||||
@ -68,14 +64,14 @@ public class UltimiArriviFornitoreFragment extends Fragment implements ITitledFr
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
mBinding = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_ultimi_arrivi_fornitore, container, false);
|
||||
FragmentUltimiArriviFornitoreBinding mBinding = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_ultimi_arrivi_fornitore, container, false);
|
||||
|
||||
mBinding.setViewmodel(this);
|
||||
mViewModel = new UltimiArriviFornitoreViewModel(getActivity(), mBinding);
|
||||
|
||||
mBinding.setViewmodel(mViewModel);
|
||||
|
||||
mToolbar.setRecyclerView(mBinding.recyclerView);
|
||||
|
||||
this.initView();
|
||||
|
||||
// Inflate the layout for this fragment
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
@ -104,98 +100,11 @@ public class UltimiArriviFornitoreFragment extends Fragment implements ITitledFr
|
||||
|
||||
|
||||
|
||||
private void initView() {
|
||||
this.initList();
|
||||
|
||||
this.mBinding.mainFab.hide();
|
||||
this.mBinding.mainFab.setOnClickListener(v -> {
|
||||
dispatchConsegne();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initList() {
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||
|
||||
UltimiArriviFornitoreRESTConsumer.getUltimeConsegneFornitori(
|
||||
SettingsManager.i().userSession.depo.getCodMdep(),
|
||||
null,
|
||||
null,
|
||||
consegne -> {
|
||||
this.mItems = consegne;
|
||||
|
||||
this.initDataAdapter(consegne);
|
||||
refreshItems(consegne);
|
||||
|
||||
progressDialog.dismiss();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(getActivity(), ex, progressDialog);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initDataAdapter(ArrayList<DocumentoResoDTO> dataset) {
|
||||
mAdapter = new UltimiArriviFornitoreListAdapter(getActivity(), dataset);
|
||||
mAdapter.setOnSelectionChanged(this::onSingleSelectionChanged);
|
||||
|
||||
mBinding.recyclerView.setHasFixedSize(true);
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
mBinding.recyclerView.setAdapter(mAdapter);
|
||||
mBinding.fastscroll.setRecyclerView(mBinding.recyclerView);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void onSingleSelectionChanged(DocumentoResoDTO dto) {
|
||||
List<DocumentoResoDTO> selectedOrders = getSelectedItems();
|
||||
|
||||
if(dto.isSelected()) {
|
||||
Stream.of(selectedOrders)
|
||||
.filter(x -> !x.getRagSoc().equalsIgnoreCase(dto.getRagSoc()))
|
||||
.forEach(x -> x.setSelected(false));
|
||||
}
|
||||
|
||||
if(selectedOrders != null && selectedOrders.size() > 0) {
|
||||
mBinding.mainFab.show();
|
||||
}
|
||||
else {
|
||||
mBinding.mainFab.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private List<DocumentoResoDTO> getSelectedItems() {
|
||||
return Stream.of(this.mItems)
|
||||
.filter(DocumentoResoDTO::isSelected)
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
||||
private void dispatchConsegne() {
|
||||
List<DocumentoResoDTO> selectedConsegne = getSelectedItems();
|
||||
|
||||
PickingResiActivity.startActivity(getActivity(), getText(R.string.ultime_arrivi_fornitore_title).toString(), selectedConsegne, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFilterClick() {
|
||||
DialogUltimiArriviFornitoreFiltroAvanzato.make(getActivity(), mItems, mAppliedFilterViewModel, (filteredOrderList, filter) -> {
|
||||
mAppliedFilterViewModel = filter;
|
||||
|
||||
if(filteredOrderList != null){
|
||||
|
||||
refreshItems(filteredOrderList);
|
||||
}
|
||||
|
||||
}).show();
|
||||
mViewModel.openFilterDialog();
|
||||
}
|
||||
|
||||
|
||||
private void refreshItems(List<DocumentoResoDTO> items){
|
||||
mBinding.emptyView.setVisibility((items != null && items.size() > 0) ? View.GONE : View.VISIBLE);
|
||||
|
||||
mRenderedItems.clear();
|
||||
if(items != null) mRenderedItems.addAll(items);
|
||||
mAdapter.updateItems(mRenderedItems);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,154 @@
|
||||
package it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.core;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.GtbAnag;
|
||||
import it.integry.integrywmsnative.core.rest.model.DocumentoResoDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.databinding.FragmentUltimiArriviFornitoreBinding;
|
||||
import it.integry.integrywmsnative.gest.picking_resi.PickingResiActivity;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.dialog.DialogUltimiArriviFornitoreFiltroAvanzato;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.rest.UltimiArriviFornitoreRESTConsumer;
|
||||
|
||||
public class UltimiArriviFornitoreViewModel {
|
||||
|
||||
private Context mContext;
|
||||
private FragmentUltimiArriviFornitoreBinding mBinding;
|
||||
|
||||
private List<DocumentoResoDTO> mItems;
|
||||
private List<DocumentoResoDTO> mRenderedItems = new ArrayList<>();
|
||||
|
||||
private List<GtbAnag> mAvailableGtbAnags = null;
|
||||
|
||||
private UltimiArriviFornitoreListAdapter mAdapter;
|
||||
|
||||
private DialogUltimiArriviFornitoreFiltroAvanzato.DialogUltimiArriviFiltroAvanzatoViewModel mAppliedFilterViewModel;
|
||||
|
||||
public UltimiArriviFornitoreViewModel(Context context, FragmentUltimiArriviFornitoreBinding binding) {
|
||||
this.mContext = context;
|
||||
this.mBinding = binding;
|
||||
|
||||
this.mBinding.mainFab.hide();
|
||||
this.mBinding.mainFab.setOnClickListener(v -> {
|
||||
dispatchConsegne();
|
||||
});
|
||||
|
||||
openFilterDialog();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initDataAdapter(ArrayList<DocumentoResoDTO> dataset) {
|
||||
mAdapter = new UltimiArriviFornitoreListAdapter(mContext, dataset);
|
||||
mAdapter.setOnSelectionChanged(this::onSingleSelectionChanged);
|
||||
|
||||
mBinding.recyclerView.setHasFixedSize(true);
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
mBinding.recyclerView.setAdapter(mAdapter);
|
||||
mBinding.fastscroll.setRecyclerView(mBinding.recyclerView);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void openFilterDialog() {
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
UltimiArriviFornitoreRESTConsumer.getAvailableCodAnagFornitori(gtbAnags -> {
|
||||
mAvailableGtbAnags = gtbAnags;
|
||||
progressDialog.dismiss();
|
||||
|
||||
DialogUltimiArriviFornitoreFiltroAvanzato.make(mContext, mAvailableGtbAnags, mAppliedFilterViewModel, (filter) -> {
|
||||
mAppliedFilterViewModel = filter;
|
||||
refreshItems();
|
||||
}).show();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void dispatchConsegne() {
|
||||
List<DocumentoResoDTO> selectedConsegne = getSelectedItems();
|
||||
|
||||
PickingResiActivity.startActivity(mContext, mContext.getText(R.string.ultime_arrivi_fornitore_title).toString(), selectedConsegne, -1);
|
||||
}
|
||||
|
||||
private List<DocumentoResoDTO> getSelectedItems() {
|
||||
return Stream.of(this.mItems)
|
||||
.filter(DocumentoResoDTO::isSelected)
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
||||
private void refreshItems(){
|
||||
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
||||
String currentCodAnagFilter = null;
|
||||
|
||||
Optional<GtbAnag> singleGtbAnag = Stream.of(mAvailableGtbAnags)
|
||||
.filter(x -> (x.getCodAnag() + " - " + x.getRagSoc()).equals(currentAnagFilter))
|
||||
.findSingle();
|
||||
|
||||
if(singleGtbAnag.isPresent()) {
|
||||
currentCodAnagFilter = singleGtbAnag.get().getCodAnag();
|
||||
}
|
||||
|
||||
|
||||
UltimiArriviFornitoreRESTConsumer.getUltimeConsegneFornitori(
|
||||
SettingsManager.i().userSession.depo.getCodMdep(),
|
||||
currentCodAnagFilter,
|
||||
null,
|
||||
null,
|
||||
365,
|
||||
consegne -> {
|
||||
this.mItems = consegne;
|
||||
|
||||
this.initDataAdapter(consegne);
|
||||
|
||||
mBinding.emptyView.setVisibility((this.mItems != null && this.mItems.size() > 0) ? View.GONE : View.VISIBLE);
|
||||
|
||||
mRenderedItems.clear();
|
||||
if(this.mItems != null) mRenderedItems.addAll(this.mItems);
|
||||
mAdapter.updateItems(mRenderedItems);
|
||||
|
||||
progressDialog.dismiss();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void onSingleSelectionChanged(DocumentoResoDTO dto) {
|
||||
List<DocumentoResoDTO> selectedOrders = getSelectedItems();
|
||||
|
||||
if(dto.isSelected()) {
|
||||
Stream.of(selectedOrders)
|
||||
.filter(x -> !x.getRagSoc().equalsIgnoreCase(dto.getRagSoc()))
|
||||
.forEach(x -> x.setSelected(false));
|
||||
}
|
||||
|
||||
if(selectedOrders != null && selectedOrders.size() > 0) {
|
||||
mBinding.mainFab.show();
|
||||
}
|
||||
else {
|
||||
mBinding.mainFab.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,9 @@ import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.GtbAnag;
|
||||
import it.integry.integrywmsnative.core.rest.model.DocumentoResoDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
@ -34,29 +36,29 @@ public class DialogUltimiArriviFornitoreFiltroAvanzato {
|
||||
private AlertDialog mAlert;
|
||||
private Context mContext;
|
||||
private DialogUltimiArriviFiltroAvanzatoViewModel mBaseViewModel;
|
||||
private RunnableArgss<List<DocumentoResoDTO>, DialogUltimiArriviFiltroAvanzatoViewModel> mOnDismiss;
|
||||
private RunnableArgs<DialogUltimiArriviFiltroAvanzatoViewModel> mOnDismiss;
|
||||
|
||||
|
||||
|
||||
private ArrayAdapter<String> arrayAdapterRagSoc;
|
||||
|
||||
private List<DocumentoResoDTO> mItems;
|
||||
private List<DocumentoResoDTO> mFilteredItems;
|
||||
private List<GtbAnag> mItems;
|
||||
private List<GtbAnag> mFilteredItems;
|
||||
|
||||
private Predicate<DocumentoResoDTO> currentRagSocPredicate = null;
|
||||
private Predicate<DocumentoResoDTO> currentDataDocPredicate = null;
|
||||
private Predicate<GtbAnag> currentRagSocPredicate = null;
|
||||
private Predicate<GtbAnag> currentDataDocPredicate = null;
|
||||
|
||||
public static AlertDialog make(final Context context,
|
||||
final List<DocumentoResoDTO> items,
|
||||
final List<GtbAnag> items,
|
||||
DialogUltimiArriviFiltroAvanzatoViewModel baseViewModel,
|
||||
RunnableArgss<List<DocumentoResoDTO>, DialogUltimiArriviFiltroAvanzatoViewModel> onDismiss) {
|
||||
RunnableArgs<DialogUltimiArriviFiltroAvanzatoViewModel> onDismiss) {
|
||||
return new DialogUltimiArriviFornitoreFiltroAvanzato(context, items, baseViewModel, onDismiss).mAlert;
|
||||
}
|
||||
|
||||
public DialogUltimiArriviFornitoreFiltroAvanzato(final Context context,
|
||||
final List<DocumentoResoDTO> items,
|
||||
final List<GtbAnag> items,
|
||||
DialogUltimiArriviFiltroAvanzatoViewModel baseViewModel,
|
||||
RunnableArgss<List<DocumentoResoDTO>, DialogUltimiArriviFiltroAvanzatoViewModel> onDismiss) {
|
||||
RunnableArgs<DialogUltimiArriviFiltroAvanzatoViewModel> onDismiss) {
|
||||
mContext = context;
|
||||
mItems = items;
|
||||
mBaseViewModel = baseViewModel;
|
||||
@ -90,7 +92,7 @@ public class DialogUltimiArriviFornitoreFiltroAvanzato {
|
||||
|
||||
|
||||
mAlert.setOnDismissListener(dialogInterface -> {
|
||||
if(mOnDismiss != null) mOnDismiss.run(mFilteredItems, viewModel);
|
||||
if(mOnDismiss != null) mOnDismiss.run(viewModel);
|
||||
});
|
||||
|
||||
refreshList();
|
||||
@ -145,26 +147,13 @@ public class DialogUltimiArriviFornitoreFiltroAvanzato {
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
BindableString.resetListeners(viewModel.dataDoc);
|
||||
BindableString.registerListener(viewModel.dataDoc, value -> {
|
||||
if (UtilityString.isNullOrEmpty(value)) currentDataDocPredicate = null;
|
||||
else {
|
||||
currentDataDocPredicate = o -> o.getDataDocD().equals(viewModel.dataDocDate);
|
||||
}
|
||||
|
||||
refreshList();
|
||||
|
||||
arrayAdapterRagSoc.clear();
|
||||
arrayAdapterRagSoc.addAll(getAvailableRagSocs(true));
|
||||
});
|
||||
}
|
||||
|
||||
private List<String> getAvailableRagSocs(boolean skipRecalc) {
|
||||
if(currentDataDocPredicate == null){
|
||||
mFilteredItems = mItems;
|
||||
} else if(!skipRecalc){
|
||||
Stream<DocumentoResoDTO> tmpStream = Stream.of(mItems)
|
||||
Stream<GtbAnag> tmpStream = Stream.of(mItems)
|
||||
.filter(x ->
|
||||
(currentDataDocPredicate == null || (currentDataDocPredicate.test(x)))
|
||||
);
|
||||
@ -172,7 +161,7 @@ public class DialogUltimiArriviFornitoreFiltroAvanzato {
|
||||
mFilteredItems = tmpStream.toList();
|
||||
}
|
||||
|
||||
return Stream.of(mFilteredItems).map(DocumentoResoDTO::getRagSoc).distinct().withoutNulls().toList();
|
||||
return Stream.of(mFilteredItems).map(x -> x.getCodAnag() + " - " + x.getRagSoc()).distinct().withoutNulls().toList();
|
||||
}
|
||||
|
||||
|
||||
@ -181,7 +170,7 @@ public class DialogUltimiArriviFornitoreFiltroAvanzato {
|
||||
if(currentRagSocPredicate == null && currentDataDocPredicate == null){
|
||||
mFilteredItems = mItems;
|
||||
} else {
|
||||
Stream<DocumentoResoDTO> tmpStream = Stream.of(mItems)
|
||||
Stream<GtbAnag> tmpStream = Stream.of(mItems)
|
||||
.filter(x ->
|
||||
(currentRagSocPredicate == null || (currentRagSocPredicate.test(x))) &&
|
||||
(currentDataDocPredicate== null || (currentDataDocPredicate.test(x)))
|
||||
|
||||
@ -4,7 +4,9 @@ import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.GtbAnag;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
@ -13,19 +15,37 @@ import it.integry.integrywmsnative.core.rest.model.DocumentoResoDTO;
|
||||
|
||||
public class UltimiArriviFornitoreRESTConsumer {
|
||||
|
||||
public static void getUltimeConsegneFornitori(String codMdep, String codAnag, String codMart, RunnableArgs<ArrayList<DocumentoResoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public static void getAvailableCodAnagFornitori(RunnableArgs<List<GtbAnag>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String sql = "SELECT DISTINCT gtb_anag.cod_anag, gtb_anag.rag_soc " +
|
||||
"FROM gtb_anag " +
|
||||
"INNER JOIN atb_forn ON atb_forn.cod_anag = gtb_anag.cod_anag " +
|
||||
"WHERE flag_stato = 'A'";
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<GtbAnag>>() {}.getType();
|
||||
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<GtbAnag>>() {
|
||||
@Override
|
||||
public void onSuccess(ArrayList<GtbAnag> value) {
|
||||
if(onComplete != null) onComplete.run(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getUltimeConsegneFornitori(String codMdep, String codAnag, String codMart, Integer limitConsegnePerCli, int limitDays, RunnableArgs<ArrayList<DocumentoResoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
int numberOfConsegnePerForn = 100;
|
||||
int numberOfDayToAnalyze = 365;
|
||||
|
||||
String sql = "SELECT consegne.*, " +
|
||||
" rag_soc " +
|
||||
"FROM WMS_GetUltimeConsegneFornitori(" +
|
||||
UtilityDB.valueToString(numberOfConsegnePerForn) + ", " +
|
||||
UtilityDB.valueToString(limitConsegnePerCli) + ", " +
|
||||
UtilityDB.valueToString(codAnag) + ", " +
|
||||
UtilityDB.valueToString(codMart) + ", " +
|
||||
UtilityDB.valueToString(codMdep) + ", " +
|
||||
UtilityDB.valueToString(numberOfDayToAnalyze) + ") consegne " +
|
||||
UtilityDB.valueToString(limitDays) + ") consegne " +
|
||||
"LEFT OUTER JOIN gtb_anag ON consegne.cod_anag = gtb_anag.cod_anag " +
|
||||
"ORDER BY rag_soc, " +
|
||||
" counter_consegna ";
|
||||
|
||||
@ -68,7 +68,7 @@ public class VersamentoMerceViewModel {
|
||||
}
|
||||
|
||||
public void openLU() {
|
||||
DialogScanOrCreateLU.make(mContext, true, false, mtbColt -> {
|
||||
DialogScanOrCreateLU.make(mContext, true, false, true, false, mtbColt -> {
|
||||
if(mtbColt == null) {
|
||||
((IPoppableActivity)mContext).pop();
|
||||
} else if((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(+1)){
|
||||
|
||||
@ -1,21 +1,37 @@
|
||||
package it.integry.integrywmsnative.ui;
|
||||
|
||||
import android.animation.LayoutTransition;
|
||||
import android.content.Context;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.view.animation.Transformation;
|
||||
|
||||
public class DeactivatableViewPager extends ViewPager {
|
||||
public class DeactivatableViewPager extends ViewPager implements Animation.AnimationListener {
|
||||
|
||||
private View mCurrentView;
|
||||
private PagerAnimation mAnimation = new PagerAnimation();
|
||||
private boolean mAnimStarted = false;
|
||||
private long mAnimDuration = 100;
|
||||
|
||||
|
||||
public DeactivatableViewPager(Context context) {
|
||||
super(context);
|
||||
mAnimation.setAnimationListener(this);
|
||||
|
||||
setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||
// getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
|
||||
}
|
||||
|
||||
public DeactivatableViewPager(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mAnimation.setAnimationListener(this);
|
||||
|
||||
setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||
// getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -31,30 +47,113 @@ public class DeactivatableViewPager extends ViewPager {
|
||||
|
||||
@Override
|
||||
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
if (mCurrentView == null) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
return;
|
||||
}
|
||||
int height = 0;
|
||||
|
||||
if (!mAnimStarted && mCurrentView != null) {
|
||||
mCurrentView.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
|
||||
int h = mCurrentView.getMeasuredHeight();
|
||||
if (h > height) height = h;
|
||||
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
|
||||
int height = mCurrentView.getMeasuredHeight();
|
||||
|
||||
if (height < getMinimumHeight()) {
|
||||
height = getMinimumHeight();
|
||||
}
|
||||
|
||||
int newHeight = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
|
||||
if (/*getLayoutParams().height != 0 && */heightMeasureSpec != height && height > 0 && height < 100000) {
|
||||
// animate()
|
||||
// .y(height)
|
||||
// .withLayer()
|
||||
// .start();
|
||||
// mAnimation.setDimensions(height, getLayoutParams().height);
|
||||
// mAnimation.setDuration(mAnimDuration);
|
||||
// startAnimation(mAnimation);
|
||||
// mAnimStarted = true;
|
||||
} else {
|
||||
}
|
||||
heightMeasureSpec = newHeight;
|
||||
}
|
||||
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
|
||||
public void measureCurrentView(View currentView) {
|
||||
/**
|
||||
* This method should be called when the ViewPager changes to another page. For best results
|
||||
* call this method in the adapter's setPrimary
|
||||
*
|
||||
* @param currentView PagerAdapter item view
|
||||
*/
|
||||
public void onPageChanged(View currentView) {
|
||||
mCurrentView = currentView;
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
public int measureFragment(View view) {
|
||||
if (view == null)
|
||||
return 0;
|
||||
|
||||
view.measure(0, 0);
|
||||
return view.getMeasuredHeight();
|
||||
/**
|
||||
* Custom animation to animate the change of height in the
|
||||
*/
|
||||
private class PagerAnimation extends Animation {
|
||||
private int targetHeight;
|
||||
private int currentHeight;
|
||||
private int heightChange;
|
||||
|
||||
/**
|
||||
* Set the dimensions for the animation.
|
||||
*
|
||||
* @param targetHeight View's target height
|
||||
* @param currentHeight View's current height
|
||||
*/
|
||||
void setDimensions(int targetHeight, int currentHeight) {
|
||||
this.targetHeight = targetHeight;
|
||||
this.currentHeight = currentHeight;
|
||||
this.heightChange = targetHeight - currentHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyTransformation(float interpolatedTime, Transformation t) {
|
||||
if (interpolatedTime >= 1) {
|
||||
getLayoutParams().height = targetHeight;
|
||||
} else {
|
||||
int stepHeight = (int) (heightChange * interpolatedTime);
|
||||
getLayoutParams().height = currentHeight + stepHeight;
|
||||
}
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean willChangeBounds() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the duration of the animation.
|
||||
*
|
||||
* @param duration Duration in ms
|
||||
*/
|
||||
public void setAnimationDuration(long duration) {
|
||||
mAnimDuration = duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the interpolator used by the animation.
|
||||
*
|
||||
* @param interpolator {@link Interpolator}
|
||||
*/
|
||||
public void setAnimationInterpolator(Interpolator interpolator) {
|
||||
mAnimation.setInterpolator(interpolator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
mAnimStarted = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
mAnimStarted = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ public class DialogAskClienteAdapter extends PagerAdapter implements ViewPager.O
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
if(position != lastPage) {
|
||||
viewPager.measureCurrentView(mDatasetViews.get(position).getKey().getRoot());
|
||||
viewPager.onPageChanged(mDatasetViews.get(position).getKey().getRoot());
|
||||
mDatasetViews.get(position).getValue().onShow();
|
||||
lastPage = position;
|
||||
}
|
||||
|
||||
@ -27,6 +27,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
@ -84,6 +85,8 @@ public class DialogAskPositionOfLU {
|
||||
// mDialog.setCancelable(false);
|
||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
UtilityDialog.setTo90PercentSize(mContext, mDialog);
|
||||
|
||||
mDialog.setOnShowListener(dialog -> {
|
||||
((AppCompatTextView) adapter.getPage(0).findViewById(R.id.description_text)).setText(mCheckForLineaProd ? R.string.ask_production_line_of_lu_message : R.string.ask_position_of_lu_message);
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ public class DialogAskPositionOfLUAdapter extends PagerAdapter {
|
||||
this.mDatasetViews.add(view);
|
||||
|
||||
DeactivatableViewPager pager = (DeactivatableViewPager) container;
|
||||
pager.measureCurrentView(view);
|
||||
pager.onPageChanged(view);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@ -0,0 +1,88 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.basket_lu;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||
import it.integry.integrywmsnative.databinding.DialogBasketLuBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page1ViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page2ViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.pages.page1.DialogBasketLU_Page1_ListAdapter;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.pages.page1.DialogBasketLU_Page1_ViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.pages.page2.DialogBasketLU_Page2_ViewModel;
|
||||
|
||||
public class DialogBasketLU {
|
||||
|
||||
private Context mContext;
|
||||
private Dialog mDialog;
|
||||
private DialogBasketLuBinding mBinding;
|
||||
|
||||
private RunnableArgs<MtbColt> mOnComplete;
|
||||
|
||||
public static Dialog make(final Context context, RunnableArgs<MtbColt> onComplete) {
|
||||
return new DialogBasketLU(context, onComplete).mDialog;
|
||||
}
|
||||
|
||||
|
||||
private DialogBasketLU(Context context, RunnableArgs<MtbColt> onComplete) {
|
||||
mContext = context;
|
||||
mOnComplete = onComplete;
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_basket_lu, null, false);
|
||||
|
||||
mDialog = new Dialog(context);
|
||||
|
||||
mDialog.setContentView(mBinding.getRoot());
|
||||
|
||||
mDialog.setCanceledOnTouchOutside(false);
|
||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
UtilityDialog.setTo90PercentSize(context, mDialog);
|
||||
|
||||
this.initViewPager();
|
||||
}
|
||||
|
||||
private void initViewPager() {
|
||||
List<Map.Entry<Integer, Class>> views = new ArrayList<>();
|
||||
views.add(new AbstractMap.SimpleEntry<>(R.layout.dialog_basket_lu__page1, DialogBasketLU_Page1_ViewModel.class));
|
||||
views.add(new AbstractMap.SimpleEntry<>(R.layout.dialog_basket_lu__page2, DialogBasketLU_Page2_ViewModel.class));
|
||||
|
||||
DialogBasketLU_ViewPagerAdapter viewPagerAdapter = new DialogBasketLU_ViewPagerAdapter(mContext, views);
|
||||
mBinding.viewpager.setAdapter(viewPagerAdapter);
|
||||
mBinding.viewpager.beginFakeDrag();
|
||||
mBinding.viewpager.addOnPageChangeListener(viewPagerAdapter);
|
||||
mBinding.viewpager.setEnabled(false);
|
||||
|
||||
|
||||
mDialog.setOnShowListener(v -> {
|
||||
viewPagerAdapter.getViewModel(R.layout.dialog_basket_lu__page2).setOnConfirmClickListener(data -> {
|
||||
MtbColt mtbColt = (MtbColt) data;
|
||||
|
||||
mOnComplete.run(mtbColt);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,131 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.basket_lu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.ui.DeactivatableViewPager;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.IDialogAskClienteViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.interfaces.IDialogBasketLUViewModel;
|
||||
|
||||
public class DialogBasketLU_ViewPagerAdapter extends PagerAdapter implements ViewPager.OnPageChangeListener {
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private List<Map.Entry<Integer, Class>> mDatasetLayout;
|
||||
private List<Map.Entry<ViewDataBinding, IDialogBasketLUViewModel>> mDatasetViews;
|
||||
|
||||
private DeactivatableViewPager viewPager;
|
||||
|
||||
public DialogBasketLU_ViewPagerAdapter(Context context, List<Map.Entry<Integer, Class>> datasetLayouts) {
|
||||
this.mContext = context;
|
||||
this.mDatasetLayout = datasetLayouts;
|
||||
this.mDatasetViews = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View instantiateItem(ViewGroup container, int position) {
|
||||
viewPager = (DeactivatableViewPager) container;
|
||||
|
||||
Integer viewId = mDatasetLayout.get(position).getKey();
|
||||
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||
ViewDataBinding mBinding = DataBindingUtil.inflate(inflater, viewId, null, false);
|
||||
|
||||
Class viewModelClass = mDatasetLayout.get(position).getValue();
|
||||
IDialogBasketLUViewModel viewModel = null;
|
||||
|
||||
try {
|
||||
viewModel = (IDialogBasketLUViewModel) viewModelClass.newInstance();
|
||||
viewModel.setBinding(mBinding);
|
||||
viewModel.setContext(mContext);
|
||||
viewModel.setOnDone(data -> {
|
||||
int newIndex = viewPager.getCurrentItem() + 1;
|
||||
|
||||
if(newIndex <= getCount()) {
|
||||
this.mDatasetViews.get(newIndex).getValue().setInputData(data);
|
||||
this.mDatasetViews.get(newIndex).getValue().onPreShow();
|
||||
viewPager.setCurrentItem(newIndex, true);
|
||||
}
|
||||
});
|
||||
viewModel.setOnPrev(() -> {
|
||||
int newIndex = viewPager.getCurrentItem() - 1;
|
||||
|
||||
if(newIndex >= 0) {
|
||||
viewPager.setCurrentItem(newIndex, true);
|
||||
}
|
||||
});
|
||||
} catch (IllegalAccessException | InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
mBinding.setVariable(it.integry.integrywmsnative.BR.viewmodel, viewModel);
|
||||
|
||||
container.addView(mBinding.getRoot());
|
||||
this.mDatasetViews.add(new AbstractMap.SimpleEntry<>(mBinding, viewModel));
|
||||
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyItem(ViewGroup container, int position, Object object) {
|
||||
container.removeView((LinearLayout)object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isViewFromObject(@NonNull View view, @NonNull Object o) {
|
||||
return view == o;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mDatasetLayout.size();
|
||||
}
|
||||
|
||||
public IDialogBasketLUViewModel getViewModel(@NonNull int layoutID) {
|
||||
for(int i = 0; i < mDatasetLayout.size(); i++) {
|
||||
if(mDatasetLayout.get(i).getKey() == layoutID) {
|
||||
return this.mDatasetViews.get(i).getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private int lastPage = -1;
|
||||
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
if(position != lastPage) {
|
||||
mDatasetViews.get(position).getValue().onShow();
|
||||
viewPager.onPageChanged(mDatasetViews.get(position).getKey().getRoot());
|
||||
lastPage = position;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
// mDatasetViews.get(position).getValue().onShow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.basket_lu.interfaces;
|
||||
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public abstract class DialogBasketLU_BaseViewModel implements IDialogBasketLUViewModel {
|
||||
|
||||
private Runnable mOnPrev;
|
||||
private RunnableArgs<Object> mOnDone;
|
||||
|
||||
@Override
|
||||
public void setOnPrev(Runnable onPrev) {
|
||||
this.mOnPrev = onPrev;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnDone(RunnableArgs<Object> onDone) {
|
||||
this.mOnDone = onDone;
|
||||
}
|
||||
|
||||
|
||||
protected void done(Object data) {
|
||||
if(this.mOnDone != null) mOnDone.run(data);
|
||||
}
|
||||
|
||||
protected void previous() {
|
||||
mOnPrev.run();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.basket_lu.interfaces;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public interface IDialogBasketLUViewModel {
|
||||
|
||||
void setContext(Context context);
|
||||
|
||||
void setBinding(ViewDataBinding binding);
|
||||
|
||||
void setInputData(Object data);
|
||||
|
||||
void onShow();
|
||||
|
||||
void onPreShow();
|
||||
|
||||
void setOnConfirmClickListener(RunnableArgs<Object> onConfirm);
|
||||
|
||||
void setOnAbortClickListener(Runnable onAbort);
|
||||
|
||||
void setOnPrev(Runnable onPrev);
|
||||
|
||||
void setOnDone(RunnableArgs<Object> onDone);
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.basket_lu.pages.page1;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.DialogBasketLuMtbColtModelBinding;
|
||||
|
||||
public class DialogBasketLU_Page1_ListAdapter extends RecyclerView.Adapter<DialogBasketLU_Page1_ListAdapter.ViewHolder> {
|
||||
|
||||
protected Context mContext;
|
||||
|
||||
private List<MtbColt> mDataset;
|
||||
private IRecyclerItemClicked<MtbColt> mOnItemClickListener;
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
protected DialogBasketLuMtbColtModelBinding mViewDataBinding;
|
||||
|
||||
|
||||
public ViewHolder(DialogBasketLuMtbColtModelBinding v) {
|
||||
super(v.getRoot());
|
||||
mViewDataBinding = v;
|
||||
}
|
||||
|
||||
public void bind(MtbColt mtbColt) {
|
||||
mViewDataBinding.setMtbColt(mtbColt);
|
||||
mViewDataBinding.executePendingBindings();
|
||||
}
|
||||
}
|
||||
|
||||
public DialogBasketLU_Page1_ListAdapter(Context context, List<MtbColt> myDataset, IRecyclerItemClicked<MtbColt> onItemClickListener) {
|
||||
mContext = context;
|
||||
mDataset = myDataset;
|
||||
mOnItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialogBasketLU_Page1_ListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
// create a new view
|
||||
DialogBasketLuMtbColtModelBinding viewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.dialog_basket_lu__mtb_colt_model, parent, false);
|
||||
|
||||
return new ViewHolder(viewDataBinding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(DialogBasketLU_Page1_ListAdapter.ViewHolder holder, int position) {
|
||||
MtbColt item = mDataset.get(position);
|
||||
holder.bind(item);
|
||||
|
||||
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
||||
if(mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(item, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewRecycled(DialogBasketLU_Page1_ListAdapter.ViewHolder holder) {
|
||||
super.onViewRecycled(holder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDataset.size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.basket_lu.pages.page1;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.databinding.DialogBasketLuBinding;
|
||||
import it.integry.integrywmsnative.databinding.DialogBasketLuPage1Binding;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.interfaces.DialogBasketLU_BaseViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.interfaces.IDialogBasketLUViewModel;
|
||||
|
||||
public class DialogBasketLU_Page1_ViewModel extends DialogBasketLU_BaseViewModel implements IDialogBasketLUViewModel {
|
||||
|
||||
private Context mContext;
|
||||
private DialogBasketLuPage1Binding mBinding;
|
||||
|
||||
private List<MtbColt> availableMtbColts;
|
||||
private DialogBasketLU_Page1_ListAdapter mAdapter;
|
||||
|
||||
@Override
|
||||
public void setContext(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBinding(ViewDataBinding binding) {
|
||||
this.mBinding = (DialogBasketLuPage1Binding) binding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInputData(Object data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow() {
|
||||
ColliMagazzinoRESTConsumer.retrieveBasketColli(mtbColts -> {
|
||||
availableMtbColts = mtbColts;
|
||||
if(mtbColts != null && mtbColts.size() > 0) initRecyclerView(availableMtbColts);
|
||||
|
||||
mBinding.emptyView.setVisibility(mtbColts != null && mtbColts.size() > 0 ? View.GONE : View.VISIBLE);
|
||||
}, ex -> {
|
||||
mBinding.emptyView.setVisibility(View.VISIBLE);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreShow() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnConfirmClickListener(RunnableArgs<Object> onConfirm) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnAbortClickListener(Runnable onAbort) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void initRecyclerView(List<MtbColt> dataset) {
|
||||
mBinding.dialogBasketLuMainList.setNestedScrollingEnabled(false);
|
||||
mBinding.dialogBasketLuMainList.setHasFixedSize(true);
|
||||
mBinding.dialogBasketLuMainList.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
|
||||
DividerItemDecoration itemDecorator = new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(mContext, R.drawable.divider));
|
||||
mBinding.dialogBasketLuMainList.addItemDecoration(itemDecorator);
|
||||
|
||||
mAdapter = new DialogBasketLU_Page1_ListAdapter(mContext, dataset, (item, position) -> {
|
||||
this.done(item);
|
||||
});
|
||||
|
||||
mBinding.dialogBasketLuMainList.setAdapter(mAdapter);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.basket_lu.pages.page2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
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.DialogBasketLuMtbColrModelBinding;
|
||||
|
||||
public class DialogBasketLU_Page2_ListAdapter extends RecyclerView.Adapter<DialogBasketLU_Page2_ListAdapter.ViewHolder>{
|
||||
|
||||
protected Context mContext;
|
||||
|
||||
private List<MtbColr> mDataset;
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
protected DialogBasketLuMtbColrModelBinding mViewDataBinding;
|
||||
|
||||
|
||||
public ViewHolder(DialogBasketLuMtbColrModelBinding v) {
|
||||
super(v.getRoot());
|
||||
mViewDataBinding = v;
|
||||
}
|
||||
|
||||
public void bind(MtbColr mtbColt) {
|
||||
mViewDataBinding.setMtbColr(mtbColt);
|
||||
mViewDataBinding.executePendingBindings();
|
||||
}
|
||||
}
|
||||
|
||||
public DialogBasketLU_Page2_ListAdapter(Context context, List<MtbColr> myDataset) {
|
||||
mContext = context;
|
||||
mDataset = myDataset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialogBasketLU_Page2_ListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
// create a new view
|
||||
DialogBasketLuMtbColrModelBinding viewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.dialog_basket_lu__mtb_colr_model, parent, false);
|
||||
|
||||
return new ViewHolder(viewDataBinding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(DialogBasketLU_Page2_ListAdapter.ViewHolder holder, int position) {
|
||||
MtbColr mtbColr = mDataset.get(position);
|
||||
holder.bind(mtbColr);
|
||||
|
||||
//Setting qty with unt_mis
|
||||
if(!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissa())){
|
||||
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
||||
|
||||
if(mtbColr.getMtbAart() != null) {
|
||||
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
||||
}
|
||||
|
||||
holder.mViewDataBinding.qtaTextview.setText(text);
|
||||
} else {
|
||||
holder.mViewDataBinding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewRecycled(DialogBasketLU_Page2_ListAdapter.ViewHolder holder) {
|
||||
super.onViewRecycled(holder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDataset.size();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.basket_lu.pages.page2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.DialogBasketLuPage2Binding;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.interfaces.DialogBasketLU_BaseViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.interfaces.IDialogBasketLUViewModel;
|
||||
|
||||
public class DialogBasketLU_Page2_ViewModel extends DialogBasketLU_BaseViewModel implements IDialogBasketLUViewModel {
|
||||
|
||||
private Context mContext;
|
||||
private DialogBasketLuPage2Binding mBinding;
|
||||
|
||||
private MtbColt mMtbColt;
|
||||
private DialogBasketLU_Page2_ListAdapter mAdapter;
|
||||
|
||||
private RunnableArgs<Object> mOnConfirm;
|
||||
|
||||
@Override
|
||||
public void setContext(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBinding(ViewDataBinding binding) {
|
||||
this.mBinding = (DialogBasketLuPage2Binding) binding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInputData(Object data) {
|
||||
mMtbColt = (MtbColt) data;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreShow() {
|
||||
if(mMtbColt != null && mMtbColt.getMtbColr() != null && mMtbColt.getMtbColr().size() > 0) initRecyclerView(mMtbColt.getMtbColr());
|
||||
mBinding.emptyView.setVisibility(mMtbColt != null && mMtbColt.getMtbColr() != null && mMtbColt.getMtbColr().size() > 0 ? View.GONE : View.VISIBLE);
|
||||
|
||||
mBinding.buttonAbort.setOnClickListener(v -> {
|
||||
previous();
|
||||
});
|
||||
|
||||
mBinding.buttonConfirm.setOnClickListener(v -> {
|
||||
mOnConfirm.run(mMtbColt);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnConfirmClickListener(RunnableArgs<Object> onConfirm) {
|
||||
mOnConfirm = onConfirm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnAbortClickListener(Runnable onAbort) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initRecyclerView(List<MtbColr> dataset) {
|
||||
mBinding.dialogBasketLuMtbColrList.setNestedScrollingEnabled(false);
|
||||
mBinding.dialogBasketLuMtbColrList.setHasFixedSize(true);
|
||||
mBinding.dialogBasketLuMtbColrList.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
|
||||
DividerItemDecoration itemDecorator = new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(mContext, R.drawable.divider));
|
||||
mBinding.dialogBasketLuMtbColrList.addItemDecoration(itemDecorator);
|
||||
|
||||
mAdapter = new DialogBasketLU_Page2_ListAdapter(mContext, dataset);
|
||||
|
||||
mBinding.dialogBasketLuMtbColrList.setAdapter(mAdapter);
|
||||
}
|
||||
}
|
||||
@ -35,6 +35,7 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.DialogScanOrCreateLuBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLU;
|
||||
|
||||
public class DialogScanOrCreateLU {
|
||||
|
||||
@ -54,18 +55,18 @@ public class DialogScanOrCreateLU {
|
||||
|
||||
|
||||
public static Dialog make(final Context context, RunnableArgs<MtbColt> onDialogDismiss) {
|
||||
return new DialogScanOrCreateLU(context, false, true, true, onDialogDismiss).mDialog;
|
||||
return new DialogScanOrCreateLU(context, false, true, true, true, onDialogDismiss).mDialog;
|
||||
}
|
||||
|
||||
public static Dialog make(final Context context, boolean disableCreation, boolean shouldCheckIfExistDoc, RunnableArgs<MtbColt> onDialogDismiss) {
|
||||
return new DialogScanOrCreateLU(context, disableCreation, true, shouldCheckIfExistDoc, onDialogDismiss).mDialog;
|
||||
public static Dialog make(final Context context, boolean enableCreation, boolean shouldCheckIfExistDoc, RunnableArgs<MtbColt> onDialogDismiss) {
|
||||
return new DialogScanOrCreateLU(context, false, enableCreation, true, shouldCheckIfExistDoc, onDialogDismiss).mDialog;
|
||||
}
|
||||
|
||||
public static Dialog make(final Context context, boolean disableCreation, boolean checkResiduo, boolean shouldCheckIfExistDoc, RunnableArgs<MtbColt> onDialogDismiss) {
|
||||
return new DialogScanOrCreateLU(context, disableCreation, checkResiduo, shouldCheckIfExistDoc, onDialogDismiss).mDialog;
|
||||
public static Dialog make(final Context context, boolean enableBasket, boolean enableCreation, boolean checkResiduo, boolean shouldCheckIfExistDoc, RunnableArgs<MtbColt> onDialogDismiss) {
|
||||
return new DialogScanOrCreateLU(context, enableBasket, enableCreation, checkResiduo, shouldCheckIfExistDoc, onDialogDismiss).mDialog;
|
||||
}
|
||||
|
||||
private DialogScanOrCreateLU(Context context, boolean disableCreation, boolean checkResiduo, boolean shouldCheckIfExistDoc, RunnableArgs<MtbColt> onDialogDismiss) {
|
||||
private DialogScanOrCreateLU(Context context, boolean enableBasket, boolean enableCreation, boolean checkResiduo, boolean shouldCheckIfExistDoc, RunnableArgs<MtbColt> onDialogDismiss) {
|
||||
mOnDialogDismiss = null;
|
||||
currentMtbColt = null;
|
||||
mShouldCheckResiduo = checkResiduo;
|
||||
@ -77,7 +78,8 @@ public class DialogScanOrCreateLU {
|
||||
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_scan_or_create_lu, null, false);
|
||||
|
||||
if(disableCreation) mBinding.dialogScanOrCreateLuCreationLayout.setVisibility(View.GONE);
|
||||
mBinding.dialogScanOrCreateLuCreationLayout.setVisibility(enableCreation ? View.VISIBLE : View.GONE);
|
||||
mBinding.dialogScanOrCreateLuBasketLayout.setVisibility(enableBasket ? View.VISIBLE : View.GONE);
|
||||
|
||||
mDialog = new Dialog(context);
|
||||
mDialog.setContentView(mBinding.getRoot());
|
||||
@ -102,6 +104,12 @@ public class DialogScanOrCreateLU {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
});
|
||||
});
|
||||
|
||||
mBinding.viewBasket.setOnClickListener(v -> {
|
||||
DialogBasketLU.make(mContext, mtbColt -> {
|
||||
sendMtbColt(mtbColt, null);
|
||||
}).show();
|
||||
});
|
||||
}
|
||||
|
||||
private void initBarcode(Context context) {
|
||||
@ -275,7 +283,7 @@ public class DialogScanOrCreateLU {
|
||||
|
||||
private void sendMtbColt(MtbColt mtbColtToSend, Dialog progressDialog) {
|
||||
currentMtbColt = mtbColtToSend;
|
||||
progressDialog.dismiss();
|
||||
if(progressDialog != null) progressDialog.dismiss();
|
||||
mDialog.dismiss();
|
||||
mOnDialogDismiss.run(mtbColtToSend);
|
||||
}
|
||||
|
||||
BIN
app/src/main/res/drawable/ic_black_back.png
Normal file
BIN
app/src/main/res/drawable/ic_black_back.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 490 B |
BIN
app/src/main/res/drawable/ic_black_shopping_cart.png
Normal file
BIN
app/src/main/res/drawable/ic_black_shopping_cart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable/ic_black_tick.png
Normal file
BIN
app/src/main/res/drawable/ic_black_tick.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 484 B |
@ -3,9 +3,10 @@
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
@ -23,38 +24,37 @@
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_error_white_24dp"
|
||||
android:layout_margin="24dp"/>
|
||||
android:layout_margin="24dp"
|
||||
android:src="@drawable/ic_error_white_24dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingRight="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/TextViewMaterial.DialogTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial.DialogTitle"
|
||||
android:text="@string/action_print"
|
||||
android:gravity="center_horizontal"/>
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/action_print" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description_text"
|
||||
style="@style/TextViewMaterial"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial"
|
||||
android:text="@string/message_print_packing_list"
|
||||
android:gravity="left"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="left"
|
||||
android:text="@string/message_print_packing_list" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@ -67,34 +67,34 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_abort"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:strokeColor="@color/colorPrimary"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:text="@string/no"
|
||||
app:layout_constraintEnd_toStartOf="@id/center_buttons_guideline"
|
||||
android:text="@string/no"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeColor="@color/colorPrimary" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_confirm"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/center_buttons_guideline"
|
||||
android:text="@string/yes"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="@string/yes"/>
|
||||
app:layout_constraintStart_toStartOf="@id/center_buttons_guideline"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -142,7 +142,6 @@
|
||||
<!--</LinearLayout>-->
|
||||
|
||||
|
||||
|
||||
<!--<LinearLayout-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
@ -173,6 +172,6 @@
|
||||
<!--</LinearLayout>-->
|
||||
|
||||
<!--</LinearLayout>-->
|
||||
<!--</androidx.cardview.widget.CardView>-->
|
||||
<!--</androidx.cardview.widget.CardView>-->
|
||||
|
||||
</layout>
|
||||
52
app/src/main/res/layout/dialog_basket_lu.xml
Normal file
52
app/src/main/res/layout/dialog_basket_lu.xml
Normal file
@ -0,0 +1,52 @@
|
||||
<?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:id="@+id/base_root"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial.DialogTitle"
|
||||
android:text="@string/basket"
|
||||
android:gravity="center_horizontal"/>
|
||||
|
||||
<it.integry.integrywmsnative.ui.DeactivatableViewPager
|
||||
android:id="@+id/viewpager"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</it.integry.integrywmsnative.ui.DeactivatableViewPager>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</layout>
|
||||
139
app/src/main/res/layout/dialog_basket_lu__mtb_colr_model.xml
Normal file
139
app/src/main/res/layout/dialog_basket_lu__mtb_colr_model.xml
Normal file
@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<data>
|
||||
<import type="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
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
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">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mart"
|
||||
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"
|
||||
tools:text="COD MART" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/diacod"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{`(` + mtbColr.mtbAart.diacod + `)`}"
|
||||
android:textColor="@color/red_600"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_toEndOf="@id/cod_mart"
|
||||
android:visibility="@{(mtbColr.mtbAart != null && !UtilityString.isNullOrEmpty(mtbColr.mtbAart.diacod)) ? View.VISIBLE : View.GONE}"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
tools:text="(12345)" />
|
||||
|
||||
|
||||
|
||||
<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.isFlagQtaCnfFissa()) ? 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="2"
|
||||
android:text="@{mtbColr.getDescrizione()}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
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.GONE : 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"
|
||||
tools:text="280.45\nCONF" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
104
app/src/main/res/layout/dialog_basket_lu__mtb_colt_model.xml
Normal file
104
app/src/main/res/layout/dialog_basket_lu__mtb_colt_model.xml
Normal file
@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.model.MtbColt" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityDate" />
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="mtbColt"
|
||||
type="MtbColt" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:clickable="true"
|
||||
android:background="@drawable/ripple_effect">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@{mtbColt.numCollo.toString()}"
|
||||
tools:text="22222"
|
||||
android:background="@drawable/badge1_round_corner"
|
||||
android:textColor="@android:color/white"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_toStartOf="@id/posizione_collo"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:text="@{mtbColt.getDataColloHumanLong()}"
|
||||
tools:text="28 ottobre 2018" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/posizione_collo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@{mtbColt.posizione}"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.posizione) ? View.INVISIBLE : View.VISIBLE}"
|
||||
tools:text="A01F01C01L01" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:text="@{`Preparato da: ` + mtbColt.preparatoDa}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.preparatoDa) ? View.INVISIBLE : View.VISIBLE}"
|
||||
tools:text="Preparato da: Lisa Sportelli" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
72
app/src/main/res/layout/dialog_basket_lu__page1.xml
Normal file
72
app/src/main/res/layout/dialog_basket_lu__page1.xml
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/dialog_basket_lu__main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.2" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.15" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.85" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_box"
|
||||
android:tint="@android:color/black"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="@android:color/black"
|
||||
android:text="@string/no_lu_found_message"
|
||||
android:layout_marginTop="16dp"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
121
app/src/main/res/layout/dialog_basket_lu__page2.xml
Normal file
121
app/src/main/res/layout/dialog_basket_lu__page2.xml
Normal file
@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/dialog_basket_lu__mtb_colr_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.2" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.15" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.85" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_box"
|
||||
android:tint="@android:color/black" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/no_lu_found_message"
|
||||
android:textColor="@android:color/black" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/center_buttons_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/button_abort"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/back"
|
||||
app:icon="@drawable/ic_black_back"
|
||||
app:iconSize="24dp"
|
||||
app:iconGravity="textStart"
|
||||
app:layout_constraintEnd_toStartOf="@id/center_buttons_guideline"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeColor="@color/colorPrimary" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_confirm"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/use"
|
||||
app:icon="@drawable/ic_black_tick"
|
||||
app:iconSize="24dp"
|
||||
app:iconGravity="textStart"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/center_buttons_guideline"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@ -95,8 +95,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/dialog_scan_or_create_lu__creation_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
|
||||
@ -136,6 +135,51 @@
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/dialog_scan_or_create_lu__basket_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_gravity="center_horizontal"
|
||||
style="@style/TextViewMaterial"
|
||||
android:text="OPPURE" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/view_basket"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/button_view_basket_ul"
|
||||
app:iconSize="24dp"
|
||||
app:icon="@drawable/ic_black_shopping_cart"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<data>
|
||||
<variable
|
||||
name="viewmodel"
|
||||
type="it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreFragment" />
|
||||
type="it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.core.UltimiArriviFornitoreViewModel" />
|
||||
</data>
|
||||
|
||||
|
||||
|
||||
@ -64,8 +64,8 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_toLeftOf="@id/posizione_collo"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toStartOf="@id/posizione_collo"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
<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" />
|
||||
@ -26,28 +27,54 @@
|
||||
app:layout_constraintEnd_toStartOf="@+id/qta_box"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mart"
|
||||
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"
|
||||
tools:text="COD MART" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/diacod"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{`(` + mtbColr.mtbAart.diacod + `)`}"
|
||||
android:textColor="@color/red_600"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_toEndOf="@id/cod_mart"
|
||||
android:visibility="@{(mtbColr.mtbAart != null && !UtilityString.isNullOrEmpty(mtbColr.mtbAart.diacod)) ? View.VISIBLE : View.GONE}"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
tools:text="(12345)" />
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{mtbColr.codMart}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:text="@{UtilityNumber.decimalToString(mtbColr.qtaCol) + mtbColr.mtbAart.untMis}"
|
||||
android:visibility="@{SettingsManager.iDB().isFlagForceAllToColli() || (mtbColr.mtbAart != null && !mtbColr.mtbAart.isFlagQtaCnfFissa()) ? View.VISIBLE : View.GONE}"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="COD MART"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
||||
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" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:text='@{!UtilityString.isNullOrEmpty(mtbColr.mtbAart.diacod) ? mtbColr.mtbAart.diacod : ""}'
|
||||
android:textColor="@color/red_600"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColr.mtbAart.diacod) ? View.GONE : View.VISIBLE}"
|
||||
tools:text="DIACOD HERE"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@ -97,8 +124,8 @@
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
android:textAllCaps="true"
|
||||
tools:text="280.45\nCONF"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
tools:text="280.45\nCONF" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@ -238,6 +238,7 @@
|
||||
<string name="placement">Posizionamento</string>
|
||||
<string name="message_print_packing_list">Vuoi procedere con la stampa di una %s</string>
|
||||
<string name="button_create_new_ul">Crea nuova UL</string>
|
||||
<string name="button_view_basket_ul">Visualizza basket</string>
|
||||
<string name="title_open_lu">Apri UL</string>
|
||||
<string name="fragment_ultime_consegne_cliente_title">Resi su ultime consegne</string>
|
||||
<string name="ultime_consegne_cliente_title">Ultime consegne</string>
|
||||
@ -302,4 +303,7 @@
|
||||
<string name="distribute_ul">Distribuisci quantità</string>
|
||||
<string name="article">Articolo</string>
|
||||
<string name="title_dynamic_saporiveri">Personalizzazione SaporiVeri</string>
|
||||
<string name="basket">Basket</string>
|
||||
<string name="use">Usa</string>
|
||||
<string name="back">Indietro</string>
|
||||
</resources>
|
||||
@ -167,7 +167,8 @@
|
||||
<string name="no_item_to_pick_text">No items to pick</string>
|
||||
<string name="no_docs_to_show_text">No documents to show</string>
|
||||
<string name="no_orders_to_pick_text">No orders to dispatch</string>
|
||||
.<string name="no_available_order_on_line">no compatible orders found</string>
|
||||
.
|
||||
<string name="no_available_order_on_line">no compatible orders found</string>
|
||||
<string name="no_item_text">No items</string>
|
||||
<string name="no_item_in_recupera_materiale">No LU poured into production</string>
|
||||
|
||||
@ -241,6 +242,7 @@
|
||||
<string name="placement">Placement</string>
|
||||
<string name="message_print_packing_list">Do you want print a %s?</string>
|
||||
<string name="button_create_new_ul">Create new LU</string>
|
||||
<string name="button_view_basket_ul">View basket</string>
|
||||
<string name="title_open_lu">Open LU</string>
|
||||
|
||||
<string name="fragment_ultime_consegne_cliente_title">Returns on latest deliveries</string>
|
||||
@ -307,4 +309,7 @@
|
||||
<string name="title_dynamic_saporiveri">SaporVeri Customization</string>
|
||||
<string name="distribute_ul">Distribute quantity</string>
|
||||
<string name="article">Article</string>
|
||||
<string name="basket">Basket</string>
|
||||
<string name="use">Use</string>
|
||||
<string name="back">Back</string>
|
||||
</resources>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user