Compare commits
32 Commits
v1.19.4(24
...
v1.21.0(25
| Author | SHA1 | Date | |
|---|---|---|---|
| c37f4d62a4 | |||
| b8ac75ed6d | |||
| df9d3a80ac | |||
| 6aacaef720 | |||
| 1fab62187f | |||
| 0c4d0f2b59 | |||
| dbf183c7c6 | |||
| 42649cd5bb | |||
| 1f1a8f75de | |||
| 5215d43bf4 | |||
| d2f262a9b8 | |||
| 1fc78d053b | |||
| 016be4799c | |||
| e837132996 | |||
| 925760720d | |||
| 2e872c23aa | |||
| 7a62c8855f | |||
| c1da07b23c | |||
| ba7e2a6d61 | |||
| e798db1427 | |||
| a79dee3574 | |||
| 4f753399bf | |||
| 80842e49e5 | |||
| 2eac741bbb | |||
| c3e2a2a8fd | |||
| 99f0691c55 | |||
| 37ebd96a0f | |||
| c012c54805 | |||
| 9de6dcce80 | |||
| fc403ec419 | |||
| 4968f2f4fa | |||
| a7ea9b9022 |
@@ -6,8 +6,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 245
|
||||
def appVersionName = '1.19.4'
|
||||
def appVersionCode = 252
|
||||
def appVersionName = '1.21.0'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity
|
||||
android:name=".gest.picking_resi.PickingResiActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
||||
@@ -9,6 +9,12 @@ import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
||||
@@ -97,7 +103,10 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
ProdOrdineProduzioneElencoModule.class,
|
||||
ProdRecuperoMaterialeModule.class,
|
||||
ProdVersamentoMaterialeModule.class,
|
||||
DialogChooseArtsFromListaArtsModule.class
|
||||
DialogChooseArtsFromListaArtsModule.class,
|
||||
DocInterniModule.class,
|
||||
DialogSelectDocInfoModule.class,
|
||||
DocInterniEditFormModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@@ -132,7 +141,9 @@ public interface MainApplicationComponent {
|
||||
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
||||
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
||||
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
||||
|
||||
DocInterniComponent.Factory docInterniComponent();
|
||||
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@@ -25,6 +25,7 @@ import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||
|
||||
@Module
|
||||
@@ -158,5 +159,11 @@ public class MainApplicationModule {
|
||||
return new ProdFabbisognoLineeProdRESTConsumer(systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DocInterniRESTConsumer provideDocInterniRESTConsumer() {
|
||||
return new DocInterniRESTConsumer();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@ package it.integry.integrywmsnative.core.class_router.configs;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniFragment;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
||||
@@ -123,6 +125,14 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_prod_rientro_merce)
|
||||
.setCodMenu("MG059")
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.rientro_merce_fragment_title)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdRientroMerceFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.internal_handling)
|
||||
@@ -159,6 +169,13 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||
.setFragmentFactory(PVOrdiniAcquistoGrigliaFragment::newInstance))
|
||||
.addItem(new MenuItem()
|
||||
.setCodMenu("MG058")
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_doc_interni)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.doc_interni)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setFragmentFactory(DocInterniFragment::newInstance))
|
||||
|
||||
// .addItem(new MenuItem()
|
||||
// .setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto_trasmessi)
|
||||
|
||||
@@ -8,13 +8,17 @@ import it.integry.integrywmsnative.core.data_store.db.converter.DateConverter;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.GrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
|
||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class}, version = 1, exportSchema = false)
|
||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 5, exportSchema = false)
|
||||
@TypeConverters({
|
||||
DateConverter.class
|
||||
})
|
||||
@@ -30,26 +34,9 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public abstract ArticoloOrdineDao articoloOrdineDao();
|
||||
|
||||
// public static AppDatabase getDatabase(final Context context) {
|
||||
// if (INSTANCE == null) {
|
||||
// synchronized (AppDatabase.class) {
|
||||
// if (INSTANCE == null) {
|
||||
// INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
|
||||
// AppDatabase.class, "integry_wms")
|
||||
// .fallbackToDestructiveMigration()
|
||||
// .build();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return INSTANCE;
|
||||
// }
|
||||
public abstract MtbColtDao mtbColtDao();
|
||||
|
||||
// public AppDatabase(Application application) {
|
||||
// mRoomInstance = Room.databaseBuilder(application,
|
||||
// AppDatabase.class, "integry_wms")
|
||||
// .fallbackToDestructiveMigration()
|
||||
// .build();
|
||||
// }
|
||||
public abstract MtbColrDao mtbColrDao();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,15 +11,21 @@ import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.GrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoloGrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.GrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.OrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.ArticoliGrigliaDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.ArticoliOrdineDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.GrigliaDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.OrdineDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.SqlMtbColrDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.SqlMtbColtDataSource;
|
||||
|
||||
@Module
|
||||
public class RoomModule {
|
||||
@@ -66,6 +72,18 @@ public class RoomModule {
|
||||
return appDatabase.articoloOrdineDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColtDao providesMtbColtDao(AppDatabase appDatabase) {
|
||||
return appDatabase.mtbColtDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColrDao providesMtbColrDao(AppDatabase appDatabase) {
|
||||
return appDatabase.mtbColrDao();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -96,4 +114,16 @@ public class RoomModule {
|
||||
return new OrdineDataSource(ordineDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColtRepository providesMtbColtRepository(MtbColtDao mtbColtDao) {
|
||||
return new SqlMtbColtDataSource(mtbColtDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColrRepository providesMtbColrRepository(MtbColrDao mtbColrDao) {
|
||||
return new SqlMtbColrDataSource(mtbColrDao);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
|
||||
@Dao
|
||||
public interface MtbColrDao {
|
||||
@Query("SELECT * from mtb_colr ")
|
||||
List<SqlMtbColr> getAll();
|
||||
|
||||
@Insert
|
||||
Long insert(SqlMtbColr mtbColr);
|
||||
|
||||
@Update
|
||||
void update(SqlMtbColr mtbColr);
|
||||
|
||||
@Delete
|
||||
void delete(SqlMtbColr mtbColr);
|
||||
|
||||
@Query("SELECT * from mtb_colr where id_collo = :idDocument")
|
||||
List<SqlMtbColr> getDocumentRows(int idDocument);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdineWithGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
|
||||
@Dao
|
||||
public interface MtbColtDao {
|
||||
@Query("SELECT * from mtb_colt")
|
||||
List<SqlMtbColt> getAll();
|
||||
|
||||
@Insert
|
||||
Long insert(SqlMtbColt mtbColt);
|
||||
|
||||
@Update
|
||||
void update(SqlMtbColt mtbColt);
|
||||
|
||||
@Delete
|
||||
void delete(SqlMtbColt mtbColt);
|
||||
|
||||
@Query("SELECT mtb_colt.*, count(mtb_colr.id) as countArticoli from mtb_colt left outer join mtb_colr on (mtb_colr.id_collo = mtb_colt.id) where" +
|
||||
" cod_dtip_provv = :codDtip " +
|
||||
" AND ( cod_anag = :codAnag OR (cod_anag is null and :codAnag is null)) " +
|
||||
" AND ( cod_vdes = :codVdes OR (cod_vdes is null and :codVdes is null)) " +
|
||||
" AND ( mtb_colt.data_doc = :dataDoc OR (mtb_colt.data_doc is null and :dataDoc is null)) " +
|
||||
" AND ( mtb_colt.num_doc = :numDoc OR (mtb_colt.num_doc is null and :numDoc is null)) " +
|
||||
" and cod_dtip is null group by mtb_colt.id")
|
||||
List<DocInternoWrapper> getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc);
|
||||
|
||||
@Query("SELECT ifnull(MAX(num_collo),0) +1 as num_collo from mtb_colt")
|
||||
Integer getNextNumCollo();
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import androidx.room.ForeignKey;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
@Entity(
|
||||
@@ -54,6 +56,18 @@ public class ArticoloGriglia {
|
||||
@ColumnInfo(name = "qta_min_ordinabile")
|
||||
private float qtaMinOrdinabile;
|
||||
|
||||
@ColumnInfo(name = "gg_scadenza")
|
||||
private int ggScadenza;
|
||||
|
||||
@ColumnInfo(name = "giacenza")
|
||||
private float giacenza;
|
||||
|
||||
@ColumnInfo(name = "qta_prevista_vendita")
|
||||
private float qtaPrevistaVendita;
|
||||
|
||||
@ColumnInfo(name = "qta_proposta")
|
||||
private float qtaProposta;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
|
||||
@@ -145,6 +159,38 @@ public class ArticoloGriglia {
|
||||
this.idGriglia = idGriglia;
|
||||
}
|
||||
|
||||
public int getGgScadenza() {
|
||||
return ggScadenza;
|
||||
}
|
||||
|
||||
public void setGgScadenza(int ggScadenza) {
|
||||
this.ggScadenza = ggScadenza;
|
||||
}
|
||||
|
||||
public float getGiacenza() {
|
||||
return giacenza;
|
||||
}
|
||||
|
||||
public void setGiacenza(float giacenza) {
|
||||
this.giacenza = giacenza;
|
||||
}
|
||||
|
||||
public float getQtaPrevistaVendita() {
|
||||
return qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public void setQtaPrevistaVendita(float qtaPrevistaVendita) {
|
||||
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public float getQtaProposta() {
|
||||
return qtaProposta;
|
||||
}
|
||||
|
||||
public void setQtaProposta(float qtaProposta) {
|
||||
this.qtaProposta = qtaProposta;
|
||||
}
|
||||
|
||||
public ArticoloOrdine convertToArticoloOrdine(Ordine ordine) {
|
||||
ArticoloOrdine articolo = new ArticoloOrdine();
|
||||
|
||||
@@ -160,6 +206,11 @@ public class ArticoloGriglia {
|
||||
articolo.setUntMis(this.getUntMis());
|
||||
articolo.setDescrizione(this.getDescrizione());
|
||||
articolo.setDataIns(UtilityDate.getDateInstance());
|
||||
articolo.setGgScadenza(this.getGgScadenza());
|
||||
articolo.setGiacenza(BigDecimal.valueOf(this.getGiacenza()));
|
||||
articolo.setQtaPrevistaVendita(BigDecimal.valueOf(this.getQtaPrevistaVendita()));
|
||||
articolo.setQtaProposta(BigDecimal.valueOf(this.getQtaProposta()));
|
||||
|
||||
articolo.setQtaOrd(0);
|
||||
|
||||
return articolo;
|
||||
|
||||
@@ -3,16 +3,19 @@ package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.ForeignKey;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity(
|
||||
tableName = "articoli_ordine",
|
||||
indices = {
|
||||
@Index(value = "id_ordine"),
|
||||
@Index(value = {"id_ordine","cod_mart"}, unique = true)
|
||||
@Index(value = {"id_ordine", "cod_mart"}, unique = true)
|
||||
},
|
||||
foreignKeys = {
|
||||
@ForeignKey(
|
||||
@@ -22,7 +25,7 @@ import java.util.Date;
|
||||
onDelete = ForeignKey.CASCADE
|
||||
)
|
||||
}
|
||||
)
|
||||
)
|
||||
public class ArticoloOrdine {
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(name = "articolo_ordine_id")
|
||||
@@ -64,6 +67,20 @@ public class ArticoloOrdine {
|
||||
@ColumnInfo(name = "data_ins")
|
||||
private Date dataIns;
|
||||
|
||||
|
||||
@Ignore
|
||||
private int ggScadenza = 0;
|
||||
|
||||
@Ignore
|
||||
private BigDecimal giacenza = BigDecimal.ZERO;
|
||||
|
||||
@Ignore
|
||||
private BigDecimal qtaPrevistaVendita = BigDecimal.ZERO;
|
||||
|
||||
@Ignore
|
||||
private BigDecimal qtaProposta = BigDecimal.ZERO;
|
||||
|
||||
|
||||
public int getArticoloOrdineId() {
|
||||
return articoloOrdineId;
|
||||
}
|
||||
@@ -167,4 +184,51 @@ public class ArticoloOrdine {
|
||||
public void setDataIns(Date dataIns) {
|
||||
this.dataIns = dataIns;
|
||||
}
|
||||
|
||||
public int getGgScadenza() {
|
||||
return ggScadenza;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setGgScadenza(int ggScadenza) {
|
||||
this.ggScadenza = ggScadenza;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getGiacenza() {
|
||||
return giacenza;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setGiacenza(BigDecimal giacenza) {
|
||||
this.giacenza = giacenza;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaPrevistaVendita() {
|
||||
return qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setQtaPrevistaVendita(BigDecimal qtaPrevistaVendita) {
|
||||
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaProposta() {
|
||||
return qtaProposta;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setQtaProposta(BigDecimal qtaProposta) {
|
||||
this.qtaProposta = qtaProposta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfPrevistaVendita(){
|
||||
return qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf),0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfProposta(){
|
||||
return qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf),0, RoundingMode.CEILING);
|
||||
}
|
||||
public BigDecimal getQtaCnfGiacenza(){
|
||||
return giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf),0, RoundingMode.CEILING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,438 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.ForeignKey;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity(
|
||||
tableName = "mtb_colr",
|
||||
indices = {
|
||||
@Index(value = {"data_collo", "ser_collo", "num_collo", "gestione","riga"}, unique = true),
|
||||
@Index(value = {"id_collo"})
|
||||
},
|
||||
foreignKeys = {
|
||||
@ForeignKey(
|
||||
entity = SqlMtbColt.class,
|
||||
parentColumns = "id",
|
||||
childColumns = "id_collo",
|
||||
onDelete = ForeignKey.CASCADE
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
public class SqlMtbColr {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(name = "id")
|
||||
private int id;
|
||||
|
||||
@ColumnInfo(name = "id_collo")
|
||||
private int idCollo;
|
||||
|
||||
|
||||
@ColumnInfo(name = "data_collo")
|
||||
private Date dataCollo;
|
||||
|
||||
@ColumnInfo(name = "gestione")
|
||||
private String gestione;
|
||||
|
||||
@ColumnInfo(name = "ser_collo")
|
||||
private String serCollo;
|
||||
|
||||
@ColumnInfo(name = "descrizione")
|
||||
private String descrizione;
|
||||
|
||||
@ColumnInfo(name = "num_collo")
|
||||
private Integer numCollo;
|
||||
|
||||
|
||||
@ColumnInfo(name = "riga")
|
||||
private Integer riga;
|
||||
|
||||
@ColumnInfo(name = "riga_ord")
|
||||
private Integer rigaOrd;
|
||||
|
||||
@ColumnInfo(name = "cod_mart")
|
||||
private String codMart;
|
||||
|
||||
@ColumnInfo(name = "cod_barre")
|
||||
private String codBarre;
|
||||
|
||||
@ColumnInfo(name = "cod_col")
|
||||
private String codCol;
|
||||
|
||||
@ColumnInfo(name = "cod_tagl")
|
||||
private String codTagl;
|
||||
|
||||
@ColumnInfo(name = "partita_mag")
|
||||
private String partitaMag;
|
||||
|
||||
@ColumnInfo(name = "gestione_rif")
|
||||
private String gestioneRif;
|
||||
|
||||
@ColumnInfo(name = "ser_collo_rif")
|
||||
private String serColloRif;
|
||||
|
||||
@ColumnInfo(name = "note")
|
||||
private String note;
|
||||
|
||||
@ColumnInfo(name = "data_ord")
|
||||
private Date dataOrd;
|
||||
|
||||
@ColumnInfo(name = "data_collo_rif")
|
||||
private Date dataColloRif;
|
||||
|
||||
@ColumnInfo(name = "qta_cnf")
|
||||
private Float qtaCnf;
|
||||
|
||||
@ColumnInfo(name = "qta_col")
|
||||
private Float qtaCol;
|
||||
|
||||
@ColumnInfo(name = "num_ord")
|
||||
private Integer numOrd;
|
||||
|
||||
@ColumnInfo(name = "num_etich")
|
||||
private Integer numEtich;
|
||||
|
||||
@ColumnInfo(name = "num_collo_rif")
|
||||
private Integer numColloRif;
|
||||
|
||||
@ColumnInfo(name = "datetime_row")
|
||||
private Date datetimeRow;
|
||||
|
||||
@ColumnInfo(name = "cod_jcom")
|
||||
private String codJcom;
|
||||
|
||||
@ColumnInfo(name = "num_cnf")
|
||||
private Float numCnf;
|
||||
|
||||
@ColumnInfo(name = "causale")
|
||||
private String causale;
|
||||
|
||||
@ColumnInfo(name = "utente")
|
||||
private String utente;
|
||||
|
||||
@ColumnInfo(name = "cod_anag_doc")
|
||||
private String codAnagDoc;
|
||||
|
||||
@ColumnInfo(name = "cod_dtip_doc")
|
||||
private String codDtipDoc;
|
||||
|
||||
@ColumnInfo(name = "data_doc")
|
||||
private Date dataDoc;
|
||||
|
||||
@ColumnInfo(name = "ser_doc")
|
||||
private String serDoc;
|
||||
|
||||
@ColumnInfo(name = "num_doc")
|
||||
private Integer numDoc;
|
||||
|
||||
@ColumnInfo(name = "id_riga_doc")
|
||||
private Integer idRigaDoc;
|
||||
|
||||
@ColumnInfo(name = "unt_mis")
|
||||
private String untMis;
|
||||
@ColumnInfo(name = "data_scad")
|
||||
private Date dataScad;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getIdCollo() {
|
||||
return idCollo;
|
||||
}
|
||||
|
||||
public void setIdCollo(int idCollo) {
|
||||
this.idCollo = idCollo;
|
||||
}
|
||||
|
||||
public Date getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public void setDataCollo(Date dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
}
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public void setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public void setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public void setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
}
|
||||
|
||||
public Integer getRiga() {
|
||||
return riga;
|
||||
}
|
||||
|
||||
public void setRiga(Integer riga) {
|
||||
this.riga = riga;
|
||||
}
|
||||
|
||||
public Integer getRigaOrd() {
|
||||
return rigaOrd;
|
||||
}
|
||||
|
||||
public void setRigaOrd(Integer rigaOrd) {
|
||||
this.rigaOrd = rigaOrd;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public void setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
}
|
||||
|
||||
public String getCodBarre() {
|
||||
return codBarre;
|
||||
}
|
||||
|
||||
public void setCodBarre(String codBarre) {
|
||||
this.codBarre = codBarre;
|
||||
}
|
||||
|
||||
public String getCodCol() {
|
||||
return codCol;
|
||||
}
|
||||
|
||||
public void setCodCol(String codCol) {
|
||||
this.codCol = codCol;
|
||||
}
|
||||
|
||||
public String getCodTagl() {
|
||||
return codTagl;
|
||||
}
|
||||
|
||||
public void setCodTagl(String codTagl) {
|
||||
this.codTagl = codTagl;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public void setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
}
|
||||
|
||||
public String getGestioneRif() {
|
||||
return gestioneRif;
|
||||
}
|
||||
|
||||
public void setGestioneRif(String gestioneRif) {
|
||||
this.gestioneRif = gestioneRif;
|
||||
}
|
||||
|
||||
public String getSerColloRif() {
|
||||
return serColloRif;
|
||||
}
|
||||
|
||||
public void setSerColloRif(String serColloRif) {
|
||||
this.serColloRif = serColloRif;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public void setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
}
|
||||
|
||||
public Date getDataColloRif() {
|
||||
return dataColloRif;
|
||||
}
|
||||
|
||||
public void setDataColloRif(Date dataColloRif) {
|
||||
this.dataColloRif = dataColloRif;
|
||||
}
|
||||
|
||||
public Float getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public void setQtaCnf(Float qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
}
|
||||
|
||||
public Float getQtaCol() {
|
||||
return qtaCol;
|
||||
}
|
||||
|
||||
public void setQtaCol(Float qtaCol) {
|
||||
this.qtaCol = qtaCol;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public void setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
}
|
||||
|
||||
public Integer getNumEtich() {
|
||||
return numEtich;
|
||||
}
|
||||
|
||||
public void setNumEtich(Integer numEtich) {
|
||||
this.numEtich = numEtich;
|
||||
}
|
||||
|
||||
public Integer getNumColloRif() {
|
||||
return numColloRif;
|
||||
}
|
||||
|
||||
public void setNumColloRif(Integer numColloRif) {
|
||||
this.numColloRif = numColloRif;
|
||||
}
|
||||
|
||||
public Date getDatetimeRow() {
|
||||
return datetimeRow;
|
||||
}
|
||||
|
||||
public void setDatetimeRow(Date datetimeRow) {
|
||||
this.datetimeRow = datetimeRow;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public void setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
}
|
||||
|
||||
public Float getNumCnf() {
|
||||
return numCnf;
|
||||
}
|
||||
|
||||
public void setNumCnf(Float numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
}
|
||||
|
||||
public String getCausale() {
|
||||
return causale;
|
||||
}
|
||||
|
||||
public void setCausale(String causale) {
|
||||
this.causale = causale;
|
||||
}
|
||||
|
||||
public String getUtente() {
|
||||
return utente;
|
||||
}
|
||||
|
||||
public void setUtente(String utente) {
|
||||
this.utente = utente;
|
||||
}
|
||||
|
||||
public String getCodAnagDoc() {
|
||||
return codAnagDoc;
|
||||
}
|
||||
|
||||
public void setCodAnagDoc(String codAnagDoc) {
|
||||
this.codAnagDoc = codAnagDoc;
|
||||
}
|
||||
|
||||
public String getCodDtipDoc() {
|
||||
return codDtipDoc;
|
||||
}
|
||||
|
||||
public void setCodDtipDoc(String codDtipDoc) {
|
||||
this.codDtipDoc = codDtipDoc;
|
||||
}
|
||||
|
||||
public Date getDataDoc() {
|
||||
return dataDoc;
|
||||
}
|
||||
|
||||
public void setDataDoc(Date dataDoc) {
|
||||
this.dataDoc = dataDoc;
|
||||
}
|
||||
|
||||
public String getSerDoc() {
|
||||
return serDoc;
|
||||
}
|
||||
|
||||
public void setSerDoc(String serDoc) {
|
||||
this.serDoc = serDoc;
|
||||
}
|
||||
|
||||
public Integer getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
|
||||
public void setNumDoc(Integer numDoc) {
|
||||
this.numDoc = numDoc;
|
||||
}
|
||||
|
||||
public Integer getIdRigaDoc() {
|
||||
return idRigaDoc;
|
||||
}
|
||||
|
||||
public void setIdRigaDoc(Integer idRigaDoc) {
|
||||
this.idRigaDoc = idRigaDoc;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public void setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public void setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Entity(
|
||||
tableName = "mtb_colt",
|
||||
indices = {
|
||||
@Index(value = {"data_collo", "ser_collo", "num_collo", "gestione"}, unique = true)
|
||||
}
|
||||
)
|
||||
|
||||
public class SqlMtbColt {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(name = "id")
|
||||
private int id;
|
||||
|
||||
@ColumnInfo(name = "username")
|
||||
private String username;
|
||||
|
||||
@ColumnInfo
|
||||
private String gestione;
|
||||
|
||||
@ColumnInfo(name = "data_collo")
|
||||
private Date dataCollo;
|
||||
|
||||
@ColumnInfo(name = "ser_collo")
|
||||
private String serCollo;
|
||||
|
||||
@ColumnInfo(name = "num_collo")
|
||||
private Integer numCollo;
|
||||
|
||||
@ColumnInfo(name = "rif_ord")
|
||||
private String rifOrd;
|
||||
|
||||
@ColumnInfo(name = "cod_anag")
|
||||
private String codAnag;
|
||||
|
||||
@ColumnInfo(name = "cod_vdes")
|
||||
private String codVdes;
|
||||
|
||||
@ColumnInfo(name = "cod_mdep")
|
||||
private String codMdep;
|
||||
|
||||
@ColumnInfo(name = "cod_vlis")
|
||||
private String codVlis;
|
||||
|
||||
@ColumnInfo(name = "cod_dtip")
|
||||
private String codDtip;
|
||||
|
||||
@ColumnInfo(name = "cod_tcol")
|
||||
private String codTcol;
|
||||
|
||||
@ColumnInfo(name = "ser_doc")
|
||||
private String serDoc;
|
||||
|
||||
@ColumnInfo(name = "annotazioni")
|
||||
private String annotazioni;
|
||||
|
||||
@ColumnInfo(name = "posizione")
|
||||
private String posizione;
|
||||
|
||||
@ColumnInfo(name = "cod_dtip_provv")
|
||||
private String codDtipProvv;
|
||||
|
||||
@ColumnInfo(name = "ser_doc_provv")
|
||||
private String serDocProvv;
|
||||
|
||||
@ColumnInfo(name = "cod_jfas")
|
||||
private String codJfas;
|
||||
|
||||
@ColumnInfo(name = "data_ord")
|
||||
private Date dataOrd;
|
||||
|
||||
@ColumnInfo(name = "data_doc")
|
||||
private Date dataDoc;
|
||||
|
||||
@ColumnInfo(name = "data_doc_provv")
|
||||
private Date dataDocProvv;
|
||||
|
||||
@ColumnInfo(name = "cod_mgrp")
|
||||
private String codMgrp;
|
||||
|
||||
@ColumnInfo(name = "data_vers")
|
||||
private Date dataVers;
|
||||
|
||||
@ColumnInfo(name = "segno")
|
||||
private Integer segno;
|
||||
|
||||
@ColumnInfo(name = "num_ord")
|
||||
private Integer numOrd;
|
||||
|
||||
@ColumnInfo(name = "num_doc")
|
||||
private Integer numDoc;
|
||||
|
||||
@ColumnInfo(name = "num_doc_provv")
|
||||
private Integer numDocProvv;
|
||||
|
||||
@Ignore
|
||||
private List<SqlMtbColr> sqlMtbColrs = new ArrayList<>();
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public void setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
}
|
||||
|
||||
public Date getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public void setDataCollo(Date dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public void setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public void setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
}
|
||||
|
||||
public String getRifOrd() {
|
||||
return rifOrd;
|
||||
}
|
||||
|
||||
public void setRifOrd(String rifOrd) {
|
||||
this.rifOrd = rifOrd;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public void setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
}
|
||||
|
||||
public String getCodVdes() {
|
||||
return codVdes;
|
||||
}
|
||||
|
||||
public void setCodVdes(String codVdes) {
|
||||
this.codVdes = codVdes;
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public void setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
}
|
||||
|
||||
public String getCodVlis() {
|
||||
return codVlis;
|
||||
}
|
||||
|
||||
public void setCodVlis(String codVlis) {
|
||||
this.codVlis = codVlis;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public void setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
}
|
||||
|
||||
public String getCodTcol() {
|
||||
return codTcol;
|
||||
}
|
||||
|
||||
public void setCodTcol(String codTcol) {
|
||||
this.codTcol = codTcol;
|
||||
}
|
||||
|
||||
public String getSerDoc() {
|
||||
return serDoc;
|
||||
}
|
||||
|
||||
public void setSerDoc(String serDoc) {
|
||||
this.serDoc = serDoc;
|
||||
}
|
||||
|
||||
public String getAnnotazioni() {
|
||||
return annotazioni;
|
||||
}
|
||||
|
||||
public void setAnnotazioni(String annotazioni) {
|
||||
this.annotazioni = annotazioni;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public void setPosizione(String posizione) {
|
||||
this.posizione = posizione;
|
||||
}
|
||||
|
||||
public String getCodDtipProvv() {
|
||||
return codDtipProvv;
|
||||
}
|
||||
|
||||
public void setCodDtipProvv(String codDtipProvv) {
|
||||
this.codDtipProvv = codDtipProvv;
|
||||
}
|
||||
|
||||
public String getSerDocProvv() {
|
||||
return serDocProvv;
|
||||
}
|
||||
|
||||
public void setSerDocProvv(String serDocProvv) {
|
||||
this.serDocProvv = serDocProvv;
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public void setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public void setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
}
|
||||
|
||||
public Date getDataDoc() {
|
||||
return dataDoc;
|
||||
}
|
||||
|
||||
public void setDataDoc(Date dataDoc) {
|
||||
this.dataDoc = dataDoc;
|
||||
}
|
||||
|
||||
public Date getDataDocProvv() {
|
||||
return dataDocProvv;
|
||||
}
|
||||
|
||||
public void setDataDocProvv(Date dataDocProvv) {
|
||||
this.dataDocProvv = dataDocProvv;
|
||||
}
|
||||
|
||||
public Date getDataVers() {
|
||||
return dataVers;
|
||||
}
|
||||
|
||||
public void setDataVers(Date dataVers) {
|
||||
this.dataVers = dataVers;
|
||||
}
|
||||
|
||||
public Integer getSegno() {
|
||||
return segno;
|
||||
}
|
||||
|
||||
public void setSegno(Integer segno) {
|
||||
this.segno = segno;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public void setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
}
|
||||
|
||||
public Integer getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
|
||||
public void setNumDoc(Integer numDoc) {
|
||||
this.numDoc = numDoc;
|
||||
}
|
||||
|
||||
public Integer getNumDocProvv() {
|
||||
return numDocProvv;
|
||||
}
|
||||
|
||||
public void setNumDocProvv(Integer numDocProvv) {
|
||||
this.numDocProvv = numDocProvv;
|
||||
}
|
||||
|
||||
public List<SqlMtbColr> getSqlMtbColrs() {
|
||||
return sqlMtbColrs;
|
||||
}
|
||||
|
||||
public void setSqlMtbColrs(List<SqlMtbColr> sqlMtbColrs) {
|
||||
this.sqlMtbColrs = sqlMtbColrs;
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public void setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public interface MtbColrRepository {
|
||||
|
||||
void selectAll(RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void insert(SqlMtbColr mtbColr, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void update(SqlMtbColr mtbColr, RunnableArgs<SqlMtbColr> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void delete(SqlMtbColr mtbColr, Runnable onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void getDocumentRows(SqlMtbColt sqlMtbColt, RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdineWithGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public interface MtbColtRepository {
|
||||
|
||||
void selectAll(RunnableArgs<List<SqlMtbColt>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void insert(SqlMtbColt mtbColt, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void update(SqlMtbColt mtbColt, RunnableArgs<SqlMtbColt> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void delete(SqlMtbColt mtbColt, Runnable onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc, RunnableArgs<List<DocInternoWrapper>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void getNextNumCollo(RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrRepository;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class SqlMtbColrDataSource extends Repository implements MtbColrRepository {
|
||||
|
||||
private MtbColrDao mMtbColrDao;
|
||||
|
||||
@Inject
|
||||
public SqlMtbColrDataSource(MtbColrDao mtbColrDao) {
|
||||
this.mMtbColrDao = mtbColrDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColrDao.getAll());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void insert(SqlMtbColr mtbColr, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
Long id = mMtbColrDao.insert(mtbColr);
|
||||
onSuccess.run(id.intValue());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void update(SqlMtbColr mtbColr, RunnableArgs<SqlMtbColr> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColrDao.update(mtbColr);
|
||||
onSuccess.run(mtbColr);
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(SqlMtbColr mtbColr, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColrDao.delete(mtbColr);
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getDocumentRows(SqlMtbColt document, RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColrDao.getDocumentRows(document.getId()));
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class SqlMtbColtDataSource extends Repository implements MtbColtRepository {
|
||||
|
||||
private MtbColtDao mMtbColtDao;
|
||||
|
||||
@Inject
|
||||
public SqlMtbColtDataSource(MtbColtDao mtbColtDao) {
|
||||
this.mMtbColtDao = mtbColtDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<SqlMtbColt>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColtDao.getAll());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void insert(SqlMtbColt mtbColt, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
Long id = mMtbColtDao.insert(mtbColt);
|
||||
onSuccess.run(id.intValue());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void update(SqlMtbColt mtbColt, RunnableArgs<SqlMtbColt> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColtDao.update(mtbColt);
|
||||
onSuccess.run(mtbColt);
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(SqlMtbColt mtbColt, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColtDao.delete(mtbColt);
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc, RunnableArgs<List<DocInternoWrapper>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColtDao.getLocalDocumentsByCodDtip(codDtip,codAnag,codVdes,dataDoc,numDoc));
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNextNumCollo(RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColtDao.getNextNumCollo());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,34 +1,38 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.view_model;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
|
||||
public class ArticoloDTO {
|
||||
|
||||
private String codMart;
|
||||
|
||||
|
||||
private String descrizione;
|
||||
|
||||
|
||||
private String untMis;
|
||||
|
||||
|
||||
private float qtaCnf;
|
||||
|
||||
|
||||
private String barcode;
|
||||
|
||||
|
||||
private float merceDaRic;
|
||||
|
||||
|
||||
private float mediaSett;
|
||||
|
||||
|
||||
private String flagQtaMultipla;
|
||||
|
||||
private float qtaCnf;
|
||||
|
||||
private float merceDaRic;
|
||||
|
||||
private float mediaSett;
|
||||
|
||||
private float qtaMinOrdinabile;
|
||||
|
||||
private int ggScadenza;
|
||||
|
||||
private float giacenza;
|
||||
|
||||
private float qtaPrevistaVendita;
|
||||
|
||||
private float qtaProposta;
|
||||
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
@@ -101,8 +105,47 @@ public class ArticoloDTO {
|
||||
this.qtaMinOrdinabile = qtaMinOrdinabile;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public ArticoloGriglia toArticoloGriglia(){
|
||||
public void setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
}
|
||||
|
||||
public int getGgScadenza() {
|
||||
return ggScadenza;
|
||||
}
|
||||
|
||||
public void setGgScadenza(int ggScadenza) {
|
||||
this.ggScadenza = ggScadenza;
|
||||
}
|
||||
|
||||
public float getGiacenza() {
|
||||
return giacenza;
|
||||
}
|
||||
|
||||
public void setGiacenza(float giacenza) {
|
||||
this.giacenza = giacenza;
|
||||
}
|
||||
|
||||
public float getQtaPrevistaVendita() {
|
||||
return qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public void setQtaPrevistaVendita(float qtaPrevistaVendita) {
|
||||
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public float getQtaProposta() {
|
||||
return qtaProposta;
|
||||
}
|
||||
|
||||
public void setQtaProposta(float qtaProposta) {
|
||||
this.qtaProposta = qtaProposta;
|
||||
}
|
||||
|
||||
public ArticoloGriglia toArticoloGriglia() {
|
||||
ArticoloGriglia result = new ArticoloGriglia();
|
||||
result.setBarCode(this.getBarCode());
|
||||
result.setDescrizione(this.getDescrizione());
|
||||
@@ -113,6 +156,10 @@ public class ArticoloDTO {
|
||||
result.setMediaSett(this.getMediaSett());
|
||||
result.setFlagQtaMultipla(this.getFlagQtaMultipla());
|
||||
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
||||
result.setGgScadenza(this.ggScadenza);
|
||||
result.setGiacenza(this.giacenza);
|
||||
result.setQtaPrevistaVendita(this.qtaPrevistaVendita);
|
||||
result.setQtaProposta(this.qtaProposta);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.wrappers;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Embedded;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
|
||||
public class DocInternoWrapper {
|
||||
@Embedded
|
||||
private SqlMtbColt document;
|
||||
|
||||
@ColumnInfo(name = "countArticoli")
|
||||
private int countArticoli = 0;
|
||||
|
||||
public SqlMtbColt getDocument() {
|
||||
return document;
|
||||
}
|
||||
|
||||
public void setDocument(SqlMtbColt document) {
|
||||
this.document = document;
|
||||
}
|
||||
|
||||
public int getCountArticoli() {
|
||||
return countArticoli;
|
||||
}
|
||||
|
||||
public void setCountArticoli(int countArticoli) {
|
||||
this.countArticoli = countArticoli;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import androidx.databinding.PropertyChangeRegistry;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class BindableBigDecimal implements Observable {
|
||||
|
||||
BigDecimal mValue;
|
||||
@@ -102,9 +104,24 @@ public class BindableBigDecimal implements Observable {
|
||||
}
|
||||
|
||||
public void set(BigDecimal value, boolean forceRefresh) {
|
||||
if (!mValue.equals(value) || forceRefresh) {
|
||||
if ((mValue == null) || !mValue.equals(value) || forceRefresh) {
|
||||
this.mValue = value;
|
||||
notifyChange();
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerListener(BindableBigDecimal bindableBigDecimal, RunnableArgs<BigDecimal> onValueChanged) {
|
||||
bindableBigDecimal.addOnPropertyChangedCallback(new OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
if(onValueChanged != null) onValueChanged.run(bindableBigDecimal.get());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void resetListeners(BindableBigDecimal bindableBigDecimal){
|
||||
BigDecimal oldValue = bindableBigDecimal.get();
|
||||
bindableBigDecimal = new BindableBigDecimal();
|
||||
bindableBigDecimal.set(oldValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import androidx.databinding.BaseObservable;
|
||||
import androidx.databinding.Observable;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class BindableInteger extends BaseObservable {
|
||||
Integer mValue;
|
||||
@@ -34,4 +37,19 @@ public class BindableInteger extends BaseObservable {
|
||||
return mValue == null;
|
||||
}
|
||||
|
||||
public static void registerListener(BindableInteger bindableInteger, RunnableArgs<Integer> onValueChanged) {
|
||||
bindableInteger.addOnPropertyChangedCallback(new OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
if(onValueChanged != null) onValueChanged.run(bindableInteger.get());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void resetListeners(BindableInteger bindableInteger){
|
||||
Integer oldValue = bindableInteger.get();
|
||||
bindableInteger = new BindableInteger();
|
||||
bindableInteger.set(oldValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,20 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class BindableString extends BaseObservable {
|
||||
String value;
|
||||
private boolean isHtml = false;
|
||||
|
||||
public BindableString(){};
|
||||
public BindableString(boolean isHtml){
|
||||
this.isHtml = isHtml;
|
||||
};
|
||||
public BindableString(String startingValue ,boolean isHtml){
|
||||
this.isHtml = isHtml;
|
||||
this.set(startingValue);
|
||||
};
|
||||
|
||||
public boolean isHtml() {
|
||||
return isHtml;
|
||||
}
|
||||
|
||||
public String get() {
|
||||
return value != null ? value : "";
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@@ -51,7 +52,7 @@ public class Converters {
|
||||
|
||||
@BindingConversion
|
||||
public static String convertBindableToString(BindableString bindableString) {
|
||||
if(bindableString != null) return bindableString.get();
|
||||
if (bindableString != null) return bindableString.get();
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -75,7 +76,8 @@ public class Converters {
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if(bindableInteger != null) bindableInteger.set(Integer.parseInt(s.toString()));
|
||||
if (bindableInteger != null)
|
||||
bindableInteger.set(Integer.parseInt(s.toString()));
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(bindableInteger, watcher));
|
||||
@@ -97,7 +99,7 @@ public class Converters {
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if(observableField != null) observableField.set(s.toString());
|
||||
if (observableField != null) observableField.set(s.toString());
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
||||
@@ -126,8 +128,9 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = bindableString.get();
|
||||
boolean isHtml = bindableString.isHtml();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
view.setText(isHtml ? Html.fromHtml(newValue) : newValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +211,8 @@ public class Converters {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
if(!UtilityString.isNullOrEmpty(s.toString())) value = new BigDecimal(s.toString());
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
@@ -218,11 +222,65 @@ public class Converters {
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
|
||||
if(!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextBigDecimal(TextInputEditText view, final BindableBigDecimal bindableBigDecimal) {
|
||||
Pair<BindableBigDecimal, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != bindableBigDecimal) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
bindableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(bindableBigDecimal, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = bindableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextInteger(TextInputEditText view, final BindableInteger bindableInteger) {
|
||||
Pair<BindableInteger, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != bindableInteger) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
Integer value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = Integer.valueOf(s.toString());
|
||||
bindableInteger.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(bindableInteger, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
Integer newValue = bindableInteger.get();
|
||||
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
||||
|
||||
if (!(viewValue.compareTo(newValue) == 0)) {
|
||||
view.setText(newValue.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextString(TextInputEditText view, final ObservableField<String> observableString) {
|
||||
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@@ -242,7 +300,7 @@ public class Converters {
|
||||
String newValue = observableString.get();
|
||||
String viewValue = view.getText().toString();
|
||||
|
||||
if(!viewValue.equalsIgnoreCase(newValue)) {
|
||||
if (!viewValue.equalsIgnoreCase(newValue)) {
|
||||
view.setText(newValue);
|
||||
}
|
||||
}
|
||||
@@ -266,7 +324,7 @@ public class Converters {
|
||||
// Get Current Date
|
||||
Calendar c = UtilityDate.getCalendarInstance();
|
||||
|
||||
if(observableDate.get() != null) {
|
||||
if (observableDate.get() != null) {
|
||||
c.setTime(observableDate.get());
|
||||
}
|
||||
|
||||
@@ -277,8 +335,8 @@ public class Converters {
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(view.getContext(),
|
||||
(cView, year, month, day) -> {
|
||||
Date resultDate = new GregorianCalendar(year, month, day).getTime();
|
||||
|
||||
if(parentFragment != null && warningOnOldDates && resultDate.before(new Date())) {
|
||||
|
||||
if (parentFragment != null && warningOnOldDates && resultDate.before(new Date())) {
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
||||
view.setText(UtilityDate.formatDate(resultDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
@@ -297,8 +355,8 @@ public class Converters {
|
||||
|
||||
//Adding click-listener
|
||||
view.setOnClickListener(onClick::run);
|
||||
if(view.getParent() != null && view.getParent().getParent() != null && view.getParent().getParent() instanceof TextInputLayout) {
|
||||
((FrameLayout)view.getParent()).setOnClickListener(onClick::run);
|
||||
if (view.getParent() != null && view.getParent().getParent() != null && view.getParent().getParent() instanceof TextInputLayout) {
|
||||
((FrameLayout) view.getParent()).setOnClickListener(onClick::run);
|
||||
((TextInputLayout) view.getParent().getParent()).setOnClickListener(onClick::run);
|
||||
}
|
||||
}
|
||||
@@ -367,8 +425,9 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = bindableString.get();
|
||||
boolean isHtml = bindableString.isHtml();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
view.setText(isHtml ? Html.fromHtml(newValue) : newValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ public abstract class BaseFragment extends Fragment {
|
||||
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
|
||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||
mToolbar = toolbar;
|
||||
}
|
||||
@@ -34,10 +32,6 @@ public abstract class BaseFragment extends Fragment {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void onLoadingStarted() {
|
||||
new Thread(() -> {
|
||||
BarcodeManager.disable();
|
||||
@@ -71,23 +65,25 @@ public abstract class BaseFragment extends Fragment {
|
||||
}
|
||||
|
||||
protected void openProgress() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||
}
|
||||
});
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
}
|
||||
});
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void popMe() {
|
||||
((IPoppableActivity) requireActivity()).pop();
|
||||
getActivity().runOnUiThread(() -> {
|
||||
((IPoppableActivity) requireActivity()).pop();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package it.integry.integrywmsnative.core.interfaces;
|
||||
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
|
||||
public interface ISearcableFragment extends SearchView.OnQueryTextListener, IDestroyableFragment {
|
||||
public interface ISearchableFragment extends SearchView.OnQueryTextListener, IDestroyableFragment {
|
||||
|
||||
void onSearchEnabled();
|
||||
|
||||
@@ -57,10 +57,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void printCollo(Type printerType, MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// onComplete.run();
|
||||
// return;
|
||||
// }
|
||||
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
Call<ServiceRESTResponse<Object>> callable = null;
|
||||
@@ -88,10 +88,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// onComplete.run();
|
||||
// return;
|
||||
// }
|
||||
|
||||
JasperDTO jasperDTO = new JasperDTO();
|
||||
jasperDTO.setReportName(reportName);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.settings;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
@@ -33,6 +34,7 @@ public class DBSettingsModel {
|
||||
private boolean flagForceAllToColli;
|
||||
private boolean flagSpedizioneEnableManualPick;
|
||||
private boolean flagSpedizioneCanSelectMultipleOrders;
|
||||
private List<String> notePerditaDocInterni = new ArrayList<>();
|
||||
private boolean flagSpedizioneUseQtaOrd;
|
||||
private String produzioneDefaultCodAnag;
|
||||
private String reportNameSpedizionChiudiOrdine;
|
||||
@@ -271,4 +273,13 @@ public class DBSettingsModel {
|
||||
this.onNumCnfInputChanged = onNumCnfInputChanged;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getNotePerditaDocInterni() {
|
||||
return notePerditaDocInterni;
|
||||
}
|
||||
|
||||
public DBSettingsModel setNotePerditaDocInterni(List<String> notePerditaDocInterni) {
|
||||
this.notePerditaDocInterni = notePerditaDocInterni;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.google.firebase.perf.metrics.Trace;
|
||||
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
@@ -265,6 +266,10 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("ON_NUM_CNF_INPUT_CHANGED"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PVM")
|
||||
.setSection("DOC_INTERNI")
|
||||
.setKeySection("NOTE_PERDITA"));
|
||||
|
||||
|
||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||
@@ -289,6 +294,10 @@ public class SettingsManager {
|
||||
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
||||
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
||||
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||
String notePerdita = getValueFromList(list,"DOC_INTERNI","NOTE_PERDITA",String.class);
|
||||
if (notePerdita != null){
|
||||
dbSettingsModelIstance.setNotePerditaDocInterni(Arrays.asList(notePerdita.split("\\|")));
|
||||
}
|
||||
|
||||
Integer onNumCnfInputChanged = getValueFromList(list, "SETUP", "ON_NUM_CNF_INPUT_CHANGED", Integer.class);
|
||||
if (onNumCnfInputChanged != null) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ISearcableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ISearchableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
@@ -43,7 +43,7 @@ import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePicking
|
||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
public class MainAccettazioneFragment extends BaseFragment implements ISearcableFragment, ITitledFragment, IScrollableFragment, MainAccettazioneViewModel.Listener {
|
||||
public class MainAccettazioneFragment extends BaseFragment implements ISearchableFragment, ITitledFragment, IScrollableFragment, MainAccettazioneViewModel.Listener {
|
||||
|
||||
public BindableBoolean fabVisible = new BindableBoolean(false);
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent()
|
||||
public interface DocInterniComponent {
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
DocInterniComponent create();
|
||||
}
|
||||
|
||||
void inject(DocInterniFragment docInterniFragment);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.FragmentDocInterniBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoView;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoViewModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormActivity;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListAdapter;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListModel;
|
||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
|
||||
public class DocInterniFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, DocInterniViewModel.Listener {
|
||||
|
||||
@Inject
|
||||
DocInterniViewModel mViewModel;
|
||||
|
||||
private final ObservableArrayList<DocInterniListModel> mDocInterniMutableData = new ObservableArrayList<>();
|
||||
private ElevatedToolbar mToolbar;
|
||||
private FragmentDocInterniBinding mBinding;
|
||||
private DocInterniSetupDTO mDocInterniSetupDTO;
|
||||
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||
private boolean dialogInitialized = false;
|
||||
|
||||
|
||||
public DocInterniFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static DocInterniFragment newInstance() {
|
||||
DocInterniFragment fragment = new DocInterniFragment();
|
||||
Bundle args = new Bundle();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
titleText.setText(context.getText(R.string.doc_interni).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_doc_interni, container, false);
|
||||
MainApplication.appComponent
|
||||
.docInterniComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
mViewModel.setListeners(this);
|
||||
mBinding.setLifecycleOwner(this);
|
||||
mBinding.setView(this);
|
||||
mBinding.setViewModel(mViewModel);
|
||||
mViewModel.mtbGrup.observe(getViewLifecycleOwner(),mtbGrup-> mViewModel.fetchProducts());
|
||||
mViewModel.dtbTipi.observe(getViewLifecycleOwner(),dtbTipi-> mViewModel.fetchDocuments());
|
||||
this.initRecyclerView();
|
||||
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!this.mViewModel.hasDocDetails()){
|
||||
mViewModel.init();
|
||||
}else{
|
||||
this.mViewModel.fetchDocuments();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||
onPreDestroy.run();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDocInterniSetupFetched(DocInterniSetupDTO docInterniSetupDTO) {
|
||||
this.mDocInterniSetupDTO = docInterniSetupDTO;
|
||||
this.dialogInitialized = true;
|
||||
this.selectDocInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDocDetailsChanged(DialogSelectDocInfoViewModel selection) {
|
||||
if(selection.isInputValid()){
|
||||
mViewModel.setSelectedDocDetails(selection);
|
||||
mBinding.mainFab.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
mBinding.mainFab.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (selection.requiresFornitore()){
|
||||
mBinding.codAnagContainer.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
mBinding.codAnagContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
if (selection.getSelectedGruppoArt() != null){
|
||||
mBinding.mtbGrpContainer.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
mBinding.mtbGrpContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (selection.requiresDocData()){
|
||||
mBinding.docContainer.setVisibility(View.VISIBLE);
|
||||
mBinding.document.setText(Html.fromHtml(getString(R.string.doc_testata, String.valueOf(selection.getNumDoc()), UtilityDate.formatDate(selection.getDataDoc(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN))));
|
||||
}else{
|
||||
mBinding.docContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||
mToolbar = toolbar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||
this.mOnPreDestroyList.add(onPreDestroy);
|
||||
}
|
||||
|
||||
public void selectDocInfo() {
|
||||
if (this.dialogInitialized){
|
||||
DialogSelectDocInfoView.newInstance(
|
||||
mDocInterniSetupDTO,
|
||||
this.mViewModel.dtbTipi.getValue(),
|
||||
this.mViewModel.mtbGrup.getValue(),
|
||||
this.mViewModel.fornitore.getValue(),
|
||||
this.mViewModel.dataDoc.getValue(),
|
||||
this.mViewModel.numDoc.getValue(),
|
||||
this.mViewModel.note.getValue(),
|
||||
this::onDocDetailsChanged
|
||||
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.mViewModel.getDocsList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||
DocInterniListAdapter docInterniListAdapter = new DocInterniListAdapter(this.requireActivity(), this.mDocInterniMutableData);
|
||||
docInterniListAdapter.setEmptyView(this.mBinding.docInterniEmptyView);
|
||||
this.mBinding.docInterniMainList.setAdapter(docInterniListAdapter);
|
||||
this.mBinding.docInterniMainList.setLayoutManager(new LinearLayoutManager(this.requireActivity()));
|
||||
|
||||
docInterniListAdapter.setOnItemClicked(this.mViewModel::editDocument);
|
||||
if (mToolbar != null)
|
||||
mToolbar.setRecyclerView(this.mBinding.docInterniMainList);
|
||||
}
|
||||
|
||||
private void refreshList(List<DocInternoWrapper> filteredList) {
|
||||
this.mDocInterniMutableData.clear();
|
||||
this.mDocInterniMutableData.addAll(convertDataModelToListModel(mViewModel.getDocsList().getValue()));
|
||||
}
|
||||
|
||||
private List<DocInterniListModel> convertDataModelToListModel(List<DocInternoWrapper> dataList) {
|
||||
|
||||
return Stream.of(dataList)
|
||||
.map(x -> {
|
||||
DocInterniListModel listModel = new DocInterniListModel();
|
||||
listModel.setDocument(x.getDocument());
|
||||
listModel.setProductsCount(x.getCountArticoli());
|
||||
return listModel;
|
||||
})
|
||||
.toList();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDocumentEditRequest(SqlMtbColt document, GrigliaAcquistiDTO arts) {
|
||||
requireActivity().startActivity(DocInterniEditFormActivity.newInstance(requireActivity(),document,arts));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
|
||||
@Module(subcomponents = DocInterniComponent.class)
|
||||
public class DocInterniModule {
|
||||
|
||||
@Provides
|
||||
DocInterniViewModel docInterniViewModel(DocInterniRESTConsumer docInterniRESTConsumer, MtbColtRepository mtbColtRepository) {
|
||||
return new DocInterniViewModel(docInterniRESTConsumer,mtbColtRepository);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.di.BindableInteger;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoViewModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
|
||||
public class DocInterniViewModel {
|
||||
|
||||
@Inject
|
||||
MtbColtRepository documentRepository;
|
||||
private Listener mListener;
|
||||
private final DocInterniRESTConsumer mDocInterniRESTConsumer;
|
||||
private boolean productsFetched = true;
|
||||
private boolean docsFetched = true;
|
||||
private int nextNumCollo = 0;
|
||||
private GrigliaAcquistiDTO productsList;
|
||||
private final MutableLiveData<List<DocInternoWrapper>> mDocsList = new MutableLiveData<>();
|
||||
|
||||
public final MutableLiveData<TipiDocDTO> dtbTipi = new MutableLiveData<>();
|
||||
public final MutableLiveData<GruppiArticoloDTO> mtbGrup = new MutableLiveData<>();
|
||||
public final MutableLiveData<FornitoreDTO> fornitore = new MutableLiveData<>();
|
||||
public final MutableLiveData<Date> dataDoc = new MutableLiveData<>();
|
||||
public final MutableLiveData<String> numDoc = new MutableLiveData<>();
|
||||
public final MutableLiveData<String> note = new MutableLiveData<>();
|
||||
public final BindableInteger artsSize = new BindableInteger(0);
|
||||
|
||||
@Inject
|
||||
public DocInterniViewModel(DocInterniRESTConsumer docInterniRESTConsumer, MtbColtRepository documentRepository) {
|
||||
mDocInterniRESTConsumer = docInterniRESTConsumer;
|
||||
this.documentRepository = documentRepository;
|
||||
this.mDocsList.setValue(new ArrayList<>());
|
||||
}
|
||||
|
||||
|
||||
public void init() {
|
||||
this.sendOnLoadingStarted();
|
||||
// new Thread(() -> {
|
||||
mDocInterniRESTConsumer.getDocInterniSetup(returnDto -> {
|
||||
this.sendOnLoadingEnded();
|
||||
this.mListener.onDocInterniSetupFetched(returnDto);
|
||||
}, this::sendError);
|
||||
// }).start();
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
}
|
||||
|
||||
private void sendOnLoadingEnded() {
|
||||
if (this.mListener != null) mListener.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
public DocInterniViewModel setListeners(Listener listener) {
|
||||
this.mListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MutableLiveData<List<DocInternoWrapper>> getDocsList() {
|
||||
return mDocsList;
|
||||
}
|
||||
|
||||
public void setSelectedDocDetails(DialogSelectDocInfoViewModel selection) {
|
||||
|
||||
this.fornitore.postValue(selection.getSelectedFornitore());
|
||||
this.mtbGrup.postValue(selection.getSelectedGruppoArt());
|
||||
this.dataDoc.postValue(selection.getDataDoc());
|
||||
this.numDoc.postValue(selection.getNumDoc());
|
||||
this.note.postValue(selection.getNote());
|
||||
|
||||
if (selection.getSelectedTipoDoc() != null ) {
|
||||
this.dtbTipi.postValue(selection.getSelectedTipoDoc());
|
||||
}
|
||||
}
|
||||
|
||||
public void fetchProducts() {
|
||||
this.productsFetched = false;
|
||||
this.sendOnLoadingStarted();
|
||||
mDocInterniRESTConsumer.fetchProducts(this.getCodDtip(), this.getCodMgrp(), returnDto -> {
|
||||
this.productsFetched = true;
|
||||
this.productsList = returnDto;
|
||||
this.artsSize.set(returnDto.getGrigliaAcquistiChild().size());
|
||||
if (this.docsFetched) {
|
||||
this.sendOnLoadingEnded();
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public void fetchDocuments() {
|
||||
this.docsFetched = false;
|
||||
this.sendOnLoadingStarted();
|
||||
String codAnag = null, codVdes = null;
|
||||
FornitoreDTO fornitore = this.fornitore.getValue();
|
||||
if (fornitore != null){
|
||||
codAnag = fornitore.getCodAnag();
|
||||
codVdes = fornitore.getCodVdes();
|
||||
}
|
||||
documentRepository.getLocalDocumentsByCodDtip(this.getCodDtip(), codAnag, codVdes, dataDoc.getValue(),numDoc.getValue(), list -> {
|
||||
documentRepository.getNextNumCollo(nextNumCollo -> {
|
||||
this.mDocsList.postValue(list);
|
||||
this.setNextNumCollo(nextNumCollo);
|
||||
this.docsFetched = true;
|
||||
if (this.productsFetched) {
|
||||
this.sendOnLoadingEnded();
|
||||
}
|
||||
}, this::sendError);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void setNextNumCollo(Integer nextNumCollo) {
|
||||
this.nextNumCollo = nextNumCollo;
|
||||
}
|
||||
|
||||
private String getCodDtip() {
|
||||
if (this.dtbTipi.getValue() == null) {
|
||||
return null;
|
||||
}
|
||||
return this.dtbTipi.getValue().getCodDtip();
|
||||
}
|
||||
|
||||
private String getCodMgrp() {
|
||||
if (this.mtbGrup.getValue() == null) {
|
||||
return null;
|
||||
}
|
||||
return this.mtbGrup.getValue().getCodMgrp();
|
||||
}
|
||||
|
||||
public void editDocument(SqlMtbColt document) {
|
||||
this.mListener.onDocumentEditRequest(document, productsList);
|
||||
}
|
||||
|
||||
public void newDocument() {
|
||||
SqlMtbColt document = new SqlMtbColt();
|
||||
if (this.dtbTipi.getValue() == null) {
|
||||
this.sendError(new Exception("Nessun tipo documento selezionato!"));
|
||||
return;
|
||||
}
|
||||
document.setCodDtipProvv(this.getCodDtip());
|
||||
document.setCodMgrp(this.getCodMgrp());
|
||||
document.setDataCollo(new Date());
|
||||
document.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||
document.setAnnotazioni(this.note.getValue());
|
||||
document.setSegno(-1);
|
||||
document.setSerCollo("/");
|
||||
document.setNumCollo(this.nextNumCollo);
|
||||
document.setGestione("L");
|
||||
document.setDataDoc(this.dataDoc.getValue());
|
||||
if (this.numDoc.getValue() != null){
|
||||
document.setNumDoc(Integer.parseInt(this.numDoc.getValue()));
|
||||
}
|
||||
if (this.fornitore.getValue() != null){
|
||||
document.setCodAnag(this.fornitore.getValue().getCodAnag());
|
||||
document.setCodVdes(this.fornitore.getValue().getCodVdes());
|
||||
}
|
||||
documentRepository.insert(document, id -> {
|
||||
document.setId(id);
|
||||
this.editDocument(document);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public boolean hasDocDetails() {
|
||||
return this.dtbTipi.getValue() != null;
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
void onDocInterniSetupFetched(DocInterniSetupDTO docInterniSetupDTO);
|
||||
|
||||
void onDocDetailsChanged(DialogSelectDocInfoViewModel selection);
|
||||
|
||||
void onDocumentEditRequest(SqlMtbColt document, GrigliaAcquistiDTO arts);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface DialogSelectDocInfoComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
DialogSelectDocInfoComponent create();
|
||||
}
|
||||
|
||||
|
||||
void inject(DialogSelectDocInfoView dialogSelectDocInfoView);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = DialogSelectDocInfoComponent.class)
|
||||
public class DialogSelectDocInfoModule {
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
DialogSelectDocInfoViewModel dialogSelectMgrpDtipPairViewModel() {
|
||||
return new DialogSelectDocInfoViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ArrayAdapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||
import it.integry.integrywmsnative.databinding.DialogSelectDocInfoBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||
|
||||
public class DialogSelectDocInfoView extends BaseDialogFragment implements DialogSelectDocInfoViewModel.Listener {
|
||||
|
||||
@Inject
|
||||
DialogSelectDocInfoViewModel mViewModel;
|
||||
private Context mCurrentContext;
|
||||
|
||||
|
||||
public BindableString codDtip = new BindableString();
|
||||
public BindableString codMgrp = new BindableString();
|
||||
public BindableString codAnag = new BindableString();
|
||||
public BindableString numDoc = new BindableString();
|
||||
public BindableString note = new BindableString();
|
||||
public ObservableField<Date> dataDoc = new ObservableField<>();
|
||||
|
||||
private ArrayAdapter<String> arrayAdapterCodDtips;
|
||||
private ArrayAdapter<String> arrayAdapterCodMgrps;
|
||||
private ArrayAdapter<String> arrayAdapterCodAnags;
|
||||
private ArrayAdapter<String> arrayAdapterNote;
|
||||
private DialogSelectDocInfoBinding mBindings;
|
||||
|
||||
private final RunnableArgs<DialogSelectDocInfoViewModel> currentOnFilterDone;
|
||||
private final DocInterniSetupDTO docInterniSetupDTO;
|
||||
private final TipiDocDTO selectedDtip;
|
||||
private final GruppiArticoloDTO selectedGrp;
|
||||
private final FornitoreDTO selectedAnag;
|
||||
private final Date selectedDataDoc;
|
||||
private final String selectedNumDoc;
|
||||
private final String selectedNote;
|
||||
|
||||
public static DialogSelectDocInfoView newInstance(
|
||||
DocInterniSetupDTO docInterniSetupDTO,
|
||||
TipiDocDTO tipiDocDTO,
|
||||
GruppiArticoloDTO gruppiArticoloDTO,
|
||||
FornitoreDTO fornitoreDTO,
|
||||
Date dataDoc,
|
||||
String numDoc,
|
||||
String note,
|
||||
RunnableArgs<DialogSelectDocInfoViewModel> onDismiss
|
||||
) {
|
||||
return new DialogSelectDocInfoView(docInterniSetupDTO, tipiDocDTO, gruppiArticoloDTO, fornitoreDTO, dataDoc, numDoc,note, onDismiss);
|
||||
}
|
||||
|
||||
|
||||
private DialogSelectDocInfoView(DocInterniSetupDTO docInterniSetupDTO,
|
||||
TipiDocDTO tipiDocDTO,
|
||||
GruppiArticoloDTO gruppiArticoloDTO,
|
||||
FornitoreDTO fornitoreDTO,
|
||||
Date dataDoc,
|
||||
String numDoc,
|
||||
String note,
|
||||
RunnableArgs<DialogSelectDocInfoViewModel> onDismiss) {
|
||||
super();
|
||||
currentOnFilterDone = onDismiss;
|
||||
this.docInterniSetupDTO = docInterniSetupDTO;
|
||||
selectedDtip = tipiDocDTO;
|
||||
selectedGrp = gruppiArticoloDTO;
|
||||
selectedDataDoc = dataDoc;
|
||||
selectedNumDoc = numDoc;
|
||||
selectedNote = note;
|
||||
selectedAnag = fornitoreDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
if (currentOnFilterDone != null) currentOnFilterDone.run(mViewModel);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
this.mCurrentContext = this.requireActivity();
|
||||
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_select_doc_info, container, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
MainApplication
|
||||
.appComponent
|
||||
.dialogSelectMgrpDtipPairComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
mViewModel.init(docInterniSetupDTO);
|
||||
mViewModel.setListeners(this);
|
||||
mBindings.setView(this);
|
||||
mBindings.setViewmodel(mViewModel);
|
||||
|
||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
initView();
|
||||
|
||||
|
||||
mBindings.positiveBtn.setOnClickListener(view -> {
|
||||
if (this.isInputValid()) {
|
||||
getDialog().dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
initArrayAdapters();
|
||||
initBindables();
|
||||
|
||||
if (selectedDtip != null) {
|
||||
codDtip.set(selectedDtip.getLabel());
|
||||
}
|
||||
if (selectedGrp != null) {
|
||||
codMgrp.set(selectedGrp.getLabel());
|
||||
}
|
||||
if (selectedAnag != null) {
|
||||
codAnag.set(selectedAnag.getLabel());
|
||||
}
|
||||
if (selectedDataDoc != null) {
|
||||
dataDoc.set(selectedDataDoc);
|
||||
}
|
||||
if (selectedNumDoc != null) {
|
||||
numDoc.set(selectedNumDoc);
|
||||
}
|
||||
if (selectedNote != null) {
|
||||
note.set(selectedNote);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isInputValid() {
|
||||
if (this.mViewModel.getSelectedTipoDoc() == null) {
|
||||
mBindings.inputCodDtip.setErrorEnabled(true);
|
||||
mBindings.inputCodDtip.setError("Seleziona un tipo documento");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.mViewModel.requiresFornitore() && this.mViewModel.getSelectedFornitore() == null) {
|
||||
mBindings.inputCodAnagForn.setErrorEnabled(true);
|
||||
mBindings.inputCodAnagForn.setError("Seleziona un fornitore/destinatario");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.mViewModel.requiresDocData() && this.mViewModel.getDataDoc() == null){
|
||||
mBindings.inputDataDoc.setError("Seleziona la data del documento");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.mViewModel.requiresDocData() && (this.mViewModel.getNumDoc() == null || this.mViewModel.getNumDoc().isEmpty() )){
|
||||
mBindings.inputNumDoc.setError("Seleziona il numero del documento");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.mViewModel.requiresNote() && (this.mViewModel.getNote() == null || this.mViewModel.getNote().isEmpty() )){
|
||||
mBindings.inputNoteLayout.setErrorEnabled(true);
|
||||
mBindings.inputNoteLayout.setError("Specifica delle note per il documento");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void initArrayAdapters() {
|
||||
|
||||
arrayAdapterCodDtips = new ArrayAdapter<>(mCurrentContext, R.layout.dialog_select_doc_info__single_item);
|
||||
arrayAdapterCodDtips.addAll(mViewModel.getAvailableCodDtips());
|
||||
mBindings.filledExposedDropdownCodDtips.setAdapter(arrayAdapterCodDtips);
|
||||
|
||||
arrayAdapterCodMgrps = new ArrayAdapter<>(mCurrentContext, R.layout.dialog_select_doc_info__single_item);
|
||||
arrayAdapterCodMgrps.addAll(mViewModel.getAvailableCodMgrps());
|
||||
mBindings.filledExposedDropdownCodMgrps.setAdapter(arrayAdapterCodMgrps);
|
||||
|
||||
arrayAdapterCodAnags = new ArrayAdapter<>(mCurrentContext, R.layout.dialog_select_doc_info__single_item);
|
||||
arrayAdapterCodAnags.addAll(mViewModel.getAvailableFornitori());
|
||||
mBindings.filledExposedDropdownCodAnagList.setAdapter(arrayAdapterCodAnags);
|
||||
|
||||
arrayAdapterNote = new ArrayAdapter<>(mCurrentContext, R.layout.dialog_select_doc_info__single_item);
|
||||
arrayAdapterNote.addAll(mViewModel.getAdditionalNotes());
|
||||
mBindings.filledExposedDropdownNote.setAdapter(arrayAdapterNote);
|
||||
}
|
||||
|
||||
private void initBindables() {
|
||||
BindableString.registerListener(codDtip, codDtip -> {
|
||||
mViewModel.setCodDtip(codDtip);
|
||||
mBindings.inputCodAnagForn.setVisibility(mViewModel.requiresFornitore() ? View.VISIBLE : View.GONE);
|
||||
mBindings.inputDataDocLayout.setVisibility(mViewModel.requiresDocData() ? View.VISIBLE : View.GONE);
|
||||
mBindings.inputNumDocLayout.setVisibility(mViewModel.requiresDocData() ? View.VISIBLE : View.GONE);
|
||||
mBindings.inputNoteLayout.setVisibility(mViewModel.requiresNote() ? View.VISIBLE : View.GONE);
|
||||
});
|
||||
BindableString.registerListener(codMgrp, mViewModel::setCodMgrp);
|
||||
BindableString.registerListener(codAnag, mViewModel::setCodAnag);
|
||||
BindableString.registerListener(numDoc, mViewModel::setNumDoc);
|
||||
BindableString.registerListener(note, mViewModel::setNote);
|
||||
UtilityObservable.addPropertyChanged(this.dataDoc, (value) -> {
|
||||
this.mViewModel.setDataDoc(value);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDocTypeSelected() {
|
||||
arrayAdapterCodAnags.clear();
|
||||
if (mViewModel.getSelectedFornitore() != null && !mViewModel.getAvailableFornitori().contains(mViewModel.getSelectedFornitore().getLabel())) {
|
||||
codAnag.set("");
|
||||
}
|
||||
if (mViewModel.getNote() != null && ! mViewModel.requiresNote()){
|
||||
mViewModel.setNote(null);
|
||||
}
|
||||
arrayAdapterCodAnags.addAll(mViewModel.getAvailableFornitori());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniViewModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||
|
||||
|
||||
public class DialogSelectDocInfoViewModel {
|
||||
|
||||
|
||||
private DocInterniSetupDTO mDocInterniSetupDTO;
|
||||
|
||||
private String mTipoDoc;
|
||||
|
||||
private String mGruppoArt;
|
||||
|
||||
private String mFornitore;
|
||||
|
||||
private Date mDataDoc;
|
||||
|
||||
private String mNumDoc;
|
||||
|
||||
private String mNote;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public void init(DocInterniSetupDTO initialList) {
|
||||
this.mDocInterniSetupDTO = initialList;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
return mTipoDoc;
|
||||
}
|
||||
|
||||
public void setCodDtip(String codDtip) {
|
||||
this.mTipoDoc = codDtip;
|
||||
if (this.getSelectedTipoDoc() != null) {
|
||||
this.mListener.onDocTypeSelected();
|
||||
}
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return mGruppoArt;
|
||||
}
|
||||
|
||||
public void setCodMgrp(String codMgrp) {
|
||||
this.mGruppoArt = codMgrp;
|
||||
}
|
||||
|
||||
public void setCodAnag(String codAnag) {
|
||||
this.mFornitore = codAnag;
|
||||
}
|
||||
|
||||
public Date getDataDoc() {
|
||||
return mDataDoc;
|
||||
}
|
||||
|
||||
public void setDataDoc(Date mDataDoc) {
|
||||
this.mDataDoc = mDataDoc;
|
||||
}
|
||||
|
||||
public String getNumDoc() {
|
||||
return mNumDoc;
|
||||
}
|
||||
|
||||
public void setNumDoc(String numDoc) {
|
||||
this.mNumDoc = numDoc;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return mNote;
|
||||
}
|
||||
|
||||
public DialogSelectDocInfoViewModel setNote(String note) {
|
||||
this.mNote = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogSelectDocInfoViewModel setListeners(Listener listener) {
|
||||
this.mListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getAvailableCodDtips() {
|
||||
return Stream.of(mDocInterniSetupDTO.getTipiDoc()).map(TipiDocDTO::getLabel).toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailableCodMgrps() {
|
||||
return Stream.of(mDocInterniSetupDTO.getGruppiArt()).map(GruppiArticoloDTO::getLabel).toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailableFornitori() {
|
||||
if (!this.requiresFornitore()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
TipiDocDTO selectedDocType = getSelectedTipoDoc();
|
||||
|
||||
return Stream.of(mDocInterniSetupDTO.getFornitori())
|
||||
.filter(forn -> {
|
||||
if (selectedDocType.getGestioneDoc().equalsIgnoreCase("T")) {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("D") &&
|
||||
forn.getGestioneAnag().equalsIgnoreCase(
|
||||
selectedDocType.getGestione().equalsIgnoreCase("V") ? "V" : "A"
|
||||
);
|
||||
} else {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("F") ;
|
||||
}
|
||||
})
|
||||
.map(FornitoreDTO::getLabel).toList();
|
||||
}
|
||||
|
||||
public TipiDocDTO getSelectedTipoDoc() {
|
||||
return Stream.of(mDocInterniSetupDTO.getTipiDoc()).filter(x -> x.getLabel().equals(mTipoDoc)).findFirstOrElse(null);
|
||||
}
|
||||
|
||||
public FornitoreDTO getSelectedFornitore() {
|
||||
return Stream.of(mDocInterniSetupDTO.getFornitori()).filter(x -> x.getLabel().equals(mFornitore)).findFirstOrElse(null);
|
||||
}
|
||||
|
||||
public GruppiArticoloDTO getSelectedGruppoArt() {
|
||||
if (mGruppoArt == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Stream.of(mDocInterniSetupDTO.getGruppiArt()).filter(x -> x.getLabel().equals(mGruppoArt)).findFirstOrElse(null);
|
||||
}
|
||||
|
||||
public boolean requiresFornitore() {
|
||||
return this.getSelectedTipoDoc() != null && (
|
||||
this.getSelectedTipoDoc().getGestioneDoc().equals("T") ||
|
||||
this.getSelectedTipoDoc().getGestioneDoc().equals("A") ||
|
||||
(
|
||||
this.getSelectedTipoDoc().getGestioneDoc().equals("P") &&
|
||||
!this.getSelectedTipoDoc().getGestione().equals("L")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public boolean requiresNote() {
|
||||
return this.getSelectedTipoDoc() != null &&
|
||||
this.getSelectedTipoDoc().getGestioneDoc().equals("P") &&
|
||||
this.getSelectedTipoDoc().getGestione().equals("L")
|
||||
;
|
||||
}
|
||||
|
||||
public boolean isInputValid() {
|
||||
if (this.getSelectedTipoDoc() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.requiresFornitore() && this.getSelectedFornitore() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.requiresDocData() && (this.getDataDoc() == null || this.getNumDoc() == null)){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (this.requiresNote() && (this.getNote() == null || this.getNote().length() <= 0) ){
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean requiresDocData() {
|
||||
TipiDocDTO doc = this.getSelectedTipoDoc();
|
||||
return doc != null && doc.getGestioneDoc().equalsIgnoreCase("P") && !doc.getGestione().equalsIgnoreCase("L");
|
||||
}
|
||||
|
||||
public List<String> getAdditionalNotes() {
|
||||
return SettingsManager.iDB().getNotePerditaDocInterni();
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
void onDocTypeSelected();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class ArtDTO {
|
||||
|
||||
private Integer rigaOrd;
|
||||
|
||||
private String codMart;
|
||||
|
||||
private String barcode;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private Date dataIns;
|
||||
|
||||
private String untMis;
|
||||
|
||||
private BigDecimal qta;
|
||||
|
||||
private BigDecimal qtaCnf;
|
||||
|
||||
private BigDecimal colli;
|
||||
|
||||
private String partitaMag;
|
||||
|
||||
private Date dataScad;
|
||||
|
||||
public Integer getRigaOrd() {
|
||||
return rigaOrd;
|
||||
}
|
||||
|
||||
public void setRigaOrd(Integer rigaOrd) {
|
||||
this.rigaOrd = rigaOrd;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public void setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public void setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public Date getDataIns() {
|
||||
return dataIns;
|
||||
}
|
||||
|
||||
public void setDataIns(Date dataIns) {
|
||||
this.dataIns = dataIns;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public void setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
}
|
||||
|
||||
public BigDecimal getQta() {
|
||||
return qta;
|
||||
}
|
||||
|
||||
public void setQta(BigDecimal qta) {
|
||||
this.qta = qta;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public void setQtaCnf(BigDecimal qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
}
|
||||
|
||||
public BigDecimal getColli() {
|
||||
return colli;
|
||||
}
|
||||
|
||||
public void setColli(BigDecimal colli) {
|
||||
this.colli = colli;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public void setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public void setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class ColloDTO {
|
||||
|
||||
private String codMdep;
|
||||
private String createdDate;
|
||||
private String annotazioni;
|
||||
private String gestione;
|
||||
private String segno;
|
||||
private String idDisp;
|
||||
private String codDtip;
|
||||
private List<ArtDTO> artRows = new ArrayList<>();
|
||||
private RifOrd rifOrd;
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public void setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
}
|
||||
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
|
||||
public void setCreatedDate(String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
public String getAnnotazioni() {
|
||||
return annotazioni;
|
||||
}
|
||||
|
||||
public void setAnnotazioni(String annotazioni) {
|
||||
this.annotazioni = annotazioni;
|
||||
}
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public void setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
}
|
||||
|
||||
public String getSegno() {
|
||||
return segno;
|
||||
}
|
||||
|
||||
public void setSegno(String segno) {
|
||||
this.segno = segno;
|
||||
}
|
||||
|
||||
public String getIdDisp() {
|
||||
return idDisp;
|
||||
}
|
||||
|
||||
public void setIdDisp(String idDisp) {
|
||||
this.idDisp = idDisp;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public void setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
}
|
||||
|
||||
public List<ArtDTO> getArtRows() {
|
||||
return artRows;
|
||||
}
|
||||
|
||||
public void setArtRows(List<ArtDTO> artRows) {
|
||||
this.artRows = artRows;
|
||||
}
|
||||
|
||||
public void addArtRow(ArtDTO artRow){
|
||||
this.artRows.add(artRow);
|
||||
}
|
||||
|
||||
public RifOrd getRifOrd() {
|
||||
return rifOrd;
|
||||
}
|
||||
|
||||
public void setRifOrd(RifOrd rifOrd) {
|
||||
this.rifOrd = rifOrd;
|
||||
}
|
||||
|
||||
public static class RifOrd {
|
||||
|
||||
private Date dataOrd;
|
||||
|
||||
private Integer numOrd;
|
||||
|
||||
private String chiaveOrd;
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public void setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public void setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
}
|
||||
|
||||
public String getChiaveOrd() {
|
||||
return chiaveOrd;
|
||||
}
|
||||
|
||||
public void setChiaveOrd(String chiaveOrd) {
|
||||
this.chiaveOrd = chiaveOrd;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DocFromPickingDTO {
|
||||
String codAnag, codVdes, tipoLista, noteDoc;
|
||||
Date dataDoc;
|
||||
Integer numDoc;
|
||||
List<DatiCollo> colli;
|
||||
List<Pedane> pedane;
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public DocFromPickingDTO setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodVdes() {
|
||||
return codVdes;
|
||||
}
|
||||
|
||||
public DocFromPickingDTO setCodVdes(String codVdes) {
|
||||
this.codVdes = codVdes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTipoLista() {
|
||||
return tipoLista;
|
||||
}
|
||||
|
||||
public DocFromPickingDTO setTipoLista(String tipoLista) {
|
||||
this.tipoLista = tipoLista;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNoteDoc() {
|
||||
return noteDoc;
|
||||
}
|
||||
|
||||
public DocFromPickingDTO setNoteDoc(String noteDoc) {
|
||||
this.noteDoc = noteDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataDoc() {
|
||||
return dataDoc;
|
||||
}
|
||||
|
||||
public DocFromPickingDTO setDataDoc(Date dataDoc) {
|
||||
this.dataDoc = dataDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
|
||||
public DocFromPickingDTO setNumDoc(Integer numDoc) {
|
||||
this.numDoc = numDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<DatiCollo> getColli() {
|
||||
return colli;
|
||||
}
|
||||
|
||||
public DocFromPickingDTO setColli(List<DatiCollo> colli) {
|
||||
this.colli = colli;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<Pedane> getPedane() {
|
||||
return pedane;
|
||||
}
|
||||
|
||||
public void setPedane(List<Pedane> pedane) {
|
||||
this.pedane = pedane;
|
||||
}
|
||||
|
||||
public static class Pedane {
|
||||
String codTcol;
|
||||
BigDecimal qta;
|
||||
|
||||
public String getCodTcol() {
|
||||
return codTcol;
|
||||
}
|
||||
|
||||
public void setCodTcol(String codTcol) {
|
||||
this.codTcol = codTcol;
|
||||
}
|
||||
|
||||
public BigDecimal getQta() {
|
||||
return qta;
|
||||
}
|
||||
|
||||
public void setQta(BigDecimal qta) {
|
||||
this.qta = qta;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DatiCollo {
|
||||
String gestione, serCollo;
|
||||
Date dataCollo;
|
||||
Integer numCollo;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public DatiCollo setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public DatiCollo setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public DatiCollo setDataCollo(Date dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public DatiCollo setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DocInterniSetupDTO {
|
||||
|
||||
|
||||
private List<TipiDocDTO> tipiDoc;
|
||||
|
||||
private List<GruppiArticoloDTO> gruppiArt;
|
||||
|
||||
private List<FornitoreDTO> fornitori;
|
||||
|
||||
|
||||
public List<TipiDocDTO> getTipiDoc() {
|
||||
return tipiDoc;
|
||||
}
|
||||
|
||||
public void setTipiDoc(List<TipiDocDTO> tipiDoc) {
|
||||
this.tipiDoc = tipiDoc;
|
||||
}
|
||||
|
||||
public List<GruppiArticoloDTO> getGruppiArt() {
|
||||
return gruppiArt;
|
||||
}
|
||||
|
||||
public void setGruppiArt(List<GruppiArticoloDTO> gruppiArt) {
|
||||
this.gruppiArt = gruppiArt;
|
||||
}
|
||||
|
||||
public List<FornitoreDTO> getFornitori() {
|
||||
return fornitori;
|
||||
}
|
||||
|
||||
public void setFornitori(List<FornitoreDTO> fornitori) {
|
||||
this.fornitori = fornitori;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
public class DocSetupDTO {
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
public class FornitoreDTO {
|
||||
|
||||
|
||||
private String codAnag;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String codVdes;
|
||||
|
||||
private String tipoAnag;
|
||||
|
||||
private String gestioneAnag;
|
||||
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public void setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
}
|
||||
|
||||
public String getCodVdes() {
|
||||
return codVdes;
|
||||
}
|
||||
|
||||
public void setCodVdes(String codVdes) {
|
||||
this.codVdes = codVdes;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public String getTipoAnag() {
|
||||
return tipoAnag;
|
||||
}
|
||||
|
||||
public void setTipoAnag(String tipoAnag) {
|
||||
this.tipoAnag = tipoAnag;
|
||||
}
|
||||
|
||||
public String getGestioneAnag() {
|
||||
return gestioneAnag;
|
||||
}
|
||||
|
||||
public void setGestioneAnag(String gestioneAnag) {
|
||||
this.gestioneAnag = gestioneAnag;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return this.codAnag + (this.codVdes != null ? " - "+ this.codVdes : "") +" ( " + this.descrizione+" )";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class GrigliaAcquistiChildDTO {
|
||||
|
||||
public String codMart;
|
||||
public String descrizione;
|
||||
public String untMis;
|
||||
public BigDecimal qtaCnf;
|
||||
public String barcode;
|
||||
public BigDecimal merceDaRic;
|
||||
public BigDecimal mediaSett;
|
||||
public String flagQtaMultipla;
|
||||
public String flagTracciabilita;
|
||||
public BigDecimal qtaMinOrdinabile;
|
||||
private int ggScadenza;
|
||||
private float giacenza;
|
||||
private float qtaPrevistaVendita;
|
||||
private float qtaProposta;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getMerceDaRic() {
|
||||
return merceDaRic;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setMerceDaRic(BigDecimal merceDaRic) {
|
||||
this.merceDaRic = merceDaRic;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getMediaSett() {
|
||||
return mediaSett;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setMediaSett(BigDecimal mediaSett) {
|
||||
this.mediaSett = mediaSett;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagQtaMultipla() {
|
||||
return flagQtaMultipla;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setFlagQtaMultipla(String flagQtaMultipla) {
|
||||
this.flagQtaMultipla = flagQtaMultipla;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaMinOrdinabile() {
|
||||
return qtaMinOrdinabile;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setQtaMinOrdinabile(BigDecimal qtaMinOrdinabile) {
|
||||
this.qtaMinOrdinabile = qtaMinOrdinabile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagTracciabilita() {
|
||||
return flagTracciabilita;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setFlagTracciabilita(String flagTracciabilita) {
|
||||
this.flagTracciabilita = flagTracciabilita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getGgScadenza() {
|
||||
return ggScadenza;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setGgScadenza(int ggScadenza) {
|
||||
this.ggScadenza = ggScadenza;
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getGiacenza() {
|
||||
return giacenza;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setGiacenza(float giacenza) {
|
||||
this.giacenza = giacenza;
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getQtaPrevistaVendita() {
|
||||
return qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setQtaPrevistaVendita(float qtaPrevistaVendita) {
|
||||
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getQtaProposta() {
|
||||
return qtaProposta;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setQtaProposta(float qtaProposta) {
|
||||
this.qtaProposta = qtaProposta;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GrigliaAcquistiDTO {
|
||||
|
||||
private String descrLisa;
|
||||
|
||||
private String descrDepo;
|
||||
|
||||
private List<GrigliaAcquistiChildDTO> grigliaAcquistiChild;
|
||||
|
||||
public String getDescrLisa() {
|
||||
return descrLisa;
|
||||
}
|
||||
|
||||
public void setDescrLisa(String descrLisa) {
|
||||
this.descrLisa = descrLisa;
|
||||
}
|
||||
|
||||
public String getDescrDepo() {
|
||||
return descrDepo;
|
||||
}
|
||||
|
||||
public void setDescrDepo(String descrDepo) {
|
||||
this.descrDepo = descrDepo;
|
||||
}
|
||||
|
||||
public List<GrigliaAcquistiChildDTO> getGrigliaAcquistiChild() {
|
||||
return grigliaAcquistiChild;
|
||||
}
|
||||
|
||||
public void setGrigliaAcquistiChild(List<GrigliaAcquistiChildDTO> grigliaAcquistiChild) {
|
||||
this.grigliaAcquistiChild = grigliaAcquistiChild;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
public class GruppiArticoloDTO {
|
||||
|
||||
private String codMgrp;
|
||||
private String descrizione;
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public void setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return this.codMgrp+" - "+this.descrizione;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by GiuseppeS on 28/06/2017.
|
||||
*/
|
||||
public class InventarioDTO {
|
||||
|
||||
private List<Object> rowList;
|
||||
|
||||
private Date dataCreate;
|
||||
|
||||
|
||||
public List<Object> getRowList() {
|
||||
return rowList;
|
||||
}
|
||||
|
||||
public void setRowList(List<Object> rowList) {
|
||||
this.rowList = rowList;
|
||||
}
|
||||
|
||||
public Date getDataCreate() {
|
||||
return dataCreate;
|
||||
}
|
||||
|
||||
public void setDataCreate(Date dataCreate) {
|
||||
this.dataCreate = dataCreate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class OrdineDTO {
|
||||
|
||||
private String chiaveGriglia;
|
||||
private Date dataCons;
|
||||
|
||||
private List<ArtDTO> artRows;
|
||||
|
||||
public String getChiaveGriglia() {
|
||||
return chiaveGriglia;
|
||||
}
|
||||
|
||||
public void setChiaveGriglia(String chiaveGriglia) {
|
||||
this.chiaveGriglia = chiaveGriglia;
|
||||
}
|
||||
|
||||
public Date getDataCons() {
|
||||
return dataCons;
|
||||
}
|
||||
|
||||
public void setDataCons(Date dataCons) {
|
||||
this.dataCons = dataCons;
|
||||
}
|
||||
|
||||
public List<ArtDTO> getArtRows() {
|
||||
return artRows;
|
||||
}
|
||||
|
||||
public void setArtRows(List<ArtDTO> artRows) {
|
||||
this.artRows = artRows;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class PropostaOrdineDTO {
|
||||
|
||||
List<ArticoliDTO> articoli;
|
||||
private Date dataOrd;
|
||||
private String compilatoDa;
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public PropostaOrdineDTO setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCompilatoDa() {
|
||||
return compilatoDa;
|
||||
}
|
||||
|
||||
public PropostaOrdineDTO setCompilatoDa(String compilatoDa) {
|
||||
this.compilatoDa = compilatoDa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ArticoliDTO> getArticoli() {
|
||||
return articoli;
|
||||
}
|
||||
|
||||
public PropostaOrdineDTO setArticoli(List<ArticoliDTO> articoli) {
|
||||
this.articoli = articoli;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static class ArticoliDTO {
|
||||
String codMart, untMis, codArtFor, listino;
|
||||
BigDecimal qtaOrd, qtaCnf;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public ArticoliDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public ArticoliDTO setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodArtFor() {
|
||||
return codArtFor;
|
||||
}
|
||||
|
||||
public ArticoliDTO setCodArtFor(String codArtFor) {
|
||||
this.codArtFor = codArtFor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getListino() {
|
||||
return listino;
|
||||
}
|
||||
|
||||
public ArticoliDTO setListino(String listino) {
|
||||
this.listino = listino;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public ArticoliDTO setQtaOrd(BigDecimal qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public ArticoliDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class SaveDTO {
|
||||
private String gestione;
|
||||
private String codMdep;
|
||||
private String idDisp;
|
||||
private String zona;
|
||||
private String segno;
|
||||
private Date listCreate;
|
||||
private String annotazioni;
|
||||
private String codDtip;
|
||||
private Integer idInventario;
|
||||
|
||||
private OrdineDTO ordineDTO;
|
||||
private ColloDTO colloDTO;
|
||||
private InventarioDTO inventarioDTO;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public void setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public void setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
}
|
||||
|
||||
public String getIdDisp() {
|
||||
return idDisp;
|
||||
}
|
||||
|
||||
public void setIdDisp(String idDisp) {
|
||||
this.idDisp = idDisp;
|
||||
}
|
||||
|
||||
public String getZona() {
|
||||
return zona;
|
||||
}
|
||||
|
||||
public void setZona(String zona) {
|
||||
this.zona = zona;
|
||||
}
|
||||
|
||||
public String getSegno() {
|
||||
return segno;
|
||||
}
|
||||
|
||||
public void setSegno(String segno) {
|
||||
this.segno = segno;
|
||||
}
|
||||
|
||||
public Date getListCreate() {
|
||||
return listCreate;
|
||||
}
|
||||
|
||||
public void setListCreate(Date listCreate) {
|
||||
this.listCreate = listCreate;
|
||||
}
|
||||
|
||||
public String getAnnotazioni() {
|
||||
return annotazioni;
|
||||
}
|
||||
|
||||
public void setAnnotazioni(String annotazioni) {
|
||||
this.annotazioni = annotazioni;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public void setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
}
|
||||
|
||||
public Integer getIdInventario() {
|
||||
return idInventario;
|
||||
}
|
||||
|
||||
public void setIdInventario(Integer idInventario) {
|
||||
this.idInventario = idInventario;
|
||||
}
|
||||
|
||||
public OrdineDTO getOrdineDTO() {
|
||||
return ordineDTO;
|
||||
}
|
||||
|
||||
public void setOrdineDTO(OrdineDTO ordineDTO) {
|
||||
this.ordineDTO = ordineDTO;
|
||||
}
|
||||
|
||||
public ColloDTO getColloDTO() {
|
||||
return colloDTO;
|
||||
}
|
||||
|
||||
public void setColloDTO(ColloDTO colloDTO) {
|
||||
this.colloDTO = colloDTO;
|
||||
}
|
||||
|
||||
public InventarioDTO getInventarioDTO() {
|
||||
return inventarioDTO;
|
||||
}
|
||||
|
||||
public void setInventarioDTO(InventarioDTO inventarioDTO) {
|
||||
this.inventarioDTO = inventarioDTO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
public class TipiDocDTO {
|
||||
|
||||
private String codDtip;
|
||||
private String descrizione;
|
||||
private String gestione;
|
||||
private String gestioneDoc;
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public void setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public void setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
}
|
||||
|
||||
public String getGestioneDoc() {
|
||||
return gestioneDoc;
|
||||
}
|
||||
|
||||
public void setGestioneDoc(String gestioneDoc) {
|
||||
this.gestioneDoc = gestioneDoc;
|
||||
}
|
||||
public String getLabel(){
|
||||
return this.codDtip +" - "+this.descrizione;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,311 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
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.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrRepository;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.di.BindableInteger;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContabDocInterniEditBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiChildDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
||||
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
|
||||
public class DocInterniEditFormActivity extends BaseActivity implements DocInterniEditFormViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
||||
|
||||
private static String DATA_KEY_DOCUMENT = "document";
|
||||
private static String DATA_KEY_PRODUCTS_LIST = "productsList";
|
||||
|
||||
@Inject
|
||||
MtbColrRepository documentRowsRepository;
|
||||
@Inject
|
||||
DocInterniEditFormViewModel viewModel;
|
||||
|
||||
|
||||
private int mBarcodeScannerIstanceID;
|
||||
private ActivityContabDocInterniEditBinding binding;
|
||||
public BindableString documentHeader = new BindableString(true);
|
||||
public BindableString documentRifHeader = new BindableString(true);
|
||||
public BindableString codDtip = new BindableString();
|
||||
public BindableString note = new BindableString();
|
||||
public BindableString codMgrp = new BindableString();
|
||||
public BindableString codAnag = new BindableString();
|
||||
public BindableInteger prodsCount = new BindableInteger(0);
|
||||
public BindableBoolean isDocumentExportable = new BindableBoolean(false);
|
||||
private final ObservableArrayList<SqlMtbColr> documentRowsObservableList = new ObservableArrayList<>();
|
||||
|
||||
public static Intent newInstance(Context context, SqlMtbColt document, GrigliaAcquistiDTO productList) {
|
||||
Intent myIntent = new Intent(context, DocInterniEditFormActivity.class);
|
||||
|
||||
String doc = DataCache.addItem(document);
|
||||
String productsKey = DataCache.addItem(productList);
|
||||
myIntent.putExtra(DATA_KEY_DOCUMENT, doc);
|
||||
myIntent.putExtra(DATA_KEY_PRODUCTS_LIST, productsKey);
|
||||
return myIntent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_contab_doc_interni_edit);
|
||||
MainApplication.appComponent
|
||||
.docInterniEditFormComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
SqlMtbColt document = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_DOCUMENT));
|
||||
GrigliaAcquistiDTO griglia = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_PRODUCTS_LIST));
|
||||
List<GrigliaAcquistiChildDTO> productList = griglia.getGrigliaAcquistiChild();
|
||||
this.initViewModel(document, productList);
|
||||
this.initView();
|
||||
this.initBindables();
|
||||
this.initRecyclerView();
|
||||
}
|
||||
|
||||
private void initBindables() {
|
||||
SqlMtbColt document = this.viewModel.getDocument();
|
||||
this.codDtip.set(document.getCodDtipProvv());
|
||||
this.note.set(document.getAnnotazioni());
|
||||
if(document.getCodMgrp() != null){
|
||||
this.codMgrp.set(document.getCodMgrp());
|
||||
}else{
|
||||
binding.mtbGrupContainer.setVisibility(View.GONE);
|
||||
}
|
||||
if (document.getCodAnag() != null){
|
||||
this.codAnag.set(document.getCodAnag() + (document.getCodVdes()!=null?" - "+document.getCodVdes():""));
|
||||
}else{
|
||||
this.binding.supplierLayout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
this.documentHeader.set(String.format(this.getString(R.string.doc_interni_doc_header), document.getId(), document.getCodDtipProvv()));
|
||||
|
||||
if (document.getNumDoc() != null && document.getDataDoc() != null){
|
||||
this.documentRifHeader.set(String.format(this.getString(R.string.doc_testata), document.getNumDoc().toString(), document.getDataDoc()));
|
||||
}else{
|
||||
this.binding.docRifLayout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
binding.setViewModel(this.viewModel);
|
||||
binding.setView(this);
|
||||
setSupportActionBar(binding.toolbar);
|
||||
binding.toolbar.setTitle(R.string.edit_doc);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
FabMenuCustomAnimations.changeIconOnFocus(binding.closeActivityFab, R.drawable.ic_menu_24dp, R.drawable.ic_close_24dp);
|
||||
binding.bottomSheetMtbColrEdit.setListener(this);
|
||||
binding.bottomSheetMtbColrEdit.init(binding.bottomSheetMtbColrEdit, binding.bottomSheetMtbColrEditBackground);
|
||||
}
|
||||
|
||||
private void initViewModel(SqlMtbColt document, List<GrigliaAcquistiChildDTO> productList) {
|
||||
this.viewModel.setListeners(this);
|
||||
this.viewModel.setDocument(document);
|
||||
this.viewModel.setProductsList(productList);
|
||||
|
||||
}
|
||||
private void initRecyclerView() {
|
||||
this.viewModel.docRows.observe(this, this::refreshList);
|
||||
DocumentRowsListAdapter listAdapter = new DocumentRowsListAdapter(this, documentRowsObservableList);
|
||||
listAdapter.setEmptyView(binding.scanArtSpinner);
|
||||
binding.documentRowsList.setAdapter(listAdapter);
|
||||
binding.documentRowsList.setLayoutManager(new LinearLayoutManager(this));
|
||||
listAdapter.setOnItemClicked(row -> {
|
||||
binding.bottomSheetMtbColrEdit.setMtbColr(sqlToEntity(row));
|
||||
binding.bottomSheetMtbColrEdit.expand();
|
||||
});
|
||||
}
|
||||
|
||||
private void refreshList(List<SqlMtbColr> sqlMtbColrs) {
|
||||
this.documentRowsObservableList.clear();
|
||||
this.documentRowsObservableList.addAll(this.viewModel.docRows.getValue());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void closeEdit() {
|
||||
this.onBackPressed();
|
||||
}
|
||||
|
||||
public void manualSearch() {
|
||||
BarcodeManager.disable();
|
||||
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre/codice articolo da cercare", null, this.viewModel::onSearch, BarcodeManager::enable).show();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
SqlMtbColt document = this.viewModel.getDocument();
|
||||
if (document == null) {
|
||||
Toast.makeText(this, "Nesusn documento selezionato!", Toast.LENGTH_SHORT).show();
|
||||
closeEdit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getCodDtip() != null) {
|
||||
Toast.makeText(this, "Impossibile modificare un documento esportato", Toast.LENGTH_SHORT).show();
|
||||
closeEdit();
|
||||
return;
|
||||
}
|
||||
|
||||
mBarcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessfull(this.viewModel::onScanSuccessful)
|
||||
.setOnScanFailed(this::onError));
|
||||
this.viewModel.fetchDocumentRows();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowsChanged(List<SqlMtbColr> rows) {
|
||||
this.prodsCount.set(rows.size());
|
||||
this.isDocumentExportable.set(rows.size() > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEditRowRequest(SqlMtbColr row, boolean flagTracciabilita) {
|
||||
MtbAart mtbAart = new MtbAart();
|
||||
mtbAart.setBarCode(row.getCodBarre());
|
||||
mtbAart.setDiacod(row.getCodBarre());
|
||||
mtbAart.setCodMart(row.getCodMart());
|
||||
mtbAart.setFlagQtaCnfFissa("S");
|
||||
mtbAart.setQtaCnf(BigDecimal.valueOf(row.getQtaCnf()));
|
||||
mtbAart.setDescrizione(row.getDescrizione());
|
||||
mtbAart.setDescrizioneEstesa(row.getDescrizione());
|
||||
mtbAart.setFlagTracciabilita(flagTracciabilita? "S" : "N");
|
||||
mtbAart.setUntMis(row.getUntMis());
|
||||
|
||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||
.setMtbAart(mtbAart)
|
||||
.setInitialNumCnf(BigDecimal.valueOf(row.getNumCnf()))
|
||||
.setInitialQtaCnf(BigDecimal.valueOf(row.getQtaCnf()))
|
||||
.setInitialQtaTot(BigDecimal.valueOf(row.getQtaCol()))
|
||||
.setNote(row.getNote())
|
||||
.setPartitaMag(row.getPartitaMag())
|
||||
.setDataScad(row.getDataScad())
|
||||
.setCanOverflowOrderQuantity(false)
|
||||
.setCanLUBeClosed(false)
|
||||
.setNotesAllowed(true)
|
||||
.setDataScadMandatory(flagTracciabilita)
|
||||
.setCanPartitaMagBeChanged(flagTracciabilita)
|
||||
.setSuggestPartitaMag(data -> {
|
||||
Date dataScad = data.getDataScad();
|
||||
String partitaMag = null;
|
||||
if (dataScad != null){
|
||||
partitaMag = new SimpleDateFormat("yyyymmdd").format(dataScad);
|
||||
}
|
||||
return partitaMag;
|
||||
});
|
||||
|
||||
DialogInputQuantityV2View
|
||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
||||
this.onLoadingStarted();
|
||||
this.viewModel.saveRow(row, resultDTO);
|
||||
}, this::onLoadingEnded)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDocumentHoldRequest() {
|
||||
this.closeEdit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDocExported() {
|
||||
runOnUiThread(() -> {
|
||||
DialogCommon.showDataSaved(this, this::closeEdit);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColrEdit(MtbColr mtbColr) {
|
||||
GrigliaAcquistiChildDTO articolo = viewModel.getArticoloByCodMart(mtbColr.getCodMart());
|
||||
this.viewModel.editRow(entityToSql(mtbColr),articolo.getFlagTracciabilita().equalsIgnoreCase("S"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColrDelete(MtbColr mtbColr) {
|
||||
this.viewModel.deleteRow(entityToSql(mtbColr));
|
||||
}
|
||||
|
||||
|
||||
private MtbColr sqlToEntity(SqlMtbColr sqlMtbColr) {
|
||||
MtbColr entity = new MtbColr();
|
||||
|
||||
entity
|
||||
.setCodMart(sqlMtbColr.getCodMart())
|
||||
.setSerCollo(sqlMtbColr.getSerCollo())
|
||||
.setGestione(sqlMtbColr.getGestione())
|
||||
.setNumCollo(sqlMtbColr.getNumCollo())
|
||||
.setDataCollo(UtilityDate.formatDate(sqlMtbColr.getDataCollo(), UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH))
|
||||
.setRiga(sqlMtbColr.getRiga())
|
||||
.setDescrizione(sqlMtbColr.getDescrizione())
|
||||
.setUntMis(sqlMtbColr.getUntMis())
|
||||
.setCodBarre(sqlMtbColr.getCodBarre())
|
||||
.setQtaCnf(BigDecimal.valueOf(sqlMtbColr.getQtaCnf()))
|
||||
.setNumCnf(BigDecimal.valueOf(sqlMtbColr.getNumCnf()))
|
||||
.setMtbPartitaMag(new MtbPartitaMag().setDataScad(sqlMtbColr.getDataScad()))
|
||||
.setQtaCol(BigDecimal.valueOf(sqlMtbColr.getQtaCol()));
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
private SqlMtbColr entityToSql(MtbColr mtbColr) {
|
||||
|
||||
return Stream.of(this.viewModel.getDocumentRows())
|
||||
.filter(row -> row.getRiga().equals(mtbColr.getRiga()))
|
||||
.findFirstOrElse(null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface DocInterniEditFormComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
|
||||
DocInterniEditFormComponent create();
|
||||
}
|
||||
|
||||
void inject(DocInterniEditFormActivity docInterniEditFormActivity);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniViewModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
|
||||
@Module(subcomponents = DocInterniEditFormComponent.class)
|
||||
public class DocInterniEditFormModule {
|
||||
|
||||
|
||||
@Provides
|
||||
DocInterniEditFormViewModel docInterniEditFormViewModel(DocInterniRESTConsumer docInterniRESTConsumer, MtbColrRepository mtbColrRepository, MtbColtRepository mtbColtRepository) {
|
||||
return new DocInterniEditFormViewModel(docInterniRESTConsumer,mtbColrRepository, mtbColtRepository);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ArtDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ColloDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiChildDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ResultDTO;
|
||||
|
||||
public class DocInterniEditFormViewModel {
|
||||
|
||||
@Inject
|
||||
MtbColrRepository mtbColrRepository;
|
||||
@Inject
|
||||
MtbColtRepository mtbColtRepository;
|
||||
private final DocInterniRESTConsumer docInterniRESTConsumer;
|
||||
private DocInterniEditFormViewModel.Listener listener;
|
||||
private List<GrigliaAcquistiChildDTO> productsList;
|
||||
|
||||
public MutableLiveData<SqlMtbColt> document = new MutableLiveData<>();
|
||||
public MutableLiveData<List<SqlMtbColr>> docRows = new MutableLiveData<>();
|
||||
|
||||
@Inject
|
||||
public DocInterniEditFormViewModel(DocInterniRESTConsumer docInterniRESTConsumer, MtbColrRepository mtbColrRepository, MtbColtRepository mtbColtRepository) {
|
||||
this.docInterniRESTConsumer = docInterniRESTConsumer;
|
||||
this.mtbColrRepository = mtbColrRepository;
|
||||
this.mtbColtRepository = mtbColtRepository;
|
||||
this.docRows.setValue(new ArrayList<>());
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.listener != null) listener.onLoadingStarted();
|
||||
}
|
||||
|
||||
private void sendOnLoadingEnded() {
|
||||
if (this.listener != null) listener.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
if (this.listener != null) listener.onError(ex);
|
||||
}
|
||||
|
||||
public void fetchDocumentRows() {
|
||||
this.sendOnLoadingStarted();
|
||||
mtbColrRepository.getDocumentRows(this.document.getValue(), rows -> {
|
||||
this.docRows.postValue(rows);
|
||||
this.listener.onRowsChanged(rows);
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void editRow(SqlMtbColr row,boolean flagTracciabilita) {
|
||||
this.listener.onEditRowRequest(row,flagTracciabilita);
|
||||
}
|
||||
|
||||
private Integer getNextIdRiga() {
|
||||
List<SqlMtbColr> rows = this.docRows.getValue();
|
||||
if (rows == null || rows.size() <= 0) {
|
||||
return 1;
|
||||
}
|
||||
return Stream.of(rows).mapToInt(SqlMtbColr::getRiga).max().getAsInt() + 1;
|
||||
}
|
||||
|
||||
public void exportDocument() {
|
||||
this.sendOnLoadingStarted();
|
||||
docInterniRESTConsumer.saveDoc(this.getSaveDto(), obj -> {
|
||||
SqlMtbColt document = this.getDocument();
|
||||
document.setCodDtip(document.getCodDtipProvv());
|
||||
mtbColtRepository.update(document, doc -> {
|
||||
this.sendOnLoadingEnded();
|
||||
this.listener.onDocExported();
|
||||
}, this::sendError);
|
||||
}, this::sendError);
|
||||
}
|
||||
public void deleteDocument() {
|
||||
this.sendOnLoadingStarted();
|
||||
docInterniRESTConsumer.saveDoc(this.getSaveDto(), obj -> {
|
||||
SqlMtbColt document = this.getDocument();
|
||||
document.setCodDtip(document.getCodDtipProvv());
|
||||
mtbColtRepository.update(document, doc -> {
|
||||
this.sendOnLoadingEnded();
|
||||
this.listener.onDocExported();
|
||||
}, this::sendError);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public void holdDocument() {
|
||||
this.listener.onDocumentHoldRequest();
|
||||
}
|
||||
|
||||
public void onSearch(String search) {
|
||||
this.sendOnLoadingStarted();
|
||||
GrigliaAcquistiChildDTO articolo = this.searchArticolo(search);
|
||||
if (articolo == null) {
|
||||
this.sendError(new Exception("Nessun articolo corrispondente al codice fornito!"));
|
||||
this.sendOnLoadingEnded();
|
||||
return;
|
||||
}
|
||||
SqlMtbColr row = this.getRowForArticolo(articolo);
|
||||
this.editRow(row,articolo.getFlagTracciabilita().equalsIgnoreCase("S"));
|
||||
|
||||
}
|
||||
|
||||
private SqlMtbColr getRowForArticolo(GrigliaAcquistiChildDTO articolo) {
|
||||
List<SqlMtbColr> docRows = this.docRows.getValue();
|
||||
if (docRows == null) {
|
||||
docRows = new ArrayList<>();
|
||||
}
|
||||
SqlMtbColt document = this.document.getValue();
|
||||
SqlMtbColr row = Stream.of(docRows).filter(docRow -> docRow.getCodMart().equalsIgnoreCase(articolo.getCodMart())).findFirstOrElse(null);
|
||||
if (row == null) {
|
||||
row = new SqlMtbColr();
|
||||
row.setIdCollo(document.getId());
|
||||
row.setRiga(getNextIdRiga());
|
||||
row.setCodMart(articolo.getCodMart());
|
||||
row.setSerCollo(document.getSerCollo());
|
||||
row.setGestione(document.getGestione());
|
||||
row.setNumCollo(document.getNumCollo());
|
||||
row.setDataCollo(document.getDataCollo());
|
||||
row.setDescrizione(articolo.getDescrizione());
|
||||
row.setUntMis(articolo.getUntMis());
|
||||
row.setCodBarre(articolo.getBarcode());
|
||||
row.setQtaCnf(articolo.getQtaCnf().floatValue());
|
||||
row.setNumCnf(0f);
|
||||
row.setQtaCol(0f);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
private GrigliaAcquistiChildDTO searchArticolo(String filter) {
|
||||
return Stream.of(this.productsList).filter(dto -> dto.getCodMart().equalsIgnoreCase(filter) || dto.getBarcode().equalsIgnoreCase(filter)).findFirstOrElse(null);
|
||||
}
|
||||
|
||||
private SaveDTO getSaveDto() {
|
||||
SqlMtbColt document = this.getDocument();
|
||||
SaveDTO saveDTO = new SaveDTO();
|
||||
saveDTO.setIdDisp("1");
|
||||
saveDTO.setGestione(document.getGestione());
|
||||
saveDTO.setCodMdep(document.getCodMdep());
|
||||
saveDTO.setCodDtip(document.getCodDtipProvv());
|
||||
saveDTO.setAnnotazioni(document.getAnnotazioni());
|
||||
saveDTO.setSegno(document.getSegno().toString());
|
||||
|
||||
ColloDTO collo = new ColloDTO();
|
||||
collo.setIdDisp("1");
|
||||
collo.setGestione(document.getGestione());
|
||||
collo.setCodMdep(document.getCodMdep());
|
||||
collo.setCodDtip(document.getCodDtipProvv());
|
||||
collo.setCreatedDate(UtilityDate.formatDate(document.getDataCollo(), UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
|
||||
collo.setAnnotazioni(document.getAnnotazioni());
|
||||
collo.setSegno(saveDTO.getSegno());
|
||||
|
||||
for (SqlMtbColr row : this.getDocumentRows()) {
|
||||
ArtDTO artDto = new ArtDTO();
|
||||
artDto.setBarcode(row.getCodBarre());
|
||||
artDto.setQta(BigDecimal.valueOf(row.getQtaCol()));
|
||||
artDto.setDataIns(row.getDataCollo());
|
||||
artDto.setColli(BigDecimal.valueOf(row.getNumCnf()));
|
||||
artDto.setUntMis(row.getUntMis());
|
||||
artDto.setCodMart(row.getCodMart());
|
||||
if (row.getDataScad() != null) {
|
||||
artDto.setDataScad(row.getDataScad());
|
||||
}
|
||||
artDto.setDescrizione(row.getDescrizione());
|
||||
collo.addArtRow(artDto);
|
||||
}
|
||||
saveDTO.setColloDTO(collo);
|
||||
|
||||
return saveDTO;
|
||||
}
|
||||
|
||||
public DocInterniEditFormViewModel setListeners(Listener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDocument(SqlMtbColt document) {
|
||||
this.document.setValue(document);
|
||||
}
|
||||
|
||||
public SqlMtbColt getDocument() {
|
||||
return document.getValue();
|
||||
}
|
||||
|
||||
public List<GrigliaAcquistiChildDTO> getProductsList() {
|
||||
return productsList;
|
||||
}
|
||||
|
||||
public void setProductsList(List<GrigliaAcquistiChildDTO> productsList) {
|
||||
this.productsList = productsList;
|
||||
}
|
||||
|
||||
public void onScanSuccessful(BarcodeScanDTO dto) {
|
||||
String code = dto.getStringValue();
|
||||
this.onSearch(code);
|
||||
}
|
||||
|
||||
public void saveRow(SqlMtbColr row, DialogInputQuantityV2ResultDTO resultDTO) {
|
||||
row.setQtaCnf(resultDTO.getQtaCnf().floatValue());
|
||||
row.setNumCnf(resultDTO.getNumCnf().floatValue());
|
||||
row.setQtaCol(resultDTO.getQtaTot().floatValue());
|
||||
row.setNote(resultDTO.getNote());
|
||||
row.setDataScad(resultDTO.getDataScad());
|
||||
if (row.getId() > 0) {
|
||||
this.mtbColrRepository.update(row, id -> {
|
||||
this.fetchDocumentRows();
|
||||
}, this::sendError);
|
||||
} else {
|
||||
this.mtbColrRepository.insert(row, id -> {
|
||||
this.fetchDocumentRows();
|
||||
}, this::sendError);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteRow(SqlMtbColr sqlMtbColr) {
|
||||
mtbColrRepository.delete(sqlMtbColr, this::fetchDocumentRows, this::sendError);
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
SqlMtbColt document = this.document.getValue();
|
||||
document.setAnnotazioni(note);
|
||||
mtbColtRepository.update(document, doc -> this.document.postValue(doc), this::sendError);
|
||||
}
|
||||
|
||||
public List<SqlMtbColr> getDocumentRows() {
|
||||
return this.docRows.getValue();
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO getArticoloByCodMart(String codMart) {
|
||||
return Stream.of(productsList).filter(prod->prod.codMart.equalsIgnoreCase(codMart)).findFirstOrElse(null);
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
void onRowsChanged(List<SqlMtbColr> rows);
|
||||
|
||||
void onEditRowRequest(SqlMtbColr row,boolean flagTracciabilita);
|
||||
|
||||
void onDocumentHoldRequest();
|
||||
|
||||
void onDocExported();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.view.ExtendedRecyclerView;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContabDocInternoRowListSingleItemBinding;
|
||||
import it.integry.integrywmsnative.databinding.DocInterniListModelBinding;
|
||||
|
||||
public class DocumentRowsListAdapter extends ExtendedRecyclerView<SqlMtbColr, DocumentRowsListAdapter.SingleItemViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private RunnableArgs<SqlMtbColr> mOnItemClicked;
|
||||
|
||||
public DocumentRowsListAdapter(Context context, ObservableArrayList<SqlMtbColr> myDataset) {
|
||||
super(myDataset);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SingleItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
ActivityContabDocInternoRowListSingleItemBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.activity_contab_doc_interno_row__list_single_item, parent, false);
|
||||
return new SingleItemViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull SingleItemViewHolder holder, int position) {
|
||||
final SqlMtbColr row = mDataset.get(position);
|
||||
holder.binding.setItem(row);
|
||||
holder.binding.executePendingBindings();
|
||||
holder.binding.getRoot().setOnClickListener(v -> {
|
||||
if (this.mOnItemClicked != null)
|
||||
this.mOnItemClicked.run(row);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void setOnItemClicked(RunnableArgs<SqlMtbColr> onItemClicked){
|
||||
this.mOnItemClicked = onItemClicked;
|
||||
}
|
||||
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
ActivityContabDocInternoRowListSingleItemBinding binding;
|
||||
|
||||
SingleItemViewHolder(ActivityContabDocInternoRowListSingleItemBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.rest;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class DocInterniRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void getDocInterniSetup(RunnableArgs<DocInterniSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
DocInterniRESTConsumerService service = RESTBuilder.getService(DocInterniRESTConsumerService.class);
|
||||
service.getSetupDocInterni().enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<DocInterniSetupDTO>> call, Response<ServiceRESTResponse<DocInterniSetupDTO>> response) {
|
||||
analyzeAnswer(response, "getSetupDocInterni", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<DocInterniSetupDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void fetchProducts(String codDtip, String codMgrp, RunnableArgs<GrigliaAcquistiDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
DocInterniRESTConsumerService service = RESTBuilder.getService(DocInterniRESTConsumerService.class);
|
||||
service.fetchProducts(codDtip,codMgrp,"L").enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<GrigliaAcquistiDTO>> call, Response<ServiceRESTResponse<GrigliaAcquistiDTO>> response) {
|
||||
analyzeAnswer(response, "fetchProducts", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<GrigliaAcquistiDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void saveDoc(SaveDTO saveDTO, RunnableArgs<JsonObject> onComplete, RunnableArgs<Exception> onFailed){
|
||||
DocInterniRESTConsumerService service = RESTBuilder.getService(DocInterniRESTConsumerService.class);
|
||||
service.save(saveDTO).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||
analyzeAnswer(response, "saveDoc", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.rest;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
|
||||
public interface DocInterniRESTConsumerService {
|
||||
|
||||
@GET("getDocInterniSetup")
|
||||
Call<ServiceRESTResponse<DocInterniSetupDTO>> getSetupDocInterni();
|
||||
|
||||
@POST("SM2SaveTerminalinoWMS")
|
||||
Call<ServiceRESTResponse<JsonObject>> save(@Body SaveDTO saveDTO);
|
||||
|
||||
@GET("getElencoArticoli")
|
||||
Call<ServiceRESTResponse<GrigliaAcquistiDTO>> fetchProducts(@Query("codDtip") String codDtip, @Query("codMgrp") String codMgrp, @Query("gestione") String gestione);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.view.ExtendedRecyclerView;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.DocInterniListModelBinding;
|
||||
|
||||
public class DocInterniListAdapter extends ExtendedRecyclerView<DocInterniListModel, DocInterniListAdapter.SingleItemViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private RunnableArgs<SqlMtbColt> mOnItemClicked;
|
||||
|
||||
public DocInterniListAdapter(Context context, ObservableArrayList<DocInterniListModel> myDataset) {
|
||||
super(myDataset);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SingleItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
DocInterniListModelBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.doc_interni_list_model, parent, false);
|
||||
return new SingleItemViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull SingleItemViewHolder holder, int position) {
|
||||
final DocInterniListModel doc = mDataset.get(position);
|
||||
SqlMtbColt mtbColt = doc.getDocument();
|
||||
|
||||
String testataDocString = String.format(mContext.getString(R.string.doc_interni_doc_header), mtbColt.getId(), mtbColt.getCodDtipProvv());
|
||||
holder.binding.dataDoc.setText(Html.fromHtml(UtilityDate.formatDate(mtbColt.getDataCollo(), UtilityDate.COMMONS_DATE_FORMATS.DM_HUMAN)));
|
||||
holder.binding.docDescription.setText(Html.fromHtml(testataDocString));
|
||||
holder.binding.numRows.setText(Html.fromHtml(String.format(mContext.getString(R.string.doc_interni_num_arts_doc), doc.getProductsCount())));
|
||||
|
||||
holder.binding.executePendingBindings();
|
||||
holder.binding.getRoot().setOnClickListener(v -> {
|
||||
if (this.mOnItemClicked != null)
|
||||
this.mOnItemClicked.run(mtbColt);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void setOnItemClicked(RunnableArgs<SqlMtbColt> onItemClicked){
|
||||
this.mOnItemClicked = onItemClicked;
|
||||
}
|
||||
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
DocInterniListModelBinding binding;
|
||||
|
||||
SingleItemViewHolder(DocInterniListModelBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.ui;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
|
||||
public class DocInterniListModel {
|
||||
|
||||
|
||||
private SqlMtbColt document;
|
||||
private int productsCount;
|
||||
|
||||
public SqlMtbColt getDocument() {
|
||||
return document;
|
||||
}
|
||||
|
||||
public void setDocument(SqlMtbColt document) {
|
||||
this.document = document;
|
||||
}
|
||||
|
||||
public int getProductsCount() {
|
||||
return productsCount;
|
||||
}
|
||||
|
||||
public void setProductsCount(int productsCount) {
|
||||
this.productsCount = productsCount;
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ILifecycleFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ISearcableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ISearchableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
@@ -280,21 +280,21 @@ public class MainActivity extends BaseActivity
|
||||
}
|
||||
|
||||
private void adaptViewToFragment(Fragment fragment) {
|
||||
if (fragment instanceof ISearcableFragment) {
|
||||
if (fragment instanceof ISearchableFragment) {
|
||||
mBinding.appBarMain.mainSearch.setOnQueryTextListener((SearchView.OnQueryTextListener) fragment);
|
||||
mBinding.appBarMain.mainSearch.setVisibility(View.VISIBLE);
|
||||
mBinding.appBarMain.mainSearch.setOnSearchClickListener(v -> {
|
||||
((ISearcableFragment) fragment).onSearchEnabled();
|
||||
((ISearchableFragment) fragment).onSearchEnabled();
|
||||
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.GONE);
|
||||
});
|
||||
|
||||
mBinding.appBarMain.mainSearch.setOnCloseListener(() -> {
|
||||
((ISearcableFragment) fragment).onSearchDisabled();
|
||||
((ISearchableFragment) fragment).onSearchDisabled();
|
||||
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.VISIBLE);
|
||||
return false;
|
||||
});
|
||||
|
||||
((ISearcableFragment) fragment).addOnPreDestroy(() -> {
|
||||
((ISearchableFragment) fragment).addOnPreDestroy(() -> {
|
||||
mBinding.appBarMain.mainSearch.setIconified(true);
|
||||
mBinding.appBarMain.mainSearch.setVisibility(View.GONE);
|
||||
});
|
||||
|
||||
@@ -32,55 +32,66 @@ public class OrdiniUscitaElencoBindings {
|
||||
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {{
|
||||
put(DEPOSITO_FILTER_ID, new FilterChipDTO()
|
||||
.setID(DEPOSITO_FILTER_ID)
|
||||
.setPosizione(9)
|
||||
.setFilterChipText("Deposito")
|
||||
.setFilterLayoutView(new FilterDepositoLayoutView()));
|
||||
|
||||
put(VIAGGIO_FILTER_ID, new FilterChipDTO()
|
||||
.setID(VIAGGIO_FILTER_ID)
|
||||
.setPosizione(2)
|
||||
.setFilterChipText("Viaggio")
|
||||
.setFilterLayoutView(new FilterViaggioLayoutView()));
|
||||
|
||||
put(NUM_ORD_FILTER_ID, new FilterChipDTO()
|
||||
.setID(NUM_ORD_FILTER_ID)
|
||||
.setPosizione(0)
|
||||
.setFilterChipText("Numero ordine")
|
||||
.setFilterLayoutView(new FilterNumeroOrdineLayoutView()));
|
||||
|
||||
put(CLIENTE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(CLIENTE_FILTER_ID)
|
||||
.setPosizione(1)
|
||||
.setFilterChipText("Cliente")
|
||||
.setFilterLayoutView(new FilterClienteLayoutView()));
|
||||
|
||||
put(VETTORE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(VETTORE_FILTER_ID)
|
||||
.setPosizione(4)
|
||||
.setFilterChipText("Vettore")
|
||||
.setFilterLayoutView(new FilterVettoreLayoutView()));
|
||||
|
||||
put(AUTOMEZZO_FILTER_ID, new FilterChipDTO()
|
||||
.setID(AUTOMEZZO_FILTER_ID)
|
||||
.setPosizione(6)
|
||||
.setFilterChipText("Automezzo")
|
||||
.setFilterLayoutView(new FilterAutomezzoLayoutView()));
|
||||
|
||||
put(PAESE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(PAESE_FILTER_ID)
|
||||
.setPosizione(8)
|
||||
.setFilterChipText("Paese")
|
||||
.setFilterLayoutView(new FilterPaeseLayoutView()));
|
||||
|
||||
put(AGENTE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(AGENTE_FILTER_ID)
|
||||
.setPosizione(10)
|
||||
.setFilterChipText("Agente")
|
||||
.setFilterLayoutView(new FilterAgenteLayoutView()));
|
||||
|
||||
put(TERM_CONS_FILTER_ID, new FilterChipDTO()
|
||||
.setID(TERM_CONS_FILTER_ID)
|
||||
.setPosizione(5)
|
||||
.setFilterChipText("Termini consegna")
|
||||
.setFilterLayoutView(new FilterTermConsLayoutView()));
|
||||
|
||||
put(DATA_CONS_FILTER_ID, new FilterChipDTO()
|
||||
.setID(DATA_CONS_FILTER_ID)
|
||||
.setPosizione(3)
|
||||
.setFilterChipText("Data consegna"));
|
||||
|
||||
put(GRUPPO_MERC_FILTER_ID, new FilterChipDTO()
|
||||
.setID(GRUPPO_MERC_FILTER_ID)
|
||||
.setPosizione(7)
|
||||
.setFilterChipText("Gruppo merceologico")
|
||||
.setFilterLayoutView(new FilterGruppoMercLayoutView()));
|
||||
}};
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.google.android.material.datepicker.MaterialDatePicker;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -261,14 +262,16 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
mAppliedFilterViewModel.getCurrentDataConsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
|
||||
for (var filterChipDTO : OrdiniUscitaElencoBindings.AVAILABLE_FILTERS.entrySet()) {
|
||||
List<FilterChipDTO> filterList = Stream.of(OrdiniUscitaElencoBindings.AVAILABLE_FILTERS.entrySet()).map(Map.Entry::getValue).sortBy(FilterChipDTO::getPosizione).toList();
|
||||
|
||||
for (FilterChipDTO filterChipDTO : filterList) {
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(
|
||||
requireActivity(),
|
||||
filterChipDTO.getValue().getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO.getValue()));
|
||||
filterChipDTO.getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||
|
||||
switch (filterChipDTO.getKey()) {
|
||||
switch (filterChipDTO.getID()) {
|
||||
case OrdiniUscitaElencoBindings.DEPOSITO_FILTER_ID:
|
||||
mAppliedFilterViewModel.getCurrentDepositoPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
@@ -694,28 +697,29 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
|
||||
//new Thread(() -> {
|
||||
|
||||
// requireActivity().runOnUiThread(() -> {
|
||||
List<OrdiniUscitaElencoDTO> tmpList;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
List<OrdiniUscitaElencoDTO> tmpList;
|
||||
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mAppliedFilterViewModel != null) {
|
||||
mAppliedFilterViewModel.applyAllTests();
|
||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getOrderList().getValue();
|
||||
}
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mAppliedFilterViewModel != null) {
|
||||
mAppliedFilterViewModel.applyAllTests();
|
||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getOrderList().getValue();
|
||||
}
|
||||
|
||||
var list = convertDataModelToListModel(tmpList);
|
||||
var list = convertDataModelToListModel(tmpList);
|
||||
|
||||
this.mOrdiniInevasiMutableData.clear();
|
||||
this.mOrdiniInevasiMutableData.addAll(list);
|
||||
this.mOrdiniInevasiMutableData.clear();
|
||||
this.mOrdiniInevasiMutableData.addAll(list);
|
||||
|
||||
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||
// });
|
||||
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
|
||||
//}).start();
|
||||
|
||||
}
|
||||
@@ -828,7 +832,6 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||
this.mOnPreDestroyList.add(onPreDestroy);
|
||||
|
||||
@@ -284,10 +284,16 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
||||
if (offsetCnf.floatValue() != 0 || offsetCol.floatValue() != 0){
|
||||
if ( SettingsManager.iDB().isFlagForceAllToColli() || (majorOrder.getOriginalMtbAart() != null && !majorOrder.getOriginalMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
majorOrder.setNumCnfBigDecimal(majorOrder.getNumCnfBigDecimal().add(offsetCnf));
|
||||
majorOrder.getOriginalOrdineLavorazione().setNumCnfVersamento(majorOrder.getNumCnfBigDecimal().floatValue());
|
||||
|
||||
majorOrder.setQtaBigDecimal(majorOrder.getQtaBigDecimal().add(offsetCol));
|
||||
majorOrder.getOriginalOrdineLavorazione().setQtaColVersamento(majorOrder.getQtaBigDecimal().floatValue());
|
||||
} else {
|
||||
majorOrder.setQtaBigDecimal(majorOrder.getQtaBigDecimal().add(offsetCol));
|
||||
majorOrder.getOriginalOrdineLavorazione().setQtaColVersamento(majorOrder.getQtaBigDecimal().floatValue());
|
||||
|
||||
majorOrder.setNumCnfBigDecimal(UtilityBigDecimal.divide(majorOrder.getQtaBigDecimal(), qtaCnf));
|
||||
majorOrder.getOriginalOrdineLavorazione().setNumCnfVersamento(majorOrder.getNumCnfBigDecimal().floatValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -319,6 +325,12 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
||||
this.openLU();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex, boolean requestClose) {
|
||||
super.onError(ex);
|
||||
if(requestClose) popMe();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarning(String warningText, Runnable action) {
|
||||
this.requireActivity().runOnUiThread(() -> {
|
||||
|
||||
@@ -77,8 +77,13 @@ public class ProdVersamentoMaterialeViewModel {
|
||||
mtbDepoPosizione.getPosizione(),
|
||||
getIdMaterialeFromCollo(mtbColt),
|
||||
ordini -> {
|
||||
setCurrentOrders(ordini, mtbColt.getMtbColr().get(0));
|
||||
this.sendOnLoadingEnded();
|
||||
if(ordini == null || ordini.isEmpty())
|
||||
this.sendError(new Exception("Nessun ordine compatibile con " + getIdMaterialeFromCollo(mtbColt) + " sulla linea " + mtbDepoPosizione.getPosizione()), true);
|
||||
else {
|
||||
setCurrentOrders(ordini, mtbColt.getMtbColr().get(0));
|
||||
this.sendOnLoadingEnded();
|
||||
}
|
||||
|
||||
},
|
||||
e -> this.sendWarning(e.getMessage(), this::sendRequestLUOpen));
|
||||
}
|
||||
@@ -194,7 +199,11 @@ public class ProdVersamentoMaterialeViewModel {
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
if (this.mListener != null) mListener.onError(ex, false);
|
||||
}
|
||||
|
||||
private void sendError(Exception ex, boolean requestClose) {
|
||||
if (this.mListener != null) mListener.onError(ex, requestClose);
|
||||
}
|
||||
|
||||
private void sendOnDataSaved() {
|
||||
@@ -205,7 +214,7 @@ public class ProdVersamentoMaterialeViewModel {
|
||||
|
||||
void requestLUOpen();
|
||||
|
||||
void onError(Exception ex);
|
||||
void onError(Exception ex, boolean requestClose);
|
||||
|
||||
void onWarning(String warningText, Runnable action);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
@@ -33,11 +34,10 @@ import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PVOrdiniAcquistoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.databinding.ActivityPvOrdineAcquistoEditBinding;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.ui.OrdineAcquistoArtListAdapter;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.EditArticoloDialog;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.helper.PVEditOrderHelper;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.ui.OrdineAcquistoArtListAdapter;
|
||||
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogAskAction;
|
||||
@@ -46,6 +46,7 @@ import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
||||
|
||||
private static String DATA_KEY_ORDER = "keyOrdine";
|
||||
private Ordine mOrdine;
|
||||
private Griglia mGriglia;
|
||||
private List<ArticoloOrdine> mArticoli = new ArrayList<>();
|
||||
@@ -64,6 +65,13 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
||||
ArticoloGrigliaRepository mArticoloGrigliaRepository;
|
||||
|
||||
|
||||
public static Intent newInstance(Context context, Ordine ordine){
|
||||
Intent myIntent = new Intent(context, PVOrdineAcquistoEditActivity.class);
|
||||
String keyOrdine = DataCache.addItem(ordine);
|
||||
myIntent.putExtra(DATA_KEY_ORDER, keyOrdine);
|
||||
return myIntent;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -77,7 +85,7 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
||||
|
||||
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_pv_ordine_acquisto_edit);
|
||||
mBinding.setViewModel(this);
|
||||
mOrdine = DataCache.retrieveItem(getIntent().getStringExtra("keyOrdine"));
|
||||
mOrdine = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_ORDER));
|
||||
setSupportActionBar(mBinding.toolbar);
|
||||
mBinding.toolbar.setTitle(R.string.edit_order);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
@@ -175,13 +183,14 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void addArticolo(ArticoloOrdine articoloOrdine) {
|
||||
runOnUiThread(() -> EditArticoloDialog.make(this, mhelper, articoloOrdine, articolo -> {
|
||||
|
||||
runOnUiThread(() -> EditArticoloDialog.newInstance(this, mhelper, articoloOrdine, articolo -> {
|
||||
BarcodeManager.enable();
|
||||
if (articolo != null) {
|
||||
Toast.makeText(this, "Articolo aggiunto all'ordine!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
fetchArticoli();
|
||||
}).show());
|
||||
}).show(this.getSupportFragmentManager(), "tag"));
|
||||
}
|
||||
|
||||
private void fetchDetails() {
|
||||
|
||||
@@ -1,177 +1,165 @@
|
||||
package it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialog;
|
||||
import it.integry.integrywmsnative.core.di.BindableBigDecimal;
|
||||
import it.integry.integrywmsnative.core.di.BindableInteger;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.databinding.DialogPvEditArticoloBinding;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.helper.PVEditOrderHelper;
|
||||
|
||||
public class EditArticoloDialog {
|
||||
|
||||
private Activity mContext;
|
||||
|
||||
private Dialog mDialog;
|
||||
public class EditArticoloDialog extends BaseDialogFragment {
|
||||
|
||||
private final Activity mContext;
|
||||
private DialogPvEditArticoloBinding mBinding;
|
||||
|
||||
private PVEditOrderHelper mHelper;
|
||||
|
||||
private ArticoloOrdine mArticolo;
|
||||
private ArticoloOrdine mSavedArt;
|
||||
|
||||
private final PVEditOrderHelper mHelper;
|
||||
private final MutableLiveData<ArticoloOrdine> mArticolo = new MutableLiveData<>();
|
||||
private final RunnableArgs<ArticoloOrdine> onDialogDismiss;
|
||||
private boolean mLockedInput = false;
|
||||
private Dialog mCurrentProgress;
|
||||
|
||||
public final BindableBigDecimal qtaOrd = new BindableBigDecimal(BigDecimal.ZERO);
|
||||
public final BindableInteger numCnf = new BindableInteger(0);
|
||||
public final BindableBigDecimal qtaCnf = new BindableBigDecimal(BigDecimal.ZERO);
|
||||
|
||||
public static Dialog make(Activity context, PVEditOrderHelper helper, ArticoloOrdine articolo, RunnableArgs<ArticoloOrdine> onDialogDismiss) {
|
||||
return new EditArticoloDialog(context, helper, articolo, onDialogDismiss).mDialog;
|
||||
public static EditArticoloDialog newInstance(Activity context, PVEditOrderHelper helper, ArticoloOrdine articolo, RunnableArgs<ArticoloOrdine> onDialogDismiss) {
|
||||
return new EditArticoloDialog(context, helper, articolo, onDialogDismiss);
|
||||
}
|
||||
|
||||
|
||||
private EditArticoloDialog(Activity context, PVEditOrderHelper helper, ArticoloOrdine articolo, RunnableArgs<ArticoloOrdine> onDialogDismiss) {
|
||||
mContext = context;
|
||||
mArticolo = articolo;
|
||||
mArticolo.setValue(articolo);
|
||||
mHelper = helper;
|
||||
qtaOrd.set(BigDecimal.valueOf(articolo.getQtaOrd()));
|
||||
numCnf.set(BigDecimal.valueOf(articolo.getQtaOrd()).divide(BigDecimal.valueOf(articolo.getQtaCnf()),0,RoundingMode.CEILING).intValue());
|
||||
qtaCnf.set(BigDecimal.valueOf(articolo.getQtaCnf()));
|
||||
|
||||
mSavedArt = null;
|
||||
this.onDialogDismiss = onDialogDismiss;
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setStyle(DialogFragment.STYLE_NORMAL, R.style.AppTheme_NewMaterial_Dialog_FullscreenDialog);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
ArticoloOrdine articolo = mArticolo.getValue();
|
||||
if (articolo != null && articolo.getQtaOrd() <= 0f){
|
||||
articolo = null;
|
||||
}
|
||||
onDialogDismiss.run(articolo);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_pv_edit_articolo, null, false);
|
||||
mBinding.setViewmodel(this);
|
||||
mBinding.setView(this);
|
||||
mBinding.toolbar.setTitle("Inserimento articolo");
|
||||
mBinding.inputQtaOrd.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
initBindings();
|
||||
|
||||
mDialog = new BaseDialog(context);
|
||||
mDialog.setContentView(mBinding.getRoot());
|
||||
UtilityDialog.setTo90PercentWidth(mContext, mDialog);
|
||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
int qtaCnf = (int) Math.ceil(mArticolo.getQtaOrd() / mArticolo.getQtaCnf());
|
||||
mBinding.qtaTot.setText(String.valueOf(mArticolo.getQtaOrd()));
|
||||
mBinding.qtaCnf.setText(String.valueOf(qtaCnf));
|
||||
mDialog.setOnShowListener(dialog -> {
|
||||
UtilityFocus.focusTextBox(mContext, mBinding.qtaTot);
|
||||
});
|
||||
|
||||
mDialog.setOnDismissListener(dialog -> {
|
||||
onDialogDismiss.run(mSavedArt);
|
||||
});
|
||||
setListeners();
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
private void setListeners() {
|
||||
mBinding.qtaTot.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
setQtaOrd(s.toString().length() > 0 ? Float.parseFloat(s.toString()) : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
}
|
||||
});
|
||||
mBinding.qtaCnf.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
setQtaCnf(s.toString().length() > 0 ? Integer.parseInt(s.toString()) : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
UtilityFocus.focusTextBox(mContext, mBinding.inputQtaOrd);
|
||||
}
|
||||
|
||||
public void setQtaCnf(int qtaCnf) {
|
||||
if (mLockedInput) {
|
||||
mLockedInput = false;
|
||||
} else {
|
||||
mLockedInput = true;
|
||||
private void initBindings() {
|
||||
|
||||
float qtaTot = qtaCnf * mArticolo.getQtaCnf();
|
||||
mBinding.qtaTot.setText(String.valueOf(qtaTot));
|
||||
}
|
||||
}
|
||||
BindableBigDecimal.registerListener(qtaOrd, qta -> {
|
||||
if (!mLockedInput) {
|
||||
mLockedInput = true;
|
||||
|
||||
public void setQtaOrd(float qtaOrd) {
|
||||
mArticolo.setQtaOrd(qtaOrd);
|
||||
if (mLockedInput) {
|
||||
mLockedInput = false;
|
||||
} else {
|
||||
mLockedInput = true;
|
||||
mBinding.qtaCnf.setText(String.valueOf((int) Math.ceil(qtaOrd / mArticolo.getQtaCnf())));
|
||||
}
|
||||
ArticoloOrdine articoloOrdine = mArticolo.getValue();
|
||||
BigDecimal qtaCnf = BigDecimal.valueOf(articoloOrdine.getQtaCnf());
|
||||
int cnf = 0;
|
||||
if (qtaOrd.get() != null && qtaOrd.get().compareTo(BigDecimal.ZERO) > 0){
|
||||
cnf = qtaOrd.get().divide(qtaCnf, 0, RoundingMode.CEILING).intValue();
|
||||
}
|
||||
this.numCnf.set( cnf);
|
||||
this.mBinding.executePendingBindings();
|
||||
|
||||
mLockedInput = false;
|
||||
}
|
||||
});
|
||||
BindableInteger.registerListener(numCnf, qta -> {
|
||||
if (!mLockedInput){
|
||||
mLockedInput = true;
|
||||
|
||||
ArticoloOrdine articoloOrdine = mArticolo.getValue();
|
||||
BigDecimal qtaCnf = BigDecimal.valueOf(articoloOrdine.getQtaCnf());
|
||||
this.qtaOrd.set(BigDecimal.valueOf(numCnf.get() * qtaCnf.floatValue()).setScale(2, RoundingMode.CEILING));
|
||||
this.mBinding.executePendingBindings();
|
||||
|
||||
mLockedInput = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void saveAndExit() {
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
try {
|
||||
float qtaOrd = Float.parseFloat(mBinding.qtaTot.getText().toString());
|
||||
if (qtaOrd <= 0) {
|
||||
ArticoloOrdine articolo = mArticolo.getValue();
|
||||
if (articolo == null) {
|
||||
throw new Exception("Articolo non valido");
|
||||
}
|
||||
if (qtaOrd.get().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new Exception("La quantità ordinata deve essere maggiore di 0");
|
||||
}
|
||||
mArticolo.setQtaOrd(qtaOrd);
|
||||
|
||||
articolo.setQtaOrd(qtaOrd.get().floatValue());
|
||||
mArticolo.postValue(articolo);
|
||||
|
||||
} catch (Exception e) {
|
||||
mContext.runOnUiThread(() -> UtilityExceptions.defaultException(mContext, e));
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
return;
|
||||
}
|
||||
mHelper.saveArticoloToOrdine(mArticolo, () -> {
|
||||
mSavedArt = mArticolo;
|
||||
this.closeProgress();
|
||||
mDialog.dismiss();
|
||||
mHelper.saveArticoloToOrdine(mArticolo.getValue(), () -> {
|
||||
this.onLoadingEnded();
|
||||
this.dismiss();
|
||||
}, e -> mContext.runOnUiThread(() -> UtilityExceptions.defaultException(mContext, e)));
|
||||
}
|
||||
|
||||
public ArticoloOrdine getArticolo() {
|
||||
return mArticolo;
|
||||
return mArticolo.getValue();
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
mArticolo = null;
|
||||
mDialog.dismiss();
|
||||
}
|
||||
|
||||
protected void openProgress() {
|
||||
mContext.runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
mContext.runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
}
|
||||
});
|
||||
mArticolo.postValue(null);
|
||||
this.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_pv_ordini_acquisto, container, false);
|
||||
mBinding.setViewmodel(this);
|
||||
|
||||
mHelper = new OrdineAcquistoPvHelper(getActivity(), mGrigliaRepository, mArticoloGrigliaRepository, mArticoliOrdineRepository, mOrdineRepository);
|
||||
mHelper = new OrdineAcquistoPvHelper(requireActivity(), mGrigliaRepository, mArticoloGrigliaRepository, mArticoliOrdineRepository, mOrdineRepository);
|
||||
|
||||
init();
|
||||
initRecyclerView();
|
||||
@@ -107,9 +107,9 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
private void init() {
|
||||
|
||||
BarcodeManager.enable();
|
||||
DialogScanLisA.make(getActivity(), mGrigliaRepository, mHelper, griglia -> {
|
||||
DialogScanLisA.make(requireActivity(), mGrigliaRepository, mHelper, griglia -> {
|
||||
if (griglia == null) {
|
||||
if (getActivity() != null) ((IPoppableActivity) getActivity()).pop();
|
||||
((IPoppableActivity) requireActivity()).pop();
|
||||
} else {
|
||||
setGriglia(griglia);
|
||||
}
|
||||
@@ -136,15 +136,15 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
private void fetchOrders() {
|
||||
this.openProgress();
|
||||
|
||||
mOrdineRepository.selectAllOpenOrders(mGriglia, (ordini) -> getActivity().runOnUiThread(() -> {
|
||||
mOrdineRepository.selectAllOpenOrders(mGriglia, (ordini) -> requireActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
setOrdini(ordini);
|
||||
}), (e) -> {
|
||||
this.closeProgress();
|
||||
String errorMessage = e.getMessage();
|
||||
getActivity().runOnUiThread(() -> DialogSimpleMessageView
|
||||
requireActivity().runOnUiThread(() -> DialogSimpleMessageView
|
||||
.makeErrorDialog(new SpannableString(errorMessage), null, null)
|
||||
.show(getActivity().getSupportFragmentManager(), "tag"));
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag"));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -167,29 +167,22 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
private void initRecyclerView() {
|
||||
mBinding.ordiniAApertiMainList.setHasFixedSize(true);
|
||||
|
||||
mBinding.ordiniAApertiMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
mBinding.ordiniAApertiMainList.setLayoutManager(new LinearLayoutManager(requireActivity()));
|
||||
|
||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(getActivity(), SimpleDividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.divider));
|
||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(requireActivity(), SimpleDividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(requireActivity(), R.drawable.divider));
|
||||
mBinding.ordiniAApertiMainList.addItemDecoration(itemDecorator);
|
||||
mAdapter = new OrdineAcquistoPvOpenListAdapter(getActivity(), mRenderedOrderList, this::selectAction);
|
||||
mAdapter = new OrdineAcquistoPvOpenListAdapter(requireActivity(), mRenderedOrderList, this::selectAction);
|
||||
mBinding.ordiniAApertiMainList.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
private void editOrdine(Ordine ordine) {
|
||||
|
||||
Intent myIntent = new Intent(getActivity(), PVOrdineAcquistoEditActivity.class);
|
||||
|
||||
String keyOrdine = DataCache.addItem(ordine);
|
||||
myIntent.putExtra("keyOrdine", keyOrdine);
|
||||
|
||||
getActivity().startActivity(myIntent);
|
||||
|
||||
requireActivity().startActivity(PVOrdineAcquistoEditActivity.newInstance(requireActivity(),ordine));
|
||||
}
|
||||
|
||||
|
||||
private void selectAction(Ordine ordine) {
|
||||
getActivity().runOnUiThread(() -> DialogAskAction.make(getActivity(),
|
||||
requireActivity().runOnUiThread(() -> DialogAskAction.make(requireActivity(),
|
||||
Html.fromHtml(String.format(this.getString(R.string.ord_acq_testata), String.valueOf(ordine.getOrdineId()), UtilityDate.formatDate(ordine.getDataIns(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN))).toString(),
|
||||
ordine.getCountArticoli() + " articoli",
|
||||
() -> this.editOrdine(ordine),
|
||||
@@ -200,20 +193,20 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
private void deleteOrdine(Ordine ordine) {
|
||||
String text = "Stai per eliminare un ordine sei sicuro?";
|
||||
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(Html.fromHtml(text)), null, () -> getActivity().runOnUiThread(() -> {
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(Html.fromHtml(text)), null, () -> requireActivity().runOnUiThread(() -> {
|
||||
this.openProgress();
|
||||
mHelper.deleteOrder(ordine, () -> {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
Toast.makeText(getActivity(), "Ordine eliminato!", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(requireActivity(), "Ordine eliminato!", Toast.LENGTH_SHORT).show();
|
||||
fetchOrders();
|
||||
});
|
||||
}, e -> {
|
||||
this.closeProgress();
|
||||
getActivity().runOnUiThread(() -> UtilityExceptions.defaultException(getActivity(), e));
|
||||
requireActivity().runOnUiThread(() -> UtilityExceptions.defaultException(requireActivity(), e));
|
||||
});
|
||||
}), () -> {
|
||||
}).show(getActivity().getSupportFragmentManager(), "tag");
|
||||
}).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
private void refreshRenderedOrdini(List<OrdineWrapper> ordini) {
|
||||
@@ -225,9 +218,9 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
this.openProgress();
|
||||
mHelper.createNewOrder(mGriglia, order -> {
|
||||
this.closeProgress();
|
||||
getActivity().runOnUiThread(() -> editOrdine(order));
|
||||
}, e -> getActivity().runOnUiThread(() -> {
|
||||
UtilityExceptions.defaultException(getActivity(), e);
|
||||
requireActivity().runOnUiThread(() -> editOrdine(order));
|
||||
}, e -> requireActivity().runOnUiThread(() -> {
|
||||
UtilityExceptions.defaultException(requireActivity(), e);
|
||||
this.closeProgress();
|
||||
}
|
||||
));
|
||||
@@ -261,15 +254,15 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
||||
}
|
||||
|
||||
protected void openProgress() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(requireActivity());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.ui.filter_chips;
|
||||
public class FilterChipDTO {
|
||||
|
||||
private int ID;
|
||||
private int posizione;
|
||||
private String filterChipText;
|
||||
private FilterLayoutView filterLayoutView;
|
||||
|
||||
@@ -32,4 +33,13 @@ public class FilterChipDTO {
|
||||
this.filterLayoutView = filterLayoutView;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public FilterChipDTO setPosizione(int posizione) {
|
||||
this.posizione = posizione;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import it.integry.integrywmsnative.databinding.DialogInputGeneralBinding;
|
||||
public class DialogSimpleInputHelper {
|
||||
|
||||
|
||||
private static Dialog makeBase(Context mContext, String titleText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
||||
private static Dialog makeBase(Context mContext, String titleText, String valueText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
||||
Dialog dialog = new Dialog(mContext);
|
||||
DialogSimpleInputViewModel viewModel = new DialogSimpleInputViewModel(dialog);
|
||||
|
||||
@@ -39,6 +39,9 @@ public class DialogSimpleInputHelper {
|
||||
|
||||
//Title VIEW
|
||||
mBinding.titleText.setText(titleText);
|
||||
if (valueText != null){
|
||||
mBinding.generalInput.setText(valueText);
|
||||
}
|
||||
ColorStateList colorStateList = ColorStateList.valueOf(Color.WHITE);
|
||||
|
||||
//Content View
|
||||
@@ -56,6 +59,18 @@ public class DialogSimpleInputHelper {
|
||||
|
||||
return makeBase(mContext,
|
||||
title,
|
||||
null,
|
||||
onPositiveClick,
|
||||
onNegativeClick);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Dialog makeInputDialog(Context mContext, String title,String value, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
||||
|
||||
return makeBase(mContext,
|
||||
title,
|
||||
value,
|
||||
onPositiveClick,
|
||||
onNegativeClick);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
|
||||
@@ -27,10 +28,14 @@ public class DialogInputQuantityV2DTO {
|
||||
private BigDecimal qtaCnfAvailable;
|
||||
|
||||
private boolean canPartitaMagBeChanged = true;
|
||||
private boolean isDataScadMandatory = false;
|
||||
private boolean isNotesAllowed = false;
|
||||
private boolean canLUBeClosed;
|
||||
|
||||
private String partitaMag;
|
||||
private String note;
|
||||
private Date dataScad;
|
||||
private RunnableArgsWithReturn<DialogInputQuantityV2ViewModel,String> suggestPartitaMag;
|
||||
|
||||
private boolean canOverflowOrderQuantity;
|
||||
|
||||
@@ -178,6 +183,15 @@ public class DialogInputQuantityV2DTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
@@ -195,4 +209,31 @@ public class DialogInputQuantityV2DTO {
|
||||
this.canOverflowOrderQuantity = canOverflowOrderQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setDataScadMandatory(boolean dataScadMandatory) {
|
||||
isDataScadMandatory = dataScadMandatory;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDataScadMandatory() {
|
||||
return isDataScadMandatory ;
|
||||
}
|
||||
|
||||
public boolean isNotesAllowed() {
|
||||
return isNotesAllowed;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setNotesAllowed(boolean notesAllowed) {
|
||||
isNotesAllowed = notesAllowed;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> getSuggestPartitaMag() {
|
||||
return suggestPartitaMag;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setSuggestPartitaMag(RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> suggestPartitaMag) {
|
||||
this.suggestPartitaMag = suggestPartitaMag;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Date;
|
||||
public class DialogInputQuantityV2ResultDTO {
|
||||
|
||||
private String partitaMag;
|
||||
private String note;
|
||||
private Date dataScad;
|
||||
|
||||
private BigDecimal numCnf;
|
||||
@@ -21,6 +22,15 @@ public class DialogInputQuantityV2ResultDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ResultDTO setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
private Runnable mOnAbort;
|
||||
|
||||
public ObservableField<String> currentPartitaMag = new ObservableField<>();
|
||||
public ObservableField<String> currentNotes = new ObservableField<>();
|
||||
public ObservableField<Date> currentDataScad = new ObservableField<>();
|
||||
|
||||
public ObservableField<BigDecimal> currentNumCnf = new ObservableField<>();
|
||||
@@ -67,6 +68,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
public ObservableField<Boolean> enabledQtaTot = new ObservableField<>(true);
|
||||
|
||||
public ObservableField<Boolean> enabledChangePartitaMag = new ObservableField<>(true);
|
||||
public ObservableField<Boolean> enabledNotes = new ObservableField<>(false);
|
||||
public ObservableField<Boolean> enabledLUCloseButton = new ObservableField<>(true);
|
||||
|
||||
private Context context;
|
||||
@@ -127,6 +129,8 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
.setCanOverflowOrderQuantity(mDialogInputQuantityV2DTO.isCanOverflowOrderQuantity())
|
||||
.setQtaCnfAvailable(mDialogInputQuantityV2DTO.getQtaCnfAvailable())
|
||||
.setPartitaMag(mDialogInputQuantityV2DTO.getPartitaMag())
|
||||
.setNote(mDialogInputQuantityV2DTO.getNote())
|
||||
.setSuggestPartitaMagRunnable(mDialogInputQuantityV2DTO.getSuggestPartitaMag())
|
||||
.setDataScad(mDialogInputQuantityV2DTO.getDataScad());
|
||||
|
||||
mBindings.setView(this);
|
||||
@@ -196,6 +200,12 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
}
|
||||
});
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.currentNotes, (value) -> {
|
||||
if (this.mEnableDataCallback) {
|
||||
this.mViewModel.setNote(value);
|
||||
}
|
||||
});
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.currentDataScad, (value) -> {
|
||||
if (this.mEnableDataCallback) {
|
||||
this.mViewModel.setDataScad(value);
|
||||
@@ -326,6 +336,8 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
|
||||
this.mViewModel.setCanPartitaMagBeChanged(this.mDialogInputQuantityV2DTO.isCanPartitaMagBeChanged());
|
||||
this.enabledChangePartitaMag.set(this.mDialogInputQuantityV2DTO.isCanPartitaMagBeChanged());
|
||||
this.mViewModel.shouldAskDataScad = this.mDialogInputQuantityV2DTO.isDataScadMandatory();
|
||||
this.enabledNotes.set(this.mDialogInputQuantityV2DTO.isNotesAllowed());
|
||||
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
|
||||
}
|
||||
|
||||
@@ -350,6 +362,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
this.mEnableDataCallback = false;
|
||||
|
||||
this.currentPartitaMag.set(this.mViewModel.getPartitaMag());
|
||||
this.currentNotes.set(this.mViewModel.getNote());
|
||||
this.currentDataScad.set(this.mViewModel.getDataScad());
|
||||
|
||||
this.currentNumCnf.set(this.mViewModel.getNumCnf());
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.Date;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
@@ -59,8 +60,11 @@ public class DialogInputQuantityV2ViewModel {
|
||||
private BigDecimal internalQtaTot;
|
||||
|
||||
private String internalPartitaMag;
|
||||
private String internalNote;
|
||||
private Date internalDataScad;
|
||||
|
||||
private RunnableArgsWithReturn<DialogInputQuantityV2ViewModel,String> suggestPartitaMagRunnable;
|
||||
|
||||
private boolean canOverflowOrderQuantity;
|
||||
private boolean canPartitaMagBeChanged;
|
||||
private int onNumCnfInputChanged;
|
||||
@@ -98,8 +102,10 @@ public class DialogInputQuantityV2ViewModel {
|
||||
this.internalQtaTot = totalQtaOrd;
|
||||
}
|
||||
|
||||
this.shouldAskDataScad = mtbAart.get().isFlagTracciabilitaBoolean() && mtbAart.get().getGgScadPartita() != null && mtbAart.get().getGgScadPartita() > 0;
|
||||
this.shouldShowDataScad = this.internalDataScad != null;
|
||||
if (this.shouldAskDataScad == null){
|
||||
this.shouldAskDataScad = mtbAart.get().isFlagTracciabilitaBoolean() && mtbAart.get().getGgScadPartita() != null && mtbAart.get().getGgScadPartita() > 0;
|
||||
}
|
||||
this.shouldShowDataScad = this.shouldAskDataScad || this.internalDataScad != null;
|
||||
|
||||
this.blockedNumCnf.set(false);
|
||||
this.blockedQtaCnf.set(false);
|
||||
@@ -194,6 +200,10 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return internalPartitaMag;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return internalNote;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return internalDataScad;
|
||||
}
|
||||
@@ -285,6 +295,10 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean canPartitaMagBeChanged() {
|
||||
return canPartitaMagBeChanged;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setPartitaMag(String internalPartitaMag) {
|
||||
this.internalPartitaMag = internalPartitaMag;
|
||||
return this;
|
||||
@@ -389,9 +403,16 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return false;
|
||||
|
||||
} else if (mtbAart.get().isFlagTracciabilitaBoolean() && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||
|
||||
this.mListener.onError(new InvalidBatchLotException());
|
||||
return false;
|
||||
if (suggestPartitaMagRunnable != null){
|
||||
internalPartitaMag = suggestPartitaMagRunnable.run(this);
|
||||
if (internalPartitaMag == null){
|
||||
this.mListener.onError(new InvalidBatchLotException());
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
this.mListener.onError(new InvalidBatchLotException());
|
||||
return false;
|
||||
}
|
||||
|
||||
} else if (this.shouldAskDataScad && UtilityString.isNullOrEmpty(internalPartitaMag)) {
|
||||
|
||||
@@ -445,6 +466,7 @@ public class DialogInputQuantityV2ViewModel {
|
||||
.setDataScad(this.internalDataScad)
|
||||
.setNumCnf(this.internalNumCnf)
|
||||
.setQtaCnf(this.internalQtaCnf)
|
||||
.setNote(this.internalNote)
|
||||
.setQtaTot(this.internalQtaTot);
|
||||
|
||||
}
|
||||
@@ -453,6 +475,16 @@ public class DialogInputQuantityV2ViewModel {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setNote(String value) {
|
||||
this.internalNote = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setSuggestPartitaMagRunnable(RunnableArgsWithReturn<DialogInputQuantityV2ViewModel,String> suggestPartitaMagRunnable) {
|
||||
this.suggestPartitaMagRunnable = suggestPartitaMagRunnable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface Listener {
|
||||
void onDataChanged();
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<vector
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path
|
||||
android:pathData="M39,16v25c0,1.105-0.895,2-2,2H11c-1.105,0-2-0.895-2-2V7c0-1.105,0.895-2,2-2h17l3,8L39,16z"
|
||||
android:fillColor="#50e6ff" />
|
||||
<path
|
||||
android:pathData="M28,5v9c0,1.105,0.895,2,2,2h9L28,5z"
|
||||
android:fillColor="#297cd2" />
|
||||
<path
|
||||
android:pathData="M32.5,24h-17c-0.276,0-0.5-0.224-0.5-0.5v-1c0-0.276,0.224-0.5,0.5-0.5h17c0.276,0,0.5,0.224,0.5,0.5 v1C33,23.776,32.776,24,32.5,24z"
|
||||
android:fillColor="#057093" />
|
||||
<path
|
||||
android:pathData="M30.5,28h-15c-0.276,0-0.5-0.224-0.5-0.5v-1c0-0.276,0.224-0.5,0.5-0.5h15c0.276,0,0.5,0.224,0.5,0.5 v1C31,27.776,30.776,28,30.5,28z"
|
||||
android:fillColor="#057093" />
|
||||
<path
|
||||
android:pathData="M32.5,32h-17c-0.276,0-0.5-0.224-0.5-0.5v-1c0-0.276,0.224-0.5,0.5-0.5h17c0.276,0,0.5,0.224,0.5,0.5 v1C33,31.776,32.776,32,32.5,32z"
|
||||
android:fillColor="#057093" />
|
||||
<path
|
||||
android:pathData="M30.5,36h-15c-0.276,0-0.5-0.224-0.5-0.5v-1c0-0.276,0.224-0.5,0.5-0.5h15c0.276,0,0.5,0.224,0.5,0.5 v1C31,35.776,30.776,36,30.5,36z"
|
||||
android:fillColor="#057093" />
|
||||
</vector>
|
||||
@@ -409,6 +409,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? 1f : 2f}"
|
||||
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
|
||||
android:enabled="@{view.enabledChangePartitaMag}"
|
||||
android:paddingEnd="4dp"
|
||||
tools:layout_weight="1">
|
||||
@@ -528,6 +529,36 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_note_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.enabledNotes}"
|
||||
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
|
||||
>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_note_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_additional_notes"
|
||||
android:inputType="textMultiLine"
|
||||
app:binding="@{view.currentNotes}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
|
||||
368
app/src/main/res/layout/activity_contab_doc_interni_edit.xml
Normal file
368
app/src/main/res/layout/activity_contab_doc_interni_edit.xml
Normal file
@@ -0,0 +1,368 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:fab="http://schemas.android.com/apk/res-auto">
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormViewModel" />
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/full_white"
|
||||
android:orientation="vertical"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/full_white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp"
|
||||
>
|
||||
|
||||
<it.integry.integrywmsnative.ui.ElevatedToolbar
|
||||
android:id="@+id/elevated_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="@string/edit_doc"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
||||
android:layout_gravity="start" />
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/add_extra_items_toolbar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end"
|
||||
android:background="@drawable/ripple_effect"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_search_black_24dp"
|
||||
android:onClick="@{()->view.manualSearch()}"
|
||||
android:tint="@color/colorPrimaryGray"/>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</it.integry.integrywmsnative.ui.ElevatedToolbar>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:background="@drawable/gray_detail_background_round8"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/document_label"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/order_identifier"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:binding="@{view.documentHeader}"
|
||||
tools:text="#documentId" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/doc_type"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_dtip"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textStyle="italic"
|
||||
app:binding="@{view.codDtip}"
|
||||
tools:text="CodDtip" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/mtb_grup_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/art_group"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mgrp"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="italic"
|
||||
app:binding="@{view.codMgrp}"
|
||||
tools:text="CodMgrp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/doc_rif_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/document_rif_label"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/document_rif"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:binding="@{view.documentRifHeader}"
|
||||
tools:text="#documentId" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/supplier_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fornitore"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_anag"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textStyle="italic"
|
||||
app:binding="@{view.codAnag}"
|
||||
tools:text="F000 - 01" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/prod_count"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/count_art_ord"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="4dp"
|
||||
app:binding="@{view.prodsCount}"
|
||||
tools:text="10" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/document_rows_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="92dp"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp" />
|
||||
<LinearLayout
|
||||
android:id="@+id/scan_art_spinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="24dp"
|
||||
android:visibility="visible"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_horizontal"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:text="@string/scan_item"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.github.clans.fab.FloatingActionMenu
|
||||
android:id="@+id/close_activity_fab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_anchor="@+id/linearLayout2"
|
||||
app:layout_anchorGravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:menu_icon="@drawable/ic_menu_24dp"
|
||||
fab:menu_animationDelayPerItem="50"
|
||||
fab:menu_backgroundColor="@color/white_bg_alpha"
|
||||
fab:menu_buttonSpacing="0dp"
|
||||
fab:menu_colorNormal="@color/success_color"
|
||||
fab:menu_colorPressed="@color/green_400"
|
||||
fab:menu_labels_colorNormal="@color/white"
|
||||
fab:menu_labels_colorPressed="@color/white_pressed"
|
||||
fab:menu_labels_colorRipple="#66FFFFFF"
|
||||
fab:menu_labels_cornerRadius="3dp"
|
||||
fab:menu_labels_hideAnimation="@anim/fab_slide_out_to_right"
|
||||
fab:menu_labels_margin="0dp"
|
||||
fab:menu_labels_padding="8dp"
|
||||
fab:menu_labels_paddingBottom="4dp"
|
||||
fab:menu_labels_paddingLeft="8dp"
|
||||
fab:menu_labels_paddingRight="8dp"
|
||||
fab:menu_labels_paddingTop="4dp"
|
||||
fab:menu_labels_position="left"
|
||||
fab:menu_labels_showAnimation="@anim/fab_slide_in_from_right"
|
||||
fab:menu_labels_showShadow="true"
|
||||
fab:menu_labels_textColor="@color/black_semi_transparent"
|
||||
fab:menu_labels_textSize="18sp"
|
||||
fab:menu_openDirection="up"
|
||||
fab:menu_shadowColor="#66000000"
|
||||
fab:menu_shadowRadius="4dp"
|
||||
fab:menu_shadowXOffset="1dp"
|
||||
fab:menu_shadowYOffset="3dp"
|
||||
fab:menu_showShadow="true">
|
||||
|
||||
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:id="@+id/export_document"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_black_upload"
|
||||
android:visibility="@{view.isDocumentExportable.get() ? View.VISIBLE : View.GONE}"
|
||||
app:fab_colorNormal="@color/white"
|
||||
app:fab_colorPressed="@color/white_pressed"
|
||||
app:fab_colorRipple="#66FFFFFF"
|
||||
app:onClick="@{() -> viewModel.exportDocument()}"
|
||||
fab:fab_label="@string/export_document" />
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:id="@+id/delete_document"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_delete_24dp"
|
||||
app:fab_colorNormal="@color/white"
|
||||
app:fab_colorPressed="@color/white_pressed"
|
||||
app:fab_colorRipple="#66FFFFFF"
|
||||
app:onClick="@{() -> viewModel.deleteDocument()}"
|
||||
fab:fab_label="@string/delete_document" />
|
||||
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:id="@+id/save_document"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_check_black_24dp"
|
||||
android:visibility="visible"
|
||||
app:fab_colorNormal="@color/white"
|
||||
app:fab_colorPressed="@color/white_pressed"
|
||||
app:fab_colorRipple="#66FFFFFF"
|
||||
app:onClick="@{() -> viewModel.holdDocument()}"
|
||||
fab:fab_label="@string/save_document" />
|
||||
|
||||
|
||||
</com.github.clans.fab.FloatingActionMenu>
|
||||
<View
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit__background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:visibility="gone"
|
||||
android:clickable="true"
|
||||
android:focusable="true"/>
|
||||
|
||||
<it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:layout_behavior=".view.bottom_sheet__base.AutoCloseBottomSheetBehavior" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@+id/qta_box"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.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="1"
|
||||
android:text="@{item.descrizione}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
tools:text="Descrizione lunga item" />
|
||||
|
||||
|
||||
<!--<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_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge1_round_corner"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@{UtilityNumber.decimalToString(item.qtaCol) + `\n` + item.untMis}"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="280.45\nCONF" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</layout>
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
@@ -6,7 +7,9 @@
|
||||
<data>
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityBigDecimal" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
@@ -51,15 +54,34 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
|
||||
android:layout_width="wrap_content"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:text="@{viewmodel.mtbAart.codMart}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
tools:text="COD MART (Partita mag)" />
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@id/unt_mis"
|
||||
android:ellipsize="end"
|
||||
android:text="@{viewmodel.mtbAart.codMart}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
tools:text="COD MART (Partita mag)" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
|
||||
android:id="@+id/unt_mis"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:visibility="@{viewmodel.mtbAart.untMis != null ? View.VISIBLE : View.GONE}"
|
||||
android:text="@{viewmodel.mtbAart.untMis}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
tools:text="UM" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@@ -67,9 +89,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:text="@{viewmodel.mtbAart.diacod}"
|
||||
android:textColor="@color/red_600"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(viewmodel.mtbAart.diacod) ? View.GONE : View.VISIBLE}"
|
||||
android:text="@{viewmodel.mtbAart.diacod}"
|
||||
tools:text="DIACOD" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@@ -186,8 +208,8 @@
|
||||
android:background="@drawable/badge_gray_round_corner"
|
||||
android:backgroundTint="@color/green_600"
|
||||
android:orientation="vertical"
|
||||
android:visibility="@{viewmodel.totalNumCnfToBeTaken != null || viewmodel.totalQtaToBeTaken != null ? View.VISIBLE : View.GONE}"
|
||||
android:padding="8dp">
|
||||
android:padding="8dp"
|
||||
android:visibility="@{viewmodel.totalNumCnfToBeTaken != null || viewmodel.totalQtaToBeTaken != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@@ -225,7 +247,6 @@
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -233,7 +254,6 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -325,7 +345,6 @@
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -333,8 +352,6 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -402,8 +419,9 @@
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.enabledChangePartitaMag}"
|
||||
android:layout_weight="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? 1f : 2f}"
|
||||
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
|
||||
android:enabled="@{view.enabledChangePartitaMag}"
|
||||
android:paddingEnd="4dp"
|
||||
tools:layout_weight="1">
|
||||
|
||||
@@ -413,9 +431,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/batch_lot"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
app:binding="@{view.currentPartitaMag}"
|
||||
android:imeOptions="actionDone" />
|
||||
app:binding="@{view.currentPartitaMag}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@@ -424,21 +442,21 @@
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="@{view.enabledChangePartitaMag}"
|
||||
android:visibility="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? View.VISIBLE : View.GONE}"
|
||||
android:layout_weight="1">
|
||||
android:visibility="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_data_scad_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/expire_date"
|
||||
android:focusableInTouchMode="false"
|
||||
android:hint="@string/expire_date"
|
||||
android:inputType="text"
|
||||
app:binding="@{view.currentDataScad}"
|
||||
app:warningOnOldDates="@{true}"
|
||||
app:parentView="@{view}"
|
||||
android:inputType="text" />
|
||||
app:warningOnOldDates="@{true}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@@ -458,9 +476,9 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="@{!viewmodel.mtbAart.flagQtaCnfFissaBoolean ? 1f : 1.5f}"
|
||||
android:paddingEnd="4dp"
|
||||
android:focusableInTouchMode="false"
|
||||
android:enabled="@{view.enabledNumCnf}"
|
||||
android:focusableInTouchMode="false"
|
||||
android:paddingEnd="4dp"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@@ -469,9 +487,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/num_pcks"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.currentNumCnf}"
|
||||
android:imeOptions="actionDone" />
|
||||
app:binding="@{view.currentNumCnf}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@@ -481,9 +499,9 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingEnd="4dp"
|
||||
android:focusableInTouchMode="false"
|
||||
android:enabled="@{view.enabledQtaCnf}"
|
||||
android:focusableInTouchMode="false"
|
||||
android:paddingEnd="4dp"
|
||||
android:visibility="@{!viewmodel.mtbAart.flagQtaCnfFissaBoolean ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@@ -492,9 +510,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/qty_x_pck"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
app:binding="@{view.currentQtaCnf}"
|
||||
android:imeOptions="actionDone" />
|
||||
app:binding="@{view.currentQtaCnf}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@@ -506,16 +524,16 @@
|
||||
android:layout_weight="@{!viewmodel.mtbAart.flagQtaCnfFissaBoolean ? 1f : 1.5f}"
|
||||
android:enabled="@{view.enabledQtaTot}"
|
||||
android:focusableInTouchMode="false"
|
||||
tools:layout_weight="1"
|
||||
android:imeOptions="actionDone">
|
||||
android:imeOptions="actionDone"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_qta_tot_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/tot_qty"
|
||||
android:digits="0123456789"
|
||||
android:hint="@string/tot_qty"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.currentQtaTot}" />
|
||||
|
||||
@@ -527,10 +545,40 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1"
|
||||
android:gravity="center_horizontal">
|
||||
>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_note_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.enabledNotes}"
|
||||
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
|
||||
>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_note_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_additional_notes"
|
||||
android:inputType="textMultiLine"
|
||||
app:binding="@{view.currentNotes}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/close_lu_btn"
|
||||
@@ -542,10 +590,10 @@
|
||||
android:layout_weight="0.4"
|
||||
android:onClick="@{() -> view.saveAndCloseLU()}"
|
||||
android:text="@string/action_close_ul"
|
||||
app:visibility="@{view.enabledLUCloseButton}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeColor="@color/colorPrimary" />
|
||||
app:strokeColor="@color/colorPrimary"
|
||||
app:visibility="@{view.enabledLUCloseButton}" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
||||
@@ -10,273 +10,522 @@
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="viewmodel"
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.EditArticoloDialog" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/base_root"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/white">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:titleTextColor="@android:color/white">
|
||||
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/title_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/light_blue_300"
|
||||
android:gravity="center_horizontal">
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@id/unt_mis"
|
||||
android:ellipsize="end"
|
||||
android:text="@{view.articolo.codMart}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
tools:text="020100514" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/unt_mis"
|
||||
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:ellipsize="end"
|
||||
android:text="@{view.articolo.untMis}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
tools:text="KG" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Dialog.DialogSubTitleText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
android:ellipsize="end"
|
||||
android:text="@{view.articolo.descrizione}"
|
||||
android:textColor="@color/red_600"
|
||||
tools:text="BOSCAIOLA DI POLLO" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/dialog_actions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/dialog_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:ellipsize="end"
|
||||
android:text="@string/insert_qty"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/dialog_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:ellipsize="end"
|
||||
android:text="@{viewmodel.articolo.codMart}"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="codMart" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/descr_art"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/cod_mart"
|
||||
android:ellipsize="end"
|
||||
android:text="@{viewmodel.articolo.descrizione}"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="DESCR ART" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
android:text="@string/gg_scadenza"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Unità di misura: "
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="4dp"
|
||||
android:text="@{viewmodel.articolo.untMis}"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="(UM)" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Qta media settimanale: "
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="4dp"
|
||||
android:text='@{UtilityNumber.decimalToString(viewmodel.articolo.mediaSett)}'
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="1150" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Qta per confezione: "
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="4dp"
|
||||
android:text='@{UtilityNumber.decimalToString(viewmodel.articolo.qtaCnf)}'
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="5" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/qta_cnf_label"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_weight="1"
|
||||
app:layout_constraintEnd_toStartOf="@id/guide_right"
|
||||
app:layout_constraintStart_toStartOf="@id/guide_left"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/qta_cnf"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/packages"
|
||||
android:inputType="number"
|
||||
android:selectAllOnFocus="true" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/qta_tot_label"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_weight="1"
|
||||
app:layout_constraintEnd_toStartOf="@id/guide_right"
|
||||
app:layout_constraintStart_toStartOf="@id/guide_left"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/qta_tot"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/quantity"
|
||||
android:inputType="numberDecimal"
|
||||
android:selectAllOnFocus="true" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/center_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/center_guideline"
|
||||
android:onClick="@{()->viewmodel.cancel()}"
|
||||
app:strokeColor="@color/colorPrimary"
|
||||
android:text="@string/abort"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/add_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/center_guideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:focusable="true"
|
||||
android:onClick="@{()->viewmodel.saveAndExit()}"
|
||||
android:text="@string/add"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
android:text='@{String.valueOf(view.articolo.ggScadenza)}'
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="5" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@id/qta_ord_panel"
|
||||
android:text="@string/giacenza"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/qta_ord_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.qtaCnfGiacenza)}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
tools:text="1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/unt_mis_col"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="("
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.giacenza)}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="2dp"
|
||||
android:text="@{view.articolo.untMis}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text=")"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/badge_gray_round_corner"
|
||||
android:backgroundTint="@color/green_600"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/selling_prediction"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.qtaCnfPrevistaVendita)}"
|
||||
tools:text="1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/unt_mis_col"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="("
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.qtaPrevistaVendita)}"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="2dp"
|
||||
android:text="@{view.articolo.untMis}"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text=")"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/badge_gray_round_corner"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp"
|
||||
>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/order_suggestion"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.qtaCnfProposta)}"
|
||||
tools:text="1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/unt_mis_col"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="("
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.qtaProposta)}"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="2dp"
|
||||
android:text="@{view.articolo.untMis}"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text=")"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@color/gray_400" />
|
||||
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_num_cnf_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="false"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_num_cnf_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/num_pcks"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.numCnf}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_qta_cnf_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:paddingEnd="4dp"
|
||||
android:paddingStart="4dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_qta_cnf_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/qty_x_pck"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
app:binding="@{view.qtaCnf}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_qta_tot_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="false"
|
||||
android:imeOptions="actionDone"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_qta_ord"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:digits="0123456789"
|
||||
android:hint="@string/tot_qty"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.qtaOrd}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/abort_btn"
|
||||
style="@style/Button.DangerFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="1"
|
||||
android:onClick="@{() -> view.cancel()}"
|
||||
app:icon="@drawable/ic_close_24dp"
|
||||
app:iconGravity="textStart"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_weight="1"
|
||||
android:onClick="@{() -> view.saveAndExit()}"
|
||||
app:icon="@drawable/ic_save_24"
|
||||
app:iconGravity="textStart"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
175
app/src/main/res/layout/dialog_select_doc_info.xml
Normal file
175
app/src/main/res/layout/dialog_select_doc_info.xml
Normal file
@@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewmodel"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoViewModel" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoView" />
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/TextViewMaterial.DialogTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/dialog_doc_interni_choose_dtip_mgrp_pair_title" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_cod_dtip"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/doc_type">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_cod_dtips"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
app:binding="@{view.codDtip}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_cod_mgrps"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/art_group">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_cod_mgrps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
app:binding="@{view.codMgrp}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_cod_anag_forn"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/fornitore"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_cod_anag_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
app:binding="@{view.codAnag}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_num_doc_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
style="@style/TextInputLayout.OutlineDefault"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_num_doc"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/document_number"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.numDoc}"
|
||||
/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_data_doc_layout"
|
||||
style="@style/TextInputLayout.OutlineDefault"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_data_doc"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="false"
|
||||
android:hint="@string/document_date"
|
||||
android:inputType="text"
|
||||
app:binding="@{view.dataDoc}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_note_layout"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:hint="@string/hint_additional_notes">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_note"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
app:binding="@{view.note}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/positive_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/confirm" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
</layout>
|
||||
@@ -0,0 +1,8 @@
|
||||
<androidx.appcompat.widget.AppCompatTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="?attr/textAppearanceSubtitle1"
|
||||
style="@style/AppTheme.NewMaterial.Text"/>
|
||||
65
app/src/main/res/layout/doc_interni_list_model.xml
Normal file
65
app/src/main/res/layout/doc_interni_list_model.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/doc_description"
|
||||
style="@android:style/TextAppearance.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_toStartOf="@id/data_doc"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/black"
|
||||
tools:text="#1 MOD.114 - PERDITE" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/data_doc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:textColor="@color/colorPrimaryGray"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:textSize="14sp"
|
||||
tools:text="13 Apr"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/num_rows"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@android:style/TextAppearance.Small"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_below="@id/doc_description"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
tools:text="0 Articoli"/>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
324
app/src/main/res/layout/fragment_doc_interni.xml
Normal file
324
app/src/main/res/layout/fragment_doc_interni.xml
Normal file
@@ -0,0 +1,324 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="androidx.databinding.ObservableList" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniFragment" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniViewModel" />
|
||||
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/full_white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:background="@drawable/gray_detail_background_round8"
|
||||
android:orientation="vertical"
|
||||
android:onClick="@{() -> view.selectDocInfo()}"
|
||||
android:padding="16dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/cod_dtip_name"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_dtip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.dtbTipi.codDtip}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="114" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/desc_tipo_doc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@{viewModel.dtbTipi.descrizione}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="PERDITA" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/mtb_grp_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/cod_mgrp_name"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mgrp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.mtbGrup.codMgrp}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="06" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/desc_group_art"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@{viewModel.mtbGrup.descrizione}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textStyle="bold"
|
||||
tools:text="FOOD" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/cod_anag_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/cod_anag_name"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_anag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.fornitore.label}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="F0000 - CARELLI" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/doc_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/document_label"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/document"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="n. 123 del 12/11/2021" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/articoli_disponibili"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/count_arts"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:binding="@{viewModel.artsSize}"
|
||||
tools:text="0" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/doc_interni_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@color/full_white"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/doc_interni_empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.2" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.15" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.85" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/no_doc_found_message"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/free_picking__suggestion_1__guideline_top"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.3" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/free_picking__suggestion_1__guideline_left"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.2" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/free_picking__suggestion_1__guideline_right"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.8" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/main_fab"
|
||||
style="@style/Widget.MaterialComponents.FloatingActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:onClick="@{() -> viewModel.newDocument()}"
|
||||
android:tint="@android:color/white"
|
||||
android:visibility="invisible"
|
||||
app:srcCompat="@drawable/ic_add_24dp" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
</layout>
|
||||
@@ -103,8 +103,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toEndOf="@id/peso_lordo_collo"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_toEndOf="@id/peso_lordo_collo"
|
||||
android:text="@{mtbColt.timeVers}"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:textColor="@android:color/black"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<string name="ord_acq_testata"><![CDATA[N° <b>%s</b> del <b>%s</b>]]></string>
|
||||
<string name="ord_ven_testata"><![CDATA[N° <b>%s</b> del <b>%s</b>]]></string>
|
||||
<string name="ord_testata"><![CDATA[N° <b>%s</b> del <b>%s</b>]]></string>
|
||||
<string name="doc_testata"><![CDATA[N° <b>%s</b> del <b>%s</b>]]></string>
|
||||
<string name="ord_ven_testata_data_cons"><![CDATA[Cons <b>%s</b>]]></string>
|
||||
<string name="search">Cerca…</string>
|
||||
<string name="login">Login</string>
|
||||
@@ -216,6 +217,7 @@
|
||||
<string name="start_date">Data inizio</string>
|
||||
<string name="end_date">Data fine</string>
|
||||
<string name="document_date">Data documento</string>
|
||||
<string name="document_number">Numero documento</string>
|
||||
<string name="terms_of_delivery">Termini di consegna</string>
|
||||
<string name="vehicle">Automezzo</string>
|
||||
<string name="city">Paese</string>
|
||||
@@ -340,4 +342,30 @@
|
||||
<string name="use">Usa</string>
|
||||
<string name="back">Indietro</string>
|
||||
<string name="rientro_merce_fragment_title">Rientro merce</string>
|
||||
<string name="title_dynamic_gramm">Personalizzazioni Gramm</string>
|
||||
<string name="title_dynamic_agricoper">Personalizzazioni Agricoper</string>
|
||||
<string name="title_dynamicfeature">Titolo Modulo</string>
|
||||
<string name="doc_interni">Documenti interni</string>
|
||||
<string name="doc_interni_num_arts_doc"><![CDATA[#<b>%d</b> articoli]]></string>
|
||||
<string name="doc_interni_doc_header"><![CDATA[DL #<b>%d_%s</b>]]></string>
|
||||
<string name="dialog_doc_interni_choose_dtip_mgrp_pair_title">Seleziona estremi documento</string>
|
||||
<string name="doc_type">Tipo documento</string>
|
||||
<string name="art_group">Gruppo articolo</string>
|
||||
<string name="cod_dtip_name">Tipo doc.</string>
|
||||
<string name="cod_mgrp_name">Gruppo art.</string>
|
||||
<string name="articoli_disponibili">Articoli disponibili</string>
|
||||
<string name="no_doc_found_message">Nessun documento trovato</string>
|
||||
<string name="document_label">Documento:</string>
|
||||
<string name="prod_count">Numero articoli:</string>
|
||||
<string name="edit_doc">Modifica documento</string>
|
||||
<string name="export_document">Esporta documento</string>
|
||||
<string name="save_document">Salva documento</string>
|
||||
<string name="fornitore">Fornitore</string>
|
||||
<string name="cod_anag_name">Fornitore</string>
|
||||
<string name="delete_document">Elimina documento</string>
|
||||
<string name="document_rif_label">Documento rif. :</string>
|
||||
<string name="gg_scadenza">Shelf life:</string>
|
||||
<string name="selling_prediction">Previsione di vendita</string>
|
||||
<string name="giacenza">Giacenza</string>
|
||||
<string name="order_suggestion">Qtà proposta</string>
|
||||
</resources>
|
||||
@@ -30,5 +30,6 @@
|
||||
<item name="nav_prod_rientro_merce" type="id"/>
|
||||
<item name="nav_settings" type="id" />
|
||||
<item name="nav_logout" type="id" />
|
||||
<item name="nav_pv_doc_interni" type="id" />
|
||||
|
||||
</resources>
|
||||
@@ -51,6 +51,7 @@
|
||||
<string name="ord_acq_testata"><![CDATA[#<b>%s</b> of <b>%s</b>]]></string>
|
||||
<string name="ord_ven_testata"><![CDATA[#<b>%s</b> of <b>%s</b>]]></string>
|
||||
<string name="ord_testata"><![CDATA[#<b>%s</b> of <b>%s</b>]]></string>
|
||||
<string name="doc_testata"><![CDATA[#<b>%s</b> of <b>%s</b>]]></string>
|
||||
<string name="ord_ven_testata_data_cons"><![CDATA[Ship <b>%s</b>]]></string>
|
||||
<string name="accettazione_title_fragment">Check in</string>
|
||||
<string name="accettazione_ordine_inevaso_title_empty">Check in order</string>
|
||||
@@ -219,6 +220,7 @@
|
||||
<string name="start_date">Start date</string>
|
||||
<string name="end_date">End date</string>
|
||||
<string name="document_date">Document date</string>
|
||||
<string name="document_number">Document number</string>
|
||||
<string name="terms_of_delivery">Terms of delivery</string>
|
||||
<string name="vehicle">Vehicle</string>
|
||||
<string name="city">City</string>
|
||||
@@ -350,4 +352,27 @@
|
||||
<string name="rientro_merce_fragment_title">Ret of processing goods</string>
|
||||
<string name="title_dynamic_agricoper">Agricoper customizations</string>
|
||||
<string name="title_dynamicfeature">Module Title</string>
|
||||
<string name="doc_interni">Internal Docs</string>
|
||||
<string name="doc_interni_num_arts_doc"><![CDATA[#<b>%d</b> items]]></string>
|
||||
<string name="doc_interni_doc_header"><![CDATA[DL #<b>%d_%s</b>]]></string>
|
||||
<string name="dialog_doc_interni_choose_dtip_mgrp_pair_title">Choose Document details</string>
|
||||
<string name="doc_type">Document type</string>
|
||||
<string name="art_group">Product group</string>
|
||||
<string name="cod_dtip_name">Doc type</string>
|
||||
<string name="cod_mgrp_name">Product group</string>
|
||||
<string name="articoli_disponibili">Available products</string>
|
||||
<string name="no_doc_found_message">No document found</string>
|
||||
<string name="document_label">Document:</string>
|
||||
<string name="prod_count">Products count:</string>
|
||||
<string name="edit_doc">Edit document</string>
|
||||
<string name="export_document">Export document</string>
|
||||
<string name="save_document">Save document</string>
|
||||
<string name="fornitore">Supplier</string>
|
||||
<string name="cod_anag_name">Supplier</string>
|
||||
<string name="delete_document">Elimina documento</string>
|
||||
<string name="document_rif_label">Reference doc.:</string>
|
||||
<string name="gg_scadenza">Shelf life:</string>
|
||||
<string name="selling_prediction">Sales prediction</string>
|
||||
<string name="giacenza">Stock</string>
|
||||
<string name="order_suggestion">Suggested Qty</string>
|
||||
</resources>
|
||||
|
||||
@@ -17,4 +17,10 @@
|
||||
<item name="android:textColor">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="TextInputLayout.OutlineDefault" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
|
||||
<item name="fontFamily">@font/product_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||
<item name="android:textColorHint">@color/half_black</item>
|
||||
<item name="boxStrokeColor">@color/colorPrimary</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user