Completata rettifica giacenze
This commit is contained in:
parent
7d1d01f006
commit
7c394d3d78
@ -17,7 +17,8 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/Light">
|
android:theme="@style/Light"
|
||||||
|
android:windowSoftInputMode="adjustPan">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|||||||
@ -32,12 +32,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
|
|
||||||
public static void createColloLavorazione(RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void createColloLavorazione(RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.setGestione("L")
|
.setGestione(GestioneEnum.LAVORAZIONE);
|
||||||
.setDataCollo(new Date())
|
|
||||||
.setCodMdep(SettingsManager.i().userSession.depo.getCodMdep())
|
|
||||||
.setPreparatoDa(SettingsManager.i().user.fullname)
|
|
||||||
.setOraInizPrep(new Date())
|
|
||||||
.setCodAnag(SettingsManager.iDB().getDefaultCodAnag());
|
|
||||||
|
|
||||||
mtbColtToCreate
|
mtbColtToCreate
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
@ -60,12 +55,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
public static void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, String gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, String gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.setGestione(gestione)
|
.setGestione(gestione);
|
||||||
.setDataCollo(new Date())
|
|
||||||
.setCodMdep(SettingsManager.i().userSession.depo.getCodMdep())
|
|
||||||
.setPreparatoDa(SettingsManager.i().user.fullname)
|
|
||||||
.setOraInizPrep(new Date())
|
|
||||||
.setCodAnag(SettingsManager.iDB().getDefaultCodAnag());
|
|
||||||
|
|
||||||
Integer customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO);
|
Integer customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO);
|
||||||
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
public class MtbAartWithFornitore extends MtbAart {
|
||||||
|
|
||||||
|
private String codArtFor;
|
||||||
|
|
||||||
|
public String getCodArtFor() {
|
||||||
|
return codArtFor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAartWithFornitore setCodArtFor(String codArtFor) {
|
||||||
|
this.codArtFor = codArtFor;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
|
||||||
|
public class MtbCols extends EntityBase {
|
||||||
|
|
||||||
|
private String dataCollo;
|
||||||
|
private String gestione;
|
||||||
|
private Integer idRiga;
|
||||||
|
private Integer numCollo;
|
||||||
|
private String serCollo;
|
||||||
|
private String codMdep;
|
||||||
|
private String dataMove;
|
||||||
|
private String modificatoDa;
|
||||||
|
private String posizione;
|
||||||
|
private String causale;
|
||||||
|
|
||||||
|
public MtbCols() {
|
||||||
|
type = "mtb_cols";
|
||||||
|
setCodMdep(SettingsManager.i().userSession.depo.getCodMdep());
|
||||||
|
setModificatoDa(SettingsManager.i().user.fullname);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataCollo() {
|
||||||
|
return dataCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setDataCollo(String dataCollo) {
|
||||||
|
this.dataCollo = dataCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIdRiga() {
|
||||||
|
return idRiga;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setIdRiga(Integer idRiga) {
|
||||||
|
this.idRiga = idRiga;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumCollo() {
|
||||||
|
return numCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setNumCollo(Integer numCollo) {
|
||||||
|
this.numCollo = numCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerCollo() {
|
||||||
|
return serCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setSerCollo(String serCollo) {
|
||||||
|
this.serCollo = serCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataMove() {
|
||||||
|
return dataMove;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setDataMove(String dataMove) {
|
||||||
|
this.dataMove = dataMove;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModificatoDa() {
|
||||||
|
return modificatoDa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setModificatoDa(String modificatoDa) {
|
||||||
|
this.modificatoDa = modificatoDa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCausale() {
|
||||||
|
return causale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setCausale(String causale) {
|
||||||
|
this.causale = causale;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,6 +14,7 @@ import java.util.List;
|
|||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
|
||||||
@ -56,6 +57,8 @@ public class MtbColt extends EntityBase implements Parcelable {
|
|||||||
private BigDecimal larghezzaCm;
|
private BigDecimal larghezzaCm;
|
||||||
private BigDecimal altezzaCm;
|
private BigDecimal altezzaCm;
|
||||||
|
|
||||||
|
public List<MtbCols> mtbCols;
|
||||||
|
|
||||||
private Boolean disablePrint;
|
private Boolean disablePrint;
|
||||||
|
|
||||||
protected MtbColt(Parcel in) {
|
protected MtbColt(Parcel in) {
|
||||||
@ -285,6 +288,12 @@ public class MtbColt extends EntityBase implements Parcelable {
|
|||||||
|
|
||||||
public MtbColt(){
|
public MtbColt(){
|
||||||
type = "mtb_colt";
|
type = "mtb_colt";
|
||||||
|
setDataCollo(new Date());
|
||||||
|
setSerCollo("/");
|
||||||
|
setCodMdep(SettingsManager.i().userSession.depo.getCodMdep());
|
||||||
|
setPreparatoDa(SettingsManager.i().user.fullname);
|
||||||
|
setOraInizPrep(new Date());
|
||||||
|
setCodAnag(SettingsManager.iDB().getDefaultCodAnag());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -638,8 +647,18 @@ public class MtbColt extends EntityBase implements Parcelable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<MtbCols> getMtbCols() {
|
||||||
|
return mtbCols;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setMtbCols(List<MtbCols> mtbCols) {
|
||||||
|
this.mtbCols = mtbCols;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean getDisablePrint() {
|
public Boolean getDisablePrint() {
|
||||||
return disablePrint;
|
return disablePrint == null ? false : disablePrint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt setDisablePrint(Boolean disablePrint) {
|
public MtbColt setDisablePrint(Boolean disablePrint) {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ public class ReportManager {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LAVORAZIONE:
|
case LAVORAZIONE:
|
||||||
onFailed.run(new Exception("Etichetta non definita"));
|
onComplete.run("EtichettaInventario");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VENDITA:
|
case VENDITA:
|
||||||
|
|||||||
@ -12,6 +12,7 @@ public class DBSettingsModel {
|
|||||||
private boolean enableCheckPartitaMagCheckPickingV;
|
private boolean enableCheckPartitaMagCheckPickingV;
|
||||||
private boolean flagMultiClienteOrdV;
|
private boolean flagMultiClienteOrdV;
|
||||||
private String defaultCodAnag;
|
private String defaultCodAnag;
|
||||||
|
private String defaultCausaleRettificaGiacenze;
|
||||||
|
|
||||||
public List<String> getAvailableProfiles() {
|
public List<String> getAvailableProfiles() {
|
||||||
return availableProfiles;
|
return availableProfiles;
|
||||||
@ -55,4 +56,13 @@ public class DBSettingsModel {
|
|||||||
this.defaultCodAnag = defaultCodAnag;
|
this.defaultCodAnag = defaultCodAnag;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDefaultCausaleRettificaGiacenze() {
|
||||||
|
return defaultCausaleRettificaGiacenze;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setDefaultCausaleRettificaGiacenze(String defaultCausaleRettificaGiacenze) {
|
||||||
|
this.defaultCausaleRettificaGiacenze = defaultCausaleRettificaGiacenze;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,16 +130,23 @@ public class SettingsManager {
|
|||||||
|
|
||||||
|
|
||||||
private static void loadGestSetupValues(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private static void loadGestSetupValues(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
GestSetupRESTConsumer.getBooleanValue("PICKING", "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", valueEnableCheckPartitaMag -> {
|
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", valueDefaultCausaleRettificaGiacenze -> {
|
||||||
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(valueEnableCheckPartitaMag);
|
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(valueDefaultCausaleRettificaGiacenze.value);
|
||||||
|
|
||||||
GestSetupRESTConsumer.getBooleanValue("PICKING", "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", valueFlagMultiClienteOrdVendita -> {
|
GestSetupRESTConsumer.getBooleanValue("PICKING", "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", valueEnableCheckPartitaMag -> {
|
||||||
|
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(valueEnableCheckPartitaMag);
|
||||||
|
|
||||||
|
GestSetupRESTConsumer.getBooleanValue("PICKING", "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", valueFlagMultiClienteOrdVendita -> {
|
||||||
dbSettingsModelIstance.setFlagMultiClienteOrdV(valueFlagMultiClienteOrdVendita);
|
dbSettingsModelIstance.setFlagMultiClienteOrdV(valueFlagMultiClienteOrdVendita);
|
||||||
|
|
||||||
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "COD_ANAG_DEFAULT", valueCodAnagDefault -> {
|
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "COD_ANAG_DEFAULT", valueCodAnagDefault -> {
|
||||||
dbSettingsModelIstance.setDefaultCodAnag(valueCodAnagDefault.value);
|
dbSettingsModelIstance.setDefaultCodAnag(valueCodAnagDefault.value);
|
||||||
|
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}, ex -> {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
});
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if(onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -383,14 +383,10 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
|||||||
if(defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value)) defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
if(defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value)) defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
||||||
|
|
||||||
MtbColt mtbColt = new MtbColt();
|
MtbColt mtbColt = new MtbColt();
|
||||||
mtbColt .setDataCollo(new Date())
|
mtbColt .setGestione(GestioneEnum.ACQUISTO)
|
||||||
.setGestione(GestioneEnum.ACQUISTO)
|
|
||||||
.setCodMdep(SettingsManager.i().userSession.depo.getCodMdep())
|
|
||||||
.setPreparatoDa(SettingsManager.i().user.fullname)
|
.setPreparatoDa(SettingsManager.i().user.fullname)
|
||||||
.setOraInizPrep(new Date())
|
|
||||||
.setAnnotazioni(noteString)
|
.setAnnotazioni(noteString)
|
||||||
.setPosizione(defaultPosAccettazione)
|
.setPosizione(defaultPosAccettazione)
|
||||||
.setSerCollo("/")
|
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
if(customNumCollo != null) {
|
if(customNumCollo != null) {
|
||||||
|
|||||||
@ -69,9 +69,6 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
|
|
||||||
mAdapter = new ContenutoBancaleListAdapter(mContext, mtbColt.get().getMtbColr(), this);
|
mAdapter = new ContenutoBancaleListAdapter(mContext, mtbColt.get().getMtbColr(), this);
|
||||||
mContext.bindings.contenutoBancaleMainList.setAdapter(mAdapter);
|
mContext.bindings.contenutoBancaleMainList.setAdapter(mAdapter);
|
||||||
|
|
||||||
// mContext.bindings.waterfallToolbar.setRecyclerView(mContext.bindings.contenutoBancaleMainList);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,10 @@ import android.view.ViewGroup;
|
|||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import it.integry.integrywmsnative.MainActivity;
|
import it.integry.integrywmsnative.MainActivity;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.databinding.DialogScanOrCreateLuBinding;
|
import it.integry.integrywmsnative.databinding.DialogScanOrCreateLuBinding;
|
||||||
import it.integry.integrywmsnative.databinding.FragmentMainRettificaGiacenzeBinding;
|
import it.integry.integrywmsnative.databinding.FragmentMainRettificaGiacenzeBinding;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.RettificaGiacenzeHelper;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.RettificaGiacenzeHelper;
|
||||||
@ -26,6 +29,8 @@ public class RettificaGiacenzeFragment extends Fragment implements ITitledFragme
|
|||||||
|
|
||||||
private RettificaGiacenzeViewModel mRettificaGiacenzeViewModel = null;
|
private RettificaGiacenzeViewModel mRettificaGiacenzeViewModel = null;
|
||||||
|
|
||||||
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
|
||||||
public RettificaGiacenzeFragment() {
|
public RettificaGiacenzeFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
}
|
}
|
||||||
@ -48,7 +53,6 @@ public class RettificaGiacenzeFragment extends Fragment implements ITitledFragme
|
|||||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_rettifica_giacenze, container, false);
|
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_rettifica_giacenze, container, false);
|
||||||
mRettificaGiacenzeViewModel = new RettificaGiacenzeViewModel();
|
mRettificaGiacenzeViewModel = new RettificaGiacenzeViewModel();
|
||||||
|
|
||||||
|
|
||||||
mBinding.setView(this);
|
mBinding.setView(this);
|
||||||
mBinding.setViewmodel(mRettificaGiacenzeViewModel);
|
mBinding.setViewmodel(mRettificaGiacenzeViewModel);
|
||||||
|
|
||||||
@ -62,6 +66,10 @@ public class RettificaGiacenzeFragment extends Fragment implements ITitledFragme
|
|||||||
mHelper = new RettificaGiacenzeHelper(getActivity());
|
mHelper = new RettificaGiacenzeHelper(getActivity());
|
||||||
mRettificaGiacenzeViewModel.init(getActivity(), mBinding, mHelper);
|
mRettificaGiacenzeViewModel.init(getActivity(), mBinding, mHelper);
|
||||||
|
|
||||||
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
|
.setOnScanSuccessfull(mRettificaGiacenzeViewModel.onScanSuccessfull)
|
||||||
|
.setOnScanFailed(ex -> UtilityExceptions.defaultException(getActivity(), ex, false)));
|
||||||
|
|
||||||
mHelper.loadListaFornitori(listaFornitori -> {
|
mHelper.loadListaFornitori(listaFornitori -> {
|
||||||
mRettificaGiacenzeViewModel.setupSearchFornitori(listaFornitori);
|
mRettificaGiacenzeViewModel.setupSearchFornitori(listaFornitori);
|
||||||
});
|
});
|
||||||
@ -78,25 +86,19 @@ public class RettificaGiacenzeFragment extends Fragment implements ITitledFragme
|
|||||||
setUIToIntArt();
|
setUIToIntArt();
|
||||||
});
|
});
|
||||||
|
|
||||||
DialogScanOrCreateLU.makeBase(getActivity(), mtbColt -> {
|
mRettificaGiacenzeViewModel.openLU();
|
||||||
if(mtbColt == null) {
|
|
||||||
((MainActivity)getActivity()).popToMain();
|
|
||||||
} else {
|
|
||||||
mRettificaGiacenzeViewModel.setMtbColt(mtbColt);
|
|
||||||
}
|
|
||||||
}).show();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDetach() {
|
public void onDetach() {
|
||||||
|
mRettificaGiacenzeViewModel.closeLU(false);
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
super.onDetach();
|
super.onDetach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import java.util.List;
|
|||||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||||
import it.integry.integrywmsnative.core.REST.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.REST.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAartWithFornitore;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
@ -50,17 +52,17 @@ public class RettificaGiacenzeHelper {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void searchArtForn(String codAlis, String codArtForOrDescr, RunnableArgs<ArrayList<ArticoloFornitoreDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void searchArtForn(String codAlis, String codArtForOrDescr, RunnableArgs<ArrayList<MtbAartWithFornitore>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String sql = "SELECT mtb_aart.cod_mart, mtb_aart.descrizione_estesa, mtb_lisa.cod_art_for from mtb_lisa, mtb_aart " +
|
String sql = "SELECT mtb_aart.*, mtb_lisa.cod_art_for from mtb_lisa, mtb_aart " +
|
||||||
" WHERE cod_alis = " + UtilityDB.valueToString(codAlis) +
|
" WHERE cod_alis = " + UtilityDB.valueToString(codAlis) +
|
||||||
" AND mtb_lisa.cod_mart = mtb_aart.cod_mart " +
|
" AND mtb_lisa.cod_mart = mtb_aart.cod_mart " +
|
||||||
" AND (mtb_aart.descrizione_estesa LIKE '%" + codArtForOrDescr +"%' OR cod_art_for LIKE '%" + codArtForOrDescr + "%') " +
|
" AND (mtb_aart.descrizione_estesa LIKE '%" + codArtForOrDescr +"%' OR cod_art_for LIKE '%" + codArtForOrDescr + "%') " +
|
||||||
" ORDER BY mtb_aart.descrizione_estesa";
|
" ORDER BY mtb_aart.descrizione_estesa";
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<ArticoloFornitoreDTO>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbAartWithFornitore>>() {}.getType();
|
||||||
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<ArticoloFornitoreDTO>>() {
|
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<MtbAartWithFornitore>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ArrayList<ArticoloFornitoreDTO> value) {
|
public void onSuccess(ArrayList<MtbAartWithFornitore> value) {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if(onComplete != null) onComplete.run(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,4 +72,30 @@ public class RettificaGiacenzeHelper {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void searchArtInt(String codMartOrBarcodeOrDescr, RunnableArgs<ArrayList<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
String sql = "SELECT DISTINCT mtb_aart.* " +
|
||||||
|
"FROM mtb_aart, mvw_barcode " +
|
||||||
|
"WHERE (case when len(mvw_barcode.cod_barre) > 13 " +
|
||||||
|
"then mvw_barcode.cod_barre " +
|
||||||
|
"else Replicate('0', 13 - len(mvw_barcode.cod_barre))+ mvw_barcode.cod_barre end LIKE '%' + case when len('" + codMartOrBarcodeOrDescr + "') > 13 then '" + codMartOrBarcodeOrDescr + "' else Replicate('0', 13 - len('" + codMartOrBarcodeOrDescr + "')) + '" + codMartOrBarcodeOrDescr + "'" +
|
||||||
|
"end OR mtb_aart.cod_mart = '" + codMartOrBarcodeOrDescr + "' OR mtb_aart.descrizione_estesa LIKE '%" + codMartOrBarcodeOrDescr + "%') AND mtb_aart.cod_mart = mvw_barcode.cod_mart";
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbAart>>() {}.getType();
|
||||||
|
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<MtbAart>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ArrayList<MtbAart> value) {
|
||||||
|
if(onComplete != null) onComplete.run(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,122 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.rettifica_giacenze.core.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.databinding.DataBindingUtil;
|
||||||
|
import android.databinding.ObservableArrayList;
|
||||||
|
import android.databinding.ObservableList;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.databinding.ListaRettificaGiacenzeModelBinding;
|
||||||
|
|
||||||
|
public class RettificaGiacenzeMainListAdapter extends RecyclerView.Adapter<RettificaGiacenzeMainListAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
protected Context mContext;
|
||||||
|
protected ObservableArrayList<MtbColr> mDataset;
|
||||||
|
private View mEmptyView;
|
||||||
|
|
||||||
|
private IRecyclerItemClicked<MtbColr> mOnItemClickListener;
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
protected ListaRettificaGiacenzeModelBinding mViewDataBinding;
|
||||||
|
|
||||||
|
|
||||||
|
public ViewHolder(ListaRettificaGiacenzeModelBinding v) {
|
||||||
|
super(v.getRoot());
|
||||||
|
mViewDataBinding = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void bind(MtbColr mtbColr) {
|
||||||
|
mViewDataBinding.setMtbColr(mtbColr);
|
||||||
|
mViewDataBinding.executePendingBindings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public RettificaGiacenzeMainListAdapter(Context context, ObservableArrayList<MtbColr> myDataset, IRecyclerItemClicked<MtbColr> onItemClickListener, View emptView) {
|
||||||
|
mContext = context;
|
||||||
|
mDataset = myDataset;
|
||||||
|
mEmptyView = emptView;
|
||||||
|
mOnItemClickListener = onItemClickListener;
|
||||||
|
|
||||||
|
myDataset.addOnListChangedCallback(onListChangedCallback);
|
||||||
|
|
||||||
|
checkIfEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RettificaGiacenzeMainListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
// create a new view
|
||||||
|
ListaRettificaGiacenzeModelBinding viewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.lista_rettifica_giacenze_model, parent, false);
|
||||||
|
|
||||||
|
return new ViewHolder(viewDataBinding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(RettificaGiacenzeMainListAdapter.ViewHolder holder, int position) {
|
||||||
|
MtbColr item = mDataset.get(position);
|
||||||
|
holder.bind(item);
|
||||||
|
|
||||||
|
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
||||||
|
if(mOnItemClickListener != null) {
|
||||||
|
mOnItemClickListener.onItemClick(item, position);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewRecycled(RettificaGiacenzeMainListAdapter.ViewHolder holder) {
|
||||||
|
super.onViewRecycled(holder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mDataset.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ObservableList.OnListChangedCallback onListChangedCallback = new ObservableList.OnListChangedCallback<ObservableList<MtbColr>>(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChanged(ObservableList<MtbColr> sender) {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
checkIfEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeChanged(ObservableList<MtbColr> sender, int positionStart, int itemCount) {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
checkIfEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeInserted(ObservableList<MtbColr> sender, int positionStart, int itemCount) {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
checkIfEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeMoved(ObservableList<MtbColr> sender, int fromPosition, int toPosition, int itemCount) {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
checkIfEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeRemoved(ObservableList<MtbColr> sender, int positionStart, int itemCount) {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
checkIfEmpty();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void checkIfEmpty() {
|
||||||
|
if (mEmptyView != null) {
|
||||||
|
final boolean emptyViewVisible = getItemCount() == 0;
|
||||||
|
mEmptyView.setVisibility(emptyViewVisible ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,38 +1,81 @@
|
|||||||
package it.integry.integrywmsnative.gest.rettifica_giacenze.viewmodel;
|
package it.integry.integrywmsnative.gest.rettifica_giacenze.viewmodel;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.res.Resources;
|
||||||
import android.databinding.ObservableArrayList;
|
import android.databinding.ObservableArrayList;
|
||||||
import android.databinding.ObservableField;
|
import android.databinding.ObservableField;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.design.widget.BottomSheetBehavior;
|
||||||
|
import android.support.design.widget.TextInputLayout;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.v7.widget.DividerItemDecoration;
|
||||||
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.view.KeyEvent;
|
import android.view.View;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainActivity;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.REST.CommonRESTException;
|
||||||
|
import it.integry.integrywmsnative.core.REST.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||||
|
import it.integry.integrywmsnative.core.REST.consumers.PrinterRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||||
|
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbCols;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.FragmentMainRettificaGiacenzeBinding;
|
import it.integry.integrywmsnative.databinding.FragmentMainRettificaGiacenzeBinding;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.RettificaGiacenzeHelper;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.RettificaGiacenzeHelper;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.adapter.AutoCompleteFornitoreAdapter;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.adapter.AutoCompleteFornitoreAdapter;
|
||||||
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.adapter.RettificaGiacenzeMainListAdapter;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.dto.FornitoreDTO;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.dto.FornitoreDTO;
|
||||||
|
import it.integry.integrywmsnative.ui.StatusBarAlert;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts.DialogChooseArtFromListaArt;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity.QuantityDTO;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
||||||
|
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.plugins.barcode_base_library.model.BarcodeType;
|
||||||
|
import kotlin.NotImplementedError;
|
||||||
|
|
||||||
public class RettificaGiacenzeViewModel {
|
public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr> {
|
||||||
|
|
||||||
private Context mContext;
|
private Activity mContext;
|
||||||
private FragmentMainRettificaGiacenzeBinding mBinding;
|
private FragmentMainRettificaGiacenzeBinding mBinding;
|
||||||
|
|
||||||
|
private BottomSheetBehavior mBottomSheetBehavior;
|
||||||
|
|
||||||
private RettificaGiacenzeHelper mHelper;
|
private RettificaGiacenzeHelper mHelper;
|
||||||
|
private RettificaGiacenzeMainListAdapter mAdapter;
|
||||||
|
|
||||||
private ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||||
|
public BindableBoolean isFabVisible = new BindableBoolean();
|
||||||
|
public BindableBoolean isMtbColtLoaded = new BindableBoolean();
|
||||||
|
|
||||||
public void init(Context context, FragmentMainRettificaGiacenzeBinding binding, RettificaGiacenzeHelper helper) {
|
|
||||||
|
|
||||||
|
public void init(Activity context, FragmentMainRettificaGiacenzeBinding binding, RettificaGiacenzeHelper helper) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mBinding = binding;
|
mBinding = binding;
|
||||||
mHelper = helper;
|
mHelper = helper;
|
||||||
@ -40,8 +83,86 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
public void setMtbColt(MtbColt mtbColt) {
|
public void setMtbColt(MtbColt mtbColt) {
|
||||||
this.mtbColt.set(mtbColt);
|
this.mtbColt.set(mtbColt);
|
||||||
|
|
||||||
|
isFabVisible.set(mtbColt != null);
|
||||||
|
isMtbColtLoaded.set(mtbColt != null);
|
||||||
|
|
||||||
|
if(this.mtbColt.get().getMtbColr() == null) this.mtbColt.get().setMtbColr(new ObservableArrayList<>());
|
||||||
|
|
||||||
|
initRecyclerView();
|
||||||
|
initBottomSheetActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetMtbColt(boolean openNew) {
|
||||||
|
this.mtbColt.set(null);
|
||||||
|
isFabVisible.set(false);
|
||||||
|
isMtbColtLoaded.set(false);
|
||||||
|
mBinding.rettificaGiacenzeMainList.setAdapter(null);
|
||||||
|
|
||||||
|
if(openNew) openLU();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initRecyclerView() {
|
||||||
|
mBinding.rettificaGiacenzeMainList.setNestedScrollingEnabled(false);
|
||||||
|
|
||||||
|
mBinding.rettificaGiacenzeMainList.setHasFixedSize(true);
|
||||||
|
|
||||||
|
mBinding.rettificaGiacenzeMainList.setLayoutManager(new LinearLayoutManager(mContext));
|
||||||
|
|
||||||
|
DividerItemDecoration itemDecorator = new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL);
|
||||||
|
itemDecorator.setDrawable(ContextCompat.getDrawable(mContext, R.drawable.divider));
|
||||||
|
mBinding.rettificaGiacenzeMainList.addItemDecoration(itemDecorator);
|
||||||
|
|
||||||
|
mAdapter = new RettificaGiacenzeMainListAdapter(mContext, mtbColt.get().getMtbColr(), this, mBinding.rettificaGiacenzeEmptyView);
|
||||||
|
mBinding.rettificaGiacenzeMainList.setAdapter(mAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initBottomSheetActions() {
|
||||||
|
mBinding.bg.setOnClickListener(v -> mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED));
|
||||||
|
|
||||||
|
mBottomSheetBehavior = BottomSheetBehavior.from(mBinding.bottomSheetActions);
|
||||||
|
|
||||||
|
mBottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
|
||||||
|
@Override
|
||||||
|
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
||||||
|
if (newState == BottomSheetBehavior.STATE_COLLAPSED)
|
||||||
|
mBinding.bg.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
||||||
|
mBinding.bg.setVisibility(View.VISIBLE);
|
||||||
|
mBinding.bg.setAlpha(slideOffset);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
|
|
||||||
|
BarcodeManager.disable();
|
||||||
|
|
||||||
|
if(data.getType() == BarcodeType.EAN8 || data.getType() == BarcodeType.EAN13 || data.getType() == BarcodeType.UPCA){
|
||||||
|
searchArtInt(data.getStringValue());
|
||||||
|
} else {
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
if(UtilityBarcode.isEtichettaAnonima(data) && !thereIsAnOpenedUL()){
|
||||||
|
this.executeEtichettaAnonima(data, progressDialog);
|
||||||
|
} else if(data.getType() == BarcodeType.EAN128) {
|
||||||
|
this.executeEtichettaEan128(data, progressDialog);
|
||||||
|
} else if(UtilityBarcode.isEanPeso(data)){
|
||||||
|
this.executeEtichettaEanPeso(data, progressDialog);
|
||||||
|
} else {
|
||||||
|
this.loadArticolo(data.getStringValue(), null, progressDialog);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
public void setupSearchFornitori(ArrayList<FornitoreDTO> listaFornitori) {
|
public void setupSearchFornitori(ArrayList<FornitoreDTO> listaFornitori) {
|
||||||
AutoCompleteFornitoreAdapter autoCompleteFornitoreAdapter = new AutoCompleteFornitoreAdapter(mContext, listaFornitori);
|
AutoCompleteFornitoreAdapter autoCompleteFornitoreAdapter = new AutoCompleteFornitoreAdapter(mContext, listaFornitori);
|
||||||
mBinding.autoCompleteFornitori.setAdapter(autoCompleteFornitoreAdapter);
|
mBinding.autoCompleteFornitori.setAdapter(autoCompleteFornitoreAdapter);
|
||||||
@ -49,8 +170,14 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
mBinding.inputCodArtDescrForn.setOnEditorActionListener((v, actionId, event) -> {
|
mBinding.inputCodArtDescrForn.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||||
|
resetAllError();
|
||||||
if(UtilityString.isNullOrEmpty(mBinding.autoCompleteFornitori.getText().toString())) {
|
if(UtilityString.isNullOrEmpty(mBinding.autoCompleteFornitori.getText().toString())) {
|
||||||
showNoFornSelected();
|
setError(mBinding.autoCompleteFornitoriLayout, mContext.getResources().getText(R.string.error).toString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrForn.getText().toString())) {
|
||||||
|
setError(mBinding.layoutCodArtDescrForn, mContext.getResources().getText(R.string.error).toString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,12 +188,45 @@ public class RettificaGiacenzeViewModel {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
mBinding.inputCodArtDescrInt.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||||
|
resetAllError();
|
||||||
|
|
||||||
|
if(UtilityString.isNullOrEmpty(mBinding.inputCodArtDescrInt.getText().toString())) {
|
||||||
|
setError(mBinding.layoutCodArtDescrInt, mContext.getResources().getText(R.string.error).toString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
searchArtInt(mBinding.inputCodArtDescrInt.getText().toString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showNoFornSelected() {
|
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
private void setError(TextInputLayout textInputLayout, String message){
|
||||||
new SpannableString(mContext.getResources().getText(R.string.no_supplier_selected)),
|
textInputLayout.setErrorEnabled(true);
|
||||||
null, null).show();
|
textInputLayout.setError(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetAllError() {
|
||||||
|
resetError(mBinding.autoCompleteFornitoriLayout);
|
||||||
|
resetError(mBinding.layoutCodArtDescrForn);
|
||||||
|
resetError(mBinding.layoutCodArtDescrInt);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetTexts() {
|
||||||
|
//mBinding.autoCompleteFornitori.setText("");
|
||||||
|
mBinding.inputCodArtDescrForn.setText("");
|
||||||
|
mBinding.inputCodArtDescrInt.setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetError(TextInputLayout textInputLayout) {
|
||||||
|
textInputLayout.setErrorEnabled(false);
|
||||||
|
textInputLayout.setError(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void searchArtFor(String codAlis, String queryText) {
|
private void searchArtFor(String codAlis, String queryText) {
|
||||||
@ -75,7 +235,342 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
mHelper.searchArtForn(codAlis, queryText, listaArts -> {
|
mHelper.searchArtForn(codAlis, queryText, listaArts -> {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
|
|
||||||
|
List<MtbAart> mtbAarts = Stream.of(listaArts).map(x -> (MtbAart) x).toList();
|
||||||
|
|
||||||
|
dispatchArtsList(mtbAarts);
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progressDialog));
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progressDialog));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void searchArtInt(String queryText) {
|
||||||
|
final ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
progressDialog.show();
|
||||||
|
|
||||||
|
mHelper.searchArtInt(queryText, listaArts -> {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
dispatchArtsList(listaArts);
|
||||||
|
}, ex -> {
|
||||||
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
|
BarcodeManager.enable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void dispatchArtsList(List<MtbAart> articoloFornitoreDTOS){
|
||||||
|
|
||||||
|
if(articoloFornitoreDTOS != null){
|
||||||
|
if(articoloFornitoreDTOS.size() == 0) {
|
||||||
|
showNoArtsFound();
|
||||||
|
} else if(articoloFornitoreDTOS.size() == 1) {
|
||||||
|
dispatchArt(articoloFornitoreDTOS.get(0));
|
||||||
|
} else {
|
||||||
|
DialogChooseArtFromListaArt.makeBase(mContext, articoloFornitoreDTOS, this::dispatchArt).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showNoArtsFound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showNoArtsFound() {
|
||||||
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
|
new SpannableString(mContext.getResources().getText(R.string.no_items_found_message)),
|
||||||
|
null, null).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void dispatchArt(MtbAart mtbAart){
|
||||||
|
DialogInputQuantity.DTO qtaDto = new DialogInputQuantity.DTO();
|
||||||
|
|
||||||
|
qtaDto.setMtbAart(mtbAart);
|
||||||
|
|
||||||
|
qtaDto.setQtaCnf(mtbAart.qtaCnf);
|
||||||
|
qtaDto.setNumCnf(1);
|
||||||
|
qtaDto.setQtaTot(mtbAart.qtaCnf);
|
||||||
|
|
||||||
|
qtaDto.setQtaDaEvadere(new BigDecimal(-1));
|
||||||
|
|
||||||
|
qtaDto.setCanPartitaMagBeChanged(true);
|
||||||
|
qtaDto.setCanDataScadBeChanged(true);
|
||||||
|
|
||||||
|
/*
|
||||||
|
if(ean128Model != null){
|
||||||
|
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)){
|
||||||
|
qtaDto.partitaMag = ean128Model.BatchLot;
|
||||||
|
qtaDto.canPartitaMagBeChanged = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let dataScad = ean128Model.BestBefore || ean128Model.Expiry;
|
||||||
|
if(dataScad != null){
|
||||||
|
qtaDto.shouldAskDataScad = true;
|
||||||
|
qtaDto.dataScad = moment(dataScad, "DD/MM/YYYY HH:mm:ss").format("YYYY-MM-DD");
|
||||||
|
qtaDto.canDataScadBeChanged = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ean128Model.NetWeightKg != null) {
|
||||||
|
qtaDto.qtaTot = ean128Model.NetWeightKg;
|
||||||
|
qtaDto.qtaPerCnf = ean128Model.NetWeightKg;
|
||||||
|
qtaDto.numDiCnf = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ean128Model.Count != null){
|
||||||
|
qtaDto.qtaTot = ean128Model.Count;
|
||||||
|
qtaDto.numDiCnf = qtaDto.qtaTot / qtaDto.qtaPerCnf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
DialogInputQuantity.makeBase(mContext, qtaDto, true, (quantityDTO) -> {
|
||||||
|
onPostDispatch(mtbAart, quantityDTO);
|
||||||
|
}).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void onPostDispatch(MtbAart mtbAart, QuantityDTO quantityDTO) {
|
||||||
|
|
||||||
|
final ProgressDialog progress = ProgressDialog.show(mContext, mContext.getText(R.string.waiting),
|
||||||
|
mContext.getText(R.string.loading) + " ...", true);
|
||||||
|
|
||||||
|
final MtbColr mtbColr = new MtbColr()
|
||||||
|
.setCodMart(mtbAart.codMart)
|
||||||
|
.setPartitaMag(quantityDTO.batchLot.get())
|
||||||
|
.setDataScadPartita(quantityDTO.expireDate)
|
||||||
|
.setQtaCol(new BigDecimal(quantityDTO.qtaTot.get()))
|
||||||
|
.setDescrizione(mtbAart.descrizioneEstesa);
|
||||||
|
|
||||||
|
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
MtbColt cloneMtbColt = (MtbColt) mtbColt.get().clone();
|
||||||
|
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
|
||||||
|
cloneMtbColt.setMtbColr(new ObservableArrayList());
|
||||||
|
cloneMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColt value) {
|
||||||
|
|
||||||
|
mtbColr
|
||||||
|
.setDataCollo(value.getDataColloS())
|
||||||
|
.setNumCollo(value.getNumCollo())
|
||||||
|
.setGestione(value.getGestione())
|
||||||
|
.setSerCollo(value.getSerCollo())
|
||||||
|
.setRiga(value.getMtbColr().get(0).getRiga())
|
||||||
|
.setUntMis(mtbAart.untMis)
|
||||||
|
.setMtbAart(mtbAart);
|
||||||
|
|
||||||
|
mtbColt.get().getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
|
new StatusBarAlert.Builder(mContext)
|
||||||
|
.autoHide(true)
|
||||||
|
.withDuration(2500)
|
||||||
|
.showProgress(false)
|
||||||
|
.withText(R.string.data_saved)
|
||||||
|
.withAlertColor(R.color.mainGreen)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
resetTexts();
|
||||||
|
progress.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemClick(MtbColr item, int position) {
|
||||||
|
/*
|
||||||
|
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||||
|
|
||||||
|
MtbColr clickedItem = mtbColt.get().getMtbColr().get(position);
|
||||||
|
|
||||||
|
mBinding.bottomSheetActionsTitle.setText(clickedItem.getDescrizione());
|
||||||
|
mBinding.bottomSheetActionsSubtitle.setText(clickedItem.getCodMart());
|
||||||
|
|
||||||
|
mBinding.bottomSheetActionsEditBtn.setOnClickListener(v -> onItemEdit(position));
|
||||||
|
|
||||||
|
mBinding.bottomSheetActionsDeleteBtn.setOnClickListener(v -> onItemDelete(position));
|
||||||
|
|
||||||
|
mBinding.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getQtaCol()) + " " + clickedItem.getUntMis());
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void openLU() {
|
||||||
|
DialogScanOrCreateLU.makeBase(mContext, mtbColt -> {
|
||||||
|
if(mtbColt == null) {
|
||||||
|
((MainActivity)mContext).popToMain();
|
||||||
|
} else {
|
||||||
|
setMtbColt(mtbColt);
|
||||||
|
}
|
||||||
|
}).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean thereIsAnOpenedUL() {
|
||||||
|
return mtbColt.get() != null;
|
||||||
|
}
|
||||||
|
public boolean thereIsAnyRowInUL() {
|
||||||
|
return mtbColt.get() != null &&
|
||||||
|
mtbColt.get().getMtbColr() != null &&
|
||||||
|
mtbColt.get().getMtbColr().size() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void closeLU(boolean openNewOne) {
|
||||||
|
|
||||||
|
final ProgressDialog progress = ProgressDialog.show(mContext, mContext.getText(R.string.waiting),
|
||||||
|
mContext.getText(R.string.loading) + " ...", true);
|
||||||
|
|
||||||
|
if(thereIsAnyRowInUL()){
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(SettingsManager.iDB().getDefaultCausaleRettificaGiacenze())) {
|
||||||
|
|
||||||
|
progress.show();
|
||||||
|
saveCausaleRettificaGiacenze(progress, () -> {
|
||||||
|
if(!mtbColt.get().getDisablePrint()){
|
||||||
|
printCollo(progress);
|
||||||
|
} else {
|
||||||
|
progress.dismiss();
|
||||||
|
resetMtbColt(openNewOne);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if(!mtbColt.get().getDisablePrint()){
|
||||||
|
progress.show();
|
||||||
|
printCollo(progress);
|
||||||
|
} else {
|
||||||
|
resetMtbColt(openNewOne);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
progress.show();
|
||||||
|
ColliMagazzinoRESTConsumer.deleteCollo(mtbColt.get(), () -> {
|
||||||
|
progress.dismiss();
|
||||||
|
resetMtbColt(openNewOne);
|
||||||
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveCausaleRettificaGiacenze(ProgressDialog progress, Runnable onComplete) {
|
||||||
|
|
||||||
|
final MtbCols mtbCols = new MtbCols()
|
||||||
|
.setCausale(SettingsManager.iDB().getDefaultCausaleRettificaGiacenze());
|
||||||
|
mtbCols.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
MtbColt cloneMtbColt = (MtbColt) mtbColt.get().clone();
|
||||||
|
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
|
||||||
|
cloneMtbColt.setMtbCols(new ArrayList<>());
|
||||||
|
cloneMtbColt.getMtbCols().add(mtbCols);
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColt value) {
|
||||||
|
onComplete.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void printCollo(ProgressDialog progress) {
|
||||||
|
|
||||||
|
this.showAskPrint(shouldPrint -> {
|
||||||
|
|
||||||
|
if(shouldPrint) {
|
||||||
|
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), new ISimpleOperationCallback<List<String>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<String> value) {
|
||||||
|
|
||||||
|
if (value.size() > 0) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
ReportManager.getRightReportNameByMtbColt(mtbColt.get(), reportName -> {
|
||||||
|
|
||||||
|
PrinterRESTConsumer.printCollo(value.get(0),
|
||||||
|
mtbColt.get(),
|
||||||
|
1,
|
||||||
|
reportName,
|
||||||
|
() -> {
|
||||||
|
progress.dismiss();
|
||||||
|
resetMtbColt(true);
|
||||||
|
|
||||||
|
Resources res = mContext.getResources();
|
||||||
|
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||||
|
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
||||||
|
}, ex -> {
|
||||||
|
UtilityLogger.errorMe(ex);
|
||||||
|
progress.dismiss();
|
||||||
|
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||||
|
showPrintErrorDialog(errorMessage);
|
||||||
|
});
|
||||||
|
|
||||||
|
}, ex -> {
|
||||||
|
UtilityLogger.errorMe(ex);
|
||||||
|
progress.dismiss();
|
||||||
|
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||||
|
showPrintErrorDialog(errorMessage);
|
||||||
|
});
|
||||||
|
} catch (Exception ex) {
|
||||||
|
progress.dismiss();
|
||||||
|
UtilityLogger.errorMe(ex);
|
||||||
|
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||||
|
showPrintErrorDialog(errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
progress.dismiss();
|
||||||
|
String errorMessage = "Nessuna stampante configurata";
|
||||||
|
showPrintErrorDialog(errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
progress.dismiss();
|
||||||
|
UtilityLogger.errorMe(ex);
|
||||||
|
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||||
|
showPrintErrorDialog(errorMessage);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
resetMtbColt(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void showAskPrint(RunnableArgs<Boolean> onComplete) {
|
||||||
|
DialogSimpleMessageHelper.makeInfoDialog(
|
||||||
|
mContext,
|
||||||
|
mContext.getResources().getString(R.string.action_print_ul),
|
||||||
|
new SpannableString(mContext.getResources().getString(R.string.ask_print_message)),
|
||||||
|
null,
|
||||||
|
() -> onComplete.run(true),
|
||||||
|
() -> onComplete.run(false)).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showPrintErrorDialog(String message) {
|
||||||
|
DialogSimpleMessageHelper.makeErrorDialog(
|
||||||
|
mContext,
|
||||||
|
new SpannableString(message),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
R.string.button_ignore_print,
|
||||||
|
() -> resetMtbColt(true)).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -584,12 +584,8 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
progress.show();
|
progress.show();
|
||||||
|
|
||||||
MtbColt mtbColt = new MtbColt();
|
MtbColt mtbColt = new MtbColt();
|
||||||
mtbColt .setDataCollo(new Date())
|
mtbColt .setGestione(defaultGestioneOfUL)
|
||||||
.setGestione(defaultGestioneOfUL)
|
|
||||||
.setSegno(-1)
|
.setSegno(-1)
|
||||||
.setCodMdep(SettingsManager.i().userSession.depo.getCodMdep())
|
|
||||||
.setPreparatoDa(SettingsManager.i().user.fullname)
|
|
||||||
.setOraInizPrep(new Date())
|
|
||||||
.setRifOrd(defaultRifOrdOfUL)
|
.setRifOrd(defaultRifOrdOfUL)
|
||||||
.setNumOrd(defaultNumOrdOfUL)
|
.setNumOrd(defaultNumOrdOfUL)
|
||||||
.setDataOrdD(defaultDataOrdOfUL)
|
.setDataOrdD(defaultDataOrdOfUL)
|
||||||
|
|||||||
@ -138,6 +138,17 @@ public class DialogSimpleMessageHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static AlertDialog makeInfoDialog(Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick, Runnable onNegativeClick){
|
||||||
|
return makeBase(TYPE.INFO,
|
||||||
|
mContext,
|
||||||
|
titleText,
|
||||||
|
messageText,
|
||||||
|
hashmapContent,
|
||||||
|
onPositiveClick,
|
||||||
|
onNegativeClick, -1, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static AlertDialog makeSuccessDialog(Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick){
|
public static AlertDialog makeSuccessDialog(Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick){
|
||||||
return makeBase(TYPE.SUCCESS,
|
return makeBase(TYPE.SUCCESS,
|
||||||
mContext,
|
mContext,
|
||||||
@ -174,7 +185,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
|
|
||||||
return makeBase(TYPE.ERROR,
|
return makeBase(TYPE.ERROR,
|
||||||
mContext,
|
mContext,
|
||||||
mContext.getText(R.string.error).toString(),
|
mContext.getText(R.string.ops).toString(),
|
||||||
messageText,
|
messageText,
|
||||||
hashmapContent,
|
hashmapContent,
|
||||||
onPositiveClick,
|
onPositiveClick,
|
||||||
@ -185,7 +196,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
|
|
||||||
return makeBase(TYPE.ERROR,
|
return makeBase(TYPE.ERROR,
|
||||||
mContext,
|
mContext,
|
||||||
mContext.getText(R.string.error).toString(),
|
mContext.getText(R.string.ops).toString(),
|
||||||
messageText,
|
messageText,
|
||||||
hashmapContent,
|
hashmapContent,
|
||||||
onPositiveClick,
|
onPositiveClick,
|
||||||
|
|||||||
@ -0,0 +1,74 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.databinding.DataBindingUtil;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.support.v7.widget.DividerItemDecoration;
|
||||||
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAartWithFornitore;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogChooseArtFromListaArtBinding;
|
||||||
|
|
||||||
|
public class DialogChooseArtFromListaArt {
|
||||||
|
|
||||||
|
|
||||||
|
private static Context currentContext;
|
||||||
|
private static AlertDialog currentAlert;
|
||||||
|
|
||||||
|
private static DialogChooseArtFromListaArtAdapter currentAdapter;
|
||||||
|
|
||||||
|
private static RunnableArgs<MtbAart> mOnItemChoosed;
|
||||||
|
|
||||||
|
public static AlertDialog makeBase(final Context context, List<MtbAart> listaArts, RunnableArgs<MtbAart> onItemChoosed) {
|
||||||
|
currentContext = context;
|
||||||
|
mOnItemChoosed = onItemChoosed;
|
||||||
|
|
||||||
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||||
|
DialogChooseArtFromListaArtBinding binding = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_art_from_lista_art, null, false);
|
||||||
|
|
||||||
|
|
||||||
|
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
|
||||||
|
.setView(binding.getRoot())
|
||||||
|
.setPositiveButton(context.getText(R.string.confirm), null)
|
||||||
|
.setNegativeButton(context.getText(R.string.abort), null);
|
||||||
|
|
||||||
|
currentAlert = alertDialog.create();
|
||||||
|
currentAlert.setCanceledOnTouchOutside(false);
|
||||||
|
|
||||||
|
initRecyclerView(binding, listaArts);
|
||||||
|
|
||||||
|
return currentAlert;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initRecyclerView(DialogChooseArtFromListaArtBinding binding, List<MtbAart> dataset) {
|
||||||
|
binding.dialogChooseArtFromListaArtMainList.setNestedScrollingEnabled(false);
|
||||||
|
|
||||||
|
binding.dialogChooseArtFromListaArtMainList.setHasFixedSize(true);
|
||||||
|
|
||||||
|
binding.dialogChooseArtFromListaArtMainList.setLayoutManager(new LinearLayoutManager(currentContext));
|
||||||
|
|
||||||
|
DividerItemDecoration itemDecorator = new DividerItemDecoration(currentContext, DividerItemDecoration.VERTICAL);
|
||||||
|
itemDecorator.setDrawable(ContextCompat.getDrawable(currentContext, R.drawable.divider));
|
||||||
|
binding.dialogChooseArtFromListaArtMainList.addItemDecoration(itemDecorator);
|
||||||
|
|
||||||
|
currentAdapter = new DialogChooseArtFromListaArtAdapter(currentContext, dataset, onItemClicked);
|
||||||
|
binding.dialogChooseArtFromListaArtMainList.setAdapter(currentAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IRecyclerItemClicked<MtbAart> onItemClicked = (item, position) -> {
|
||||||
|
if(mOnItemChoosed != null) {
|
||||||
|
mOnItemChoosed.run(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentAlert.dismiss();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.databinding.DataBindingUtil;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAartWithFornitore;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogChooseArtFromListaArtItemModelBinding;
|
||||||
|
|
||||||
|
public class DialogChooseArtFromListaArtAdapter extends RecyclerView.Adapter<DialogChooseArtFromListaArtAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
protected Context mContext;
|
||||||
|
|
||||||
|
private List<MtbAart> mDataset;
|
||||||
|
private IRecyclerItemClicked<MtbAart> mOnItemClickListener;
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
protected DialogChooseArtFromListaArtItemModelBinding mViewDataBinding;
|
||||||
|
|
||||||
|
|
||||||
|
public ViewHolder(DialogChooseArtFromListaArtItemModelBinding v) {
|
||||||
|
super(v.getRoot());
|
||||||
|
mViewDataBinding = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void bind(MtbAart mtbAart) {
|
||||||
|
mViewDataBinding.setMtbAart(mtbAart);
|
||||||
|
mViewDataBinding.executePendingBindings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseArtFromListaArtAdapter(Context context, List<MtbAart> myDataset, IRecyclerItemClicked<MtbAart> onItemClickListener) {
|
||||||
|
mContext = context;
|
||||||
|
mDataset = myDataset;
|
||||||
|
mOnItemClickListener = onItemClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DialogChooseArtFromListaArtAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
// create a new view
|
||||||
|
DialogChooseArtFromListaArtItemModelBinding viewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.dialog_choose_art_from_lista_art__item_model, parent, false);
|
||||||
|
|
||||||
|
return new ViewHolder(viewDataBinding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(DialogChooseArtFromListaArtAdapter.ViewHolder holder, int position) {
|
||||||
|
MtbAart item = mDataset.get(position);
|
||||||
|
holder.bind(item);
|
||||||
|
|
||||||
|
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
||||||
|
if(mOnItemClickListener != null) {
|
||||||
|
mOnItemClickListener.onItemClick(item, position);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewRecycled(DialogChooseArtFromListaArtAdapter.ViewHolder holder) {
|
||||||
|
super.onViewRecycled(holder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mDataset.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -17,6 +17,7 @@ import android.text.Html;
|
|||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
@ -199,22 +200,25 @@ public class DialogInputQuantity {
|
|||||||
private static AlertDialog currentAlert;
|
private static AlertDialog currentAlert;
|
||||||
private static Context currentContext;
|
private static Context currentContext;
|
||||||
|
|
||||||
|
private static DialogInputQuantityArticoloBinding currentBinding;
|
||||||
|
|
||||||
private static MtbAart currentMtbAart;
|
private static MtbAart currentMtbAart;
|
||||||
private static QuantityDTO currentQuantityDto;
|
private static QuantityDTO currentQuantityDto;
|
||||||
|
private static DTO currentDTO;
|
||||||
|
|
||||||
public static AlertDialog makeBase(final Context context, final DTO dto, boolean canOverflowQuantity, final ISingleValueOperationCallback<QuantityDTO> dialogCallback) {
|
public static AlertDialog makeBase(final Context context, final DTO dto, boolean canOverflowQuantity, final ISingleValueOperationCallback<QuantityDTO> dialogCallback) {
|
||||||
currentContext = context;
|
currentContext = context;
|
||||||
currentMtbAart = dto.getMtbAart();
|
currentMtbAart = dto.getMtbAart();
|
||||||
|
currentDTO = dto;
|
||||||
|
|
||||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||||
|
currentBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_input_quantity_articolo, null, false);
|
||||||
|
|
||||||
DialogInputQuantityArticoloBinding contentView = DataBindingUtil.inflate(inflater, R.layout.dialog_input_quantity_articolo, null, false);
|
final TextInputLayout txlInputBatchLot = currentBinding.inputPartitaMag;
|
||||||
|
|
||||||
final TextInputLayout txlInputBatchLot = contentView.inputPartitaMag;
|
final TextInputLayout txlInputNumDiCnf = currentBinding.inputNumCnf;
|
||||||
|
final TextInputLayout txlInputQtaPerCnf = currentBinding.inputQtaCnf;
|
||||||
final TextInputLayout txlInputNumDiCnf = contentView.inputNumCnf;
|
final TextInputLayout txlInputQtaTot = currentBinding.inputQtaTot;
|
||||||
final TextInputLayout txlInputQtaPerCnf = contentView.inputQtaCnf;
|
|
||||||
final TextInputLayout txlInputQtaTot = contentView.inputQtaTot;
|
|
||||||
|
|
||||||
txlInputNumDiCnf.getEditText().setSelectAllOnFocus(true);
|
txlInputNumDiCnf.getEditText().setSelectAllOnFocus(true);
|
||||||
txlInputQtaPerCnf.getEditText().setSelectAllOnFocus(true);
|
txlInputQtaPerCnf.getEditText().setSelectAllOnFocus(true);
|
||||||
@ -230,11 +234,11 @@ public class DialogInputQuantity {
|
|||||||
|
|
||||||
setupQuantityListener(currentQuantityDto, txlInputNumDiCnf, txlInputQtaPerCnf, txlInputQtaTot);
|
setupQuantityListener(currentQuantityDto, txlInputNumDiCnf, txlInputQtaPerCnf, txlInputQtaTot);
|
||||||
|
|
||||||
contentView.setViewmodel(dto);
|
currentBinding.setViewmodel(dto);
|
||||||
contentView.setQuantityViewModel(currentQuantityDto);
|
currentBinding.setQuantityViewModel(currentQuantityDto);
|
||||||
|
|
||||||
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
|
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
|
||||||
.setView(contentView.getRoot())
|
.setView(currentBinding.getRoot())
|
||||||
.setPositiveButton(context.getText(R.string.confirm), null)
|
.setPositiveButton(context.getText(R.string.confirm), null)
|
||||||
.setNegativeButton(context.getText(R.string.abort), null);
|
.setNegativeButton(context.getText(R.string.abort), null);
|
||||||
|
|
||||||
@ -265,7 +269,7 @@ public class DialogInputQuantity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
initDatePicker(context, currentQuantityDto, contentView.getRoot().findViewById(R.id.input_data_scad));
|
initDatePicker(context, currentQuantityDto, currentBinding.getRoot().findViewById(R.id.input_data_scad));
|
||||||
|
|
||||||
setupBarcode(context);
|
setupBarcode(context);
|
||||||
|
|
||||||
@ -278,7 +282,10 @@ public class DialogInputQuantity {
|
|||||||
if(dto.getMaxQta() != null) quantityDTO.maxQta = dto.getMaxQta().floatValue();
|
if(dto.getMaxQta() != null) quantityDTO.maxQta = dto.getMaxQta().floatValue();
|
||||||
|
|
||||||
float qtaDaEvadere = dto.qtaDaEvadere != null ? dto.qtaDaEvadere.floatValue() : 0f;
|
float qtaDaEvadere = dto.qtaDaEvadere != null ? dto.qtaDaEvadere.floatValue() : 0f;
|
||||||
if (qtaDaEvadere < 0) qtaDaEvadere = 0;
|
if (qtaDaEvadere < 0) {
|
||||||
|
currentBinding.layoutQtaDaEvadere.setVisibility(View.GONE);
|
||||||
|
qtaDaEvadere = 0;
|
||||||
|
}
|
||||||
|
|
||||||
quantityDTO.qtaEvasa.set(dto.qtaEvasa != null ? dto.qtaEvasa.floatValue() : null);
|
quantityDTO.qtaEvasa.set(dto.qtaEvasa != null ? dto.qtaEvasa.floatValue() : null);
|
||||||
if(qtaDaEvadere > 0) quantityDTO.qtaDaEvadere.set(qtaDaEvadere);
|
if(qtaDaEvadere > 0) quantityDTO.qtaDaEvadere.set(qtaDaEvadere);
|
||||||
@ -592,7 +599,11 @@ public class DialogInputQuantity {
|
|||||||
|
|
||||||
|
|
||||||
private static void onConfirm(Context context, QuantityDTO quantityDTO, ISingleValueOperationCallback<QuantityDTO> dialogCallback){
|
private static void onConfirm(Context context, QuantityDTO quantityDTO, ISingleValueOperationCallback<QuantityDTO> dialogCallback){
|
||||||
if(quantityDTO.shouldAskDataScad.get() && (quantityDTO.batchLot == null || quantityDTO.batchLot.get().trim().length() == 0)){
|
if(currentDTO.mtbAart.isFlagTracciabilita() && (quantityDTO.batchLot == null || quantityDTO.batchLot.get().trim().length() == 0)){
|
||||||
|
|
||||||
|
showBatchLotErrorPrompt(context);
|
||||||
|
|
||||||
|
} else if(quantityDTO.shouldAskDataScad.get() && (quantityDTO.batchLot == null || quantityDTO.batchLot.get().trim().length() == 0)){
|
||||||
|
|
||||||
showBatchLotErrorPrompt(context);
|
showBatchLotErrorPrompt(context);
|
||||||
|
|
||||||
|
|||||||
35
app/src/main/res/layout/dialog_choose_art_from_lista_art.xml
Normal file
35
app/src/main/res/layout/dialog_choose_art_from_lista_art.xml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_margin="16dp">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:text="@string/dialog_choose_art_from_lista_art"
|
||||||
|
android:textStyle="normal"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginBottom="12dp"/>
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/dialog_choose_art_from_lista_art__main_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="android.view.View" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||||
|
<variable
|
||||||
|
name="mtbAart"
|
||||||
|
type="it.integry.integrywmsnative.core.model.MtbAart"/>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{mtbAart.codMart}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="COD MART" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@{mtbAart.descrizioneEstesa}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
tools:text="Descrizione lunga articolo" />
|
||||||
|
|
||||||
|
|
||||||
|
<!--<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{`Lotto: ` + dtoModel.partitaMag}"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:visibility="@{UtilityString.isNullOrEmpty(dtoModel.partitaMag) ? View.INVISIBLE : View.VISIBLE}"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/badge1_round_corner"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:text="@{UtilityNumber.decimalToString(mtbColr.getQtaCol()) + `\n` + mtbColr.getUntMis()}"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="280.45\nCONF" />
|
||||||
|
|
||||||
|
</RelativeLayout>-->
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@ -135,6 +135,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_qta_da_evadere"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.databinding.ObservableList"/>
|
<import type="android.databinding.ObservableList"/>
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
<import type="android.view.View"/>
|
||||||
<variable name="view" type="it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment" />
|
<variable name="view" type="it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment" />
|
||||||
<variable
|
<variable
|
||||||
name="viewmodel"
|
name="viewmodel"
|
||||||
@ -15,132 +17,412 @@
|
|||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/full_white"
|
android:background="@color/empty_view_bg_gray"
|
||||||
tools:context=".gest.rettifica_giacenze.RettificaGiacenzeFragment">
|
tools:context=".gest.rettifica_giacenze.RettificaGiacenzeFragment"
|
||||||
|
android:clipToPadding="false">
|
||||||
|
|
||||||
<LinearLayout
|
<android.support.design.widget.CoordinatorLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent">
|
||||||
android:orientation="vertical">
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/full_white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<net.cachapa.expandablelayout.ExpandableLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
|
app:el_expanded_bind="@{viewmodel.isMtbColtLoaded}">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:background="@drawable/badge1_round_corner"
|
||||||
|
android:text="@{viewmodel.mtbColt.get().numCollo.toString()}"
|
||||||
|
tools:text="2156"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="@{!UtilityString.isNullOrEmpty(viewmodel.mtbColt.get().posizione) ? View.VISIBLE : View.GONE}"
|
||||||
|
android:text="@{viewmodel.mtbColt.get().posizione}"
|
||||||
|
tools:text="ME1FS032"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</net.cachapa.expandablelayout.ExpandableLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/rettifica_giacenze_forn_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:paddingTop="6dp"
|
||||||
|
android:paddingBottom="6dp">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rettifica_giacenze_forn_check_box"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:onClick="@{() -> view.setUIToForn()}"/>
|
||||||
|
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.constraint.Guideline
|
||||||
|
android:id="@+id/guide_line_fornitore"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.40"/>
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/auto_complete_fornitori_layout"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:hintTextAppearance="@style/hint_text"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/guide_line_fornitore">
|
||||||
|
|
||||||
|
<AutoCompleteTextView
|
||||||
|
android:id="@+id/auto_complete_fornitori"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="10"
|
||||||
|
android:completionThreshold="2"
|
||||||
|
android:hint="@string/supplier"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/layout_cod_art_descr_forn"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:hintTextAppearance="@style/hint_text"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/guide_line_fornitore"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputEditText
|
||||||
|
android:id="@+id/input_cod_art_descr_forn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textNoSuggestions"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:hint="@string/cod_art_or_description"/>
|
||||||
|
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/rettifica_giacenze_art_int_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:paddingTop="6dp"
|
||||||
|
android:paddingBottom="6dp">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rettifica_giacenze_art_int_check_box"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:onClick="@{() -> view.setUIToIntArt()}"/>
|
||||||
|
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/layout_cod_art_descr_int"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:hintTextAppearance="@style/hint_text"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputEditText
|
||||||
|
android:id="@+id/input_cod_art_descr_int"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textNoSuggestions"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:hint="@string/cod_art_or_description"/>
|
||||||
|
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
android:id="@+id/rettifica_giacenze_empty_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:alpha="0.3"
|
||||||
|
tools:context=".gest.lista_bancali.ListaBancaliActivity">
|
||||||
|
|
||||||
|
<android.support.constraint.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.15" />
|
||||||
|
|
||||||
|
<android.support.constraint.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" />
|
||||||
|
|
||||||
|
<android.support.constraint.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">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatImageView
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_playlist_add_check_24dp"
|
||||||
|
android:adjustViewBounds="true"/>
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:text="@string/no_item_text"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/rettifica_giacenze_main_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="32dp"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/rettifica_giacenze_main_fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:tint="@android:color/white"
|
||||||
|
app:srcCompat="@drawable/ic_check_black_24dp"
|
||||||
|
android:onClick="@{() -> viewmodel.closeLU(true)}"
|
||||||
|
android:visibility="@{viewmodel.isFabVisible.get() ? View.VISIBLE : View.GONE}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/bg"
|
||||||
|
android:background="#99000000"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/rettifica_giacenze_forn_layout"
|
android:id="@+id/bottom_sheet_actions"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:background="#fff"
|
||||||
android:layout_marginTop="4dp"
|
android:orientation="vertical"
|
||||||
android:layout_marginStart="4dp"
|
android:padding="16dp"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_gravity="bottom"
|
||||||
android:paddingStart="8dp"
|
app:behavior_hideable="true"
|
||||||
android:paddingEnd="6dp"
|
app:behavior_peekHeight="0dp"
|
||||||
android:paddingTop="6dp"
|
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
|
||||||
android:paddingBottom="6dp">
|
|
||||||
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/rettifica_giacenze_forn_check_box"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:onClick="@{() -> view.setUIToForn()}"/>
|
|
||||||
|
|
||||||
<android.support.constraint.ConstraintLayout
|
<android.support.constraint.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_gravity="center_vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/bottom_sheet_actions_quantity"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/bottom_sheet_actions_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="Descrizione articolo"
|
||||||
|
android:textColor="#444"
|
||||||
|
android:textSize="18dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/bottom_sheet_actions_subtitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="ABF52IL"
|
||||||
|
android:textSize="14dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bottom_sheet_actions_quantity"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:gravity="right"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="15dp"
|
||||||
|
tools:text="250 PZ"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
<android.support.constraint.Guideline
|
<android.support.constraint.Guideline
|
||||||
android:id="@+id/guide_line_fornitore"
|
android:id="@+id/guideline_action"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintGuide_percent="0.40"/>
|
app:layout_constraintGuide_percent="0.50" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
<android.support.design.widget.TextInputLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:hintTextAppearance="@style/hint_text"
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/guideline_action"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/guide_line_fornitore">
|
android:gravity="center">
|
||||||
|
|
||||||
<AutoCompleteTextView
|
<android.support.v7.widget.AppCompatImageButton
|
||||||
android:id="@+id/autoCompleteFornitori"
|
android:id="@+id/bottom_sheet_actions_edit_btn"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ems="10"
|
android:padding="16dp"
|
||||||
android:completionThreshold="2"
|
android:background="@android:color/white"
|
||||||
android:hint="@string/supplier"/>
|
android:scaleX="1.5"
|
||||||
|
android:scaleY="1.5"
|
||||||
|
android:src="@drawable/ic_edit_24dp"
|
||||||
|
android:tint="@color/green_600" />
|
||||||
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Modifica"/>
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:hintTextAppearance="@style/hint_text"
|
android:orientation="vertical"
|
||||||
app:layout_constraintStart_toEndOf="@id/guide_line_fornitore"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
app:layout_constraintStart_toStartOf="@id/guideline_action"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
<android.support.design.widget.TextInputEditText
|
<android.support.v7.widget.AppCompatImageButton
|
||||||
android:id="@+id/input_cod_art_descr_forn"
|
android:id="@+id/bottom_sheet_actions_delete_btn"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:inputType="textNoSuggestions"
|
android:padding="16dp"
|
||||||
android:imeOptions="actionDone"
|
android:background="@android:color/white"
|
||||||
android:hint="@string/cod_art_or_description"/>
|
android:scaleX="1.5"
|
||||||
|
android:scaleY="1.5"
|
||||||
|
android:src="@drawable/ic_delete_24dp"
|
||||||
|
android:tint="@color/red_600" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Cancella"/>
|
||||||
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
android:id="@+id/rettifica_giacenze_art_int_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginBottom="4dp"
|
|
||||||
android:paddingStart="8dp"
|
|
||||||
android:paddingEnd="6dp"
|
|
||||||
android:paddingTop="6dp"
|
|
||||||
android:paddingBottom="6dp">
|
|
||||||
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/rettifica_giacenze_art_int_check_box"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:onClick="@{() -> view.setUIToIntArt()}"/>
|
|
||||||
|
|
||||||
<android.support.constraint.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:hintTextAppearance="@style/hint_text"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputEditText
|
|
||||||
android:id="@+id/input_cod_art_descr_int"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="textNoSuggestions"
|
|
||||||
android:imeOptions="actionDone"
|
|
||||||
android:hint="@string/cod_art_or_description"/>
|
|
||||||
|
|
||||||
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</layout>
|
</layout>
|
||||||
94
app/src/main/res/layout/lista_rettifica_giacenze_model.xml
Normal file
94
app/src/main/res/layout/lista_rettifica_giacenze_model.xml
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="android.view.View" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||||
|
<variable
|
||||||
|
name="mtbColr"
|
||||||
|
type="it.integry.integrywmsnative.core.model.MtbColr" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<android.support.constraint.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_constraintEnd_toStartOf="@+id/qta_box"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{mtbColr.codMart}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="COD MART" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_toLeftOf="@id/posizione_collo"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@{mtbColr.getDescrizione()}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
tools:text="Descrizione lunga articolo" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{`Lotto: ` + mtbColr.getPartitaMag()}"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:visibility="@{UtilityString.isNullOrEmpty(mtbColr.getPartitaMag()) ? View.INVISIBLE : View.VISIBLE}"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/badge1_round_corner"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:text="@{UtilityNumber.decimalToString(mtbColr.getQtaCol()) + (!UtilityString.isNullOrEmpty(mtbColr.getUntMis()) ? `\n` + mtbColr.getUntMis() : ``)}"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="280.45\nCONF" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -13,7 +13,8 @@
|
|||||||
<string name="accettazione_ordine_inevaso_title_multiple_order">Ordini di accettazione</string>
|
<string name="accettazione_ordine_inevaso_title_multiple_order">Ordini di accettazione</string>
|
||||||
<string name="vendita_title_fragment">Spedizione</string>
|
<string name="vendita_title_fragment">Spedizione</string>
|
||||||
<string name="rettifica_giacenze_fragment_title">Rettifica giacenze</string>
|
<string name="rettifica_giacenze_fragment_title">Rettifica giacenze</string>
|
||||||
<string name="error">Ops</string>
|
<string name="error">Errore</string>
|
||||||
|
<string name="ops">Ops</string>
|
||||||
<string name="warning">Attenzione</string>
|
<string name="warning">Attenzione</string>
|
||||||
<string name="ok">OK</string>
|
<string name="ok">OK</string>
|
||||||
<string name="abort">Annulla</string>
|
<string name="abort">Annulla</string>
|
||||||
@ -122,6 +123,7 @@
|
|||||||
|
|
||||||
<string name="no_lu_already_registered_text">Nessuna UL registrata a magazzino</string>
|
<string name="no_lu_already_registered_text">Nessuna UL registrata a magazzino</string>
|
||||||
<string name="no_item_to_pick_text">Nessun articolo da prelevare</string>
|
<string name="no_item_to_pick_text">Nessun articolo da prelevare</string>
|
||||||
|
<string name="no_item_text">Nessun articolo</string>
|
||||||
|
|
||||||
<string name="already_used_anonymous_barcode"><![CDATA[L\'etichetta scansionata è stata già utilizzata]]></string>
|
<string name="already_used_anonymous_barcode"><![CDATA[L\'etichetta scansionata è stata già utilizzata]]></string>
|
||||||
<string name="no_result_from_barcode">Il barcode scansionato non ha fornito alcun risultato</string>
|
<string name="no_result_from_barcode">Il barcode scansionato non ha fornito alcun risultato</string>
|
||||||
@ -131,6 +133,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<string name="dialog_vendita_filtro_avanzato">Filtro avanzato</string>
|
<string name="dialog_vendita_filtro_avanzato">Filtro avanzato</string>
|
||||||
|
<string name="dialog_choose_art_from_lista_art">Seleziona un articolo</string>
|
||||||
|
|
||||||
<string name="supplier">Fornitore</string>
|
<string name="supplier">Fornitore</string>
|
||||||
<string name="cod_art_or_description">Cod art / Descrizione</string>
|
<string name="cod_art_or_description">Cod art / Descrizione</string>
|
||||||
@ -139,4 +142,7 @@
|
|||||||
<string name="num_ords">Numero ordine</string>
|
<string name="num_ords">Numero ordine</string>
|
||||||
<string name="customer">Cliente</string>
|
<string name="customer">Cliente</string>
|
||||||
|
|
||||||
|
<string name="no_items_found_message">Nessun articolo trovato</string>
|
||||||
|
<string name="ask_print_message"><![CDATA[Si vuole procedere con la stampa dell\'etichetta?]]></string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
<!-- EMPTY VIEW -->
|
<!-- EMPTY VIEW -->
|
||||||
<color name="empty_view_gray">#bdbdbd</color>
|
<color name="empty_view_gray">#bdbdbd</color>
|
||||||
|
<color name="empty_view_bg_gray">#f5f5f5</color>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,8 @@
|
|||||||
<string name="accettazione_ordine_inevaso_title_multiple_order">Multiple acceptance orders</string>
|
<string name="accettazione_ordine_inevaso_title_multiple_order">Multiple acceptance orders</string>
|
||||||
<string name="vendita_title_fragment">Check out</string>
|
<string name="vendita_title_fragment">Check out</string>
|
||||||
<string name="rettifica_giacenze_fragment_title">Inventory</string>
|
<string name="rettifica_giacenze_fragment_title">Inventory</string>
|
||||||
<string name="error">Ops</string>
|
<string name="error">Error</string>
|
||||||
|
<string name="ops">Ops</string>
|
||||||
<string name="warning">Warning</string>
|
<string name="warning">Warning</string>
|
||||||
<string name="ok">OK</string>
|
<string name="ok">OK</string>
|
||||||
<string name="abort">Abort</string>
|
<string name="abort">Abort</string>
|
||||||
@ -130,6 +131,7 @@
|
|||||||
|
|
||||||
<string name="no_lu_already_registered_text">No LU already registered</string>
|
<string name="no_lu_already_registered_text">No LU already registered</string>
|
||||||
<string name="no_item_to_pick_text">No items to pick</string>
|
<string name="no_item_to_pick_text">No items to pick</string>
|
||||||
|
<string name="no_item_text">No items</string>
|
||||||
|
|
||||||
<string name="already_used_anonymous_barcode">The scanned label has already been used</string>
|
<string name="already_used_anonymous_barcode">The scanned label has already been used</string>
|
||||||
<string name="no_result_from_barcode">The scanned barcode did not produce any results</string>
|
<string name="no_result_from_barcode">The scanned barcode did not produce any results</string>
|
||||||
@ -138,6 +140,7 @@
|
|||||||
<string name="remove_filter_button">Remove filter</string>
|
<string name="remove_filter_button">Remove filter</string>
|
||||||
|
|
||||||
<string name="dialog_vendita_filtro_avanzato">Advanced filter</string>
|
<string name="dialog_vendita_filtro_avanzato">Advanced filter</string>
|
||||||
|
<string name="dialog_choose_art_from_lista_art">Choose item</string>
|
||||||
|
|
||||||
|
|
||||||
<string name="supplier">Supplier</string>
|
<string name="supplier">Supplier</string>
|
||||||
@ -148,4 +151,7 @@
|
|||||||
<string name="num_ords">Orders number</string>
|
<string name="num_ords">Orders number</string>
|
||||||
<string name="customer">Customer</string>
|
<string name="customer">Customer</string>
|
||||||
|
|
||||||
|
<string name="no_items_found_message">No items found</string>
|
||||||
|
<string name="ask_print_message">Do you want print the label?</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user