Commit 864e76ea401009d4a705bf92db0c7a130678f024

Authored by Mauricio Sanchez
1 parent d1857acb65
Exists in master

20102020 1600

Showing 90 changed files with 6377 additions and 1773 deletions   Show diff stats
... ... @@ -0,0 +1,6 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="CompilerConfiguration">
  4 + <bytecodeTargetLevel target="11" />
  5 + </component>
  6 +</project>
0 7 \ No newline at end of file
... ... @@ -16,6 +16,7 @@
16 16 </set>
17 17 </option>
18 18 <option name="resolveModulePerSourceSet" value="false" />
  19 + <option name="useQualifiedModuleNames" value="true" />
19 20 </GradleProjectSettings>
20 21 </option>
21 22 </component>
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <project version="4">
3   - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="11" project-jdk-type="JavaSDK">
  3 + <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
4 4 <output url="file://$PROJECT_DIR$/build/classes" />
5 5 </component>
6 6 <component name="ProjectType">
... ... @@ -0,0 +1,11 @@
  1 +ITOMINVC.EST="T"
  2 +ITOMINVC.FEC="2020-09-30 12:18:00" fecha de exportacion
  3 +
  4 +
  5 +ITOMINVD.CON="2" EL VALOR CONTADO EN EL DISPOSITIVO
  6 +ITOMINVD.CON="-1" SI NO SE PUSO NINGUN VALOR O SEA SI NO SE CONTO
  7 +ITOMINVD.FECTOM="2020-09-30 12:16:00" FECHA Y HORA EN LA QUE SE TOMO
  8 +ITOMINVD.FECTOMFIN="2020-09-30 12:16:00" FECHA Y HORA SI SE MODIFICO LO TOMADO
  9 +
  10 +
  11 +
Guardar Cabecera de Inventarios Sectorizados.docx
No preview for this file type
Guardar Cuerpo de Inventarios Sectorizados.docx
No preview for this file type
Obtener Cabecera de Inventarios Sectorizados.docx
No preview for this file type
Obtener cuerpo de Inventarios Sectorizados.docx
No preview for this file type
[VI_API_ARTICULOS_INVENTARIO].txt
... ... @@ -0,0 +1,23 @@
  1 +USE [ZUCCO_PILOTO_FMT_2B]
  2 +GO
  3 +
  4 +/****** Object: View [dbo].[VI_API_ARTICULOS_INVENTARIO] Script Date: 10/20/2020 11:15:17 ******/
  5 +SET ANSI_NULLS ON
  6 +GO
  7 +
  8 +SET QUOTED_IDENTIFIER ON
  9 +GO
  10 +
  11 +CREATE VIEW VI_API_ARTICULOS_INVENTARIO
  12 +
  13 +SELECT A.CODSEC, A.CODART, A.UNIVEN, C.DVE, A.EXIVTA, A.EXIDEP, B.CODBAR, D.COO, A.DETART,
  14 +(SELECT PRECIO FROM LISTA_PRECIO_DET AS E INNER JOIN APAREMP AS F ON E.ID=F.LISTA_V WHERE E.SEC=A.CODSEC AND E.ART=A.CODART ) AS PREVEN ,
  15 +A.COSTO, A.DEPSN, '' AS FOTO
  16 +FROM ARTICULOS AS A
  17 +LEFT JOIN CODBAR AS B
  18 +ON A.CODSEC=B.CODSEC AND A.CODART=B.CODART
  19 +INNER JOIN AUNIVTA AS C ON A.UNIVEN=C.ID
  20 +LEFT JOIN A_COD_ORI AS D ON D.SEC=A.CODSEC AND D.ART=A.CODART
  21 +GO
  22 +
  23 +
... ... @@ -9,7 +9,7 @@ android {
9 9  
10 10 defaultConfig {
11 11 applicationId "com.focasoftware.deboinventariov20"
12   - minSdkVersion 26
  12 + minSdkVersion 24
13 13 targetSdkVersion 30
14 14 versionCode 1
15 15 versionName "1.0"
... ... @@ -41,16 +41,16 @@ android {
41 41 dependencies {
42 42 implementation fileTree(dir: "libs", include: ["*.jar"])
43 43 implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
44   - implementation 'androidx.core:core-ktx:1.3.1'
  44 + implementation 'androidx.core:core-ktx:1.3.2'
45 45 implementation 'androidx.appcompat:appcompat:1.2.0'
46 46 implementation 'androidx.legacy:legacy-support-v4:1.0.0'
47 47 implementation 'com.google.android.material:material:1.2.1'
48   - implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
49   - implementation 'androidx.navigation:navigation-fragment:2.3.0'
50   - implementation 'androidx.navigation:navigation-ui:2.3.0'
  48 + implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
  49 + implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
  50 + implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
51 51 implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
52   - implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
53   - implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
  52 + implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
  53 + implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
54 54 implementation 'androidx.recyclerview:recyclerview:1.1.0'
55 55 testImplementation 'junit:junit:4.13'
56 56 androidTestImplementation 'androidx.test.ext:junit:1.1.2'
app/src/main/java/com/focasoftware/deboinventariov20/DB/Constans/Constans.kt
... ... @@ -8,6 +8,8 @@ class Constans {
8 8 const val TABLA_INV_H="InvHead"
9 9 const val TABLA_INV_B="InvBody"
10 10 const val TABLA_SERV_INV="ServeInv"
  11 + const val TABLA_INV_SEC_B="InvBodySec"
  12 + const val TABLA_INV_SEC_H="InvHeadSec"
11 13 }
12 14  
13 15 }
14 16 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/DB/DAO/ArticulosDAO.kt
... ... @@ -7,11 +7,10 @@ import androidx.room.Query
7 7 import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_ART
8 8 import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_B
9 9 import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_H
  10 +import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_SEC_B
  11 +import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_SEC_H
10 12 import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_SERV_INV
11   -import com.focasoftware.deboinventariov20.Model.Articles
12   -import com.focasoftware.deboinventariov20.Model.InvBody
13   -import com.focasoftware.deboinventariov20.Model.InvHead
14   -import com.focasoftware.deboinventariov20.Model.ServeInv
  13 +import com.focasoftware.deboinventariov20.Model.*
15 14  
16 15 @Dao
17 16 interface ArticulosDAO {
... ... @@ -63,7 +62,7 @@ interface InvHeadDAO {
63 62 suspend fun consultaCantidadInvH (inven: Int): Int
64 63  
65 64 @Query("UPDATE $TABLA_INV_H SET INV_PRODCONT=:cant WHERE INV_NUM=:inven")
66   - suspend fun updateInvBody(inven: Int,cant: Int)
  65 + suspend fun updateInvCantHead(inven: Int,cant: Int)
67 66  
68 67 @Query("SELECT * FROM $TABLA_INV_H WHERE INV_NUM=:inven")
69 68 suspend fun foundInvHead (inven: Int): InvHead
... ... @@ -77,7 +76,7 @@ interface InvBodyDAO {
77 76 @Query("DELETE FROM $TABLA_INV_B")
78 77 suspend fun deleteAllInvBody()
79 78  
80   - @Query("DELETE FROM $TABLA_INV_B WHERE INV_NUM =:inven")
  79 + @Query("DELETE FROM $TABLA_INV_B WHERE INV_NUM =:inven")
81 80 suspend fun deleteInvBody(inven: Int)
82 81  
83 82 @Query("UPDATE $TABLA_INV_B SET CANT=:cant , INV_FEF=:actFechaHora WHERE SEC=:sec AND COD=:cod")
... ... @@ -118,4 +117,71 @@ interface ServeInvDao {
118 117  
119 118 @Query("SELECT * FROM $TABLA_SERV_INV WHERE SER_NUM = :numero")
120 119 suspend fun fetchServer(numero: Int): ServeInv
121   -}
122 120 \ No newline at end of file
  121 +}
  122 +
  123 +
  124 +
  125 +@Dao
  126 +interface InvHeadSecDAO {
  127 + @Insert(onConflict = OnConflictStrategy.REPLACE)
  128 + fun insertInvHeadSec(Inventario: InvHeadSec)
  129 +
  130 + @Query("DELETE FROM $TABLA_INV_SEC_H WHERE INV_NUM = :inven")
  131 + suspend fun deleteAllInvHeadSec(inven: Int)
  132 +
  133 + @Query("SELECT * FROM $TABLA_INV_SEC_H ORDER BY INV_NUM")
  134 + suspend fun fetchAllInvSecHead(): List<InvHeadSec>
  135 +
  136 + @Query("UPDATE $TABLA_INV_SEC_H SET CONT=:cant WHERE INV_NUM=:inven")
  137 + suspend fun updateCantArtInvSecHead(inven: Int,cant: Int)
  138 +
  139 + @Query("DELETE FROM $TABLA_INV_SEC_H WHERE INV_NUM=:inven")
  140 + suspend fun deleteinvSecHead(inven: String)
  141 +
  142 + @Query("SELECT * FROM $TABLA_INV_SEC_H WHERE INV_NUM=:inven")
  143 + suspend fun foundInvSecHead (inven: String): InvHeadSec
  144 +
  145 + @Query("UPDATE $TABLA_INV_SEC_H SET FET=:fecha, FEC=:fecha WHERE INV_NUM=:inven")
  146 + suspend fun updateFETinvSecHead(inven: String, fecha:String)
  147 +
  148 + @Query("UPDATE $TABLA_INV_SEC_H SET FEC=:fecha WHERE INV_NUM=:inven")
  149 + suspend fun updateFECinvSecHead(inven: String, fecha:String)
  150 +}
  151 +
  152 +@Dao
  153 +interface InvBodySecDAO {
  154 + @Insert()
  155 + suspend fun insertInvBodySec(invBody: InvBodySec?)
  156 +
  157 + @Query("DELETE FROM $TABLA_INV_SEC_B WHERE INV = :inven")
  158 + suspend fun deleteAllInvBodySec(inven: Int)
  159 +
  160 + @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven GROUP BY SEC, ART")
  161 + suspend fun buscarInvSecBody(inven: Int): List<InvBodySec>
  162 +
  163 + @Query("UPDATE $TABLA_INV_SEC_B SET CON=:cant , FECTOM=:actFechaHora WHERE INV =:inven AND SEC=:sec AND ART=:cod")
  164 + suspend fun updateInvSecBody(inven: String, cant: Float, sec: Long, cod: Long, actFechaHora:String)
  165 +
  166 + @Query("DELETE FROM $TABLA_INV_SEC_B WHERE INV =:inven")
  167 + suspend fun deleteInvSecBody(inven: String)
  168 +
  169 + @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven GROUP BY SEC, ART")
  170 + suspend fun fetchInvSecBody(inven: String): List<InvBodySec>
  171 +
  172 + @Query("UPDATE $TABLA_INV_SEC_B SET FECTOM=:fecha, FECTOMFIN=:fecha WHERE INV =:inven")
  173 + suspend fun updateFECTOMyFECTOMFINinvSecBody(inven: String, fecha:String)
  174 +
  175 + @Query("UPDATE $TABLA_INV_SEC_B SET CON=:cant ,FECTOMFIN=:actFechaHora WHERE INV =:inven AND SEC=:sec AND ART=:cod")
  176 + suspend fun updateFECTOMFINinvSecBody(inven: String, cant: Float, sec: Long, cod: Long, actFechaHora:String)
  177 +
  178 + @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven ")
  179 + suspend fun verificoExisteInvSec(inven: Int): List<InvBodySec>
  180 +
  181 + @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven AND SEC=:sec AND ART=:cod")
  182 + suspend fun fetchArticuloByCodSec(inven: String, sec: String, cod: String):InvBodySec
  183 +
  184 + @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven GROUP BY SEC, ART")
  185 + suspend fun fetchInvSecBodyGroup(inven: String): List<InvBodySec>
  186 +
  187 +
  188 +}
app/src/main/java/com/focasoftware/deboinventariov20/DB/DataBase/AppDb.kt
... ... @@ -6,18 +6,17 @@ import androidx.room.Room
6 6 import androidx.room.RoomDatabase
7 7 import com.focasoftware.deboinventariov20.DB.Constans.Constans
8 8 import com.focasoftware.deboinventariov20.DB.DAO.*
9   -import com.focasoftware.deboinventariov20.Model.Articles
10   -import com.focasoftware.deboinventariov20.Model.InvBody
11   -import com.focasoftware.deboinventariov20.Model.InvHead
12   -import com.focasoftware.deboinventariov20.Model.ServeInv
  9 +import com.focasoftware.deboinventariov20.Model.*
13 10  
14 11  
15   -@Database(entities = [Articles::class, InvHead::class, InvBody::class, ServeInv::class], version = 1, exportSchema = false)
  12 +@Database(entities = [InvBodySec::class, InvHeadSec::class, Articles::class, InvHead::class, InvBody::class, ServeInv::class], version = 1, exportSchema = false)
16 13 abstract class AppDb : RoomDatabase() {
17 14 abstract fun ArticulosDAO(): ArticulosDAO?
18 15 abstract fun InvHeadDAO(): InvHeadDAO?
19 16 abstract fun InvBodyDAO(): InvBodyDAO?
20 17 abstract fun ServeInvDao(): ServeInvDao?
  18 + abstract fun InvHeadSecDAO(): InvHeadSecDAO?
  19 + abstract fun InvBodySecDAO(): InvBodySecDAO?
21 20  
22 21 companion object {
23 22 private var INSTANCE: AppDb? = null
app/src/main/java/com/focasoftware/deboinventariov20/Model/DefaultResponse.kt
... ... @@ -0,0 +1,7 @@
  1 +package com.focasoftware.deboinventariov20.Model
  2 +
  3 +import retrofit2.Callback
  4 +
  5 +data class DefaultResponse(val message:String, val success: Boolean, val status:Int) {
  6 +
  7 +}
0 8 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/Model/ItomInv.kt
... ... @@ -0,0 +1,34 @@
  1 +package com.focasoftware.deboinventariov20.Model
  2 +
  3 +import okhttp3.OkHttpClient
  4 +import okhttp3.logging.HttpLoggingInterceptor
  5 +import retrofit2.Retrofit
  6 +import retrofit2.converter.gson.GsonConverterFactory
  7 +import java.util.concurrent.TimeUnit
  8 +
  9 +object ItomInv {
  10 +
  11 + private val TIME_OUT: Long
  12 + get() {
  13 + return 200
  14 + }
  15 + private val interceptor = run {
  16 + val httpLoggingInterceptor = HttpLoggingInterceptor()
  17 + httpLoggingInterceptor.apply {
  18 + httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
  19 + }
  20 + }
  21 + private val okHttpClient = OkHttpClient.Builder()
  22 + .addNetworkInterceptor(interceptor) // same for .addInterceptor(...)
  23 + .connectTimeout(TIME_OUT, TimeUnit.SECONDS) //Backend is really slow
  24 + .writeTimeout(TIME_OUT, TimeUnit.SECONDS)
  25 + .readTimeout(TIME_OUT, TimeUnit.SECONDS)
  26 + .build()
  27 +
  28 + private val retrofit: Retrofit = Retrofit.Builder()
  29 + .client(okHttpClient)
  30 + .baseUrl(BASE_URL)
  31 + .addConverterFactory(GsonConverterFactory.create())
  32 + .build()
  33 + val request: WebServiceApi = retrofit.create(WebServiceApi::class.java)
  34 +}
0 35 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/Model/Tablas.kt
... ... @@ -6,85 +6,129 @@ import androidx.room.PrimaryKey
6 6 import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_ART
7 7 import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_B
8 8 import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_H
  9 +import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_SEC_B
  10 +import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_SEC_H
9 11 import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_SERV_INV
10 12 import com.google.gson.annotations.SerializedName
11 13 import java.io.Serializable
12 14  
13   -//data class Productos(@SerializedName("SEC") var sector: String?,
14   -// @SerializedName("COD") var codigo: String?,
15   -// @SerializedName("DESC") var descripcion: String?,
16   -// @SerializedName("CB") var codBar: String?,
17   -// @SerializedName("CBC") var codOrigen: String?,
18   -// @SerializedName("PRE_VTA") var precio: String?,
19   -// @SerializedName("PRE_COS") var costo: String?,
20   -// @SerializedName( "EV") var exiVenta: String?,
21   -// @SerializedName( "ED") var exiDeposito: String?,
22   -// @SerializedName( "DE") var de: String?,
23   -// @SerializedName( "BAL") var balanza: Int?,
24   -// @SerializedName("DEPSN") var depSn: Int?,
25   -// @SerializedName("FOTO") var imagen: String?)
26   -data class Productos(@SerializedName("CODSEC") var sector: String?,
27   - @SerializedName("CODART") var codigo: String?,
28   - @SerializedName("DETART") var descripcion: String?,
29   - @SerializedName("CODBAR") var codBar: String?,
30   - @SerializedName("COO") var codOrigen: String?,
31   - @SerializedName("PREVEN") var precio: String?,
32   - @SerializedName("COSTO") var costo: String?,
33   - @SerializedName( "EXIVTA") var exiVenta: String?,
34   - @SerializedName( "EXIDEP") var exiDeposito: String?,
35   - @SerializedName( "DVE") var de: String?,
36   - @SerializedName( "UNIVEN") var balanza: Int?,
37   - @SerializedName("DEPSN") var depSn: Boolean?,
38   - @SerializedName("FOTO") var imagen: String?)
39   -
40   -data class InvToSend ( var fechaInicio: String?,
41   - var fechaFinal: String?,
42   - var lugar: Int?,
43   - var sector: String?,
44   - var codigo: String?,
45   - var descripcion: String?,
46   - var cantTomada: String?,
47   - var fechaInicioArt: String?,
48   - var fechaFinArt: String?)
49   -//@Entity(tableName = TABLA_ART)
50   -//data class Articles(@ColumnInfo(name = "SEC") var sector: String?,
51   -// @ColumnInfo(name = "COD") var codigo: String?,
52   -// @ColumnInfo(name = "DES") var descripcion: String?,
53   -// @ColumnInfo(name = "CB") var codBar: String?,
54   -// @ColumnInfo(name = "CBC") var codOrigen: String?,
55   -// @ColumnInfo(name = "PRE_VTA") var precio: String?,
56   -// @ColumnInfo(name = "PRE_COS") var costo: String?,
57   -// @ColumnInfo(name = "EV") var exiVenta: String?,
58   -// @ColumnInfo(name = "ED") var exiDeposito: String?,
59   -// @ColumnInfo(name = "DE") var de: String?,
60   -// @ColumnInfo(name = "BAL") var balanza: Int?,
61   -// @ColumnInfo(name = "DEPSN") var depSn: Int?,
62   -// @ColumnInfo(name = "FOTO") var imagen: String?) : Serializable {
63   -// @PrimaryKey(autoGenerate = true)
64   -// @ColumnInfo(name = "id")
65   -// var id: Long = 0
66   -//}
  15 +data class Productos(
  16 + @SerializedName("CODSEC") var sector: String?,
  17 + @SerializedName("CODART") var codigo: String?,
  18 + @SerializedName("DETART") var descripcion: String?,
  19 + @SerializedName("CODBAR") var codBar: String?,
  20 + @SerializedName("COO") var codOrigen: String?,
  21 + @SerializedName("PREVEN") var precio: String?,
  22 + @SerializedName("COSTO") var costo: String?,
  23 + @SerializedName("EXIVTA") var exiVenta: String?,
  24 + @SerializedName("EXIDEP") var exiDeposito: String?,
  25 + @SerializedName("DVE") var de: String?,
  26 + @SerializedName("UNIVEN") var balanza: Int?,
  27 + @SerializedName("DEPSN") var depSn: Boolean?,
  28 + @SerializedName("FOTO") var imagen: String?
  29 +)
  30 +
  31 +data class Time(
  32 + @SerializedName("DIA") var dia: String?,
  33 + @SerializedName("MES") var mes: String?,
  34 + @SerializedName("ANO") var ano: String?,
  35 + @SerializedName("HORA") var hora: String?,
  36 + @SerializedName("MIN") var minutos: String?,
  37 + @SerializedName("SEG") var segundos: String?
  38 +)
  39 +
  40 +data class InvHeadSecR(
  41 + @SerializedName("INV_NUM") var invNum: Int,
  42 + @SerializedName("DET") var detalle: String,
  43 + @SerializedName("FET") var fechaInicio: String,
  44 + @SerializedName("DEP") var depsn: Int
  45 +)
  46 +
  47 +data class InvBodySecR(
  48 + @SerializedName("INV") var INV: String,
  49 + @SerializedName("SEC") var SEC: String?,
  50 + @SerializedName("ART") var ART: String?,
  51 + @SerializedName("DET") var DET: String?,
  52 + @SerializedName("PRE") var PRE: String?,
  53 + @SerializedName("COS") var COS: String?,
  54 + @SerializedName("DVE") var DVE: String?,
  55 + @SerializedName("EXIVTA") var EXIVTA: String?,
  56 + @SerializedName("EXIDEP") var EXIDEP: String?,
  57 + @SerializedName("CODBAR") var CODBAR: String?,
  58 + @SerializedName("COO") var COO: String?,
  59 + @SerializedName("DEPSN") var DEPSN: String?,
  60 + @SerializedName("UNIVEN") var uniVta: String?
  61 +)
  62 +
  63 +data class ItomInvD(
  64 + var Sector: String?,
  65 + var Codigo: String?,
  66 + var Descripcion: String?,
  67 + var CantTomada: String?,
  68 + var FechaInicioArt: String?,
  69 + var FechaFinArt: String?
  70 +)
  71 +
  72 +data class InvToSend(
  73 + var FechaInicio: String?,
  74 + var FechaFinal: String?,
  75 + var Lugar: Int?,
  76 + var Sector: String?,
  77 + var Codigo: String?,
  78 + var Descripcion: String?,
  79 + var CantTomada: String?,
  80 + var FechaInicioArt: String?,
  81 + var FechaFinArt: String?
  82 +)
  83 +
  84 +data class ItomInvC(
  85 + var FechaInicio: String?,
  86 + var FechaFinal: String?,
  87 + var Lugar: Int?,
  88 +)
  89 +
  90 +data class InvSecHeadToSend(
  91 + var ID: String?,
  92 + var EST: String?,
  93 + var FEC: String?
  94 +)
  95 +
  96 +data class InvSecBodyToSend(
  97 + var INV: String?,
  98 + var SEC: String?,
  99 + var ART: String?,
  100 + var CON: String?,
  101 + var FECTOM: String?,
  102 + var FECTOMFIN: String?
  103 +)
  104 +
  105 +data class NumInvSec(var inv_num: String?)
  106 +
67 107 @Entity(tableName = TABLA_ART)
68   -data class Articles(@ColumnInfo(name = "CODSEC") var sector: String?,
69   - @ColumnInfo(name = "CODART") var codigo: String?,
70   - @ColumnInfo(name = "DETART") var descripcion: String?,
71   - @ColumnInfo(name = "CODBAR") var codBar: String?,
72   - @ColumnInfo(name = "COO") var codOrigen: String?,
73   - @ColumnInfo(name = "PREVEN") var precio: String?,
74   - @ColumnInfo(name = "COSTO") var costo: String?,
75   - @ColumnInfo(name = "EXIVTA") var exiVenta: String?,
76   - @ColumnInfo(name = "EXIDEP") var exiDeposito: String?,
77   - @ColumnInfo(name = "DVE") var de: String?,
78   - @ColumnInfo(name = "UNIVEN") var balanza: Int?,
79   - @ColumnInfo(name = "DEPSN") var depSn: Boolean?,
80   - @ColumnInfo(name = "FOTO") var imagen: String?) : Serializable {
  108 +data class Articles(
  109 + @ColumnInfo(name = "CODSEC") var sector: String?,
  110 + @ColumnInfo(name = "CODART") var codigo: String?,
  111 + @ColumnInfo(name = "DETART") var descripcion: String?,
  112 + @ColumnInfo(name = "CODBAR") var codBar: String?,
  113 + @ColumnInfo(name = "COO") var codOrigen: String?,
  114 + @ColumnInfo(name = "PREVEN") var precio: String?,
  115 + @ColumnInfo(name = "COSTO") var costo: String?,
  116 + @ColumnInfo(name = "EXIVTA") var exiVenta: String?,
  117 + @ColumnInfo(name = "EXIDEP") var exiDeposito: String?,
  118 + @ColumnInfo(name = "DVE") var de: String?,
  119 + @ColumnInfo(name = "UNIVEN") var balanza: Int?,
  120 + @ColumnInfo(name = "DEPSN") var depSn: Boolean?,
  121 + @ColumnInfo(name = "FOTO") var imagen: String?
  122 +) : Serializable {
81 123 @PrimaryKey(autoGenerate = true)
82 124 @ColumnInfo(name = "id")
83 125 var id: Long = 0
84 126 }
85 127  
  128 +
86 129 @Entity(tableName = TABLA_INV_H)
87   -data class InvHead(@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "INV_NUM") var invNum: Int,
  130 +data class InvHead(
  131 + @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "INV_NUM") var invNum: Int,
88 132 @ColumnInfo(name = "INV_DESC") var descripcion: String?,
89 133 @ColumnInfo(name = "ESTADO") var estado: Int?,
90 134 @ColumnInfo(name = "INV_FEI") var fechaInicio: String?,
... ... @@ -96,23 +140,26 @@ data class InvHead(@PrimaryKey(autoGenerate = true) @ColumnInfo(name = &quot;INV_NUM&quot;
96 140 // Ajusta productos no incluidos en el conteo con stock en cero=1
97 141 @ColumnInfo(name = "PRO_NO_CONTA") var stDesc: Int?,
98 142 // Mostror stock en el sistema al momento de la descarga del maestro.
99   - @ColumnInfo(name = "MOSTRAR_STOCK") var proNoCont: Int?)
  143 + @ColumnInfo(name = "MOSTRAR_STOCK") var proNoCont: Int?
  144 +)
100 145  
101 146  
102 147 @Entity(tableName = TABLA_INV_B)
103   -data class InvBody(@ColumnInfo(name = "INV_NUM") var invNum: Int,
104   - @ColumnInfo(name = "SEC") var sector: String?,
105   - @ColumnInfo(name = "COD") var codigo: String?,
106   - @ColumnInfo(name = "DES") var descripcion: String?,
107   - @ColumnInfo(name = "CANT") var cantTomada: String?,
108   - @ColumnInfo(name = "CB") var codBar: String?,
109   - @ColumnInfo(name = "CBC") var codOrigen: String?,
110   - @ColumnInfo(name = "PRE_VTA") var precio: String?,
111   - @ColumnInfo(name = "PRE_COS") var costo: String?,
112   - @ColumnInfo(name = "BAL") var balanza: Int?,
113   - @ColumnInfo(name = "DSN") var depSn: Boolean?,
114   - @ColumnInfo(name = "INV_FEI") var fechaInicio: String?,
115   - @ColumnInfo(name = "INV_FEF") var fechaFinal: String?) : Serializable {
  148 +data class InvBody(
  149 + @ColumnInfo(name = "INV_NUM") var invNum: Int,
  150 + @ColumnInfo(name = "SEC") var sector: String?,
  151 + @ColumnInfo(name = "COD") var codigo: String?,
  152 + @ColumnInfo(name = "DES") var descripcion: String?,
  153 + @ColumnInfo(name = "CANT") var cantTomada: String?,
  154 + @ColumnInfo(name = "CB") var codBar: String?,
  155 + @ColumnInfo(name = "CBC") var codOrigen: String?,
  156 + @ColumnInfo(name = "PRE_VTA") var precio: String?,
  157 + @ColumnInfo(name = "PRE_COS") var costo: String?,
  158 + @ColumnInfo(name = "BAL") var balanza: Int?,
  159 + @ColumnInfo(name = "DSN") var depSn: Boolean?,
  160 + @ColumnInfo(name = "INV_FEI") var fechaInicio: String?,
  161 + @ColumnInfo(name = "INV_FEF") var fechaFinal: String?
  162 +) : Serializable {
116 163 @PrimaryKey(autoGenerate = true)
117 164 @ColumnInfo(name = "id")
118 165 var id: Long = 0
... ... @@ -122,11 +169,48 @@ data class InvBody(@ColumnInfo(name = &quot;INV_NUM&quot;) var invNum: Int,
122 169 data class ServeInv(
123 170 @ColumnInfo(name = "SER_DESC") var descripcion: String?,
124 171 @ColumnInfo(name = "SER_DIR") var direccion: String?,
125   - @ColumnInfo(name = "SER_PUERTO") var puerto: String?,
126   - @ColumnInfo(name = "SER_PRE") var predeterminado: Int?):
127   - Serializable { @PrimaryKey(autoGenerate = true)
128   -@ColumnInfo(name = "SER_NUM")
129   -var servNum: Int=0
  172 + @ColumnInfo(name = "SER_PUERTO_SUBIDA") var puertoSubida: String?,
  173 + @ColumnInfo(name = "SER_PUERTO_BAJADA") var puertoBajada: String?,
  174 + @ColumnInfo(name = "SER_PRE") var predeterminado: Int?
  175 +) :
  176 + Serializable {
  177 + @PrimaryKey(autoGenerate = true)
  178 + @ColumnInfo(name = "SER_NUM")
  179 + var servNum: Int = 0
130 180 }
131 181  
  182 +@Entity(tableName = TABLA_INV_SEC_H)
  183 +data class InvHeadSec(
  184 + @PrimaryKey() @ColumnInfo(name = "INV_NUM") var invNum: Int,
  185 + @ColumnInfo(name = "DET") var detalle: String?,
  186 + @ColumnInfo(name = "FET") var fechaInicio: String?,
  187 + @ColumnInfo(name = "DEP") var depsn: Boolean?,
  188 + @ColumnInfo(name = "EST") var estado: String?,
  189 + @ColumnInfo(name = "FEC") var fechaFinal: String?,
  190 + @ColumnInfo(name = "CONT") var prodContados: Int?
  191 +)
  192 +
  193 +
  194 +@Entity(tableName = TABLA_INV_SEC_B)
  195 +data class InvBodySec(
  196 + @ColumnInfo(name = "INV") var invNum: Int,
  197 + @ColumnInfo(name = "SEC") var sector: String?,
  198 + @ColumnInfo(name = "ART") var codigo: String?,
  199 + @ColumnInfo(name = "DET") var descripcion: String?,
  200 + @ColumnInfo(name = "PRE") var precio: String?,
  201 + @ColumnInfo(name = "UNIVTA") var uniVenta: String?,
  202 + @ColumnInfo(name = "COS") var costo: String?,
  203 + @ColumnInfo(name = "CON") var contado: String?,
  204 + @ColumnInfo(name = "DSN") var depSn: Boolean?,
  205 + @ColumnInfo(name = "EXIVTA") var EXIVTA: String?,
  206 + @ColumnInfo(name = "EXIDEP") var EXIDEP: String?,
  207 + @ColumnInfo(name = "CODBAR") var CODBAR: String?,
  208 + @ColumnInfo(name = "FECTOM") var fechaTomado: String?,
  209 + @ColumnInfo(name = "FECTOMFIN") var fechaFinal: String?
  210 +) :
  211 + Serializable {
  212 + @PrimaryKey(autoGenerate = true)
  213 + @ColumnInfo(name = "ID")
  214 + var id: Int = 0
  215 +}
132 216  
app/src/main/java/com/focasoftware/deboinventariov20/Model/WebService.kt
1 1 package com.focasoftware.deboinventariov20.Model
2 2  
3   -import com.focasoftware.deboinventariov20.UI.actualizacionMaestros.BASE_URL
  3 +
4 4 import okhttp3.OkHttpClient
5 5 import okhttp3.logging.HttpLoggingInterceptor
6 6 import retrofit2.Retrofit
7 7 import retrofit2.converter.gson.GsonConverterFactory
8 8 import java.util.concurrent.TimeUnit
9 9  
10   -object WebService {
11   - private var instance: WebService? = null
12   - private var retrofit: Retrofit? = null
13   - private val TIME_OUT: Long
14   - get() {
15   - return 15
16   - }
17   - private val interceptor = run {
18   - val httpLoggingInterceptor = HttpLoggingInterceptor()
19   - httpLoggingInterceptor.apply {
20   - httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
21   - }
  10 +var BASE_URL: String = ""
  11 +
  12 +class WebService private constructor() {
  13 +
  14 + private val retrofit: Retrofit
  15 + private val loggingInterceptor: HttpLoggingInterceptor = HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
  16 + private val httpClientBuilder: OkHttpClient.Builder
  17 +
  18 +// private val interceptor = run {
  19 +// val httpLoggingInterceptor = HttpLoggingInterceptor()
  20 +// httpLoggingInterceptor.apply {
  21 +// httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
  22 +// }
  23 +// }
  24 +// private val TIME_OUT: Long
  25 +// get() {
  26 +// return 200
  27 +// }
  28 +// private val okHttpClient = OkHttpClient.Builder()
  29 +// .addNetworkInterceptor(interceptor)
  30 +// .connectTimeout(TIME_OUT, TimeUnit.SECONDS)
  31 +// .writeTimeout(TIME_OUT, TimeUnit.SECONDS)
  32 +// .readTimeout(TIME_OUT, TimeUnit.SECONDS)
  33 +// .build()
  34 +
  35 + fun createService(): WebServiceApi {
  36 + return retrofit.create(WebServiceApi::class.java)
22 37 }
23   - private val okHttpClient = OkHttpClient.Builder()
24   - .addNetworkInterceptor(interceptor)
25   - .connectTimeout(TIME_OUT, TimeUnit.SECONDS)
26   - .writeTimeout(TIME_OUT, TimeUnit.SECONDS)
27   - .readTimeout(TIME_OUT, TimeUnit.SECONDS)
28   - .build()
29 38  
  39 + fun <S> createService(serviceClass: Class<S>): S {
  40 + return retrofit.create(serviceClass)
  41 + }
  42 +
  43 + companion object {
  44 +
  45 +
  46 + @get:Synchronized
  47 + var instance: WebService? = null
  48 + get() {
  49 + if (field == null) {
  50 + field = WebService()
  51 + }
  52 + return field
  53 + }
  54 + private set
  55 + }
  56 +
  57 + init {
  58 + httpClientBuilder = OkHttpClient.Builder().addInterceptor(loggingInterceptor)
  59 + retrofit = Retrofit.Builder()
  60 + .baseUrl(BASE_URL)
  61 +// .client(okHttpClient)
  62 + .client(httpClientBuilder.build())
  63 + .addConverterFactory(GsonConverterFactory.create())
  64 + .build()
  65 + }
  66 +}
  67 +//object WebService2 {
  68 +// private var instance: WebService? = null
  69 +// private val TIME_OUT: Long
  70 +// get() {
  71 +// return 15
  72 +// }
  73 +// private val interceptor = run {
  74 +// val httpLoggingInterceptor = HttpLoggingInterceptor()
  75 +// httpLoggingInterceptor.apply {
  76 +// httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
  77 +// }
  78 +// }
  79 +// private val okHttpClient = OkHttpClient.Builder()
  80 +// .addNetworkInterceptor(interceptor)
  81 +// .connectTimeout(TIME_OUT, TimeUnit.SECONDS)
  82 +// .writeTimeout(TIME_OUT, TimeUnit.SECONDS)
  83 +// .readTimeout(TIME_OUT, TimeUnit.SECONDS)
  84 +// .build()
  85 +//
  86 +// fun getProductosService(): WebServiceApi {
  87 +// return Retrofit.Builder()
  88 +// .client(okHttpClient)
  89 +// .baseUrl(BASE_URL)
  90 +// .addConverterFactory(GsonConverterFactory.create())
  91 +// .build()
  92 +// .create(insertarItominvc::class.java)
  93 +// }
  94 +//}
30 95 // private fun WebService() {
31 96 // retrofit = Retrofit.Builder()
32 97 // .client(okHttpClient)
... ... @@ -56,12 +121,3 @@ object WebService {
56 121 // }
57 122  
58 123  
59   - fun getProductosService(): WebServiceApi {
60   - return Retrofit.Builder()
61   - .client(okHttpClient)
62   - .baseUrl(BASE_URL)
63   - .addConverterFactory(GsonConverterFactory.create())
64   - .build()
65   - .create(WebServiceApi::class.java)
66   - }
67   -}
app/src/main/java/com/focasoftware/deboinventariov20/Model/WebServiceApi.kt
1 1 package com.focasoftware.deboinventariov20.Model
2 2  
3 3 import retrofit2.Call
4   -import retrofit2.Response
5 4 import retrofit2.http.Body
6 5 import retrofit2.http.GET
7 6 import retrofit2.http.POST
8 7  
9   -
10 8 interface WebServiceApi {
11 9  
12 10 @GET("articulos/articulosCodBarra")
13   - fun getProductos(): Call<List<Productos>>
  11 + fun getProductos():Call<List<Productos?>?>?
  12 +
  13 + @GET("articulos/time")
  14 + fun getTime():Call<List<Time?>?>?
  15 +
  16 + @POST("api/insertar-itominvc")
  17 + fun insertarItominvc(@Body itomInvC: ItomInvC): Call<DefaultResponse>
  18 +
  19 + @POST("api/insertar-itominvd")
  20 + fun insertarItominvd(@Body itominvd: ItomInvD): Call<Void?>
  21 +
  22 +
  23 +
  24 +
  25 +// @POST("api/insertar-inventario")
  26 +// fun inventarioToSend(@Body invToSend: InvToSend): Call<Void?>
  27 +
  28 + @GET("api/get-cabecera-inventario")
  29 + fun getHeadInvSec():Call<List<InvHeadSecR?>?>?
  30 +
  31 + @POST("api/get-detalle-inventario")
  32 + fun getBodyInvSec(@Body inv_num: NumInvSec?): Call<List<InvBodySecR?>?>?
  33 +
  34 + @POST("api/update-cabecera-inventario")
  35 + fun inventarioSecToSendHead(@Body invSecHeadToSend: InvSecHeadToSend): Call<Void?>
14 36  
  37 + @POST("api/update-detalle-inventario")
  38 + fun inventarioSecToSendBody(@Body invSecBodyToSend: InvSecBodyToSend): Call<Void?>
15 39  
16   - @POST("articulos/articulosCodBarra")
17   - fun inventarioToSend(@Body invToSend: List<InvToSend>?): Call<Void?>?
18 40 }
19 41 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/MainActivity.kt
... ... @@ -43,4 +43,5 @@ class MainActivity : AppCompatActivity() {
43 43 val navController = findNavController(R.id.nav_host_fragment)
44 44 return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
45 45 }
  46 +
46 47 }
47 48 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/SplashActivity.kt
1 1 package com.focasoftware.deboinventariov20.UI
2 2  
3 3 import android.app.Activity
  4 +import android.content.Context
4 5 import android.content.Intent
  6 +import android.content.SharedPreferences
5 7 import android.os.Bundle
6 8 import com.focasoftware.deboinventariov20.R
7 9  
  10 +private lateinit var sharedPreferences: SharedPreferences
  11 +
8 12 class SplashActivity : Activity() {
9 13  
10   - override fun onCreate(savedInstanceState: Bundle?) {
11   - super.onCreate(savedInstanceState)
12   - setContentView(R.layout.activity_splash)
13   - //window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
  14 + override fun onCreate(savedInstanceState: Bundle?) {
  15 + super.onCreate(savedInstanceState)
  16 + setContentView(R.layout.activity_splash)
  17 +
  18 + sharedPreferences = baseContext.getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
  19 + val editor = sharedPreferences.edit()
  20 + editor?.putString("inicio", "inicio")
  21 + editor?.apply()
  22 + editor.commit()
  23 + val bac = object : Thread() {
  24 + override fun run() {
  25 + try {
  26 + sleep(3000)
  27 + val intent = Intent(baseContext, MainActivity::class.java)
  28 + startActivity(intent)
  29 + finish()
  30 + } catch (e: Exception) {
  31 + e.printStackTrace()
  32 + }
  33 + }
  34 + }
  35 + bac.start()
14 36  
15   - val bac = object : Thread(){
16   - override fun run(){
17   - try {
18   - Thread.sleep(3)
19   - val intent = Intent(baseContext, MainActivity:: class.java)
20   - startActivity(intent)
21   - finish()
22   - } catch (e : Exception){
23   - e.printStackTrace()
24   - }
25   - }
26   - }
27   - bac.start()
28   - }
  37 + }
29 38 }
app/src/main/java/com/focasoftware/deboinventariov20/UI/Utils/BaseViewHolder.kt
... ... @@ -5,5 +5,4 @@ import androidx.recyclerview.widget.RecyclerView
5 5  
6 6 abstract class BaseViewHolder<T>(itemView: View):RecyclerView.ViewHolder(itemView) {
7 7 abstract fun bind(item: T, position: Int)
8   -}
9   -
  8 +}
10 9 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/Utils/Utils.kt
1 1 package com.focasoftware.deboinventariov20.UI.Utils
2 2  
  3 +import android.app.Activity
3 4 import android.app.AlertDialog
4 5 import android.app.Dialog
5 6 import android.content.Context
  7 +import android.content.Intent
6 8 import android.os.Bundle
  9 +import android.provider.Settings
  10 +import android.view.LayoutInflater
  11 +import android.view.View
  12 +import android.view.WindowManager
  13 +import android.view.inputmethod.InputMethodManager
  14 +import androidx.core.content.ContextCompat.getSystemService
7 15 import androidx.fragment.app.DialogFragment
  16 +import androidx.fragment.app.FragmentActivity
8 17 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
  18 +import com.focasoftware.deboinventariov20.Model.ServeInv
  19 +import com.focasoftware.deboinventariov20.R
  20 +import com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment
  21 +import kotlinx.android.synthetic.main.fragment_inventario.*
  22 +import kotlinx.android.synthetic.main.solicitar_fecha.view.*
9 23 import kotlinx.coroutines.Dispatchers
10 24 import kotlinx.coroutines.GlobalScope
11 25 import kotlinx.coroutines.async
... ... @@ -14,6 +28,9 @@ import java.net.UnknownHostException
14 28 import java.time.LocalDateTime
15 29 import java.time.format.DateTimeFormatter
16 30  
  31 +
  32 +private var serverPre: ServeInv? = null
  33 +
17 34 fun modificarCantidadEnCabecera(inventarioActual: Int, b: Boolean, context: Context) {
18 35 GlobalScope.async(Dispatchers.IO) {
19 36 var cantProductos = 0
... ... @@ -21,10 +38,10 @@ fun modificarCantidadEnCabecera(inventarioActual: Int, b: Boolean, context: Cont
21 38 AppDb.getAppDb(context)!!.InvHeadDAO()!!.consultaCantidadInvH(inventarioActual)
22 39 if (b) {
23 40 AppDb.getAppDb(context)!!.InvHeadDAO()!!
24   - .updateInvBody(inventarioActual, cantProductos + 1)
  41 + .updateInvCantHead(inventarioActual, cantProductos + 1)
25 42 } else {
26 43 AppDb.getAppDb(context)!!.InvHeadDAO()!!
27   - .updateInvBody(inventarioActual, cantProductos - 1)
  44 + .updateInvCantHead(inventarioActual, cantProductos - 1)
28 45 }
29 46 }
30 47 }
... ... @@ -60,12 +77,16 @@ class NoEncontradoSimple : DialogFragment() {
60 77 override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
61 78 return activity?.let {
62 79 val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity())
  80 + .setCancelable(true)
  81 +
63 82 builder.show()
64 83 val title = ""
65 84 val content = "¡El producto buscado NO fue encontrado!"
66 85  
67 86 builder.setTitle(title).setMessage(content)
68   - .setPositiveButton(android.R.string.ok) { _, _ -> }
  87 + .setPositiveButton(android.R.string.ok) { _, _ ->
  88 +
  89 + }
69 90 return builder.create()
70 91 } ?: throw IllegalStateException("Activity cannot be null")
71 92 }
... ... @@ -105,6 +126,7 @@ fun isConnectedToThisServer(host: String): Boolean {
105 126  
106 127 return false
107 128 }
  129 +
108 130 class ServerValido : DialogFragment() {
109 131 override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
110 132 return activity?.let {
... ... @@ -117,6 +139,7 @@ class ServerValido : DialogFragment() {
117 139 } ?: throw IllegalStateException("Activity cannot be null")
118 140 }
119 141 }
  142 +
120 143 class ServerNoValido : DialogFragment() {
121 144 override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
122 145 return activity?.let {
... ... @@ -129,6 +152,7 @@ class ServerNoValido : DialogFragment() {
129 152 } ?: throw IllegalStateException("Activity cannot be null")
130 153 }
131 154 }
  155 +
132 156 class ServerNoConf : DialogFragment() {
133 157 override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
134 158 return activity?.let {
... ... @@ -141,6 +165,7 @@ class ServerNoConf : DialogFragment() {
141 165 } ?: throw IllegalStateException("Activity cannot be null")
142 166 }
143 167 }
  168 +
144 169 class ExportacionExitosa : DialogFragment() {
145 170 override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
146 171 return activity?.let {
... ... @@ -153,10 +178,125 @@ class ExportacionExitosa : DialogFragment() {
153 178 } ?: throw IllegalStateException("Activity cannot be null")
154 179 }
155 180 }
  181 +
  182 +class ExportacionFracasada : DialogFragment() {
  183 + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
  184 + return activity?.let {
  185 + val title = "Exportación de Inventarios"
  186 + val content = "!No se pudo realizar la expotación¡"
  187 + val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity())
  188 + builder.setTitle(title).setMessage(content)
  189 + .setPositiveButton(android.R.string.ok) { _, _ -> }
  190 + return builder.create()
  191 + } ?: throw IllegalStateException("Activity cannot be null")
  192 + }
  193 +}
  194 +
  195 +fun obtenerFechaActualFormatoFoca(): String {
  196 + //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD
  197 + val current = LocalDateTime.now()
  198 + val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
  199 + val dFechaHora = current.format(formatter)
  200 + return dFechaHora.toString()
  201 +}
156 202 fun obtenerFechaActual(): String {
157   - //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD
158   - val current = LocalDateTime.now()
159   - val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm:ss")
160   - val dFechaHora = current.format(formatter)
161   - return dFechaHora.toString()
162   - }
163 203 \ No newline at end of file
  204 + //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD
  205 + val current = LocalDateTime.now()
  206 + val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss")
  207 + val dFechaHora = current.format(formatter)
  208 + return dFechaHora.toString()
  209 +}
  210 +fun obtenerHoraActual(): String {
  211 + //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD
  212 + val current = LocalDateTime.now()
  213 + val formatter = DateTimeFormatter.ofPattern("HHmmss")
  214 + val dFechaHora = current.format(formatter)
  215 + return dFechaHora.toString()
  216 +}
  217 +
  218 +fun obtenerDiaActual(): String {
  219 + //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD
  220 + val current = LocalDateTime.now()
  221 + val formatter = DateTimeFormatter.ofPattern("ddMMyyyy")
  222 + val dFechaHora = current.format(formatter)
  223 + return dFechaHora.toString()
  224 +}
  225 +class SelAreaInventarioVentas : DialogFragment() {
  226 + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
  227 + return activity?.let {
  228 + val title = "Inventarios de Ventas"
  229 + val content = "!En busqueda de articulos no estaran disponibles los articulos de DEPOSITO¡"
  230 + val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity())
  231 + builder.setTitle(title).setMessage(content)
  232 + .setPositiveButton(android.R.string.ok) { _, _ -> }
  233 + return builder.create()
  234 + } ?: throw IllegalStateException("Activity cannot be null")
  235 + }
  236 +}
  237 +
  238 +class SelAreaInventarioDeposito : DialogFragment() {
  239 + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
  240 + return activity?.let {
  241 + val title = "Inventarios de Depositos"
  242 + val content = "!En busqueda de articulos no estaran disponibles los articulos de VENTAS¡"
  243 + val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity())
  244 + builder.setTitle(title).setMessage(content)
  245 + .setPositiveButton(android.R.string.ok) { _, _ -> }
  246 + return builder.create()
  247 + } ?: throw IllegalStateException("Activity cannot be null")
  248 + }
  249 +}
  250 +
  251 +fun dialogoHoraServer(reqActivity: FragmentActivity, context: Context, fechaHoraDispositivo: String, fechaHoraServer: String) {
  252 + val mDialogView: View = LayoutInflater.from(context).inflate(R.layout.solicitar_fecha, null)
  253 + val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false)
  254 +
  255 +
  256 + mDialogView.tvHoraDispositivo.text = fechaHoraDispositivo
  257 + mDialogView.tvHoraServidor.text = fechaHoraServer
  258 + val mAlertDialog = mBuilder.show()
  259 +
  260 +// mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)
  261 +// mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
  262 +//
  263 +// val imm = reqActivity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?
  264 +// imm!!.hideSoftInputFromWindow(reqActivity.currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
  265 +
  266 + mDialogView.btnCambiarHora.setOnClickListener {
  267 + context.startActivity(Intent(Settings.ACTION_DATE_SETTINGS))
  268 + mAlertDialog.dismiss()
  269 + }
  270 +
  271 + mDialogView.btnSalir.setOnClickListener {
  272 + mAlertDialog.dismiss()
  273 + }
  274 +}
  275 +
  276 +class InvSecImp : DialogFragment() {
  277 + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
  278 + return activity?.let {
  279 + val title = "Inventarios de Sectorizados"
  280 + val content = "!Inventario importado correctamente¡"
  281 + val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity())
  282 + builder.setTitle(title).setMessage(content)
  283 + .setPositiveButton(android.R.string.ok) { _, _ -> }
  284 + return builder.create()
  285 + } ?: throw IllegalStateException("Activity cannot be null")
  286 + }
  287 +}
  288 +
  289 +suspend fun fetchServerPreOne(reqActivity: FragmentActivity): ServeInv? {
  290 + return GlobalScope.async(Dispatchers.IO) {
  291 + return@async AppDb.getAppDb(reqActivity)!!.ServeInvDao()!!.fetchServerPreOne()
  292 + }.await()
  293 +}
  294 +
  295 +//fun hideSoftKeyboard(reqActivity: FragmentActivity) {
  296 +// val imm = reqActivity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?
  297 +// imm!!.hideSoftInputFromWindow(reqActivity.currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
  298 +//
  299 +//
  300 +//}
  301 +fun Context.hideSoftKeyboard(view: View) {
  302 +val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
  303 +inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0) }
164 304 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/ActuaMaestrosFragment.kt
... ... @@ -6,74 +6,156 @@ import android.view.View
6 6 import android.view.ViewGroup
7 7 import android.widget.Button
8 8 import android.widget.RadioButton
  9 +import android.widget.Toast
9 10 import androidx.fragment.app.Fragment
10   -import androidx.lifecycle.lifecycleScope
  11 +import androidx.navigation.NavController
  12 +import androidx.navigation.Navigation
11 13 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
12   -import com.focasoftware.deboinventariov20.Model.Articles
13   -import com.focasoftware.deboinventariov20.Model.ServeInv
  14 +import com.focasoftware.deboinventariov20.Model.*
14 15 import com.focasoftware.deboinventariov20.R
  16 +import com.focasoftware.deboinventariov20.UI.MainActivity
15 17 import com.focasoftware.deboinventariov20.UI.Utils.NoServerConf
16 18 import com.focasoftware.deboinventariov20.UI.Utils.ServerNoConf
  19 +import com.focasoftware.deboinventariov20.UI.Utils.fetchServerPreOne
17 20 import kotlinx.android.synthetic.main.fragment_actua_maestros.*
18 21 import kotlinx.coroutines.*
19 22 import kotlinx.coroutines.Dispatchers.IO
20 23 import kotlinx.coroutines.Dispatchers.Main
  24 +import retrofit2.Call
  25 +import retrofit2.Callback
  26 +import retrofit2.Response
  27 +import java.net.SocketTimeoutException
21 28  
22 29  
23   -var BASE_URL = ""
24   -var serverPre: ServeInv? = null
  30 +private var serverPre: ServeInv? = null
  31 +private lateinit var navController: NavController
  32 +
25 33  
26 34 class ActuaMaestrosFragment : Fragment() {
  35 + private val job: Job = Job()
  36 + private val fragmentScopeAM = CoroutineScope(IO + job)
27 37  
28 38 override fun onCreate(savedInstanceState: Bundle?) {
29 39 super.onCreate(savedInstanceState)
30 40  
31   - GlobalScope.launch(Main) {
32   -
33   - serverPre = fetchServerPreOne()
34   - if (serverPre != null) {
35   - btnConfirmarAct.isEnabled = true
36   - if (serverPre!!.direccion.isNullOrEmpty()) {
37   - val modalDialog = NoServerConf()
38   - modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
39   - } else {
40   - BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puerto.toString() + "/"
41   - tvServerConectado.text = "Conectado al servidor: ${serverPre!!.descripcion}"
42   - }
43   - } else {
44   - val modalDialog = ServerNoConf()
45   - modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
46   -
47   - btnConfirmarAct.isEnabled = false
48   -
49   - }
50   - }
51   -
52   -// mostrarArticulos()
  41 +// val servidor = urlBajada((activity as MainActivity))
  42 +// if (servidor != "") {
  43 +// tvServerConectado.text = "Conectado al servidor: $servidor"
  44 +// }
53 45 }
54 46  
55   - private suspend fun fetchServerPreOne(): ServeInv? {
56   - return GlobalScope.async(IO) {
57   - return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServerPreOne()
58   - }.await()
  47 + override fun onDestroy() {
  48 + super.onDestroy()
  49 + fragmentScopeAM.cancel()
59 50 }
60 51  
61 52 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
62   - // Inflate the layout for this fragment
63 53 val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false)
64 54 val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct)
65 55 val obPorWifi = v.findViewById<RadioButton>(R.id.obPorWifi)
66   - val obImpInventarios= v.findViewById<RadioButton>(R.id.obImpInventarios)
  56 + val obImpInventarios = v.findViewById<RadioButton>(R.id.obImpInventarios)
  57 +
  58 + obPorWifi.setOnClickListener {
  59 + bConfirmarAct.text = ("Confirmar Importación")
  60 + }
  61 + obImpInventarios.setOnClickListener {
  62 + bConfirmarAct.text = ("Buscar Inventarios sectorizados en servidor")
  63 + }
67 64  
68 65 bConfirmarAct.setOnClickListener {
69   - loading_view.visibility = View.VISIBLE
70   - countriesList.text = "Obteniendo artículos del servidor, aguarde por favor."
71   - obtenerArticulos()
  66 + if (obPorWifi.isChecked) {
  67 + loading_view.visibility = View.VISIBLE
  68 + countriesList.text = ("Obteniendo artículos del servidor, aguarde por favor.")
  69 + obtenerArticulos()
  70 + }
  71 + if (obImpInventarios.isChecked) {
  72 + navController = Navigation.findNavController(v)
  73 + navController.navigate(R.id.action_actuaMaestrosFragment_to_invSecImpFragment)
  74 + }
72 75 }
73 76 return v
74 77 }
75 78  
76 79 private fun obtenerArticulos() {
  80 + fragmentScopeAM.launch(Main) {
  81 + try {
  82 + serverPre = fetchServerPreOne((activity as MainActivity))
  83 +
  84 + } catch (e: RuntimeException) {
  85 + Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show()
  86 + }
  87 + if (serverPre != null) {
  88 + if (serverPre!!.direccion.isNullOrEmpty()) {
  89 + val modalDialog = NoServerConf()
  90 + if (activity != null) {
  91 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  92 + }
  93 + } else {
  94 + BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puertoBajada.toString() + "/"
  95 + }
  96 + } else {
  97 + if (activity != null) {
  98 + val modalDialog = ServerNoConf()
  99 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  100 + }
  101 + }
  102 +
  103 +
  104 + try {
  105 + val call: Call<List<Productos?>?>? = WebService.instance
  106 + ?.createService(WebServiceApi::class.java)
  107 + ?.getProductos()
  108 + var index: Long = 1
  109 + call!!.enqueue(object : Callback<List<Productos?>?> {
  110 + override fun onResponse(call: Call<List<Productos?>?>?, response: Response<List<Productos?>?>) {
  111 + if (response.code() == 200) {
  112 + try {
  113 + for (pro in response.body()!!) {
  114 + val artiAcargar = Articles(
  115 + pro?.sector,
  116 + pro?.codigo,
  117 + pro?.descripcion,
  118 + pro?.codBar,
  119 + pro?.codOrigen,
  120 + pro?.precio,
  121 + pro?.costo,
  122 + pro?.exiVenta,
  123 + pro?.exiDeposito,
  124 + pro?.de,
  125 + pro?.balanza,
  126 + pro?.depSn,
  127 + pro?.imagen
  128 + )
  129 + index += index
  130 + insertarProducto(artiAcargar)
  131 + }
  132 + countriesList.visibility = View.VISIBLE
  133 + countriesList.text = "¡Datos Importados Correctamente!"
  134 + loading_view.visibility = View.GONE
  135 + } catch (e: SocketTimeoutException) {
  136 + countriesList.visibility = View.VISIBLE
  137 + countriesList.text = "¡Sin conexión al Servidor!"
  138 + loading_view.visibility = View.GONE
  139 + }
  140 + } else if (response.code() == 404) {
  141 + countriesList.visibility = View.VISIBLE
  142 + countriesList.text = "¡Sin conexión al Servidor!"
  143 + loading_view.visibility = View.GONE
  144 + }
  145 + }
  146 +
  147 + override fun onFailure(call: Call<List<Productos?>?>?, t: Throwable?) { countriesList.visibility = View.VISIBLE
  148 + countriesList.visibility = View.VISIBLE
  149 + countriesList.text = "¡Sin conexión al Servidor!"
  150 + loading_view.visibility = View.GONE
  151 + }
  152 + })
  153 + } catch (e: RuntimeException) {
  154 + countriesList.visibility = View.VISIBLE
  155 + countriesList.text = "Error ${e.message}"
  156 + loading_view.visibility = View.GONE
  157 + }
  158 + }
77 159 // val call = getInstance()
78 160 // ?.createService(WebServiceApi::class.java)
79 161 // ?.getProductos()
... ... @@ -127,7 +209,7 @@ class ActuaMaestrosFragment : Fragment() {
127 209 // withContext(IO) {
128 210 // val job = CoroutineScope(IO).launch {
129 211 // // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO
130   -// AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.deleteAllArticulos()
  212 +// AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.deleteAllArticulos()
131 213 // try {
132 214 // val response = WebServiceApi.
133 215 // if (response.isSuccessful) {
... ... @@ -149,7 +231,7 @@ class ActuaMaestrosFragment : Fragment() {
149 231 // pro.imagen
150 232 // )
151 233 // index += index
152   -// AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.insertArticulos(artiAcargar)
  234 +// AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.insertArticulos(artiAcargar)
153 235 // }
154 236 // withContext(Main) {
155 237 // countriesList.visibility = View.VISIBLE
... ... @@ -172,8 +254,6 @@ class ActuaMaestrosFragment : Fragment() {
172 254 // }
173 255 // }
174 256 // }
175   -
176   -
177 257 // withContext(Dispatchers.Main) {
178 258 // if (response.isSuccessful) {
179 259 // val call = WebService
... ... @@ -187,7 +267,7 @@ class ActuaMaestrosFragment : Fragment() {
187 267 // ) {
188 268 // if (response.code() == 200) {
189 269 // for (i in response.body()!!.indices) {
190   -// //AppDb.getAppDb(requireActivity())!!.ArticulosDAO()?.insertArticulos(response.body()!![i])
  270 +// //AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()?.insertArticulos(response.body()!![i])
191 271 // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "")
192 272 //// Log.d(
193 273 //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector
... ... @@ -206,23 +286,23 @@ class ActuaMaestrosFragment : Fragment() {
206 286 }
207 287  
208 288 fun insertarProducto(aCargar: Articles) {
209   - lifecycleScope.launch {
  289 + fragmentScopeAM.launch {
210 290 withContext(IO) {
211   - AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.insertArticulos(aCargar)
  291 + AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.insertArticulos(aCargar)
212 292 }
213 293 }
214 294 }
215 295  
216 296 fun mostrarArticulos() {
217   - val Job = GlobalScope.launch {
  297 + fragmentScopeAM.launch {
218 298 var listArticulos: List<Articles>? = null
219 299 var temp: String = ""
220   - listArticulos = AppDb.getAppDb(requireActivity())?.ArticulosDAO()?.findAllArticulos()
  300 + listArticulos = AppDb.getAppDb((activity as MainActivity))?.ArticulosDAO()?.findAllArticulos()
221 301 if (listArticulos != null) {
222 302  
223 303 for (i in listArticulos.indices) temp += listArticulos[i].codigo.toString()
224 304 }
225   - withContext(Dispatchers.Main) {
  305 + withContext(Main) {
226 306 countriesList.visibility = View.VISIBLE
227 307 loading_view.visibility = View.GONE
228 308 countriesList?.text = temp
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/InvImportadosFragment.kt
... ... @@ -1,24 +0,0 @@
1   -package com.focasoftware.deboinventariov20.UI.actualizacionMaestros
2   -
3   -import android.os.Bundle
4   -import androidx.fragment.app.Fragment
5   -import android.view.LayoutInflater
6   -import android.view.View
7   -import android.view.ViewGroup
8   -import com.focasoftware.deboinventariov20.R
9   -
10   -class InvImportadosFragment : Fragment() {
11   -
12   - override fun onCreate(savedInstanceState: Bundle?) {
13   - super.onCreate(savedInstanceState)
14   -
15   - }
16   -
17   - override fun onCreateView(
18   - inflater: LayoutInflater, container: ViewGroup?,
19   - savedInstanceState: Bundle?
20   - ): View? {
21   - // Inflate the layout for this fragment
22   - return inflater.inflate(R.layout.fragment_inv_importados, container, false)
23   - }
24   -}
25 0 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/InvSecHeadListAdapter.kt
... ... @@ -0,0 +1,43 @@
  1 +package com.focasoftware.deboinventariov20.UI.actualizacionMaestros
  2 +
  3 +import android.content.Context
  4 +import android.view.LayoutInflater
  5 +import android.view.View
  6 +import android.view.ViewGroup
  7 +import androidx.recyclerview.widget.RecyclerView
  8 +import com.focasoftware.deboinventariov20.R
  9 +import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder
  10 +import kotlinx.android.synthetic.main.item_inv_importados.view.*
  11 +
  12 +
  13 +class InvSecHeadListAdapter(
  14 + private val context: Context, private val invHead: ArrayList<ItemsInvSecHead>, private val itemCheckListener: OnCheckListener
  15 +) : RecyclerView.Adapter<BaseViewHolder<*>>() {
  16 +
  17 + interface OnCheckListener {
  18 + fun onItemCheck(inventario: String?)
  19 + }
  20 +
  21 + override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item_inv_importados, parent, false))
  22 +
  23 + override fun getItemCount() = invHead.size
  24 +
  25 + override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) {
  26 + when (holder) {
  27 + is ItemsViewHolder -> {
  28 + holder.bind(invHead[position], position)
  29 + }
  30 + }
  31 + }
  32 +
  33 + inner class ItemsViewHolder(itemView: View) : BaseViewHolder<ItemsInvSecHead>(itemView) {
  34 + override fun bind(item: ItemsInvSecHead, position: Int) {
  35 + itemView.tvPrincipalinventario.setOnCheckedChangeListener { button, b -> itemCheckListener.onItemCheck(item.invnum.toString()) }
  36 + itemView.tvPrincipalinventario.text = item.invnum.toString() + "-" + item.detalle.toString() + " " + item.fecha.toString()
  37 + }
  38 + }
  39 +}
  40 +
  41 +
  42 +
  43 +
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/InvSecImpFragment.kt
... ... @@ -0,0 +1,300 @@
  1 +package com.focasoftware.deboinventariov20.UI.actualizacionMaestros
  2 +
  3 +import android.app.AlertDialog
  4 +import android.content.DialogInterface
  5 +import android.os.Bundle
  6 +import android.view.LayoutInflater
  7 +import android.view.View
  8 +import android.view.ViewGroup
  9 +import android.widget.Button
  10 +import android.widget.ProgressBar
  11 +import android.widget.TextView
  12 +import android.widget.Toast
  13 +import androidx.fragment.app.Fragment
  14 +import androidx.navigation.NavController
  15 +import androidx.navigation.Navigation
  16 +import androidx.recyclerview.widget.LinearLayoutManager
  17 +import androidx.recyclerview.widget.RecyclerView
  18 +import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
  19 +import com.focasoftware.deboinventariov20.Model.*
  20 +import com.focasoftware.deboinventariov20.R
  21 +import com.focasoftware.deboinventariov20.UI.MainActivity
  22 +import com.focasoftware.deboinventariov20.UI.Utils.*
  23 +import kotlinx.android.synthetic.main.fragment_inv_importados.*
  24 +import kotlinx.coroutines.*
  25 +import kotlinx.coroutines.Dispatchers.IO
  26 +import kotlinx.coroutines.Dispatchers.Main
  27 +import retrofit2.Call
  28 +import retrofit2.Callback
  29 +import retrofit2.Response
  30 +import java.lang.Thread.sleep
  31 +import java.net.SocketTimeoutException
  32 +
  33 +private lateinit var viewAdapter: RecyclerView.Adapter<*>
  34 +private lateinit var viewManager: RecyclerView.LayoutManager
  35 +private lateinit var recicler: RecyclerView
  36 +private var listInv = ArrayList<ItemsInvSecHead>()
  37 +private var serverPre: ServeInv? = null
  38 +var invSeleccionados = mutableListOf<String>()
  39 +private lateinit var navController: NavController
  40 +
  41 +class InvSecImpFragment : Fragment(), InvSecHeadListAdapter.OnCheckListener {
  42 + private val job: Job = Job()
  43 + private val fragmentScopeInvSec = CoroutineScope(Dispatchers.IO + job)
  44 +
  45 + override fun onCreate(savedInstanceState: Bundle?) {
  46 + super.onCreate(savedInstanceState)
  47 + invSeleccionados.clear()
  48 + }
  49 + override fun onDestroy() {
  50 + super.onDestroy()
  51 + fragmentScopeInvSec.cancel()
  52 + }
  53 + override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
  54 + super.onViewCreated(view, savedInstanceState)
  55 + val navController = Navigation.findNavController(view)
  56 + val btnConfirmarAct = view.findViewById<Button>(R.id.btnConfirmarAct)
  57 + val pbInvSec = view.findViewById<ProgressBar>(R.id.pbInvSec)
  58 + val tvMensaje = view.findViewById<TextView>(R.id.tvMensaje)
  59 + recicler = view.findViewById(R.id.rcDescripcion)
  60 +
  61 + fragmentScopeInvSec.launch(Main) {
  62 + invSeleccionados.clear()
  63 + pbInvSec.visibility = View.VISIBLE
  64 + recicler.visibility = View.GONE
  65 + try {
  66 + serverPre = fetchServerPreOne(requireActivity())
  67 + } catch (e: RuntimeException) {
  68 +
  69 + Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show()
  70 + }
  71 + if (serverPre != null) {
  72 + if (serverPre!!.direccion.isNullOrEmpty()) {
  73 + val modalDialog = NoServerConf()
  74 + if (activity != null) {
  75 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  76 + }
  77 + } else {
  78 + BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puertoSubida.toString() + "/"
  79 + listInv.clear()
  80 + try {
  81 +// val call: Call<List<InvHeadSecR?>?>? = WebService.instance
  82 +// ?.createService(WebServiceApi::class.java)
  83 +// ?.getHeadInvSec()
  84 + ItomInv.request.getHeadInvSec()
  85 + ?.enqueue(object : Callback<List<InvHeadSecR?>?> {
  86 +// call!!.enqueue(object : Callback<List<InvHeadSecR?>?> {
  87 + override fun onResponse(call: Call<List<InvHeadSecR?>?>?, response: Response<List<InvHeadSecR?>?>) {
  88 + if (response.code() == 200) {
  89 + try {
  90 + for (inv in response.body()!!) {
  91 + cargarRecicler(inv?.invNum, inv!!.detalle, inv.fechaInicio, inv.depsn)
  92 + }
  93 + } catch (e: SocketTimeoutException) {
  94 + }
  95 + } else if (response.code() == 404) {
  96 + tvSeleccionInventario.visibility = View.VISIBLE
  97 + tvMensaje.visibility = View.VISIBLE
  98 + tvMensaje.text = "No hay inventarios disponibles."
  99 + pbInvSec.visibility = View.GONE
  100 + }
  101 + }
  102 +
  103 + override fun onFailure(call: Call<List<InvHeadSecR?>?>?, t: Throwable?) {}
  104 + })
  105 + } catch (e: RuntimeException) {
  106 + tvSeleccionInventario.visibility = View.VISIBLE
  107 + tvMensaje.visibility = View.VISIBLE
  108 + tvMensaje.text = "Error ${e.message}"
  109 + pbInvSec.visibility = View.GONE
  110 + tvMensaje.visibility = View.GONE
  111 + }
  112 + // obtenerInvSectorizados()
  113 + }
  114 + } else {
  115 + if (activity != null) {
  116 + val modalDialog = ServerNoConf()
  117 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  118 + }
  119 + }
  120 + pbInvSec.visibility = View.GONE
  121 + recicler.visibility = View.VISIBLE
  122 +
  123 + }
  124 +
  125 +
  126 + btnConfirmarAct.setOnClickListener {
  127 + var entroAlFor=false
  128 + for (inv in invSeleccionados) {
  129 + entroAlFor=true
  130 + GlobalScope.launch(Main) {
  131 + deleteAllInvHeadSec(inv.toInt())
  132 + deleteAllInvBodySec(inv.toInt())
  133 + }
  134 + val aEnviar: NumInvSec = NumInvSec(inv)
  135 +// val call: Call<List<InvBodySecR?>?>? = WebService.instance
  136 +// ?.createService(WebServiceApi::class.java)
  137 +// ?.getBodyInvSec(aEnviar)
  138 +// call!!.enqueue(object : Callback<List<InvBodySecR?>?> {
  139 + ItomInv.request.getBodyInvSec(aEnviar)
  140 + ?.enqueue(object : Callback<List<InvBodySecR?>?> {
  141 + override fun onResponse(call: Call<List<InvBodySecR?>?>?, response: Response<List<InvBodySecR?>?>) {
  142 +
  143 + if (response.code() == 200) {
  144 + try {
  145 + preparaParaInsertar(response.body(), inv)
  146 + } catch (e: SocketTimeoutException) {
  147 + }
  148 + } else if (response.code() == 404) {
  149 + }
  150 + }
  151 +
  152 + override fun onFailure(call: Call<List<InvBodySecR?>?>?, t: Throwable?) {}
  153 + })
  154 + }
  155 + if (entroAlFor) {
  156 + recicler.visibility = View.GONE
  157 + btnConfirmarAct.isEnabled = false
  158 + val modalDialog = InvSecImp()
  159 + modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
  160 + }
  161 +// navController.navigate(R.id.action_invSecImpFragment_to_mainFragment2)
  162 + }
  163 + }
  164 +
  165 + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
  166 + val v = inflater.inflate(R.layout.fragment_inv_importados, container, false)
  167 + return v
  168 + }
  169 +
  170 + private fun preparaParaInsertar(list: List<InvBodySecR?>?, inv: String) {
  171 +
  172 + fragmentScopeInvSec.launch(Main) {
  173 + if (list != null) {
  174 + for (head in listInv) {
  175 + if (inv.toInt() == head.invnum) {
  176 + val invHeadTemp = InvHeadSec(head.invnum, head.detalle, head.fecha, head.deposito == 1, "", head.fecha, 0)
  177 + insertInvHeadSec(invHeadTemp)
  178 + break
  179 + }
  180 + }
  181 + for (body in list) {
  182 + val invBodyTemp = InvBodySec(
  183 + body!!.INV.toInt(), body.SEC, body.ART, body.DET, body.PRE,
  184 + body.uniVta,
  185 + body.COS, "", body.DEPSN!!.toInt() != 0, body.EXIVTA, body.EXIDEP, body.CODBAR, "", ""
  186 + )
  187 + insertInvBodySec(invBodyTemp)
  188 + }
  189 + }
  190 + sleep(500)
  191 + buscarCantArtInvSecHead(inv)
  192 + sleep(500)
  193 + }
  194 + }
  195 +
  196 + fun cargarRecicler(invNum: Int?, detalle: String?, fechaInicio: String?, deposito: Int?) {
  197 + //TODO CARGO EN LE RV
  198 + val item = ItemsInvSecHead(invNum, detalle, fechaInicio, deposito)
  199 + listInv.add(item)
  200 +
  201 + viewAdapter = InvSecHeadListAdapter(requireContext(), listInv, this)
  202 + viewManager = LinearLayoutManager(requireContext())
  203 + // deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!!
  204 + recicler.apply {
  205 + adapter = viewAdapter
  206 + layoutManager = viewManager
  207 + }
  208 + }
  209 +
  210 + override fun onItemCheck(inventario: String?) {
  211 + if (inventario in invSeleccionados) {
  212 + invSeleccionados.removeIf { it == inventario }
  213 + } else {
  214 + fragmentScopeInvSec.launch(Main) {
  215 + var invBodySec: List<InvBodySec>? = null
  216 + invBodySec = verificoExisteInvSec(inventario!!.toInt())
  217 + if (!invBodySec.isNullOrEmpty()) {
  218 + AlertDialog.Builder(requireContext()).setTitle("El inventario $inventario ya se encuentra cargado.").setMessage(" Si continúa se perderan los datos ingresados.")
  219 + .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which ->
  220 + invSeleccionados.add(inventario)
  221 + }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which ->
  222 +
  223 + }).show()
  224 + } else invSeleccionados.add(inventario)
  225 + }
  226 + }
  227 + }
  228 +
  229 + private suspend fun insertInvBodySec(inventario: InvBodySec) {
  230 + return withContext(fragmentScopeInvSec.coroutineContext + IO) {
  231 + AppDb.getAppDb(requireActivity())!!.InvBodySecDAO()!!.insertInvBodySec(inventario)
  232 + }
  233 + }
  234 +
  235 + private suspend fun insertInvHeadSec(inventario: InvHeadSec) {
  236 + return withContext(fragmentScopeInvSec.coroutineContext + IO) {
  237 + AppDb.getAppDb(requireActivity())!!.InvHeadSecDAO()!!.insertInvHeadSec(inventario)
  238 + }
  239 + }
  240 +
  241 + private suspend fun deleteAllInvHeadSec(invNum: Int) {
  242 + return withContext(fragmentScopeInvSec.coroutineContext + IO) {
  243 + AppDb.getAppDb(requireContext())!!.InvHeadSecDAO()!!.deleteAllInvHeadSec(invNum)
  244 + }
  245 + }
  246 +
  247 + private suspend fun deleteAllInvBodySec(invNum: Int) {
  248 + return withContext(fragmentScopeInvSec.coroutineContext + IO) {
  249 + AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.deleteAllInvBodySec(invNum)
  250 + }
  251 + }
  252 +
  253 + private suspend fun buscarCantArtInvSecHead(invNum: String) {
  254 + return withContext(fragmentScopeInvSec.coroutineContext + IO) {
  255 + val arti = mutableListOf<String>()
  256 + val invBodySec: List<InvBodySec> = fetchInvSecBodyGroup(invNum)
  257 +// var cant = 0
  258 +// var encontrado: Boolean
  259 +// var first = false
  260 +// for (inv in invBodySec) {
  261 +// if (!first) {
  262 +// arti.add(inv.sector.toString() + inv.codigo.toString())
  263 +// first = true
  264 +// cant += 1
  265 +// } else {
  266 +// encontrado = false
  267 +// for (ar in arti) {
  268 +//
  269 +// +
  270 +// if (ar == inv.sector.toString() + inv.codigo.toString()) {
  271 +// encontrado = true
  272 +// break
  273 +// }
  274 +// }
  275 +// if (!encontrado) {
  276 +// cant += 1
  277 +// arti.add(inv.sector.toString() + inv.codigo.toString())
  278 +// }
  279 +// }
  280 +// }
  281 + AppDb.getAppDb(requireActivity())!!.InvHeadSecDAO()!!.updateCantArtInvSecHead(invNum.toInt(), invBodySec.count())
  282 + }
  283 + }
  284 +
  285 + private suspend fun verificoExisteInvSec(invNum: Int): List<InvBodySec> {
  286 + var busqueda: List<InvBodySec>
  287 + return fragmentScopeInvSec.async(IO) {
  288 + busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.verificoExisteInvSec(invNum)
  289 + return@async busqueda
  290 + }.await()
  291 + }
  292 +
  293 + private suspend fun fetchInvSecBodyGroup(invNum: String): List<InvBodySec> {
  294 + var busqueda: List<InvBodySec>
  295 + return fragmentScopeInvSec.async(IO) {
  296 + busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.fetchInvSecBodyGroup(invNum)
  297 + return@async busqueda
  298 + }.await()
  299 + }
  300 +}
0 301 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/ItemsInvSecHead.kt
... ... @@ -0,0 +1,5 @@
  1 +package com.focasoftware.deboinventariov20.UI.actualizacionMaestros
  2 +
  3 +data class ItemsInvSecHead(val invnum: Int?, val detalle: String?, val fecha: String?, val deposito: Int?) {
  4 +
  5 +}
0 6 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/configuracion/ConfiguracionFragment.kt
... ... @@ -8,20 +8,24 @@ import android.view.View
8 8 import android.view.ViewGroup
9 9 import android.widget.*
10 10 import androidx.fragment.app.Fragment
11   -import androidx.fragment.app.FragmentActivity
12 11 import androidx.lifecycle.lifecycleScope
13 12 import androidx.navigation.NavController
14 13 import androidx.navigation.Navigation
15 14 import androidx.navigation.fragment.findNavController
16 15 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
17   -import com.focasoftware.deboinventariov20.Model.ServeInv
  16 +import com.focasoftware.deboinventariov20.Model.*
18 17 import com.focasoftware.deboinventariov20.R
19   -import com.focasoftware.deboinventariov20.UI.Utils.isConnectedToThisServer
20   -import com.focasoftware.deboinventariov20.UI.Utils.ServerNoValido
21   -import com.focasoftware.deboinventariov20.UI.Utils.ServerValido
  18 +import com.focasoftware.deboinventariov20.UI.MainActivity
  19 +import com.focasoftware.deboinventariov20.UI.Utils.*
22 20 import kotlinx.android.synthetic.main.fragment_configuracion.*
23 21 import kotlinx.coroutines.*
24 22 import kotlinx.coroutines.Dispatchers.Main
  23 +import retrofit2.Call
  24 +import retrofit2.Callback
  25 +import retrofit2.Response
  26 +import java.net.SocketTimeoutException
  27 +import kotlin.math.absoluteValue
  28 +
25 29  
26 30 class ConfiguracionFragment : Fragment() {
27 31  
... ... @@ -32,7 +36,7 @@ class ConfiguracionFragment : Fragment() {
32 36  
33 37 override fun onCreate(savedInstanceState: Bundle?) {
34 38 super.onCreate(savedInstanceState)
35   - sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
  39 + sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
36 40 }
37 41  
38 42 override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
... ... @@ -61,22 +65,20 @@ class ConfiguracionFragment : Fragment() {
61 65 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
62 66  
63 67 val v = inflater.inflate(R.layout.fragment_configuracion, container, false)
64   - val etRuta = v.findViewById<EditText>(R.id.etRuta)
65 68 val btnGuardar = v.findViewById<Button>(R.id.btnGuardar)
66 69 val rbProInclu = v.findViewById<RadioButton>(R.id.rbProInclu)
67 70 val rbProNoInclu = v.findViewById<RadioButton>(R.id.rbProNoInclu)
68 71 val cbHabiLectura = v.findViewById<CheckBox>(R.id.cbHabiLectura)
69 72 val cbMostrarStock = v.findViewById<CheckBox>(R.id.cbMostrarStock)
70   - val rbCodigoBarras = v.findViewById<RadioButton>(R.id.rbCodigoBarras)
71   - val rbCodigoDebo = v.findViewById<RadioButton>(R.id.rbCodigoDebo)
72   - val rbCodigoOrigen = v.findViewById<RadioButton>(R.id.rbCodigoOrigen)
  73 +// val rbCodigoBarras = v.findViewById<RadioButton>(R.id.rbCodigoBarras)
  74 +// val rbCodigoDebo = v.findViewById<RadioButton>(R.id.rbCodigoDebo)
  75 +// val rbCodigoOrigen = v.findViewById<RadioButton>(R.id.rbCodigoOrigen)
73 76 val rbDeposito = v.findViewById<RadioButton>(R.id.rbDeposito)
74 77 val rbVentas = v.findViewById<RadioButton>(R.id.rbVentas)
75   - val cbMostrarExistencia = v.findViewById<CheckBox>(R.id.cbMostrarExistencia)
76   - val cbMostrarPrecio = v.findViewById<CheckBox>(R.id.cbMostrarPrecio)
77 78 val btnAgregarServidor = v.findViewById<Button>(R.id.btnAgregarServidor)
78 79 val spServidor = v.findViewById<Spinner>(R.id.spServidor)
79 80 val btnValidarServidor = v.findViewById<Button>(R.id.btnValidarServidor)
  81 + val cbAskTimeServerToStart = v.findViewById<CheckBox>(R.id.cbAskTimeServerToStart)
80 82  
81 83 if (sharedPreferences.contains("etRuta")) if (sharedPreferences.contains("rbProInclu")) {
82 84 if (sharedPreferences.getString("rbProInclu", "").toString() == "0") {
... ... @@ -134,55 +136,94 @@ class ConfiguracionFragment : Fragment() {
134 136 }
135 137 } else (sharedPreferences.getString("rbDeposito", "").toString() == "")
136 138  
137   - if (sharedPreferences.contains("rbCodigoDebo")) {
138   - if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "0") {
139   - rbCodigoDebo.isChecked = false
140   - rbCodigoOrigen.isChecked = false
141   - rbCodigoBarras.isChecked = false
142   - } else if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "1") {
143   - rbCodigoDebo.isChecked = true
144   - rbCodigoOrigen.isChecked = false
145   - rbCodigoBarras.isChecked = false
  139 +// if (sharedPreferences.contains("rbCodigoDebo")) {
  140 +// if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "0") {
  141 +// rbCodigoDebo.isChecked = false
  142 +// rbCodigoOrigen.isChecked = false
  143 +// rbCodigoBarras.isChecked = false
  144 +// } else if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "1") {
  145 +// rbCodigoDebo.isChecked = true
  146 +// rbCodigoOrigen.isChecked = false
  147 +// rbCodigoBarras.isChecked = false
  148 +// }
  149 +// } else (sharedPreferences.getString("rbCodigoDebo", "").toString() == "")
  150 +//
  151 +// if (sharedPreferences.contains("rbCodigoOrigen")) {
  152 +// if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "0") {
  153 +// rbCodigoOrigen.isChecked = false
  154 +// } else if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "1") {
  155 +// rbCodigoOrigen.isChecked = true
  156 +// }
  157 +// } else (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "")
  158 +
  159 +// if (sharedPreferences.contains("rbCodigoBarras")) {
  160 +// if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "0") {
  161 +// rbCodigoBarras.isChecked = false
  162 +// } else if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "1") {
  163 +// rbCodigoBarras.isChecked = true
  164 +// }
  165 +// } else (sharedPreferences.getString("rbCodigoBarras", "").toString() == "")
  166 +
  167 + if (sharedPreferences.contains("cbAskTimeServerToStart")) {
  168 + if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "0") {
  169 + cbAskTimeServerToStart.isChecked = false
  170 + } else if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "1") {
  171 + cbAskTimeServerToStart.isChecked = true
146 172 }
147   - } else (sharedPreferences.getString("rbCodigoDebo", "").toString() == "")
  173 + } else (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "")
148 174  
149   - if (sharedPreferences.contains("rbCodigoOrigen")) {
150   - if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "0") {
151   - rbCodigoOrigen.isChecked = false
152   - } else if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "1") {
153   - rbCodigoOrigen.isChecked = true
154   - }
155   - } else (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "")
156 175  
157   - if (sharedPreferences.contains("rbCodigoBarras")) {
158   - if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "0") {
159   - rbCodigoBarras.isChecked = false
160   - } else if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "1") {
161   - rbCodigoBarras.isChecked = true
162   - }
163   - } else (sharedPreferences.getString("rbCodigoBarras", "").toString() == "")
  176 + btnGuardar.setOnClickListener {
  177 + guardarPreferencias()
  178 + GlobalScope.launch(Main) {
164 179  
165   - if (sharedPreferences.contains("cbMostrarExistencia")) {
166   - if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "0") {
167   - cbMostrarExistencia.isChecked = false
168   - } else if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "1") {
169   - cbMostrarExistencia.isChecked = true
170   - }
171   - } else (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "")
  180 + val serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne()
  181 + if (serverBajada != null) {
  182 + if (serverBajada.direccion.isNullOrEmpty()) {
  183 + val modalDialog = NoServerConf()
  184 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  185 + } else {
  186 + BASE_URL = serverBajada.direccion.toString() + ":" + serverBajada.puertoBajada.toString() + "/"
  187 + val call: Call<List<Time?>?>? = WebService.instance
  188 + ?.createService(WebServiceApi::class.java)
  189 + ?.getTime()
  190 + call!!.enqueue(object : Callback<List<Time?>?> {
  191 + override fun onResponse(call: Call<List<Time?>?>?, response: Response<List<Time?>?>) {
  192 + if (response.code() == 200) {
  193 + try {
  194 + val timeServer =
  195 + response.body()?.get(0)?.dia + "/" +
  196 + response.body()?.get(0)?.mes + "/" +
  197 + response.body()?.get(0)?.ano + " " +
  198 + response.body()?.get(0)?.hora + ":" +
  199 + response.body()?.get(0)?.minutos + ":" +
  200 + response.body()?.get(0)?.segundos
  201 + val horaServer = response.body()?.get(0)?.hora + "" +
  202 + response.body()?.get(0)?.minutos + "" +
  203 + response.body()?.get(0)?.segundos
  204 + val fechaServer = response.body()?.get(0)?.dia + "" +
  205 + response.body()?.get(0)?.mes + "" +
  206 + response.body()?.get(0)?.ano
  207 + if (!askTimeServer(timeServer, horaServer, fechaServer)) {
  208 +// Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_SHORT).show()
  209 +// navController.navigate(R.id.action_configuracionFragment_to_mainFragment2)
  210 + }
  211 + } catch (e: SocketTimeoutException) {
  212 +
  213 + }
  214 + } else if (response.code() == 400) {
  215 + }
  216 + }
  217 +
  218 + override fun onFailure(call: Call<List<Time?>?>?, t: Throwable?) {}
  219 + })
  220 +
  221 + Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_SHORT).show()
  222 + navController.navigate(R.id.action_configuracionFragment_to_mainFragment2)
172 223  
173   - if (sharedPreferences.contains("cbMostrarPrecio")) {
174   - if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "0") {
175   - cbMostrarPrecio.isChecked = false
176   - } else if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "1") {
177   - cbMostrarPrecio.isChecked = true
  224 + }
  225 + }
178 226 }
179   - } else (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "")
180   -
181   - btnGuardar.setOnClickListener {
182   - guardarPreferencias()
183   - Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_LONG)
184   - .show()
185   - navController.navigate(R.id.action_configuracionFragment_to_mainFragment2)
186 227 }
187 228 btnAgregarServidor.setOnClickListener { findNavController().navigate(R.id.servidoresFragment) }
188 229  
... ... @@ -196,32 +237,40 @@ class ConfiguracionFragment : Fragment() {
196 237  
197 238 btnValidarServidor.setOnClickListener {
198 239 GlobalScope.launch(Main) {
199   -
200 240 val serverPre = fetchServer()
201 241 if (serverPre != null) {
202 242 if (isConnectedToThisServer(serverPre.direccion.toString().substring(7, serverPre.direccion.toString().length))) {
203 243 val modalDialog = ServerValido()
204   - modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
  244 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
205 245 } else {
206 246 val modalDialog = ServerNoValido()
207   - modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
  247 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
208 248 }
209 249 }
210 250 }
211 251 }
212 252  
  253 + rbVentas.setOnClickListener {
  254 + val modalDialog = SelAreaInventarioVentas()
  255 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  256 + }
  257 +
  258 + rbDeposito.setOnClickListener {
  259 + val modalDialog = SelAreaInventarioDeposito()
  260 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  261 + }
213 262 return v
214 263 }
215 264  
216 265 private suspend fun fetchServer(): ServeInv? {
217 266 return GlobalScope.async(Dispatchers.IO) {
218   - return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServer(itemSelect)
  267 + return@async AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServer(itemSelect)
219 268 }.await()
220 269 }
221 270  
222   - suspend fun getDescServers(): List<ServeInv> {
  271 + private suspend fun getDescServers(): List<ServeInv> {
223 272 return GlobalScope.async(Dispatchers.IO) {
224   - return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchAllServers()
  273 + return@async AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchAllServers()
225 274 }.await()
226 275 }
227 276  
... ... @@ -235,13 +284,9 @@ class ConfiguracionFragment : Fragment() {
235 284 if (rbProNoInclu.isChecked) editor?.putString("rbProNoInclu", "1") else editor?.putString("rbProNoInclu", "0")
236 285 if (cbHabiLectura.isChecked) editor?.putString("cbHabiLectura", "1") else editor?.putString("cbHabiLectura", "0")
237 286 if (cbMostrarStock.isChecked) editor?.putString("cbMostrarStock", "1") else editor?.putString("cbMostrarStock", "0")
238   - if (rbVentas.isChecked) editor?.putString("rbVentas","1") else editor?.putString("rbVentas", "0")
239   - if (rbDeposito.isChecked) editor?.putString("rbDeposito","1") else editor?.putString("rbDeposito", "0")
240   -// if (rbCodigoDebo.isChecked) editor?.putString("rbCodigoDebo", "1") else editor?.putString("rbCodigoDebo", "0")
241   -// if (rbCodigoOrigen.isChecked) editor?.putString("rbCodigoOrigen", "1") else editor?.putString("rbCodigoOrigen", "0")
242   -// if (rbCodigoBarras.isChecked) editor?.putString("rbCodigoBarras", "1") else editor?.putString("rbCodigoBarras", "0")
243   -// if (cbMostrarExistencia.isChecked) editor?.putString("cbMostrarExistencia", "1") else editor?.putString("cbMostrarExistencia", "0")
244   -// if (cbMostrarPrecio.isChecked) editor?.putString("cbMostrarPrecio", "1") else editor?.putString("cbMostrarPrecio", "0")
  287 + if (rbVentas.isChecked) editor?.putString("rbVentas", "1") else editor?.putString("rbVentas", "0")
  288 + if (rbDeposito.isChecked) editor?.putString("rbDeposito", "1") else editor?.putString("rbDeposito", "0")
  289 + if (cbAskTimeServerToStart.isChecked) editor?.putString("cbAskTimeServerToStart", "1") else editor?.putString("cbAskTimeServerToStart", "0")
245 290 editor?.putString("ServerPredeterminado", indexSelect.toString())
246 291 updateServerPreInZero()
247 292 updateServerPre(itemSelect)
... ... @@ -255,13 +300,29 @@ class ConfiguracionFragment : Fragment() {
255 300 }
256 301 }
257 302  
  303 + private fun askTimeServer(timeServer: String, horaServer: String, fechaServer: String): Boolean {
  304 +
  305 + var existeDiferencias = false
  306 + val horaAct = obtenerHoraActual().toDouble()
  307 + val fechaAct = obtenerDiaActual().toDouble()
  308 + val difFecha = fechaAct - fechaServer.toDouble()
  309 + val difHora = horaAct - horaServer.toDouble()
  310 + if (difFecha.absoluteValue > 0) existeDiferencias = true
  311 + if (difHora.absoluteValue > 130) existeDiferencias = true
  312 +
  313 + if (existeDiferencias) {
  314 + dialogoHoraServer((activity as MainActivity), requireContext(), obtenerFechaActual(), timeServer)
  315 + }
  316 + return existeDiferencias
  317 + }
  318 +
258 319 private fun updateServerPreInZero() {
259 320 lifecycleScope.launch {
260 321 withContext(Dispatchers.IO) {
261   - val activity: FragmentActivity? = activity
262   - if (activity != null && isAdded) {
263   - AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.UpdateServerPreInZero()
264   - }
  322 +// val activity: FragmentActivity? = activity
  323 +// if (activity != null && isAdded) {
  324 + AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.UpdateServerPreInZero()
  325 +// }
265 326 }
266 327 }
267 328 }
... ... @@ -269,17 +330,14 @@ class ConfiguracionFragment : Fragment() {
269 330 private fun updateServerPre(server: Int) {
270 331 lifecycleScope.launch {
271 332 withContext(Dispatchers.IO) {
272   - val activity: FragmentActivity? = activity
273   - if (activity != null) {
274   - AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.UpdateServerPre(server)
275   - }
  333 +// val activity: FragmentActivity? = activity
  334 +// if (activity != null) {
  335 + AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.UpdateServerPre(server)
  336 +// }
276 337 }
277 338 }
278 339 }
  340 +}
  341 +
  342 +
279 343  
280   - private suspend fun fetchServerPreOne(): ServeInv? {
281   - return GlobalScope.async(Dispatchers.IO) {
282   - return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServerPreOne()
283   - }.await()
284   - }
285   -}
286 344 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripCorigenFragment/CodigoOriFragment.kt
... ... @@ -49,6 +49,7 @@ class CodigoOriFragment : Fragment() {
49 49 lateinit var sharedPreferences: SharedPreferences
50 50 private var artCargadoEnBD: InvBody? = null
51 51 lateinit var mDialogViewM: View
  52 + var resultadoTemp:Float=0F
52 53  
53 54 override fun onCreate(savedInstanceState: Bundle?) {
54 55 super.onCreate(savedInstanceState)
... ... @@ -153,7 +154,8 @@ class CodigoOriFragment : Fragment() {
153 154 val mBuilder = AlertDialog.Builder(context).setView(mDialogViewM).setCancelable(false)
154 155 if (artCargadoEnBD!!.balanza.toString().contains("1") || artCargadoEnBD!!.balanza.toString().contains("3") || artCargadoEnBD!!.balanza.toString().contains("7")) mDialogViewM.tvNuevaCantidad.inputType= InputType.TYPE_CLASS_NUMBER
155 156 mDialogViewM.tvTitulo2.text="${artCargadoEnBD!!.descripcion}"
156   - mDialogViewM.tvCantInicial.text =String.format("%.2f", artCargadoEnBD!!.cantTomada.toString().toFloat())
  157 + mDialogViewM.tvCantInicial.text = (Math.round(artCargadoEnBD!!.cantTomada.toString().toFloat() * 100.0) / 100.0).toString()
  158 +
157 159  
158 160 val mAlertDialog = mBuilder.show()
159 161 mDialogViewM.tvNuevaCantidad.requestFocus()
... ... @@ -164,15 +166,15 @@ class CodigoOriFragment : Fragment() {
164 166  
165 167 mDialogViewM.rbSumar.setOnClickListener {
166 168 if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
167   - mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat()))
168   -// mDialogView.tvNuevaCantidad.isEnabled=false
  169 + resultadoTemp=mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat()
  170 + mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString()
169 171 }
170 172 }
171 173 mDialogViewM.rbRestar.setOnClickListener {
172 174 if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
173 175 if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) {
174   - mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat())
175   -// mDialogView.tvNuevaCantidad.isEnabled = false
  176 + resultadoTemp= mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()
  177 + mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString()
176 178 }else{
177 179 mDialogViewM.tvResultado.text=""
178 180 mDialogViewM.tvResultado.error = "Operación No Valida"
... ... @@ -183,8 +185,7 @@ class CodigoOriFragment : Fragment() {
183 185 }
184 186 mDialogViewM.rbMdodificar.setOnClickListener {
185 187 if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
186   - mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvNuevaCantidad.text.toString().toFloat()))
187   -// mDialogView.tvNuevaCantidad.isEnabled = false
  188 + mDialogViewM.tvResultado.text = (Math.round(mDialogViewM.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString()
188 189 }
189 190 }
190 191 mDialogViewM.btnAceptar.setOnClickListener {
... ... @@ -267,33 +268,38 @@ class CodigoOriFragment : Fragment() {
267 268 }
268 269 private val textWatcher = object : TextWatcher {
269 270 override fun afterTextChanged(s: Editable?) {
  271 + if (mDialogViewM.tvNuevaCantidad.text.toString() == "") { mDialogViewM.tvResultado.text = ""}
270 272 }
271 273  
272 274 override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
273 275 }
274 276  
275 277 override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
276   - if (mDialogViewM.rbSumar.isChecked) {
277   -// mDialogView.tvNuevaCantidad.isEnabled=false
278   - mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat())
279   - }
280   - if (mDialogViewM.rbRestar.isChecked) {
281   - if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
282   - if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) {
283   - mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat())
  278 + if (mDialogViewM.tvNuevaCantidad.text.toString() != "") {
  279 +
  280 + if (mDialogViewM.rbSumar.isChecked) {
  281 + resultadoTemp = mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat()
  282 + mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString()
  283 + }
  284 + if (mDialogViewM.rbRestar.isChecked) {
  285 + if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
  286 + if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) {
  287 + resultadoTemp = mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()
  288 + mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString()
284 289 // mDialogView.tvNuevaCantidad.isEnabled = false
285   - } else {
286   - mDialogViewM.tvResultado.text = ""
287   - mDialogViewM.tvResultado.error = "Operación No Valida"
288   - mDialogViewM.tvResultado.requestFocus()
289   - mDialogViewM.tvResultado.hint = "Error"
  290 + } else {
  291 + mDialogViewM.tvResultado.text = ""
  292 + mDialogViewM.tvResultado.error = "Operación No Valida"
  293 + mDialogViewM.tvResultado.requestFocus()
  294 + mDialogViewM.tvResultado.hint = "Error"
  295 + }
290 296 }
291 297 }
292   - }
293   - if (mDialogViewM.rbMdodificar.isChecked) {
294   - if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
295   - mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat())
  298 + if (mDialogViewM.rbMdodificar.isChecked) {
  299 + if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
  300 + mDialogViewM.tvResultado.text = (Math.round(mDialogViewM.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString()
296 301 // mDialogView.tvNuevaCantidad.isEnabled = false
  302 + }
297 303 }
298 304 }
299 305 }
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripcionFragment/DescripcionFragment.kt
... ... @@ -27,6 +27,7 @@ import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
27 27 import com.focasoftware.deboinventariov20.Model.Articles
28 28 import com.focasoftware.deboinventariov20.Model.InvBody
29 29 import com.focasoftware.deboinventariov20.R
  30 +import com.focasoftware.deboinventariov20.UI.MainActivity
30 31 import com.focasoftware.deboinventariov20.UI.Utils.obtenerFechaActual
31 32 import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera
32 33 import kotlinx.android.synthetic.main.ingresar_cantidad.view.*
... ... @@ -34,7 +35,6 @@ import kotlinx.android.synthetic.main.login_dialog.view.*
34 35 import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar
35 36 import kotlinx.coroutines.*
36 37  
37   -
38 38 class DescripcionFragment : Fragment() {
39 39 private var artAcargar2: List<Articles>? = null
40 40 private var listArticulos2: List<Articles>? = null
... ... @@ -48,10 +48,11 @@ class DescripcionFragment : Fragment() {
48 48 lateinit var sharedPreferences: SharedPreferences
49 49 private var artCargadoEnBD: InvBody? = null
50 50 lateinit var mDialogViewM: View
  51 + var resultadoTemp:Float=0F
51 52  
52 53 override fun onCreate(savedInstanceState: Bundle?) {
53 54 super.onCreate(savedInstanceState)
54   - sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
  55 + sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
55 56 arguments.apply {
56 57 artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles>
57 58 numeroInventario = requireArguments().getInt("numeroInv")
... ... @@ -76,7 +77,7 @@ class DescripcionFragment : Fragment() {
76 77  
77 78 private fun showSoftKeyboard(view: View) {
78 79 if (view.requestFocus()) {
79   - val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
  80 + val imm = (activity as MainActivity).getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
80 81 imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY)
81 82 }
82 83 }
... ... @@ -123,8 +124,9 @@ class DescripcionFragment : Fragment() {
123 124 mDialogView.etCantidad.requestFocus()
124 125 mDialogView.etCantidad.hint = "Ingrese un valor"
125 126 } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) {
  127 + val tr: Double = Math.round(mDialogView.etCantidad.text.toString().toFloat() * 100.0) / 100.0
  128 + cantidad = tr.toFloat()
126 129  
127   - cantidad = String.format("%.2f",mDialogView.etCantidad.text.toString().toFloat()).toFloat()
128 130 val body = InvBody(
129 131 numeroInventario,
130 132 (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector,
... ... @@ -141,8 +143,8 @@ class DescripcionFragment : Fragment() {
141 143 obtenerFechaActual(),
142 144 obtenerFechaActual()
143 145 )
144   - InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS
145   - modificarCantidadEnCabecera(numeroInventario, true, requireActivity())
  146 + insertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS
  147 + modificarCantidadEnCabecera(numeroInventario, true, (activity as MainActivity))
146 148 // VolverAinventario()
147 149 activity?.onBackPressed()
148 150 mAlertDialog.dismiss()
... ... @@ -155,7 +157,8 @@ class DescripcionFragment : Fragment() {
155 157 if (artCargadoEnBD!!.balanza.toString().contains("1") || artCargadoEnBD!!.balanza.toString().contains("3") || artCargadoEnBD!!.balanza.toString().contains("7")
156 158 ) mDialogViewM.tvNuevaCantidad.inputType = InputType.TYPE_CLASS_NUMBER
157 159 mDialogViewM.tvTitulo2.text="${artCargadoEnBD!!.descripcion}"
158   - mDialogViewM.tvCantInicial.text = String.format("%.2f", artCargadoEnBD!!.cantTomada.toString().toFloat())
  160 + val tr: Double = Math.round(artCargadoEnBD!!.cantTomada.toString().toFloat() * 100.0) / 100.0
  161 + mDialogViewM.tvCantInicial.text = tr.toString()
159 162  
160 163 val mAlertDialog = mBuilder.show()
161 164 mDialogViewM.tvNuevaCantidad.requestFocus()
... ... @@ -168,15 +171,18 @@ class DescripcionFragment : Fragment() {
168 171  
169 172 mDialogViewM.rbSumar.setOnClickListener {
170 173 if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
171   - mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat()))
172   -// mDialogViewM.tvNuevaCantidad.isEnabled = false
  174 + resultadoTemp=mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat()
  175 + mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString()
  176 +
173 177 }
174 178 }
175 179 mDialogViewM.rbRestar.setOnClickListener {
176 180 if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
177 181 if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) {
178   - mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat())
179   -// mDialogViewM.tvNuevaCantidad.isEnabled = false
  182 + resultadoTemp=mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()
  183 + mDialogViewM.tvResultado.text = (Math.round(resultadoTemp* 100.0) / 100.0).toString()
  184 +
  185 +
180 186 } else {
181 187 mDialogViewM.tvResultado.text = ""
182 188 mDialogViewM.tvResultado.error = "Operación No Valida"
... ... @@ -187,8 +193,8 @@ class DescripcionFragment : Fragment() {
187 193 }
188 194 mDialogViewM.rbMdodificar.setOnClickListener {
189 195 if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
190   - mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvNuevaCantidad.text.toString().toFloat()))
191   -// mDialogViewM.tvNuevaCantidad.isEnabled = false
  196 + mDialogViewM.tvResultado.text = (Math.round(mDialogViewM.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString()
  197 +
192 198 }
193 199 }
194 200 mDialogViewM.btnAceptar.setOnClickListener {
... ... @@ -242,10 +248,10 @@ class DescripcionFragment : Fragment() {
242 248 itemTouchHelper2.attachToRecyclerView(rcDescripcion)
243 249 }
244 250  
245   - fun InsertarArtEnDB(cuarpoInventario: InvBody) {
  251 + fun insertarArtEnDB(cuarpoInventario: InvBody) {
246 252 lifecycleScope.launch {
247 253 withContext(Dispatchers.IO) {
248   - AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario)
  254 + AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario)
249 255 }
250 256 }
251 257 }
... ... @@ -264,7 +270,7 @@ class DescripcionFragment : Fragment() {
264 270 withContext(Dispatchers.IO) {
265 271 val activity: FragmentActivity? = activity
266 272 if (activity != null && isAdded) {
267   - AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(),obtenerFechaActual())
  273 + AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(),obtenerFechaActual())
268 274 }
269 275 }
270 276 }
... ... @@ -272,21 +278,24 @@ class DescripcionFragment : Fragment() {
272 278  
273 279 private val textWatcher = object : TextWatcher {
274 280 override fun afterTextChanged(s: Editable?) {
  281 + if (mDialogViewM.tvNuevaCantidad.text.toString() == "") { mDialogViewM.tvResultado.text = ""}
275 282 }
276 283  
277 284 override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
278 285 }
279 286  
280 287 override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
  288 +
  289 + if (mDialogViewM.tvNuevaCantidad.text.toString() != "") {
281 290 if (mDialogViewM.rbSumar.isChecked) {
282   -// mDialogView.tvNuevaCantidad.isEnabled=false
283   - mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat())
  291 + resultadoTemp=mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat()
  292 + mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString()
284 293 }
285 294 if (mDialogViewM.rbRestar.isChecked) {
286 295 if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
287 296 if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) {
288   - mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat())
289   -// mDialogView.tvNuevaCantidad.isEnabled = false
  297 + resultadoTemp=mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()
  298 + mDialogViewM.tvResultado.text = (Math.round( resultadoTemp * 100.0) / 100.0).toString()
290 299 } else {
291 300 mDialogViewM.tvResultado.text = ""
292 301 mDialogViewM.tvResultado.error = "Operación No Valida"
... ... @@ -297,8 +306,8 @@ class DescripcionFragment : Fragment() {
297 306 }
298 307 if (mDialogViewM.rbMdodificar.isChecked) {
299 308 if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) {
300   - mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat())
301   -// mDialogView.tvNuevaCantidad.isEnabled = false
  309 + mDialogViewM.tvResultado.text = (Math.round(mDialogViewM.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString()
  310 + }
302 311 }
303 312 }
304 313 }
app/src/main/java/com/focasoftware/deboinventariov20/UI/detalleProducto/DetalleArtFragment.kt
... ... @@ -13,6 +13,7 @@ import com.focasoftware.deboinventariov20.Model.Articles
13 13 import com.focasoftware.deboinventariov20.R
14 14 import kotlinx.android.synthetic.main.fragment_detalle_art.*
15 15 import kotlinx.coroutines.Dispatchers
  16 +import kotlinx.coroutines.Dispatchers.Main
16 17 import kotlinx.coroutines.GlobalScope
17 18 import kotlinx.coroutines.async
18 19 import kotlinx.coroutines.launch
... ... @@ -37,7 +38,7 @@ class DetalleArtFragment : Fragment() {
37 38 imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
38 39  
39 40 marcarInventario()
40   - GlobalScope.launch(Dispatchers.Main) {
  41 + GlobalScope.launch(Main) {
41 42 artSerch = buscarCodigoDeboEnBD(sector, codigo)
42 43 if (artSerch == null) {
43 44  
... ... @@ -83,8 +84,10 @@ class DetalleArtFragment : Fragment() {
83 84 else -> { tvBal.text="Otros"
84 85 }
85 86 }
86   - tvCosto.text=String.format("%.2f", artSerch!!.costo.toString().toFloat())
87   - tvPrecio.text=String.format("%.2f", artSerch!!.precio.toString().toFloat())
  87 + if(!artSerch!!.costo.toString().isNullOrEmpty()){}
  88 + tvCosto.text=
  89 + (Math.round(artSerch!!.costo.toString().toFloat() * 100.0) / 100.0).toString()
  90 + tvPrecio.text= (Math.round( artSerch!!.precio.toString().toFloat() * 100.0) / 100.0).toString()
88 91 }
89 92 }
90 93 }
app/src/main/java/com/focasoftware/deboinventariov20/UI/detalleProducto/DetalleArtSecFragment.kt
... ... @@ -0,0 +1,92 @@
  1 +package com.focasoftware.deboinventariov20.UI.detalleProducto
  2 +
  3 +import android.content.Context
  4 +import android.content.SharedPreferences
  5 +import android.os.Bundle
  6 +import androidx.fragment.app.Fragment
  7 +import android.view.LayoutInflater
  8 +import android.view.View
  9 +import android.view.ViewGroup
  10 +import android.view.inputmethod.InputMethodManager
  11 +import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
  12 +import com.focasoftware.deboinventariov20.Model.Articles
  13 +import com.focasoftware.deboinventariov20.Model.InvBodySec
  14 +import com.focasoftware.deboinventariov20.R
  15 +import kotlinx.android.synthetic.main.fragment_detalle_art.*
  16 +import kotlinx.android.synthetic.main.fragment_inv_sec.*
  17 +import kotlinx.coroutines.Dispatchers
  18 +import kotlinx.coroutines.GlobalScope
  19 +import kotlinx.coroutines.async
  20 +import kotlinx.coroutines.launch
  21 +
  22 +private lateinit var sharedPreferences: SharedPreferences
  23 +private var Inventario: String? = null
  24 +private var sector: String? = null
  25 +private var codigo: String? = null
  26 +private var busqueda: String? = null
  27 +private var artSerch: InvBodySec? = null
  28 +
  29 +class DetalleArtSecFragment : Fragment() {
  30 +
  31 + override fun onCreate(savedInstanceState: Bundle?) {
  32 + super.onCreate(savedInstanceState)
  33 + sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
  34 +
  35 + arguments?.let {
  36 + sector = it.getString("sector")
  37 + codigo = it.getString("codigo")
  38 + busqueda= it.getString("Busqueda")
  39 + Inventario= it.getString("numeroInv").toString()
  40 + }
  41 + val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?
  42 + imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
  43 +
  44 + GlobalScope.launch(Dispatchers.Main) {
  45 + artSerch = Inventario?.let { buscarCodigoDeboEnBD(it,sector, codigo) }
  46 + if (artSerch != null) {
  47 + tvSector.text=sector
  48 + tvCodigo.text=codigo
  49 + tvDeposito.text=if(!artSerch!!.depSn!!)"No" else "Si"
  50 + tvDescripcion.text=artSerch!!.descripcion.toString()
  51 + tvCodigoBarras.text=if (artSerch!!.CODBAR.toString()=="null")"" else artSerch!!.CODBAR.toString()
  52 +// tvCodigoOrigen.text=if (artSerch!!.codOrigen.toString()=="null")"" else artSerch!!.codOrigen.toString()
  53 + tvExiVenta.text=artSerch!!.EXIVTA.toString()
  54 + tvExiDeposito.text=artSerch!!.EXIDEP.toString()
  55 +
  56 + when ( artSerch!!.uniVenta.toString().toInt()) {
  57 + 1 ->tvBal.text="Unidades"
  58 + 2 ->tvBal.text="Litros"
  59 + 3 ->tvBal.text="Cajas"
  60 + 4 ->tvBal.text="M3"
  61 + 5 ->tvBal.text="Metros"
  62 + 6 ->tvBal.text="Fracción"
  63 + 7 ->tvBal.text="Bultos"
  64 + 8 ->tvBal.text="Gramos"
  65 + 9 ->tvBal.text="Cent. cúbicos"
  66 + 10 ->tvBal.text="Kgs"
  67 + else -> { tvBal.text="Otros"
  68 + }
  69 + }
  70 + tvCosto.text= (Math.round(artSerch!!.costo.toString().toFloat() * 100.0) / 100.0).toString()
  71 + tvPrecio.text=(Math.round(artSerch!!.precio.toString().toFloat() * 100.0) / 100.0).toString()
  72 + }
  73 + }
  74 + val editor = sharedPreferences.edit()
  75 + editor?.putString("BusquedaVuelta", busqueda)
  76 + editor?.apply()
  77 + editor.commit()
  78 + }
  79 + suspend fun buscarCodigoDeboEnBD(inventario: String, sector: String?, codigo: String?): InvBodySec? {
  80 + //TODO BUSQUEDA POR CODIGO DE BARRAS
  81 + var busqueda: InvBodySec?
  82 + return GlobalScope.async(Dispatchers.IO) {
  83 + busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.fetchArticuloByCodSec(inventario,sector!!, codigo!!)
  84 + return@async busqueda
  85 + }.await()
  86 + }
  87 + override fun onCreateView(
  88 + inflater: LayoutInflater, container: ViewGroup?,
  89 + savedInstanceState: Bundle?
  90 + ): View? {return inflater.inflate(R.layout.fragment_detalle_art_sec, container, false) }
  91 +
  92 +}
0 93 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/InvSecFragment.kt
... ... @@ -0,0 +1,564 @@
  1 +package com.focasoftware.deboinventariov20.UI.inventario
  2 +
  3 +import android.app.AlertDialog
  4 +import android.content.Context
  5 +import android.content.DialogInterface
  6 +import android.content.SharedPreferences
  7 +import android.os.Bundle
  8 +import android.text.Editable
  9 +import android.text.InputType
  10 +import android.text.TextWatcher
  11 +import android.view.*
  12 +import android.widget.EditText
  13 +import android.widget.TextView
  14 +import android.widget.Toast
  15 +import androidx.fragment.app.Fragment
  16 +import androidx.navigation.NavController
  17 +import androidx.navigation.Navigation
  18 +import androidx.recyclerview.widget.LinearLayoutManager
  19 +import androidx.recyclerview.widget.RecyclerView
  20 +import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
  21 +import com.focasoftware.deboinventariov20.Model.*
  22 +import com.focasoftware.deboinventariov20.R
  23 +import com.focasoftware.deboinventariov20.UI.MainActivity
  24 +import com.focasoftware.deboinventariov20.UI.Utils.*
  25 +import kotlinx.android.synthetic.main.fragment_inv_sec.*
  26 +import kotlinx.android.synthetic.main.login_dialog.view.*
  27 +import kotlinx.coroutines.*
  28 +import kotlinx.coroutines.Dispatchers.IO
  29 +import kotlinx.coroutines.Dispatchers.Main
  30 +import retrofit2.Call
  31 +import retrofit2.Callback
  32 +import retrofit2.Response
  33 +import java.util.*
  34 +import kotlin.collections.ArrayList
  35 +
  36 +private var listArtSec = ArrayList<ItemsSecRecycler>()
  37 +private lateinit var viewAdapter: RecyclerView.Adapter<*>
  38 +private lateinit var viewManager: RecyclerView.LayoutManager
  39 +lateinit var mDialogView: View
  40 +private lateinit var invSecActual: String
  41 +private lateinit var navController: NavController
  42 +private var serverBajada: ServeInv? = null
  43 +private var filtrado = false
  44 +private var countryFilterList = ArrayList<ItemsSecRecycler>()
  45 +
  46 +
  47 +class InvSecFragment : Fragment(), ProdSecListAdapter.OnImageDotsClickListener {
  48 + private lateinit var rcInventariosSec: RecyclerView
  49 + private lateinit var sharedPreferences: SharedPreferences
  50 + private val job: Job = Job()
  51 + private val fragmentScope = CoroutineScope(IO + job)
  52 +
  53 +
  54 + override fun onCreate(savedInstanceState: Bundle?) {
  55 + super.onCreate(savedInstanceState)
  56 + sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
  57 + if (sharedPreferences.contains("InventarioSec")) if (sharedPreferences.getString("InventarioSec", "").toString() != "-1") {
  58 + }
  59 + }
  60 +
  61 + override fun onCreateView(
  62 + inflater: LayoutInflater, container: ViewGroup?,
  63 + savedInstanceState: Bundle?
  64 + ): View? {
  65 +
  66 + val v = inflater.inflate(R.layout.fragment_inv_sec, container, false)
  67 + val tvTituloSec = v.findViewById<TextView>(R.id.tvTitulo)
  68 + val etDescripcion = v.findViewById<EditText>(R.id.etDescripcion)
  69 + rcInventariosSec = v.findViewById<RecyclerView>(R.id.rcInventarios)
  70 +
  71 + invSecActual = sharedPreferences.getString("InventarioSecNum", "").toString()
  72 + tvTituloSec.text = "# ${sharedPreferences.getString("InventarioSecNum", "").toString()} ${sharedPreferences.getString("InventarioSecNom", "").toString()}"
  73 + if (sharedPreferences.contains("BusquedaVuelta")) if (sharedPreferences.getString("BusquedaVuelta", "").toString() == "") {
  74 +
  75 + cargarDeBdInventario(sharedPreferences.getString("InventarioSecNum", "").toString().toInt())
  76 + }
  77 +
  78 + if (sharedPreferences.getString("BusquedaVuelta", "").toString() != "") {
  79 + etDescripcion.setText("")
  80 + etDescripcion.setText(sharedPreferences.getString("BusquedaVuelta", "").toString())
  81 + etDescripcion.setImeActionLabel(sharedPreferences.getString("BusquedaVuelta", "").toString(), KeyEvent.KEYCODE_ENTER)
  82 + }
  83 + val editor = sharedPreferences.edit()
  84 + editor?.putString("BusquedaVuelta", "")
  85 + editor?.apply()
  86 + editor.commit()
  87 + updateFETinvSecHead(sharedPreferences.getString("InventarioSecNum", "").toString(), obtenerFechaActualFormatoFoca())
  88 + updateFECTOMyFECTOMFINinvSecBody(sharedPreferences.getString("InventarioSecNum", "").toString(), obtenerFechaActualFormatoFoca())
  89 +
  90 + return v
  91 + }
  92 +
  93 + override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
  94 + super.onViewCreated(view, savedInstanceState)
  95 + navController = Navigation.findNavController(view)
  96 +
  97 + btnBorrarInv.setOnClickListener {
  98 + AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?")
  99 + .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which ->
  100 + borrarInvActualCabecera()
  101 + borrarInvActualCuerpo()
  102 + Toast.makeText(requireContext(), "El inventario $invSecActual fue Borrado", Toast.LENGTH_LONG).show()
  103 + navController.navigate(R.id.action_invSecFragment_to_mainFragment2)
  104 +
  105 + }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show()
  106 + }
  107 +
  108 + etDescripcion.addTextChangedListener(textWatcher2)
  109 +
  110 + btnExportarInv.setOnClickListener {
  111 + AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar)
  112 + .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which ->
  113 + preparaInvParaExportar(invSecActual)
  114 + val modalDialog = ExportacionExitosa()
  115 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  116 + Thread.sleep(500)
  117 + navController.navigate(R.id.action_invSecFragment_to_mainFragment2)
  118 +
  119 + }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show()
  120 + }
  121 + }
  122 +
  123 + private fun preparaInvParaExportar(inventario: String) {
  124 +
  125 + fragmentScope.launch(Main) {
  126 + val aEnviarHead: InvSecHeadToSend
  127 + var aEnviarBody: InvSecBodyToSend
  128 + val datosCabecera = foundInvHeadDB(inventario)
  129 + val datosCuerpo = foundInvBodyBD(inventario)
  130 +
  131 + aEnviarHead = InvSecHeadToSend(datosCabecera.invNum.toString(), "D", obtenerFechaActualFormatoFoca())
  132 + updateFECinvSecHead(datosCabecera.invNum.toString(), obtenerFechaActualFormatoFoca())
  133 + exportarInventarioSecHead(aEnviarHead)
  134 +
  135 + for (cuerpo in datosCuerpo) {
  136 + aEnviarBody = InvSecBodyToSend(
  137 + cuerpo.invNum.toString(),
  138 + cuerpo.sector.toString(),
  139 + cuerpo.codigo.toString(),
  140 + if (cuerpo.contado.toString() == "" || cuerpo.contado.toString().isEmpty()) "-1" else cuerpo.contado.toString(),
  141 + cuerpo.fechaTomado.toString(),
  142 + cuerpo.fechaFinal.toString()
  143 + )
  144 +
  145 + exportarInventarioSecBody(aEnviarBody)
  146 + }
  147 + borrarInvActualCabecera()
  148 + borrarInvActualCuerpo()
  149 +
  150 + }
  151 + }
  152 +
  153 + private fun exportarInventarioSecBody(EnviarBody: InvSecBodyToSend) {
  154 + fragmentScope.launch(Main) {
  155 + serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne()
  156 +
  157 + if (serverBajada != null) {
  158 + if (serverBajada!!.direccion.isNullOrEmpty()) {
  159 + val modalDialog = NoServerConf()
  160 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  161 + } else {
  162 + BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/"
  163 +
  164 +// val call: Call<Void?>? = WebService.instance
  165 +// ?.createService(WebServiceApi::class.java)
  166 +// ?.inventarioSecToSendBody(EnviarBody)
  167 + ItomInv.request.inventarioSecToSendBody(EnviarBody)
  168 + .enqueue(object : Callback<Void?> {
  169 +// call?.enqueue(object : Callback<Void?> {
  170 + override fun onResponse(call: Call<Void?>, response: Response<Void?>) {
  171 + if (response.code() == 200) { }
  172 + if (response.code() == 409) {
  173 + Toast.makeText(requireContext(), response.message(), Toast.LENGTH_SHORT).show()
  174 + }
  175 + }
  176 +
  177 + override fun onFailure(call: Call<Void?>?, t: Throwable?) {}
  178 + })
  179 + }
  180 + } else {
  181 + val modalDialog = ServerNoConf()
  182 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  183 + }
  184 + }
  185 + }
  186 +
  187 + private fun exportarInventarioSecHead(aEnviar: InvSecHeadToSend) {
  188 +
  189 + fragmentScope.launch(Main) {
  190 + serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne()
  191 +
  192 + if (serverBajada != null) {
  193 +
  194 + if (serverBajada!!.direccion.isNullOrEmpty()) {
  195 + val modalDialog = NoServerConf()
  196 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  197 + } else {
  198 + BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/"
  199 +
  200 + ItomInv.request.inventarioSecToSendHead(aEnviar)
  201 + .enqueue(object : Callback<Void?> {
  202 +
  203 +// }
  204 +// val call: Call<Void?>? = WebService.instance
  205 +// ?.createService(WebServiceApi::class.java)
  206 +// ?.inventarioSecToSendHead(aEnviar)
  207 +// call?.enqueue(object : Callback<Void?> {
  208 + override fun onResponse(call: Call<Void?>, response: Response<Void?>) {
  209 + if (response.code() == 201) {}
  210 + if (response.code() == 409) {
  211 + Toast.makeText(requireContext(), response.message(), Toast.LENGTH_SHORT).show()
  212 + }
  213 + }
  214 + override fun onFailure(call: Call<Void?>?, t: Throwable?) {}
  215 + })
  216 + }
  217 + } else {
  218 + val modalDialog = ServerNoConf()
  219 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  220 + }
  221 + }
  222 + }
  223 +
  224 + override fun onDestroy() {
  225 + super.onDestroy()
  226 + fragmentScope.cancel()
  227 + }
  228 +// private fun exportarInventario(aEnviar: InvToSend){
  229 +// var serverBajada: ServeInv? = null
  230 +// GlobalScope.launch(IO) {
  231 +// serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne()
  232 +//
  233 +// if (serverBajada != null) {
  234 +//
  235 +// if (serverBajada!!.direccion.isNullOrEmpty()) {
  236 +// val modalDialog = NoServerConf()
  237 +// modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  238 +// } else {
  239 +// BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/"
  240 +//
  241 +// val call: Call<Void?>? = WebService.instance
  242 +// ?.createService(WebServiceApi::class.java)
  243 +// ?.inventarioToSend(aEnviar)
  244 +// call?.enqueue(object : Callback<Void?> {
  245 +// override fun onResponse(call: Call<Void?>, response: Response<Void?>) {
  246 +// if (response.code() == 201) {
  247 +// }
  248 +// if (response.code() == 409) {
  249 +// }
  250 +// }
  251 +// override fun onFailure(call: Call<Void?>?, t: Throwable?) {}
  252 +// })
  253 +// }
  254 +// } else {
  255 +// val modalDialog = ServerNoConf()
  256 +// modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  257 +// }
  258 +//
  259 +// }
  260 +// }
  261 +
  262 + private suspend fun foundInvHeadDB(inv: String): InvHeadSec {
  263 + var busqueda: InvHeadSec
  264 + return fragmentScope.async(IO) {
  265 + busqueda = AppDb.getAppDb(requireContext())!!.InvHeadSecDAO()!!.foundInvSecHead(inv)
  266 + return@async busqueda
  267 + }.await()
  268 + }
  269 +
  270 + private suspend fun foundInvBodyBD(inv: String): List<InvBodySec> {
  271 + var busqueda: List<InvBodySec>
  272 + return fragmentScope.async(IO) {
  273 + busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.fetchInvSecBody(inv)
  274 + return@async busqueda
  275 + }.await()
  276 + }
  277 +
  278 + private fun borrarInvActualCuerpo() {
  279 + fragmentScope.launch {
  280 + withContext(IO) {
  281 + AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.deleteInvSecBody(invSecActual)
  282 + }
  283 + }
  284 + }
  285 +
  286 + private fun borrarInvActualCabecera() {
  287 + fragmentScope.launch {
  288 + withContext(IO) {
  289 + AppDb.getAppDb((activity as MainActivity))!!.InvHeadSecDAO()!!.deleteinvSecHead(invSecActual)
  290 + }
  291 + }
  292 + }
  293 +
  294 + private fun cargarDeBdInventario(ultimoInv: Int) {
  295 + fragmentScope.launch(Main) {
  296 + listArtSec.clear()
  297 + val invbody = searchInvSecBody(ultimoInv)
  298 + for ((i, _) in invbody!!.withIndex()) {
  299 + loadRecycler(
  300 + invbody[i].invNum,
  301 + if (invbody[i].sector.toString().toInt() < 9) "0${invbody[i].sector.toString()}" else invbody[i].sector.toString(),
  302 + invbody[i].codigo!!,
  303 + invbody[i].descripcion!!,
  304 + invbody[i].precio!!,
  305 + invbody[i].uniVenta!!,
  306 + invbody[i].costo!!,
  307 + invbody[i].contado!!,
  308 + invbody[i].depSn!!,
  309 + invbody[i].fechaTomado!!,
  310 + invbody[i].fechaFinal!!
  311 + )
  312 + }
  313 + }
  314 + }
  315 +
  316 + private suspend fun searchInvSecBody(inventario: Int): List<InvBodySec>? {
  317 + return fragmentScope.async(IO) {
  318 + return@async AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.buscarInvSecBody(inventario)
  319 + }.await()
  320 + }
  321 +
  322 + private fun loadRecycler(
  323 + invNum: Int, sector: String, codigo: String, descripcion: String, precio: String, uniVta: String,
  324 + costo: String, contado: String, depSn: Boolean, fechaTomado: String, fechaFinal: String
  325 + ) {
  326 +
  327 + //TODO CARGO EN LE RV
  328 + val item = ItemsSecRecycler(
  329 + invNum.toString(),
  330 + sector,
  331 + codigo,
  332 + descripcion,
  333 + precio,
  334 + uniVta,
  335 + costo,
  336 + contado,
  337 + depSn,
  338 + fechaTomado,
  339 + fechaFinal
  340 + )
  341 + listArtSec.add(item)
  342 +
  343 + viewAdapter = ProdSecListAdapter(requireContext(), listArtSec, this)
  344 + viewManager = LinearLayoutManager(requireContext())
  345 + rcInventariosSec.apply {
  346 + adapter = viewAdapter
  347 + layoutManager = viewManager
  348 + }
  349 + }
  350 +
  351 + override fun onImagePenClick(numInv: String?, sector: String?, codigo: String?, cantidad: String?, position: String) {
  352 + if (filtrado)
  353 + dialogoSumaResta(numInv, requireContext(), position.toInt(), countryFilterList[position.toInt()].uniVta, true)
  354 + else
  355 + dialogoSumaResta(numInv, requireContext(), position.toInt(), listArtSec[position.toInt()].uniVta, true)
  356 + }
  357 +
  358 + override fun onImageDotsClick(numInv: String?, sector: String?, codigo: String?) {
  359 + val bundle = Bundle()
  360 + bundle.putString("sector", sector!!.toInt().toString())
  361 + bundle.putString("codigo", codigo)
  362 + bundle.putString("numeroInv", numInv)
  363 + bundle.putString("Busqueda", etDescripcion.text.toString())
  364 + navController.navigate(R.id.action_invSecFragment_to_detalleArtSecFragment, bundle)
  365 + }
  366 +
  367 + fun dialogoSumaResta(numInv: String?, context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) {
  368 + var segundaVezCant = false
  369 + var cantidadTemp: Float
  370 + mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null)
  371 + val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable)
  372 + // TODO: SI PERMITE QUE INGRESE DECIMALES
  373 + if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = InputType.TYPE_CLASS_NUMBER
  374 + mDialogView.tvTitulo2.text = if (filtrado) countryFilterList[indiceDelArtEncontrado].descripcion else listArtSec[indiceDelArtEncontrado].descripcion
  375 + mDialogView.tvCantInicial.text =
  376 + if (filtrado)
  377 + (Math.round((if (countryFilterList[indiceDelArtEncontrado].contado == "") "0".toDouble() else countryFilterList[indiceDelArtEncontrado].contado.toFloat() * 100.0)) / 100.0).toString()
  378 + else
  379 + (Math.round((if (listArtSec[indiceDelArtEncontrado].contado == "") "0".toDouble() else listArtSec[indiceDelArtEncontrado].contado.toFloat() * 100.0)) / 100.0).toString()
  380 +
  381 + if (filtrado)
  382 + if (countryFilterList[indiceDelArtEncontrado].contado != "") segundaVezCant = true
  383 + else
  384 + if (listArtSec[indiceDelArtEncontrado].contado != "") segundaVezCant = true
  385 +
  386 + val mAlertDialog = mBuilder.show()
  387 + mDialogView.tvNuevaCantidad.requestFocus()
  388 +
  389 + mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)
  390 + mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
  391 +
  392 + mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher)
  393 +
  394 + mDialogView.rbSumar.setOnClickListener {
  395 + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
  396 + cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()
  397 + mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString()
  398 + }
  399 + }
  400 + mDialogView.rbRestar.setOnClickListener {
  401 + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
  402 + if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) {
  403 + cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()
  404 + mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString()
  405 + } else {
  406 + mDialogView.tvResultado.text = ""
  407 + mDialogView.tvResultado.error = "Operación No Valida"
  408 + mDialogView.tvResultado.requestFocus()
  409 + mDialogView.tvResultado.hint = "Error"
  410 + }
  411 + }
  412 + }
  413 + mDialogView.rbMdodificar.setOnClickListener {
  414 + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
  415 + mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString()
  416 + }
  417 + }
  418 + mDialogView.btnAceptar.setOnClickListener {
  419 + if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) {
  420 + if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) {
  421 + mAlertDialog.dismiss()
  422 +
  423 + if (filtrado)
  424 + countryFilterList[indiceDelArtEncontrado].contado = (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toString()
  425 + else
  426 + listArtSec[indiceDelArtEncontrado].contado = (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toString()
  427 +
  428 + if (segundaVezCant) {
  429 + updateFECTOMFINinvSecBody(
  430 + numInv!!,
  431 + if (filtrado) countryFilterList[indiceDelArtEncontrado].sector else listArtSec[indiceDelArtEncontrado].sector,
  432 + if (filtrado) countryFilterList[indiceDelArtEncontrado].codigo else listArtSec[indiceDelArtEncontrado].codigo,
  433 + (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat()
  434 + )
  435 + } else {
  436 + updateCantidad(
  437 + numInv!!,
  438 + if (filtrado) countryFilterList[indiceDelArtEncontrado].sector else listArtSec[indiceDelArtEncontrado].sector,
  439 + if (filtrado) countryFilterList[indiceDelArtEncontrado].codigo else listArtSec[indiceDelArtEncontrado].codigo,
  440 + (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat()
  441 + )
  442 + }
  443 +
  444 + viewAdapter.notifyDataSetChanged()
  445 + } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) {
  446 + mDialogView.tvResultado.error = "Operación Requerida"
  447 + mDialogView.tvResultado.requestFocus()
  448 + mDialogView.tvResultado.hint = "Seleccione Operación"
  449 + }
  450 + } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) {
  451 + mDialogView.tvNuevaCantidad.error = "Completar"
  452 + mDialogView.tvNuevaCantidad.requestFocus()
  453 + mDialogView.tvNuevaCantidad.hint = "Ingrese un valor"
  454 + }
  455 + }
  456 + mDialogView.dialogCancelBtn.setOnClickListener {
  457 + mAlertDialog.dismiss()
  458 + }
  459 + }
  460 +
  461 + private val textWatcher = object : TextWatcher {
  462 +
  463 + override fun afterTextChanged(s: Editable?) {
  464 + if (mDialogView.tvNuevaCantidad.text.toString() == "") {
  465 + mDialogView.tvResultado.text = ""
  466 + }
  467 + }
  468 +
  469 + override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
  470 +
  471 + override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
  472 + var cantidadTemp: Float
  473 + if (mDialogView.tvNuevaCantidad.text.toString() != "") {
  474 + if (mDialogView.rbSumar.isChecked) {
  475 + cantidadTemp = mDialogView.tvNuevaCantidad.text.toString().toFloat() + mDialogView.tvCantInicial.text.toString().toFloat()
  476 + mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString()
  477 + }
  478 + if (mDialogView.rbRestar.isChecked) {
  479 + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
  480 + if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) {
  481 + cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()
  482 + mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString()
  483 + } else {
  484 + mDialogView.tvResultado.text = ""
  485 + mDialogView.tvResultado.error = "Operación No Valida"
  486 + mDialogView.tvResultado.requestFocus()
  487 + mDialogView.tvResultado.hint = "Error"
  488 + }
  489 + }
  490 + }
  491 + if (mDialogView.rbMdodificar.isChecked) {
  492 + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
  493 + mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString()
  494 + }
  495 + }
  496 + }
  497 + }
  498 + }
  499 +
  500 + private val textWatcher2 = object : TextWatcher {
  501 +
  502 + override fun afterTextChanged(constraint: Editable?) {}
  503 +
  504 + override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
  505 +
  506 + override fun onTextChanged(constraint: CharSequence?, start: Int, before: Int, count: Int) {
  507 +
  508 + val charSearch = constraint.toString()
  509 + if (charSearch.isEmpty()) {
  510 + countryFilterList = listArtSec
  511 + filtrado = false
  512 + } else {
  513 + val resultList = ArrayList<ItemsSecRecycler>()
  514 + for (row in listArtSec) {
  515 + if (row.descripcion.toLowerCase(Locale.ROOT).contains(charSearch.toLowerCase(Locale.ROOT))) {
  516 + resultList.add(row)
  517 + filtrado = true
  518 + }
  519 + }
  520 + countryFilterList = resultList
  521 + }
  522 + viewAdapter = ProdSecListAdapter(requireContext(), countryFilterList, this@InvSecFragment)
  523 + viewManager = LinearLayoutManager(requireContext())
  524 + rcInventariosSec.apply {
  525 + adapter = viewAdapter
  526 + layoutManager = viewManager
  527 + rcInventariosSec.recycledViewPool.clear()
  528 + viewAdapter.notifyDataSetChanged()
  529 + }
  530 + }
  531 + }
  532 +
  533 + private fun updateFETinvSecHead(numInv: String, fecha: String) {
  534 + fragmentScope.launch(IO) {
  535 + AppDb.getAppDb((activity as MainActivity))!!.InvHeadSecDAO()!!.updateFETinvSecHead(numInv, fecha)
  536 + }
  537 + }
  538 +
  539 + private fun updateFECTOMyFECTOMFINinvSecBody(numInv: String, fecha: String) {
  540 + fragmentScope.launch(IO) {
  541 + AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.updateFECTOMyFECTOMFINinvSecBody(numInv, fecha)
  542 + }
  543 + }
  544 +
  545 + private fun updateFECinvSecHead(numInv: String, fecha: String) {
  546 + fragmentScope.launch(IO) {
  547 + AppDb.getAppDb((activity as MainActivity))!!.InvHeadSecDAO()!!.updateFECinvSecHead(numInv, fecha)
  548 + }
  549 + }
  550 +
  551 + private fun updateFECTOMFINinvSecBody(numInv: String, sector: String, codigo: String, cantidad: Float) {
  552 + fragmentScope.launch(IO) {
  553 + AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.updateFECTOMFINinvSecBody(numInv, cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActualFormatoFoca())
  554 + }
  555 + }
  556 +
  557 + private fun updateCantidad(numInv: String, sector: String, codigo: String, cantidad: Float) {
  558 + fragmentScope.launch(IO) {
  559 + AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.updateInvSecBody(numInv, cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActualFormatoFoca())
  560 + }
  561 + }
  562 +}
  563 +
  564 +
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/InventarioFragment.kt
1 1 package com.focasoftware.deboinventariov20.UI.inventario
2 2  
3   -import android.annotation.SuppressLint
4 3 import android.app.AlertDialog
5 4 import android.content.Context
6 5 import android.content.Context.INPUT_METHOD_SERVICE
... ... @@ -10,6 +9,7 @@ import android.graphics.Canvas
10 9 import android.graphics.Color
11 10 import android.graphics.drawable.Drawable
12 11 import android.os.Bundle
  12 +import android.system.ErrnoException
13 13 import android.text.Editable
14 14 import android.text.InputType.TYPE_CLASS_NUMBER
15 15 import android.text.TextWatcher
... ... @@ -32,10 +32,8 @@ import androidx.recyclerview.widget.RecyclerView
32 32 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
33 33 import com.focasoftware.deboinventariov20.Model.*
34 34 import com.focasoftware.deboinventariov20.R
35   -import com.focasoftware.deboinventariov20.UI.Utils.ExportacionExitosa
36   -import com.focasoftware.deboinventariov20.UI.Utils.NoEncontradoSimple
37   -import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera
38   -import com.focasoftware.deboinventariov20.UI.Utils.obtenerFechaActual
  35 +import com.focasoftware.deboinventariov20.UI.MainActivity
  36 +import com.focasoftware.deboinventariov20.UI.Utils.*
39 37 import com.focasoftware.deboinventariov20.UI.inventario.viewModel.InventarioViewModel
40 38 import kotlinx.android.synthetic.main.fragment_inventario.*
41 39 import kotlinx.android.synthetic.main.ingresar_cantidad.view.*
... ... @@ -47,35 +45,48 @@ import kotlinx.coroutines.Dispatchers.Main
47 45 import retrofit2.Call
48 46 import retrofit2.Callback
49 47 import retrofit2.Response
  48 +import java.io.IOException
  49 +import java.net.SocketTimeoutException
50 50 import java.util.*
51 51 import kotlin.collections.ArrayList
52 52  
53   -class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener {
  53 +private lateinit var sharedPreferences: SharedPreferences
  54 +private var iArea: Boolean = false
  55 +private lateinit var invHead: InvHead
  56 +private lateinit var viewAdapter: RecyclerView.Adapter<*>
  57 +private lateinit var viewManager: RecyclerView.LayoutManager
  58 +private lateinit var sChangeUpper: String
  59 +private var listArticulos = ArrayList<ItemsRecycler>()
  60 +private lateinit var navController: NavController
  61 +private var iEstado = 0
  62 +private var iBusquedaPor = 0
  63 +private var fCant = 0F
  64 +private var bFirst = false
  65 +private lateinit var deleteIcon: Drawable
  66 +lateinit var inventarioViewModel: ViewModel
  67 +private var sectorBalanza = 0
  68 +private var codigoBalanza = 0
  69 +private var cantEnteraBalanza = 0
  70 +private var cantDecimalBalanza = 0
  71 +private var EsBalanza = false
54 72  
55   - private lateinit var sharedPreferences: SharedPreferences
56   - private var iArea: Boolean = false
57   - private lateinit var invHead: InvHead
58   - private lateinit var rcInventarios: RecyclerView
59   - private lateinit var viewAdapter: RecyclerView.Adapter<*>
60   - private lateinit var viewManager: RecyclerView.LayoutManager
61   - private lateinit var sChangeUpper: String
62   - private var listArticulos = ArrayList<ItemsRecycler>()
63   - private lateinit var navController: NavController
64   - var InventarioNuevo: Int = 0
65   - private var iEstado = 0
66   - private var iBusquedaPor = 0
67   - private var fCant = 0F
68   - private var bFirst = false
69   - private lateinit var deleteIcon: Drawable
  73 +class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener {
70 74 lateinit var mDialogView: View
71   - lateinit var inventarioViewModel: ViewModel
  75 + private lateinit var rcInventarios: RecyclerView
  76 + private val job: Job = Job()
  77 + private val fragmentScopeInvFrag = CoroutineScope(IO + job)
  78 + private var serverBajada: ServeInv? = null
  79 +
  80 + override fun onDestroy() {
  81 + super.onDestroy()
  82 + fragmentScopeInvFrag.cancel()
  83 + }
72 84  
73   - @SuppressLint("MissingPermission")
74 85 override fun onCreate(savedInstanceState: Bundle?) {
75 86 super.onCreate(savedInstanceState)
76 87 inventarioViewModel = ViewModelProviders.of(this).get(InventarioViewModel::class.java)
77 88  
78   - sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
  89 + sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
79 90 if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") {
80 91 (inventarioViewModel as InventarioViewModel).InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt()
81 92 val editor = sharedPreferences.edit()
... ... @@ -83,20 +94,12 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
83 94 editor?.apply()
84 95 editor.commit()
85 96 }
86   -// val c = Calendar.getInstance()
87   -// c[2009, 9, 9, 12, 0] = 0
88   -// val am: AlarmManager = requireActivity().getSystemService(Context.ALARM_SERVICE) as AlarmManager
89   -// am.setTime(c.timeInMillis)
90 97 }
91   -// private fun setupTimeZone(timeZoneName: String) {
92   -// val am = requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager
93   -// am.setTimeZone("Europe/Madrid")
94   -// }
95   -
96 98  
97 99 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
98 100 val v = inflater.inflate(R.layout.fragment_inventario, container, false)
99   - sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
  101 +
  102 +
100 103 val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras)
101 104 rcInventarios = v.findViewById(R.id.rcInventarios)
102 105 val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo)
... ... @@ -105,7 +108,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
105 108 if ((inventarioViewModel as InventarioViewModel).InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO
106 109 GlobalScope.launch(Dispatchers.Main) {
107 110 //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO
108   - (inventarioViewModel as InventarioViewModel).InventarioNuevo = AppDb.getAppDb(requireActivity())?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1
  111 + (inventarioViewModel as InventarioViewModel).InventarioNuevo = AppDb.getAppDb((activity as MainActivity))?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1
109 112 //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO
110 113 invHead = InvHead(
111 114 (inventarioViewModel as InventarioViewModel).InventarioNuevo,
... ... @@ -118,7 +121,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
118 121 AjusteProductos(),
119 122 ProdNoCont()
120 123 )
121   - AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead)
  124 + AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.insertInvHead(invHead)
122 125  
123 126 tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo} " + descArea
124 127 }
... ... @@ -131,6 +134,15 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
131 134 tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent ->
132 135 if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) {
133 136 sChangeUpper = tCodigoBarras.text.toString()
  137 +
  138 +// val esnumero = try {
  139 +// val retorno = java.lang.Double.valueOf(sChangeUpper)
  140 +// true
  141 +// } catch (e: NumberFormatException) {
  142 +// //retorno = 0.0
  143 +// false
  144 +// }
  145 +// if (esnumero){}
134 146 var indiceDelArtEncontrado = 0
135 147  
136 148 if (tCodigoBarras.text.isNullOrBlank()) {
... ... @@ -143,41 +155,65 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
143 155 tCodigoBarras.hint = "4 Minimo"
144 156  
145 157 } else {
146   -
  158 + tCodigoBarras.hint = ""
147 159 //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS
148 160 when (iBusquedaPor) {
149 161 0 -> {
150 162 // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER
151   - val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
152   - imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
153   -
154   - GlobalScope.launch(Dispatchers.Main) {
  163 + val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
  164 + imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
  165 +
  166 + if (sharedPreferences.contains("cbHabiLectura")) {
  167 + if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") {
  168 + if (sChangeUpper.length == 13)
  169 + if (sChangeUpper.substring(0, 2) == "20" && sChangeUpper.substring(12, 13) == "2") {
  170 + EsBalanza=true
  171 + sectorBalanza = sChangeUpper.substring(2, 4).toInt()
  172 + codigoBalanza = sChangeUpper.substring(4, 7).toInt()
  173 + cantEnteraBalanza = sChangeUpper.substring(7, 9).toInt()
  174 + cantDecimalBalanza = sChangeUpper.substring(9, 12).toInt()
  175 + }
  176 + }
  177 + }
  178 + GlobalScope.launch(Main) {
155 179 indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice
156 180 //TODO (Si no lo encuentra devuelve -1)
157 181 if (indiceDelArtEncontrado != -1) {
158   - if (swSumaUno!!.isChecked) {
159   -// fCant = 0F
160   -// fCant = listArticulos[indiceDelArtEncontrado].cantTomada
161   -// fCant += 1F
162   - //TODO ACTUALIZO LA CANTIDAD EN LA BD
163   - updateCantidad(
164   - listArticulos[indiceDelArtEncontrado].sector.toString(),
165   - listArticulos[indiceDelArtEncontrado].codigo.toString(),
166   - listArticulos[indiceDelArtEncontrado].cantTomada + 1
167   - )
168   - //TODO ACTUALIZO LA CANTIDAD EN EL RV
169   - listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1
170   - viewAdapter.notifyDataSetChanged()
171   - } else {
172   - dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false)
  182 + if (!EsBalanza) {
  183 +// //TODO ACTUALIZO LA CANTIDAD EN LA BD
  184 +// updateCantidad(
  185 +// sectorBalanza.toString(),
  186 +// codigoBalanza.toString(),
  187 +// ("$cantEnteraBalanza.$cantDecimalBalanza").toFloat())
  188 +// //TODO ACTUALIZO LA CANTIDAD EN EL RV
  189 +// listArticulos[indiceDelArtEncontrado].cantTomada = ("$cantEnteraBalanza.$cantDecimalBalanza").toFloat()
  190 +// viewAdapter.notifyDataSetChanged()
  191 +// }else{
  192 + if (swSumaUno!!.isChecked) {
  193 + //TODO ACTUALIZO LA CANTIDAD EN LA BD
  194 + updateCantidad(
  195 + listArticulos[indiceDelArtEncontrado].sector.toString(),
  196 + listArticulos[indiceDelArtEncontrado].codigo.toString(),
  197 + listArticulos[indiceDelArtEncontrado].cantTomada + 1
  198 + )
  199 + //TODO ACTUALIZO LA CANTIDAD EN EL RV
  200 + listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1
  201 + viewAdapter.notifyDataSetChanged()
  202 +
  203 + } else {
  204 + dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false)
  205 + }
173 206 }
174   -
175 207 } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD
176 208 //TODO BUSCO EN BASE DE DATOS
177   - val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT))
  209 + val artEncontrado:Articles? = if (EsBalanza) {
  210 + buscarCodigoDeboEnBD(sectorBalanza.toString(), codigoBalanza.toString())
  211 + }else{
  212 + buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT))
  213 + }
178 214 continuarCargaCB(artEncontrado)//TODO SE MANDA CERO POR QUE ES UN ARTICULO ESCANEADO NUEVO PARA QUE SEA COMPATIBLE
179 215 }
180   - tCodigoBarras.focusable = View.FOCUSABLE
  216 + etCodigoBarras.requestFocus()
181 217 tCodigoBarras.setText("")
182 218 tCodigoBarras.selectAll()
183 219 }
... ... @@ -187,8 +223,8 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
187 223 }
188 224 1 -> {//TODO: BUSQUEDA POR DESCRIPCION**************************************************************************
189 225 // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER
190   - val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
191   - imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
  226 + val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
  227 + imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
192 228 // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice
193 229 // //TODO Si no lo encuentra devuelve -1
194 230 // if (indiceDelArtEncontrado != -1) {
... ... @@ -217,19 +253,24 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
217 253 //
218 254 // } else if
219 255 // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD
220   - GlobalScope.launch(Dispatchers.Main) {
  256 + GlobalScope.launch(Main) {
221 257 val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT))
222 258 continuarCargaDesc(artEncontrado as ArrayList<Articles>)
223 259 }
224 260  
  261 + ivCamara.setImageResource(R.drawable.codbar)
  262 + etCodigoBarras.hint = "Busqueda por Código de Barras"
  263 + swSumaUno.visibility = View.VISIBLE
225 264 iBusquedaPor = 0
  265 + iEstado = 0
  266 + bFirst = false
226 267 // }
227 268  
228 269 return@setOnKeyListener true
229 270 }
230 271 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN**************************************************************************
231   - val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
232   - imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
  272 + val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
  273 + imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
233 274  
234 275 // GlobalScope.launch(Dispatchers.Main) {
235 276 // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice
... ... @@ -312,7 +353,13 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
312 353 val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT))
313 354 continuarCargaCodigoOri(artEncontrado)
314 355 }
  356 + ivCamara.setImageResource(R.drawable.codbar)
  357 + etCodigoBarras.hint = "Busqueda por Código de Barras"
  358 + swSumaUno.visibility = View.VISIBLE
315 359 iBusquedaPor = 0
  360 + iEstado = 0
  361 + bFirst = false
  362 +
316 363 // }
317 364 // }
318 365 return@setOnKeyListener true
... ... @@ -330,13 +377,14 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
330 377 navController = Navigation.findNavController(view)
331 378 etCodigoBarras.requestFocus()
332 379 // val modalDialog = NoEncontradoSimple()
333   -// modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
  380 +// modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
334 381  
335 382 btnBorrarInv.setOnClickListener {
336 383 AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?")
337 384 .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which ->
338   - borrarInvActual()
339   - Toast.makeText(requireContext(), "El inventario $(inventarioViewModel as InventarioViewModel).InventarioNuevo fue Borrado", Toast.LENGTH_LONG).show()
  385 + borrarInvActualCabecera()
  386 + borrarInvActualCuerpo()
  387 + Toast.makeText(requireContext(), "El inventario fue Borrado", Toast.LENGTH_LONG).show()
340 388 navController.navigate(R.id.action_inventarioFragment_to_mainFragment2)
341 389 (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0
342 390  
... ... @@ -348,16 +396,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
348 396 btnExportarInv.setOnClickListener {
349 397 AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar)
350 398 .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which ->
351   - if (preparaInvParaExportar((inventarioViewModel as InventarioViewModel).InventarioNuevo )) {
352   - borrarInvActual()
353   - Toast.makeText(requireContext(), "El inventario $(inventarioViewModel as InventarioViewModel).InventarioNuevo fue Exportado al Servidor", Toast.LENGTH_LONG).show()
354   - navController.navigate(R.id.action_inventarioFragment_to_mainFragment2)
355   - (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0
356   - } else {
357   - Toast.makeText(requireContext(), "No se pudo realizar la exportación, Intente mas tarde.", Toast.LENGTH_LONG).show()
358   - }
359   -
360   -
  399 + preparaInvParaExportar((inventarioViewModel as InventarioViewModel).InventarioNuevo)
361 400 }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show()
362 401 }
363 402 ivCamara.setOnClickListener {
... ... @@ -392,49 +431,123 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
392 431 }
393 432 }
394 433  
395   - private fun preparaInvParaExportar(inventario: Int): Boolean {
396   - var bExporto = false
397   - GlobalScope.launch(Main) {
398   - val aEnviar: ArrayList<InvToSend>? = arrayListOf<InvToSend>()
  434 + private fun preparaInvParaExportar(inventario: Int) {
  435 +
  436 + var fecInicio: String
  437 + var lug: Int
  438 + var itomInvC: ItomInvC
  439 + lifecycleScope.launch(Main) {
  440 +// fragmentScopeInvFrag.launch(Main) {
  441 +
399 442 val datosCabecera = foundInvHeadDB(inventario)
400 443 val datosCuerpo = foundInvBodyBD(inventario)
  444 + fecInicio = datosCabecera.fechaInicio.toString()
  445 + var fecActual: String = "${obtenerFechaActual()}"
  446 + fecActual = "$fecActual"
  447 + lug = if (datosCabecera.lugar!!) 1 else 0
  448 + itomInvC = ItomInvC(fecInicio, fecActual, lug)
  449 + serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne()
  450 + exportarInventarioHead(itomInvC, datosCuerpo)
  451 +
401 452  
402   - for (cuerpo in datosCuerpo) {
403   - val temp=InvToSend(datosCabecera.fechaInicio, datosCabecera.fechaFinal, if (datosCabecera.lugar!!) 1 else 0, cuerpo.sector, cuerpo.codigo, cuerpo.descripcion, cuerpo.cantTomada, cuerpo.fechaInicio, cuerpo.fechaFinal)
404   - aEnviar!!.add(temp)
  453 + }
  454 + }
  455 +
  456 + private fun exportarInventarioHead(aEnviar: ItomInvC, datosCuerpo: List<InvBody>) {
  457 + var exporto = false
  458 + if (serverBajada != null) {
  459 +
  460 + if (serverBajada!!.direccion.isNullOrEmpty()) {
  461 + val modalDialog = NoServerConf()
  462 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  463 + } else {
  464 + BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/"
  465 + try {
  466 + ItomInv.request.insertarItominvc(aEnviar)
  467 + .enqueue(object : Callback<DefaultResponse> {
  468 + override fun onResponse(call: Call<DefaultResponse>, response: Response<DefaultResponse>) {
  469 + lifecycleScope.launch(Main) {
  470 + loading_view.visibility=View.VISIBLE
  471 + if(exportarInventarioBody(datosCuerpo)) {
  472 + borrarInvActualCabecera()
  473 + borrarInvActualCuerpo()
  474 + loading_view.visibility = View.INVISIBLE
  475 +
  476 + navController.navigate(R.id.action_inventarioFragment_to_mainFragment2)
  477 + (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0
  478 +
  479 + val modalDialog = ExportacionExitosa()
  480 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  481 + }else {
  482 + loading_view.visibility = View.INVISIBLE
  483 + val modalDialog = ExportacionFracasada()
  484 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  485 + }
  486 + }
  487 + }
  488 +
  489 + override fun onFailure(call: Call<DefaultResponse>, t: Throwable) {
  490 + val modalDialog = ExportacionFracasada()
  491 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  492 + }
  493 + })
  494 +
  495 + } catch (e: RuntimeException) {
  496 + Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show()
  497 + } catch (e: Error) {
  498 + Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show()
  499 + } catch (e: ErrnoException) {
  500 + Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show()
  501 + } catch (e: InternalError) {
  502 + Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show()
  503 + } catch (e: IOException) {
  504 + Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show()
  505 + } catch (e: SocketTimeoutException) {
  506 + Toast.makeText(requireContext(), e.message, Toast.LENGTH_SHORT).show()
  507 + }
405 508 }
406   -// exportarInventario(aEnviar!!)
407   - bExporto = true
  509 + } else {
  510 + val modalDialog = ServerNoConf()
  511 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
408 512 }
409   - return bExporto
410 513 }
411 514  
412   -// private fun exportarInventario(aEnviar: List<InvToSend>) {
413   -//
414   -// val call: Call<Void?>? = WebService
415   -// .getInstance()
416   -// ?.createService(WebServiceApi::class.java)
417   -// ?.inventarioToSend(aEnviar)
418   -//
419   -// call!!.enqueue(object : Callback<Void?> {
420   -// override fun onResponse(call: Call<Void?>?, response: Response<Void?>) {
421   -// if (response.code() == 201) {
422   -// val modalDialog = ExportacionExitosa()
423   -// modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
424   -// }
425   -// if (response.code() == 409) {
  515 + private fun exportarInventarioBody(datosCuerpo: List<InvBody>):Boolean {
  516 +
  517 +
  518 + for (cuerpo in datosCuerpo) {
  519 + val aEnviar: ItomInvD = ItomInvD(
  520 + cuerpo.sector.toString(),
  521 + cuerpo.codigo.toString(),
  522 + cuerpo.descripcion.toString(),
  523 + cuerpo.cantTomada.toString(),
  524 + cuerpo.fechaInicio.toString(),
  525 + cuerpo.fechaFinal.toString()
  526 + )
  527 +
  528 + ItomInv.request.insertarItominvd(aEnviar)
  529 + .enqueue(object : Callback<Void?> {
  530 + override fun onResponse(call: Call<Void?>, response: Response<Void?>) {}
  531 + override fun onFailure(call: Call<Void?>, t: Throwable) {}
  532 +// val call: Call<Void?>? = WebService.instance
  533 +// ?.createService(WebServiceApi::class.java)
  534 +// ?.insertarItominvd(aEnviar)
  535 +// call?.enqueue(object : Callback<Void?> {
  536 +// override fun onResponse(call: Call<Void?>, response: Response<Void?>) {
  537 +// if (response.code() == 200) { }
  538 +// if (response.code() == 400) { }
426 539 // }
427   -// }
428   -//
429   -// override fun onFailure(call: Call<Void?>?, t: Throwable?) {}
430   -// })
431   -//
432   -// }
  540 +// override fun onFailure(call: Call<Void?>?, t: Throwable?) {}
  541 + })
  542 +
  543 + }
  544 + return true
  545 + }
433 546  
434 547 private suspend fun foundInvHeadDB(inv: Int): InvHead {
435 548 var busqueda: InvHead
436 549 return GlobalScope.async(IO) {
437   - busqueda = AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.foundInvHead(inv)
  550 + busqueda = AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.foundInvHead(inv)
438 551 return@async busqueda
439 552 }.await()
440 553 }
... ... @@ -442,17 +555,20 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
442 555 private suspend fun foundInvBodyBD(inv: Int): List<InvBody> {
443 556 var busqueda: List<InvBody>
444 557 return GlobalScope.async(IO) {
445   - busqueda = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.fetchAllInvBody(inv)
  558 + busqueda = AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inv)
446 559 return@async busqueda
447 560 }.await()
448 561 }
449 562  
450   - private fun borrarInvActual() {
451   - lifecycleScope.launch {
452   - withContext(Dispatchers.IO) {
453   - AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.deleteinvHead((inventarioViewModel as InventarioViewModel).InventarioNuevo)
454   - AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.deleteInvBody((inventarioViewModel as InventarioViewModel).InventarioNuevo)
455   - }
  563 + private fun borrarInvActualCabecera() {
  564 + GlobalScope.launch(IO) {
  565 + AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.deleteinvHead((inventarioViewModel as InventarioViewModel).InventarioNuevo)
  566 + }
  567 + }
  568 +
  569 + private fun borrarInvActualCuerpo() {
  570 + GlobalScope.launch(IO) {
  571 + AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteInvBody((inventarioViewModel as InventarioViewModel).InventarioNuevo)
456 572 }
457 573 }
458 574  
... ... @@ -484,8 +600,8 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
484 600  
485 601 if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD
486 602 // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER
487   - val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
488   - imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
  603 + val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
  604 + imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
489 605  
490 606 var bundle = Bundle()
491 607 bundle = bundleOf("ArrayDesc" to artAcargar)
... ... @@ -494,9 +610,10 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
494 610  
495 611 } else {//TODO si no lo encuentra en la BD
496 612 val modalDialog = NoEncontradoSimple()
497   - modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
  613 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
498 614 }
499   - etCodigoBarras.focusable = View.FOCUSABLE
  615 +// etCodigoBarras.focusable = View.FOCUSABLE
  616 + etCodigoBarras.requestFocus()
500 617 etCodigoBarras.setText("")
501 618 etCodigoBarras.selectAll()
502 619 }
... ... @@ -528,8 +645,8 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
528 645 // cargarRecicler(acargarPorDesc, fCant)
529 646 // } else {
530 647 // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER
531   - val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
532   - imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
  648 + val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
  649 + imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
533 650 var bundle = Bundle()
534 651 bundle = bundleOf("ArrayDesc" to artAcargar)
535 652 bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo)
... ... @@ -575,31 +692,38 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
575 692 // }
576 693 } else {//TODO si no lo encuentra en la BD
577 694 val modalDialog = NoEncontradoSimple()
578   - modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
  695 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
579 696 }
580   - etCodigoBarras.focusable = View.FOCUSABLE
  697 +// etCodigoBarras.focusable = View.FOCUSABLE
  698 + etCodigoBarras.requestFocus()
581 699 etCodigoBarras.setText("")
582 700 etCodigoBarras.selectAll()
583 701 }
584 702  
585 703 private fun continuarCargaCB(artAcargar: Articles?) {
586 704  
587   - if (artAcargar != null) {// TODO: Si lo encuentra en la BD
588   - if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1
589   - fCant = 0F
590   - fCant += 1F
591   - cargarArtEnBd(artAcargar, String.format("%.3f", fCant))
592   - cargarRecicler(artAcargar, fCant)
593   - } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD
594   -
595   - dialogingresarCantidad(requireContext(), artAcargar)
596   -
  705 + if (artAcargar != null) { // TODO: Si lo encuentra en la BD
  706 + if (EsBalanza) {
  707 + cargarArtEnBd(artAcargar, (Math.round(("$cantEnteraBalanza.$cantDecimalBalanza").toFloat() * 100.0) / 100.0).toFloat().toString())
  708 + cargarRecicler(artAcargar, (Math.round(("$cantEnteraBalanza.$cantDecimalBalanza").toFloat() * 100.0) / 100.0).toFloat())
  709 + modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext())
  710 + EsBalanza=false
  711 + }else{
  712 + if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1
  713 + fCant = 0F
  714 + fCant += 1F
  715 +
  716 + cargarArtEnBd(artAcargar, (Math.round(fCant * 100.0) / 100.0).toFloat().toString())
  717 + cargarRecicler(artAcargar, (Math.round(fCant * 100.0) / 100.0).toFloat())
  718 + } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD
  719 + dialogingresarCantidad(requireContext(), artAcargar)
  720 + }
597 721 }
598 722 } else {// TODO si no lo encuentra en la BD
599 723 val modalDialog = NoEncontradoSimple()
600   - modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog")
  724 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
601 725 }
602   - etCodigoBarras.focusable = View.FOCUSABLE
  726 + etCodigoBarras.requestFocus()
603 727 etCodigoBarras.setText("")
604 728 etCodigoBarras.selectAll()
605 729 }
... ... @@ -623,8 +747,8 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
623 747 mDialogView.etCantidad.hint = "Ingrese un valor"
624 748 } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) {
625 749 mAlertDialog.dismiss()
626   - cantidad = mDialogView.etCantidad.text.toString().toFloat()
627   - cargarArtEnBd(artAcargar, String.format("%.2f", cantidad))
  750 + cantidad = (Math.round(mDialogView.etCantidad.text.toString().toFloat() * 100.0) / 100.0).toFloat()
  751 + cargarArtEnBd(artAcargar, cantidad.toString())
628 752 cargarRecicler(artAcargar, cantidad)
629 753 modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext())
630 754 }
... ... @@ -633,13 +757,14 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
633 757 }
634 758  
635 759 fun dialogoSumaResta(context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) {
636   -
  760 + var cantidadTemp: Float
637 761 mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null)
638 762 val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable)
639 763 // TODO: SI PERMITE QUE INGRESE DECIMALES
640 764 if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = TYPE_CLASS_NUMBER
641 765 mDialogView.tvTitulo2.text = "${listArticulos[indiceDelArtEncontrado].descripcion}"
642   - mDialogView.tvCantInicial.text = String.format("%.2f", listArticulos[indiceDelArtEncontrado].cantTomada)
  766 + cantidadTemp = (Math.round(listArticulos[indiceDelArtEncontrado].cantTomada * 100.0) / 100.0).toFloat()
  767 + mDialogView.tvCantInicial.text = cantidadTemp.toString()
643 768 val mAlertDialog = mBuilder.show()
644 769 mDialogView.tvNuevaCantidad.requestFocus()
645 770  
... ... @@ -652,14 +777,15 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
652 777  
653 778 mDialogView.rbSumar.setOnClickListener {
654 779 if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
655   - mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat())
656   -// mDialogView.tvNuevaCantidad.isEnabled = false
  780 + cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()
  781 + mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString()
657 782 }
658 783 }
659 784 mDialogView.rbRestar.setOnClickListener {
660 785 if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
661 786 if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) {
662   - mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat())
  787 + cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()
  788 + mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString()
663 789 // mDialogView.tvNuevaCantidad.isEnabled = false
664 790 } else {
665 791 mDialogView.tvResultado.text = ""
... ... @@ -671,19 +797,18 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
671 797 }
672 798 mDialogView.rbMdodificar.setOnClickListener {
673 799 if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
674   - mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat())
675   -// mDialogView.tvNuevaCantidad.isEnabled = false
  800 + mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString()
676 801 }
677 802 }
678 803 mDialogView.btnAceptar.setOnClickListener {
679 804 if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) {
680 805 if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) {
681 806 mAlertDialog.dismiss()
682   - listArticulos[indiceDelArtEncontrado].cantTomada = String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat()
  807 + listArticulos[indiceDelArtEncontrado].cantTomada = (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat()
683 808 updateCantidad(
684 809 listArticulos[indiceDelArtEncontrado].sector.toString(),
685 810 listArticulos[indiceDelArtEncontrado].codigo.toString(),
686   - String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat()
  811 + (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat()
687 812 )
688 813  
689 814 viewAdapter.notifyDataSetChanged()
... ... @@ -707,7 +832,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
707 832 //TODO BUSQUEDA POR CODIGO DE BARRAS
708 833 var busqueda: List<Articles>
709 834 return GlobalScope.async(IO) {
710   - busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario())
  835 + busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario())
711 836 return@async busqueda
712 837 }.await()
713 838 }
... ... @@ -716,7 +841,16 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
716 841 //TODO BUSQUEDA POR CODIGO DE BARRAS
717 842 var busqueda: Articles? = null
718 843 return GlobalScope.async(IO) {
719   - busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario())
  844 + busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario())
  845 + return@async busqueda
  846 + }.await()
  847 + }
  848 +
  849 + suspend fun buscarCodigoDeboEnBD(sector: String?, codigo: String?): Articles? {
  850 + //TODO BUSQUEDA POR CODIGO DE BARRAS
  851 + var busqueda: Articles?
  852 + return GlobalScope.async(IO) {
  853 + busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.fetchArticuloByCodSec(sector, codigo)
720 854 return@async busqueda
721 855 }.await()
722 856 }
... ... @@ -725,7 +859,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
725 859 //TODO BUSQUEDA POR DESCRIPCION
726 860 var busqueda: List<Articles>? = null
727 861 return GlobalScope.async(IO) {
728   - busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario())
  862 + busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario())
729 863 return@async busqueda
730 864 }.await()
731 865 }
... ... @@ -734,7 +868,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
734 868 //TODO BUSQUEDA POR DESCRIPCION
735 869 var result: Int
736 870 return GlobalScope.async(IO) {
737   - result = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toInt())
  871 + result = AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toInt())
738 872 return@async result
739 873 }.await()
740 874 }
... ... @@ -745,15 +879,25 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
745 879 var bEncontrado = false
746 880 if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS
747 881 // TODO CAMBIO DE CB A CODIGO DEBO
748   - val any = cambioCBporCodigoDebo(codigoBarras)
749   - if (any != null) {
  882 + if (EsBalanza){
750 883 for (item in listArticulos) {
751   - if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) {
  884 + if (item.sector!!.toInt() == sectorBalanza.toInt() && item.codigo!!.toInt() == codigoBalanza.toInt()) {
752 885 bEncontrado = true
753 886 break
754 887 }
755 888 indice += 1
756 889 }
  890 + }else {
  891 + val any = cambioCBporCodigoDebo(codigoBarras)
  892 + if (any != null) {
  893 + for (item in listArticulos) {
  894 + if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) {
  895 + bEncontrado = true
  896 + break
  897 + }
  898 + indice += 1
  899 + }
  900 + }
757 901 }
758 902  
759 903 } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION
... ... @@ -781,7 +925,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
781 925 //TODO BUSQUEDA POR DESCRIPCION
782 926 var busqueda: Articles? = null
783 927 return GlobalScope.async(IO) {
784   - busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario())
  928 + busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario())
785 929 return@async busqueda
786 930 }.await()
787 931 }
... ... @@ -887,32 +1031,32 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
887 1031 return iArea
888 1032 }
889 1033  
890   - suspend fun SerchAreaInventario(): Boolean {
  1034 + private suspend fun SerchAreaInventario(): Boolean {
891 1035 return GlobalScope.async(IO) {
892   - return@async AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.fetchAreaInvH((inventarioViewModel as InventarioViewModel).InventarioNuevo)
  1036 + return@async AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.fetchAreaInvH((inventarioViewModel as InventarioViewModel).InventarioNuevo)
893 1037 }.await()
894 1038  
895 1039 }
896 1040  
897   - fun InsertarArtEnDB(cuarpoInventario: InvBody) {
  1041 + private fun InsertarArtEnDB(cuarpoInventario: InvBody) {
898 1042 lifecycleScope.launch {
899 1043 withContext(Dispatchers.IO) {
900   - AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario)
  1044 + AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario)
901 1045 }
902 1046 }
903 1047 }
904 1048  
905   - fun updateCantidad(sector: String, codigo: String, cantidad: Float) {
  1049 + private fun updateCantidad(sector: String, codigo: String, cantidad: Float) {
906 1050 lifecycleScope.launch {
907 1051 withContext(IO) {
908   - AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActual())
  1052 + AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActual())
909 1053 }
910 1054 }
911 1055 }
912 1056  
913   - suspend fun cargarInventario(inventario: Int): List<InvBody>? {
  1057 + private suspend fun cargarInventario(inventario: Int): List<InvBody>? {
914 1058 return GlobalScope.async(IO) {
915   - return@async AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inventario)
  1059 + return@async AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.fetchAllInvBody(inventario)
916 1060 }.await()
917 1061 }
918 1062  
... ... @@ -929,34 +1073,41 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
929 1073 }
930 1074  
931 1075 private val textWatcher = object : TextWatcher {
932   - override fun afterTextChanged(s: Editable?) {}
  1076 + override fun afterTextChanged(s: Editable?) {
  1077 + if (mDialogView.tvNuevaCantidad.text.toString() == "") {
  1078 + mDialogView.tvResultado.text = ""
  1079 + }
  1080 + }
  1081 +
933 1082 override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
934 1083  
935 1084 override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
936   - if (mDialogView.rbSumar.isChecked) {
937   -// mDialogView.tvNuevaCantidad.isEnabled=false
938   - mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat() + mDialogView.tvCantInicial.text.toString().toFloat())
939   - }
940   - if (mDialogView.rbRestar.isChecked) {
941   - if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
942   - if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) {
943   - mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat())
  1085 + var cantidadTemp: Float
  1086 + if (mDialogView.tvNuevaCantidad.text.toString() != "") {
  1087 + if (mDialogView.rbSumar.isChecked) {
  1088 + cantidadTemp = mDialogView.tvNuevaCantidad.text.toString().toFloat() + mDialogView.tvCantInicial.text.toString().toFloat()
  1089 + mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString()
  1090 + }
  1091 + if (mDialogView.rbRestar.isChecked) {
  1092 + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
  1093 + if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) {
  1094 + cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()
  1095 + mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString()
944 1096 // mDialogView.tvNuevaCantidad.isEnabled = false
945   - } else {
946   - mDialogView.tvResultado.text = ""
947   - mDialogView.tvResultado.error = "Operación No Valida"
948   - mDialogView.tvResultado.requestFocus()
949   - mDialogView.tvResultado.hint = "Error"
  1097 + } else {
  1098 + mDialogView.tvResultado.text = ""
  1099 + mDialogView.tvResultado.error = "Operación No Valida"
  1100 + mDialogView.tvResultado.requestFocus()
  1101 + mDialogView.tvResultado.hint = "Error"
  1102 + }
950 1103 }
951 1104 }
952   - }
953   - if (mDialogView.rbMdodificar.isChecked) {
954   - if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
955   - mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat())
956   -// mDialogView.tvNuevaCantidad.isEnabled = false
  1105 + if (mDialogView.rbMdodificar.isChecked) {
  1106 + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) {
  1107 + mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString()
  1108 + }
957 1109 }
958 1110 }
959   -
960 1111 }
961 1112 }
962 1113 }
... ... @@ -974,3 +1125,4 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList
974 1125  
975 1126  
976 1127  
  1128 +
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/ItemsSecRecycler.kt
... ... @@ -0,0 +1,6 @@
  1 +package com.focasoftware.deboinventariov20.UI.inventario
  2 +
  3 +data class ItemsSecRecycler(val invNum: String, val sector: String, val codigo: String, val descripcion: String, var precio: String, var uniVta: String, val costo: String, var contado: String, val depSn: Boolean, val fechaTomado:String, val fechaFinal:String) {
  4 +
  5 +
  6 +}
0 7 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/ProdSecListAdapter.kt
... ... @@ -0,0 +1,49 @@
  1 +package com.focasoftware.deboinventariov20.UI.inventario
  2 +
  3 +import android.content.Context
  4 +import android.view.LayoutInflater
  5 +import android.view.View
  6 +import android.view.ViewGroup
  7 +import android.widget.Filter
  8 +import android.widget.Filterable
  9 +import androidx.recyclerview.widget.RecyclerView
  10 +import com.focasoftware.deboinventariov20.R
  11 +import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder
  12 +import kotlinx.android.synthetic.main.item.view.*
  13 +import java.util.*
  14 +import kotlin.collections.ArrayList
  15 +
  16 +class ProdSecListAdapter(private val context: Context, private var productos: ArrayList<ItemsSecRecycler>, private val itemImageClickListener: InvSecFragment) :
  17 + RecyclerView.Adapter<BaseViewHolder<*>>() {
  18 +
  19 + interface OnImageDotsClickListener {
  20 + fun onImagePenClick(numInv: String?, sector: String?, codigo: String?, cantidad: String?, position: String)
  21 + fun onImageDotsClick(numInv: String?, sector: String?, codigo: String?)
  22 + }
  23 +
  24 + override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item, parent, false))
  25 +
  26 + override fun getItemCount(): Int {
  27 + return productos.count()
  28 + }
  29 +
  30 + override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) {
  31 + when (holder) {
  32 + is ItemsViewHolder -> {
  33 + holder.bind(productos[position], position)
  34 + }
  35 + }
  36 + }
  37 +
  38 + inner class ItemsViewHolder(itemView: View) : BaseViewHolder<ItemsSecRecycler>(itemView) {
  39 + override fun bind(item: ItemsSecRecycler, position: Int) {
  40 +
  41 + itemView.ivDots.setOnClickListener { itemImageClickListener.onImageDotsClick(item.invNum, item.sector, item.codigo) }
  42 + itemView.ivPen.setOnClickListener { itemImageClickListener.onImagePenClick(item.invNum, item.sector, item.codigo, item.contado, adapterPosition.toString()) }
  43 + itemView.tvDescripcion.text = item.descripcion
  44 + itemView.tvCantidad.text = item.contado
  45 + itemView.ivPen.setImageResource(R.drawable.pen)
  46 + itemView.ivDots.setImageResource(R.drawable.more)
  47 + }
  48 + }
  49 +}
0 50 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/ProductosListAdapter.kt
... ... @@ -8,11 +8,9 @@ import androidx.recyclerview.widget.RecyclerView
8 8 import com.focasoftware.deboinventariov20.R
9 9 import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder
10 10 import kotlinx.android.synthetic.main.item.view.*
11   -import java.io.IOException
12   -import java.net.UnknownHostException
13 11  
14 12  
15   -class ProductosListAdapter(private val context: Context,private val productos: ArrayList<ItemsRecycler>, private val itemImageClickListener: OnImageDotsClickListener) :
  13 +class ProductosListAdapter(private val context: Context, private val productos: ArrayList<ItemsRecycler>, private val itemImageClickListener: OnImageDotsClickListener) :
16 14 RecyclerView.Adapter<BaseViewHolder<*>>() {
17 15  
18 16 private var removePosition: Int = 0
... ... @@ -39,12 +37,8 @@ class ProductosListAdapter(private val context: Context,private val productos: A
39 37 itemView.ivDots.setOnClickListener {itemImageClickListener.onImageDotsClick(item.sector,item.codigo) }
40 38 itemView.ivPen.setOnClickListener {itemImageClickListener.onImagePenClick(item.sector,item.codigo,item.cantTomada.toString(),adapterPosition.toString()) }
41 39  
42   -// itemView.tvSector.text=item.sector
43   -// itemView.tvCodigo.text=item.codigo
44 40 itemView.tvDescripcion.text=item.descripcion
45 41 itemView.tvCantidad.text=item.cantTomada.toString()
46   -// itemView.tvCodigoBarras.text=item.sector
47   -// itemView.tvCodigoOrigen.text=item.sector
48 42 itemView.ivPen.setImageResource(R.drawable.pen)
49 43 itemView.ivDots.setImageResource(R.drawable.more)
50 44 }
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/InventarioSecListAdapter.kt
... ... @@ -0,0 +1,42 @@
  1 +package com.focasoftware.deboinventariov20.UI.main
  2 +
  3 +import android.content.Context
  4 +import android.view.LayoutInflater
  5 +import android.view.View
  6 +import android.view.ViewGroup
  7 +import androidx.recyclerview.widget.RecyclerView
  8 +import com.focasoftware.deboinventariov20.Model.InvHeadSec
  9 +import com.focasoftware.deboinventariov20.R
  10 +import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder
  11 +import kotlinx.android.synthetic.main.item_principal.view.*
  12 +
  13 +class InventarioSecListAdapter(private val context: Context, private val inv: ArrayList<InvHeadSec>, private val itemClickListener: MainFragment) :
  14 + RecyclerView.Adapter<BaseViewHolder<*>>() {
  15 +
  16 + interface OnInventarioSecClickListener {
  17 + fun onItemSecClick(inventario: String?, nombre: String?)
  18 + }
  19 +
  20 + override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item_principal, parent, false))
  21 +
  22 + override fun getItemCount() = inv.size
  23 +
  24 + inner class ItemsViewHolder(itemView: View) : BaseViewHolder<InvHeadSec>(itemView) {
  25 + override fun bind(item: InvHeadSec, position: Int) {
  26 + itemView.setOnClickListener { itemClickListener.onItemSecClick(item.invNum.toString(), item.detalle.toString()) }
  27 + itemView.tvPrincipalinventario.text = if (item.invNum < 10) "#0${item.invNum}" else "#" + item.invNum.toString()
  28 +
  29 + itemView.tvDescription.text = item.detalle.toString()
  30 + itemView.tvFecha.text = item.fechaInicio.toString()
  31 + //SimpleDateFormat("dd/MM/yyyy HH:mm:SS").format(DateFormat(hd)).toString()
  32 + itemView.tvCantContada.text = item.prodContados.toString()
  33 + }
  34 + }
  35 +
  36 + override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) {
  37 + when (holder) {
  38 + is ItemsViewHolder -> holder.bind(inv[position], position)
  39 + else -> IllegalArgumentException("No se pudo pasar el ViewHolder")
  40 + }
  41 + }
  42 +}
0 43 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/MainFragment.kt
1 1 package com.focasoftware.deboinventariov20.UI.main
2 2  
  3 +import android.app.AlertDialog
3 4 import android.content.Context
  5 +import android.content.Intent
4 6 import android.content.SharedPreferences
5 7 import android.os.Bundle
  8 +import android.provider.Settings
6 9 import android.view.LayoutInflater
7 10 import android.view.View
8 11 import android.view.ViewGroup
  12 +import android.view.WindowManager
  13 +import android.view.inputmethod.InputMethodManager
9 14 import android.widget.CheckBox
10 15 import android.widget.ImageButton
  16 +import android.widget.ImageView
11 17 import android.widget.TextView
12 18 import androidx.fragment.app.Fragment
  19 +import androidx.fragment.app.FragmentActivity
13 20 import androidx.navigation.NavController
14 21 import androidx.navigation.Navigation
15 22 import androidx.recyclerview.widget.LinearLayoutManager
16 23 import androidx.recyclerview.widget.RecyclerView
17 24 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
18   -import com.focasoftware.deboinventariov20.Model.InvHead
  25 +import com.focasoftware.deboinventariov20.Model.*
19 26 import com.focasoftware.deboinventariov20.R
20   -import kotlinx.coroutines.Dispatchers
21   -import kotlinx.coroutines.GlobalScope
22   -import kotlinx.coroutines.async
23   -import kotlinx.coroutines.launch
24   -import java.time.LocalDateTime
  27 +import com.focasoftware.deboinventariov20.UI.MainActivity
  28 +import com.focasoftware.deboinventariov20.UI.Utils.*
  29 +import kotlinx.android.synthetic.main.fragment_main.*
  30 +import kotlinx.android.synthetic.main.solicitar_fecha.view.*
  31 +import kotlinx.coroutines.*
  32 +import kotlinx.coroutines.Dispatchers.Main
  33 +import retrofit2.Call
  34 +import retrofit2.Callback
  35 +import retrofit2.Response
  36 +import java.net.SocketTimeoutException
25 37 import java.util.*
  38 +import kotlin.math.absoluteValue
26 39  
27   -class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener {
28   - private lateinit var inventarios: List<InvHead>
  40 +class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener, InventarioSecListAdapter.OnInventarioSecClickListener {
  41 + private var inventarios: List<InvHead>? = null
  42 + private var inventariosII: List<InvHeadSec>? = null
29 43 private lateinit var ordenado: List<InvHead>
30   - private lateinit var ordenadoII: List<InvHead>
31 44 private lateinit var rcInventario: RecyclerView
32 45 private lateinit var rcInventarioII: RecyclerView
33 46 private lateinit var viewAdapter: RecyclerView.Adapter<*>
34 47 private lateinit var viewManager: RecyclerView.LayoutManager
35 48 private var listIvn2 = ArrayList<InvHead>()
36   - private var listIvn2II = ArrayList<InvHead>()
  49 + private var listIvn2II = ArrayList<InvHeadSec>()
37 50 private lateinit var navController: NavController
38 51 private lateinit var sharedPreferences: SharedPreferences
39 52 private var cantidadInventarios: Int = 0
40 53 private var cantidadInventariosII: Int = 0
  54 + private val job: Job = Job()
  55 + private val fragmentScopeMain = CoroutineScope(Dispatchers.IO + job)
  56 + private var serverBajada: ServeInv? = null
41 57  
42 58 override fun onCreate(savedInstanceState: Bundle?) {
43 59 super.onCreate(savedInstanceState)
44   - sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
45 60  
  61 + sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
  62 +
  63 + if (sharedPreferences.contains("inicio")) {
  64 + if (sharedPreferences.getString("inicio", "").toString() == "inicio") {
  65 + if (sharedPreferences.contains("cbAskTimeServerToStart")) {
  66 + if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "1") {
  67 + GlobalScope.launch(Main) {
  68 + serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne()
  69 + if (serverBajada != null) {
  70 + if (serverBajada!!.direccion.isNullOrEmpty()) {
  71 + val modalDialog = NoServerConf()
  72 + modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog")
  73 + } else {
  74 + BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoBajada.toString() + "/"
  75 + }
  76 + }
  77 +
  78 + val call: Call<List<Time?>?>? = WebService.instance
  79 + ?.createService(WebServiceApi::class.java)
  80 + ?.getTime()
  81 + call!!.enqueue(object : Callback<List<Time?>?> {
  82 + override fun onResponse(call: Call<List<Time?>?>?, response: Response<List<Time?>?>) {
  83 + if (response.code() == 200) {
  84 + try {
  85 + val timeServer =
  86 + response.body()?.get(0)?.dia + "/" +
  87 + response.body()?.get(0)?.mes + "/" +
  88 + response.body()?.get(0)?.ano + " " +
  89 + response.body()?.get(0)?.hora + ":" +
  90 + response.body()?.get(0)?.minutos + ":" +
  91 + response.body()?.get(0)?.segundos
  92 + val horaServer = response.body()?.get(0)?.hora + "" +
  93 + response.body()?.get(0)?.minutos + "" +
  94 + response.body()?.get(0)?.segundos
  95 + val fechaServer = response.body()?.get(0)?.dia + "" +
  96 + response.body()?.get(0)?.mes + "" +
  97 + response.body()?.get(0)?.ano
  98 + if (!askTimeServer(timeServer, horaServer, fechaServer)) {
  99 + }
  100 + } catch (e: SocketTimeoutException) {
  101 + }
  102 + } else if (response.code() == 400) {
  103 + }
  104 + }
  105 +
  106 + override fun onFailure(call: Call<List<Time?>?>?, t: Throwable?) {}
  107 + })
  108 + }
  109 + val editor = sharedPreferences.edit()
  110 + editor?.putString("inicio", "")
  111 + editor?.apply()
  112 + editor.commit()
  113 + }
  114 + }
  115 + }
  116 + }
  117 + }
  118 +
  119 + override fun onDestroy() {
  120 + super.onDestroy()
  121 + fragmentScopeMain.cancel()
46 122 }
47 123  
48   - override fun onCreateView(
49   - inflater: LayoutInflater,
50   - container: ViewGroup?,
51   - savedInstanceState: Bundle?
52   - ): View? {
  124 + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
53 125 var bAbiertoCerrado = false
54 126 var bAbiertoCerradoII = false
55 127 val v = inflater.inflate(R.layout.fragment_main, container, false)
... ... @@ -57,51 +129,66 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener
57 129 val tvInvImportados = v.findViewById<TextView>(R.id.tvInvImportados)
58 130 val ivSort19 = v.findViewById<ImageButton>(R.id.ivSort19)
59 131 val ivSort91 = v.findViewById<ImageButton>(R.id.ivSort91)
60   - val ivSort19II = v.findViewById<ImageButton>(R.id.ivSort19II)
61   - val ivSort91II = v.findViewById<ImageButton>(R.id.ivSort91II)
62 132 val cbVentas = v.findViewById<CheckBox>(R.id.cbVentas)
63 133 val cbDeposito = v.findViewById<CheckBox>(R.id.cbDeposito)
64 134 val tvTipo = v.findViewById<TextView>(R.id.tvTipo)
65   - val cbVentasII = v.findViewById<CheckBox>(R.id.cbVentasII)
66   - val cbDepositoII = v.findViewById<CheckBox>(R.id.cbDepositoII)
67   - val tvTipoII = v.findViewById<TextView>(R.id.tvTipoII)
  135 + val ivPortada = v.findViewById<ImageView>(R.id.ivPortada)
68 136 rcInventario = v.findViewById(R.id.rcInventario)
69 137 rcInventarioII = v.findViewById(R.id.rcInventarioII)
  138 + ivPortada.visibility = View.VISIBLE
  139 +
  140 + fragmentScopeMain.launch(Main) {
  141 +
  142 +
  143 +
  144 +
  145 +
70 146  
71   - GlobalScope.launch(Dispatchers.Main) {
72 147 inventarios = buscarEnBDInvHead()
73   - for ((i, item) in inventarios.withIndex()) {
  148 + for ((i, item) in inventarios!!.withIndex()) {
74 149 val inv = InvHead(
75   - inventarios[i].invNum,
76   - inventarios[i].descripcion,
77   - inventarios[i].estado,
78   - inventarios[i].fechaInicio,
79   - inventarios[i].fechaFinal,
80   - inventarios[i].prodContados,
81   - inventarios[i].lugar,
82   - inventarios[i].stDesc,
83   - inventarios[i].proNoCont
  150 + inventarios!![i].invNum,
  151 + inventarios!![i].descripcion,
  152 + inventarios!![i].estado,
  153 + inventarios!![i].fechaInicio,
  154 + inventarios!![i].fechaFinal,
  155 + inventarios!![i].prodContados,
  156 + inventarios!![i].lugar,
  157 + inventarios!![i].stDesc,
  158 + inventarios!![i].proNoCont
84 159 )
85 160 cargarRecicler(inv)
86 161 cantidadInventarios = i + 1
87 162 }
88   - tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) +"
  163 + tvInvDinamicos.text = "Inventarios Dinámicos ($cantidadInventarios) +"
  164 + listIvn2II.clear()
  165 + inventariosII = buscarEnBDInvSecHead()
  166 + for ((i, item) in inventariosII!!.withIndex()) {
  167 + val invII = InvHeadSec(
  168 + inventariosII!![i].invNum,
  169 + inventariosII!![i].detalle,
  170 + inventariosII!![i].fechaInicio,
  171 + inventariosII!![i].depsn,
  172 + inventariosII!![i].estado,
  173 + inventariosII!![i].fechaFinal,
  174 + inventariosII!![i].prodContados
  175 + )
  176 + cargarReciclerII(invII)
  177 + cantidadInventariosII = i + 1
  178 + }
  179 + tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) +"
  180 +
89 181 tvInvDinamicos.setOnClickListener {
90 182 if (!bAbiertoCerrado) {
91 183 bAbiertoCerrado = true
92 184 tvInvImportados.visibility = View.GONE
93   - ivSort19II.visibility = View.GONE
94   - ivSort91II.visibility = View.GONE
95   - tvTipoII.visibility = View.GONE
96   - cbVentasII.visibility = View.GONE
97   - cbDepositoII.visibility = View.GONE
98   -
99 185 rcInventario.visibility = View.VISIBLE
100 186 ivSort91.visibility = View.INVISIBLE
101 187 ivSort19.visibility = View.VISIBLE
102 188 cbVentas.visibility = View.VISIBLE
103 189 cbDeposito.visibility = View.VISIBLE
104 190 tvTipo.visibility = View.VISIBLE
  191 + ivPortada.visibility = View.GONE
105 192 tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) -"
106 193 } else {
107 194 bAbiertoCerrado = false
... ... @@ -112,18 +199,19 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener
112 199 cbVentas.visibility = View.GONE
113 200 cbDeposito.visibility = View.GONE
114 201 tvTipo.visibility = View.GONE
  202 + ivPortada.visibility = View.VISIBLE
115 203 tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) +"
116 204 }
117 205 }
118   - ordenado = inventarios.sortedBy {
119   - it.invNum
120   - }
  206 +
  207 + ordenado = inventarios!!.sortedBy { it.invNum }
  208 +
121 209 ivSort19.setOnClickListener {
122   - ordenado = inventarios.sortedByDescending {
  210 + ordenado = inventarios!!.sortedByDescending {
123 211 it.invNum
124 212 }
125   - cbDeposito.isChecked=true
126   - cbVentas.isChecked=true
  213 + cbDeposito.isChecked = true
  214 + cbVentas.isChecked = true
127 215 viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment)
128 216 viewManager = LinearLayoutManager(requireContext())
129 217  
... ... @@ -135,12 +223,13 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener
135 223 ivSort19.visibility = View.INVISIBLE
136 224 ivSort91.visibility = View.VISIBLE
137 225 }
  226 +
138 227 ivSort91.setOnClickListener {
139   - ordenado = inventarios.sortedBy {
  228 + ordenado = inventarios!!.sortedBy {
140 229 it.invNum
141 230 }
142   - cbDeposito.isChecked=true
143   - cbVentas.isChecked=true
  231 + cbDeposito.isChecked = true
  232 + cbVentas.isChecked = true
144 233 viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment)
145 234 viewManager = LinearLayoutManager(requireContext())
146 235  
... ... @@ -152,14 +241,36 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener
152 241 ivSort91.visibility = View.INVISIBLE
153 242 ivSort19.visibility = View.VISIBLE
154 243 }
  244 +
  245 + tvInvImportados.setOnClickListener {
  246 + if (!bAbiertoCerradoII) {
  247 + bAbiertoCerradoII = true
  248 + tvInvDinamicos.visibility = View.GONE
  249 + ivSort19.visibility = View.GONE
  250 + ivSort91.visibility = View.GONE
  251 + cbVentas.visibility = View.GONE
  252 + cbDeposito.visibility = View.GONE
  253 + ivPortada.visibility = View.GONE
  254 + tvInvDinamicos.visibility = View.GONE
  255 + rcInventarioII.visibility = View.VISIBLE
  256 + tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) -"
  257 + } else {
  258 + bAbiertoCerradoII = false
  259 + ivPortada.visibility = View.VISIBLE
  260 + rcInventarioII.visibility = View.GONE
  261 + tvInvImportados.visibility = View.VISIBLE
  262 + tvInvDinamicos.visibility = View.VISIBLE
  263 + tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) +"
  264 + }
  265 + }
155 266 }
156 267  
157 268 cbVentas.setOnClickListener {
158 269 if (!cbVentas.isChecked) {
159   - cbDeposito.isChecked=true
  270 + cbDeposito.isChecked = true
160 271 listIvn2.clear()
161 272 ordenado.forEach {
162   - if (it.lugar==true) {
  273 + if (it.lugar == true) {
163 274 listIvn2.add(it)
164 275 }
165 276 }
... ... @@ -178,10 +289,10 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener
178 289  
179 290 cbDeposito.setOnClickListener {
180 291 if (!cbDeposito.isChecked) {
181   - cbVentas.isChecked=true
  292 + cbVentas.isChecked = true
182 293 listIvn2.clear()
183 294 ordenado.forEach {
184   - if (it.lugar==false) {
  295 + if (it.lugar == false) {
185 296 listIvn2.add(it)
186 297 }
187 298 }
... ... @@ -198,139 +309,20 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener
198 309 viewAdapter.notifyDataSetChanged()
199 310 }
200 311  
201   - GlobalScope.launch(Dispatchers.Main) {
202   - tvInvImportados.text = "Inventarios Inportados ($cantidadInventariosII) +"
203   - tvInvImportados.setOnClickListener {
204   - if (!bAbiertoCerradoII) {
205   - bAbiertoCerradoII = true
206   - tvInvDinamicos.visibility = View.GONE
207   - ivSort19.visibility = View.GONE
208   - ivSort91.visibility = View.GONE
209   - cbVentas.visibility = View.GONE
210   - cbDeposito.visibility = View.GONE
211   -
212   - tvInvDinamicos.visibility = View.GONE
213   - rcInventarioII.visibility = View.VISIBLE
214   - ivSort91II.visibility = View.INVISIBLE
215   - ivSort19II.visibility = View.VISIBLE
216   - cbVentasII.visibility = View.VISIBLE
217   - cbDepositoII.visibility = View.VISIBLE
218   - tvTipoII.visibility = View.VISIBLE
219   - tvInvImportados.text = "Inventarios Inportados ($cantidadInventariosII) -"
220   - } else {
221   - bAbiertoCerradoII = false
222   - rcInventarioII.visibility = View.GONE
223   - ivSort91II.visibility = View.GONE
224   - ivSort19II.visibility = View.GONE
225   - tvInvImportados.visibility = View.VISIBLE
226   - cbVentasII.visibility = View.GONE
227   - cbDepositoII.visibility = View.GONE
228   - tvTipoII.visibility = View.GONE
229   - tvInvDinamicos.visibility = View.VISIBLE
230   - tvInvImportados.text = "Inventarios Inportados ($cantidadInventariosII) +"
231   - }
232   - }
233   - ordenadoII = inventarios.sortedBy {
234   - it.invNum
235   - }
236   - ivSort19II.setOnClickListener {
237   - ordenadoII = inventarios.sortedByDescending {
238   - it.invNum
239   - }
240   - cbDepositoII.isChecked=true
241   - cbVentasII.isChecked=true
242   - viewAdapter = InventarioListAdapter(requireContext(), ordenadoII, this@MainFragment)
243   - viewManager = LinearLayoutManager(requireContext())
244   -
245   - rcInventarioII.apply {
246   - adapter = viewAdapter
247   - layoutManager = viewManager
248   - }
249   - viewAdapter.notifyDataSetChanged()
250   - ivSort19II.visibility = View.INVISIBLE
251   - ivSort91II.visibility = View.VISIBLE
252   - }
253   - ivSort91II.setOnClickListener {
254   - ordenadoII = inventarios.sortedBy {
255   - it.invNum
256   - }
257   - cbDepositoII.isChecked=true
258   - cbVentasII.isChecked=true
259   - viewAdapter = InventarioListAdapter(requireContext(), ordenadoII, this@MainFragment)
260   - viewManager = LinearLayoutManager(requireContext())
261   -
262   - rcInventarioII.apply {
263   - adapter = viewAdapter
264   - layoutManager = viewManager
265   - }
266   - viewAdapter.notifyDataSetChanged()
267   - ivSort91.visibility = View.INVISIBLE
268   - ivSort19.visibility = View.VISIBLE
269   - }
270   - }
271   -
272   - cbVentasII.setOnClickListener {
273   - if (!cbVentasII.isChecked) {
274   - cbDepositoII.isChecked=true
275   - listIvn2II.clear()
276   - ordenadoII.forEach {
277   - if (it.lugar==true) {
278   - listIvn2II.add(it)
279   - }
280   - }
281   - } else {
282   - listIvn2II.clear()
283   - listIvn2II.addAll(ordenadoII)
284   - }
285   - viewAdapter = InventarioListAdapter(requireContext(), listIvn2II, this@MainFragment)
286   - viewManager = LinearLayoutManager(requireContext())
287   - rcInventarioII.apply {
288   - adapter = viewAdapter
289   - layoutManager = viewManager
290   - }
291   - viewAdapter.notifyDataSetChanged()
292   - }
293   -
294   - cbDepositoII.setOnClickListener {
295   - if (!cbDepositoII.isChecked) {
296   - cbVentasII.isChecked=true
297   - listIvn2II.clear()
298   - ordenadoII.forEach {
299   - if (it.lugar==false) {
300   - listIvn2II.add(it)
301   - }
302   - }
303   - } else {
304   - listIvn2II.clear()
305   - listIvn2II.addAll(ordenadoII)
306   - }
307   - viewAdapter = InventarioListAdapter(requireContext(), listIvn2II, this@MainFragment)
308   - viewManager = LinearLayoutManager(requireContext())
309   - rcInventarioII.apply {
310   - adapter = viewAdapter
311   - layoutManager = viewManager
312   - }
313   - viewAdapter.notifyDataSetChanged()
314   - }
315 312 return v
316 313 }
317 314  
318   - suspend fun buscarEnBDInvHead(): List<InvHead> {
319   - //TODO BUSQUEDA POR DESCRIPCION
320   - var busqueda: List<InvHead>
321   - return GlobalScope.async(Dispatchers.IO) {
322   - busqueda = AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.fetchAllInvHead()
323   - return@async busqueda
324   - }.await()
  315 + override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
  316 + super.onViewCreated(view, savedInstanceState)
  317 + navController = Navigation.findNavController(view)
  318 + listIvn2.clear()
  319 + listIvn2II.clear()
  320 + ivPortada.visibility = View.VISIBLE
325 321 }
326 322  
327 323 fun cargarRecicler(inv: InvHead) {
328 324 //TODO CARGO EN LE RV
329 325  
330   -// val number = if (inv.invNum.toLong() < 10) "0${inv.invNum.toLong()}" else inv.invNum.toString()
331   -// val item = ItemInventario("N° $number ${inv.descripcion}. Fecha: ${inv.fechaFinal}")
332   -
333   -// listIvn.add(item)
334 326 listIvn2.add(inv)
335 327 viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this)
336 328 viewManager = LinearLayoutManager(requireContext())
... ... @@ -341,23 +333,101 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener
341 333 }
342 334 }
343 335  
344   - override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
345   - super.onViewCreated(view, savedInstanceState)
346   - navController = Navigation.findNavController(view)
347   - listIvn2.clear()
  336 + fun cargarReciclerII(inv: InvHeadSec) {
  337 + //TODO CARGO EN LE RV
  338 +
  339 + listIvn2II.add(inv)
  340 + viewAdapter = InventarioSecListAdapter(requireContext(), listIvn2II, this)
  341 + viewManager = LinearLayoutManager(requireContext())
  342 +
  343 + rcInventarioII.apply {
  344 + adapter = viewAdapter
  345 + layoutManager = viewManager
  346 + }
348 347 }
349 348  
350 349 override fun onItemClick(inventario: String?) {
351   -
352 350 val editor = sharedPreferences.edit()
353   -// var invSel: String = inventario.toString()
354   -// invSel = invSel.substring(3, 5)
355 351 editor?.putString("Inventario", inventario)
356 352 editor?.apply()
357 353 editor.commit()
358 354 navController.navigate(R.id.action_mainFragment2_to_inventarioFragment)
359 355 }
360 356  
  357 + override fun onItemSecClick(inventario: String?, nombre: String?) {
  358 + val editor = sharedPreferences.edit()
  359 + editor?.putString("InventarioSecNum", inventario)
  360 + editor?.putString("InventarioSecNom", nombre)
  361 + editor?.apply()
  362 + editor.commit()
  363 + navController.navigate(R.id.action_mainFragment2_to_invSecFragment)
  364 + }
  365 +
  366 + private suspend fun buscarEnBDInvHead(): List<InvHead> {
  367 + //TODO BUSQUEDA POR DESCRIPCION
  368 + var busqueda: List<InvHead>
  369 + return fragmentScopeMain.async(Dispatchers.IO) {
  370 + busqueda = AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.fetchAllInvHead()
  371 + return@async busqueda
  372 + }.await()
  373 + }
  374 +
  375 + private suspend fun buscarEnBDInvSecHead(): List<InvHeadSec> {
  376 + //TODO BUSQUEDA POR DESCRIPCION
  377 + var busqueda: List<InvHeadSec>
  378 + return fragmentScopeMain.async(Dispatchers.IO) {
  379 + busqueda = AppDb.getAppDb(requireContext())!!.InvHeadSecDAO()!!.fetchAllInvSecHead()
  380 + return@async busqueda
  381 + }.await()
  382 + }
  383 +
  384 +
  385 +private suspend fun fetchServerPreOne(): ServeInv? {
  386 + return fragmentScopeMain.async(Dispatchers.IO) {
  387 + return@async AppDb.getAppDb(requireContext())!!.ServeInvDao()!!.fetchServerPreOne()
  388 + }.await()
  389 +}
  390 +
  391 +
  392 + private fun askTimeServer(timeServer: String, horaServer: String, fechaServer: String): Boolean {
  393 +
  394 + var existeDiferencias = false
  395 + val horaAct = obtenerHoraActual().toDouble()
  396 + val fechaAct = obtenerDiaActual().toDouble()
  397 + val difFecha = fechaAct - fechaServer.toDouble()
  398 + val difHora = horaAct - horaServer.toDouble()
  399 + if (difFecha.absoluteValue > 0) existeDiferencias = true
  400 + if (difHora.absoluteValue > 130) existeDiferencias = true
  401 +
  402 + if (existeDiferencias) {
  403 + dialogoHoraServer((activity as MainActivity), requireContext(), obtenerFechaActual(), timeServer)
  404 + }
  405 +
  406 + return existeDiferencias
  407 + }
361 408  
  409 +//private fun dialogoHoraServerLocal(reqActivity: FragmentActivity, context: Context, fechaHoraDispositivo: String, fechaHoraServer: String) {
  410 +// val mDialogView: View = LayoutInflater.from(context).inflate(R.layout.solicitar_fecha, null)
  411 +// val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false)
  412 +//
  413 +// mDialogView.tvHoraDispositivo.text = fechaHoraDispositivo
  414 +// mDialogView.tvHoraServidor.text = fechaHoraServer
  415 +// val mAlertDialog = mBuilder.show()
  416 +// val imm = reqActivity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?
  417 +// imm!!.hideSoftInputFromWindow(reqActivity.currentFocus?.windowToken, InputMethodManager.HIDE_IMPLICIT_ONLY )
  418 +//
  419 +//// mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)
  420 +//// mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
  421 +//
  422 +//
  423 +// mDialogView.btnCambiarHora.setOnClickListener {
  424 +// context.startActivity(Intent(Settings.ACTION_DATE_SETTINGS))
  425 +// mAlertDialog.dismiss()
  426 +// }
  427 +//
  428 +// mDialogView.btnSalir.setOnClickListener {
  429 +// mAlertDialog.dismiss()
  430 +// }
  431 +//}
362 432 }
363 433  
app/src/main/java/com/focasoftware/deboinventariov20/UI/servidores/AdapterServidores.kt
... ... @@ -17,8 +17,8 @@ class AdapterServidores(private val servidor: ArrayList&lt;ItemsServidores&gt;, privat
17 17 fun bind(itemsServidores: ItemsServidores) {
18 18 vista.tvDescServidor.text = itemsServidores.descripcion
19 19 vista.tvDireccionServidor.text = itemsServidores.direccion
20   - vista.tvPuertoServidor.text = itemsServidores.puerto
21   -
  20 + vista.tvPuertoBajada.text = itemsServidores.puertoBajada
  21 + vista.tvPuertoSubida.text = itemsServidores.puertoSubida
22 22 }
23 23 }
24 24  
app/src/main/java/com/focasoftware/deboinventariov20/UI/servidores/ItemsServidores.kt
1 1 package com.focasoftware.deboinventariov20.UI.servidores
2 2  
3   -data class ItemsServidores(val descripcion: String?, var direccion: String?, var puerto: String?, var predeterminado: String?)
4 3 \ No newline at end of file
  4 +data class ItemsServidores(val descripcion: String?, var direccion: String?, var puertoSubida: String?, var puertoBajada: String?, var predeterminado: String?)
5 5 \ No newline at end of file
app/src/main/java/com/focasoftware/deboinventariov20/UI/servidores/ServidoresFragment.kt
... ... @@ -17,6 +17,7 @@ import androidx.recyclerview.widget.RecyclerView
17 17 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
18 18 import com.focasoftware.deboinventariov20.Model.ServeInv
19 19 import com.focasoftware.deboinventariov20.R
  20 +import com.focasoftware.deboinventariov20.UI.Utils.hideSoftKeyboard
20 21 import kotlinx.android.synthetic.main.fragment_servidores.*
21 22 import kotlinx.coroutines.*
22 23  
... ... @@ -31,7 +32,8 @@ class ServidoresFragment : Fragment() {
31 32  
32 33 override fun onCreate(savedInstanceState: Bundle?) {
33 34 super.onCreate(savedInstanceState)
34   - CargarRV()
  35 +// hideSoftKeyboard()
  36 + loadRV()
35 37 }
36 38  
37 39 override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
... ... @@ -51,13 +53,18 @@ class ServidoresFragment : Fragment() {
51 53 if (!etDireccionServidor.text.isNullOrBlank() || !etNombreServidor.text.isNullOrBlank()) {
52 54 // GlobalScope.launch(Dispatchers.Main) {
53 55 // ServerNew =AppDb.getAppDb(requireContext())?.ServeInvDao()?.findLastServer()?.plus(1) ?: 1
54   - val servidor = ServeInv(etNombreServidor.text.toString(), "http://${etDireccionServidor.text}",
55   - etPuerto.text.toString(),0)
56   - ingresarDatos(servidor)
57   - cargarRecicler(servidor)
58   - Toast.makeText(requireContext(), "Servidor ${etNombreServidor.text} Guardado", Toast.LENGTH_LONG).show()
  56 + val servidor = ServeInv(
  57 + etNombreServidor.text.toString(), "http://${etDireccionServidor.text}",
  58 + etPuertoSubida.text.toString(), etPuertoBajada.text.toString(), 0
  59 + )
  60 + inputData(servidor)
  61 + continueLoadRV(servidor)
  62 + Toast.makeText(requireContext(), "Servidor ${etNombreServidor.text} Guardado", Toast.LENGTH_SHORT).show()
59 63 etNombreServidor.text.clear()
60 64 etDireccionServidor.text.clear()
  65 + etPuertoBajada.text.clear()
  66 + etPuertoSubida.text.clear()
  67 +
61 68 // }
62 69 }
63 70 }
... ... @@ -69,13 +76,13 @@ class ServidoresFragment : Fragment() {
69 76 return v
70 77 }
71 78  
72   - fun ingresarDatos(servidor: ServeInv) {
  79 + private fun inputData(servidor: ServeInv) {
73 80 val Job = GlobalScope.launch {
74 81 AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.insertServer(servidor)
75 82 }
76 83 }
77 84  
78   - suspend fun buscarEnBD(): List<ServeInv> {
  85 + private suspend fun buscarEnBD(): List<ServeInv> {
79 86 var busqueda: List<ServeInv>
80 87 return GlobalScope.async(Dispatchers.IO) {
81 88 busqueda = AppDb.getAppDb(requireContext())!!.ServeInvDao()!!.fetchAllServers()
... ... @@ -83,20 +90,20 @@ class ServidoresFragment : Fragment() {
83 90 }.await()
84 91 }
85 92  
86   - fun CargarRV() {
  93 + private fun loadRV() {
87 94 GlobalScope.launch(Dispatchers.Main) {
88 95 servidores = buscarEnBD()
89 96 for ((i, item) in servidores.withIndex()) {
90   - val ser = ServeInv(servidores[i].descripcion, servidores[i].direccion,servidores[i].puerto, servidores[i].predeterminado)
91   - cargarRecicler(ser)
  97 + val ser = ServeInv(servidores[i].descripcion, servidores[i].direccion, servidores[i].puertoSubida, servidores[i].puertoBajada, servidores[i].predeterminado)
  98 + continueLoadRV(ser)
92 99 }
93 100 }
94 101 }
95 102  
96   - fun cargarRecicler(ser: ServeInv) {
  103 + private fun continueLoadRV(ser: ServeInv) {
97 104 //TODO CARGO EN LE RV
98 105 deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!!
99   - val item = ItemsServidores(ser.descripcion, ser.direccion, ser.puerto.toString(),ser.predeterminado.toString())
  106 + val item = ItemsServidores(ser.descripcion, ser.direccion, ser.puertoSubida.toString(), ser.puertoBajada.toString(), ser.predeterminado.toString())
100 107  
101 108 listServ.add(item)
102 109  
app/src/main/res/drawable/error.png

569 KB

app/src/main/res/drawable/error_fecha_hora.png

2.54 KB

app/src/main/res/drawable/imagen_portada.jpg

35.3 KB

app/src/main/res/layout-land/fragment_configuracion.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2   -<ScrollView
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
3 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 4 xmlns:tools="http://schemas.android.com/tools"
5   - tools:context=".UI.configuracion.ConfiguracionFragment"
6   - xmlns:android="http://schemas.android.com/apk/res/android"
7 5 android:layout_width="match_parent"
8   - android:layout_height="wrap_content">
  6 + android:layout_height="wrap_content"
  7 + tools:context=".UI.configuracion.ConfiguracionFragment">
9 8  
10   -<androidx.constraintlayout.widget.ConstraintLayout
11   - android:layout_width="match_parent"
12   - android:layout_height="wrap_content">
13   -
14   - <androidx.appcompat.widget.AppCompatTextView
15   - android:id="@+id/textView2"
  9 + <androidx.constraintlayout.widget.ConstraintLayout
16 10 android:layout_width="match_parent"
17   - android:layout_height="wrap_content"
18   - android:layout_marginTop="@dimen/MarginTopTitulos"
19   - android:gravity="center"
20   - android:lines="1"
21   - android:text="@string/tvTituloConf"
22   - android:textColor="@color/colorAccent"
23   - android:textSize="@dimen/Titulos"
24   - app:fontFamily="sans-serif-condensed"
25   - app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor"
26   - app:layout_constraintEnd_toEndOf="parent"
27   - app:layout_constraintStart_toStartOf="parent"
28   - app:layout_constraintTop_toTopOf="parent" />
29   -
30   - <TextView
31   - android:id="@+id/tvSeleccioneServidor"
32   - android:layout_width="0dp"
33   - android:layout_height="wrap_content"
34   -
35   - android:layout_marginStart="@dimen/MarginBotAgreSer"
36   - android:layout_marginTop="@dimen/MarginTopSubTitulos"
37   - android:gravity="start"
38   - android:lines="1"
39   - android:text="@string/tvSeleccioneServidor"
40   - android:textColor="@android:color/black"
41   - android:textSize="@dimen/SubTitulos"
42   - app:fontFamily="sans-serif-condensed"
43   - app:layout_constraintBottom_toTopOf="@+id/spServidor"
44   - app:layout_constraintEnd_toEndOf="parent"
45   - app:layout_constraintStart_toStartOf="parent"
46   - app:layout_constraintTop_toBottomOf="@+id/textView2" />
47   -
48   - <Spinner
49   - android:id="@+id/spServidor"
50   - android:layout_width="0dp"
51   - android:layout_height="wrap_content"
52   - android:backgroundTint="@color/LightGray"
53   - android:elevation="5dp"
54   - android:fadeScrollbars="true"
55   - android:foregroundTint="@android:color/holo_orange_dark"
56   - android:soundEffectsEnabled="true"
57   - android:spinnerMode="dialog"
58   - android:splitMotionEvents="false"
59   - android:textAlignment="center"
60   - android:textSize="@dimen/NormalText"
61   - app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
62   - app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor"
63   - app:layout_constraintHorizontal_chainStyle="packed"
64   - app:layout_constraintStart_toStartOf="parent"
65   - app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"
66   - android:prompt="@string/leyendaSpinner"/>
67   -
68   - <Button
69   - android:id="@+id/btnValidarServidor"
70   - android:layout_width="wrap_content"
71   - android:layout_height="wrap_content"
72   - android:textColor="@android:color/white"
73   - android:padding="10dp"
74   - android:background="@drawable/boton_borde_redondeado"
75   - android:text="@string/btnValidarServidor"
76   - android:textSize="@dimen/NormalText"
77   - app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
78   - app:layout_constraintEnd_toEndOf="parent"
79   - app:layout_constraintHorizontal_chainStyle="packed"
80   - app:layout_constraintStart_toEndOf="@id/spServidor"
81   - app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" />
82   -
83   - <Button
84   - android:id="@+id/btnAgregarServidor"
85   - android:layout_width="0dp"
86   - android:layout_height="wrap_content"
87   - android:layout_marginStart="@dimen/MarginBotAgreSer"
88   - android:layout_marginEnd="@dimen/MarginBotAgreSer"
89   - android:text="@string/btnAgregarServidor"
90   - android:textSize="@dimen/NormalText"
91   - android:textColor="@android:color/white"
92   - android:padding="10dp"
93   - android:background="@drawable/boton_borde_redondeado"
94   - app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas"
95   - app:layout_constraintEnd_toEndOf="parent"
96   - app:layout_constraintStart_toStartOf="parent"
97   - app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" />
98   -
99   -
100   - <TextView
101   - android:id="@+id/tvUbicacionCarpetas"
102   - android:layout_width="0dp"
103   - android:layout_height="wrap_content"
104   -
105   - android:layout_marginStart="@dimen/MarginBotAgreSer"
106   - android:layout_marginTop="@dimen/MarginTopSubTitulos"
107   - android:gravity="start"
108   - android:lines="1"
109   - android:text="@string/tvUbicacionCarpetas"
110   - android:textColor="@android:color/black"
111   - android:textSize="@dimen/SubTitulos"
112   - app:fontFamily="sans-serif-condensed"
113   - app:layout_constraintBottom_toTopOf="@+id/ibSearch"
114   - app:layout_constraintEnd_toEndOf="parent"
115   - app:layout_constraintStart_toStartOf="parent"
116   - app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" />
117   -
118   - <ImageButton
119   - android:id="@+id/ibSearch"
120   - android:layout_width="36dp"
121   - android:layout_height="37dp"
122   - android:layout_margin="10dp"
123   - android:src="@drawable/search"
124   - android:textColor="@android:color/white"
125   - android:padding="10dp"
126   - android:background="@drawable/boton_borde_redondeado"
127   - app:layout_constraintEnd_toStartOf="@+id/etRuta"
128   - app:layout_constraintStart_toStartOf="parent"
129   - app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
130   -
131   - <EditText
132   - android:id="@+id/etRuta"
133   - android:layout_width="0dp"
134   - android:layout_height="wrap_content"
135   - android:layout_marginTop="10dp"
136   - android:layout_marginEnd="10dp"
137   - android:clickable="true"
138   - android:ems="10"
139   - android:focusable="true"
140   - android:inputType="textPersonName"
141   - android:lines="1"
142   - android:text=""
143   - android:textSize="@dimen/NormalText"
144   - app:layout_constraintEnd_toEndOf="parent"
145   - app:layout_constraintStart_toEndOf="@id/ibSearch"
146   - app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
147   -
148   - <TextView
149   - android:id="@+id/tvActuFecha"
150   - android:layout_width="0dp"
151   - android:layout_height="wrap_content"
152   - android:layout_marginStart="@dimen/MarginBotAgreSer"
153   - android:layout_marginTop="@dimen/MarginTopSubTitulos"
154   - android:gravity="start"
155   - android:lines="1"
156   - android:text="@string/tvTituloArea"
157   - android:textColor="@android:color/black"
158   - android:textSize="@dimen/SubTitulos"
159   - app:fontFamily="sans-serif-condensed"
160   - app:layout_constraintEnd_toEndOf="parent"
161   - app:layout_constraintStart_toStartOf="parent"
162   - app:layout_constraintTop_toBottomOf="@+id/etRuta" />
163   -
164   - <RadioGroup
165   - android:id="@+id/rgFechaHora"
166   - android:layout_width="0dp"
167   - android:layout_height="wrap_content"
168   -
169   - android:gravity="center"
170   - android:orientation="horizontal"
171   - app:layout_constraintEnd_toEndOf="parent"
172   - app:layout_constraintStart_toStartOf="parent"
173   - app:layout_constraintTop_toBottomOf="@+id/tvActuFecha">
174   -
175   - <RadioButton
176   - android:id="@+id/rbVentas"
177   - android:layout_width="wrap_content"
  11 + android:layout_height="wrap_content">
  12 +
  13 + <androidx.appcompat.widget.AppCompatTextView
  14 + android:id="@+id/textView2"
  15 + android:layout_width="match_parent"
  16 + android:layout_height="wrap_content"
  17 + android:layout_marginTop="@dimen/MarginTopTitulos"
  18 + android:gravity="center"
  19 + android:lines="1"
  20 + android:text="@string/tvTituloConf"
  21 + android:textColor="@color/colorAccent"
  22 + android:textSize="@dimen/Titulos"
  23 + app:fontFamily="sans-serif-condensed"
  24 + app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor"
  25 + app:layout_constraintEnd_toEndOf="parent"
  26 + app:layout_constraintStart_toStartOf="parent"
  27 + app:layout_constraintTop_toTopOf="parent" />
  28 +
  29 + <TextView
  30 + android:id="@+id/tvSeleccioneServidor"
  31 + android:layout_width="0dp"
  32 + android:layout_height="wrap_content"
  33 +
  34 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  35 + android:layout_marginTop="@dimen/MarginTopSubTitulos"
  36 + android:gravity="start"
  37 + android:lines="1"
  38 + android:text="@string/tvSeleccioneServidor"
  39 + android:textColor="@android:color/black"
  40 + android:textSize="@dimen/SubTitulos"
  41 + app:fontFamily="sans-serif-condensed"
  42 + app:layout_constraintBottom_toTopOf="@+id/spServidor"
  43 + app:layout_constraintEnd_toEndOf="parent"
  44 + app:layout_constraintStart_toStartOf="parent"
  45 + app:layout_constraintTop_toBottomOf="@+id/textView2" />
  46 +
  47 + <Spinner
  48 + android:id="@+id/spServidor"
  49 + android:layout_width="0dp"
178 50 android:layout_height="wrap_content"
179   - android:layout_margin="5dp"
180   - android:checked="true"
181   - android:padding="5dp"
182   - android:text="@string/rbVentas"
183   - android:textSize="@dimen/NormalText" />
184   -
185   - <RadioButton
186   - android:id="@+id/rbDeposito"
  51 + android:backgroundTint="@color/LightGray"
  52 + android:elevation="5dp"
  53 + android:fadeScrollbars="true"
  54 + android:foregroundTint="@android:color/holo_orange_dark"
  55 + android:prompt="@string/leyendaSpinner"
  56 + android:soundEffectsEnabled="true"
  57 + android:spinnerMode="dialog"
  58 + android:splitMotionEvents="false"
  59 + android:textAlignment="center"
  60 + android:textSize="@dimen/NormalText"
  61 + app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
  62 + app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor"
  63 + app:layout_constraintHorizontal_chainStyle="packed"
  64 + app:layout_constraintStart_toStartOf="parent"
  65 + app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" />
  66 +
  67 + <Button
  68 + android:id="@+id/btnValidarServidor"
187 69 android:layout_width="wrap_content"
188 70 android:layout_height="wrap_content"
189   - android:layout_margin="5dp"
190   - android:checked="false"
191   - android:padding="5dp"
192   - android:text="@string/rbDeposito"
193   - android:textSize="@dimen/NormalText" />
194   -
195   - </RadioGroup>
196   -
197   - <TextView
198   - android:id="@+id/tvLosProductos"
199   - android:layout_width="0dp"
200   - android:layout_height="wrap_content"
201   -
202   - android:layout_marginStart="@dimen/MarginBotAgreSer"
203   - android:layout_marginEnd="@dimen/MarginTopSubTitulos"
204   - android:gravity="start"
205   - android:lines="1"
206   - android:text="@string/tvLosProductos"
207   - android:textColor="@android:color/black"
208   - android:textSize="@dimen/SubTitulos"
209   - app:fontFamily="sans-serif-condensed"
210   - app:layout_constraintEnd_toEndOf="parent"
211   - app:layout_constraintStart_toStartOf="parent"
212   - app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" />
213   -
214   - <RadioGroup
215   - android:id="@+id/rgLosProductos"
216   - android:layout_width="0dp"
217   - android:layout_height="wrap_content"
218   -
219   - android:gravity="center"
220   - android:orientation="vertical"
221   - app:layout_constraintEnd_toEndOf="parent"
222   - app:layout_constraintStart_toStartOf="parent"
223   - app:layout_constraintTop_toBottomOf="@+id/tvLosProductos">
224   -
225   - <RadioButton
226   - android:id="@+id/rbProInclu"
227   - android:layout_width="match_parent"
  71 + android:background="@drawable/boton_borde_redondeado"
  72 + android:padding="10dp"
  73 + android:text="@string/btnValidarServidor"
  74 + android:textColor="@android:color/white"
  75 + android:textSize="@dimen/NormalText"
  76 + app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
  77 + app:layout_constraintEnd_toEndOf="parent"
  78 + app:layout_constraintHorizontal_chainStyle="packed"
  79 + app:layout_constraintStart_toEndOf="@id/spServidor"
  80 + app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" />
  81 +
  82 + <Button
  83 + android:id="@+id/btnAgregarServidor"
  84 + android:layout_width="0dp"
  85 + android:layout_height="wrap_content"
  86 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  87 + android:layout_marginEnd="@dimen/MarginBotAgreSer"
  88 + android:background="@drawable/boton_borde_redondeado"
  89 + android:padding="10dp"
  90 + android:text="@string/btnAgregarServidor"
  91 + android:textColor="@android:color/white"
  92 + android:textSize="@dimen/NormalText"
  93 + app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas"
  94 + app:layout_constraintEnd_toEndOf="parent"
  95 + app:layout_constraintStart_toStartOf="parent"
  96 + app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" />
  97 +
  98 +
  99 + <TextView
  100 + android:id="@+id/tvUbicacionCarpetas"
  101 + android:layout_width="0dp"
  102 + android:layout_height="wrap_content"
  103 + android:visibility="gone"
  104 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  105 + android:layout_marginTop="@dimen/MarginTopSubTitulos"
  106 + android:gravity="start"
  107 + android:lines="1"
  108 + android:text="@string/tvUbicacionCarpetas"
  109 + android:textColor="@android:color/black"
  110 + android:textSize="@dimen/SubTitulos"
  111 + app:fontFamily="sans-serif-condensed"
  112 + app:layout_constraintBottom_toTopOf="@+id/ibSearch"
  113 + app:layout_constraintEnd_toEndOf="parent"
  114 + app:layout_constraintStart_toStartOf="parent"
  115 + app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" />
  116 +
  117 + <ImageButton
  118 + android:id="@+id/ibSearch"
  119 + android:layout_width="36dp"
  120 + android:layout_height="37dp"
  121 + android:layout_margin="10dp"
  122 + android:background="@drawable/boton_borde_redondeado"
  123 + android:padding="10dp"
  124 + android:visibility="gone"
  125 + android:src="@drawable/search"
  126 + android:textColor="@android:color/white"
  127 + app:layout_constraintEnd_toStartOf="@+id/etRuta"
  128 + app:layout_constraintStart_toStartOf="parent"
  129 + app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
  130 +
  131 + <EditText
  132 + android:id="@+id/etRuta"
  133 + android:layout_width="0dp"
  134 + android:layout_height="wrap_content"
  135 + android:layout_marginTop="10dp"
  136 + android:layout_marginEnd="10dp"
  137 + android:clickable="true"
  138 + android:ems="10"
  139 + android:focusable="true"
  140 + android:inputType="textPersonName"
  141 + android:lines="1"
  142 + android:text=""
  143 + android:visibility="gone"
  144 + android:textSize="@dimen/NormalText"
  145 + app:layout_constraintEnd_toEndOf="parent"
  146 + app:layout_constraintStart_toEndOf="@id/ibSearch"
  147 + app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
  148 +
  149 + <TextView
  150 + android:id="@+id/tvActuFecha"
  151 + android:layout_width="0dp"
  152 + android:layout_height="wrap_content"
  153 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  154 + android:layout_marginTop="@dimen/MarginTopSubTitulos"
  155 + android:gravity="start"
  156 + android:lines="1"
  157 + android:text="@string/tvTituloArea"
  158 + android:textColor="@android:color/black"
  159 + android:textSize="@dimen/SubTitulos"
  160 + app:fontFamily="sans-serif-condensed"
  161 + app:layout_constraintEnd_toEndOf="parent"
  162 + app:layout_constraintStart_toStartOf="parent"
  163 + app:layout_constraintTop_toBottomOf="@+id/etRuta" />
  164 +
  165 + <RadioGroup
  166 + android:id="@+id/rgFechaHora"
  167 + android:layout_width="0dp"
228 168 android:layout_height="wrap_content"
229 169  
  170 + android:gravity="center"
  171 + android:orientation="horizontal"
  172 + app:layout_constraintEnd_toEndOf="parent"
  173 + app:layout_constraintStart_toStartOf="parent"
  174 + app:layout_constraintTop_toBottomOf="@+id/tvActuFecha">
  175 +
  176 + <RadioButton
  177 + android:id="@+id/rbVentas"
  178 + android:layout_width="wrap_content"
  179 + android:layout_height="wrap_content"
  180 + android:layout_margin="5dp"
  181 + android:checked="true"
  182 + android:padding="5dp"
  183 + android:text="@string/rbVentas"
  184 + android:textSize="@dimen/NormalText" />
  185 +
  186 + <RadioButton
  187 + android:id="@+id/rbDeposito"
  188 + android:layout_width="wrap_content"
  189 + android:layout_height="wrap_content"
  190 + android:layout_margin="5dp"
  191 + android:checked="false"
  192 + android:padding="5dp"
  193 + android:text="@string/rbDeposito"
  194 + android:textSize="@dimen/NormalText" />
  195 +
  196 + </RadioGroup>
  197 +
  198 + <TextView
  199 + android:id="@+id/tvLosProductos"
  200 + android:layout_width="0dp"
  201 + android:layout_height="wrap_content"
  202 +
  203 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  204 + android:layout_marginEnd="@dimen/MarginTopSubTitulos"
  205 + android:gravity="start"
  206 + android:lines="1"
  207 + android:text="@string/tvLosProductos"
  208 + android:textColor="@android:color/black"
  209 + android:textSize="@dimen/SubTitulos"
  210 + app:fontFamily="sans-serif-condensed"
  211 + app:layout_constraintEnd_toEndOf="parent"
  212 + app:layout_constraintStart_toStartOf="parent"
  213 + app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" />
  214 +
  215 + <RadioGroup
  216 + android:id="@+id/rgLosProductos"
  217 + android:layout_width="0dp"
  218 + android:layout_height="wrap_content"
  219 +
  220 + android:gravity="center"
  221 + android:orientation="vertical"
  222 + app:layout_constraintEnd_toEndOf="parent"
  223 + app:layout_constraintStart_toStartOf="parent"
  224 + app:layout_constraintTop_toBottomOf="@+id/tvLosProductos">
  225 +
  226 + <RadioButton
  227 + android:id="@+id/rbProInclu"
  228 + android:layout_width="match_parent"
  229 + android:layout_height="wrap_content"
  230 +
  231 + android:layout_margin="@dimen/PadingCbyRb"
  232 + android:checked="true"
  233 + android:padding="@dimen/PadingCbyRb"
  234 + android:text="@string/rbProInclu"
  235 + android:textSize="@dimen/NormalText" />
  236 +
  237 + <RadioButton
  238 + android:id="@+id/rbProNoInclu"
  239 + android:layout_width="match_parent"
  240 + android:layout_height="wrap_content"
  241 + android:layout_margin="@dimen/PadingCbyRb"
  242 + android:checked="false"
  243 + android:padding="@dimen/PadingCbyRb"
  244 + android:text="@string/rbProNoInclu"
  245 + android:textSize="@dimen/NormalText" />
  246 +
  247 + </RadioGroup>
  248 +
  249 + <CheckBox
  250 + android:id="@+id/cbHabiLectura"
  251 + android:layout_width="0dp"
  252 + android:layout_height="wrap_content"
230 253 android:layout_margin="@dimen/PadingCbyRb"
231   - android:checked="true"
232 254 android:padding="@dimen/PadingCbyRb"
233   - android:text="@string/rbProInclu"
234   - android:textSize="@dimen/NormalText" />
235   -
236   - <RadioButton
237   - android:id="@+id/rbProNoInclu"
238   - android:layout_width="match_parent"
  255 + android:text="@string/cbHabiLectura"
  256 + android:textSize="@dimen/NormalText"
  257 + app:layout_constraintEnd_toEndOf="parent"
  258 + app:layout_constraintStart_toStartOf="parent"
  259 + app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" />
  260 +
  261 + <CheckBox
  262 + android:id="@+id/cbMostrarStock"
  263 + android:layout_width="0dp"
239 264 android:layout_height="wrap_content"
240 265 android:layout_margin="@dimen/PadingCbyRb"
241   - android:checked="false"
242 266 android:padding="@dimen/PadingCbyRb"
243   - android:text="@string/rbProNoInclu"
244   - android:textSize="@dimen/NormalText" />
245   -
246   - </RadioGroup>
247   -
248   - <CheckBox
249   - android:id="@+id/cbHabiLectura"
250   - android:layout_width="0dp"
251   - android:layout_height="wrap_content"
252   - android:layout_margin="@dimen/PadingCbyRb"
253   - android:padding="@dimen/PadingCbyRb"
254   - android:text="@string/cbHabiLectura"
255   - android:textSize="@dimen/NormalText"
256   - app:layout_constraintEnd_toEndOf="parent"
257   - app:layout_constraintStart_toStartOf="parent"
258   - app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" />
259   -
260   - <CheckBox
261   - android:id="@+id/cbMostrarStock"
262   - android:layout_width="0dp"
263   - android:layout_height="wrap_content"
264   - android:layout_margin="@dimen/PadingCbyRb"
265   - android:padding="@dimen/PadingCbyRb"
266   - android:text="@string/cbMostrarStock"
267   - android:textSize="@dimen/NormalText"
268   - app:layout_constraintEnd_toEndOf="parent"
269   - app:layout_constraintStart_toStartOf="parent"
270   - app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" />
271   -
272   - <TextView
273   - android:id="@+id/tvColumMostrar"
274   - android:layout_width="0dp"
275   - android:layout_height="wrap_content"
276   -
277   - android:layout_marginStart="@dimen/MarginBotAgreSer"
278   - android:layout_marginEnd="@dimen/MarginTopSubTitulos"
279   - android:gravity="start"
280   - android:lines="1"
281   - android:text="@string/tvColumMostrar"
282   - android:textColor="@android:color/black"
283   - android:textSize="@dimen/SubTitulos"
284   - app:fontFamily="sans-serif-condensed"
285   - app:layout_constraintEnd_toEndOf="parent"
286   - app:layout_constraintStart_toStartOf="parent"
287   - app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />
288   -
289   - <RadioGroup
290   - android:id="@+id/rgCodigosMostrar"
291   - android:layout_width="0dp"
292   - android:layout_height="wrap_content"
293   -
294   - android:gravity="center"
295   - android:orientation="horizontal"
296   - app:layout_constraintEnd_toEndOf="parent"
297   - app:layout_constraintStart_toStartOf="parent"
298   - app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">
299   -
300   - <RadioButton
301   - android:id="@+id/rbCodigoDebo"
  267 + android:text="@string/cbMostrarStock"
  268 + android:textSize="@dimen/NormalText"
  269 + app:layout_constraintEnd_toEndOf="parent"
  270 + app:layout_constraintStart_toStartOf="parent"
  271 + app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" />
  272 +
  273 + <TextView
  274 + android:id="@+id/tvColumMostrar"
  275 + android:layout_width="0dp"
  276 + android:layout_height="wrap_content"
  277 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  278 + android:layout_marginEnd="@dimen/MarginTopSubTitulos"
  279 + android:gravity="start"
  280 + android:lines="1"
  281 + android:text="@string/tvColumMostrar"
  282 + android:textColor="@android:color/black"
  283 + android:textSize="@dimen/SubTitulos"
  284 + android:visibility="gone"
  285 + app:fontFamily="sans-serif-condensed"
  286 + app:layout_constraintEnd_toEndOf="parent"
  287 + app:layout_constraintStart_toStartOf="parent"
  288 + app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />
  289 +
  290 + <RadioGroup
  291 + android:id="@+id/rgCodigosMostrar"
  292 + android:layout_width="0dp"
  293 + android:layout_height="wrap_content"
  294 + android:gravity="center"
  295 + android:orientation="horizontal"
  296 + android:visibility="gone"
  297 + app:layout_constraintEnd_toEndOf="parent"
  298 + app:layout_constraintStart_toStartOf="parent"
  299 + app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">
  300 +
  301 + <RadioButton
  302 + android:id="@+id/rbCodigoDebo"
  303 + android:layout_width="wrap_content"
  304 + android:layout_height="wrap_content"
  305 + android:layout_margin="5dp"
  306 + android:checked="true"
  307 + android:padding="5dp"
  308 + android:text="@string/rbCodigoDebo"
  309 + android:textSize="@dimen/NormalText" />
  310 +
  311 + <RadioButton
  312 + android:id="@+id/rbCodigoOrigen"
  313 + android:layout_width="wrap_content"
  314 + android:layout_height="wrap_content"
  315 + android:layout_margin="5dp"
  316 + android:checked="false"
  317 + android:padding="5dp"
  318 + android:text="@string/rbCodigoOrigen"
  319 + android:textSize="@dimen/NormalText" />
  320 +
  321 + <RadioButton
  322 + android:id="@+id/rbCodigoBarras"
  323 + android:layout_width="wrap_content"
  324 + android:layout_height="wrap_content"
  325 + android:layout_margin="5dp"
  326 + android:padding="5dp"
  327 + android:text="@string/rbCodigoBarras"
  328 + android:textSize="@dimen/NormalText" />
  329 + </RadioGroup>
  330 +
  331 + <Button
  332 + android:id="@+id/btnAskTimeServer"
302 333 android:layout_width="wrap_content"
303 334 android:layout_height="wrap_content"
304   - android:layout_margin="5dp"
305   - android:checked="true"
306   - android:padding="5dp"
307   - android:text="@string/rbCodigoDebo"
308   - android:textSize="@dimen/NormalText" />
309   -
310   - <RadioButton
311   - android:id="@+id/rbCodigoOrigen"
  335 + android:layout_margin="@dimen/PadingCbyRb"
  336 + android:background="@drawable/boton_borde_redondeado"
  337 + android:checked="false"
  338 + android:padding="10dp"
  339 + android:text="@string/btnAskTimeServer"
  340 + android:textColor="@android:color/white"
  341 + android:textSize="@dimen/NormalText"
  342 + android:visibility="gone"
  343 + app:layout_constraintStart_toStartOf="parent"
  344 + app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />
  345 +
  346 + <CheckBox
  347 + android:id="@+id/cbAskTimeServerToStart"
312 348 android:layout_width="wrap_content"
313 349 android:layout_height="wrap_content"
314   - android:layout_margin="5dp"
  350 + android:layout_margin="@dimen/PadingCbyRb"
315 351 android:checked="false"
316   - android:padding="5dp"
317   - android:text="@string/rbCodigoOrigen"
318   - android:textSize="@dimen/NormalText" />
319   -
320   - <RadioButton
321   - android:id="@+id/rbCodigoBarras"
  352 + android:padding="@dimen/PadingCbyRb"
  353 + android:text="@string/cbAskTimeServerToStart"
  354 + android:textSize="@dimen/NormalText"
  355 + android:visibility="visible"
  356 + app:layout_constraintStart_toStartOf="parent"
  357 + app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />
  358 +
  359 + <Button
  360 + android:id="@+id/btnGuardar"
322 361 android:layout_width="wrap_content"
323 362 android:layout_height="wrap_content"
324   - android:layout_margin="5dp"
325   - android:padding="5dp"
326   - android:text="@string/rbCodigoBarras"
327   - android:textSize="@dimen/NormalText" />
328   - </RadioGroup>
329   -
330   - <CheckBox
331   - android:id="@+id/cbMostrarExistencia"
332   - android:layout_width="wrap_content"
333   - android:layout_height="wrap_content"
334   - android:layout_margin="@dimen/PadingCbyRb"
335   - android:padding="@dimen/PadingCbyRb"
336   - android:text="@string/cbMostrarExistencia"
337   - android:textSize="@dimen/NormalText"
338   - android:checked="false"
339   - app:layout_constraintEnd_toStartOf="@+id/cbMostrarPrecio"
340   - app:layout_constraintStart_toStartOf="parent"
341   - app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />
342   -
343   - <CheckBox
344   - android:id="@+id/cbMostrarPrecio"
345   - android:layout_width="wrap_content"
346   - android:layout_height="wrap_content"
347   - android:layout_margin="@dimen/PadingCbyRb"
348   - android:padding="@dimen/PadingCbyRb"
349   - android:text="@string/cbMostrarPrecio"
350   - android:textSize="@dimen/NormalText"
351   - android:checked="false"
352   - app:layout_constraintEnd_toEndOf="parent"
353   - app:layout_constraintStart_toEndOf="@+id/cbMostrarExistencia"
354   - app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />
355   -
356   - <Button
357   - android:id="@+id/btnGuardar"
358   - android:layout_width="wrap_content"
359   - android:layout_height="wrap_content"
360   - android:text="@string/btnGuardar"
361   - android:textSize="@dimen/NormalText"
362   - app:layout_constraintEnd_toEndOf="parent"
363   - android:textColor="@android:color/white"
364   - android:padding="10dp"
365   - android:background="@drawable/boton_borde_redondeado"
366   - app:layout_constraintStart_toStartOf="parent"
367   - app:layout_constraintTop_toBottomOf="@+id/cbMostrarPrecio" />
368   -</androidx.constraintlayout.widget.ConstraintLayout>
  363 + android:background="@drawable/boton_borde_redondeado"
  364 + android:padding="10dp"
  365 + android:text="@string/btnGuardar"
  366 + android:textColor="@android:color/white"
  367 + android:textSize="@dimen/NormalText"
  368 + app:layout_constraintBottom_toBottomOf="parent"
  369 + app:layout_constraintEnd_toEndOf="parent"
  370 + app:layout_constraintStart_toStartOf="parent"
  371 + app:layout_constraintTop_toBottomOf="@+id/cbAskTimeServerToStart" />
  372 +
  373 + </androidx.constraintlayout.widget.ConstraintLayout>
369 374  
370 375 </ScrollView>
371 376 \ No newline at end of file
app/src/main/res/layout-land/fragment_inventario.xml
... ... @@ -117,6 +117,23 @@
117 117 android:background="@drawable/boton_borde_redondeado"
118 118 app:layout_constraintTop_toBottomOf="@+id/guideline5" />
119 119  
  120 +
  121 + <ProgressBar
  122 + android:id="@+id/loading_view"
  123 + android:layout_width="wrap_content"
  124 + android:layout_height="wrap_content"
  125 + android:layout_marginStart="8dp"
  126 + android:layout_marginLeft="8dp"
  127 + android:layout_marginTop="8dp"
  128 + android:layout_marginEnd="8dp"
  129 + android:layout_marginRight="8dp"
  130 + android:layout_marginBottom="8dp"
  131 + android:visibility="invisible"
  132 + app:layout_constraintBottom_toBottomOf="parent"
  133 + app:layout_constraintEnd_toEndOf="parent"
  134 + app:layout_constraintStart_toStartOf="parent"
  135 + app:layout_constraintTop_toTopOf="parent" />
  136 +
120 137 <androidx.constraintlayout.widget.Guideline
121 138 android:id="@+id/guideline"
122 139 android:layout_width="wrap_content"
app/src/main/res/layout-land/fragment_servidores.xml
... ... @@ -77,7 +77,7 @@
77 77  
78 78 <EditText
79 79 android:id="@+id/etDireccionServidor"
80   - android:layout_width="130dp"
  80 + android:layout_width="180dp"
81 81 android:layout_height="wrap_content"
82 82 android:clickable="true"
83 83 android:ems="10"
... ... @@ -85,25 +85,52 @@
85 85 android:hint="192.168.100.100"
86 86 android:inputType="phone"
87 87 android:lines="1"
  88 + android:nextFocusLeft="@id/etPuertoSubida"
  89 + android:nextFocusRight="@id/etPuertoSubida"
  90 + android:nextFocusDown="@id/etPuertoSubida"
88 91 android:textSize="15sp"
89 92 app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer"
90 93 app:layout_constraintStart_toEndOf="@+id/tvDirServer" />
91 94  
92 95  
93 96 <EditText
94   - android:id="@+id/etPuerto"
95   - android:layout_width="80dp"
  97 + android:id="@+id/etPuertoSubida"
  98 + android:layout_width="150dp"
96 99 android:layout_height="wrap_content"
  100 + android:layout_margin="10dp"
  101 + android:autofillHints=""
97 102 android:clickable="true"
98   - android:ems="10"
  103 + android:ems="9"
99 104 android:focusable="true"
100   - android:hint="Puerto"
  105 + android:hint="Puerto de Subida"
101 106 android:inputType="number"
102 107 android:lines="1"
  108 + android:nextFocusLeft="@id/etPuertoBajada"
  109 + android:nextFocusRight="@id/etPuertoBajada"
  110 + android:nextFocusDown="@id/etPuertoBajada"
103 111 android:textSize="15sp"
104 112 app:layout_constraintBaseline_toBaselineOf="@+id/etDireccionServidor"
105   - app:layout_constraintStart_toEndOf="@+id/etDireccionServidor"
106   - android:autofillHints="" />
  113 + app:layout_constraintStart_toEndOf="@+id/etDireccionServidor" />
  114 +
  115 + <EditText
  116 + android:id="@+id/etPuertoBajada"
  117 + android:layout_width="150dp"
  118 + android:layout_height="wrap_content"
  119 + android:layout_margin="10dp"
  120 + android:autofillHints=""
  121 + android:clickable="true"
  122 + android:ems="10"
  123 + android:focusable="true"
  124 + android:hint="Puerto de Bajada"
  125 + android:inputType="number"
  126 + android:lines="1"
  127 + android:nextFocusLeft="@id/btnGuardarServidores"
  128 + android:nextFocusRight="@id/btnGuardarServidores"
  129 + android:nextFocusDown="@id/btnGuardarServidores"
  130 + android:textSize="15sp"
  131 + app:layout_constraintBaseline_toBaselineOf="@+id/etPuertoSubida"
  132 +
  133 + app:layout_constraintStart_toEndOf="@+id/etPuertoSubida" />
107 134  
108 135  
109 136 <androidx.recyclerview.widget.RecyclerView
... ... @@ -115,7 +142,7 @@
115 142 app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores"
116 143 app:layout_constraintEnd_toEndOf="parent"
117 144 app:layout_constraintStart_toStartOf="parent"
118   - app:layout_constraintTop_toBottomOf="@+id/etPuerto"
  145 + app:layout_constraintTop_toBottomOf="@+id/etPuertoSubida"
119 146 app:layout_goneMarginEnd="10dp"
120 147 tools:listitem="@layout/item_servidores" />
121 148  
app/src/main/res/layout-large-v26/fragment_main.xml
... ... @@ -0,0 +1,180 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent">
  7 +
  8 + <androidx.appcompat.widget.AppCompatTextView
  9 + android:id="@+id/tvInvDinamicos"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="110dp"
  12 + android:autoSizeMaxTextSize="150sp"
  13 + android:autoSizeMinTextSize="25sp"
  14 + android:autoSizeStepGranularity="5sp"
  15 + android:autoSizeTextType="uniform"
  16 + android:gravity="start"
  17 + android:lines="1"
  18 + android:padding="10dp"
  19 + android:text="@string/invDinamicoVenta"
  20 + android:textColor="@color/colorAccent"
  21 + android:visibility="visible"
  22 + app:fontFamily="sans-serif-condensed"
  23 + app:layout_constraintEnd_toEndOf="parent"
  24 + app:layout_constraintStart_toStartOf="parent"
  25 + app:layout_constraintTop_toTopOf="parent" />
  26 +
  27 + <androidx.appcompat.widget.AppCompatImageButton
  28 + android:id="@+id/ivSort19"
  29 + android:layout_width="@dimen/icon_dim10"
  30 + android:layout_height="@dimen/icon_dim10"
  31 + android:layout_marginStart="10dp"
  32 + android:padding="5dp"
  33 + android:src="@drawable/ic_sort19"
  34 + android:visibility="gone"
  35 + app:layout_constraintHorizontal_bias="0.0"
  36 + app:layout_constraintHorizontal_chainStyle="packed"
  37 + app:layout_constraintStart_toStartOf="parent"
  38 + app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" />
  39 +
  40 + <androidx.appcompat.widget.AppCompatImageButton
  41 + android:id="@+id/ivSort91"
  42 + android:layout_width="@dimen/icon_dim10"
  43 + android:layout_height="@dimen/icon_dim10"
  44 + android:layout_marginStart="10dp"
  45 + android:padding="5dp"
  46 + android:src="@drawable/ic_sort91"
  47 + android:visibility="gone"
  48 + app:layout_constraintHorizontal_chainStyle="packed"
  49 + app:layout_constraintStart_toStartOf="parent"
  50 + app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" />
  51 +
  52 + <TextView
  53 + android:id="@+id/tvTipo"
  54 + android:layout_width="wrap_content"
  55 + android:layout_height="wrap_content"
  56 + android:layout_margin="5dp"
  57 + android:layout_marginTop="12dp"
  58 + android:text="Tipo:"
  59 + android:textSize="@dimen/md_message_textsize"
  60 + android:visibility="gone"
  61 + app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas"
  62 + app:layout_constraintEnd_toStartOf="@+id/cbVentas" />
  63 +
  64 + <com.google.android.material.checkbox.MaterialCheckBox
  65 + android:id="@+id/cbVentas"
  66 + android:layout_width="wrap_content"
  67 + android:layout_height="wrap_content"
  68 + android:layout_margin="5dp"
  69 + android:layout_marginTop="12dp"
  70 + android:checked="true"
  71 + android:text="Ventas"
  72 + android:textSize="@dimen/SubTitulos10"
  73 + android:visibility="gone"
  74 + app:layout_constraintEnd_toStartOf="@+id/cbDeposito"
  75 + app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" />
  76 +
  77 + <com.google.android.material.checkbox.MaterialCheckBox
  78 + android:id="@+id/cbDeposito"
  79 + android:layout_width="wrap_content"
  80 + android:layout_height="wrap_content"
  81 + android:layout_margin="5dp"
  82 + android:layout_marginTop="12dp"
  83 + android:checked="true"
  84 + android:text="Deposito"
  85 + android:textSize="@dimen/SubTitulos10"
  86 + android:visibility="gone"
  87 + app:layout_constraintEnd_toEndOf="parent"
  88 + app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" />
  89 +
  90 + <androidx.recyclerview.widget.RecyclerView
  91 + android:id="@+id/rcInventario"
  92 + android:layout_width="match_parent"
  93 + android:layout_height="0dp"
  94 + android:background="@android:color/darker_gray"
  95 + android:scrollbars="vertical"
  96 + android:visibility="gone"
  97 + app:layout_constraintBottom_toTopOf="@+id/guideline6"
  98 + app:layout_constraintEnd_toEndOf="parent"
  99 + app:layout_constraintStart_toStartOf="parent"
  100 + app:layout_constraintTop_toBottomOf="@id/ivSort19"
  101 + tools:listitem="@layout/item_principal" />
  102 +
  103 +
  104 + <androidx.appcompat.widget.AppCompatTextView
  105 + android:id="@+id/tvInvImportados"
  106 + android:layout_width="match_parent"
  107 + android:layout_height="110dp"
  108 + android:autoSizeMaxTextSize="150sp"
  109 + android:autoSizeMinTextSize="25sp"
  110 + android:autoSizeStepGranularity="5sp"
  111 + android:autoSizeTextType="uniform"
  112 + android:gravity="start"
  113 + android:lines="1"
  114 + android:padding="10dp"
  115 + android:text="@string/invDinamicoCompra"
  116 + android:textColor="@color/colorAccent"
  117 + android:visibility="visible"
  118 + app:fontFamily="sans-serif-condensed"
  119 + app:layout_constraintBottom_toBottomOf="parent"
  120 + app:layout_constraintEnd_toEndOf="parent"
  121 + app:layout_constraintStart_toStartOf="parent"
  122 + app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos"
  123 + app:layout_constraintVertical_bias="0.0" />
  124 +
  125 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  126 +<!-- android:id="@+id/ivSort19II"-->
  127 +<!-- android:layout_width="@dimen/icon_dim10"-->
  128 +<!-- android:layout_height="@dimen/icon_dim10"-->
  129 +<!-- android:layout_marginStart="10dp"-->
  130 +<!-- android:padding="5dp"-->
  131 +<!-- android:src="@drawable/ic_sort19"-->
  132 +<!-- android:visibility="invisible"-->
  133 +<!-- app:layout_constraintHorizontal_bias="0.0"-->
  134 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  135 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  136 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  137 +
  138 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  139 +<!-- android:id="@+id/ivSort91II"-->
  140 +<!-- android:layout_width="@dimen/icon_dim10"-->
  141 +<!-- android:layout_height="@dimen/icon_dim10"-->
  142 +<!-- android:layout_marginStart="10dp"-->
  143 +<!-- android:padding="5dp"-->
  144 +<!-- android:src="@drawable/ic_sort91"-->
  145 +<!-- android:visibility="invisible"-->
  146 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  147 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  148 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  149 + <ImageView
  150 + android:id="@+id/ivPortada"
  151 + android:layout_width="452dp"
  152 + android:layout_height="259dp"
  153 + android:elevation="10dp"
  154 + android:visibility="visible"
  155 + app:layout_constraintBottom_toBottomOf="parent"
  156 + app:layout_constraintEnd_toEndOf="parent"
  157 + app:layout_constraintStart_toStartOf="parent"
  158 + app:layout_constraintTop_toBottomOf="@+id/tvInvImportados"
  159 + tools:srcCompat="@drawable/imagen_portada" />
  160 +
  161 + <androidx.recyclerview.widget.RecyclerView
  162 + android:id="@+id/rcInventarioII"
  163 + android:layout_width="match_parent"
  164 + android:layout_height="0dp"
  165 + android:background="@android:color/darker_gray"
  166 + android:scrollbars="vertical"
  167 + android:visibility="gone"
  168 + app:layout_constraintBottom_toTopOf="@+id/guideline6"
  169 + app:layout_constraintEnd_toEndOf="parent"
  170 + app:layout_constraintStart_toStartOf="parent"
  171 + app:layout_constraintTop_toBottomOf="@id/tvInvImportados"
  172 + tools:listitem="@layout/item_principal" />
  173 +
  174 + <androidx.constraintlayout.widget.Guideline
  175 + android:id="@+id/guideline6"
  176 + android:layout_width="wrap_content"
  177 + android:layout_height="wrap_content"
  178 + android:orientation="horizontal"
  179 + app:layout_constraintGuide_percent="0.97" />
  180 +</androidx.constraintlayout.widget.ConstraintLayout>
0 181 \ No newline at end of file
app/src/main/res/layout-large/fragment_main.xml
... ... @@ -0,0 +1,174 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent">
  7 +
  8 + <androidx.appcompat.widget.AppCompatTextView
  9 + android:id="@+id/tvInvDinamicos"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content"
  12 + android:textSize="60sp"
  13 + android:gravity="start"
  14 + android:lines="1"
  15 + android:padding="10dp"
  16 + android:text="@string/invDinamicoVenta"
  17 + android:textColor="@color/colorAccent"
  18 + android:visibility="visible"
  19 + app:fontFamily="sans-serif-condensed"
  20 + app:layout_constraintEnd_toEndOf="parent"
  21 + app:layout_constraintStart_toStartOf="parent"
  22 + app:layout_constraintTop_toTopOf="parent" />
  23 +
  24 + <androidx.appcompat.widget.AppCompatImageButton
  25 + android:id="@+id/ivSort19"
  26 + android:layout_width="@dimen/icon_dim10"
  27 + android:layout_height="@dimen/icon_dim10"
  28 + android:layout_marginStart="10dp"
  29 + android:padding="5dp"
  30 + android:src="@drawable/ic_sort19"
  31 + android:visibility="gone"
  32 + app:layout_constraintHorizontal_bias="0.0"
  33 + app:layout_constraintHorizontal_chainStyle="packed"
  34 + app:layout_constraintStart_toStartOf="parent"
  35 + app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" />
  36 +
  37 + <androidx.appcompat.widget.AppCompatImageButton
  38 + android:id="@+id/ivSort91"
  39 + android:layout_width="@dimen/icon_dim10"
  40 + android:layout_height="@dimen/icon_dim10"
  41 + android:layout_marginStart="10dp"
  42 + android:padding="5dp"
  43 + android:src="@drawable/ic_sort91"
  44 + android:visibility="gone"
  45 + app:layout_constraintHorizontal_chainStyle="packed"
  46 + app:layout_constraintStart_toStartOf="parent"
  47 + app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" />
  48 +
  49 + <TextView
  50 + android:id="@+id/tvTipo"
  51 + android:layout_width="wrap_content"
  52 + android:layout_height="wrap_content"
  53 + android:layout_margin="5dp"
  54 + android:layout_marginTop="12dp"
  55 + android:text="Tipo:"
  56 + android:textSize="@dimen/md_message_textsize"
  57 + android:visibility="gone"
  58 + app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas"
  59 + app:layout_constraintEnd_toStartOf="@+id/cbVentas" />
  60 +
  61 + <com.google.android.material.checkbox.MaterialCheckBox
  62 + android:id="@+id/cbVentas"
  63 + android:layout_width="wrap_content"
  64 + android:layout_height="wrap_content"
  65 + android:layout_margin="5dp"
  66 + android:layout_marginTop="12dp"
  67 + android:checked="true"
  68 + android:text="Ventas"
  69 + android:textSize="@dimen/SubTitulos10"
  70 + android:visibility="gone"
  71 + app:layout_constraintEnd_toStartOf="@+id/cbDeposito"
  72 + app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" />
  73 +
  74 + <com.google.android.material.checkbox.MaterialCheckBox
  75 + android:id="@+id/cbDeposito"
  76 + android:layout_width="wrap_content"
  77 + android:layout_height="wrap_content"
  78 + android:layout_margin="5dp"
  79 + android:layout_marginTop="12dp"
  80 + android:checked="true"
  81 + android:text="Deposito"
  82 + android:textSize="@dimen/SubTitulos10"
  83 + android:visibility="gone"
  84 + app:layout_constraintEnd_toEndOf="parent"
  85 + app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" />
  86 +
  87 + <androidx.recyclerview.widget.RecyclerView
  88 + android:id="@+id/rcInventario"
  89 + android:layout_width="match_parent"
  90 + android:layout_height="0dp"
  91 + android:background="@android:color/darker_gray"
  92 + android:scrollbars="vertical"
  93 + android:visibility="gone"
  94 + app:layout_constraintBottom_toTopOf="@+id/guideline6"
  95 + app:layout_constraintEnd_toEndOf="parent"
  96 + app:layout_constraintStart_toStartOf="parent"
  97 + app:layout_constraintTop_toBottomOf="@id/ivSort19"
  98 + tools:listitem="@layout/item_principal" />
  99 +
  100 +
  101 + <androidx.appcompat.widget.AppCompatTextView
  102 + android:id="@+id/tvInvImportados"
  103 + android:layout_width="match_parent"
  104 + android:layout_height="wrap_content"
  105 + android:textSize="60sp"
  106 + android:gravity="start"
  107 + android:lines="1"
  108 + android:padding="10dp"
  109 + android:text="@string/invDinamicoCompra"
  110 + android:textColor="@color/colorAccent"
  111 + android:visibility="visible"
  112 + app:fontFamily="sans-serif-condensed"
  113 + app:layout_constraintBottom_toBottomOf="parent"
  114 + app:layout_constraintEnd_toEndOf="parent"
  115 + app:layout_constraintStart_toStartOf="parent"
  116 + app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos"
  117 + app:layout_constraintVertical_bias="0.0" />
  118 +
  119 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  120 +<!-- android:id="@+id/ivSort19II"-->
  121 +<!-- android:layout_width="@dimen/icon_dim10"-->
  122 +<!-- android:layout_height="@dimen/icon_dim10"-->
  123 +<!-- android:layout_marginStart="10dp"-->
  124 +<!-- android:padding="5dp"-->
  125 +<!-- android:src="@drawable/ic_sort19"-->
  126 +<!-- android:visibility="invisible"-->
  127 +<!-- app:layout_constraintHorizontal_bias="0.0"-->
  128 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  129 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  130 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  131 +
  132 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  133 +<!-- android:id="@+id/ivSort91II"-->
  134 +<!-- android:layout_width="@dimen/icon_dim10"-->
  135 +<!-- android:layout_height="@dimen/icon_dim10"-->
  136 +<!-- android:layout_marginStart="10dp"-->
  137 +<!-- android:padding="5dp"-->
  138 +<!-- android:src="@drawable/ic_sort91"-->
  139 +<!-- android:visibility="invisible"-->
  140 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  141 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  142 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  143 + <ImageView
  144 + android:id="@+id/ivPortada"
  145 + android:layout_width="706dp"
  146 + android:layout_height="448dp"
  147 + android:elevation="10dp"
  148 + android:visibility="visible"
  149 + app:layout_constraintBottom_toBottomOf="parent"
  150 + app:layout_constraintEnd_toEndOf="parent"
  151 + app:layout_constraintStart_toStartOf="parent"
  152 + app:layout_constraintTop_toBottomOf="@+id/tvInvImportados"
  153 + tools:srcCompat="@drawable/imagen_portada" />
  154 +
  155 + <androidx.recyclerview.widget.RecyclerView
  156 + android:id="@+id/rcInventarioII"
  157 + android:layout_width="match_parent"
  158 + android:layout_height="0dp"
  159 + android:background="@android:color/darker_gray"
  160 + android:scrollbars="vertical"
  161 + android:visibility="gone"
  162 + app:layout_constraintBottom_toTopOf="@+id/guideline6"
  163 + app:layout_constraintEnd_toEndOf="parent"
  164 + app:layout_constraintStart_toStartOf="parent"
  165 + app:layout_constraintTop_toBottomOf="@id/tvInvImportados"
  166 + tools:listitem="@layout/item_principal" />
  167 +
  168 + <androidx.constraintlayout.widget.Guideline
  169 + android:id="@+id/guideline6"
  170 + android:layout_width="wrap_content"
  171 + android:layout_height="wrap_content"
  172 + android:orientation="horizontal"
  173 + app:layout_constraintGuide_percent="0.97" />
  174 +</androidx.constraintlayout.widget.ConstraintLayout>
0 175 \ No newline at end of file
app/src/main/res/layout-xlarge-v26/fragment_actua_maestros.xml
... ... @@ -0,0 +1,140 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment">
  8 +
  9 + <androidx.appcompat.widget.AppCompatTextView
  10 + android:id="@+id/tvActMaestros"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="120dp"
  13 + android:layout_marginTop="15dp"
  14 + android:autoSizeMaxTextSize="100sp"
  15 + android:autoSizeMinTextSize="20sp"
  16 + android:autoSizeStepGranularity="5sp"
  17 + android:autoSizeTextType="uniform"
  18 + android:gravity="center"
  19 + android:lines="1"
  20 + android:text="@string/tvActMaestros"
  21 + android:textColor="@color/colorAccent"
  22 + app:fontFamily="sans-serif-condensed"
  23 + app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor"
  24 + app:layout_constraintEnd_toEndOf="parent"
  25 + app:layout_constraintStart_toStartOf="parent"
  26 + app:layout_constraintTop_toTopOf="parent" />
  27 +
  28 + <TextView
  29 + android:id="@+id/tvSeleccioneServidor"
  30 + android:layout_width="0dp"
  31 + android:layout_height="wrap_content"
  32 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  33 + android:layout_marginTop="20dp"
  34 + android:gravity="start"
  35 + android:lines="1"
  36 + android:text="@string/tvMedio"
  37 + android:textColor="@android:color/black"
  38 + android:textSize="@dimen/VentasDeposito10"
  39 + app:fontFamily="sans-serif-condensed"
  40 + app:layout_constraintEnd_toEndOf="parent"
  41 + app:layout_constraintStart_toStartOf="parent"
  42 + app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" />
  43 +
  44 + <RadioGroup
  45 + android:id="@+id/rgTipoActualizacion"
  46 + android:layout_width="0dp"
  47 + android:layout_height="wrap_content"
  48 + android:layout_marginTop="20dp"
  49 + android:gravity="start"
  50 + android:orientation="vertical"
  51 + app:layout_constraintEnd_toEndOf="parent"
  52 + app:layout_constraintStart_toStartOf="parent"
  53 + app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor">
  54 +
  55 + <RadioButton
  56 + android:id="@+id/obPorWifi"
  57 + android:layout_width="wrap_content"
  58 + android:layout_height="wrap_content"
  59 + android:layout_margin="10dp"
  60 + android:checked="true"
  61 + android:padding="5dp"
  62 + android:text="@string/obPorWifi"
  63 + android:textSize="@dimen/SubTitulos10" />
  64 +
  65 + <RadioButton
  66 + android:id="@+id/obImpInventarios"
  67 + android:layout_width="wrap_content"
  68 + android:layout_height="wrap_content"
  69 + android:layout_margin="10dp"
  70 + android:checked="false"
  71 + android:padding="5dp"
  72 + android:text="@string/obViaArchivo"
  73 + android:textSize="@dimen/SubTitulos10"/>
  74 + </RadioGroup>
  75 +
  76 + <TextView
  77 + android:id="@+id/tvServerConectado"
  78 + android:layout_width="match_parent"
  79 + android:layout_height="wrap_content"
  80 + android:layout_margin="30dp"
  81 + android:gravity="center"
  82 + android:lines="2"
  83 + android:text=""
  84 + android:textColor="@android:color/black"
  85 + android:textSize="@dimen/textCantidad10"
  86 + android:textStyle="bold"
  87 + app:fontFamily="sans-serif-condensed"
  88 + app:layout_constraintBottom_toTopOf="@+id/countriesList"
  89 + app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" />
  90 +
  91 + <TextView
  92 + android:id="@+id/countriesList"
  93 + android:layout_width="0dp"
  94 + android:layout_height="wrap_content"
  95 + android:layout_marginTop="@dimen/MarginTopTitulos"
  96 + android:gravity="center"
  97 + android:text=""
  98 + android:textColor="@android:color/black"
  99 + android:textSize="@dimen/SubTitulos10"
  100 + android:textStyle="bold"
  101 + android:visibility="visible"
  102 + app:fontFamily="sans-serif-condensed"
  103 + app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct"
  104 + app:layout_constraintEnd_toEndOf="parent"
  105 + app:layout_constraintHorizontal_bias="0.0"
  106 + app:layout_constraintStart_toStartOf="parent"
  107 + app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion"
  108 + app:layout_constraintVertical_bias="0.106" />
  109 +
  110 + <Button
  111 + android:id="@+id/btnConfirmarAct"
  112 + android:layout_width="0dp"
  113 + android:layout_height="wrap_content"
  114 + android:layout_margin="20dp"
  115 + android:background="@drawable/boton_borde_redondeado"
  116 + android:padding="10dp"
  117 + android:text="@string/btnConfirmarAct"
  118 + android:textColor="@android:color/white"
  119 + android:textSize="@dimen/SubTitulos10"
  120 + app:layout_constraintBottom_toBottomOf="parent"
  121 + app:layout_constraintEnd_toEndOf="parent"
  122 + app:layout_constraintStart_toStartOf="parent" />
  123 +
  124 + <ProgressBar
  125 + android:id="@+id/loading_view"
  126 + android:layout_width="wrap_content"
  127 + android:layout_height="wrap_content"
  128 + android:layout_marginStart="8dp"
  129 + android:layout_marginLeft="8dp"
  130 + android:layout_marginTop="8dp"
  131 + android:layout_marginEnd="8dp"
  132 + android:layout_marginRight="8dp"
  133 + android:layout_marginBottom="8dp"
  134 + android:visibility="gone"
  135 + app:layout_constraintBottom_toBottomOf="parent"
  136 + app:layout_constraintEnd_toEndOf="parent"
  137 + app:layout_constraintStart_toStartOf="parent"
  138 + app:layout_constraintTop_toTopOf="parent" />
  139 +
  140 +</androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout-xlarge-v26/fragment_main.xml
... ... @@ -0,0 +1,182 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent">
  7 +
  8 + <androidx.appcompat.widget.AppCompatTextView
  9 + android:id="@+id/tvInvDinamicos"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="110dp"
  12 + android:autoSizeMaxTextSize="150sp"
  13 + android:autoSizeMinTextSize="25sp"
  14 + android:autoSizeStepGranularity="5sp"
  15 + android:autoSizeTextType="uniform"
  16 + android:gravity="start"
  17 + android:lines="1"
  18 + android:padding="10dp"
  19 + android:text="@string/invDinamicoVenta"
  20 + android:textColor="@color/colorAccent"
  21 + android:visibility="visible"
  22 + app:fontFamily="sans-serif-condensed"
  23 + app:layout_constraintEnd_toEndOf="parent"
  24 + app:layout_constraintStart_toStartOf="parent"
  25 + app:layout_constraintTop_toTopOf="parent" />
  26 +
  27 + <androidx.appcompat.widget.AppCompatImageButton
  28 + android:id="@+id/ivSort19"
  29 + android:layout_width="@dimen/icon_dim10"
  30 + android:layout_height="@dimen/icon_dim10"
  31 + android:layout_marginStart="10dp"
  32 + android:padding="5dp"
  33 + android:src="@drawable/ic_sort19"
  34 + android:visibility="gone"
  35 + app:layout_constraintHorizontal_bias="0.0"
  36 + app:layout_constraintHorizontal_chainStyle="packed"
  37 + app:layout_constraintStart_toStartOf="parent"
  38 + app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" />
  39 +
  40 + <androidx.appcompat.widget.AppCompatImageButton
  41 + android:id="@+id/ivSort91"
  42 + android:layout_width="@dimen/icon_dim10"
  43 + android:layout_height="@dimen/icon_dim10"
  44 + android:layout_marginStart="10dp"
  45 + android:padding="5dp"
  46 + android:src="@drawable/ic_sort91"
  47 + android:visibility="gone"
  48 + app:layout_constraintHorizontal_chainStyle="packed"
  49 + app:layout_constraintStart_toStartOf="parent"
  50 + app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" />
  51 +
  52 + <TextView
  53 + android:id="@+id/tvTipo"
  54 + android:layout_width="wrap_content"
  55 + android:layout_height="wrap_content"
  56 + android:layout_margin="5dp"
  57 + android:layout_marginTop="12dp"
  58 + android:text="Tipo:"
  59 + android:textSize="@dimen/md_message_textsize"
  60 + android:visibility="gone"
  61 + app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas"
  62 + app:layout_constraintEnd_toStartOf="@+id/cbVentas" />
  63 +
  64 + <com.google.android.material.checkbox.MaterialCheckBox
  65 + android:id="@+id/cbVentas"
  66 + android:layout_width="wrap_content"
  67 + android:layout_height="wrap_content"
  68 + android:layout_margin="5dp"
  69 + android:layout_marginTop="12dp"
  70 + android:checked="true"
  71 + android:text="Ventas"
  72 + android:textSize="@dimen/SubTitulos10"
  73 + android:visibility="gone"
  74 + app:layout_constraintEnd_toStartOf="@+id/cbDeposito"
  75 + app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" />
  76 +
  77 + <com.google.android.material.checkbox.MaterialCheckBox
  78 + android:id="@+id/cbDeposito"
  79 + android:layout_width="wrap_content"
  80 + android:layout_height="wrap_content"
  81 + android:layout_margin="5dp"
  82 + android:layout_marginTop="12dp"
  83 + android:checked="true"
  84 + android:text="Deposito"
  85 + android:textSize="@dimen/SubTitulos10"
  86 + android:visibility="gone"
  87 + app:layout_constraintEnd_toEndOf="parent"
  88 + app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" />
  89 +
  90 + <androidx.recyclerview.widget.RecyclerView
  91 + android:id="@+id/rcInventario"
  92 + android:layout_width="match_parent"
  93 + android:layout_height="0dp"
  94 + android:background="@android:color/darker_gray"
  95 + android:scrollbars="vertical"
  96 + android:visibility="gone"
  97 + app:layout_constraintBottom_toTopOf="@+id/guideline6"
  98 + app:layout_constraintEnd_toEndOf="parent"
  99 + app:layout_constraintStart_toStartOf="parent"
  100 + app:layout_constraintTop_toBottomOf="@id/ivSort19"
  101 + tools:listitem="@layout/item_principal" />
  102 +
  103 +
  104 + <androidx.appcompat.widget.AppCompatTextView
  105 + android:id="@+id/tvInvImportados"
  106 + android:layout_width="match_parent"
  107 + android:layout_height="110dp"
  108 + android:autoSizeMaxTextSize="150sp"
  109 + android:autoSizeMinTextSize="25sp"
  110 + android:autoSizeStepGranularity="5sp"
  111 + android:autoSizeTextType="uniform"
  112 + android:gravity="start"
  113 + android:lines="1"
  114 + android:padding="10dp"
  115 + android:text="@string/invDinamicoCompra"
  116 + android:textColor="@color/colorAccent"
  117 + android:visibility="visible"
  118 + app:fontFamily="sans-serif-condensed"
  119 + app:layout_constraintBottom_toBottomOf="parent"
  120 + app:layout_constraintEnd_toEndOf="parent"
  121 + app:layout_constraintStart_toStartOf="parent"
  122 + app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos"
  123 + app:layout_constraintVertical_bias="0.0" />
  124 +
  125 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  126 +<!-- android:id="@+id/ivSort19II"-->
  127 +<!-- android:layout_width="@dimen/icon_dim10"-->
  128 +<!-- android:layout_height="@dimen/icon_dim10"-->
  129 +<!-- android:layout_marginStart="10dp"-->
  130 +<!-- android:padding="5dp"-->
  131 +<!-- android:src="@drawable/ic_sort19"-->
  132 +<!-- android:visibility="invisible"-->
  133 +<!-- app:layout_constraintHorizontal_bias="0.0"-->
  134 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  135 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  136 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  137 +
  138 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  139 +<!-- android:id="@+id/ivSort91II"-->
  140 +<!-- android:layout_width="@dimen/icon_dim10"-->
  141 +<!-- android:layout_height="@dimen/icon_dim10"-->
  142 +<!-- android:layout_marginStart="10dp"-->
  143 +<!-- android:padding="5dp"-->
  144 +<!-- android:src="@drawable/ic_sort91"-->
  145 +<!-- android:visibility="invisible"-->
  146 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  147 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  148 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  149 +
  150 + <ImageView
  151 + android:id="@+id/ivPortada"
  152 + android:layout_width="730dp"
  153 + android:layout_height="491dp"
  154 + android:layout_marginBottom="156dp"
  155 + android:elevation="10dp"
  156 + android:visibility="visible"
  157 + app:layout_constraintBottom_toBottomOf="parent"
  158 + app:layout_constraintEnd_toEndOf="parent"
  159 + app:layout_constraintStart_toStartOf="parent"
  160 + app:layout_constraintTop_toBottomOf="@+id/tvInvImportados"
  161 + tools:srcCompat="@drawable/imagen_portada" />
  162 +
  163 + <androidx.recyclerview.widget.RecyclerView
  164 + android:id="@+id/rcInventarioII"
  165 + android:layout_width="match_parent"
  166 + android:layout_height="0dp"
  167 + android:background="@android:color/darker_gray"
  168 + android:scrollbars="vertical"
  169 + android:visibility="gone"
  170 + app:layout_constraintBottom_toTopOf="@+id/guideline6"
  171 + app:layout_constraintEnd_toEndOf="parent"
  172 + app:layout_constraintStart_toStartOf="parent"
  173 + app:layout_constraintTop_toBottomOf="@id/tvInvImportados"
  174 + tools:listitem="@layout/item_principal" />
  175 +
  176 + <androidx.constraintlayout.widget.Guideline
  177 + android:id="@+id/guideline6"
  178 + android:layout_width="wrap_content"
  179 + android:layout_height="wrap_content"
  180 + android:orientation="horizontal"
  181 + app:layout_constraintGuide_percent="0.97" />
  182 +</androidx.constraintlayout.widget.ConstraintLayout>
0 183 \ No newline at end of file
app/src/main/res/layout-xlarge/activity_splash.xml
... ... @@ -14,10 +14,7 @@
14 14 android:layout_width="match_parent"
15 15 android:layout_height="150dp"
16 16 android:layout_margin="20dp"
17   - android:autoSizeMaxTextSize="1000sp"
18   - android:autoSizeMinTextSize="30sp"
19   - android:autoSizeStepGranularity="5sp"
20   - android:autoSizeTextType="uniform"
  17 + android:textSize="95sp"
21 18 android:gravity="center"
22 19 android:lines="1"
23 20 android:text="@string/bien"
... ... @@ -44,10 +41,7 @@
44 41 android:layout_width="match_parent"
45 42 android:layout_height="150dp"
46 43 android:layout_margin="20dp"
47   - android:autoSizeMaxTextSize="1000sp"
48   - android:autoSizeMinTextSize="30sp"
49   - android:autoSizeStepGranularity="5sp"
50   - android:autoSizeTextType="uniform"
  44 + android:textSize="95sp"
51 45 android:gravity="center"
52 46 android:lines="1"
53 47 android:text="@string/inventario"
app/src/main/res/layout-xlarge/fragment_actua_maestros.xml
... ... @@ -6,21 +6,16 @@
6 6 android:layout_height="match_parent"
7 7 tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment">
8 8  
9   -
10 9 <androidx.appcompat.widget.AppCompatTextView
11 10 android:id="@+id/tvActMaestros"
12 11 android:layout_width="match_parent"
13 12 android:layout_height="120dp"
14 13 android:layout_marginTop="15dp"
15   - android:autoSizeMaxTextSize="100sp"
16   - android:autoSizeMinTextSize="20sp"
17   - android:autoSizeStepGranularity="5sp"
18   - android:autoSizeTextType="uniform"
  14 + android:textSize="60sp"
19 15 android:gravity="center"
20 16 android:lines="1"
21 17 android:text="@string/tvActMaestros"
22 18 android:textColor="@color/colorAccent"
23   -
24 19 app:fontFamily="sans-serif-condensed"
25 20 app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor"
26 21 app:layout_constraintEnd_toEndOf="parent"
... ... @@ -37,7 +32,7 @@
37 32 android:lines="1"
38 33 android:text="@string/tvMedio"
39 34 android:textColor="@android:color/black"
40   - android:textSize="@dimen/SubTitulos10"
  35 + android:textSize="@dimen/VentasDeposito10"
41 36 app:fontFamily="sans-serif-condensed"
42 37 app:layout_constraintEnd_toEndOf="parent"
43 38 app:layout_constraintStart_toStartOf="parent"
... ... @@ -58,17 +53,17 @@
58 53 android:id="@+id/obPorWifi"
59 54 android:layout_width="wrap_content"
60 55 android:layout_height="wrap_content"
61   - android:layout_margin="5dp"
  56 + android:layout_margin="10dp"
62 57 android:checked="true"
63 58 android:padding="5dp"
64 59 android:text="@string/obPorWifi"
65 60 android:textSize="@dimen/SubTitulos10" />
66 61  
67 62 <RadioButton
68   - android:id="@+id/obViaArchivo"
  63 + android:id="@+id/obImpInventarios"
69 64 android:layout_width="wrap_content"
70 65 android:layout_height="wrap_content"
71   - android:layout_margin="5dp"
  66 + android:layout_margin="10dp"
72 67 android:checked="false"
73 68 android:padding="5dp"
74 69 android:text="@string/obViaArchivo"
... ... @@ -123,7 +118,6 @@
123 118 app:layout_constraintEnd_toEndOf="parent"
124 119 app:layout_constraintStart_toStartOf="parent" />
125 120  
126   -
127 121 <ProgressBar
128 122 android:id="@+id/loading_view"
129 123 android:layout_width="wrap_content"
app/src/main/res/layout-xlarge/fragment_configuracion.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2   -<ScrollView
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
3 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 4 xmlns:tools="http://schemas.android.com/tools"
5   - tools:context=".UI.configuracion.ConfiguracionFragment"
6   - xmlns:android="http://schemas.android.com/apk/res/android"
7   - android:layout_width="match_parent"
8   - android:layout_height="wrap_content">
9   -
10   -<androidx.constraintlayout.widget.ConstraintLayout
11 5 android:layout_width="match_parent"
12 6 android:layout_height="wrap_content"
13 7 tools:context=".UI.configuracion.ConfiguracionFragment">
14 8  
15   -
16   - <androidx.appcompat.widget.AppCompatTextView
17   - android:id="@+id/textView2"
  9 + <androidx.constraintlayout.widget.ConstraintLayout
18 10 android:layout_width="match_parent"
19   - android:layout_height="100dp"
20   - android:layout_marginStart="8dp"
21   - android:layout_marginEnd="8dp"
22   - android:autoSizeMaxTextSize="100sp"
23   - android:autoSizeMinTextSize="20sp"
24   - android:autoSizeStepGranularity="5sp"
25   - android:autoSizeTextType="uniform"
26   - android:gravity="center"
27   - android:lines="1"
28   - android:text="@string/tvTituloConf"
29   - android:textColor="@color/colorAccent"
30   - android:textSize="@dimen/Titulos"
31   - app:fontFamily="sans-serif-condensed"
32   - app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor"
33   - app:layout_constraintEnd_toEndOf="parent"
34   - app:layout_constraintStart_toStartOf="parent"
35   - app:layout_constraintTop_toTopOf="parent" />
36   -
37   - <TextView
38   - android:id="@+id/tvSeleccioneServidor"
39   - android:layout_width="0dp"
40   - android:layout_height="wrap_content"
41   - android:layout_marginStart="@dimen/MarginBotAgreSer"
42   - android:layout_marginTop="15dp"
43   - android:gravity="start"
44   - android:lines="1"
45   - android:text="@string/tvSeleccioneServidor"
46   - android:textColor="@android:color/black"
47   - android:textSize="@dimen/SubTitulos10"
48   - app:fontFamily="sans-serif-condensed"
49   - app:layout_constraintBottom_toTopOf="@+id/spServidor"
50   - app:layout_constraintEnd_toEndOf="parent"
51   - app:layout_constraintStart_toStartOf="parent"
52   - app:layout_constraintTop_toBottomOf="@+id/textView2" />
53   -
54   - <Spinner
55   - android:id="@+id/spServidor"
56   - style="@android:style/Widget.Holo.Light.Spinner"
57   - android:layout_width="0dp"
58   - android:layout_height="wrap_content"
59   - android:elevation="5dp"
60   - android:textSize="@dimen/VentasDeposito10"
61   - app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
62   - app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor"
63   - app:layout_constraintHorizontal_chainStyle="packed"
64   - app:layout_constraintStart_toStartOf="parent"
65   - app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"
66   - />
67   -
68   - <Button
69   - android:id="@+id/btnValidarServidor"
70   - android:layout_width="wrap_content"
71   - android:layout_height="wrap_content"
72   - android:textColor="@android:color/white"
73   - android:padding="10dp"
74   - android:background="@drawable/boton_borde_redondeado"
75   - android:text="@string/btnValidarServidor"
76   - android:textSize="@dimen/SubTitulos10"
77   - app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
78   - app:layout_constraintEnd_toEndOf="parent"
79   - app:layout_constraintHorizontal_chainStyle="packed"
80   - app:layout_constraintStart_toEndOf="@id/spServidor"
81   - app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" />
82   -
83   - <Button
84   - android:id="@+id/btnAgregarServidor"
85   - android:layout_width="0dp"
86   - android:layout_height="wrap_content"
87   - android:layout_marginTop="10dp"
88   - android:layout_marginStart="@dimen/MarginBotAgreSer"
89   - android:layout_marginEnd="@dimen/MarginBotAgreSer"
90   - android:text="@string/btnAgregarServidor"
91   - android:textSize="@dimen/SubTitulos10"
92   - android:textColor="@android:color/white"
93   - android:padding="10dp"
94   - android:background="@drawable/boton_borde_redondeado"
95   - app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas"
96   - app:layout_constraintEnd_toEndOf="parent"
97   - app:layout_constraintStart_toStartOf="parent"
98   - app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" />
99   -
100   -
101   - <TextView
102   - android:id="@+id/tvUbicacionCarpetas"
103   - android:layout_width="0dp"
104   - android:layout_height="wrap_content"
105   -android:visibility="gone"
106   - android:layout_marginStart="@dimen/MarginBotAgreSer"
107   - android:layout_marginTop="@dimen/MarginTopSubTitulos"
108   - android:gravity="start"
109   - android:lines="1"
110   - android:text="@string/tvUbicacionCarpetas"
111   - android:textColor="@android:color/black"
112   - android:textSize="@dimen/SubTitulos"
113   - app:fontFamily="sans-serif-condensed"
114   - app:layout_constraintBottom_toTopOf="@+id/ibSearch"
115   - app:layout_constraintEnd_toEndOf="parent"
116   - app:layout_constraintStart_toStartOf="parent"
117   - app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" />
118   -
119   - <ImageButton
120   - android:id="@+id/ibSearch"
121   - android:layout_width="36dp"
122   - android:layout_height="37dp"
123   - android:layout_margin="10dp"
124   - android:src="@drawable/search"
125   - android:textColor="@android:color/white"
126   - android:padding="10dp"
127   - android:visibility="gone"
128   - android:background="@drawable/boton_borde_redondeado"
129   - app:layout_constraintEnd_toStartOf="@+id/etRuta"
130   - app:layout_constraintStart_toStartOf="parent"
131   - app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
132   -
133   - <EditText
134   - android:id="@+id/etRuta"
135   - android:layout_width="0dp"
136   - android:layout_height="wrap_content"
137   - android:layout_marginTop="10dp"
138   - android:layout_marginEnd="10dp"
139   - android:clickable="true"
140   - android:ems="10"
141   - android:focusable="true"
142   - android:visibility="gone"
143   - android:inputType="textPersonName"
144   - android:lines="1"
145   - android:text=""
146   - android:textSize="@dimen/NormalText"
147   - app:layout_constraintEnd_toEndOf="parent"
148   - app:layout_constraintStart_toEndOf="@id/ibSearch"
149   - app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
150   -
151   - <TextView
152   - android:id="@+id/tvActuFecha"
153   - android:layout_width="0dp"
154   - android:layout_height="wrap_content"
155   - android:layout_marginStart="@dimen/MarginBotAgreSer"
156   - android:layout_marginTop="@dimen/MarginTopSubTitulos"
157   - android:gravity="start"
158   - android:lines="1"
159   - android:text="@string/tvTituloArea"
160   - android:textColor="@android:color/black"
161   - android:textSize="@dimen/SubTitulos10"
162   - app:fontFamily="sans-serif-condensed"
163   - app:layout_constraintEnd_toEndOf="parent"
164   - app:layout_constraintStart_toStartOf="parent"
165   - app:layout_constraintTop_toBottomOf="@+id/etRuta" />
166   -
167   - <RadioGroup
168   - android:id="@+id/rgFechaHora"
169   - android:layout_width="0dp"
170 11 android:layout_height="wrap_content"
  12 + tools:context=".UI.configuracion.ConfiguracionFragment">
171 13  
172   - android:gravity="center"
173   - android:orientation="horizontal"
174   - app:layout_constraintEnd_toEndOf="parent"
175   - app:layout_constraintStart_toStartOf="parent"
176   - app:layout_constraintTop_toBottomOf="@+id/tvActuFecha">
177 14  
178   - <RadioButton
179   - android:id="@+id/rbVentas"
180   - android:layout_width="wrap_content"
  15 + <androidx.appcompat.widget.AppCompatTextView
  16 + android:id="@+id/textView2"
  17 + android:layout_width="match_parent"
  18 + android:layout_height="100dp"
  19 + android:layout_marginStart="8dp"
  20 + android:layout_marginEnd="8dp"
  21 + android:gravity="center"
  22 + android:lines="1"
  23 + android:text="@string/tvTituloConf"
  24 + android:textColor="@color/colorAccent"
  25 + android:textSize="60sp"
  26 +
  27 + app:fontFamily="sans-serif-condensed"
  28 + app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor"
  29 + app:layout_constraintEnd_toEndOf="parent"
  30 + app:layout_constraintStart_toStartOf="parent"
  31 + app:layout_constraintTop_toTopOf="parent" />
  32 +
  33 + <TextView
  34 + android:id="@+id/tvSeleccioneServidor"
  35 + android:layout_width="0dp"
  36 + android:layout_height="wrap_content"
  37 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  38 + android:layout_marginTop="15dp"
  39 + android:gravity="start"
  40 + android:lines="1"
  41 + android:text="@string/tvSeleccioneServidor"
  42 + android:textColor="@android:color/black"
  43 + android:textSize="@dimen/SubTitulos10"
  44 + app:fontFamily="sans-serif-condensed"
  45 + app:layout_constraintBottom_toTopOf="@+id/spServidor"
  46 + app:layout_constraintEnd_toEndOf="parent"
  47 + app:layout_constraintStart_toStartOf="parent"
  48 + app:layout_constraintTop_toBottomOf="@+id/textView2" />
  49 +
  50 + <Spinner
  51 + android:id="@+id/spServidor"
  52 + style="@android:style/Widget.Holo.Light.Spinner"
  53 + android:layout_width="0dp"
181 54 android:layout_height="wrap_content"
182   - android:layout_margin="5dp"
183   - android:checked="true"
184   - android:padding="5dp"
185   - android:text="@string/rbVentas"
186   - android:textSize="@dimen/SubTitulos10" />
187   -
188   - <RadioButton
189   - android:id="@+id/rbDeposito"
  55 + android:elevation="5dp"
  56 + android:textSize="@dimen/VentasDeposito10"
  57 + app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
  58 + app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor"
  59 + app:layout_constraintHorizontal_chainStyle="packed"
  60 + app:layout_constraintStart_toStartOf="parent"
  61 + app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" />
  62 +
  63 + <Button
  64 + android:id="@+id/btnValidarServidor"
190 65 android:layout_width="wrap_content"
191 66 android:layout_height="wrap_content"
192   - android:layout_margin="5dp"
193   - android:checked="false"
194   - android:padding="5dp"
195   - android:text="@string/rbDeposito"
196   - android:textSize="@dimen/SubTitulos10" />
197   -
198   - </RadioGroup>
199   -
200   - <TextView
201   - android:id="@+id/tvLosProductos"
202   - android:layout_width="0dp"
203   - android:layout_height="wrap_content"
204   - android:layout_marginStart="@dimen/MarginBotAgreSer"
205   - android:layout_marginEnd="@dimen/MarginTopSubTitulos"
206   - android:gravity="start"
207   - android:lines="1"
208   - android:text="@string/tvLosProductos"
209   - android:textColor="@android:color/black"
210   - android:textSize="@dimen/SubTitulos10"
211   - app:fontFamily="sans-serif-condensed"
212   - app:layout_constraintEnd_toEndOf="parent"
213   - app:layout_constraintStart_toStartOf="parent"
214   - app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" />
215   -
216   - <RadioGroup
217   - android:id="@+id/rgLosProductos"
218   - android:layout_width="0dp"
219   - android:layout_height="wrap_content"
  67 + android:background="@drawable/boton_borde_redondeado"
  68 + android:padding="10dp"
  69 + android:text="@string/btnValidarServidor"
  70 + android:textColor="@android:color/white"
  71 + android:textSize="@dimen/SubTitulos10"
  72 + app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
  73 + app:layout_constraintEnd_toEndOf="parent"
  74 + app:layout_constraintHorizontal_chainStyle="packed"
  75 + app:layout_constraintStart_toEndOf="@id/spServidor"
  76 + app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" />
  77 +
  78 + <Button
  79 + android:id="@+id/btnAgregarServidor"
  80 + android:layout_width="0dp"
  81 + android:layout_height="wrap_content"
  82 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  83 + android:layout_marginTop="10dp"
  84 + android:layout_marginEnd="@dimen/MarginBotAgreSer"
  85 + android:background="@drawable/boton_borde_redondeado"
  86 + android:padding="10dp"
  87 + android:text="@string/btnAgregarServidor"
  88 + android:textColor="@android:color/white"
  89 + android:textSize="@dimen/SubTitulos10"
  90 + app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas"
  91 + app:layout_constraintEnd_toEndOf="parent"
  92 + app:layout_constraintStart_toStartOf="parent"
  93 + app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" />
  94 +
  95 +
  96 + <TextView
  97 + android:id="@+id/tvUbicacionCarpetas"
  98 + android:layout_width="0dp"
  99 + android:layout_height="wrap_content"
  100 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  101 + android:layout_marginTop="@dimen/MarginTopSubTitulos"
  102 + android:gravity="start"
  103 + android:lines="1"
  104 + android:text="@string/tvUbicacionCarpetas"
  105 + android:textColor="@android:color/black"
  106 + android:textSize="@dimen/SubTitulos"
  107 + android:visibility="gone"
  108 + app:fontFamily="sans-serif-condensed"
  109 + app:layout_constraintBottom_toTopOf="@+id/ibSearch"
  110 + app:layout_constraintEnd_toEndOf="parent"
  111 + app:layout_constraintStart_toStartOf="parent"
  112 + app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" />
  113 +
  114 + <ImageButton
  115 + android:id="@+id/ibSearch"
  116 + android:layout_width="36dp"
  117 + android:layout_height="37dp"
  118 + android:layout_margin="10dp"
  119 + android:background="@drawable/boton_borde_redondeado"
  120 + android:padding="10dp"
  121 + android:src="@drawable/search"
  122 + android:textColor="@android:color/white"
  123 + android:visibility="gone"
  124 + app:layout_constraintEnd_toStartOf="@+id/etRuta"
  125 + app:layout_constraintStart_toStartOf="parent"
  126 + app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
  127 +
  128 + <EditText
  129 + android:id="@+id/etRuta"
  130 + android:layout_width="0dp"
  131 + android:layout_height="wrap_content"
  132 + android:layout_marginTop="10dp"
  133 + android:layout_marginEnd="10dp"
  134 + android:clickable="true"
  135 + android:ems="10"
  136 + android:focusable="true"
  137 + android:inputType="textPersonName"
  138 + android:lines="1"
  139 + android:text=""
  140 + android:textSize="@dimen/NormalText"
  141 + android:visibility="gone"
  142 + app:layout_constraintEnd_toEndOf="parent"
  143 + app:layout_constraintStart_toEndOf="@id/ibSearch"
  144 + app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
  145 +
  146 + <TextView
  147 + android:id="@+id/tvActuFecha"
  148 + android:layout_width="0dp"
  149 + android:layout_height="wrap_content"
  150 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  151 + android:layout_marginTop="@dimen/MarginTopSubTitulos"
  152 + android:gravity="start"
  153 + android:lines="1"
  154 + android:text="@string/tvTituloArea"
  155 + android:textColor="@android:color/black"
  156 + android:textSize="@dimen/SubTitulos10"
  157 + app:fontFamily="sans-serif-condensed"
  158 + app:layout_constraintEnd_toEndOf="parent"
  159 + app:layout_constraintStart_toStartOf="parent"
  160 + app:layout_constraintTop_toBottomOf="@+id/etRuta" />
  161 +
  162 + <RadioGroup
  163 + android:id="@+id/rgFechaHora"
  164 + android:layout_width="0dp"
  165 + android:layout_height="wrap_content"
220 166  
221   - android:gravity="center"
222   - android:orientation="vertical"
223   - app:layout_constraintEnd_toEndOf="parent"
224   - app:layout_constraintStart_toStartOf="parent"
225   - app:layout_constraintTop_toBottomOf="@+id/tvLosProductos">
  167 + android:gravity="center"
  168 + android:orientation="horizontal"
  169 + app:layout_constraintEnd_toEndOf="parent"
  170 + app:layout_constraintStart_toStartOf="parent"
  171 + app:layout_constraintTop_toBottomOf="@+id/tvActuFecha">
  172 +
  173 + <RadioButton
  174 + android:id="@+id/rbVentas"
  175 + android:layout_width="wrap_content"
  176 + android:layout_height="wrap_content"
  177 + android:layout_margin="5dp"
  178 + android:checked="true"
  179 + android:padding="5dp"
  180 + android:text="@string/rbVentas"
  181 + android:textSize="@dimen/SubTitulos10" />
  182 +
  183 + <RadioButton
  184 + android:id="@+id/rbDeposito"
  185 + android:layout_width="wrap_content"
  186 + android:layout_height="wrap_content"
  187 + android:layout_margin="5dp"
  188 + android:checked="false"
  189 + android:padding="5dp"
  190 + android:text="@string/rbDeposito"
  191 + android:textSize="@dimen/SubTitulos10" />
  192 +
  193 + </RadioGroup>
  194 +
  195 + <TextView
  196 + android:id="@+id/tvLosProductos"
  197 + android:layout_width="0dp"
  198 + android:layout_height="wrap_content"
  199 + android:layout_marginStart="@dimen/MarginBotAgreSer"
  200 + android:layout_marginEnd="@dimen/MarginTopSubTitulos"
  201 + android:gravity="start"
  202 + android:lines="1"
  203 + android:text="@string/tvLosProductos"
  204 + android:textColor="@android:color/black"
  205 + android:textSize="@dimen/SubTitulos10"
  206 + app:fontFamily="sans-serif-condensed"
  207 + app:layout_constraintEnd_toEndOf="parent"
  208 + app:layout_constraintStart_toStartOf="parent"
  209 + app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" />
  210 +
  211 + <RadioGroup
  212 + android:id="@+id/rgLosProductos"
  213 + android:layout_width="0dp"
  214 + android:layout_height="wrap_content"
226 215  
227   - <RadioButton
228   - android:id="@+id/rbProInclu"
229   - android:layout_width="match_parent"
  216 + android:gravity="center"
  217 + android:orientation="vertical"
  218 + app:layout_constraintEnd_toEndOf="parent"
  219 + app:layout_constraintStart_toStartOf="parent"
  220 + app:layout_constraintTop_toBottomOf="@+id/tvLosProductos">
  221 +
  222 + <RadioButton
  223 + android:id="@+id/rbProInclu"
  224 + android:layout_width="match_parent"
  225 + android:layout_height="wrap_content"
  226 + android:layout_margin="@dimen/PadingCbyRb"
  227 + android:checked="true"
  228 + android:padding="@dimen/PadingCbyRb"
  229 + android:text="@string/rbProInclu"
  230 + android:textSize="@dimen/SubTitulos10" />
  231 +
  232 + <RadioButton
  233 + android:id="@+id/rbProNoInclu"
  234 + android:layout_width="match_parent"
  235 + android:layout_height="wrap_content"
  236 + android:layout_margin="@dimen/PadingCbyRb"
  237 + android:checked="false"
  238 + android:padding="@dimen/PadingCbyRb"
  239 + android:text="@string/rbProNoInclu"
  240 + android:textSize="@dimen/SubTitulos10" />
  241 +
  242 + </RadioGroup>
  243 +
  244 + <CheckBox
  245 + android:id="@+id/cbHabiLectura"
  246 + android:layout_width="0dp"
230 247 android:layout_height="wrap_content"
231 248 android:layout_margin="@dimen/PadingCbyRb"
232   - android:checked="true"
233 249 android:padding="@dimen/PadingCbyRb"
234   - android:text="@string/rbProInclu"
235   - android:textSize="@dimen/SubTitulos10" />
  250 + android:text="@string/cbHabiLectura"
  251 + android:textSize="@dimen/SubTitulos10"
  252 + app:layout_constraintEnd_toEndOf="parent"
  253 + app:layout_constraintStart_toStartOf="parent"
  254 + app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" />
  255 +
  256 + <CheckBox
  257 + android:id="@+id/cbMostrarStock"
  258 + android:layout_width="0dp"
  259 + android:layout_height="wrap_content"
  260 + android:layout_margin="@dimen/PadingCbyRb"
  261 + android:padding="@dimen/PadingCbyRb"
  262 + android:text="@string/cbMostrarStock"
  263 + android:textSize="@dimen/SubTitulos10"
  264 + app:layout_constraintEnd_toEndOf="parent"
  265 + app:layout_constraintStart_toStartOf="parent"
  266 + app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" />
236 267  
237   - <RadioButton
238   - android:id="@+id/rbProNoInclu"
239   - android:layout_width="match_parent"
  268 +
  269 + <Button
  270 + android:id="@+id/btnAskTimeServer"
  271 + android:layout_width="wrap_content"
  272 + android:layout_height="wrap_content"
  273 + android:layout_margin="10dp"
  274 + android:background="@drawable/boton_borde_redondeado"
  275 + android:checked="false"
  276 + android:padding="@dimen/PadingCbyRb"
  277 + android:text="@string/btnAskTimeServer"
  278 + android:textColor="@android:color/white"
  279 + android:textSize="@dimen/md_message_textsize"
  280 + android:visibility="gone"
  281 + app:layout_constraintStart_toStartOf="parent"
  282 + app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />
  283 +
  284 + <CheckBox
  285 + android:id="@+id/cbAskTimeServerToStart"
  286 + android:layout_width="wrap_content"
240 287 android:layout_height="wrap_content"
241 288 android:layout_margin="@dimen/PadingCbyRb"
242 289 android:checked="false"
243 290 android:padding="@dimen/PadingCbyRb"
244   - android:text="@string/rbProNoInclu"
245   - android:textSize="@dimen/SubTitulos10"/>
  291 + android:text="@string/cbAskTimeServerToStart"
  292 + android:textSize="@dimen/SubTitulos10"
  293 + android:visibility="visible"
246 294  
247   - </RadioGroup>
  295 + app:layout_constraintStart_toStartOf="parent"
  296 + app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />
248 297  
249   - <CheckBox
250   - android:id="@+id/cbHabiLectura"
251   - android:layout_width="0dp"
252   - android:layout_height="wrap_content"
253   - android:layout_margin="@dimen/PadingCbyRb"
254   - android:padding="@dimen/PadingCbyRb"
255   - android:text="@string/cbHabiLectura"
256   - android:textSize="@dimen/SubTitulos10"
257   - app:layout_constraintEnd_toEndOf="parent"
258   - app:layout_constraintStart_toStartOf="parent"
259   - app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" />
260   -
261   - <CheckBox
262   - android:id="@+id/cbMostrarStock"
263   - android:layout_width="0dp"
264   - android:layout_height="wrap_content"
265   - android:layout_margin="@dimen/PadingCbyRb"
266   - android:padding="@dimen/PadingCbyRb"
267   - android:text="@string/cbMostrarStock"
268   - android:textSize="@dimen/SubTitulos10"
269   - app:layout_constraintEnd_toEndOf="parent"
270   - app:layout_constraintStart_toStartOf="parent"
271   - app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" />
272   -
273   -<!-- <TextView-->
274   -<!-- android:id="@+id/tvColumMostrar"-->
275   -<!-- android:layout_width="0dp"-->
276   -<!-- android:layout_height="wrap_content"-->
277   -<!-- android:layout_marginStart="@dimen/MarginBotAgreSer"-->
278   -<!-- android:layout_marginEnd="@dimen/MarginTopSubTitulos"-->
279   -<!-- android:gravity="start"-->
280   -<!-- android:lines="1"-->
281   -<!-- android:text="@string/tvColumMostrar"-->
282   -<!-- android:textColor="@android:color/black"-->
283   -<!-- android:textSize="@dimen/VentasDeposito10"-->
284   -<!-- app:fontFamily="sans-serif-condensed"-->
285   -<!-- app:layout_constraintEnd_toEndOf="parent"-->
286   -<!-- app:layout_constraintStart_toStartOf="parent"-->
287   -<!-- app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />-->
288   -
289   -<!-- <RadioGroup-->
290   -<!-- android:id="@+id/rgCodigosMostrar"-->
291   -<!-- android:layout_width="0dp"-->
292   -<!-- android:layout_height="wrap_content"-->
293   -
294   -<!-- android:gravity="center"-->
295   -<!-- android:orientation="horizontal"-->
296   -<!-- app:layout_constraintEnd_toEndOf="parent"-->
297   -<!-- app:layout_constraintStart_toStartOf="parent"-->
298   -<!-- app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">-->
299   -
300   -<!-- <RadioButton-->
301   -<!-- android:id="@+id/rbCodigoDebo"-->
302   -<!-- android:layout_width="wrap_content"-->
303   -<!-- android:layout_height="wrap_content"-->
304   -<!-- android:layout_margin="5dp"-->
305   -<!-- android:checked="true"-->
306   -<!-- android:padding="5dp"-->
307   -<!-- android:text="@string/rbCodigoDebo"-->
308   -<!-- android:textSize="@dimen/NormalText" />-->
309   -
310   -<!-- <RadioButton-->
311   -<!-- android:id="@+id/rbCodigoOrigen"-->
312   -<!-- android:layout_width="wrap_content"-->
313   -<!-- android:layout_height="wrap_content"-->
314   -<!-- android:layout_margin="5dp"-->
315   -<!-- android:checked="false"-->
316   -<!-- android:padding="5dp"-->
317   -<!-- android:text="@string/rbCodigoOrigen"-->
318   -<!-- android:textSize="@dimen/NormalText" />-->
319   -
320   -<!-- <RadioButton-->
321   -<!-- android:id="@+id/rbCodigoBarras"-->
322   -<!-- android:layout_width="wrap_content"-->
323   -<!-- android:layout_height="wrap_content"-->
324   -<!-- android:layout_margin="5dp"-->
325   -<!-- android:padding="5dp"-->
326   -<!-- android:text="@string/rbCodigoBarras"-->
327   -<!-- android:textSize="@dimen/NormalText" />-->
328   -<!-- </RadioGroup>-->
329   -
330   -<!-- <CheckBox-->
331   -<!-- android:id="@+id/cbMostrarExistencia"-->
332   -<!-- android:layout_width="wrap_content"-->
333   -<!-- android:layout_height="wrap_content"-->
334   -<!-- android:layout_margin="@dimen/PadingCbyRb"-->
335   -<!-- android:padding="@dimen/PadingCbyRb"-->
336   -<!-- android:text="@string/cbMostrarExistencia"-->
337   -<!-- android:textSize="@dimen/NormalText"-->
338   -<!-- android:checked="false"-->
339   -<!-- app:layout_constraintEnd_toStartOf="@+id/cbMostrarPrecio"-->
340   -<!-- app:layout_constraintStart_toStartOf="parent"-->
341   -<!-- app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />-->
342   -
343   -<!-- <CheckBox-->
344   -<!-- android:id="@+id/cbMostrarPrecio"-->
345   -<!-- android:layout_width="wrap_content"-->
346   -<!-- android:layout_height="wrap_content"-->
347   -<!-- android:layout_margin="@dimen/PadingCbyRb"-->
348   -<!-- android:padding="@dimen/PadingCbyRb"-->
349   -<!-- android:text="@string/cbMostrarPrecio"-->
350   -<!-- android:textSize="@dimen/NormalText"-->
351   -<!-- android:checked="false"-->
352   -<!-- app:layout_constraintEnd_toEndOf="parent"-->
353   -<!-- app:layout_constraintStart_toEndOf="@+id/cbMostrarExistencia"-->
354   -<!-- app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />-->
355   -
356   - <Button
357   - android:id="@+id/btnGuardar"
358   - android:layout_width="wrap_content"
359   - android:layout_height="wrap_content"
360   - android:layout_marginTop="20dp"
361   - android:text="@string/btnGuardar"
362   - android:textSize="@dimen/SubTitulos10"
363   - app:layout_constraintEnd_toEndOf="parent"
364   - android:textColor="@android:color/white"
365   - android:padding="10dp"
366   - android:background="@drawable/boton_borde_redondeado"
367   - app:layout_constraintStart_toStartOf="parent"
368   - app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />
369   -
370   -</androidx.constraintlayout.widget.ConstraintLayout>
  298 + <Button
  299 + android:id="@+id/btnGuardar"
  300 + android:layout_width="wrap_content"
  301 + android:layout_height="wrap_content"
  302 + android:background="@drawable/boton_borde_redondeado"
  303 + android:padding="10dp"
  304 + android:text="@string/btnGuardar"
  305 + android:textColor="@android:color/white"
  306 + android:textSize="@dimen/SubTitulos10"
  307 + app:layout_constraintEnd_toEndOf="parent"
  308 + app:layout_constraintStart_toStartOf="parent"
  309 + app:layout_constraintTop_toBottomOf="@+id/cbAskTimeServerToStart" />
  310 +
  311 + </androidx.constraintlayout.widget.ConstraintLayout>
371 312 </ScrollView>
372 313  
app/src/main/res/layout-xlarge/fragment_detalle_art_sec.xml
... ... @@ -0,0 +1,348 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + android:id="@+id/nsPedidosDatos"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent">
  7 +
  8 + <androidx.cardview.widget.CardView
  9 + android:id="@+id/cvItem1"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content"
  12 + android:layout_marginStart="5dp"
  13 + android:layout_marginTop="5dp"
  14 + android:layout_marginEnd="5dp"
  15 + app:cardBackgroundColor="@android:color/darker_gray"
  16 + app:cardCornerRadius="25dp"
  17 + app:cardElevation="10dp"
  18 + app:layout_constraintEnd_toEndOf="parent"
  19 + app:layout_constraintStart_toStartOf="parent"
  20 + app:layout_constraintTop_toTopOf="parent">
  21 +
  22 + <androidx.constraintlayout.widget.ConstraintLayout
  23 + android:id="@+id/clayout"
  24 + android:layout_width="match_parent"
  25 + android:layout_height="match_parent">
  26 +
  27 + <!-- <TextView-->
  28 + <!-- android:id="@+id/tvTime"-->
  29 + <!-- android:layout_width="0dp"-->
  30 + <!-- android:layout_height="wrap_content"-->
  31 + <!-- android:layout_marginTop="15dp"-->
  32 + <!-- android:gravity="center_horizontal"-->
  33 + <!-- android:orientation="horizontal"-->
  34 + <!-- android:text="Detalle del artículo"-->
  35 + <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
  36 + <!-- android:textSize="@dimen/Titulos"-->
  37 + <!-- android:textStyle="bold"-->
  38 + <!-- app:layout_constraintEnd_toEndOf="parent"-->
  39 + <!-- app:layout_constraintStart_toStartOf="parent"-->
  40 + <!-- app:layout_constraintTop_toTopOf="parent" />-->
  41 +
  42 + <TextView
  43 + android:id="@+id/tvDescripcion"
  44 + android:layout_width="wrap_content"
  45 + android:layout_height="0dp"
  46 + android:layout_marginTop="10dp"
  47 + android:layout_marginBottom="30dp"
  48 + android:gravity="center_horizontal"
  49 + android:text="coaca"
  50 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  51 + android:textSize="30sp"
  52 + android:textStyle="bold"
  53 + app:layout_constraintEnd_toEndOf="parent"
  54 + app:layout_constraintStart_toStartOf="parent"
  55 + app:layout_constraintTop_toTopOf="parent" />
  56 +
  57 +
  58 + <TextView
  59 + android:id="@+id/textView18"
  60 + android:layout_width="wrap_content"
  61 + android:layout_height="wrap_content"
  62 + android:layout_marginTop="10dp"
  63 + android:text="Códigos:"
  64 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  65 + android:textSize="@dimen/nav_header_vertical_spacing10"
  66 + app:layout_constraintStart_toStartOf="parent"
  67 + app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" />
  68 +
  69 + <TextView
  70 + android:id="@+id/textView19"
  71 + android:layout_width="wrap_content"
  72 + android:layout_height="wrap_content"
  73 + android:layout_marginStart="5dp"
  74 + android:text="DEBO:"
  75 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  76 + android:textSize="@dimen/nav_header_vertical_spacing10"
  77 + app:layout_constraintBaseline_toBaselineOf="@+id/textView18"
  78 + app:layout_constraintStart_toEndOf="@+id/textView18" />
  79 +
  80 + <TextView
  81 + android:id="@+id/tvSector"
  82 + android:layout_width="0dp"
  83 + android:layout_height="wrap_content"
  84 + android:layout_marginStart="5dp"
  85 + android:text="99"
  86 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  87 + android:textSize="@dimen/SubTitulos10"
  88 + android:textStyle="bold"
  89 + app:layout_constraintBaseline_toBaselineOf="@+id/textView19"
  90 + app:layout_constraintStart_toEndOf="@+id/textView19" />
  91 +
  92 + <TextView
  93 + android:id="@+id/tvCodigo"
  94 + android:layout_width="0dp"
  95 + android:layout_height="wrap_content"
  96 + android:layout_marginTop="10dp"
  97 + android:text="999999"
  98 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  99 + android:textSize="@dimen/SubTitulos10"
  100 + android:textStyle="bold"
  101 + app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"
  102 + app:layout_constraintStart_toEndOf="@id/tvSector" />
  103 +
  104 +
  105 + <TextView
  106 + android:id="@+id/textView1"
  107 + android:layout_width="0dp"
  108 + android:layout_height="wrap_content"
  109 + android:layout_marginStart="5dp"
  110 + android:layout_marginTop="10dp"
  111 + android:text="barras:"
  112 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  113 + android:textSize="@dimen/nav_header_vertical_spacing10"
  114 + app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo"
  115 + app:layout_constraintStart_toEndOf="@+id/tvCodigo" />
  116 +
  117 + <TextView
  118 + android:id="@+id/tvCodigoBarras"
  119 + android:layout_width="wrap_content"
  120 + android:layout_height="wrap_content"
  121 + android:layout_marginStart="5dp"
  122 + android:text="12346579012345"
  123 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  124 + android:textSize="@dimen/SubTitulos10"
  125 + android:textStyle="bold"
  126 + app:layout_constraintBaseline_toBaselineOf="@+id/textView1"
  127 + app:layout_constraintStart_toEndOf="@id/textView1" />
  128 +
  129 + <TextView
  130 + android:id="@+id/textView2"
  131 + android:layout_width="wrap_content"
  132 + android:layout_height="wrap_content"
  133 + android:layout_marginStart="5dp"
  134 + android:layout_marginTop="10dp"
  135 + android:text="origen:"
  136 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  137 + android:textSize="@dimen/nav_header_vertical_spacing10"
  138 + app:layout_constraintStart_toEndOf="@+id/textView18"
  139 + app:layout_constraintTop_toBottomOf="@+id/textView18" />
  140 +
  141 +
  142 + <TextView
  143 + android:id="@+id/tvCodigoOrigen"
  144 + android:layout_width="wrap_content"
  145 + android:layout_height="wrap_content"
  146 + android:layout_marginStart="5dp"
  147 + android:layout_marginTop="10dp"
  148 + android:text="1234567890123"
  149 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  150 + android:textSize="@dimen/SubTitulos10"
  151 + android:textStyle="bold"
  152 + app:layout_constraintBaseline_toBaselineOf="@+id/textView2"
  153 + app:layout_constraintStart_toEndOf="@+id/textView2"
  154 + app:layout_constraintTop_toBottomOf="@+id/textView18" />
  155 +
  156 + <TextView
  157 + android:id="@+id/textView9"
  158 + android:layout_width="wrap_content"
  159 + android:layout_height="wrap_content"
  160 + android:layout_marginTop="10dp"
  161 + android:text="Precio:"
  162 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  163 + android:textSize="@dimen/nav_header_vertical_spacing10"
  164 + app:layout_constraintStart_toStartOf="parent"
  165 + app:layout_constraintTop_toBottomOf="@+id/textView2" />
  166 +
  167 + <TextView
  168 + android:id="@+id/textView12"
  169 + android:layout_width="wrap_content"
  170 + android:layout_height="wrap_content"
  171 + android:layout_marginStart="5dp"
  172 + android:layout_marginTop="10dp"
  173 + android:text="venta:"
  174 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  175 + android:textSize="@dimen/nav_header_vertical_spacing10"
  176 + app:layout_constraintBaseline_toBaselineOf="@+id/textView9"
  177 + app:layout_constraintStart_toEndOf="@+id/textView18" />
  178 +
  179 + <TextView
  180 + android:id="@+id/tvPrecio"
  181 + android:layout_width="wrap_content"
  182 + android:layout_height="wrap_content"
  183 + android:layout_marginStart="5dp"
  184 + android:layout_marginTop="10dp"
  185 + android:text="99999.99"
  186 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  187 + android:textSize="@dimen/SubTitulos10"
  188 + android:textStyle="bold"
  189 + app:layout_constraintBaseline_toBaselineOf="@+id/textView12"
  190 + app:layout_constraintStart_toEndOf="@+id/textView12" />
  191 +
  192 + <TextView
  193 + android:id="@+id/textView8"
  194 + android:layout_width="wrap_content"
  195 + android:layout_height="wrap_content"
  196 + android:text="Costo:"
  197 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  198 + android:textSize="@dimen/nav_header_vertical_spacing10"
  199 + app:layout_constraintBaseline_toBaselineOf="@+id/tvPrecio"
  200 + app:layout_constraintStart_toEndOf="@+id/tvCodigo" />
  201 +
  202 + <TextView
  203 + android:id="@+id/tvCosto"
  204 + android:layout_width="wrap_content"
  205 + android:layout_height="wrap_content"
  206 + android:layout_marginStart="5dp"
  207 + android:layout_marginTop="10dp"
  208 + android:text="9999.99"
  209 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  210 + android:textSize="@dimen/SubTitulos10"
  211 + android:textStyle="bold"
  212 + app:layout_constraintBaseline_toBaselineOf="@+id/textView8"
  213 + app:layout_constraintStart_toEndOf="@+id/textView8" />
  214 +
  215 + <TextView
  216 + android:id="@+id/textView3"
  217 + android:layout_width="wrap_content"
  218 + android:layout_height="wrap_content"
  219 + android:layout_marginTop="10dp"
  220 + android:text="Depósito:"
  221 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  222 + android:textSize="@dimen/nav_header_vertical_spacing10"
  223 + app:layout_constraintStart_toStartOf="parent"
  224 + app:layout_constraintTop_toBottomOf="@+id/textView9" />
  225 +
  226 + <TextView
  227 + android:id="@+id/tvDeposito"
  228 + android:layout_width="wrap_content"
  229 + android:layout_height="wrap_content"
  230 + android:layout_marginStart="5dp"
  231 + android:text="Si"
  232 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  233 + android:textSize="@dimen/SubTitulos10"
  234 + android:textStyle="bold"
  235 + app:layout_constraintBaseline_toBaselineOf="@+id/textView3"
  236 + app:layout_constraintStart_toEndOf="@+id/textView3" />
  237 +
  238 + <TextView
  239 + android:id="@+id/textView5"
  240 + android:layout_width="wrap_content"
  241 + android:layout_height="wrap_content"
  242 + android:layout_marginTop="10dp"
  243 + android:text="Stock:"
  244 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  245 + android:textSize="@dimen/nav_header_vertical_spacing10"
  246 + app:layout_constraintStart_toStartOf="parent"
  247 + app:layout_constraintTop_toBottomOf="@+id/textView3" />
  248 +
  249 +
  250 + <TextView
  251 + android:id="@+id/textView15"
  252 + android:layout_width="wrap_content"
  253 + android:layout_height="wrap_content"
  254 + android:layout_marginStart="5dp"
  255 + android:layout_marginTop="10dp"
  256 + android:text="venta:"
  257 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  258 + android:textSize="@dimen/nav_header_vertical_spacing10"
  259 + app:layout_constraintBaseline_toBaselineOf="@+id/textView5"
  260 + app:layout_constraintStart_toEndOf="@+id/textView18" />
  261 +
  262 + <TextView
  263 + android:id="@+id/tvExiVenta"
  264 + android:layout_width="wrap_content"
  265 + android:layout_height="wrap_content"
  266 + android:layout_marginStart="5dp"
  267 + android:layout_marginTop="10dp"
  268 + android:text="99999.99"
  269 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  270 + android:textSize="@dimen/SubTitulos10"
  271 + android:textStyle="bold"
  272 + app:layout_constraintBaseline_toBaselineOf="@+id/textView15"
  273 + app:layout_constraintStart_toEndOf="@+id/textView15" />
  274 +
  275 + <TextView
  276 + android:id="@+id/textView7"
  277 + android:layout_width="wrap_content"
  278 + android:layout_height="wrap_content"
  279 + android:text="deposito:"
  280 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  281 + android:textSize="@dimen/nav_header_vertical_spacing10"
  282 + app:layout_constraintBaseline_toBaselineOf="@+id/tvExiVenta"
  283 + app:layout_constraintStart_toEndOf="@+id/tvCodigo" />
  284 +
  285 + <TextView
  286 + android:id="@+id/tvExiDeposito"
  287 + android:layout_width="wrap_content"
  288 + android:layout_height="wrap_content"
  289 + android:layout_marginStart="5dp"
  290 + android:layout_marginTop="10dp"
  291 + android:text="99999.99"
  292 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  293 + android:textSize="@dimen/SubTitulos10"
  294 + android:textStyle="bold"
  295 + app:layout_constraintBaseline_toBaselineOf="@+id/textView7"
  296 + app:layout_constraintStart_toEndOf="@+id/textView7"
  297 + app:layout_constraintTop_toBottomOf="@+id/tvCosto" />
  298 +
  299 +
  300 + <TextView
  301 + android:id="@+id/textView10"
  302 + android:layout_width="wrap_content"
  303 + android:layout_height="wrap_content"
  304 + android:text="Unidad de venta:"
  305 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  306 + android:textSize="@dimen/nav_header_vertical_spacing10"
  307 + app:layout_constraintBaseline_toBaselineOf="@+id/tvDeposito"
  308 + app:layout_constraintStart_toEndOf="@+id/tvCodigo" />
  309 +
  310 + <TextView
  311 + android:id="@+id/tvBal"
  312 + android:layout_width="wrap_content"
  313 + android:layout_height="wrap_content"
  314 + android:layout_marginStart="5dp"
  315 + android:text="Unidades"
  316 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  317 + android:textSize="@dimen/SubTitulos10"
  318 + android:textStyle="bold"
  319 + app:layout_constraintBaseline_toBaselineOf="@+id/textView10"
  320 + app:layout_constraintStart_toEndOf="@+id/textView10" />
  321 +
  322 +
  323 + <TextView
  324 + android:id="@+id/textView11"
  325 + android:layout_width="wrap_content"
  326 + android:layout_height="wrap_content"
  327 + android:layout_marginTop="10dp"
  328 + android:text="Imagen:"
  329 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  330 + android:textSize="@dimen/nav_header_vertical_spacing10"
  331 + app:layout_constraintStart_toStartOf="parent"
  332 + app:layout_constraintTop_toBottomOf="@+id/textView5" />
  333 +
  334 + <ImageView
  335 + android:id="@+id/ivImagen"
  336 + android:layout_width="400dp"
  337 + android:layout_height="400dp"
  338 + android:src="@drawable/no_imagen"
  339 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  340 + android:textSize="14sp"
  341 + app:layout_constraintEnd_toEndOf="parent"
  342 + app:layout_constraintStart_toStartOf="parent"
  343 + app:layout_constraintTop_toBottomOf="@+id/textView15" />
  344 +
  345 + </androidx.constraintlayout.widget.ConstraintLayout>
  346 + </androidx.cardview.widget.CardView>
  347 +
  348 +</ScrollView>
app/src/main/res/layout-xlarge/fragment_inv_importados.xml
... ... @@ -0,0 +1,106 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment">
  8 +
  9 +
  10 + <androidx.appcompat.widget.AppCompatTextView
  11 + android:id="@+id/tvActMaestros"
  12 + android:layout_width="0dp"
  13 + android:layout_height="wrap_content"
  14 + android:layout_marginTop="@dimen/MarginTopTitulos"
  15 + android:gravity="center"
  16 + android:text="@string/tvActMaestros"
  17 + android:textColor="@color/colorAccent"
  18 + android:textSize="65sp"
  19 + app:fontFamily="sans-serif-condensed"
  20 + app:layout_constraintBottom_toTopOf="@+id/tvSeleccionInventario"
  21 + app:layout_constraintEnd_toEndOf="parent"
  22 + app:layout_constraintStart_toStartOf="parent"
  23 + app:layout_constraintTop_toTopOf="parent" />
  24 +
  25 + <TextView
  26 + android:id="@+id/tvSeleccionInventario"
  27 + android:layout_width="0dp"
  28 + android:layout_height="wrap_content"
  29 + android:layout_margin="30dp"
  30 + android:padding="15dp"
  31 + android:gravity="center"
  32 + android:text="@string/tvSeleccionInventario"
  33 + android:textColor="@android:color/black"
  34 + android:textSize="30sp"
  35 + app:fontFamily="sans-serif-condensed"
  36 + app:layout_constraintEnd_toEndOf="parent"
  37 + app:layout_constraintStart_toStartOf="parent"
  38 + app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" />
  39 +
  40 + <androidx.recyclerview.widget.RecyclerView
  41 + android:id="@+id/rcDescripcion"
  42 + android:layout_width="match_parent"
  43 + android:layout_height="0dp"
  44 + android:background="@android:color/darker_gray"
  45 + android:scrollbars="vertical"
  46 + android:visibility="visible"
  47 + app:layout_constraintBottom_toTopOf="@+id/guideline"
  48 + app:layout_constraintEnd_toEndOf="parent"
  49 + app:layout_constraintStart_toStartOf="parent"
  50 + app:layout_constraintTop_toBottomOf="@id/tvSeleccionInventario"
  51 + tools:listitem="@layout/item_inv_importados" />
  52 +
  53 + <Button
  54 + android:id="@+id/btnConfirmarAct"
  55 + android:layout_width="0dp"
  56 + android:layout_height="wrap_content"
  57 + android:layout_margin="20dp"
  58 + android:text="@string/btnConfirmarAct"
  59 + android:textSize="@dimen/TitulosMedios"
  60 + android:textColor="@android:color/white"
  61 + android:padding="10dp"
  62 + android:background="@drawable/boton_borde_redondeado"
  63 + app:layout_constraintBottom_toBottomOf="parent"
  64 + app:layout_constraintEnd_toEndOf="parent"
  65 + app:layout_constraintStart_toStartOf="parent" />
  66 +
  67 +
  68 + <ProgressBar
  69 + android:id="@+id/pbInvSec"
  70 + android:layout_width="wrap_content"
  71 + android:layout_height="wrap_content"
  72 + android:layout_marginStart="8dp"
  73 + android:layout_marginLeft="8dp"
  74 + android:layout_marginTop="8dp"
  75 + android:layout_marginEnd="8dp"
  76 + android:layout_marginRight="8dp"
  77 + android:layout_marginBottom="8dp"
  78 + android:visibility="gone"
  79 + app:layout_constraintBottom_toBottomOf="parent"
  80 + app:layout_constraintEnd_toEndOf="parent"
  81 + app:layout_constraintStart_toStartOf="parent"
  82 + app:layout_constraintTop_toTopOf="parent" />
  83 +
  84 + <TextView
  85 + android:id="@+id/tvMensaje"
  86 + android:layout_width="0dp"
  87 + android:layout_height="wrap_content"
  88 + android:padding="15dp"
  89 + android:gravity="center"
  90 + android:text="@string/tvSeleccionInventario"
  91 + android:textColor="@android:color/black"
  92 + android:textSize="@dimen/TitulosMedios"
  93 + app:fontFamily="sans-serif-condensed"
  94 + android:visibility="gone"
  95 + app:layout_constraintBottom_toBottomOf="@+id/rcDescripcion"
  96 + app:layout_constraintEnd_toEndOf="parent"
  97 + app:layout_constraintStart_toStartOf="parent"
  98 + app:layout_constraintTop_toTopOf="@+id/rcDescripcion" />
  99 +
  100 + <androidx.constraintlayout.widget.Guideline
  101 + android:id="@+id/guideline"
  102 + android:layout_width="wrap_content"
  103 + android:layout_height="wrap_content"
  104 + android:orientation="horizontal"
  105 + app:layout_constraintGuide_percent="0.88" />
  106 +</androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout-xlarge/fragment_inv_sec.xml
... ... @@ -0,0 +1,244 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.constraintlayout.widget.ConstraintLayout
  3 + xmlns:android="http://schemas.android.com/apk/res/android"
  4 + xmlns:app="http://schemas.android.com/apk/res-auto"
  5 + xmlns:tools="http://schemas.android.com/tools"
  6 + android:id="@+id/frameLayout"
  7 + android:layout_width="match_parent"
  8 + android:layout_height="match_parent"
  9 + tools:context=".UI.inventario.InventarioFragment">
  10 +
  11 +
  12 +<!-- <androidx.appcompat.widget.AppCompatTextView-->
  13 +<!-- android:id="@+id/tvTituloSec"-->
  14 +<!-- android:layout_width="0dp"-->
  15 +<!-- android:layout_height="wrap_content"-->
  16 +<!-- android:layout_marginStart="8dp"-->
  17 +<!-- android:layout_marginEnd="8dp"-->
  18 +<!-- android:textSize="60sp"-->
  19 +<!-- android:gravity="center"-->
  20 +<!-- android:lines="1"-->
  21 +<!-- android:text="@string/invTitulo"-->
  22 +<!-- android:textColor="@color/colorAccent"-->
  23 +<!-- app:fontFamily="sans-serif-condensed"-->
  24 +<!-- app:layout_constraintBottom_toTopOf="@id/guideline2"-->
  25 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  26 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  27 +<!-- app:layout_constraintTop_toTopOf="@id/guideline" />-->
  28 +
  29 +
  30 +<!-- <androidx.recyclerview.widget.RecyclerView-->
  31 +<!-- android:id="@+id/rcInventariosSec"-->
  32 +<!-- android:layout_width="match_parent"-->
  33 +<!-- android:layout_height="0dp"-->
  34 +<!-- android:background="@android:color/darker_gray"-->
  35 +<!-- app:layout_constraintBottom_toBottomOf="@+id/guideline5"-->
  36 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  37 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  38 +<!-- app:layout_constraintTop_toBottomOf="@+id/guideline2"-->
  39 +<!-- tools:listitem="@layout/item" />-->
  40 +
  41 +
  42 +<!-- <Button-->
  43 +<!-- android:id="@+id/btnExportarInvSec"-->
  44 +<!-- android:layout_width="wrap_content"-->
  45 +<!-- android:layout_height="wrap_content"-->
  46 +<!-- android:text="@string/btnExportarInv"-->
  47 +<!-- android:textColor="@android:color/white"-->
  48 +<!-- android:padding="10dp"-->
  49 +<!-- android:textSize="@dimen/SubTitulos10"-->
  50 +<!-- android:background="@drawable/boton_borde_redondeado"-->
  51 +<!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"-->
  52 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  53 +<!-- app:layout_constraintHorizontal_chainStyle="spread"-->
  54 +<!-- app:layout_constraintStart_toEndOf="@+id/btnBorrarInv"-->
  55 +<!-- app:layout_constraintTop_toBottomOf="@+id/guideline5" />-->
  56 +
  57 +<!-- <Button-->
  58 +<!-- android:id="@+id/btnBorrarInv"-->
  59 +<!-- android:layout_width="wrap_content"-->
  60 +<!-- android:layout_height="wrap_content"-->
  61 +<!-- android:text="@string/btnBorrarInv"-->
  62 +<!-- android:textSize="@dimen/SubTitulos10"-->
  63 +<!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"-->
  64 +<!-- app:layout_constraintEnd_toStartOf="@id/btnExportarInvSec"-->
  65 +<!-- app:layout_constraintHorizontal_chainStyle="spread"-->
  66 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  67 +<!-- android:textColor="@android:color/white"-->
  68 +<!-- android:padding="10dp"-->
  69 +<!-- android:background="@drawable/boton_borde_redondeado"-->
  70 +<!-- app:layout_constraintTop_toBottomOf="@+id/guideline5" />-->
  71 +
  72 +<!-- <androidx.constraintlayout.widget.Guideline-->
  73 +<!-- android:id="@+id/guideline"-->
  74 +<!-- android:layout_width="wrap_content"-->
  75 +<!-- android:layout_height="wrap_content"-->
  76 +<!-- android:orientation="horizontal"-->
  77 +<!-- app:layout_constraintGuide_percent="0.02" />-->
  78 +
  79 +<!-- <androidx.constraintlayout.widget.Guideline-->
  80 +<!-- android:id="@+id/guideline2"-->
  81 +<!-- android:layout_width="wrap_content"-->
  82 +<!-- android:layout_height="wrap_content"-->
  83 +<!-- android:orientation="horizontal"-->
  84 +<!-- app:layout_constraintGuide_percent="0.12029161" />-->
  85 +
  86 +<!-- <androidx.constraintlayout.widget.Guideline-->
  87 +<!-- android:id="@+id/guideline5"-->
  88 +<!-- android:layout_width="wrap_content"-->
  89 +<!-- android:layout_height="wrap_content"-->
  90 +<!-- android:orientation="horizontal"-->
  91 +<!-- app:layout_constraintGuide_percent="0.88" />-->
  92 +
  93 +<!-- <androidx.constraintlayout.widget.Guideline-->
  94 +<!-- android:id="@+id/guideline6"-->
  95 +<!-- android:layout_width="wrap_content"-->
  96 +<!-- android:layout_height="wrap_content"-->
  97 +<!-- android:orientation="horizontal"-->
  98 +<!-- app:layout_constraintGuide_percent="0.97" />-->
  99 +
  100 +
  101 + <androidx.appcompat.widget.AppCompatTextView
  102 + android:id="@+id/tvTitulo"
  103 + android:layout_width="0dp"
  104 + android:layout_height="wrap_content"
  105 + android:layout_marginStart="8dp"
  106 + android:layout_marginEnd="8dp"
  107 +android:textSize="60sp"
  108 + android:gravity="center"
  109 + android:lines="1"
  110 + android:text="@string/invTitulo"
  111 + android:textColor="@color/colorAccent"
  112 + app:fontFamily="sans-serif-condensed"
  113 + app:layout_constraintBottom_toTopOf="@id/guideline2"
  114 + app:layout_constraintEnd_toEndOf="parent"
  115 + app:layout_constraintStart_toStartOf="parent"
  116 + app:layout_constraintTop_toTopOf="@id/guideline" />
  117 +
  118 +
  119 + <ImageButton
  120 + android:id="@+id/ivCamara"
  121 + android:layout_width="@dimen/boton10"
  122 + android:layout_height="@dimen/boton10"
  123 + android:layout_marginTop="15dp"
  124 + android:clickable="true"
  125 + android:contentDescription="@string/ibBusCB"
  126 + android:elevation="5dp"
  127 + android:background="@drawable/boton_redondo"
  128 + android:layout_margin="10dp"
  129 + android:focusable="false"
  130 + android:scaleType="fitEnd"
  131 + app:layout_constraintCircleRadius="40dp"
  132 + android:src="@drawable/desc"
  133 + app:layout_constraintBottom_toTopOf="@id/guideline3"
  134 + app:layout_constraintEnd_toStartOf="@+id/etDescripcion"
  135 + app:layout_constraintHorizontal_bias="0.0"
  136 + app:layout_constraintStart_toStartOf="parent"
  137 + app:layout_constraintTop_toBottomOf="@+id/guideline2" />
  138 +
  139 + <EditText
  140 + android:id="@+id/etDescripcion"
  141 + android:layout_width="0dp"
  142 + android:layout_height="wrap_content"
  143 + android:autofillHints=""
  144 + android:clickable="true"
  145 + android:ems="10"
  146 + android:focusable="true"
  147 + android:hint="@string/ibBusDesc"
  148 + android:inputType="textPersonName"
  149 + android:lines="1"
  150 + android:textAllCaps="true"
  151 + android:textSize="@dimen/textCantidad10"
  152 + app:layout_constraintBottom_toTopOf="@+id/guideline3"
  153 + app:layout_constraintEnd_toEndOf="parent"
  154 + app:layout_constraintHorizontal_bias="0.49"
  155 + app:layout_constraintHorizontal_chainStyle="packed"
  156 + app:layout_constraintStart_toEndOf="@+id/ivCamara"
  157 + app:layout_constraintTop_toBottomOf="@+id/guideline2" />
  158 +
  159 + <androidx.recyclerview.widget.RecyclerView
  160 + android:id="@+id/rcInventarios"
  161 + android:layout_width="match_parent"
  162 + android:layout_height="0dp"
  163 + android:background="@android:color/darker_gray"
  164 + app:layout_constraintBottom_toBottomOf="@+id/guideline5"
  165 + app:layout_constraintEnd_toEndOf="parent"
  166 + app:layout_constraintStart_toStartOf="parent"
  167 + app:layout_constraintTop_toBottomOf="@+id/guideline4"
  168 + tools:listitem="@layout/item" />
  169 +
  170 + <Button
  171 + android:id="@+id/btnExportarInv"
  172 + android:layout_width="wrap_content"
  173 + android:layout_height="wrap_content"
  174 + android:text="@string/btnExportarInv"
  175 + android:textColor="@android:color/white"
  176 + android:layout_marginTop="7dp"
  177 + android:padding="10dp"
  178 + android:textSize="@dimen/SubTitulos10"
  179 + android:background="@drawable/boton_borde_redondeado"
  180 + app:layout_constraintBottom_toBottomOf="@+id/guideline6"
  181 + app:layout_constraintEnd_toEndOf="parent"
  182 + app:layout_constraintHorizontal_chainStyle="spread"
  183 + app:layout_constraintStart_toEndOf="@+id/btnBorrarInv"
  184 + app:layout_constraintTop_toBottomOf="@+id/guideline5" />
  185 +
  186 + <Button
  187 + android:id="@+id/btnBorrarInv"
  188 + android:layout_width="wrap_content"
  189 + android:layout_height="wrap_content"
  190 + android:layout_marginTop="7dp"
  191 + android:background="@drawable/boton_borde_redondeado"
  192 + android:padding="10dp"
  193 + android:text="@string/btnBorrarInv"
  194 + android:textColor="@android:color/white"
  195 + android:textSize="@dimen/SubTitulos10"
  196 + app:layout_constraintBottom_toBottomOf="@+id/guideline6"
  197 + app:layout_constraintEnd_toStartOf="@id/btnExportarInv"
  198 + app:layout_constraintHorizontal_chainStyle="spread"
  199 + app:layout_constraintStart_toStartOf="parent"
  200 + app:layout_constraintTop_toBottomOf="@+id/guideline5" />
  201 +
  202 + <androidx.constraintlayout.widget.Guideline
  203 + android:id="@+id/guideline"
  204 + android:layout_width="wrap_content"
  205 + android:layout_height="wrap_content"
  206 + android:orientation="horizontal"
  207 + app:layout_constraintGuide_percent="0.02" />
  208 +
  209 + <androidx.constraintlayout.widget.Guideline
  210 + android:id="@+id/guideline2"
  211 + android:layout_width="wrap_content"
  212 + android:layout_height="wrap_content"
  213 + android:orientation="horizontal"
  214 + app:layout_constraintGuide_percent="0.12029161" />
  215 +
  216 + <androidx.constraintlayout.widget.Guideline
  217 + android:id="@+id/guideline3"
  218 + android:layout_width="wrap_content"
  219 + android:layout_height="wrap_content"
  220 + android:orientation="horizontal"
  221 + app:layout_constraintGuide_percent="0.27" />
  222 +
  223 + <androidx.constraintlayout.widget.Guideline
  224 + android:id="@+id/guideline4"
  225 + android:layout_width="wrap_content"
  226 + android:layout_height="wrap_content"
  227 + android:orientation="horizontal"
  228 + app:layout_constraintGuide_percent="0.32" />
  229 +
  230 + <androidx.constraintlayout.widget.Guideline
  231 + android:id="@+id/guideline5"
  232 + android:layout_width="wrap_content"
  233 + android:layout_height="wrap_content"
  234 + android:orientation="horizontal"
  235 + app:layout_constraintGuide_percent="0.88" />
  236 +
  237 + <androidx.constraintlayout.widget.Guideline
  238 + android:id="@+id/guideline6"
  239 + android:layout_width="wrap_content"
  240 + android:layout_height="wrap_content"
  241 + android:orientation="horizontal"
  242 + app:layout_constraintGuide_percent="0.97" />
  243 +
  244 +</androidx.constraintlayout.widget.ConstraintLayout>
0 245 \ No newline at end of file
app/src/main/res/layout-xlarge/fragment_inventario.xml
... ... @@ -10,14 +10,11 @@
10 10  
11 11 <androidx.appcompat.widget.AppCompatTextView
12 12 android:id="@+id/tvTitulo"
13   - android:layout_width="match_parent"
14   - android:layout_height="90dp"
  13 + android:layout_width="0dp"
  14 + android:layout_height="wrap_content"
15 15 android:layout_marginStart="8dp"
16 16 android:layout_marginEnd="8dp"
17   - android:autoSizeMaxTextSize="100sp"
18   - android:autoSizeMinTextSize="20sp"
19   - android:autoSizeStepGranularity="5sp"
20   - android:autoSizeTextType="uniform"
  17 +android:textSize="60sp"
21 18 android:gravity="center"
22 19 android:lines="1"
23 20 android:text="@string/invTitulo"
... ... @@ -125,6 +122,23 @@
125 122 app:layout_constraintStart_toStartOf="parent"
126 123 app:layout_constraintTop_toBottomOf="@+id/guideline5" />
127 124  
  125 +
  126 + <ProgressBar
  127 + android:id="@+id/loading_view"
  128 + android:layout_width="wrap_content"
  129 + android:layout_height="wrap_content"
  130 + android:layout_marginStart="8dp"
  131 + android:layout_marginLeft="8dp"
  132 + android:layout_marginTop="8dp"
  133 + android:layout_marginEnd="8dp"
  134 + android:layout_marginRight="8dp"
  135 + android:layout_marginBottom="8dp"
  136 + android:visibility="invisible"
  137 + app:layout_constraintBottom_toBottomOf="parent"
  138 + app:layout_constraintEnd_toEndOf="parent"
  139 + app:layout_constraintStart_toStartOf="parent"
  140 + app:layout_constraintTop_toTopOf="parent" />
  141 +
128 142 <androidx.constraintlayout.widget.Guideline
129 143 android:id="@+id/guideline"
130 144 android:layout_width="wrap_content"
app/src/main/res/layout-xlarge/fragment_main.xml
... ... @@ -8,11 +8,8 @@
8 8 <androidx.appcompat.widget.AppCompatTextView
9 9 android:id="@+id/tvInvDinamicos"
10 10 android:layout_width="match_parent"
11   - android:layout_height="110dp"
12   - android:autoSizeMaxTextSize="150sp"
13   - android:autoSizeMinTextSize="25sp"
14   - android:autoSizeStepGranularity="5sp"
15   - android:autoSizeTextType="uniform"
  11 + android:layout_height="wrap_content"
  12 + android:textSize="60sp"
16 13 android:gravity="start"
17 14 android:lines="1"
18 15 android:padding="10dp"
... ... @@ -54,9 +51,9 @@
54 51 android:layout_width="wrap_content"
55 52 android:layout_height="wrap_content"
56 53 android:layout_margin="5dp"
57   - android:text="Tipo:"
58 54 android:layout_marginTop="12dp"
59   - android:textSize="@dimen/nav_header_vertical_spacing10"
  55 + android:text="Tipo:"
  56 + android:textSize="@dimen/md_message_textsize"
60 57 android:visibility="gone"
61 58 app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas"
62 59 app:layout_constraintEnd_toStartOf="@+id/cbVentas" />
... ... @@ -65,11 +62,11 @@
65 62 android:id="@+id/cbVentas"
66 63 android:layout_width="wrap_content"
67 64 android:layout_height="wrap_content"
68   - android:textSize="@dimen/SubTitulos10"
69 65 android:layout_margin="5dp"
  66 + android:layout_marginTop="12dp"
70 67 android:checked="true"
71 68 android:text="Ventas"
72   - android:layout_marginTop="12dp"
  69 + android:textSize="@dimen/SubTitulos10"
73 70 android:visibility="gone"
74 71 app:layout_constraintEnd_toStartOf="@+id/cbDeposito"
75 72 app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" />
... ... @@ -78,11 +75,11 @@
78 75 android:id="@+id/cbDeposito"
79 76 android:layout_width="wrap_content"
80 77 android:layout_height="wrap_content"
81   - android:textSize="@dimen/SubTitulos10"
82 78 android:layout_margin="5dp"
  79 + android:layout_marginTop="12dp"
83 80 android:checked="true"
84 81 android:text="Deposito"
85   - android:layout_marginTop="12dp"
  82 + android:textSize="@dimen/SubTitulos10"
86 83 android:visibility="gone"
87 84 app:layout_constraintEnd_toEndOf="parent"
88 85 app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" />
... ... @@ -94,21 +91,18 @@
94 91 android:background="@android:color/darker_gray"
95 92 android:scrollbars="vertical"
96 93 android:visibility="gone"
  94 + app:layout_constraintBottom_toTopOf="@+id/guideline6"
97 95 app:layout_constraintEnd_toEndOf="parent"
98 96 app:layout_constraintStart_toStartOf="parent"
99 97 app:layout_constraintTop_toBottomOf="@id/ivSort19"
100   - tools:listitem="@layout/item_principal"
101   - app:layout_constraintBottom_toTopOf="@+id/guideline6"/>
  98 + tools:listitem="@layout/item_principal" />
102 99  
103 100  
104 101 <androidx.appcompat.widget.AppCompatTextView
105   - android:id="@+id/txtDeposito"
  102 + android:id="@+id/tvInvImportados"
106 103 android:layout_width="match_parent"
107 104 android:layout_height="110dp"
108   - android:autoSizeMaxTextSize="150sp"
109   - android:autoSizeMinTextSize="25sp"
110   - android:autoSizeStepGranularity="5sp"
111   - android:autoSizeTextType="uniform"
  105 + android:textSize="60sp"
112 106 android:gravity="start"
113 107 android:lines="1"
114 108 android:padding="10dp"
... ... @@ -122,10 +116,60 @@
122 116 app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos"
123 117 app:layout_constraintVertical_bias="0.0" />
124 118  
  119 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  120 +<!-- android:id="@+id/ivSort19II"-->
  121 +<!-- android:layout_width="@dimen/icon_dim10"-->
  122 +<!-- android:layout_height="@dimen/icon_dim10"-->
  123 +<!-- android:layout_marginStart="10dp"-->
  124 +<!-- android:padding="5dp"-->
  125 +<!-- android:src="@drawable/ic_sort19"-->
  126 +<!-- android:visibility="invisible"-->
  127 +<!-- app:layout_constraintHorizontal_bias="0.0"-->
  128 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  129 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  130 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  131 +
  132 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  133 +<!-- android:id="@+id/ivSort91II"-->
  134 +<!-- android:layout_width="@dimen/icon_dim10"-->
  135 +<!-- android:layout_height="@dimen/icon_dim10"-->
  136 +<!-- android:layout_marginStart="10dp"-->
  137 +<!-- android:padding="5dp"-->
  138 +<!-- android:src="@drawable/ic_sort91"-->
  139 +<!-- android:visibility="invisible"-->
  140 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  141 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  142 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  143 +
  144 + <androidx.recyclerview.widget.RecyclerView
  145 + android:id="@+id/rcInventarioII"
  146 + android:layout_width="match_parent"
  147 + android:layout_height="0dp"
  148 + android:background="@android:color/darker_gray"
  149 + android:scrollbars="vertical"
  150 + android:visibility="gone"
  151 + app:layout_constraintBottom_toTopOf="@+id/guideline6"
  152 + app:layout_constraintEnd_toEndOf="parent"
  153 + app:layout_constraintStart_toStartOf="parent"
  154 + app:layout_constraintTop_toBottomOf="@id/tvInvImportados"
  155 + tools:listitem="@layout/item_principal" />
  156 +
125 157 <androidx.constraintlayout.widget.Guideline
126   - android:id="@+id/guideline6"
127   - android:layout_width="wrap_content"
128   - android:layout_height="wrap_content"
129   - android:orientation="horizontal"
130   - app:layout_constraintGuide_percent="0.97" />
  158 + android:id="@+id/guideline6"
  159 + android:layout_width="wrap_content"
  160 + android:layout_height="wrap_content"
  161 + android:orientation="horizontal"
  162 + app:layout_constraintGuide_percent="0.97" />
  163 +
  164 + <ImageView
  165 + android:id="@+id/ivPortada"
  166 + android:layout_width="730dp"
  167 + android:layout_height="491dp"
  168 + android:elevation="10dp"
  169 + android:visibility="visible"
  170 + app:layout_constraintBottom_toBottomOf="parent"
  171 + app:layout_constraintEnd_toEndOf="parent"
  172 + app:layout_constraintStart_toStartOf="parent"
  173 + app:layout_constraintTop_toBottomOf="@+id/tvInvImportados"
  174 + tools:srcCompat="@drawable/imagen_portada" />
131 175 </androidx.constraintlayout.widget.ConstraintLayout>
132 176 \ No newline at end of file
app/src/main/res/layout-xlarge/fragment_servidores.xml
... ... @@ -8,15 +8,12 @@
8 8  
9 9 <androidx.appcompat.widget.AppCompatTextView
10 10 android:id="@+id/tvTitutloServer"
11   - android:layout_width="match_parent"
12   - android:layout_height="120dp"
  11 + android:layout_width="0dp"
  12 + android:layout_height="wrap_content"
13 13 android:layout_marginStart="8dp"
14 14 android:layout_marginTop="15dp"
15 15 android:layout_marginEnd="8dp"
16   - android:autoSizeMaxTextSize="100sp"
17   - android:autoSizeMinTextSize="20sp"
18   - android:autoSizeStepGranularity="5sp"
19   - android:autoSizeTextType="uniform"
  16 +android:textSize="60sp"
20 17 android:gravity="center"
21 18 android:lines="1"
22 19 android:text="@string/tvTitutloServer"
... ... @@ -77,7 +74,7 @@
77 74  
78 75 <EditText
79 76 android:id="@+id/etDireccionServidor"
80   - android:layout_width="wrap_content"
  77 + android:layout_width="0dp"
81 78 android:layout_height="wrap_content"
82 79 android:clickable="true"
83 80 android:ems="10"
... ... @@ -85,25 +82,55 @@
85 82 android:hint="192.168.100.100"
86 83 android:inputType="phone"
87 84 android:lines="1"
  85 + android:nextFocusLeft="@id/etPuertoSubida"
  86 + android:nextFocusRight="@id/etPuertoSubida"
  87 + android:nextFocusDown="@id/etPuertoSubida"
88 88 android:textSize="@dimen/SubTitulos10"
89 89 app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer"
  90 + app:layout_constraintEnd_toEndOf="parent"
90 91 app:layout_constraintStart_toEndOf="@+id/tvDirServer" />
91 92  
92 93  
  94 +<EditText
  95 + android:id="@+id/etPuertoSubida"
  96 + android:layout_width="0dp"
  97 + android:layout_height="wrap_content"
  98 + android:layout_margin="10dp"
  99 + android:autofillHints=""
  100 + android:clickable="true"
  101 + android:ems="10"
  102 + android:focusable="true"
  103 + android:hint="Puerto de Subida"
  104 + android:inputType="number"
  105 + android:nextFocusDown="@id/etPuertoBajada"
  106 + android:nextFocusRight="@id/etPuertoBajada"
  107 + android:nextFocusLeft="@id/etPuertoBajada"
  108 + android:lines="1"
  109 + android:textSize="@dimen/SubTitulos10"
  110 + app:layout_constraintStart_toStartOf="parent"
  111 + app:layout_constraintTop_toBottomOf="@+id/tvDirServer" />
  112 +
93 113 <EditText
94   - android:id="@+id/etPuerto"
95   - android:layout_width="wrap_content"
  114 + android:id="@+id/etPuertoBajada"
  115 + android:layout_width="0dp"
96 116 android:layout_height="wrap_content"
  117 + android:layout_margin="10dp"
  118 + android:autofillHints=""
97 119 android:clickable="true"
98 120 android:ems="10"
99 121 android:focusable="true"
100   - android:hint="Puerto"
  122 + android:hint="Puerto de Bajada"
101 123 android:inputType="number"
102 124 android:lines="1"
  125 + android:nextFocusLeft="@id/btnGuardarServidores"
  126 + android:nextFocusRight="@id/btnGuardarServidores"
  127 + android:nextFocusDown="@id/btnGuardarServidores"
103 128 android:textSize="@dimen/SubTitulos10"
104   - app:layout_constraintBaseline_toBaselineOf="@+id/etDireccionServidor"
105   - app:layout_constraintStart_toEndOf="@+id/etDireccionServidor"
106   - android:autofillHints="" />
  129 + app:layout_constraintBaseline_toBaselineOf="@+id/etPuertoSubida"
  130 +
  131 + app:layout_constraintEnd_toEndOf="parent"
  132 + app:layout_constraintStart_toEndOf="@+id/etPuertoSubida" />
  133 +
107 134  
108 135  
109 136 <androidx.recyclerview.widget.RecyclerView
... ... @@ -115,7 +142,7 @@
115 142 app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores"
116 143 app:layout_constraintEnd_toEndOf="parent"
117 144 app:layout_constraintStart_toStartOf="parent"
118   - app:layout_constraintTop_toBottomOf="@+id/etPuerto"
  145 + app:layout_constraintTop_toBottomOf="@+id/etPuertoSubida"
119 146 app:layout_goneMarginEnd="10dp"
120 147 tools:listitem="@layout/item_servidores" />
121 148  
app/src/main/res/layout-xlarge/item_descripcion.xml
... ... @@ -34,7 +34,7 @@
34 34 android:layout_marginStart="5dp"
35 35 android:text="Código DEBO:"
36 36 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
37   - android:textSize="@dimen/nav_header_vertical_spacing10"
  37 + android:textSize="@dimen/md_message_textsize"
38 38 app:layout_constraintHorizontal_chainStyle="packed"
39 39 app:layout_constraintStart_toStartOf="parent"
40 40 app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" />
app/src/main/res/layout-xlarge/item_inv_importados.xml
... ... @@ -0,0 +1,36 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="wrap_content"
  7 + android:layout_margin="10dp"
  8 + app:cardCornerRadius="15dp"
  9 + app:cardElevation="10dp"
  10 + app:cardPreventCornerOverlap="false">
  11 +
  12 + <androidx.constraintlayout.widget.ConstraintLayout
  13 + android:layout_width="match_parent"
  14 + android:layout_height="wrap_content"
  15 + android:layout_gravity="center"
  16 + android:orientation="horizontal">
  17 +
  18 + <com.google.android.material.checkbox.MaterialCheckBox
  19 + android:id="@+id/tvPrincipalinventario"
  20 + android:layout_width="match_parent"
  21 + android:layout_height="wrap_content"
  22 + android:layout_margin="15dp"
  23 + android:background="@drawable/boton_redondo2"
  24 + android:gravity="center_vertical"
  25 + android:padding="5dp"
  26 + android:textColor="@android:color/black"
  27 + android:textSize="@dimen/VentasDeposito10"
  28 + android:textStyle="bold"
  29 + app:layout_constraintBottom_toBottomOf="parent"
  30 + app:layout_constraintStart_toStartOf="parent"
  31 + app:layout_constraintTop_toTopOf="parent"
  32 + tools:text="Inventario Sectorizado # 1487" />
  33 +
  34 +
  35 + </androidx.constraintlayout.widget.ConstraintLayout>
  36 +</androidx.cardview.widget.CardView>
app/src/main/res/layout-xlarge/item_principal.xml
... ... @@ -62,8 +62,8 @@
62 62 android:layout_width="wrap_content"
63 63 android:layout_height="wrap_content"
64 64 android:layout_marginTop="4dp"
65   - android:text="Art. Contados"
66   - android:textSize="@dimen/nav_header_vertical_spacing10"
  65 + android:text="Cantidad Art."
  66 + android:textSize="@dimen/textView510"
67 67 android:textStyle="bold"
68 68 app:layout_constraintEnd_toEndOf="parent"
69 69 app:layout_constraintHorizontal_bias="0.23"
app/src/main/res/layout-xlarge/item_sec.xml
... ... @@ -0,0 +1,171 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="wrap_content"
  7 + android:layout_margin="5dp"
  8 + app:cardCornerRadius="15dp"
  9 + app:cardElevation="10dp"
  10 + app:contentPadding="5dp"
  11 + app:cardPreventCornerOverlap="false">
  12 +
  13 + <androidx.constraintlayout.widget.ConstraintLayout
  14 + android:layout_width="match_parent"
  15 + android:layout_height="wrap_content">
  16 +
  17 + <TextView
  18 + android:id="@+id/tvDescripcion"
  19 + android:layout_width="0dp"
  20 + android:layout_height="wrap_content"
  21 + android:layout_marginStart="3dp"
  22 + android:maxLines="2"
  23 + android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz"
  24 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  25 + android:textSize="@dimen/SubTitulos10"
  26 + android:textStyle="bold"
  27 + app:layout_constraintStart_toStartOf="parent"
  28 + app:layout_constraintTop_toTopOf="parent" />
  29 +
  30 +<!-- <TextView-->
  31 +<!-- android:id="@+id/textView2"-->
  32 +<!-- android:layout_width="wrap_content"-->
  33 +<!-- android:layout_height="wrap_content"-->
  34 +<!-- android:layout_marginStart="5dp"-->
  35 +<!-- android:text="Código:"-->
  36 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"-->
  37 +<!-- android:textSize="14sp"-->
  38 +<!-- app:layout_constraintEnd_toStartOf="@+id/tvSector"-->
  39 +<!-- app:layout_constraintHorizontal_bias="0.01"-->
  40 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  41 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  42 +<!-- app:layout_constraintTop_toTopOf="parent" />-->
  43 +
  44 +
  45 +<!-- <TextView-->
  46 +<!-- android:id="@+id/tvSector"-->
  47 +<!-- android:layout_width="wrap_content"-->
  48 +<!-- android:layout_height="match_parent"-->
  49 +<!-- android:layout_marginStart="8dp"-->
  50 +<!-- android:text="9999"-->
  51 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
  52 +<!-- android:textColorHint="@android:color/black"-->
  53 +<!-- android:textSize="18sp"-->
  54 +<!-- android:textStyle="bold"-->
  55 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  56 +<!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView2"-->
  57 +<!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigo"-->
  58 +<!-- app:layout_constraintStart_toEndOf="@+id/textView2" />-->
  59 +
  60 +
  61 +<!-- <TextView-->
  62 +<!-- android:id="@+id/tvCodigo"-->
  63 +<!-- android:layout_width="wrap_content"-->
  64 +<!-- android:layout_height="match_parent"-->
  65 +<!-- android:text="99999999"-->
  66 +<!-- android:layout_marginStart="8dp"-->
  67 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  68 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
  69 +<!-- android:textColorHint="@android:color/black"-->
  70 +<!-- android:textSize="18sp"-->
  71 +<!-- android:textStyle="bold"-->
  72 +<!-- app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"-->
  73 +<!-- app:layout_constraintEnd_toStartOf="@+id/textView5"-->
  74 +<!-- app:layout_constraintStart_toEndOf="@+id/tvSector" />-->
  75 +
  76 + <TextView
  77 + android:id="@+id/textView5"
  78 + android:layout_width="wrap_content"
  79 + android:layout_height="wrap_content"
  80 + android:text="Cantidad:"
  81 + android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
  82 + android:textSize="@dimen/md_message_textsize"
  83 + android:layout_marginStart="5dp"
  84 + android:layout_marginTop="5dp"
  85 + app:layout_constraintStart_toStartOf="parent"
  86 + app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" />
  87 +
  88 + <TextView
  89 + android:id="@+id/tvCantidad"
  90 + android:layout_width="wrap_content"
  91 + android:layout_height="match_parent"
  92 + android:layout_marginTop="5dp"
  93 + android:text="12345.12"
  94 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  95 + android:textSize="@dimen/SubTitulos10"
  96 + android:textStyle="bold"
  97 + app:layout_constraintBaseline_toBaselineOf="@+id/textView5"
  98 +
  99 + app:layout_constraintStart_toEndOf="@id/textView5" />
  100 +
  101 + <ImageView
  102 + android:id="@+id/ivPen"
  103 + android:layout_width="@dimen/iconosMedia10"
  104 + android:layout_height="@dimen/iconosMedia10"
  105 + android:layout_marginStart="3dp"
  106 + android:src="@drawable/pen"
  107 + android:visibility="visible"
  108 + app:layout_constraintStart_toEndOf="@+id/tvCantidad"
  109 + app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" />
  110 +
  111 + <ImageView
  112 + android:id="@+id/ivDots"
  113 + android:layout_width="30dp"
  114 + android:layout_height="30dp"
  115 + android:layout_marginEnd="3dp"
  116 + android:src="@drawable/more"
  117 + android:visibility="visible"
  118 + app:layout_constraintEnd_toEndOf="parent"
  119 + app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" />
  120 +
  121 +<!-- <TextView-->
  122 +<!-- android:id="@+id/textView85"-->
  123 +<!-- android:layout_width="wrap_content"-->
  124 +<!-- android:layout_height="wrap_content"-->
  125 +<!-- android:layout_marginStart="5dp"-->
  126 +<!-- android:layout_marginTop="8dp"-->
  127 +<!-- android:text="Desc:"-->
  128 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"-->
  129 +<!-- android:textSize="14sp"-->
  130 +<!-- app:layout_constraintEnd_toStartOf="@+id/tvDescripcion"-->
  131 +<!-- app:layout_constraintHorizontal_bias="0.0"-->
  132 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  133 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  134 +<!-- app:layout_constraintTop_toBottomOf="@id/tvCodigo" />-->
  135 +
  136 +
  137 +<!-- <TextView-->
  138 +<!-- android:id="@+id/tvCodigoBarras"-->
  139 +<!-- android:layout_width="match_parent"-->
  140 +<!-- android:layout_height="wrap_content"-->
  141 +<!-- android:layout_marginStart="3dp"-->
  142 +<!-- android:layout_marginTop="8dp"-->
  143 +<!-- android:maxLines="2"-->
  144 +<!-- android:text=""-->
  145 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
  146 +<!-- android:textSize="14sp"-->
  147 +<!-- android:visibility="gone"-->
  148 +<!-- android:textStyle="bold"-->
  149 +<!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"-->
  150 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  151 +<!-- app:layout_constraintStart_toEndOf="@+id/textView85"-->
  152 +<!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />-->
  153 +<!-- <TextView-->
  154 +<!-- android:id="@+id/tvCodigoOrigen"-->
  155 +<!-- android:layout_width="match_parent"-->
  156 +<!-- android:layout_height="wrap_content"-->
  157 +<!-- android:layout_marginStart="3dp"-->
  158 +<!-- android:layout_marginTop="8dp"-->
  159 +<!-- android:maxLines="2"-->
  160 +<!-- android:text=""-->
  161 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
  162 +<!-- android:textSize="14sp"-->
  163 +<!-- android:visibility="gone"-->
  164 +<!-- android:textStyle="bold"-->
  165 +<!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"-->
  166 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  167 +<!-- app:layout_constraintStart_toEndOf="@+id/textView85"-->
  168 +<!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />-->
  169 + </androidx.constraintlayout.widget.ConstraintLayout>
  170 +
  171 +</androidx.cardview.widget.CardView>
0 172 \ No newline at end of file
app/src/main/res/layout-xlarge/item_servidores.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
3 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4   - xmlns:tools="http://schemas.android.com/tools"
5 4 android:layout_width="match_parent"
6 5 android:layout_height="wrap_content"
7 6 android:layout_margin="5dp"
8 7 app:cardCornerRadius="15dp"
9 8 app:cardElevation="10dp"
10   - app:contentPadding="5dp"
11   - app:cardPreventCornerOverlap="false">
  9 + app:cardPreventCornerOverlap="false"
  10 + app:contentPadding="5dp">
12 11  
13 12 <androidx.constraintlayout.widget.ConstraintLayout
14 13 android:layout_width="match_parent"
... ... @@ -71,28 +70,51 @@
71 70 android:id="@+id/textView86"
72 71 android:layout_width="wrap_content"
73 72 android:layout_height="wrap_content"
74   - android:layout_marginTop="8dp"
75   - android:layout_marginStart="15dp"
76   - android:text="Puerto:"
  73 + android:layout_marginStart="5dp"
  74 + android:layout_marginTop="3dp"
  75 + android:text="Puerto Subida:"
77 76 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
78 77 android:textSize="20sp"
79 78 app:layout_constraintHorizontal_chainStyle="packed"
80   - app:layout_constraintStart_toEndOf="@+id/tvDireccionServidor"
81   - app:layout_constraintTop_toBottomOf="@id/tvDescServidor" />
  79 + app:layout_constraintStart_toStartOf="parent"
  80 + app:layout_constraintTop_toBottomOf="@+id/textView85" />
82 81  
83 82 <TextView
84   - android:id="@+id/tvPuertoServidor"
  83 + android:id="@+id/tvPuertoSubida"
  84 + android:layout_width="wrap_content"
  85 + android:layout_height="wrap_content"
  86 + android:text="9999"
  87 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  88 + android:textColorHint="@android:color/black"
  89 + android:textSize="25sp"
  90 + android:textStyle="bold"
  91 + app:layout_constraintBaseline_toBaselineOf="@+id/textView86"
  92 + app:layout_constraintStart_toEndOf="@+id/textView86" />
  93 +
  94 + <TextView
  95 + android:id="@+id/textView87"
85 96 android:layout_width="wrap_content"
86 97 android:layout_height="wrap_content"
87   - android:layout_marginTop="8dp"
88 98 android:layout_marginStart="5dp"
89   - android:text=""
  99 + android:layout_marginTop="3dp"
  100 + android:text="Puerto Bajada:"
  101 + android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
  102 + android:textSize="20sp"
  103 + app:layout_constraintHorizontal_chainStyle="packed"
  104 + app:layout_constraintStart_toEndOf="@+id/tvPuertoSubida"
  105 + app:layout_constraintTop_toBottomOf="@+id/textView85" />
  106 +
  107 + <TextView
  108 + android:id="@+id/tvPuertoBajada"
  109 + android:layout_width="wrap_content"
  110 + android:layout_height="wrap_content"
  111 + android:text="9999"
90 112 android:textAppearance="@style/TextAppearance.AppCompat.Large"
91 113 android:textColorHint="@android:color/black"
92 114 android:textSize="25sp"
93 115 android:textStyle="bold"
94   - app:layout_constraintStart_toEndOf="@+id/textView86"
95   - app:layout_constraintTop_toBottomOf="@+id/tvDescServidor" />
  116 + app:layout_constraintBaseline_toBaselineOf="@+id/textView87"
  117 + app:layout_constraintStart_toEndOf="@+id/textView87" />
96 118 </androidx.constraintlayout.widget.ConstraintLayout>
97 119  
98 120 </androidx.cardview.widget.CardView>
99 121 \ No newline at end of file
app/src/main/res/layout-xlarge/login_dialog.xml
... ... @@ -51,7 +51,7 @@
51 51 android:layout_height="wrap_content"
52 52 android:layout_margin="5dp"
53 53 android:text=""
54   - android:textSize="20sp"
  54 + android:textSize="25sp"
55 55 app:layout_constraintBaseline_toBaselineOf="@+id/dialogNameEt"
56 56 app:layout_constraintEnd_toEndOf="parent"
57 57 app:layout_constraintHorizontal_chainStyle="packed"
... ... @@ -74,7 +74,7 @@
74 74 android:layout_height="wrap_content"
75 75 android:autofillHints=""
76 76 android:hint=""
77   - android:textSize="20sp"
  77 + android:textSize="25sp"
78 78 android:focusable="true"
79 79 android:clickable="true"
80 80 android:inputType="numberDecimal"
... ... @@ -155,7 +155,7 @@
155 155 android:layout_margin="5dp"
156 156 android:gravity="center"
157 157 android:text=""
158   - android:textSize="20sp"
  158 + android:textSize="25sp"
159 159 app:layout_constraintEnd_toEndOf="parent"
160 160 app:layout_constraintHorizontal_bias="0.0"
161 161 app:layout_constraintStart_toEndOf="@+id/tvgenerico3"
app/src/main/res/layout/fragment_actua_maestros.xml
... ... @@ -6,14 +6,12 @@
6 6 android:layout_height="match_parent"
7 7 tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment">
8 8  
9   -
10 9 <androidx.appcompat.widget.AppCompatTextView
11 10 android:id="@+id/tvActMaestros"
12 11 android:layout_width="match_parent"
13 12 android:layout_height="wrap_content"
14 13 android:layout_marginTop="@dimen/MarginTopTitulos"
15 14 android:gravity="center"
16   -
17 15 android:text="@string/tvActMaestros"
18 16 android:textColor="@color/colorAccent"
19 17 android:textSize="@dimen/Titulos"
... ... @@ -69,7 +67,6 @@
69 67 android:text="@string/obViaArchivo"
70 68 android:textSize="@dimen/NormalText" />
71 69  
72   -
73 70 </RadioGroup>
74 71  
75 72 <TextView
... ... @@ -118,7 +115,6 @@
118 115 app:layout_constraintEnd_toEndOf="parent"
119 116 app:layout_constraintStart_toStartOf="parent" />
120 117  
121   -
122 118 <ProgressBar
123 119 android:id="@+id/loading_view"
124 120 android:layout_width="wrap_content"
... ... @@ -129,7 +125,7 @@
129 125 android:layout_marginEnd="8dp"
130 126 android:layout_marginRight="8dp"
131 127 android:layout_marginBottom="8dp"
132   - android:visibility="gone"
  128 + android:visibility="invisible"
133 129 app:layout_constraintBottom_toBottomOf="parent"
134 130 app:layout_constraintEnd_toEndOf="parent"
135 131 app:layout_constraintStart_toStartOf="parent"
app/src/main/res/layout/fragment_configuracion.xml
... ... @@ -11,10 +11,8 @@
11 11 android:id="@+id/textView2"
12 12 android:layout_width="match_parent"
13 13 android:layout_height="wrap_content"
14   -
15 14 android:layout_marginTop="@dimen/MarginTopTitulos"
16 15 android:gravity="center"
17   -
18 16 android:lines="1"
19 17 android:text="@string/tvTituloConf"
20 18 android:textColor="@color/colorAccent"
... ... @@ -49,23 +47,21 @@
49 47 android:layout_width="0dp"
50 48 android:layout_height="wrap_content"
51 49 android:elevation="5dp"
52   -
53 50 android:textSize="@dimen/NormalText"
54 51 app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
55 52 app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor"
56 53 app:layout_constraintHorizontal_chainStyle="packed"
57 54 app:layout_constraintStart_toStartOf="parent"
58   - app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"
59   - />
  55 + app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" />
60 56  
61 57 <Button
62 58 android:id="@+id/btnValidarServidor"
63 59 android:layout_width="wrap_content"
64 60 android:layout_height="wrap_content"
65   - android:textColor="@android:color/white"
66   - android:padding="10dp"
67 61 android:background="@drawable/boton_borde_redondeado"
  62 + android:padding="10dp"
68 63 android:text="@string/btnValidarServidor"
  64 + android:textColor="@android:color/white"
69 65 android:textSize="@dimen/NormalText"
70 66 app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
71 67 app:layout_constraintEnd_toEndOf="parent"
... ... @@ -79,11 +75,11 @@
79 75 android:layout_height="wrap_content"
80 76 android:layout_marginStart="@dimen/MarginBotAgreSer"
81 77 android:layout_marginEnd="@dimen/MarginBotAgreSer"
  78 + android:background="@drawable/boton_borde_redondeado"
  79 + android:padding="10dp"
82 80 android:text="@string/btnAgregarServidor"
83   - android:textSize="@dimen/NormalText"
84 81 android:textColor="@android:color/white"
85   - android:padding="10dp"
86   - android:background="@drawable/boton_borde_redondeado"
  82 + android:textSize="@dimen/NormalText"
87 83 app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas"
88 84 app:layout_constraintEnd_toEndOf="parent"
89 85 app:layout_constraintStart_toStartOf="parent"
... ... @@ -94,7 +90,6 @@
94 90 android:id="@+id/tvUbicacionCarpetas"
95 91 android:layout_width="0dp"
96 92 android:layout_height="wrap_content"
97   -android:visibility="gone"
98 93 android:layout_marginStart="@dimen/MarginBotAgreSer"
99 94 android:layout_marginTop="@dimen/MarginTopSubTitulos"
100 95 android:gravity="start"
... ... @@ -102,6 +97,7 @@ android:visibility=&quot;gone&quot;
102 97 android:text="@string/tvUbicacionCarpetas"
103 98 android:textColor="@android:color/black"
104 99 android:textSize="@dimen/SubTitulos"
  100 + android:visibility="gone"
105 101 app:fontFamily="sans-serif-condensed"
106 102 app:layout_constraintBottom_toTopOf="@+id/ibSearch"
107 103 app:layout_constraintEnd_toEndOf="parent"
... ... @@ -113,11 +109,11 @@ android:visibility=&quot;gone&quot;
113 109 android:layout_width="36dp"
114 110 android:layout_height="37dp"
115 111 android:layout_margin="10dp"
  112 + android:background="@drawable/boton_borde_redondeado"
  113 + android:padding="10dp"
116 114 android:src="@drawable/search"
117 115 android:textColor="@android:color/white"
118   - android:padding="10dp"
119 116 android:visibility="gone"
120   - android:background="@drawable/boton_borde_redondeado"
121 117 app:layout_constraintEnd_toStartOf="@+id/etRuta"
122 118 app:layout_constraintStart_toStartOf="parent"
123 119 app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
... ... @@ -131,11 +127,11 @@ android:visibility=&quot;gone&quot;
131 127 android:clickable="true"
132 128 android:ems="10"
133 129 android:focusable="true"
134   - android:visibility="gone"
135 130 android:inputType="textPersonName"
136 131 android:lines="1"
137 132 android:text=""
138 133 android:textSize="@dimen/NormalText"
  134 + android:visibility="gone"
139 135 app:layout_constraintEnd_toEndOf="parent"
140 136 app:layout_constraintStart_toEndOf="@id/ibSearch"
141 137 app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
... ... @@ -221,7 +217,6 @@ android:visibility=&quot;gone&quot;
221 217 android:id="@+id/rbProInclu"
222 218 android:layout_width="match_parent"
223 219 android:layout_height="wrap_content"
224   -
225 220 android:layout_margin="@dimen/PadingCbyRb"
226 221 android:checked="true"
227 222 android:padding="@dimen/PadingCbyRb"
... ... @@ -268,7 +263,6 @@ android:visibility=&quot;gone&quot;
268 263 android:id="@+id/tvColumMostrar"
269 264 android:layout_width="0dp"
270 265 android:layout_height="wrap_content"
271   -
272 266 android:layout_marginStart="@dimen/MarginBotAgreSer"
273 267 android:layout_marginEnd="@dimen/MarginTopSubTitulos"
274 268 android:gravity="start"
... ... @@ -276,90 +270,94 @@ android:visibility=&quot;gone&quot;
276 270 android:text="@string/tvColumMostrar"
277 271 android:textColor="@android:color/black"
278 272 android:textSize="@dimen/SubTitulos"
  273 + android:visibility="gone"
279 274 app:fontFamily="sans-serif-condensed"
280 275 app:layout_constraintEnd_toEndOf="parent"
281 276 app:layout_constraintStart_toStartOf="parent"
282 277 app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />
283 278  
284   - <RadioGroup
285   - android:id="@+id/rgCodigosMostrar"
286   - android:layout_width="0dp"
287   - android:layout_height="wrap_content"
  279 +<!-- <RadioGroup-->
  280 +<!-- android:id="@+id/rgCodigosMostrar"-->
  281 +<!-- android:layout_width="0dp"-->
  282 +<!-- android:layout_height="wrap_content"-->
  283 +<!-- android:gravity="center"-->
  284 +<!-- android:orientation="horizontal"-->
  285 +<!-- android:visibility="gone"-->
  286 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  287 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  288 +<!-- app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">-->
  289 +
  290 +<!-- <RadioButton-->
  291 +<!-- android:id="@+id/rbCodigoDebo"-->
  292 +<!-- android:layout_width="wrap_content"-->
  293 +<!-- android:layout_height="wrap_content"-->
  294 +<!-- android:layout_margin="5dp"-->
  295 +<!-- android:checked="true"-->
  296 +<!-- android:padding="5dp"-->
  297 +<!-- android:text="@string/rbCodigoDebo"-->
  298 +<!-- android:textSize="@dimen/NormalText" />-->
  299 +
  300 +<!-- <RadioButton-->
  301 +<!-- android:id="@+id/rbCodigoOrigen"-->
  302 +<!-- android:layout_width="wrap_content"-->
  303 +<!-- android:layout_height="wrap_content"-->
  304 +<!-- android:layout_margin="5dp"-->
  305 +<!-- android:checked="false"-->
  306 +<!-- android:padding="5dp"-->
  307 +<!-- android:text="@string/rbCodigoOrigen"-->
  308 +<!-- android:textSize="@dimen/NormalText" />-->
  309 +
  310 +<!-- <RadioButton-->
  311 +<!-- android:id="@+id/rbCodigoBarras"-->
  312 +<!-- android:layout_width="wrap_content"-->
  313 +<!-- android:layout_height="wrap_content"-->
  314 +<!-- android:layout_margin="5dp"-->
  315 +<!-- android:padding="5dp"-->
  316 +<!-- android:text="@string/rbCodigoBarras"-->
  317 +<!-- android:textSize="@dimen/NormalText" />-->
  318 +<!-- </RadioGroup>-->
288 319  
289   - android:gravity="center"
290   - android:orientation="horizontal"
291   - app:layout_constraintEnd_toEndOf="parent"
292   - app:layout_constraintStart_toStartOf="parent"
293   - app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">
294   -
295   - <RadioButton
296   - android:id="@+id/rbCodigoDebo"
297   - android:layout_width="wrap_content"
298   - android:layout_height="wrap_content"
299   - android:layout_margin="5dp"
300   - android:checked="true"
301   - android:padding="5dp"
302   - android:text="@string/rbCodigoDebo"
303   - android:textSize="@dimen/NormalText" />
304   -
305   - <RadioButton
306   - android:id="@+id/rbCodigoOrigen"
307   - android:layout_width="wrap_content"
308   - android:layout_height="wrap_content"
309   - android:layout_margin="5dp"
310   - android:checked="false"
311   - android:padding="5dp"
312   - android:text="@string/rbCodigoOrigen"
313   - android:textSize="@dimen/NormalText" />
314   -
315   - <RadioButton
316   - android:id="@+id/rbCodigoBarras"
317   - android:layout_width="wrap_content"
318   - android:layout_height="wrap_content"
319   - android:layout_margin="5dp"
320   - android:padding="5dp"
321   - android:text="@string/rbCodigoBarras"
322   - android:textSize="@dimen/NormalText" />
323   - </RadioGroup>
324   -
325   - <CheckBox
326   - android:id="@+id/cbMostrarExistencia"
  320 + <Button
  321 + android:id="@+id/btnAskTimeServer"
327 322 android:layout_width="wrap_content"
328 323 android:layout_height="wrap_content"
329 324 android:layout_margin="@dimen/PadingCbyRb"
330   - android:padding="@dimen/PadingCbyRb"
331   - android:text="@string/cbMostrarExistencia"
332   - android:textSize="@dimen/NormalText"
  325 + android:background="@drawable/boton_borde_redondeado"
333 326 android:checked="false"
334   - app:layout_constraintEnd_toStartOf="@+id/cbMostrarPrecio"
  327 + android:padding="10dp"
  328 + android:text="@string/btnAskTimeServer"
  329 + android:textColor="@android:color/white"
  330 + android:textSize="@dimen/NormalText"
  331 + android:visibility="gone"
335 332 app:layout_constraintStart_toStartOf="parent"
336 333 app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />
337 334  
338 335 <CheckBox
339   - android:id="@+id/cbMostrarPrecio"
  336 + android:id="@+id/cbAskTimeServerToStart"
340 337 android:layout_width="wrap_content"
341 338 android:layout_height="wrap_content"
342   - android:layout_margin="@dimen/PadingCbyRb"
  339 + android:layout_margin="5dp"
  340 + android:checked="false"
343 341 android:padding="@dimen/PadingCbyRb"
344   - android:text="@string/cbMostrarPrecio"
  342 + android:text="@string/cbAskTimeServerToStart"
345 343 android:textSize="@dimen/NormalText"
346   - android:checked="false"
347   - app:layout_constraintEnd_toEndOf="parent"
348   - app:layout_constraintStart_toEndOf="@+id/cbMostrarExistencia"
349   - app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />
  344 + android:visibility="visible"
  345 + app:layout_constraintStart_toEndOf="@+id/btnAskTimeServer"
  346 + app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />
350 347  
351 348 <Button
352 349 android:id="@+id/btnGuardar"
353 350 android:layout_width="wrap_content"
354 351 android:layout_height="wrap_content"
  352 + android:background="@drawable/boton_borde_redondeado"
  353 + android:padding="10dp"
355 354 android:text="@string/btnGuardar"
  355 + android:textColor="@android:color/white"
356 356 android:textSize="@dimen/NormalText"
  357 + app:layout_constraintBottom_toBottomOf="parent"
357 358 app:layout_constraintEnd_toEndOf="parent"
358   - android:textColor="@android:color/white"
359   - android:padding="10dp"
360   - android:background="@drawable/boton_borde_redondeado"
361 359 app:layout_constraintStart_toStartOf="parent"
362   - app:layout_constraintTop_toBottomOf="@+id/cbMostrarPrecio" />
  360 + app:layout_constraintTop_toBottomOf="@+id/cbAskTimeServerToStart" />
363 361  
364 362 </androidx.constraintlayout.widget.ConstraintLayout>
365 363  
app/src/main/res/layout/fragment_detalle_art_sec.xml
... ... @@ -0,0 +1,338 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + android:id="@+id/nsPedidosDatos"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent">
  7 +
  8 + <androidx.cardview.widget.CardView
  9 + android:id="@+id/cvItem1"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content"
  12 + android:layout_marginStart="5dp"
  13 + android:layout_marginTop="5dp"
  14 + android:layout_marginEnd="5dp"
  15 + app:cardBackgroundColor="@android:color/darker_gray"
  16 + app:cardCornerRadius="25dp"
  17 + app:cardElevation="10dp"
  18 + app:layout_constraintEnd_toEndOf="parent"
  19 + app:layout_constraintStart_toStartOf="parent"
  20 + app:layout_constraintTop_toTopOf="parent">
  21 +
  22 + <androidx.constraintlayout.widget.ConstraintLayout
  23 + android:id="@+id/clayout"
  24 + android:layout_width="match_parent"
  25 + android:layout_height="match_parent">
  26 +
  27 + <TextView
  28 + android:id="@+id/tvDescripcion"
  29 + android:layout_width="wrap_content"
  30 + android:layout_height="0dp"
  31 + android:layout_marginTop="10dp"
  32 + android:gravity="center_horizontal"
  33 +
  34 + android:text="coaca"
  35 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  36 + android:textSize="25sp"
  37 + android:textStyle="bold"
  38 + app:layout_constraintEnd_toEndOf="parent"
  39 + app:layout_constraintStart_toStartOf="parent"
  40 + app:layout_constraintTop_toTopOf="parent" />
  41 +
  42 +
  43 + <TextView
  44 + android:id="@+id/textView18"
  45 + android:layout_width="wrap_content"
  46 + android:layout_height="wrap_content"
  47 + android:layout_marginTop="10dp"
  48 + android:text="Códigos:"
  49 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  50 + android:textSize="15sp"
  51 + app:layout_constraintStart_toStartOf="parent"
  52 + app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" />
  53 +
  54 + <TextView
  55 + android:id="@+id/textView19"
  56 + android:layout_width="wrap_content"
  57 + android:layout_height="wrap_content"
  58 + android:layout_marginStart="5dp"
  59 + android:text="DEBO:"
  60 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  61 + android:textSize="15sp"
  62 + app:layout_constraintBaseline_toBaselineOf="@+id/textView18"
  63 + app:layout_constraintStart_toEndOf="@+id/textView18" />
  64 +
  65 + <TextView
  66 + android:id="@+id/tvSector"
  67 + android:layout_width="0dp"
  68 + android:layout_height="wrap_content"
  69 + android:layout_marginStart="5dp"
  70 + android:text="99"
  71 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  72 + android:textSize="18sp"
  73 + android:textStyle="bold"
  74 + app:layout_constraintBaseline_toBaselineOf="@+id/textView19"
  75 + app:layout_constraintStart_toEndOf="@+id/textView19" />
  76 +
  77 + <TextView
  78 + android:id="@+id/tvCodigo"
  79 + android:layout_width="0dp"
  80 + android:layout_height="wrap_content"
  81 + android:layout_marginStart="3dp"
  82 + android:layout_marginTop="10dp"
  83 + android:text="999999"
  84 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  85 + android:textSize="18sp"
  86 + android:textStyle="bold"
  87 + app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"
  88 + app:layout_constraintStart_toEndOf="@id/tvSector" />
  89 +
  90 +
  91 + <TextView
  92 + android:id="@+id/textView1"
  93 + android:layout_width="0dp"
  94 + android:layout_height="wrap_content"
  95 + android:layout_marginStart="5dp"
  96 + android:layout_marginTop="10dp"
  97 + android:text="barras:"
  98 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  99 + android:textSize="15sp"
  100 + app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo"
  101 + app:layout_constraintStart_toEndOf="@+id/tvCodigo" />
  102 +
  103 + <TextView
  104 + android:id="@+id/tvCodigoBarras"
  105 + android:layout_width="wrap_content"
  106 + android:layout_height="wrap_content"
  107 + android:layout_marginStart="5dp"
  108 + android:text="12346579012345"
  109 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  110 + android:textSize="18sp"
  111 + android:textStyle="bold"
  112 + app:layout_constraintBaseline_toBaselineOf="@+id/textView1"
  113 + app:layout_constraintStart_toEndOf="@id/textView1" />
  114 +
  115 + <TextView
  116 + android:id="@+id/textView2"
  117 + android:layout_width="wrap_content"
  118 + android:layout_height="wrap_content"
  119 + android:layout_marginStart="5dp"
  120 + android:layout_marginTop="10dp"
  121 + android:text="origen:"
  122 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  123 + android:textSize="15sp"
  124 + app:layout_constraintStart_toEndOf="@+id/textView18"
  125 + app:layout_constraintTop_toBottomOf="@+id/textView18" />
  126 +
  127 +
  128 + <TextView
  129 + android:id="@+id/tvCodigoOrigen"
  130 + android:layout_width="wrap_content"
  131 + android:layout_height="wrap_content"
  132 + android:layout_marginStart="5dp"
  133 + android:layout_marginTop="10dp"
  134 + android:text="1234567890123"
  135 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  136 + android:textSize="18sp"
  137 + android:textStyle="bold"
  138 + app:layout_constraintBaseline_toBaselineOf="@+id/textView2"
  139 + app:layout_constraintStart_toEndOf="@+id/textView2"
  140 + app:layout_constraintTop_toBottomOf="@+id/textView18" />
  141 +
  142 + <TextView
  143 + android:id="@+id/textView9"
  144 + android:layout_width="wrap_content"
  145 + android:layout_height="wrap_content"
  146 + android:layout_marginTop="10dp"
  147 + android:text="Precio:"
  148 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  149 + android:textSize="15sp"
  150 + app:layout_constraintStart_toStartOf="parent"
  151 + app:layout_constraintTop_toBottomOf="@+id/textView2" />
  152 +
  153 + <TextView
  154 + android:id="@+id/textView12"
  155 + android:layout_width="wrap_content"
  156 + android:layout_height="wrap_content"
  157 + android:layout_marginStart="5dp"
  158 + android:layout_marginTop="10dp"
  159 + android:text="venta:"
  160 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  161 + android:textSize="15sp"
  162 + app:layout_constraintBaseline_toBaselineOf="@+id/textView9"
  163 + app:layout_constraintStart_toEndOf="@+id/textView18" />
  164 +
  165 + <TextView
  166 + android:id="@+id/tvPrecio"
  167 + android:layout_width="wrap_content"
  168 + android:layout_height="wrap_content"
  169 + android:layout_marginStart="5dp"
  170 + android:layout_marginTop="10dp"
  171 + android:text="99999.99"
  172 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  173 + android:textSize="18sp"
  174 + android:textStyle="bold"
  175 + app:layout_constraintBaseline_toBaselineOf="@+id/textView12"
  176 + app:layout_constraintStart_toEndOf="@+id/textView12" />
  177 +
  178 + <TextView
  179 + android:id="@+id/textView8"
  180 + android:layout_width="wrap_content"
  181 + android:layout_height="wrap_content"
  182 + android:layout_marginStart="5dp"
  183 + android:layout_marginTop="10dp"
  184 + android:text="Costo:"
  185 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  186 + android:textSize="15sp"
  187 + app:layout_constraintBaseline_toBaselineOf="@+id/tvPrecio"
  188 + app:layout_constraintStart_toEndOf="@+id/tvPrecio" />
  189 +
  190 + <TextView
  191 + android:id="@+id/tvCosto"
  192 + android:layout_width="wrap_content"
  193 + android:layout_height="wrap_content"
  194 + android:layout_marginStart="5dp"
  195 + android:layout_marginTop="10dp"
  196 + android:text="9999.99"
  197 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  198 + android:textSize="18sp"
  199 + android:textStyle="bold"
  200 + app:layout_constraintBaseline_toBaselineOf="@+id/textView8"
  201 + app:layout_constraintStart_toEndOf="@+id/textView8" />
  202 +
  203 + <TextView
  204 + android:id="@+id/textView3"
  205 + android:layout_width="wrap_content"
  206 + android:layout_height="wrap_content"
  207 + android:layout_marginTop="10dp"
  208 + android:text="Depósito:"
  209 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  210 + android:textSize="15sp"
  211 + app:layout_constraintStart_toStartOf="parent"
  212 + app:layout_constraintTop_toBottomOf="@+id/textView9" />
  213 +
  214 + <TextView
  215 + android:id="@+id/tvDeposito"
  216 + android:layout_width="wrap_content"
  217 + android:layout_height="wrap_content"
  218 + android:layout_marginStart="5dp"
  219 + android:text="Si"
  220 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  221 + android:textSize="18sp"
  222 + android:textStyle="bold"
  223 + app:layout_constraintBaseline_toBaselineOf="@+id/textView3"
  224 + app:layout_constraintStart_toEndOf="@+id/textView3" />
  225 +
  226 + <TextView
  227 + android:id="@+id/textView5"
  228 + android:layout_width="wrap_content"
  229 + android:layout_height="wrap_content"
  230 + android:layout_marginTop="10dp"
  231 + android:text="Stock:"
  232 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  233 + android:textSize="15sp"
  234 + app:layout_constraintStart_toStartOf="parent"
  235 + app:layout_constraintTop_toBottomOf="@+id/textView3" />
  236 +
  237 +
  238 + <TextView
  239 + android:id="@+id/textView15"
  240 + android:layout_width="wrap_content"
  241 + android:layout_height="wrap_content"
  242 + android:layout_marginStart="5dp"
  243 + android:layout_marginTop="10dp"
  244 + android:text="venta:"
  245 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  246 + android:textSize="15sp"
  247 + app:layout_constraintBaseline_toBaselineOf="@+id/textView5"
  248 + app:layout_constraintStart_toEndOf="@+id/textView18" />
  249 +
  250 + <TextView
  251 + android:id="@+id/tvExiVenta"
  252 + android:layout_width="wrap_content"
  253 + android:layout_height="wrap_content"
  254 + android:layout_marginStart="5dp"
  255 + android:layout_marginTop="10dp"
  256 + android:text="99999.99"
  257 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  258 + android:textSize="18sp"
  259 + android:textStyle="bold"
  260 + app:layout_constraintBaseline_toBaselineOf="@+id/textView15"
  261 + app:layout_constraintStart_toEndOf="@+id/textView15" />
  262 +
  263 + <TextView
  264 + android:id="@+id/textView7"
  265 + android:layout_width="wrap_content"
  266 + android:layout_height="wrap_content"
  267 + android:layout_marginStart="5dp"
  268 + android:text="deposito:"
  269 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  270 + android:textSize="15sp"
  271 + app:layout_constraintBaseline_toBaselineOf="@+id/tvExiVenta"
  272 + app:layout_constraintStart_toEndOf="@+id/tvExiVenta" />
  273 +
  274 + <TextView
  275 + android:id="@+id/tvExiDeposito"
  276 + android:layout_width="wrap_content"
  277 + android:layout_height="wrap_content"
  278 + android:layout_marginStart="5dp"
  279 + android:layout_marginTop="10dp"
  280 + android:text="99999.99"
  281 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  282 + android:textSize="18sp"
  283 + android:textStyle="bold"
  284 + app:layout_constraintBaseline_toBaselineOf="@+id/textView7"
  285 + app:layout_constraintStart_toEndOf="@+id/textView7"
  286 + app:layout_constraintTop_toBottomOf="@+id/tvCosto" />
  287 +
  288 +
  289 + <TextView
  290 + android:id="@+id/textView10"
  291 + android:layout_width="wrap_content"
  292 + android:layout_height="wrap_content"
  293 + android:layout_marginStart="5dp"
  294 + android:layout_marginTop="10dp"
  295 + android:text="Unidad de venta:"
  296 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  297 + android:textSize="15sp"
  298 + app:layout_constraintBaseline_toBaselineOf="@+id/tvDeposito"
  299 + app:layout_constraintStart_toEndOf="@+id/tvPrecio" />
  300 +
  301 + <TextView
  302 + android:id="@+id/tvBal"
  303 + android:layout_width="wrap_content"
  304 + android:layout_height="wrap_content"
  305 + android:layout_marginStart="5dp"
  306 + android:text="Unidades"
  307 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  308 + android:textSize="15sp"
  309 + app:layout_constraintBaseline_toBaselineOf="@+id/textView10"
  310 + app:layout_constraintStart_toEndOf="@+id/textView10" />
  311 +
  312 +
  313 + <TextView
  314 + android:id="@+id/textView11"
  315 + android:layout_width="wrap_content"
  316 + android:layout_height="wrap_content"
  317 + android:layout_marginTop="10dp"
  318 + android:text="Imagen:"
  319 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  320 + android:textSize="14sp"
  321 + app:layout_constraintStart_toStartOf="parent"
  322 + app:layout_constraintTop_toBottomOf="@+id/textView5" />
  323 +
  324 + <ImageView
  325 + android:id="@+id/ivImagen"
  326 + android:layout_width="300dp"
  327 + android:layout_height="300dp"
  328 + android:layout_marginStart="5dp"
  329 + android:src="@drawable/no_imagen"
  330 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  331 + android:textSize="14sp"
  332 + app:layout_constraintStart_toEndOf="@+id/textView11"
  333 + app:layout_constraintTop_toBottomOf="@+id/textView15" />
  334 +
  335 + </androidx.constraintlayout.widget.ConstraintLayout>
  336 + </androidx.cardview.widget.CardView>
  337 +
  338 +</ScrollView>
app/src/main/res/layout/fragment_inv_importados.xml
... ... @@ -24,14 +24,15 @@
24 24  
25 25 <TextView
26 26 android:id="@+id/tvSeleccionInventario"
27   - android:layout_width="0dp"
  27 + android:layout_width="355dp"
28 28 android:layout_height="wrap_content"
29   - android:layout_margin="30dp"
30   - android:layout_marginTop="28dp"
  29 + android:layout_marginTop="15dp"
  30 + android:layout_marginBottom="15dp"
31 31 android:gravity="center"
  32 + android:padding="5dp"
32 33 android:text="@string/tvSeleccionInventario"
33 34 android:textColor="@android:color/black"
34   - android:textSize="@dimen/MarginTopTitulos"
  35 + android:textSize="@dimen/TitulosMedios"
35 36 app:fontFamily="sans-serif-condensed"
36 37 app:layout_constraintEnd_toEndOf="parent"
37 38 app:layout_constraintStart_toStartOf="parent"
... ... @@ -43,6 +44,7 @@
43 44 android:layout_height="0dp"
44 45 android:background="@android:color/darker_gray"
45 46 android:scrollbars="vertical"
  47 + android:visibility="visible"
46 48 app:layout_constraintBottom_toTopOf="@+id/guideline"
47 49 app:layout_constraintEnd_toEndOf="parent"
48 50 app:layout_constraintStart_toStartOf="parent"
... ... @@ -55,7 +57,7 @@
55 57 android:layout_height="wrap_content"
56 58 android:layout_margin="20dp"
57 59 android:text="@string/btnConfirmarAct"
58   - android:textSize="@dimen/MarginTopTitulos"
  60 + android:textSize="@dimen/SubTitulos"
59 61 android:textColor="@android:color/white"
60 62 android:padding="10dp"
61 63 android:background="@drawable/boton_borde_redondeado"
... ... @@ -65,7 +67,7 @@
65 67  
66 68  
67 69 <ProgressBar
68   - android:id="@+id/loading_view"
  70 + android:id="@+id/pbInvSec"
69 71 android:layout_width="wrap_content"
70 72 android:layout_height="wrap_content"
71 73 android:layout_marginStart="8dp"
... ... @@ -79,6 +81,23 @@
79 81 app:layout_constraintEnd_toEndOf="parent"
80 82 app:layout_constraintStart_toStartOf="parent"
81 83 app:layout_constraintTop_toTopOf="parent" />
  84 +
  85 + <TextView
  86 + android:id="@+id/tvMensaje"
  87 + android:layout_width="0dp"
  88 + android:layout_height="wrap_content"
  89 + android:padding="15dp"
  90 + android:gravity="center"
  91 + android:text="@string/tvSeleccionInventario"
  92 + android:textColor="@android:color/black"
  93 + android:textSize="@dimen/TitulosMedios"
  94 + app:fontFamily="sans-serif-condensed"
  95 + android:visibility="gone"
  96 + app:layout_constraintBottom_toBottomOf="@+id/rcDescripcion"
  97 + app:layout_constraintEnd_toEndOf="parent"
  98 + app:layout_constraintStart_toStartOf="parent"
  99 + app:layout_constraintTop_toTopOf="@+id/rcDescripcion" />
  100 +
82 101 <androidx.constraintlayout.widget.Guideline
83 102 android:id="@+id/guideline"
84 103 android:layout_width="wrap_content"
app/src/main/res/layout/fragment_inv_sec.xml
... ... @@ -0,0 +1,245 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.constraintlayout.widget.ConstraintLayout
  3 + xmlns:android="http://schemas.android.com/apk/res/android"
  4 + xmlns:app="http://schemas.android.com/apk/res-auto"
  5 + xmlns:tools="http://schemas.android.com/tools"
  6 + android:id="@+id/frameLayout"
  7 + android:layout_width="match_parent"
  8 + android:layout_height="match_parent"
  9 + tools:context=".UI.inventario.InventarioFragment">
  10 +
  11 +
  12 +<!-- <androidx.appcompat.widget.AppCompatTextView-->
  13 +<!-- android:id="@+id/tvTituloSec"-->
  14 +<!-- android:layout_width="0dp"-->
  15 +<!-- android:layout_height="wrap_content"-->
  16 +<!-- android:layout_marginStart="8dp"-->
  17 +<!-- android:layout_marginEnd="8dp"-->
  18 +<!-- android:textSize="60sp"-->
  19 +<!-- android:gravity="center"-->
  20 +<!-- android:lines="1"-->
  21 +<!-- android:text="@string/invTitulo"-->
  22 +<!-- android:textColor="@color/colorAccent"-->
  23 +<!-- app:fontFamily="sans-serif-condensed"-->
  24 +<!-- app:layout_constraintBottom_toTopOf="@id/guideline2"-->
  25 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  26 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  27 +<!-- app:layout_constraintTop_toTopOf="@id/guideline" />-->
  28 +
  29 +
  30 +<!-- <androidx.recyclerview.widget.RecyclerView-->
  31 +<!-- android:id="@+id/rcInventariosSec"-->
  32 +<!-- android:layout_width="match_parent"-->
  33 +<!-- android:layout_height="0dp"-->
  34 +<!-- android:background="@android:color/darker_gray"-->
  35 +<!-- app:layout_constraintBottom_toBottomOf="@+id/guideline5"-->
  36 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  37 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  38 +<!-- app:layout_constraintTop_toBottomOf="@+id/guideline2"-->
  39 +<!-- tools:listitem="@layout/item" />-->
  40 +
  41 +
  42 +<!-- <Button-->
  43 +<!-- android:id="@+id/btnExportarInvSec"-->
  44 +<!-- android:layout_width="wrap_content"-->
  45 +<!-- android:layout_height="wrap_content"-->
  46 +<!-- android:text="@string/btnExportarInv"-->
  47 +<!-- android:textColor="@android:color/white"-->
  48 +<!-- android:padding="10dp"-->
  49 +<!-- android:background="@drawable/boton_borde_redondeado"-->
  50 +<!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"-->
  51 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  52 +<!-- app:layout_constraintHorizontal_chainStyle="spread"-->
  53 +<!-- app:layout_constraintStart_toEndOf="@+id/btnBorrarInv"-->
  54 +<!-- app:layout_constraintTop_toBottomOf="@+id/guideline5" />-->
  55 +
  56 +<!-- <Button-->
  57 +<!-- android:id="@+id/btnBorrarInv"-->
  58 +<!-- android:layout_width="wrap_content"-->
  59 +<!-- android:layout_height="wrap_content"-->
  60 +<!-- android:text="@string/btnBorrarInv"-->
  61 +<!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"-->
  62 +<!-- app:layout_constraintEnd_toStartOf="@id/btnExportarInvSec"-->
  63 +<!-- app:layout_constraintHorizontal_chainStyle="spread"-->
  64 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  65 +<!-- android:textColor="@android:color/white"-->
  66 +<!-- android:padding="10dp"-->
  67 +<!-- android:background="@drawable/boton_borde_redondeado"-->
  68 +<!-- app:layout_constraintTop_toBottomOf="@+id/guideline5" />-->
  69 +
  70 +<!-- <androidx.constraintlayout.widget.Guideline-->
  71 +<!-- android:id="@+id/guideline"-->
  72 +<!-- android:layout_width="wrap_content"-->
  73 +<!-- android:layout_height="wrap_content"-->
  74 +<!-- android:orientation="horizontal"-->
  75 +<!-- app:layout_constraintGuide_percent="0.02" />-->
  76 +
  77 +<!-- <androidx.constraintlayout.widget.Guideline-->
  78 +<!-- android:id="@+id/guideline2"-->
  79 +<!-- android:layout_width="wrap_content"-->
  80 +<!-- android:layout_height="wrap_content"-->
  81 +<!-- android:orientation="horizontal"-->
  82 +<!-- app:layout_constraintGuide_percent="0.12029161" />-->
  83 +
  84 +<!-- <androidx.constraintlayout.widget.Guideline-->
  85 +<!-- android:id="@+id/guideline5"-->
  86 +<!-- android:layout_width="wrap_content"-->
  87 +<!-- android:layout_height="wrap_content"-->
  88 +<!-- android:orientation="horizontal"-->
  89 +<!-- app:layout_constraintGuide_percent="0.88" />-->
  90 +
  91 +<!-- <androidx.constraintlayout.widget.Guideline-->
  92 +<!-- android:id="@+id/guideline6"-->
  93 +<!-- android:layout_width="wrap_content"-->
  94 +<!-- android:layout_height="wrap_content"-->
  95 +<!-- android:orientation="horizontal"-->
  96 +<!-- app:layout_constraintGuide_percent="0.97" />-->
  97 +
  98 +
  99 +
  100 + <androidx.appcompat.widget.AppCompatTextView
  101 + android:id="@+id/tvTitulo"
  102 + android:layout_width="0dp"
  103 + android:layout_height="50dp"
  104 + android:layout_marginStart="8dp"
  105 + android:layout_marginEnd="8dp"
  106 + android:autoSizeMaxTextSize="100sp"
  107 + android:autoSizeMinTextSize="20sp"
  108 + android:autoSizeStepGranularity="5sp"
  109 + android:autoSizeTextType="uniform"
  110 + android:gravity="center"
  111 + android:lines="1"
  112 + android:text="@string/invTitulo"
  113 + android:textColor="@color/colorAccent"
  114 + app:fontFamily="sans-serif-condensed"
  115 + app:layout_constraintBottom_toTopOf="@id/guideline2"
  116 + app:layout_constraintEnd_toEndOf="parent"
  117 + app:layout_constraintStart_toStartOf="parent"
  118 + app:layout_constraintTop_toTopOf="@id/guideline" />
  119 +
  120 +
  121 + <ImageButton
  122 + android:id="@+id/ivCamara"
  123 + android:layout_width="80dp"
  124 + android:layout_height="80dp"
  125 + android:layout_marginTop="15dp"
  126 + android:clickable="true"
  127 + android:contentDescription="@string/ibBusCB"
  128 + android:elevation="5dp"
  129 + android:background="@drawable/boton_redondo"
  130 + android:layout_margin="10dp"
  131 + android:focusable="false"
  132 + android:scaleType="fitEnd"
  133 + app:layout_constraintCircleRadius="40dp"
  134 + android:src="@drawable/desc"
  135 + app:layout_constraintBottom_toTopOf="@id/guideline3"
  136 + app:layout_constraintEnd_toStartOf="@+id/etDescripcion"
  137 + app:layout_constraintHorizontal_bias="0.0"
  138 + app:layout_constraintStart_toStartOf="parent"
  139 + app:layout_constraintTop_toBottomOf="@+id/guideline2" />
  140 +
  141 + <EditText
  142 + android:id="@+id/etDescripcion"
  143 + android:layout_width="0dp"
  144 + android:layout_height="wrap_content"
  145 + android:autofillHints=""
  146 + android:clickable="true"
  147 + android:ems="10"
  148 + android:focusable="true"
  149 + android:hint="@string/ibBusDesc"
  150 + android:inputType="textPersonName"
  151 + android:lines="1"
  152 + android:textAllCaps="true"
  153 + android:textSize="20sp"
  154 + app:layout_constraintBottom_toTopOf="@+id/guideline3"
  155 + app:layout_constraintEnd_toEndOf="parent"
  156 + app:layout_constraintHorizontal_bias="0.49"
  157 + app:layout_constraintHorizontal_chainStyle="packed"
  158 + app:layout_constraintStart_toEndOf="@+id/ivCamara"
  159 + app:layout_constraintTop_toBottomOf="@+id/guideline2" />
  160 +
  161 +
  162 + <androidx.recyclerview.widget.RecyclerView
  163 + android:id="@+id/rcInventarios"
  164 + android:layout_width="match_parent"
  165 + android:layout_height="0dp"
  166 + android:background="@android:color/darker_gray"
  167 + app:layout_constraintBottom_toBottomOf="@+id/guideline5"
  168 + app:layout_constraintEnd_toEndOf="parent"
  169 + app:layout_constraintStart_toStartOf="parent"
  170 + app:layout_constraintTop_toBottomOf="@+id/guideline4"
  171 + tools:listitem="@layout/item" />
  172 +
  173 +
  174 + <Button
  175 + android:id="@+id/btnExportarInv"
  176 + android:layout_width="wrap_content"
  177 + android:layout_height="wrap_content"
  178 + android:text="@string/btnExportarInv"
  179 + android:textColor="@android:color/white"
  180 + android:padding="10dp"
  181 + android:background="@drawable/boton_borde_redondeado"
  182 + app:layout_constraintBottom_toBottomOf="@+id/guideline6"
  183 + app:layout_constraintEnd_toEndOf="parent"
  184 + app:layout_constraintHorizontal_chainStyle="spread"
  185 + app:layout_constraintStart_toEndOf="@+id/btnBorrarInv"
  186 + app:layout_constraintTop_toBottomOf="@+id/guideline5" />
  187 +
  188 + <Button
  189 + android:id="@+id/btnBorrarInv"
  190 + android:layout_width="wrap_content"
  191 + android:layout_height="wrap_content"
  192 + android:text="@string/btnBorrarInv"
  193 + app:layout_constraintBottom_toBottomOf="@+id/guideline6"
  194 + app:layout_constraintEnd_toStartOf="@id/btnExportarInv"
  195 + app:layout_constraintHorizontal_chainStyle="spread"
  196 + app:layout_constraintStart_toStartOf="parent"
  197 + android:textColor="@android:color/white"
  198 + android:padding="10dp"
  199 + android:background="@drawable/boton_borde_redondeado"
  200 + app:layout_constraintTop_toBottomOf="@+id/guideline5" />
  201 +
  202 + <androidx.constraintlayout.widget.Guideline
  203 + android:id="@+id/guideline"
  204 + android:layout_width="wrap_content"
  205 + android:layout_height="wrap_content"
  206 + android:orientation="horizontal"
  207 + app:layout_constraintGuide_percent="0.02" />
  208 +
  209 + <androidx.constraintlayout.widget.Guideline
  210 + android:id="@+id/guideline2"
  211 + android:layout_width="wrap_content"
  212 + android:layout_height="wrap_content"
  213 + android:orientation="horizontal"
  214 + app:layout_constraintGuide_percent="0.12029161" />
  215 +
  216 + <androidx.constraintlayout.widget.Guideline
  217 + android:id="@+id/guideline3"
  218 + android:layout_width="wrap_content"
  219 + android:layout_height="wrap_content"
  220 + android:orientation="horizontal"
  221 + app:layout_constraintGuide_percent="0.27" />
  222 +
  223 + <androidx.constraintlayout.widget.Guideline
  224 + android:id="@+id/guideline4"
  225 + android:layout_width="wrap_content"
  226 + android:layout_height="wrap_content"
  227 + android:orientation="horizontal"
  228 + app:layout_constraintGuide_percent="0.32" />
  229 +
  230 + <androidx.constraintlayout.widget.Guideline
  231 + android:id="@+id/guideline5"
  232 + android:layout_width="wrap_content"
  233 + android:layout_height="wrap_content"
  234 + android:orientation="horizontal"
  235 + app:layout_constraintGuide_percent="0.88" />
  236 +
  237 + <androidx.constraintlayout.widget.Guideline
  238 + android:id="@+id/guideline6"
  239 + android:layout_width="wrap_content"
  240 + android:layout_height="wrap_content"
  241 + android:orientation="horizontal"
  242 + app:layout_constraintGuide_percent="0.97" />
  243 +
  244 +
  245 +</androidx.constraintlayout.widget.ConstraintLayout>
0 246 \ No newline at end of file
app/src/main/res/layout/fragment_inventario.xml
... ... @@ -120,6 +120,23 @@
120 120 android:background="@drawable/boton_borde_redondeado"
121 121 app:layout_constraintTop_toBottomOf="@+id/guideline5" />
122 122  
  123 +
  124 + <ProgressBar
  125 + android:id="@+id/loading_view"
  126 + android:layout_width="wrap_content"
  127 + android:layout_height="wrap_content"
  128 + android:layout_marginStart="8dp"
  129 + android:layout_marginLeft="8dp"
  130 + android:layout_marginTop="8dp"
  131 + android:layout_marginEnd="8dp"
  132 + android:layout_marginRight="8dp"
  133 + android:layout_marginBottom="8dp"
  134 + android:visibility="gone"
  135 + app:layout_constraintBottom_toBottomOf="parent"
  136 + app:layout_constraintEnd_toEndOf="parent"
  137 + app:layout_constraintStart_toStartOf="parent"
  138 + app:layout_constraintTop_toTopOf="parent" />
  139 +
123 140 <androidx.constraintlayout.widget.Guideline
124 141 android:id="@+id/guideline"
125 142 android:layout_width="wrap_content"
app/src/main/res/layout/fragment_main.xml
... ... @@ -120,67 +120,40 @@
120 120 app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos"
121 121 app:layout_constraintVertical_bias="0.0" />
122 122  
123   - <androidx.appcompat.widget.AppCompatImageButton
124   - android:id="@+id/ivSort19II"
125   - android:layout_width="50dp"
126   - android:layout_height="50dp"
127   - android:layout_marginStart="10dp"
128   - android:padding="5dp"
129   - android:src="@drawable/ic_sort19"
130   - android:visibility="gone"
131   - app:layout_constraintHorizontal_bias="0.0"
132   - app:layout_constraintHorizontal_chainStyle="packed"
133   - app:layout_constraintStart_toStartOf="parent"
134   - app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />
135   -
136   - <androidx.appcompat.widget.AppCompatImageButton
137   - android:id="@+id/ivSort91II"
138   - android:layout_width="50dp"
139   - android:layout_height="50dp"
140   - android:layout_marginStart="10dp"
141   - android:padding="5dp"
142   - android:src="@drawable/ic_sort91"
143   - android:visibility="gone"
144   - app:layout_constraintHorizontal_chainStyle="packed"
145   - app:layout_constraintStart_toStartOf="parent"
146   - app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />
147   -
148   - <TextView
149   - android:id="@+id/tvTipoII"
150   - android:layout_width="wrap_content"
151   - android:layout_height="wrap_content"
152   - android:layout_margin="5dp"
153   - android:text="Tipo:"
154   - android:layout_marginTop="12dp"
155   - android:textSize="15sp"
156   - android:visibility="gone"
157   - app:layout_constraintBaseline_toBaselineOf="@+id/cbVentasII"
158   - app:layout_constraintEnd_toStartOf="@+id/cbVentasII" />
159   -
160   - <com.google.android.material.checkbox.MaterialCheckBox
161   - android:id="@+id/cbVentasII"
162   - android:layout_width="wrap_content"
163   - android:layout_height="wrap_content"
164   - android:layout_margin="5dp"
165   - android:checked="true"
166   - android:text="Ventas"
167   - android:layout_marginTop="12dp"
168   - android:visibility="gone"
169   - app:layout_constraintEnd_toStartOf="@+id/cbDepositoII"
170   - app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" />
171   -
172   - <com.google.android.material.checkbox.MaterialCheckBox
173   - android:id="@+id/cbDepositoII"
174   - android:layout_width="wrap_content"
175   - android:layout_height="wrap_content"
176   - android:layout_margin="5dp"
177   - android:checked="true"
178   - android:text="Deposito"
179   - android:layout_marginTop="12dp"
180   - android:visibility="gone"
181   - app:layout_constraintEnd_toEndOf="parent"
182   - app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" />
183   -
  123 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  124 +<!-- android:id="@+id/ivSort19II"-->
  125 +<!-- android:layout_width="50dp"-->
  126 +<!-- android:layout_height="50dp"-->
  127 +<!-- android:layout_marginStart="10dp"-->
  128 +<!-- android:padding="5dp"-->
  129 +<!-- android:src="@drawable/ic_sort19"-->
  130 +<!-- android:visibility="gone"-->
  131 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  132 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  133 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  134 +
  135 +<!-- <androidx.appcompat.widget.AppCompatImageButton-->
  136 +<!-- android:id="@+id/ivSort91II"-->
  137 +<!-- android:layout_width="50dp"-->
  138 +<!-- android:layout_height="50dp"-->
  139 +<!-- android:layout_marginStart="10dp"-->
  140 +<!-- android:padding="5dp"-->
  141 +<!-- android:src="@drawable/ic_sort91"-->
  142 +<!-- android:visibility="invisible"-->
  143 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  144 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  145 +<!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />-->
  146 + <ImageView
  147 + android:id="@+id/ivPortada"
  148 + android:layout_width="404dp"
  149 + android:layout_height="248dp"
  150 + android:elevation="10dp"
  151 + android:visibility="visible"
  152 + app:layout_constraintBottom_toBottomOf="parent"
  153 + app:layout_constraintEnd_toEndOf="parent"
  154 + app:layout_constraintStart_toStartOf="parent"
  155 + app:layout_constraintTop_toBottomOf="@+id/tvInvImportados"
  156 + tools:srcCompat="@drawable/imagen_portada" />
184 157  
185 158 <androidx.recyclerview.widget.RecyclerView
186 159 android:id="@+id/rcInventarioII"
... ... @@ -191,7 +164,7 @@
191 164 android:visibility="gone"
192 165 app:layout_constraintEnd_toEndOf="parent"
193 166 app:layout_constraintStart_toStartOf="parent"
194   - app:layout_constraintTop_toBottomOf="@id/ivSort19II"
  167 + app:layout_constraintTop_toBottomOf="@id/tvInvImportados"
195 168 tools:listitem="@layout/item_principal"
196 169 app:layout_constraintBottom_toTopOf="@+id/guideline1"/>
197 170  
app/src/main/res/layout/fragment_servidores.xml
... ... @@ -75,38 +75,66 @@
75 75 app:layout_constraintStart_toStartOf="parent"
76 76 app:layout_constraintTop_toBottomOf="@+id/etNombreServidor" />
77 77  
  78 +
78 79 <EditText
79 80 android:id="@+id/etDireccionServidor"
80   - android:layout_width="130dp"
  81 + android:layout_width="150dp"
81 82 android:layout_height="wrap_content"
  83 + android:layout_marginStart="44dp"
82 84 android:clickable="true"
83 85 android:ems="10"
84 86 android:focusable="true"
85 87 android:hint="192.168.100.100"
86 88 android:inputType="phone"
  89 + android:nextFocusDown="@id/etPuertoSubida"
  90 + android:nextFocusRight="@id/etPuertoSubida"
  91 + android:nextFocusLeft="@id/etPuertoSubida"
87 92 android:lines="1"
88 93 android:textSize="15sp"
89 94 app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer"
90 95 app:layout_constraintStart_toEndOf="@+id/tvDirServer" />
91 96  
  97 + <EditText
  98 + android:id="@+id/etPuertoSubida"
  99 + android:layout_width="150dp"
  100 + android:layout_height="wrap_content"
  101 + android:layout_margin="10dp"
  102 + android:autofillHints=""
  103 + android:clickable="true"
  104 + android:ems="9"
  105 + android:focusable="true"
  106 + android:hint="Puerto de Subida"
  107 + android:inputType="number"
  108 + android:nextFocusDown="@id/etPuertoBajada"
  109 + android:nextFocusRight="@id/etPuertoBajada"
  110 + android:nextFocusLeft="@id/etPuertoBajada"
  111 + android:lines="1"
  112 + android:textSize="15sp"
  113 + app:layout_constraintStart_toStartOf="parent"
  114 + app:layout_constraintTop_toBottomOf="@+id/tvDirServer" />
92 115  
93 116 <EditText
94   - android:id="@+id/etPuerto"
95   - android:layout_width="80dp"
  117 + android:id="@+id/etPuertoBajada"
  118 + android:layout_width="150dp"
96 119 android:layout_height="wrap_content"
  120 + android:layout_margin="10dp"
  121 + android:autofillHints=""
97 122 android:clickable="true"
98 123 android:ems="10"
99 124 android:focusable="true"
100   - android:hint="Puerto"
  125 + android:hint="Puerto de Bajada"
  126 + android:nextFocusDown="@id/btnGuardarServidores"
  127 + android:nextFocusRight="@id/btnGuardarServidores"
  128 + android:nextFocusLeft="@id/btnGuardarServidores"
101 129 android:inputType="number"
102 130 android:lines="1"
103 131 android:textSize="15sp"
104   - app:layout_constraintBaseline_toBaselineOf="@+id/etDireccionServidor"
105   - app:layout_constraintStart_toEndOf="@+id/etDireccionServidor"
106   - android:autofillHints="" />
  132 + app:layout_constraintBaseline_toBaselineOf="@+id/etPuertoSubida"
  133 + app:layout_constraintEnd_toEndOf="parent"
  134 + app:layout_constraintStart_toEndOf="@+id/etPuertoSubida" />
107 135  
108 136  
109   - <androidx.recyclerview.widget.RecyclerView
  137 + <androidx.recyclerview.widget.RecyclerView
110 138 android:id="@+id/rvServidores"
111 139 android:layout_width="match_parent"
112 140 android:layout_height="0dp"
... ... @@ -115,7 +143,7 @@
115 143 app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores"
116 144 app:layout_constraintEnd_toEndOf="parent"
117 145 app:layout_constraintStart_toStartOf="parent"
118   - app:layout_constraintTop_toBottomOf="@+id/etPuerto"
  146 + app:layout_constraintTop_toBottomOf="@+id/etPuertoSubida"
119 147 app:layout_goneMarginEnd="10dp"
120 148 tools:listitem="@layout/item_servidores" />
121 149  
app/src/main/res/layout/item_inv_importados.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2   -<androidx.constraintlayout.widget.ConstraintLayout
3   - xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
4   - android:layout_height="match_parent">
  2 +<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="wrap_content"
  7 + android:layout_margin="10dp"
  8 + app:cardCornerRadius="15dp"
  9 + app:cardElevation="10dp"
  10 + app:cardPreventCornerOverlap="false">
5 11  
6   -</androidx.constraintlayout.widget.ConstraintLayout>
7 12 \ No newline at end of file
  13 + <androidx.constraintlayout.widget.ConstraintLayout
  14 + android:layout_width="match_parent"
  15 + android:layout_height="wrap_content"
  16 + android:layout_gravity="center"
  17 + android:orientation="horizontal">
  18 +
  19 + <com.google.android.material.checkbox.MaterialCheckBox
  20 + android:id="@+id/tvPrincipalinventario"
  21 + android:layout_width="match_parent"
  22 + android:layout_height="wrap_content"
  23 + android:layout_margin="15dp"
  24 + android:background="@drawable/boton_redondo2"
  25 + android:gravity="center_vertical"
  26 + android:padding="5dp"
  27 + android:textColor="@android:color/black"
  28 + android:textSize="@dimen/TitulosActMa"
  29 + android:textStyle="bold"
  30 + app:layout_constraintBottom_toBottomOf="parent"
  31 + app:layout_constraintStart_toStartOf="parent"
  32 + app:layout_constraintTop_toTopOf="parent"
  33 + tools:text="Inventario Sectorizado # 1487" />
  34 +
  35 +
  36 + </androidx.constraintlayout.widget.ConstraintLayout>
  37 +</androidx.cardview.widget.CardView>
app/src/main/res/layout/item_principal.xml
... ... @@ -62,7 +62,7 @@
62 62 android:layout_width="wrap_content"
63 63 android:layout_height="wrap_content"
64 64 android:layout_marginTop="4dp"
65   - android:text="Art. Contados"
  65 + android:text="Cantidad Art."
66 66 android:textSize="15sp"
67 67 android:textStyle="bold"
68 68 app:layout_constraintEnd_toEndOf="parent"
app/src/main/res/layout/item_sec.xml
... ... @@ -0,0 +1,171 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="wrap_content"
  7 + android:layout_margin="5dp"
  8 + app:cardCornerRadius="15dp"
  9 + app:cardElevation="10dp"
  10 + app:contentPadding="5dp"
  11 + app:cardPreventCornerOverlap="false">
  12 +
  13 + <androidx.constraintlayout.widget.ConstraintLayout
  14 + android:layout_width="match_parent"
  15 + android:layout_height="wrap_content">
  16 +
  17 + <TextView
  18 + android:id="@+id/tvDescripcion"
  19 + android:layout_width="0dp"
  20 + android:layout_height="wrap_content"
  21 + android:layout_marginStart="3dp"
  22 + android:maxLines="2"
  23 + android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz"
  24 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  25 + android:textSize="16sp"
  26 + android:textStyle="bold"
  27 + app:layout_constraintStart_toStartOf="parent"
  28 + app:layout_constraintTop_toTopOf="parent" />
  29 +
  30 +<!-- <TextView-->
  31 +<!-- android:id="@+id/textView2"-->
  32 +<!-- android:layout_width="wrap_content"-->
  33 +<!-- android:layout_height="wrap_content"-->
  34 +<!-- android:layout_marginStart="5dp"-->
  35 +<!-- android:text="Código:"-->
  36 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"-->
  37 +<!-- android:textSize="14sp"-->
  38 +<!-- app:layout_constraintEnd_toStartOf="@+id/tvSector"-->
  39 +<!-- app:layout_constraintHorizontal_bias="0.01"-->
  40 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  41 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  42 +<!-- app:layout_constraintTop_toTopOf="parent" />-->
  43 +
  44 +
  45 +<!-- <TextView-->
  46 +<!-- android:id="@+id/tvSector"-->
  47 +<!-- android:layout_width="wrap_content"-->
  48 +<!-- android:layout_height="match_parent"-->
  49 +<!-- android:layout_marginStart="8dp"-->
  50 +<!-- android:text="9999"-->
  51 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
  52 +<!-- android:textColorHint="@android:color/black"-->
  53 +<!-- android:textSize="18sp"-->
  54 +<!-- android:textStyle="bold"-->
  55 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  56 +<!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView2"-->
  57 +<!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigo"-->
  58 +<!-- app:layout_constraintStart_toEndOf="@+id/textView2" />-->
  59 +
  60 +
  61 +<!-- <TextView-->
  62 +<!-- android:id="@+id/tvCodigo"-->
  63 +<!-- android:layout_width="wrap_content"-->
  64 +<!-- android:layout_height="match_parent"-->
  65 +<!-- android:text="99999999"-->
  66 +<!-- android:layout_marginStart="8dp"-->
  67 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  68 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
  69 +<!-- android:textColorHint="@android:color/black"-->
  70 +<!-- android:textSize="18sp"-->
  71 +<!-- android:textStyle="bold"-->
  72 +<!-- app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"-->
  73 +<!-- app:layout_constraintEnd_toStartOf="@+id/textView5"-->
  74 +<!-- app:layout_constraintStart_toEndOf="@+id/tvSector" />-->
  75 +
  76 + <TextView
  77 + android:id="@+id/textView5"
  78 + android:layout_width="wrap_content"
  79 + android:layout_height="wrap_content"
  80 + android:text="Cantidad:"
  81 + android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
  82 + android:textSize="14sp"
  83 + android:layout_marginStart="5dp"
  84 + android:layout_marginTop="5dp"
  85 + app:layout_constraintStart_toStartOf="parent"
  86 + app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" />
  87 +
  88 + <TextView
  89 + android:id="@+id/tvCantidad"
  90 + android:layout_width="wrap_content"
  91 + android:layout_height="match_parent"
  92 + android:layout_marginTop="5dp"
  93 + android:text="12345.12"
  94 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  95 + android:textSize="18sp"
  96 + android:textStyle="bold"
  97 + app:layout_constraintBaseline_toBaselineOf="@+id/textView5"
  98 +
  99 + app:layout_constraintStart_toEndOf="@id/textView5" />
  100 +
  101 + <ImageView
  102 + android:id="@+id/ivPen"
  103 + android:layout_width="30dp"
  104 + android:layout_height="30dp"
  105 + android:layout_marginStart="3dp"
  106 + android:src="@drawable/pen"
  107 + android:visibility="visible"
  108 + app:layout_constraintStart_toEndOf="@+id/tvCantidad"
  109 + app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" />
  110 +
  111 + <ImageView
  112 + android:id="@+id/ivDots"
  113 + android:layout_width="30dp"
  114 + android:layout_height="30dp"
  115 + android:layout_marginEnd="3dp"
  116 + android:src="@drawable/more"
  117 + android:visibility="visible"
  118 + app:layout_constraintEnd_toEndOf="parent"
  119 + app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" />
  120 +
  121 +<!-- <TextView-->
  122 +<!-- android:id="@+id/textView85"-->
  123 +<!-- android:layout_width="wrap_content"-->
  124 +<!-- android:layout_height="wrap_content"-->
  125 +<!-- android:layout_marginStart="5dp"-->
  126 +<!-- android:layout_marginTop="8dp"-->
  127 +<!-- android:text="Desc:"-->
  128 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"-->
  129 +<!-- android:textSize="14sp"-->
  130 +<!-- app:layout_constraintEnd_toStartOf="@+id/tvDescripcion"-->
  131 +<!-- app:layout_constraintHorizontal_bias="0.0"-->
  132 +<!-- app:layout_constraintHorizontal_chainStyle="packed"-->
  133 +<!-- app:layout_constraintStart_toStartOf="parent"-->
  134 +<!-- app:layout_constraintTop_toBottomOf="@id/tvCodigo" />-->
  135 +
  136 +
  137 +<!-- <TextView-->
  138 +<!-- android:id="@+id/tvCodigoBarras"-->
  139 +<!-- android:layout_width="match_parent"-->
  140 +<!-- android:layout_height="wrap_content"-->
  141 +<!-- android:layout_marginStart="3dp"-->
  142 +<!-- android:layout_marginTop="8dp"-->
  143 +<!-- android:maxLines="2"-->
  144 +<!-- android:text=""-->
  145 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
  146 +<!-- android:textSize="14sp"-->
  147 +<!-- android:visibility="gone"-->
  148 +<!-- android:textStyle="bold"-->
  149 +<!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"-->
  150 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  151 +<!-- app:layout_constraintStart_toEndOf="@+id/textView85"-->
  152 +<!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />-->
  153 +<!-- <TextView-->
  154 +<!-- android:id="@+id/tvCodigoOrigen"-->
  155 +<!-- android:layout_width="match_parent"-->
  156 +<!-- android:layout_height="wrap_content"-->
  157 +<!-- android:layout_marginStart="3dp"-->
  158 +<!-- android:layout_marginTop="8dp"-->
  159 +<!-- android:maxLines="2"-->
  160 +<!-- android:text=""-->
  161 +<!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
  162 +<!-- android:textSize="14sp"-->
  163 +<!-- android:visibility="gone"-->
  164 +<!-- android:textStyle="bold"-->
  165 +<!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"-->
  166 +<!-- app:layout_constraintEnd_toEndOf="parent"-->
  167 +<!-- app:layout_constraintStart_toEndOf="@+id/textView85"-->
  168 +<!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />-->
  169 + </androidx.constraintlayout.widget.ConstraintLayout>
  170 +
  171 +</androidx.cardview.widget.CardView>
0 172 \ No newline at end of file
app/src/main/res/layout/item_servidores.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
3 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4   - xmlns:tools="http://schemas.android.com/tools"
5 4 android:layout_width="match_parent"
6 5 android:layout_height="wrap_content"
7 6 android:layout_margin="5dp"
8 7 app:cardCornerRadius="15dp"
9 8 app:cardElevation="10dp"
10   - app:contentPadding="5dp"
11   - app:cardPreventCornerOverlap="false">
  9 + app:cardPreventCornerOverlap="false"
  10 + app:contentPadding="5dp">
12 11  
13 12 <androidx.constraintlayout.widget.ConstraintLayout
14 13 android:layout_width="match_parent"
... ... @@ -47,7 +46,7 @@
47 46 android:layout_width="wrap_content"
48 47 android:layout_height="wrap_content"
49 48 android:layout_marginStart="5dp"
50   - android:layout_marginTop="8dp"
  49 + android:layout_marginTop="3dp"
51 50 android:text="Dirección:"
52 51 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
53 52 android:textSize="14sp"
... ... @@ -71,28 +70,51 @@
71 70 android:id="@+id/textView86"
72 71 android:layout_width="wrap_content"
73 72 android:layout_height="wrap_content"
74   - android:layout_marginTop="8dp"
75   - android:layout_marginStart="10dp"
76   - android:text="Puerto:"
  73 + android:layout_marginStart="5dp"
  74 + android:layout_marginTop="3dp"
  75 + android:text="Puerto Subida:"
77 76 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
78 77 android:textSize="14sp"
79 78 app:layout_constraintHorizontal_chainStyle="packed"
80   - app:layout_constraintStart_toEndOf="@+id/tvDireccionServidor"
81   - app:layout_constraintTop_toBottomOf="@id/tvDescServidor" />
  79 + app:layout_constraintStart_toStartOf="parent"
  80 + app:layout_constraintTop_toBottomOf="@+id/textView85" />
  81 +
  82 + <TextView
  83 + android:id="@+id/tvPuertoSubida"
  84 + android:layout_width="wrap_content"
  85 + android:layout_height="wrap_content"
  86 + android:text="9999"
  87 + android:textAppearance="@style/TextAppearance.AppCompat.Large"
  88 + android:textColorHint="@android:color/black"
  89 + android:textSize="14sp"
  90 + android:textStyle="bold"
  91 + app:layout_constraintBaseline_toBaselineOf="@+id/textView86"
  92 + app:layout_constraintStart_toEndOf="@+id/textView86" />
82 93  
83 94 <TextView
84   - android:id="@+id/tvPuertoServidor"
  95 + android:id="@+id/textView87"
85 96 android:layout_width="wrap_content"
86 97 android:layout_height="wrap_content"
87   - android:layout_marginTop="8dp"
  98 + android:layout_marginTop="3dp"
88 99 android:layout_marginStart="5dp"
89   - android:text=""
  100 + android:text="Puerto Bajada:"
  101 + android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
  102 + android:textSize="14sp"
  103 + app:layout_constraintHorizontal_chainStyle="packed"
  104 + app:layout_constraintStart_toEndOf="@+id/tvPuertoSubida"
  105 + app:layout_constraintTop_toBottomOf="@+id/textView85" />
  106 +
  107 + <TextView
  108 + android:id="@+id/tvPuertoBajada"
  109 + android:layout_width="wrap_content"
  110 + android:layout_height="wrap_content"
  111 + android:text="9999"
90 112 android:textAppearance="@style/TextAppearance.AppCompat.Large"
91 113 android:textColorHint="@android:color/black"
92 114 android:textSize="14sp"
93 115 android:textStyle="bold"
94   - app:layout_constraintStart_toEndOf="@+id/textView86"
95   - app:layout_constraintTop_toBottomOf="@+id/tvDescServidor" />
  116 + app:layout_constraintBaseline_toBaselineOf="@+id/textView87"
  117 + app:layout_constraintStart_toEndOf="@+id/textView87" />
96 118 </androidx.constraintlayout.widget.ConstraintLayout>
97 119  
98 120 </androidx.cardview.widget.CardView>
99 121 \ No newline at end of file
app/src/main/res/layout/solicitar_fecha.xml
... ... @@ -0,0 +1,148 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="wrap_content"
  6 + android:focusable="false"
  7 + android:focusableInTouchMode="false"
  8 + android:orientation="vertical"
  9 + android:padding="10dp">
  10 +
  11 + <LinearLayout
  12 + android:id="@+id/barraSuperior"
  13 + android:layout_width="0dp"
  14 + android:layout_height="wrap_content"
  15 + android:background="@color/colorPrimaryDark"
  16 + android:focusable="false"
  17 + android:focusableInTouchMode="false"
  18 + android:orientation="horizontal"
  19 + app:layout_constraintEnd_toEndOf="parent"
  20 + app:layout_constraintStart_toStartOf="parent"
  21 + app:layout_constraintTop_toTopOf="parent">
  22 +
  23 + <androidx.appcompat.widget.AppCompatImageView
  24 + android:layout_width="50dp"
  25 + android:layout_height="60dp"
  26 + android:layout_marginStart="25dp"
  27 + android:focusable="false"
  28 + android:focusableInTouchMode="false"
  29 + android:src="@drawable/error" />
  30 +
  31 + <androidx.appcompat.widget.AppCompatTextView
  32 + android:id="@+id/tvFechayHora"
  33 + android:layout_width="0dp"
  34 + android:layout_height="wrap_content"
  35 + android:layout_marginTop="15dp"
  36 + android:layout_weight="1"
  37 + android:background="@drawable/boton_borde_redondeado"
  38 + android:focusable="false"
  39 + android:focusableInTouchMode="false"
  40 + android:text="@string/tvFechayHora"
  41 + android:textAlignment="center"
  42 + android:textColor="@android:color/white"
  43 + android:textSize="25sp" />
  44 + </LinearLayout>
  45 +
  46 + <TextView
  47 + android:id="@+id/textView6"
  48 + android:layout_width="wrap_content"
  49 + android:layout_height="wrap_content"
  50 + android:layout_margin="5dp"
  51 + android:focusable="false"
  52 + android:focusableInTouchMode="false"
  53 + android:gravity="center"
  54 + android:text="La fecha y hora del Servidor no coinciden con la fecha y hora del dispositivo."
  55 + android:textColor="@android:color/holo_red_dark"
  56 + android:textSize="20sp"
  57 + android:textStyle="bold"
  58 + app:layout_constraintEnd_toEndOf="parent"
  59 + app:layout_constraintHorizontal_bias="0.0"
  60 + app:layout_constraintHorizontal_chainStyle="packed"
  61 + app:layout_constraintStart_toStartOf="parent"
  62 + app:layout_constraintTop_toBottomOf="@id/barraSuperior" />
  63 +
  64 + <TextView
  65 + android:id="@+id/textView7"
  66 + android:layout_width="wrap_content"
  67 + android:layout_height="wrap_content"
  68 + android:layout_margin="5dp"
  69 + android:focusable="false"
  70 + android:focusableInTouchMode="false"
  71 + android:text="Servidor:"
  72 + android:textSize="20sp"
  73 + app:layout_constraintHorizontal_chainStyle="packed"
  74 + app:layout_constraintStart_toStartOf="parent"
  75 + app:layout_constraintTop_toBottomOf="@+id/textView6" />
  76 +
  77 + <TextView
  78 + android:id="@+id/tvHoraServidor"
  79 + android:layout_width="wrap_content"
  80 + android:layout_height="wrap_content"
  81 + android:layout_margin="5dp"
  82 + android:focusable="false"
  83 + android:focusableInTouchMode="false"
  84 + android:text="99/99/9999 99:99:99"
  85 + android:textSize="20sp"
  86 + app:layout_constraintBaseline_toBaselineOf="@+id/textView7"
  87 + app:layout_constraintStart_toEndOf="@+id/textView7" />
  88 +
  89 +
  90 + <TextView
  91 + android:id="@+id/textView8"
  92 + android:layout_width="wrap_content"
  93 + android:layout_height="wrap_content"
  94 + android:layout_margin="5dp"
  95 + android:focusable="false"
  96 + android:focusableInTouchMode="false"
  97 + android:text="Dispositivo:"
  98 + android:textSize="20sp"
  99 + app:layout_constraintStart_toStartOf="parent"
  100 + app:layout_constraintTop_toBottomOf="@+id/textView7" />
  101 +
  102 + <TextView
  103 + android:id="@+id/tvHoraDispositivo"
  104 + android:layout_width="wrap_content"
  105 + android:layout_height="wrap_content"
  106 + android:layout_margin="5dp"
  107 + android:focusable="false"
  108 + android:focusableInTouchMode="false"
  109 + android:text="99/99/9999 99:99:99"
  110 + android:textSize="20sp"
  111 + app:layout_constraintBaseline_toBaselineOf="@+id/textView8"
  112 + app:layout_constraintStart_toEndOf="@+id/textView8" />
  113 +
  114 + <Button
  115 + android:id="@+id/btnCambiarHora"
  116 + style="@style/Base.Widget.AppCompat.Button.Colored"
  117 + android:layout_width="0dp"
  118 + android:layout_height="wrap_content"
  119 + android:layout_margin="15dp"
  120 + android:background="@drawable/boton_borde_redondeado"
  121 + android:focusable="false"
  122 + android:focusableInTouchMode="false"
  123 + android:padding="20dp"
  124 + android:text="@string/btnCambiarHora"
  125 + android:textColor="@android:color/white"
  126 + app:layout_constraintEnd_toEndOf="parent"
  127 + app:layout_constraintStart_toStartOf="parent"
  128 + app:layout_constraintTop_toBottomOf="@+id/tvHoraDispositivo" />
  129 +
  130 +
  131 + <Button
  132 + android:id="@+id/btnSalir"
  133 + style="@style/Base.Widget.AppCompat.Button.Colored"
  134 + android:layout_width="140dp"
  135 + android:layout_height="wrap_content"
  136 + android:layout_margin="5dp"
  137 + android:background="@drawable/boton_borde_redondeado"
  138 + android:focusable="false"
  139 + android:focusableInTouchMode="false"
  140 + android:padding="20dp"
  141 + android:text="@string/btnSalir"
  142 + android:textColor="@android:color/white"
  143 + app:layout_constraintEnd_toEndOf="parent"
  144 + app:layout_constraintStart_toStartOf="parent"
  145 + app:layout_constraintTop_toBottomOf="@+id/btnCambiarHora" />
  146 +
  147 +
  148 +</androidx.constraintlayout.widget.ConstraintLayout>
0 149 \ No newline at end of file
app/src/main/res/navigation/mobile_navigation.xml
... ... @@ -15,61 +15,75 @@
15 15 android:id="@+id/mainFragment2"
16 16 android:name="com.focasoftware.deboinventariov20.UI.main.MainFragment"
17 17 android:label="Principal"
18   - tools:layout="@layout/fragment_main" >
  18 + tools:layout="@layout/fragment_main">
19 19 <action
20 20 android:id="@+id/action_mainFragment2_to_configuracionFragment"
21 21 app:destination="@id/configuracionFragment"
22   - app:popEnterAnim="@anim/slide_in_left"
23   - app:popExitAnim="@anim/slide_out_right"
24 22 app:enterAnim="@anim/slide_in_right"
25   - app:exitAnim="@anim/slide_out_left" />
  23 + app:exitAnim="@anim/slide_out_left"
  24 + app:popEnterAnim="@anim/slide_in_left"
  25 + app:popExitAnim="@anim/slide_out_right" />
26 26 <action
27 27 android:id="@+id/action_mainFragment2_to_actuaMaestrosFragment"
28 28 app:destination="@id/actuaMaestrosFragment"
  29 + app:enterAnim="@anim/slide_in_right"
  30 + app:exitAnim="@anim/slide_out_left"
29 31 app:popEnterAnim="@anim/slide_in_left"
30 32 app:popExitAnim="@anim/slide_out_right"
31   - app:enterAnim="@anim/slide_in_right"
32   - app:exitAnim="@anim/slide_out_left" />
  33 + app:popUpTo="@id/mainFragment2"
  34 + app:popUpToInclusive="false" />
33 35 <action
34 36 android:id="@+id/action_mainFragment2_to_inventarioFragment"
35 37 app:destination="@id/inventarioFragment"
  38 + app:enterAnim="@anim/slide_in_right"
  39 + app:exitAnim="@anim/slide_out_left"
36 40 app:popEnterAnim="@anim/slide_in_left"
37 41 app:popExitAnim="@anim/slide_out_right"
  42 + app:popUpTo="@id/mainFragment2"
  43 + app:popUpToInclusive="false" />
  44 + <action
  45 + android:id="@+id/action_mainFragment2_to_invSecFragment"
  46 + app:destination="@id/invSecFragment"
38 47 app:enterAnim="@anim/slide_in_right"
39   - app:exitAnim="@anim/slide_out_left" />
  48 + app:exitAnim="@anim/slide_out_left"
  49 + app:popEnterAnim="@anim/slide_in_left"
  50 + app:popExitAnim="@anim/slide_out_right"
  51 + app:popUpTo="@id/mainFragment2"
  52 + app:popUpToInclusive="false" />
40 53 </fragment>
41 54  
42 55 <fragment
43 56 android:id="@+id/actuaMaestrosFragment"
44 57 android:name="com.focasoftware.deboinventariov20.UI.actualizacionMaestros.ActuaMaestrosFragment"
45 58 android:label="Importaciones Varias"
46   - tools:layout="@layout/fragment_actua_maestros" >
  59 + tools:layout="@layout/fragment_actua_maestros">
47 60 <action
48   - android:id="@+id/action_actuaMaestrosFragment_to_invImportadosFragment"
49   - app:destination="@id/invImportadosFragment" />
  61 + android:id="@+id/action_actuaMaestrosFragment_to_invSecImpFragment"
  62 + app:destination="@id/invSecImpFragment"
  63 + app:popUpTo="@id/actuaMaestrosFragment"
  64 + app:popUpToInclusive="true" />
50 65 </fragment>
51 66  
52 67  
53 68 <fragment
54 69 android:id="@+id/inventarioFragment"
55 70 android:name="com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment"
56   - android:label="Inventario Dinamico"
57   - tools:layout="@layout/fragment_inventario" >
  71 + android:label="Inventario Dinámico"
  72 + tools:layout="@layout/fragment_inventario">
58 73 <action
59 74 android:id="@+id/action_inventarioFragment_to_descripcionFragment"
60 75 app:destination="@id/descripcionFragment"
61   - app:popEnterAnim="@anim/slide_in_left"
62   - app:popExitAnim="@anim/slide_out_right"
63 76 app:enterAnim="@anim/slide_in_right"
64 77 app:exitAnim="@anim/slide_out_left"
65   - />
  78 + app:popEnterAnim="@anim/slide_in_left"
  79 + app:popExitAnim="@anim/slide_out_right" />
66 80 <action
67 81 android:id="@+id/action_inventarioFragment_to_mainFragment2"
68 82 app:destination="@id/mainFragment2"
69   - app:popEnterAnim="@anim/slide_in_left"
70   - app:popExitAnim="@anim/slide_out_right"
71 83 app:enterAnim="@anim/slide_in_right"
72   - app:exitAnim="@anim/slide_out_left"/>
  84 + app:exitAnim="@anim/slide_out_left"
  85 + app:popEnterAnim="@anim/slide_in_left"
  86 + app:popExitAnim="@anim/slide_out_right" />
73 87 <action
74 88 android:id="@+id/action_inventarioFragment_to_detalleArtFragment"
75 89 app:destination="@id/detalleArtFragment" />
... ... @@ -101,20 +115,20 @@
101 115 app:destination="@id/inventarioFragment" />
102 116 </fragment>
103 117 <fragment
104   - android:id="@+id/configuracionFragment"
105   - android:name="com.focasoftware.deboinventariov20.UI.configuracion.ConfiguracionFragment"
106   - android:label="Configuraciones"
107   - tools:layout="@layout/fragment_configuracion" >
108   - <action
109   - android:id="@+id/action_configuracionFragment_to_servidoresFragment"
110   - app:destination="@id/servidoresFragment"
111   - app:popEnterAnim="@anim/slide_in_left"
112   - app:popExitAnim="@anim/slide_out_right"
113   - app:enterAnim="@anim/slide_in_right"
114   - app:exitAnim="@anim/slide_out_left" />
115   - <action
116   - android:id="@+id/action_configuracionFragment_to_mainFragment2"
117   - app:destination="@id/mainFragment2"
  118 + android:id="@+id/configuracionFragment"
  119 + android:name="com.focasoftware.deboinventariov20.UI.configuracion.ConfiguracionFragment"
  120 + android:label="Configuraciones"
  121 + tools:layout="@layout/fragment_configuracion">
  122 + <action
  123 + android:id="@+id/action_configuracionFragment_to_servidoresFragment"
  124 + app:destination="@id/servidoresFragment"
  125 + app:enterAnim="@anim/slide_in_right"
  126 + app:exitAnim="@anim/slide_out_left"
  127 + app:popEnterAnim="@anim/slide_in_left"
  128 + app:popExitAnim="@anim/slide_out_right" />
  129 + <action
  130 + android:id="@+id/action_configuracionFragment_to_mainFragment2"
  131 + app:destination="@id/mainFragment2"
118 132 app:popUpTo="@id/configuracionFragment"
119 133 app:popUpToInclusive="false" />
120 134 </fragment>
... ... @@ -139,12 +153,38 @@
139 153 app:destination="@id/inventarioFragment" />
140 154 </fragment>
141 155 <fragment
142   - android:id="@+id/invImportadosFragment"
143   - android:name="com.focasoftware.deboinventariov20.UI.actualizacionMaestros.InvImportadosFragment"
144   - android:label="Inventarios Importados"
145   - tools:layout="@layout/fragment_inv_importados">
  156 + android:id="@+id/invSecFragment"
  157 + android:name="com.focasoftware.deboinventariov20.UI.inventario.InvSecFragment"
  158 + android:label="Inventarios por Sector">
146 159 <action
147   - android:id="@+id/action_invImportadosFragment_to_mainFragment2"
148   - app:destination="@id/mainFragment2" />
  160 + android:id="@+id/action_invSecFragment_to_mainFragment2"
  161 + app:destination="@id/mainFragment2"
  162 + app:popUpTo="@id/invSecFragment"
  163 + app:popUpToInclusive="false" />
  164 + <action
  165 + android:id="@+id/action_invSecFragment_to_detalleArtSecFragment"
  166 + app:destination="@id/detalleArtSecFragment"
  167 + app:popUpTo="@id/invSecFragment"
  168 + app:popUpToInclusive="false" />
  169 + </fragment>
  170 + <fragment
  171 + android:id="@+id/detalleArtSecFragment"
  172 + android:name="com.focasoftware.deboinventariov20.UI.detalleProducto.DetalleArtSecFragment"
  173 + android:label="Detalle de Artículos">
  174 + <action
  175 + android:id="@+id/action_detalleArtSecFragment_to_invSecFragment"
  176 + app:destination="@id/invSecFragment"
  177 + app:popUpTo="@id/detalleArtSecFragment"
  178 + app:popUpToInclusive="false" />
  179 + </fragment>
  180 + <fragment
  181 + android:id="@+id/invSecImpFragment"
  182 + android:name="com.focasoftware.deboinventariov20.UI.actualizacionMaestros.InvSecImpFragment"
  183 + android:label="Inventarios por Sector">
  184 + <action
  185 + android:id="@+id/action_invSecImpFragment_to_mainFragment2"
  186 + app:destination="@id/mainFragment2"
  187 + app:popUpTo="@id/invSecImpFragment"
  188 + app:popUpToInclusive="false" />
149 189 </fragment>
150 190 </navigation>
app/src/main/res/values/dimens.xml
... ... @@ -16,6 +16,7 @@
16 16  
17 17 <!-- //Normal Size-->
18 18 <dimen name="Titulos">40sp</dimen>
  19 + <dimen name="TitulosExtra">50sp</dimen>
19 20 <dimen name="TitulosMedios">25sp</dimen>
20 21 <dimen name="SubTitulos">15sp</dimen>
21 22  
app/src/main/res/values/strings.xml
... ... @@ -22,11 +22,12 @@
22 22 <string name="inventario">Inventario</string>
23 23  
24 24 <!-- inventarios dinamicos-->
25   - <string name="invDinamicoVenta">Inventarios Dinámicos</string>
  25 + <string name="invDinamicoVenta">Inventarios Dinámicos (0) +</string>
26 26 <string name="invDinamicoCompra">Inventarios Importados(0) +</string>
27 27  
28 28 <!-- ventana emergente-->
29 29 <string name="adv">Ingrese la cantidad contada</string>
  30 + <string name="tvFechayHora">Error de fecha y hora</string>
30 31 <string name="invVentas">Inventarios Dinámicos de Ventas</string>
31 32 <string name="btnCancela">Cancelar</string>
32 33  
... ... @@ -49,7 +50,7 @@
49 50 <string name="btnValidarServidor">Validar</string>
50 51 <string name="btnAgregarServidor">Agregar un nuevo servidor</string>
51 52 <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string>
52   - <string name="tvTituloArea">Area de Invetnario</string>
  53 + <string name="tvTituloArea">Area de Inventario</string>
53 54 <string name="rbVentas">Inventarios de Ventas</string>
54 55 <string name="rbDeposito">Inventarios de Depositos</string>
55 56 <string name="tvLosProductos">Los productos no contabilizados en Inventarios</string>
... ... @@ -59,7 +60,7 @@
59 60 <string name="rbProNoInclu">Ajusta productos no incluidos en el conteo con stock en cero.</string>
60 61  
61 62 <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string>
62   - <string name="cbHabiLectura">Habilitar Lectura de codigo de barras en balanza.</string>
  63 + <string name="cbHabiLectura">Habilitar Lectura de código de barras en balanza.</string>
63 64  
64 65 <string name="tvColumMostrar">Columnas a mostrar en inventario</string>
65 66  
... ... @@ -69,8 +70,8 @@
69 70  
70 71 <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string>
71 72  
72   - <string name="cbMostrarExistencia">Existencia</string>
73   - <string name="cbMostrarPrecio">Precio</string>
  73 + <string name="btnAskTimeServer">Fecha y hora Servidor</string>
  74 + <string name="cbAskTimeServerToStart">Verificar fecha y hora al iniciar.</string>
74 75  
75 76 <string name="btnGuardar">Guardar Cambios</string>
76 77 <string name="todo"> </string>
... ... @@ -95,6 +96,9 @@
95 96 <!-- Dialog-->
96 97 <string name="sTitulo">Producto Buscado</string>
97 98 <string name="btnOk">Aceptar</string>
  99 + <string name="btnSalir">Salir</string>
  100 + <string name="btnCambiarHora">Configura aquí la fecha y hora </string>
  101 +
98 102 <string name="btnConfirmar">Confirmar</string>
99 103 <string name="btnCancelar">Cancelar</string>
100 104 <string name="sMensaje">¡No se encontro el producto ingresado!</string>
... ... @@ -207,4 +211,6 @@
207 211 "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
208 212 "when a user tries to pick up one of cards.\n\n"
209 213 </string>
  214 + <!-- TODO: Remove or change this placeholder text -->
  215 + <string name="hello_blank_fragment">Hello blank fragment</string>
210 216 </resources>
211 217 \ No newline at end of file
... ... @@ -6,7 +6,7 @@ buildscript {
6 6 jcenter()
7 7 }
8 8 dependencies {
9   - classpath "com.android.tools.build:gradle:4.0.1"
  9 + classpath 'com.android.tools.build:gradle:4.1.0'
10 10 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 11  
12 12 // NOTE: Do not place your application dependencies here; they belong
gradle/wrapper/gradle-wrapper.properties
1   -#Thu Aug 13 18:28:21 ART 2020
2   -distributionBase=GRADLE_USER_HOME
3   -distributionPath=wrapper/dists
4   -zipStoreBase=GRADLE_USER_HOME
  1 +#Fri Oct 16 18:23:55 ART 2020
5 2 zipStorePath=wrapper/dists
6   -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7   -
8   -# Enable Kapt Incremental annotation processing requeste
9   -kapt.incremental.apt=true
10   -
11   -# Enable android.databinding.annotationprocessor.ProcessDataBinding (DYNAMIC)
  3 +zipStoreBase=GRADLE_USER_HOME
  4 +kapt.verbose=true
12 5 android.databinding.incremental=true
13   -
14   -# Decrease gradle builds time
15   -kapt.use.worker.api=true
16   -
17   -# turn off AP discovery in compile path, and therefore turn on Compile Avoidance
  6 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
18 7 kapt.include.compile.classpath=false
19   -
20   -# Enable In Logcat to determine Kapt
21   -kapt.verbose=true
22 8 \ No newline at end of file
  9 +distributionPath=wrapper/dists
  10 +kapt.use.worker.api=true
  11 +kapt.incremental.apt=true
  12 +distributionBase=GRADLE_USER_HOME