Commit ea89488e5416d3507b0a2c95931d92b05604f0b4
1 parent
df4a49f76c
Exists in
master
17092020 1500
Showing
23 changed files
with
980 additions
and
309 deletions
Show diff stats
.idea/codeStyles/Project.xml
1 | 1 | <component name="ProjectCodeStyleConfiguration"> |
2 | 2 | <code_scheme name="Project" version="173"> |
3 | - <DBN-PSQL> | |
4 | - <case-options enabled="true"> | |
5 | - <option name="KEYWORD_CASE" value="lower" /> | |
6 | - <option name="FUNCTION_CASE" value="lower" /> | |
7 | - <option name="PARAMETER_CASE" value="lower" /> | |
8 | - <option name="DATATYPE_CASE" value="lower" /> | |
9 | - <option name="OBJECT_CASE" value="preserve" /> | |
10 | - </case-options> | |
11 | - <formatting-settings enabled="false" /> | |
12 | - </DBN-PSQL> | |
13 | - <DBN-SQL> | |
14 | - <case-options enabled="true"> | |
15 | - <option name="KEYWORD_CASE" value="lower" /> | |
16 | - <option name="FUNCTION_CASE" value="lower" /> | |
17 | - <option name="PARAMETER_CASE" value="lower" /> | |
18 | - <option name="DATATYPE_CASE" value="lower" /> | |
19 | - <option name="OBJECT_CASE" value="preserve" /> | |
20 | - </case-options> | |
21 | - <formatting-settings enabled="false"> | |
22 | - <option name="STATEMENT_SPACING" value="one_line" /> | |
23 | - <option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" /> | |
24 | - <option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" /> | |
25 | - </formatting-settings> | |
26 | - </DBN-SQL> | |
27 | 3 | <JetCodeStyleSettings> |
28 | 4 | <option name="PACKAGES_TO_USE_STAR_IMPORTS"> |
29 | 5 | <value> |
... | ... | @@ -41,7 +17,6 @@ |
41 | 17 | <package name="" alias="true" withSubpackages="true" /> |
42 | 18 | </value> |
43 | 19 | </option> |
44 | - <option name="IF_RPAREN_ON_NEW_LINE" value="false" /> | |
45 | 20 | <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> |
46 | 21 | </JetCodeStyleSettings> |
47 | 22 | <codeStyleSettings language="XML"> |
... | ... | @@ -158,14 +133,6 @@ |
158 | 133 | </codeStyleSettings> |
159 | 134 | <codeStyleSettings language="kotlin"> |
160 | 135 | <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> |
161 | - <option name="RIGHT_MARGIN" value="200" /> | |
162 | - <option name="KEEP_LINE_BREAKS" value="false" /> | |
163 | - <option name="ALIGN_MULTILINE_PARAMETERS" value="false" /> | |
164 | - <option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="false" /> | |
165 | - <option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="false" /> | |
166 | - <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="false" /> | |
167 | - <option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="false" /> | |
168 | - <option name="WRAP_ON_TYPING" value="1" /> | |
169 | 136 | </codeStyleSettings> |
170 | 137 | </code_scheme> |
171 | 138 | </component> |
172 | 139 | \ No newline at end of file |
.idea/codeStyles/codeStyleConfig.xml
app/src/main/java/com/focasoftware/deboinventariov20/DB/DAO/ArticulosDAO.kt
... | ... | @@ -20,22 +20,22 @@ interface ArticulosDAO { |
20 | 20 | @Insert(onConflict = OnConflictStrategy.REPLACE) |
21 | 21 | suspend fun insertArticulos(articulos: Articles?) |
22 | 22 | |
23 | - @Query("SELECT * FROM $TABLA_ART ORDER BY DES DESC") | |
23 | + @Query("SELECT * FROM $TABLA_ART ORDER BY DETART DESC") | |
24 | 24 | suspend fun findAllArticulos(): List<Articles> |
25 | 25 | |
26 | - @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND DES LIKE '%' || :description || '%' GROUP BY DES ORDER BY DES") | |
27 | - suspend fun findArticuloByDesc(description: String?, dep: Int): List<Articles> | |
26 | + @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND DETART LIKE '%' || :description || '%' GROUP BY DETART ORDER BY DETART") | |
27 | + suspend fun findArticuloByDesc(description: String?, dep: Boolean): List<Articles> | |
28 | 28 | |
29 | - @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND CB LIKE :codBarra") | |
30 | - suspend fun findArticuloByCodBar(codBarra: String?, dep: Int): Articles? | |
29 | + @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND TRIM(CODBAR) = :codBarra") | |
30 | + suspend fun findArticuloByCodBar(codBarra: String, dep: Boolean): Articles | |
31 | 31 | |
32 | - @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND CBC LIKE :CodOrigen") | |
33 | - suspend fun findArticuloByCodOri(CodOrigen: String?, dep: Int): Articles? | |
32 | + @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND TRIM(COO) LIKE :CodOrigen") | |
33 | + suspend fun findArticuloByCodOri(CodOrigen: String?, dep: Boolean): List<Articles> | |
34 | 34 | |
35 | 35 | @Query("DELETE FROM $TABLA_ART") |
36 | 36 | suspend fun deleteAllArticulos() |
37 | 37 | |
38 | - @Query("SELECT * FROM $TABLA_ART WHERE SEC=:sector AND COD=:codigo") | |
38 | + @Query("SELECT * FROM $TABLA_ART WHERE CODSEC=:sector AND CODART=:codigo") | |
39 | 39 | suspend fun fetchArticuloByCodSec(sector: String?, codigo: String?): Articles? |
40 | 40 | } |
41 | 41 | |
... | ... | @@ -56,6 +56,9 @@ interface InvHeadDAO { |
56 | 56 | @Query("SELECT * FROM $TABLA_INV_H ORDER BY INV_FEI") |
57 | 57 | suspend fun fetchAllInvHead(): List<InvHead> |
58 | 58 | |
59 | + @Query("SELECT INV_LUG FROM $TABLA_INV_H WHERE INV_NUM=:inven") | |
60 | + suspend fun fetchAreaInvH (inven: Int): Boolean | |
61 | + | |
59 | 62 | @Query("SELECT INV_PRODCONT FROM $TABLA_INV_H WHERE INV_NUM=:inven") |
60 | 63 | suspend fun consultaCantidadInvH (inven: Int): Int |
61 | 64 |
app/src/main/java/com/focasoftware/deboinventariov20/Model/ProductosApi.kt
app/src/main/java/com/focasoftware/deboinventariov20/Model/Tablas.kt
... | ... | @@ -10,40 +10,69 @@ import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_S |
10 | 10 | import com.google.gson.annotations.SerializedName |
11 | 11 | import java.io.Serializable |
12 | 12 | |
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 | - | |
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 | +//@Entity(tableName = TABLA_ART) | |
40 | +//data class Articles(@ColumnInfo(name = "SEC") var sector: String?, | |
41 | +// @ColumnInfo(name = "COD") var codigo: String?, | |
42 | +// @ColumnInfo(name = "DES") var descripcion: String?, | |
43 | +// @ColumnInfo(name = "CB") var codBar: String?, | |
44 | +// @ColumnInfo(name = "CBC") var codOrigen: String?, | |
45 | +// @ColumnInfo(name = "PRE_VTA") var precio: String?, | |
46 | +// @ColumnInfo(name = "PRE_COS") var costo: String?, | |
47 | +// @ColumnInfo(name = "EV") var exiVenta: String?, | |
48 | +// @ColumnInfo(name = "ED") var exiDeposito: String?, | |
49 | +// @ColumnInfo(name = "DE") var de: String?, | |
50 | +// @ColumnInfo(name = "BAL") var balanza: Int?, | |
51 | +// @ColumnInfo(name = "DEPSN") var depSn: Int?, | |
52 | +// @ColumnInfo(name = "FOTO") var imagen: String?) : Serializable { | |
53 | +// @PrimaryKey(autoGenerate = true) | |
54 | +// @ColumnInfo(name = "id") | |
55 | +// var id: Long = 0 | |
56 | +//} | |
27 | 57 | @Entity(tableName = TABLA_ART) |
28 | -data class Articles(@ColumnInfo(name = "SEC") var sector: String?, | |
29 | - @ColumnInfo(name = "COD") var codigo: String?, | |
30 | - @ColumnInfo(name = "DES") var descripcion: String?, | |
31 | - @ColumnInfo(name = "CB") var codBar: String?, | |
32 | - @ColumnInfo(name = "CBC") var codOrigen: String?, | |
33 | - @ColumnInfo(name = "PRE_VTA") var precio: String?, | |
34 | - @ColumnInfo(name = "PRE_COS") var costo: String?, | |
35 | - @ColumnInfo(name = "EV") var exiVenta: String?, | |
36 | - @ColumnInfo(name = "ED") var exiDeposito: String?, | |
37 | - @ColumnInfo(name = "DE") var de: String?, | |
38 | - @ColumnInfo(name = "BAL") var balanza: Int?, | |
39 | - @ColumnInfo(name = "DEPSN") var depSn: Int?, | |
40 | - @ColumnInfo(name = "FOTO") var imagen: String?) : Serializable { | |
58 | +data class Articles(@ColumnInfo(name = "CODSEC") var sector: String?, | |
59 | + @ColumnInfo(name = "CODART") var codigo: String?, | |
60 | + @ColumnInfo(name = "DETART") var descripcion: String?, | |
61 | + @ColumnInfo(name = "CODBAR") var codBar: String?, | |
62 | + @ColumnInfo(name = "COO") var codOrigen: String?, | |
63 | + @ColumnInfo(name = "PREVEN") var precio: String?, | |
64 | + @ColumnInfo(name = "COSTO") var costo: String?, | |
65 | + @ColumnInfo(name = "EXIVTA") var exiVenta: String?, | |
66 | + @ColumnInfo(name = "EXIDEP") var exiDeposito: String?, | |
67 | + @ColumnInfo(name = "DVE") var de: String?, | |
68 | + @ColumnInfo(name = "UNIVEN") var balanza: Int?, | |
69 | + @ColumnInfo(name = "DEPSN") var depSn: Boolean?, | |
70 | + @ColumnInfo(name = "FOTO") var imagen: String?) : Serializable { | |
41 | 71 | @PrimaryKey(autoGenerate = true) |
42 | 72 | @ColumnInfo(name = "id") |
43 | 73 | var id: Long = 0 |
44 | 74 | } |
45 | 75 | |
46 | - | |
47 | 76 | @Entity(tableName = TABLA_INV_H) |
48 | 77 | data class InvHead(@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "INV_NUM") var invNum: Int, |
49 | 78 | @ColumnInfo(name = "INV_DESC") var descripcion: String?, |
... | ... | @@ -52,7 +81,7 @@ data class InvHead(@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "INV_NUM" |
52 | 81 | @ColumnInfo(name = "INV_FEF") var fechaFinal: String?, |
53 | 82 | // productos contados en el inventario |
54 | 83 | @ColumnInfo(name = "INV_PRODCONT") var prodContados: Long?, |
55 | - @ColumnInfo(name = "INV_LUG") var lugar: Int?, | |
84 | + @ColumnInfo(name = "INV_LUG") var lugar: Boolean?, | |
56 | 85 | // Solo se ajustan los productos incluidos en el conteo=0 |
57 | 86 | // Ajusta productos no incluidos en el conteo con stock en cero=1 |
58 | 87 | @ColumnInfo(name = "PRO_NO_CONTA") var stDesc: Int?, |
... | ... | @@ -62,18 +91,18 @@ data class InvHead(@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "INV_NUM" |
62 | 91 | |
63 | 92 | @Entity(tableName = TABLA_INV_B) |
64 | 93 | data class InvBody(@ColumnInfo(name = "INV_NUM") var invNum: Int, |
65 | - @ColumnInfo(name = "SEC") var sector: String?, | |
66 | - @ColumnInfo(name = "COD") var codigo: String?, | |
67 | - @ColumnInfo(name = "DES") var descripcion: String?, | |
68 | - @ColumnInfo(name = "CANT") var cantTomada: String?, | |
69 | - @ColumnInfo(name = "CB") var codBar: String?, | |
70 | - @ColumnInfo(name = "CBC") var codOrigen: String?, | |
71 | - @ColumnInfo(name = "PRE_VTA") var precio: String?, | |
72 | - @ColumnInfo(name = "PRE_COS") var costo: String?, | |
73 | - @ColumnInfo(name = "BAL") var balanza: Int?, | |
74 | - @ColumnInfo(name = "DSN") var depSn: Int?, | |
75 | - @ColumnInfo(name = "INV_FEI") var fechaInicio: String?, | |
76 | - @ColumnInfo(name = "INV_FEF") var fechaFinal: String?) : Serializable { | |
94 | + @ColumnInfo(name = "SEC") var sector: String?, | |
95 | + @ColumnInfo(name = "COD") var codigo: String?, | |
96 | + @ColumnInfo(name = "DES") var descripcion: String?, | |
97 | + @ColumnInfo(name = "CANT") var cantTomada: String?, | |
98 | + @ColumnInfo(name = "CB") var codBar: String?, | |
99 | + @ColumnInfo(name = "CBC") var codOrigen: String?, | |
100 | + @ColumnInfo(name = "PRE_VTA") var precio: String?, | |
101 | + @ColumnInfo(name = "PRE_COS") var costo: String?, | |
102 | + @ColumnInfo(name = "BAL") var balanza: Int?, | |
103 | + @ColumnInfo(name = "DSN") var depSn: Boolean?, | |
104 | + @ColumnInfo(name = "INV_FEI") var fechaInicio: String?, | |
105 | + @ColumnInfo(name = "INV_FEF") var fechaFinal: String?) : Serializable { | |
77 | 106 | @PrimaryKey(autoGenerate = true) |
78 | 107 | @ColumnInfo(name = "id") |
79 | 108 | var id: Long = 0 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/ActuaMaestrosFragment.kt
... | ... | @@ -15,6 +15,7 @@ import kotlinx.android.synthetic.main.fragment_actua_maestros.* |
15 | 15 | import kotlinx.coroutines.* |
16 | 16 | import kotlinx.coroutines.Dispatchers.IO |
17 | 17 | import kotlinx.coroutines.Dispatchers.Main |
18 | +import java.util.ArrayList | |
18 | 19 | |
19 | 20 | var BASE_URL = "" |
20 | 21 | |
... | ... | @@ -54,18 +55,18 @@ class ActuaMaestrosFragment : Fragment() { |
54 | 55 | return v |
55 | 56 | } |
56 | 57 | |
57 | - | |
58 | 58 | private suspend fun obtenerArticulos() { |
59 | 59 | |
60 | 60 | val productosService = ProductosService.getProductosService() |
61 | 61 | var index: Long = 1 |
62 | 62 | withContext(IO) { |
63 | - val job = CoroutineScope(Dispatchers.IO).launch { | |
63 | + val job = CoroutineScope(IO).launch { | |
64 | 64 | // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO |
65 | 65 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.deleteAllArticulos() |
66 | 66 | |
67 | 67 | val response = productosService.getProductos() |
68 | 68 | if (response.isSuccessful) { |
69 | + | |
69 | 70 | for (pro in response.body()!!) { |
70 | 71 | val artiAcargar = Articles(pro.sector, |
71 | 72 | pro.codigo, |
... | ... | @@ -88,6 +89,12 @@ class ActuaMaestrosFragment : Fragment() { |
88 | 89 | countriesList.text = "¡Datos Importados Correctamente!" |
89 | 90 | loading_view.visibility = View.GONE |
90 | 91 | } |
92 | + }else{ | |
93 | + withContext(Main) { | |
94 | + countriesList.visibility = View.VISIBLE | |
95 | + countriesList.text = "¡Error!" | |
96 | + loading_view.visibility = View.GONE | |
97 | + } | |
91 | 98 | } |
92 | 99 | } |
93 | 100 | if (job == null) { |
... | ... | @@ -99,6 +106,7 @@ class ActuaMaestrosFragment : Fragment() { |
99 | 106 | } |
100 | 107 | } |
101 | 108 | |
109 | + | |
102 | 110 | // withContext(Dispatchers.Main) { |
103 | 111 | // if (response.isSuccessful) { |
104 | 112 | // val call = WebService |
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripCorigenFragment/CodigoOriFragment.kt
... | ... | @@ -0,0 +1,274 @@ |
1 | +package com.focasoftware.deboinventariov20.UI.descripCorigenFragment | |
2 | + | |
3 | +import android.app.AlertDialog | |
4 | +import android.content.Context | |
5 | +import android.content.SharedPreferences | |
6 | +import android.graphics.Canvas | |
7 | +import android.graphics.Color | |
8 | +import android.graphics.drawable.ColorDrawable | |
9 | +import android.os.Bundle | |
10 | +import android.text.InputType | |
11 | +import androidx.fragment.app.Fragment | |
12 | +import android.view.LayoutInflater | |
13 | +import android.view.View | |
14 | +import android.view.ViewGroup | |
15 | +import android.view.WindowManager | |
16 | +import android.view.inputmethod.InputMethodManager | |
17 | +import androidx.fragment.app.FragmentActivity | |
18 | +import androidx.lifecycle.lifecycleScope | |
19 | +import androidx.navigation.NavController | |
20 | +import androidx.navigation.Navigation | |
21 | +import androidx.recyclerview.widget.ItemTouchHelper | |
22 | +import androidx.recyclerview.widget.LinearLayoutManager | |
23 | +import androidx.recyclerview.widget.RecyclerView | |
24 | +import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | |
25 | +import com.focasoftware.deboinventariov20.Model.Articles | |
26 | +import com.focasoftware.deboinventariov20.Model.InvBody | |
27 | +import com.focasoftware.deboinventariov20.R | |
28 | +import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera | |
29 | +import com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment | |
30 | +import kotlinx.android.synthetic.main.ingresar_cantidad.view.* | |
31 | +import kotlinx.android.synthetic.main.ingresar_cantidad.view.btnAceptar | |
32 | +import kotlinx.android.synthetic.main.login_dialog.view.* | |
33 | +import kotlinx.coroutines.* | |
34 | + | |
35 | +// | |
36 | +class CodigoOriFragment : Fragment() { | |
37 | + | |
38 | + private lateinit var artAcargar2: List<Articles> | |
39 | + private var listArticulos: List<Articles>? = null | |
40 | + lateinit var viewAdapter2: RecyclerView.Adapter<*> | |
41 | + private lateinit var viewManager2: RecyclerView.LayoutManager | |
42 | + private lateinit var rcCodigoOri: RecyclerView | |
43 | + private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW) | |
44 | + private var cantidad = 0F | |
45 | + private var numeroInventario = 0 | |
46 | + lateinit var navController: NavController | |
47 | + lateinit var sharedPreferences: SharedPreferences | |
48 | + private var artCargadoEnBD: InvBody? = null | |
49 | + | |
50 | + override fun onCreate(savedInstanceState: Bundle?) { | |
51 | + super.onCreate(savedInstanceState) | |
52 | + | |
53 | + sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | |
54 | + arguments.apply { | |
55 | + artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles> | |
56 | + numeroInventario = requireArguments().getInt("numeroInv") | |
57 | + } | |
58 | + | |
59 | + } | |
60 | + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
61 | + super.onViewCreated(view, savedInstanceState) | |
62 | + navController = Navigation.findNavController(view) | |
63 | + showSoftKeyboard(view) | |
64 | + } | |
65 | + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | |
66 | + val v = inflater.inflate(R.layout.fragment_codigo_ori, container, false) | |
67 | + rcCodigoOri = v.findViewById(R.id.rcCodigoOri) | |
68 | + | |
69 | + IngresarRecicler(artAcargar2) | |
70 | + showSoftKeyboard(v) | |
71 | +// btnSalir.setOnClickListener { | |
72 | +// activity?.onBackPressed(); | |
73 | +//// VolverAinventario() | |
74 | +// } | |
75 | + return v | |
76 | + } | |
77 | + | |
78 | + private fun showSoftKeyboard(view: View) { | |
79 | + if (view.requestFocus()) { | |
80 | + val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | |
81 | + imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY) | |
82 | + } | |
83 | + } | |
84 | + | |
85 | + fun IngresarRecicler(articulos: List<Articles>) { | |
86 | + | |
87 | + viewAdapter2 = CodigoOrigenAdapter(requireContext(),articulos) | |
88 | + viewManager2 = LinearLayoutManager(requireContext()) | |
89 | + | |
90 | + rcCodigoOri.apply { | |
91 | + adapter = viewAdapter2 | |
92 | + layoutManager = viewManager2 | |
93 | + } | |
94 | + val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { | |
95 | + override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | |
96 | + return false | |
97 | + } | |
98 | + | |
99 | + override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { | |
100 | + | |
101 | + GlobalScope.launch(Dispatchers.Main) { | |
102 | + //TODO BUSCO EN BASE DE DATOS | |
103 | + artCargadoEnBD = buscarCodigoDeboEnBD((viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)?.sector.toString(), | |
104 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)?.codigo.toString(), | |
105 | + numeroInventario.toString()) | |
106 | + if (artCargadoEnBD == null) { | |
107 | + val mDialogView = LayoutInflater.from(context).inflate(R.layout.ingresar_cantidad, null) | |
108 | + val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) | |
109 | + //TODO: DEPENDIENDO DEL TIPO DE ARTICULO PERMITER INGRESAR DECIMALES O NO | |
110 | + if ((viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza==1 || (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza==3 || (viewAdapter2 as CodigoOrigenAdapter).items2?.get( | |
111 | + viewHolder.layoutPosition)!!.balanza==7) | |
112 | + mDialogView.etCantidad.inputType= InputType.TYPE_CLASS_NUMBER | |
113 | + | |
114 | + mDialogView.tvTitulo.text = "${(viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion}" | |
115 | + val mAlertDialog = mBuilder.show() | |
116 | + mDialogView.etCantidad.requestFocus() | |
117 | + mAlertDialog.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | |
118 | + mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | |
119 | + mDialogView.btnAceptar.setOnClickListener { | |
120 | + if (mDialogView.etCantidad.text.isNullOrEmpty()) { | |
121 | + mDialogView.etCantidad.error = "No vacio" | |
122 | + mDialogView.etCantidad.requestFocus() | |
123 | + mDialogView.etCantidad.hint = "Ingrese un valor" | |
124 | + } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { | |
125 | + cantidad = mDialogView.etCantidad.text.toString().toFloat() | |
126 | + val body = InvBody(numeroInventario, | |
127 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.sector, | |
128 | + // TODO: PREPARO PARA MANDAR A CARGAR EN LA BD | |
129 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo, | |
130 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion, | |
131 | + cantidad.toString(), | |
132 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codBar, | |
133 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codOrigen, | |
134 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | |
135 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | |
136 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza, | |
137 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.depSn, | |
138 | + InventarioFragment().ObtenerFechaActual(), | |
139 | + InventarioFragment().ObtenerFechaActual()) | |
140 | + InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS | |
141 | + modificarCantidadEnCabecera(numeroInventario, true, requireActivity()) | |
142 | +// VolverAinventario() | |
143 | + activity?.onBackPressed() | |
144 | + mAlertDialog.dismiss() | |
145 | + } | |
146 | + } | |
147 | + } else if (artCargadoEnBD != null) { | |
148 | + | |
149 | + val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | |
150 | + val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setTitle("Producto '${artCargadoEnBD!!.descripcion}', se encuentra cargado.").setCancelable(false) | |
151 | + if (artCargadoEnBD!!.balanza.toString().contains("1") || artCargadoEnBD!!.balanza.toString().contains("3") || artCargadoEnBD!!.balanza.toString().contains("7")) mDialogView.tvNuevaCantidad.inputType= InputType.TYPE_CLASS_NUMBER | |
152 | + mDialogView.tvCantInicial.text =String.format("%.2f", artCargadoEnBD!!.cantTomada.toString().toFloat()) | |
153 | + | |
154 | + val mAlertDialog = mBuilder.show() | |
155 | + mDialogView.tvNuevaCantidad.requestFocus() | |
156 | + | |
157 | + | |
158 | + mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | |
159 | + mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | |
160 | + | |
161 | + mDialogView.rbSumar.setOnClickListener { | |
162 | + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | |
163 | + mDialogView.tvResultado.text = String.format("%.2f", (mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat())) | |
164 | + mDialogView.tvNuevaCantidad.isEnabled=false | |
165 | + } | |
166 | + } | |
167 | + mDialogView.rbRestar.setOnClickListener { | |
168 | + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | |
169 | + if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | |
170 | + mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) | |
171 | + mDialogView.tvNuevaCantidad.isEnabled = false | |
172 | + }else{ | |
173 | + mDialogView.tvResultado.text="" | |
174 | + mDialogView.tvResultado.error = "Operación No Valida" | |
175 | + mDialogView.tvResultado.requestFocus() | |
176 | + mDialogView.tvResultado.hint = "Error" | |
177 | + } | |
178 | + } | |
179 | + } | |
180 | + mDialogView.rbMdodificar.setOnClickListener { | |
181 | + if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | |
182 | + mDialogView.tvResultado.text = String.format("%.2f", (mDialogView.tvNuevaCantidad.text.toString().toFloat())) | |
183 | + mDialogView.tvNuevaCantidad.isEnabled = false | |
184 | + } | |
185 | + } | |
186 | + mDialogView.btnAceptar.setOnClickListener { | |
187 | + if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { | |
188 | + if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { | |
189 | + | |
190 | + updateCantidad((viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.sector.toString(), | |
191 | + (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo.toString(), | |
192 | + mDialogView.tvResultado.text.toString().toFloat()) | |
193 | +// VolverAinventario() | |
194 | + activity?.onBackPressed(); | |
195 | + mAlertDialog.dismiss() | |
196 | + } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | |
197 | + mDialogView.tvResultado.error = "Operación Requerida" | |
198 | + mDialogView.tvResultado.requestFocus() | |
199 | + mDialogView.tvResultado.hint = "Seleccione Operación" | |
200 | + } | |
201 | + } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | |
202 | + mDialogView.tvNuevaCantidad.error = "Completar" | |
203 | + mDialogView.tvNuevaCantidad.requestFocus() | |
204 | + mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" | |
205 | + } | |
206 | + } | |
207 | + mDialogView.dialogCancelBtn.setOnClickListener { | |
208 | + activity?.onBackPressed(); | |
209 | + mAlertDialog.dismiss() | |
210 | + } | |
211 | + } | |
212 | + } | |
213 | + } | |
214 | + | |
215 | + override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | |
216 | + super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | |
217 | + val itemView = viewHolder.itemView | |
218 | + | |
219 | + c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | |
220 | + | |
221 | + if (dX > 0) { | |
222 | + | |
223 | + c.drawColor(Color.RED) | |
224 | + } else if (dX < 0) { | |
225 | + // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom) | |
226 | + c.drawColor(Color.YELLOW) | |
227 | + } | |
228 | + swipeBackground.draw(c) | |
229 | + super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | |
230 | + } | |
231 | + } | |
232 | + val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback) | |
233 | + itemTouchHelper2.attachToRecyclerView(rcCodigoOri) | |
234 | + | |
235 | + } | |
236 | + | |
237 | + fun InsertarArtEnDB(cuarpoInventario: InvBody) { | |
238 | + lifecycleScope.launch { | |
239 | + withContext(Dispatchers.IO) { | |
240 | + AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | |
241 | + } | |
242 | + } | |
243 | + } | |
244 | + | |
245 | +// fun VolverAinventario() { | |
246 | +// | |
247 | +// val editor = sharedPreferences.edit() | |
248 | +// editor?.putString("Inventario", numeroInventario.toString()) | |
249 | +// editor?.apply() | |
250 | +// editor.commit() | |
251 | +// navController.navigate(R.id.action_descripcionFragment_to_inventarioFragment) | |
252 | +// } | |
253 | + | |
254 | + suspend fun buscarCodigoDeboEnBD(sector: String, codigo: String, numInventario: String): InvBody? { | |
255 | + //TODO BUSQUEDA POR CODIGO DE BARRAS | |
256 | + var busqueda: InvBody? = null | |
257 | + return GlobalScope.async(Dispatchers.IO) { | |
258 | + busqueda = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.fetchArtInInvBody(sector, codigo, numInventario) | |
259 | + return@async busqueda | |
260 | + }.await() | |
261 | + } | |
262 | + | |
263 | + fun updateCantidad(sector: String, codigo: String, cantidad: Float) { | |
264 | + lifecycleScope.launch { | |
265 | + withContext(Dispatchers.IO) { | |
266 | + val activity: FragmentActivity? = activity | |
267 | + if (activity != null && isAdded) { | |
268 | + AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector, codigo) | |
269 | + } | |
270 | + } | |
271 | + } | |
272 | + } | |
273 | + | |
274 | +} | |
0 | 275 | \ No newline at end of file |
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripCorigenFragment/CodigoOrigenAdapter.kt
... | ... | @@ -0,0 +1,55 @@ |
1 | +package com.focasoftware.deboinventariov20.UI.descripCorigenFragment | |
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.Articles | |
9 | +import com.focasoftware.deboinventariov20.Model.InvHead | |
10 | +import com.focasoftware.deboinventariov20.R | |
11 | +import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder | |
12 | +import com.focasoftware.deboinventariov20.UI.descripcionFragment.DescripcionListAdapter | |
13 | +import kotlinx.android.synthetic.main.item.view.* | |
14 | +import kotlinx.android.synthetic.main.item.view.tvCodigo | |
15 | +import kotlinx.android.synthetic.main.item.view.tvCodigoOrigen | |
16 | +import kotlinx.android.synthetic.main.item.view.tvDescripcion | |
17 | +import kotlinx.android.synthetic.main.item.view.tvSector | |
18 | +import kotlinx.android.synthetic.main.item_codigo_origen.view.* | |
19 | + | |
20 | +class CodigoOrigenAdapter(private val cnxt: Context, private val corigen: List<Articles>) : | |
21 | + RecyclerView.Adapter<CodigoOrigenAdapter.ItemsViewHolder>() { | |
22 | + internal var items2: List<Articles>? = null | |
23 | + | |
24 | + init { | |
25 | + this.items2 = corigen | |
26 | + } | |
27 | + | |
28 | + override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder( | |
29 | + LayoutInflater.from(cnxt).inflate(R.layout.item_codigo_origen, parent, false)) | |
30 | + | |
31 | + override fun getItemCount() = corigen.size | |
32 | + | |
33 | + override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) { | |
34 | + when (holder) { | |
35 | + is ItemsViewHolder -> { | |
36 | + holder.bind(items2!![position]) | |
37 | + } | |
38 | + } | |
39 | + } | |
40 | + | |
41 | + class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { | |
42 | + | |
43 | + val sector = view.tvSector | |
44 | + val codigo = view.tvCodigo | |
45 | + val descripcion = view.tvDescripcion | |
46 | + val CodigoOrigen = view.tvCodigoOrigen | |
47 | + | |
48 | + fun bind(pro: Articles) { | |
49 | + sector.text = pro.sector | |
50 | + codigo.text = pro.codigo | |
51 | + descripcion.text = pro.descripcion | |
52 | + CodigoOrigen.text = pro.codOrigen | |
53 | + } | |
54 | + } | |
55 | +} | |
0 | 56 | \ No newline at end of file |
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripCorigenFragment/ItemCodigoOrigen.kt
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripcionFragment/DescripcionFragment.kt
1 | 1 | package com.focasoftware.deboinventariov20.UI.descripcionFragment |
2 | 2 | |
3 | -import android.app.Activity | |
4 | 3 | import android.app.AlertDialog |
5 | 4 | import android.content.Context |
6 | 5 | import android.content.SharedPreferences |
... | ... | @@ -14,7 +13,6 @@ import android.view.View |
14 | 13 | import android.view.ViewGroup |
15 | 14 | import android.view.WindowManager |
16 | 15 | import android.view.inputmethod.InputMethodManager |
17 | -import androidx.core.content.ContextCompat.getSystemService | |
18 | 16 | import androidx.fragment.app.Fragment |
19 | 17 | import androidx.fragment.app.FragmentActivity |
20 | 18 | import androidx.lifecycle.lifecycleScope |
... | ... | @@ -46,7 +44,6 @@ class DescripcionFragment : Fragment() { |
46 | 44 | private var numeroInventario = 0 |
47 | 45 | lateinit var navController: NavController |
48 | 46 | lateinit var sharedPreferences: SharedPreferences |
49 | - private var indice = 0 | |
50 | 47 | private var artCargadoEnBD: InvBody? = null |
51 | 48 | |
52 | 49 | override fun onCreate(savedInstanceState: Bundle?) { |
... | ... | @@ -58,18 +55,11 @@ class DescripcionFragment : Fragment() { |
58 | 55 | } |
59 | 56 | |
60 | 57 | } |
61 | - private fun showSoftKeyboard(view: View) { | |
62 | - if (view.requestFocus()) { | |
63 | - val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | |
64 | - imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY) | |
65 | - } | |
66 | - } | |
67 | 58 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
68 | 59 | super.onViewCreated(view, savedInstanceState) |
69 | 60 | navController = Navigation.findNavController(view) |
70 | 61 | showSoftKeyboard(view) |
71 | 62 | } |
72 | - | |
73 | 63 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
74 | 64 | val v = inflater.inflate(R.layout.fragment_descripcion, container, false) |
75 | 65 | rcDescripcion = v.findViewById(R.id.rcDescripcion) |
... | ... | @@ -85,6 +75,13 @@ class DescripcionFragment : Fragment() { |
85 | 75 | return v |
86 | 76 | } |
87 | 77 | |
78 | + private fun showSoftKeyboard(view: View) { | |
79 | + if (view.requestFocus()) { | |
80 | + val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | |
81 | + imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY) | |
82 | + } | |
83 | + } | |
84 | + | |
88 | 85 | fun IngresarRecicler(articulos: List<Articles>?) { |
89 | 86 | |
90 | 87 | viewAdapter2 = DescripcionListAdapter(articulos) |
... | ... | @@ -101,23 +98,20 @@ class DescripcionFragment : Fragment() { |
101 | 98 | |
102 | 99 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { |
103 | 100 | |
104 | - var indice = 0 | |
105 | - indice = viewHolder.layoutPosition | |
106 | 101 | GlobalScope.launch(Dispatchers.Main) { |
107 | 102 | //TODO BUSCO EN BASE DE DATOS |
108 | - artCargadoEnBD = buscarCodigoDeboEnBD((viewAdapter2 as DescripcionListAdapter).items2?.get(indice)?.sector.toString(), | |
109 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)?.codigo.toString(), | |
110 | - numeroInventario.toString()) | |
103 | + artCargadoEnBD = buscarCodigoDeboEnBD((viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.sector.toString(), | |
104 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.codigo.toString(), numeroInventario.toString()) | |
111 | 105 | if (artCargadoEnBD == null) { |
112 | 106 | val mDialogView = LayoutInflater.from(context).inflate(R.layout.ingresar_cantidad, null) |
113 | 107 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) |
114 | 108 | //TODO: DEPENDIENDO DEL TIPO DE ARTICULO PERMITER INGRESAR DECIMALES O NO |
115 | - if ((viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.balanza==1 || (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.balanza==3 || (viewAdapter2 as DescripcionListAdapter).items2?.get( | |
116 | - indice)!!.balanza==7) | |
109 | + if ((viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza==1 || (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza==3 || (viewAdapter2 as DescripcionListAdapter).items2?.get( | |
110 | + viewHolder.layoutPosition)!!.balanza==7) | |
117 | 111 | mDialogView.etCantidad.inputType= InputType.TYPE_CLASS_NUMBER |
118 | 112 | |
119 | 113 | |
120 | - mDialogView.tvTitulo.text = "${(viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.descripcion}" | |
114 | + mDialogView.tvTitulo.text = "${(viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion}" | |
121 | 115 | val mAlertDialog = mBuilder.show() |
122 | 116 | mDialogView.etCantidad.requestFocus() |
123 | 117 | mAlertDialog.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
... | ... | @@ -128,19 +122,19 @@ class DescripcionFragment : Fragment() { |
128 | 122 | mDialogView.etCantidad.requestFocus() |
129 | 123 | mDialogView.etCantidad.hint = "Ingrese un valor" |
130 | 124 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { |
131 | - cantidad = mDialogView.etCantidad.text.toString().toFloat() | |
125 | + cantidad =String.format("%.2f", mDialogView.etCantidad.text.toString().toFloat()).toFloat() | |
132 | 126 | val body = InvBody(numeroInventario, |
133 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.sector, | |
127 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector, | |
134 | 128 | // TODO: PREPARO PARA MANDAR A CARGAR EN LA BD |
135 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codigo, | |
136 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.descripcion, | |
129 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo, | |
130 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion, | |
137 | 131 | cantidad.toString(), |
138 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codBar, | |
139 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codOrigen, | |
140 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.precio, | |
141 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.precio, | |
142 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.balanza, | |
143 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.depSn, | |
132 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codBar, | |
133 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codOrigen, | |
134 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | |
135 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | |
136 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza, | |
137 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.depSn, | |
144 | 138 | InventarioFragment().ObtenerFechaActual(), |
145 | 139 | InventarioFragment().ObtenerFechaActual()) |
146 | 140 | InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS |
... | ... | @@ -193,8 +187,8 @@ class DescripcionFragment : Fragment() { |
193 | 187 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { |
194 | 188 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { |
195 | 189 | |
196 | - updateCantidad((viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.sector.toString(), | |
197 | - (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codigo.toString(), | |
190 | + updateCantidad((viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector.toString(), | |
191 | + (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo.toString(), | |
198 | 192 | mDialogView.tvResultado.text.toString().toFloat()) |
199 | 193 | // VolverAinventario() |
200 | 194 | activity?.onBackPressed(); |
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripcionFragment/DescripcionListAdapter.kt
... | ... | @@ -17,8 +17,7 @@ class DescripcionListAdapter(private val productos: List<Articles>?) : |
17 | 17 | } |
18 | 18 | |
19 | 19 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder( |
20 | - LayoutInflater.from(parent.context).inflate(R.layout.item_descripcion, parent, false) | |
21 | - ) | |
20 | + LayoutInflater.from(parent.context).inflate(R.layout.item_descripcion, parent, false)) | |
22 | 21 | |
23 | 22 | override fun getItemCount() = productos!!.size |
24 | 23 | |
... | ... | @@ -30,7 +29,6 @@ class DescripcionListAdapter(private val productos: List<Articles>?) : |
30 | 29 | } |
31 | 30 | } |
32 | 31 | |
33 | - | |
34 | 32 | class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { |
35 | 33 | |
36 | 34 | val sector = view.tvSector |
app/src/main/java/com/focasoftware/deboinventariov20/UI/detalleProducto/DetalleArtFragment.kt
... | ... | @@ -6,6 +6,7 @@ import android.os.Bundle |
6 | 6 | import android.view.LayoutInflater |
7 | 7 | import android.view.View |
8 | 8 | import android.view.ViewGroup |
9 | +import android.view.inputmethod.InputMethodManager | |
9 | 10 | import androidx.fragment.app.Fragment |
10 | 11 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
11 | 12 | import com.focasoftware.deboinventariov20.Model.Articles |
... | ... | @@ -32,9 +33,11 @@ class DetalleArtFragment : Fragment() { |
32 | 33 | codigo = it.getString("codigo") |
33 | 34 | Inventario= it.getInt("numeroInv") |
34 | 35 | } |
36 | + val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? | |
37 | + imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | |
38 | + | |
35 | 39 | marcarInventario() |
36 | 40 | GlobalScope.launch(Dispatchers.Main) { |
37 | - | |
38 | 41 | artSerch = buscarCodigoDeboEnBD(sector, codigo) |
39 | 42 | if (artSerch == null) { |
40 | 43 | |
... | ... | @@ -59,14 +62,29 @@ class DetalleArtFragment : Fragment() { |
59 | 62 | } else if (artSerch != null) { |
60 | 63 | tvSector.text=sector |
61 | 64 | tvCodigo.text=codigo |
62 | - tvDeposito.text=if(artSerch!!.depSn!!.toInt() ==0)"No" else "Si" | |
65 | + tvDeposito.text=if(!artSerch!!.depSn!!)"No" else "Si" | |
63 | 66 | tvDescripcion.text=artSerch!!.descripcion.toString() |
64 | - tvCodigoBarras.text=artSerch!!.codBar.toString() | |
65 | - tvCodigoOrigen.text=artSerch!!.codOrigen.toString() | |
67 | + tvCodigoBarras.text=if (artSerch!!.codBar.toString()=="null")"" else artSerch!!.codBar.toString() | |
68 | + tvCodigoOrigen.text=if (artSerch!!.codOrigen.toString()=="null")"" else artSerch!!.codOrigen.toString() | |
66 | 69 | tvExiVenta.text=artSerch!!.exiVenta.toString() |
67 | 70 | tvExiDeposito.text=artSerch!!.exiDeposito.toString() |
68 | - tvBal.text=artSerch!!.balanza.toString() | |
69 | - tvDE.text=artSerch!!.de.toString() | |
71 | + | |
72 | + when ( artSerch!!.balanza.toString().toInt()) { | |
73 | + 1 ->tvBal.text="Unidades" | |
74 | + 2 ->tvBal.text="Litros" | |
75 | + 3 ->tvBal.text="Cajas" | |
76 | + 4 ->tvBal.text="M3" | |
77 | + 5 ->tvBal.text="Metros" | |
78 | + 6 ->tvBal.text="Fracción" | |
79 | + 7 ->tvBal.text="Bultos" | |
80 | + 8 ->tvBal.text="Gramos" | |
81 | + 9 ->tvBal.text="Cent. cúbicos" | |
82 | + 10 ->tvBal.text="Kgs" | |
83 | + else -> { tvBal.text="Otros" | |
84 | + } | |
85 | + } | |
86 | + tvCosto.text=String.format("%.2f", artSerch!!.costo.toString().toFloat()) | |
87 | + tvPrecio.text=String.format("%.2f", artSerch!!.precio.toString().toFloat()) | |
70 | 88 | } |
71 | 89 | } |
72 | 90 | } |
... | ... | @@ -78,7 +96,7 @@ class DetalleArtFragment : Fragment() { |
78 | 96 | |
79 | 97 | suspend fun buscarCodigoDeboEnBD(sector: String?, codigo: String?): Articles? { |
80 | 98 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
81 | - var busqueda: Articles? = null | |
99 | + var busqueda: Articles? | |
82 | 100 | return GlobalScope.async(Dispatchers.IO) { |
83 | 101 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.fetchArticuloByCodSec(sector, codigo) |
84 | 102 | return@async busqueda |
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/InventarioFragment.kt
... | ... | @@ -37,6 +37,7 @@ import kotlinx.android.synthetic.main.ingresar_cantidad.view.* |
37 | 37 | import kotlinx.android.synthetic.main.login_dialog.view.* |
38 | 38 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar |
39 | 39 | import kotlinx.coroutines.* |
40 | +import kotlinx.coroutines.Dispatchers.IO | |
40 | 41 | import java.time.LocalDateTime |
41 | 42 | import java.time.format.DateTimeFormatter |
42 | 43 | import java.util.* |
... | ... | @@ -44,7 +45,7 @@ import java.util.* |
44 | 45 | class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener { |
45 | 46 | |
46 | 47 | private lateinit var sharedPreferences: SharedPreferences |
47 | - private var iArea: Int = 0 | |
48 | + private var iArea: Boolean = false | |
48 | 49 | private lateinit var invHead: InvHead |
49 | 50 | private lateinit var rcInventarios: RecyclerView |
50 | 51 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
... | ... | @@ -94,7 +95,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
94 | 95 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO |
95 | 96 | InventarioNuevo = AppDb.getAppDb(requireActivity())?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 |
96 | 97 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO |
97 | - invHead = InvHead(InventarioNuevo, if (SerchArea() == 0) "Ventas" else "Deposito", 1, ObtenerFechaActual(), ObtenerFechaActual(), 0L, SerchArea(), AjusteProductos(), ProdNoCont()) | |
98 | + invHead = InvHead(InventarioNuevo, if (!SerchArea()) "Ventas" else "Deposito", 1, ObtenerFechaActual(), ObtenerFechaActual(), 0L, SerchArea(), AjusteProductos(), ProdNoCont()) | |
98 | 99 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead) |
99 | 100 | tvTitulo.text = "Inventario Dinamico" + " N° $InventarioNuevo" |
100 | 101 | } |
... | ... | @@ -109,10 +110,15 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
109 | 110 | sChangeUpper = tCodigoBarras.text.toString() |
110 | 111 | var indiceDelArtEncontrado = 0 |
111 | 112 | |
112 | - if (tCodigoBarras.text.isNullOrBlank()) { | |
113 | + if (tCodigoBarras.text.isNullOrBlank() ) { | |
113 | 114 | tCodigoBarras.error = "No puede estar vacio" |
114 | 115 | tCodigoBarras.requestFocus() |
115 | 116 | tCodigoBarras.hint = "No puede estar vacio" |
117 | + }else if (tCodigoBarras.text.toString().length<4 && iEstado==2) { | |
118 | + tCodigoBarras.error = "Minimo 4 caracteres" | |
119 | + tCodigoBarras.requestFocus() | |
120 | + tCodigoBarras.hint = "4 Minimo" | |
121 | + | |
116 | 122 | } else { |
117 | 123 | |
118 | 124 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS |
... | ... | @@ -190,6 +196,8 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
190 | 196 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
191 | 197 | ContinuarCargaDesc(artEncontrado as ArrayList<Articles>) |
192 | 198 | } |
199 | + | |
200 | + iBusquedaPor = 0 | |
193 | 201 | // } |
194 | 202 | |
195 | 203 | return@setOnKeyListener true |
... | ... | @@ -198,22 +206,22 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
198 | 206 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
199 | 207 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
200 | 208 | |
201 | - GlobalScope.launch(Dispatchers.Main) { | |
202 | - indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice | |
203 | -// //TODO Si no lo encuentra devuelve -1 | |
204 | - if (indiceDelArtEncontrado != -1) { | |
205 | - if (swSumaUno!!.isChecked) { | |
206 | - fCant = 0F | |
207 | - fCant = listArticulos[indiceDelArtEncontrado].cantTomada | |
208 | - fCant += 1F | |
209 | - //TODO ACTUALIZO LA CANTIDAD EN LA BD | |
210 | - updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | |
211 | - //TODO ACTUALIZO LA CANTIDAD EN EL RV | |
212 | - listArticulos[indiceDelArtEncontrado].cantTomada = fCant | |
213 | - viewAdapter.notifyDataSetChanged() | |
214 | - } else { | |
215 | - dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | |
216 | - } | |
209 | +// GlobalScope.launch(Dispatchers.Main) { | |
210 | +// indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice | |
211 | +//// //TODO Si no lo encuentra devuelve -1 | |
212 | +// if (indiceDelArtEncontrado != -1) { | |
213 | +// if (swSumaUno!!.isChecked) { | |
214 | +// fCant = 0F | |
215 | +// fCant = listArticulos[indiceDelArtEncontrado].cantTomada | |
216 | +// fCant += 1F | |
217 | +// //TODO ACTUALIZO LA CANTIDAD EN LA BD | |
218 | +// updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | |
219 | +// //TODO ACTUALIZO LA CANTIDAD EN EL RV | |
220 | +// listArticulos[indiceDelArtEncontrado].cantTomada = fCant | |
221 | +// viewAdapter.notifyDataSetChanged() | |
222 | +// } else { | |
223 | +// dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | |
224 | +// } | |
217 | 225 | // } else { |
218 | 226 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
219 | 227 | // val mBuilder = |
... | ... | @@ -271,17 +279,17 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
271 | 279 | // } |
272 | 280 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
273 | 281 | // } |
274 | - } else if (indiceDelArtEncontrado == -1) { | |
282 | +// } else if (indiceDelArtEncontrado == -1) { | |
275 | 283 | // no lo encontro en el RV, lo va a buscar en al BD |
276 | 284 | |
277 | 285 | GlobalScope.launch(Dispatchers.Main) { |
278 | 286 | //TODO BUSCO EN BASE DE DATOS |
279 | - listArticulos[indiceDelArtEncontrado].cantTomada | |
280 | 287 | val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
281 | - ContinuarCargaCB(artEncontrado) | |
288 | + ContinuarCargaCodigoOri(artEncontrado ) | |
282 | 289 | } |
283 | - } | |
284 | - } | |
290 | + iBusquedaPor = 0 | |
291 | +// } | |
292 | +// } | |
285 | 293 | return@setOnKeyListener true |
286 | 294 | } |
287 | 295 | } |
... | ... | @@ -385,7 +393,27 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
385 | 393 | } |
386 | 394 | } |
387 | 395 | |
388 | - // @SuppressLint("RestrictedApi") | |
396 | + private fun ContinuarCargaCodigoOri(artAcargar:List<Articles>) { | |
397 | + | |
398 | + if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | |
399 | + // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | |
400 | + val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | |
401 | + imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | |
402 | + | |
403 | + var bundle = Bundle() | |
404 | + bundle = bundleOf("ArrayDesc" to artAcargar) | |
405 | + bundle.putInt("numeroInv", InventarioNuevo) | |
406 | + navController.navigate(R.id.action_inventarioFragment_to_codigoOriFragment, bundle) | |
407 | + | |
408 | + } else {//TODO si no lo encuentra en la BD | |
409 | + val modalDialog = NoEncontradoSimple() | |
410 | + modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | |
411 | + } | |
412 | + etCodigoBarras.focusable = View.FOCUSABLE | |
413 | + etCodigoBarras.setText("") | |
414 | + etCodigoBarras.selectAll() | |
415 | + } | |
416 | + | |
389 | 417 | private fun ContinuarCargaDesc(artAcargar: ArrayList<Articles>) { |
390 | 418 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS |
391 | 419 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV |
... | ... | @@ -489,7 +517,6 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
489 | 517 | etCodigoBarras.selectAll() |
490 | 518 | } |
491 | 519 | |
492 | - | |
493 | 520 | fun DialogingresarCantidad(cnxt: Context, artAcargar: Articles?): Float { |
494 | 521 | var cantidad = 0F |
495 | 522 | val mDialogView = LayoutInflater.from(cnxt).inflate(R.layout.ingresar_cantidad, null) |
... | ... | @@ -583,11 +610,12 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
583 | 610 | mAlertDialog.dismiss() |
584 | 611 | } |
585 | 612 | } |
586 | - suspend fun buscarCodiogoOriEnBD(CodOri: String): Articles? { | |
613 | + | |
614 | + suspend fun buscarCodiogoOriEnBD(CodOri: String): List<Articles> { | |
587 | 615 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
588 | - var busqueda: Articles? = null | |
616 | + var busqueda: List<Articles> | |
589 | 617 | return GlobalScope.async(Dispatchers.IO) { |
590 | - busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchArea()) | |
618 | + busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario()) | |
591 | 619 | return@async busqueda |
592 | 620 | }.await() |
593 | 621 | } |
... | ... | @@ -595,8 +623,8 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
595 | 623 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { |
596 | 624 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
597 | 625 | var busqueda: Articles? = null |
598 | - return GlobalScope.async(Dispatchers.IO) { | |
599 | - busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchArea()) | |
626 | + return GlobalScope.async(IO) { | |
627 | + busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario()) | |
600 | 628 | return@async busqueda |
601 | 629 | }.await() |
602 | 630 | } |
... | ... | @@ -605,7 +633,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
605 | 633 | //TODO BUSQUEDA POR DESCRIPCION |
606 | 634 | var busqueda: List<Articles>? = null |
607 | 635 | return GlobalScope.async(Dispatchers.IO) { |
608 | - busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchArea()) | |
636 | + busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario()) | |
609 | 637 | return@async busqueda |
610 | 638 | }.await() |
611 | 639 | } |
... | ... | @@ -613,14 +641,14 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
613 | 641 | suspend fun borrarArticulo(sector: String, codigo: String, inventario: String): Int? { |
614 | 642 | //TODO BUSQUEDA POR DESCRIPCION |
615 | 643 | var result: Int |
616 | - return GlobalScope.async(Dispatchers.IO) { | |
644 | + return GlobalScope.async(IO) { | |
617 | 645 | result = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteItemFromInvBody(sector, codigo, inventario) |
618 | 646 | return@async result |
619 | 647 | }.await() |
620 | 648 | } |
621 | 649 | |
622 | 650 | private suspend fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { |
623 | - return GlobalScope.async(Dispatchers.IO) { | |
651 | + return GlobalScope.async(IO) { | |
624 | 652 | var indice = 0 |
625 | 653 | var bEncontrado = false |
626 | 654 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS |
... | ... | @@ -660,7 +688,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
660 | 688 | suspend fun cambioCBporCodigoDebo(codigoBarras: String): Articles? { |
661 | 689 | //TODO BUSQUEDA POR DESCRIPCION |
662 | 690 | var busqueda: Articles? = null |
663 | - return GlobalScope.async(Dispatchers.IO) { | |
691 | + return GlobalScope.async(IO) { | |
664 | 692 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchArea()) |
665 | 693 | return@async busqueda |
666 | 694 | }.await() |
... | ... | @@ -685,7 +713,8 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
685 | 713 | |
686 | 714 | fun cargarRecicler(articulos: Articles, cant: Float) { |
687 | 715 | //TODO CARGO EN LE RV |
688 | - val item = ItemsRecycler(articulos.sector, articulos.codigo, articulos.descripcion, cant, articulos.codBar, articulos.codOrigen, articulos.balanza.toString(), articulos.de.toString()) | |
716 | + val item = ItemsRecycler(if (articulos.sector.toString().toInt()<9) "0${articulos.sector.toString()}" else articulos.sector.toString() | |
717 | + , articulos.codigo, articulos.descripcion, cant, articulos.codBar, articulos.codOrigen, articulos.balanza.toString(), articulos.de.toString()) | |
689 | 718 | listArticulos.add(item) |
690 | 719 | |
691 | 720 | viewAdapter = ProductosListAdapter(requireContext(), listArticulos, this) |
... | ... | @@ -746,12 +775,17 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
746 | 775 | return prodInclu |
747 | 776 | } |
748 | 777 | |
749 | - private fun SerchArea(): Int { | |
750 | - if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea = 0 | |
751 | - if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = 1 | |
778 | + private fun SerchArea(): Boolean { | |
779 | + if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea =false | |
780 | + if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = true | |
752 | 781 | return iArea |
753 | 782 | } |
783 | + suspend fun SerchAreaInventario(): Boolean { | |
784 | + return GlobalScope.async(IO) { | |
785 | + return@async AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.fetchAreaInvH(InventarioNuevo) | |
786 | + }.await() | |
754 | 787 | |
788 | + } | |
755 | 789 | fun ObtenerFechaActual(): String? { |
756 | 790 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD |
757 | 791 | val current = LocalDateTime.now() |
... | ... | @@ -784,7 +818,7 @@ class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickList |
784 | 818 | |
785 | 819 | override fun onImageDotsClick(sector: String?, codigo: String?) { |
786 | 820 | val bundle = Bundle() |
787 | - bundle.putString("sector", sector) | |
821 | + bundle.putString("sector", sector!!.toInt().toString()) | |
788 | 822 | bundle.putString("codigo", codigo) |
789 | 823 | bundle.putInt("numeroInv", InventarioNuevo) |
790 | 824 | navController.navigate(R.id.action_inventarioFragment_to_detalleArtFragment, bundle) |
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/InventarioListAdapter.kt
... | ... | @@ -4,15 +4,22 @@ import android.content.Context |
4 | 4 | import android.view.LayoutInflater |
5 | 5 | import android.view.View |
6 | 6 | import android.view.ViewGroup |
7 | +import android.widget.Filter | |
8 | +import android.widget.Filterable | |
7 | 9 | import androidx.recyclerview.widget.RecyclerView |
8 | 10 | import com.focasoftware.deboinventariov20.Model.InvHead |
9 | 11 | import com.focasoftware.deboinventariov20.R |
10 | 12 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder |
11 | 13 | import kotlinx.android.synthetic.main.item_principal.view.* |
14 | +import java.util.* | |
15 | +import kotlin.collections.ArrayList | |
12 | 16 | |
13 | 17 | class InventarioListAdapter(private val context: Context, private val inv: List<InvHead>, private val itemClickListener: OnInventarioClickListener) : |
14 | - RecyclerView.Adapter<BaseViewHolder<*>>() { | |
15 | - | |
18 | + RecyclerView.Adapter<BaseViewHolder<*>>(), Filterable { | |
19 | + var invFiltrados: List<InvHead> | |
20 | + init { | |
21 | + invFiltrados=inv | |
22 | + } | |
16 | 23 | interface OnInventarioClickListener { |
17 | 24 | fun onItemClick(inventario: String?) |
18 | 25 | } |
... | ... | @@ -40,8 +47,33 @@ class InventarioListAdapter(private val context: Context, private val inv: List< |
40 | 47 | } |
41 | 48 | } |
42 | 49 | |
50 | + override fun getFilter(): Filter { | |
51 | + return object : Filter() { | |
52 | + override fun performFiltering(charSequence: CharSequence): FilterResults { | |
53 | + val charString = charSequence.toString() | |
43 | 54 | |
44 | -} | |
55 | + invFiltrados = if (charString.isEmpty()) { | |
56 | + inv | |
57 | + } else { | |
58 | + val filteredList = ArrayList<InvHead>() | |
45 | 59 | |
60 | + for (row in inv) { | |
61 | + if (row.lugar.toString().contains(charString.toLowerCase(Locale.ROOT))) { | |
62 | + filteredList.add(row) | |
63 | + } | |
46 | 64 | |
65 | + } | |
66 | + filteredList | |
67 | + } | |
68 | + val filterResults = FilterResults() | |
69 | + filterResults.values=invFiltrados | |
70 | + return filterResults | |
71 | + } | |
47 | 72 | |
73 | + override fun publishResults(charSequence: CharSequence?, filterResults: FilterResults?) { | |
74 | + invFiltrados = filterResults!!.values as ArrayList<InvHead> | |
75 | + notifyDataSetChanged() | |
76 | + } | |
77 | + } | |
78 | + } | |
79 | +} | |
48 | 80 | \ No newline at end of file |
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/MainFragment.kt
... | ... | @@ -6,7 +6,9 @@ import android.os.Bundle |
6 | 6 | import android.view.LayoutInflater |
7 | 7 | import android.view.View |
8 | 8 | import android.view.ViewGroup |
9 | -import android.widget.* | |
9 | +import android.widget.CheckBox | |
10 | +import android.widget.ImageButton | |
11 | +import android.widget.TextView | |
10 | 12 | import androidx.fragment.app.Fragment |
11 | 13 | import androidx.navigation.NavController |
12 | 14 | import androidx.navigation.Navigation |
... | ... | @@ -20,6 +22,7 @@ import kotlinx.coroutines.GlobalScope |
20 | 22 | import kotlinx.coroutines.async |
21 | 23 | import kotlinx.coroutines.launch |
22 | 24 | import java.util.* |
25 | +import java.util.Locale.filter | |
23 | 26 | |
24 | 27 | class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener { |
25 | 28 | private lateinit var inventarios: List<InvHead> |
... | ... | @@ -27,33 +30,38 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener |
27 | 30 | private lateinit var rcInventario: RecyclerView |
28 | 31 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
29 | 32 | private lateinit var viewManager: RecyclerView.LayoutManager |
30 | -// private var listIvn2 = List<InvHead>() | |
31 | -private var listIvn2 = ArrayList<InvHead>() | |
33 | + private var listIvn2 = ArrayList<InvHead>() | |
32 | 34 | private lateinit var navController: NavController |
33 | 35 | private lateinit var sharedPreferences: SharedPreferences |
34 | 36 | private var cantidadInventarios: Int = 0 |
37 | + private var adapterFilter: InventarioListAdapter? = null | |
35 | 38 | |
36 | 39 | override fun onCreate(savedInstanceState: Bundle?) { |
37 | 40 | super.onCreate(savedInstanceState) |
38 | 41 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
39 | 42 | } |
40 | 43 | |
41 | - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | |
44 | + override fun onCreateView( | |
45 | + inflater: LayoutInflater, | |
46 | + container: ViewGroup?, | |
47 | + savedInstanceState: Bundle? | |
48 | + ): View? { | |
42 | 49 | var bAbiertoCerrado = false |
43 | 50 | val v = inflater.inflate(R.layout.fragment_main, container, false) |
44 | 51 | val tvInvDinamicos = v.findViewById<TextView>(R.id.tvInvDinamicos) |
45 | 52 | val txtDeposito = v.findViewById<TextView>(R.id.txtDeposito) |
46 | - val ivSort19= v.findViewById<ImageButton>(R.id.ivSort19) | |
47 | - val ivSort91= v.findViewById<ImageButton>(R.id.ivSort91) | |
48 | - val cbVentas= v.findViewById<CheckBox>(R.id.cbVentas) | |
49 | - val cbDeposito= v.findViewById<CheckBox>(R.id.cbDeposito) | |
50 | - val tvTipo = v.findViewById<TextView>(R.id.tvTipo) | |
53 | + val ivSort19 = v.findViewById<ImageButton>(R.id.ivSort19) | |
54 | + val ivSort91 = v.findViewById<ImageButton>(R.id.ivSort91) | |
55 | + val cbVentas = v.findViewById<CheckBox>(R.id.cbVentas) | |
56 | + val cbDeposito = v.findViewById<CheckBox>(R.id.cbDeposito) | |
57 | + val tvTipo = v.findViewById<TextView>(R.id.tvTipo) | |
51 | 58 | rcInventario = v.findViewById(R.id.rcInventario) |
52 | 59 | |
53 | 60 | GlobalScope.launch(Dispatchers.Main) { |
54 | 61 | inventarios = buscarEnBDInvHead() |
55 | 62 | for ((i, item) in inventarios.withIndex()) { |
56 | - val inv = InvHead(inventarios[i].invNum, | |
63 | + val inv = InvHead( | |
64 | + inventarios[i].invNum, | |
57 | 65 | inventarios[i].descripcion, |
58 | 66 | inventarios[i].estado, |
59 | 67 | inventarios[i].fechaInicio, |
... | ... | @@ -61,11 +69,12 @@ private var listIvn2 = ArrayList<InvHead>() |
61 | 69 | inventarios[i].prodContados, |
62 | 70 | inventarios[i].lugar, |
63 | 71 | inventarios[i].stDesc, |
64 | - inventarios[i].proNoCont) | |
72 | + inventarios[i].proNoCont | |
73 | + ) | |
65 | 74 | cargarRecicler(inv) |
66 | 75 | cantidadInventarios = i + 1 |
67 | 76 | } |
68 | - tvInvDinamicos.text = "Inventarios Dinamicos (${cantidadInventarios.toString()}) +" | |
77 | + tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) +" | |
69 | 78 | tvInvDinamicos.setOnClickListener { |
70 | 79 | if (!bAbiertoCerrado) { |
71 | 80 | bAbiertoCerrado = true |
... | ... | @@ -76,7 +85,8 @@ private var listIvn2 = ArrayList<InvHead>() |
76 | 85 | cbVentas.visibility = View.VISIBLE |
77 | 86 | cbDeposito.visibility = View.VISIBLE |
78 | 87 | tvTipo.visibility = View.VISIBLE |
79 | - tvInvDinamicos.text = "Inventarios Dinamicos (${cantidadInventarios.toString()}) -" | |
88 | + tvInvDinamicos.text = | |
89 | + "Inventarios Dinamicos ($cantidadInventarios) -" | |
80 | 90 | } else { |
81 | 91 | bAbiertoCerrado = false |
82 | 92 | rcInventario.visibility = View.GONE |
... | ... | @@ -86,13 +96,14 @@ private var listIvn2 = ArrayList<InvHead>() |
86 | 96 | cbVentas.visibility = View.GONE |
87 | 97 | cbDeposito.visibility = View.GONE |
88 | 98 | tvTipo.visibility = View.GONE |
89 | - tvInvDinamicos.text = "Inventarios Dinamicos (${cantidadInventarios.toString()}) +" | |
99 | + tvInvDinamicos.text = | |
100 | + "Inventarios Dinamicos ($cantidadInventarios) +" | |
90 | 101 | } |
91 | 102 | } |
92 | 103 | ivSort19.setOnClickListener { |
93 | - ordenado= inventarios.sortedByDescending { | |
94 | - it.invNum | |
95 | - } | |
104 | + ordenado = inventarios.sortedByDescending { | |
105 | + it.invNum | |
106 | + } | |
96 | 107 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) |
97 | 108 | viewManager = LinearLayoutManager(requireContext()) |
98 | 109 | |
... | ... | @@ -101,11 +112,11 @@ private var listIvn2 = ArrayList<InvHead>() |
101 | 112 | layoutManager = viewManager |
102 | 113 | } |
103 | 114 | viewAdapter.notifyDataSetChanged() |
104 | - ivSort19.visibility=View.INVISIBLE | |
105 | - ivSort91.visibility=View.VISIBLE | |
115 | + ivSort19.visibility = View.INVISIBLE | |
116 | + ivSort91.visibility = View.VISIBLE | |
106 | 117 | } |
107 | 118 | ivSort91.setOnClickListener { |
108 | - ordenado= inventarios.sortedBy { | |
119 | + ordenado = inventarios.sortedBy { | |
109 | 120 | it.invNum |
110 | 121 | } |
111 | 122 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) |
... | ... | @@ -116,10 +127,23 @@ private var listIvn2 = ArrayList<InvHead>() |
116 | 127 | layoutManager = viewManager |
117 | 128 | } |
118 | 129 | viewAdapter.notifyDataSetChanged() |
119 | - ivSort91.visibility=View.INVISIBLE | |
120 | - ivSort19.visibility=View.VISIBLE | |
130 | + ivSort91.visibility = View.INVISIBLE | |
131 | + ivSort19.visibility = View.VISIBLE | |
121 | 132 | } |
122 | 133 | } |
134 | + | |
135 | +// cbVentas.setOnClickListener { | |
136 | +// if (cbVentas.isChecked) { | |
137 | +// rcInventario.apply { | |
138 | +// adapter = viewAdapter | |
139 | +// layoutManager = viewManager | |
140 | +// } | |
141 | +// adapterFilter. | |
142 | +// adapterFilter?.filter?.filter("Deposito") | |
143 | +// adapterFilter?.notifyDataSetChanged() | |
144 | +// viewAdapter.notifyDataSetChanged() | |
145 | +// } | |
146 | +// } | |
123 | 147 | return v |
124 | 148 | } |
125 | 149 |
app/src/main/res/layout/fragment_codigo_ori.xml
... | ... | @@ -0,0 +1,56 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | + | |
3 | +<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent" | |
7 | + android:layout_height="match_parent" | |
8 | + tools:context=".UI.descripcionFragment.DescripcionFragment"> | |
9 | + | |
10 | + <androidx.recyclerview.widget.RecyclerView | |
11 | + android:id="@+id/rcCodigoOri" | |
12 | + android:layout_width="match_parent" | |
13 | + android:layout_height="0dp" | |
14 | + android:background="@android:color/darker_gray" | |
15 | + android:scrollbars="vertical" | |
16 | + app:layout_constraintBottom_toTopOf="@+id/guideline6" | |
17 | + app:layout_constraintEnd_toEndOf="parent" | |
18 | + app:layout_constraintStart_toStartOf="parent" | |
19 | + app:layout_constraintTop_toBottomOf="@id/guideline4" | |
20 | + tools:listitem="@layout/item_codigo_origen" /> | |
21 | + | |
22 | + <!-- <Button--> | |
23 | + <!-- android:id="@+id/btnSalir"--> | |
24 | + <!-- android:layout_width="0dp"--> | |
25 | + <!-- android:layout_height="wrap_content"--> | |
26 | + <!-- android:text="@string/btnCancelar"--> | |
27 | + <!-- android:textColor="@android:color/white"--> | |
28 | + <!-- android:padding="10dp"--> | |
29 | + <!-- android:background="@drawable/boton_borde_redondeado"--> | |
30 | + <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | |
31 | + <!-- app:layout_constraintEnd_toEndOf="parent"--> | |
32 | + <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | |
33 | + <!-- app:layout_constraintStart_toStartOf="parent"--> | |
34 | + <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> | |
35 | + | |
36 | + <androidx.constraintlayout.widget.Guideline | |
37 | + android:id="@+id/guideline4" | |
38 | + android:layout_width="wrap_content" | |
39 | + android:layout_height="wrap_content" | |
40 | + android:orientation="horizontal" | |
41 | + app:layout_constraintGuide_percent="0.06" /> | |
42 | + | |
43 | + <androidx.constraintlayout.widget.Guideline | |
44 | + android:id="@+id/guideline5" | |
45 | + android:layout_width="wrap_content" | |
46 | + android:layout_height="wrap_content" | |
47 | + android:orientation="horizontal" | |
48 | + app:layout_constraintGuide_percent="0.88" /> | |
49 | + | |
50 | + <androidx.constraintlayout.widget.Guideline | |
51 | + android:id="@+id/guideline6" | |
52 | + android:layout_width="wrap_content" | |
53 | + android:layout_height="wrap_content" | |
54 | + android:orientation="horizontal" | |
55 | + app:layout_constraintGuide_percent="0.97" /> | |
56 | +</androidx.constraintlayout.widget.ConstraintLayout> | |
0 | 57 | \ No newline at end of file |
app/src/main/res/layout/fragment_descripcion.xml
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | |
3 | - | |
4 | - <androidx.constraintlayout.widget.ConstraintLayout | |
5 | - xmlns:android="http://schemas.android.com/apk/res/android" | |
6 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
7 | - xmlns:tools="http://schemas.android.com/tools" | |
8 | - android:layout_width="match_parent" | |
9 | - android:layout_height="match_parent" | |
10 | - tools:context=".UI.descripcionFragment.DescripcionFragment"> | |
11 | - | |
3 | +<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent" | |
7 | + android:layout_height="match_parent" | |
8 | + tools:context=".UI.descripcionFragment.DescripcionFragment"> | |
12 | 9 | |
13 | 10 | <androidx.recyclerview.widget.RecyclerView |
14 | 11 | android:id="@+id/rcDescripcion" |
... | ... | @@ -16,39 +13,39 @@ |
16 | 13 | android:layout_height="0dp" |
17 | 14 | android:background="@android:color/darker_gray" |
18 | 15 | android:scrollbars="vertical" |
19 | -app:layout_constraintTop_toBottomOf="@id/guideline4" | |
20 | 16 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
21 | 17 | app:layout_constraintEnd_toEndOf="parent" |
22 | 18 | app:layout_constraintStart_toStartOf="parent" |
19 | + app:layout_constraintTop_toBottomOf="@id/guideline4" | |
23 | 20 | tools:listitem="@layout/item" /> |
24 | 21 | |
25 | -<!-- <Button--> | |
26 | -<!-- android:id="@+id/btnSalir"--> | |
27 | -<!-- android:layout_width="0dp"--> | |
28 | -<!-- android:layout_height="wrap_content"--> | |
29 | -<!-- android:text="@string/btnCancelar"--> | |
30 | -<!-- android:textColor="@android:color/white"--> | |
31 | -<!-- android:padding="10dp"--> | |
32 | -<!-- android:background="@drawable/boton_borde_redondeado"--> | |
33 | -<!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | |
34 | -<!-- app:layout_constraintEnd_toEndOf="parent"--> | |
35 | -<!-- app:layout_constraintHorizontal_chainStyle="spread"--> | |
36 | -<!-- app:layout_constraintStart_toStartOf="parent"--> | |
37 | -<!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> | |
22 | + <!-- <Button--> | |
23 | + <!-- android:id="@+id/btnSalir"--> | |
24 | + <!-- android:layout_width="0dp"--> | |
25 | + <!-- android:layout_height="wrap_content"--> | |
26 | + <!-- android:text="@string/btnCancelar"--> | |
27 | + <!-- android:textColor="@android:color/white"--> | |
28 | + <!-- android:padding="10dp"--> | |
29 | + <!-- android:background="@drawable/boton_borde_redondeado"--> | |
30 | + <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | |
31 | + <!-- app:layout_constraintEnd_toEndOf="parent"--> | |
32 | + <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | |
33 | + <!-- app:layout_constraintStart_toStartOf="parent"--> | |
34 | + <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> | |
38 | 35 | |
39 | - <androidx.constraintlayout.widget.Guideline | |
40 | - android:id="@+id/guideline4" | |
41 | - android:layout_width="wrap_content" | |
42 | - android:layout_height="wrap_content" | |
43 | - android:orientation="horizontal" | |
44 | - app:layout_constraintGuide_percent="0.06" /> | |
36 | + <androidx.constraintlayout.widget.Guideline | |
37 | + android:id="@+id/guideline4" | |
38 | + android:layout_width="wrap_content" | |
39 | + android:layout_height="wrap_content" | |
40 | + android:orientation="horizontal" | |
41 | + app:layout_constraintGuide_percent="0.06" /> | |
45 | 42 | |
46 | - <androidx.constraintlayout.widget.Guideline | |
47 | - android:id="@+id/guideline5" | |
48 | - android:layout_width="wrap_content" | |
49 | - android:layout_height="wrap_content" | |
50 | - android:orientation="horizontal" | |
51 | - app:layout_constraintGuide_percent="0.88" /> | |
43 | + <androidx.constraintlayout.widget.Guideline | |
44 | + android:id="@+id/guideline5" | |
45 | + android:layout_width="wrap_content" | |
46 | + android:layout_height="wrap_content" | |
47 | + android:orientation="horizontal" | |
48 | + app:layout_constraintGuide_percent="0.88" /> | |
52 | 49 | |
53 | 50 | <androidx.constraintlayout.widget.Guideline |
54 | 51 | android:id="@+id/guideline6" |
... | ... | @@ -56,4 +53,4 @@ app:layout_constraintTop_toBottomOf="@id/guideline4" |
56 | 53 | android:layout_height="wrap_content" |
57 | 54 | android:orientation="horizontal" |
58 | 55 | app:layout_constraintGuide_percent="0.97" /> |
59 | - </androidx.constraintlayout.widget.ConstraintLayout> | |
56 | +</androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/fragment_detalle_art.xml
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | android:layout_marginTop="10dp" |
47 | 47 | android:text="Sector:" |
48 | 48 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
49 | - android:textSize="14sp" | |
49 | + android:textSize="15sp" | |
50 | 50 | app:layout_constraintEnd_toStartOf="@id/tvSector" |
51 | 51 | app:layout_constraintStart_toStartOf="parent" |
52 | 52 | app:layout_constraintTop_toBottomOf="@+id/tvTime" /> |
... | ... | @@ -55,13 +55,12 @@ |
55 | 55 | android:id="@+id/tvSector" |
56 | 56 | android:layout_width="0dp" |
57 | 57 | android:layout_height="wrap_content" |
58 | - android:layout_marginTop="10dp" | |
59 | 58 | android:text="" |
60 | 59 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
61 | - android:textSize="14sp" | |
60 | + android:textSize="18sp" | |
61 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView19" | |
62 | 62 | app:layout_constraintEnd_toStartOf="@id/textView18" |
63 | - app:layout_constraintStart_toEndOf="@id/textView19" | |
64 | - app:layout_constraintTop_toBottomOf="@+id/tvTime" /> | |
63 | + app:layout_constraintStart_toEndOf="@id/textView19" /> | |
65 | 64 | |
66 | 65 | <TextView |
67 | 66 | android:id="@+id/textView18" |
... | ... | @@ -70,7 +69,7 @@ |
70 | 69 | android:layout_marginTop="10dp" |
71 | 70 | android:text="Código:" |
72 | 71 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
73 | - android:textSize="14sp" | |
72 | + android:textSize="15sp" | |
74 | 73 | app:layout_constraintEnd_toStartOf="@id/tvCodigo" |
75 | 74 | app:layout_constraintStart_toEndOf="@id/tvSector" |
76 | 75 | app:layout_constraintTop_toBottomOf="@+id/tvTime" /> |
... | ... | @@ -79,13 +78,12 @@ |
79 | 78 | android:id="@+id/tvCodigo" |
80 | 79 | android:layout_width="0dp" |
81 | 80 | android:layout_height="wrap_content" |
82 | - android:layout_marginTop="10dp" | |
83 | 81 | android:text="" |
84 | 82 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
85 | - android:textSize="14sp" | |
83 | + android:textSize="18sp" | |
84 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView18" | |
86 | 85 | app:layout_constraintEnd_toStartOf="@+id/textView3" |
87 | - app:layout_constraintStart_toEndOf="@id/textView18" | |
88 | - app:layout_constraintTop_toBottomOf="@+id/tvTime" /> | |
86 | + app:layout_constraintStart_toEndOf="@id/textView18" /> | |
89 | 87 | |
90 | 88 | <TextView |
91 | 89 | android:id="@+id/textView3" |
... | ... | @@ -94,7 +92,7 @@ |
94 | 92 | android:layout_marginTop="10dp" |
95 | 93 | android:text="Depósito:" |
96 | 94 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
97 | - android:textSize="14sp" | |
95 | + android:textSize="15sp" | |
98 | 96 | app:layout_constraintEnd_toStartOf="@id/tvDeposito" |
99 | 97 | app:layout_constraintStart_toEndOf="@id/tvCodigo" |
100 | 98 | app:layout_constraintTop_toBottomOf="@+id/tvTime" /> |
... | ... | @@ -103,13 +101,12 @@ |
103 | 101 | android:id="@+id/tvDeposito" |
104 | 102 | android:layout_width="0dp" |
105 | 103 | android:layout_height="wrap_content" |
106 | - android:layout_marginTop="10dp" | |
107 | 104 | android:text="" |
108 | 105 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
109 | - android:textSize="14sp" | |
106 | + android:textSize="18sp" | |
107 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView3" | |
110 | 108 | app:layout_constraintEnd_toEndOf="parent" |
111 | - app:layout_constraintStart_toEndOf="@id/textView3" | |
112 | - app:layout_constraintTop_toBottomOf="@+id/tvTime" /> | |
109 | + app:layout_constraintStart_toEndOf="@id/textView3" /> | |
113 | 110 | |
114 | 111 | <TextView |
115 | 112 | android:id="@+id/textView6" |
... | ... | @@ -133,7 +130,7 @@ |
133 | 130 | android:lines="2" |
134 | 131 | android:text="" |
135 | 132 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
136 | - android:textSize="14sp" | |
133 | + android:textSize="18sp" | |
137 | 134 | app:layout_constraintEnd_toEndOf="parent" |
138 | 135 | app:layout_constraintStart_toEndOf="@+id/textView6" |
139 | 136 | app:layout_constraintTop_toBottomOf="@+id/tvCodigo" /> |
... | ... | @@ -146,7 +143,7 @@ |
146 | 143 | android:layout_marginTop="10dp" |
147 | 144 | android:text="C. de barras:" |
148 | 145 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
149 | - android:textSize="14sp" | |
146 | + android:textSize="15sp" | |
150 | 147 | app:layout_constraintEnd_toStartOf="@id/tvCodigoBarras" |
151 | 148 | app:layout_constraintStart_toStartOf="parent" |
152 | 149 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
... | ... | @@ -155,13 +152,12 @@ |
155 | 152 | android:id="@+id/tvCodigoBarras" |
156 | 153 | android:layout_width="0dp" |
157 | 154 | android:layout_height="wrap_content" |
158 | - android:layout_marginTop="10dp" | |
159 | 155 | android:text="" |
160 | 156 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
161 | - android:textSize="14sp" | |
157 | + android:textSize="18sp" | |
158 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView1" | |
162 | 159 | app:layout_constraintEnd_toStartOf="@id/textView2" |
163 | - app:layout_constraintStart_toEndOf="@id/textView1" | |
164 | - app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | |
160 | + app:layout_constraintStart_toEndOf="@id/textView1" /> | |
165 | 161 | |
166 | 162 | <TextView |
167 | 163 | android:id="@+id/textView2" |
... | ... | @@ -170,7 +166,7 @@ |
170 | 166 | android:layout_marginTop="10dp" |
171 | 167 | android:text="C. origen:" |
172 | 168 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
173 | - android:textSize="14sp" | |
169 | + android:textSize="15sp" | |
174 | 170 | app:layout_constraintEnd_toStartOf="@id/tvCodigoOrigen" |
175 | 171 | app:layout_constraintStart_toEndOf="@id/tvCodigoBarras" |
176 | 172 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
... | ... | @@ -179,13 +175,12 @@ |
179 | 175 | android:id="@+id/tvCodigoOrigen" |
180 | 176 | android:layout_width="0dp" |
181 | 177 | android:layout_height="wrap_content" |
182 | - android:layout_marginTop="10dp" | |
183 | 178 | android:text="" |
184 | 179 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
185 | - android:textSize="14sp" | |
180 | + android:textSize="18sp" | |
181 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | |
186 | 182 | app:layout_constraintEnd_toEndOf="parent" |
187 | - app:layout_constraintStart_toEndOf="@id/textView2" | |
188 | - app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | |
183 | + app:layout_constraintStart_toEndOf="@id/textView2" /> | |
189 | 184 | |
190 | 185 | |
191 | 186 | <TextView |
... | ... | @@ -196,7 +191,7 @@ |
196 | 191 | android:layout_marginTop="10dp" |
197 | 192 | android:text="Exi.venta:" |
198 | 193 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
199 | - android:textSize="14sp" | |
194 | + android:textSize="15sp" | |
200 | 195 | app:layout_constraintEnd_toStartOf="@id/tvExiVenta" |
201 | 196 | app:layout_constraintStart_toStartOf="parent" |
202 | 197 | app:layout_constraintTop_toBottomOf="@+id/tvCodigoBarras" /> |
... | ... | @@ -205,13 +200,12 @@ |
205 | 200 | android:id="@+id/tvExiVenta" |
206 | 201 | android:layout_width="0dp" |
207 | 202 | android:layout_height="wrap_content" |
208 | - android:layout_marginTop="10dp" | |
209 | 203 | android:text="" |
210 | 204 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
211 | - android:textSize="14sp" | |
205 | + android:textSize="18sp" | |
206 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | |
212 | 207 | app:layout_constraintEnd_toStartOf="@id/textView7" |
213 | - app:layout_constraintStart_toEndOf="@id/textView5" | |
214 | - app:layout_constraintTop_toBottomOf="@+id/tvCodigoBarras" /> | |
208 | + app:layout_constraintStart_toEndOf="@id/textView5" /> | |
215 | 209 | |
216 | 210 | <TextView |
217 | 211 | android:id="@+id/textView7" |
... | ... | @@ -220,7 +214,7 @@ |
220 | 214 | android:layout_marginTop="10dp" |
221 | 215 | android:text="Exi.dep:" |
222 | 216 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
223 | - android:textSize="14sp" | |
217 | + android:textSize="15sp" | |
224 | 218 | app:layout_constraintEnd_toStartOf="@id/tvExiDeposito" |
225 | 219 | app:layout_constraintStart_toEndOf="@id/tvExiVenta" |
226 | 220 | app:layout_constraintTop_toBottomOf="@+id/tvCodigoBarras" /> |
... | ... | @@ -229,88 +223,111 @@ |
229 | 223 | android:id="@+id/tvExiDeposito" |
230 | 224 | android:layout_width="0dp" |
231 | 225 | android:layout_height="wrap_content" |
232 | - android:layout_marginTop="10dp" | |
233 | 226 | android:text="" |
234 | 227 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
235 | - android:textSize="14sp" | |
236 | - app:layout_constraintEnd_toStartOf="@+id/textView8" | |
237 | - app:layout_constraintStart_toEndOf="@id/textView7" | |
238 | - app:layout_constraintTop_toBottomOf="@+id/tvCodigoBarras" /> | |
228 | + android:textSize="18sp" | |
229 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | |
230 | + app:layout_constraintEnd_toStartOf="@+id/textView9" | |
231 | + app:layout_constraintStart_toEndOf="@id/textView7" /> | |
239 | 232 | |
240 | 233 | <TextView |
241 | - android:id="@+id/textView8" | |
234 | + android:id="@+id/textView9" | |
242 | 235 | android:layout_width="wrap_content" |
243 | 236 | android:layout_height="wrap_content" |
244 | 237 | android:layout_marginTop="10dp" |
245 | - android:text="Bal:" | |
238 | + android:text="Precio:" | |
246 | 239 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
247 | - android:textSize="14sp" | |
248 | - app:layout_constraintEnd_toStartOf="@id/tvBal" | |
240 | + android:textSize="15sp" | |
241 | + app:layout_constraintEnd_toStartOf="@id/tvPrecio" | |
249 | 242 | app:layout_constraintStart_toEndOf="@id/tvExiDeposito" |
250 | 243 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
251 | 244 | |
252 | 245 | <TextView |
253 | - android:id="@+id/tvBal" | |
246 | + android:id="@+id/tvPrecio" | |
254 | 247 | android:layout_width="0dp" |
255 | 248 | android:layout_height="wrap_content" |
256 | - android:layout_marginTop="10dp" | |
257 | 249 | android:text="" |
258 | 250 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
259 | - android:textSize="14sp" | |
260 | - app:layout_constraintEnd_toStartOf="@+id/textView9" | |
261 | - app:layout_constraintStart_toEndOf="@id/textView8" | |
262 | - app:layout_constraintTop_toBottomOf="@+id/textView2" /> | |
251 | + android:textSize="18sp" | |
252 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView9" | |
253 | + app:layout_constraintEnd_toEndOf="parent" | |
254 | + app:layout_constraintStart_toEndOf="@id/textView9" /> | |
255 | + <TextView | |
256 | + android:id="@+id/textView8" | |
257 | + android:layout_width="wrap_content" | |
258 | + android:layout_height="wrap_content" | |
259 | + android:layout_marginStart="5dp" | |
260 | + android:layout_marginTop="10dp" | |
261 | + android:text="Costo:" | |
262 | + android:textAppearance="@style/TextAppearance.AppCompat.Large" | |
263 | + android:textSize="15sp" | |
264 | + app:layout_constraintEnd_toStartOf="@+id/tvCosto" | |
265 | + app:layout_constraintStart_toStartOf="parent" | |
266 | + app:layout_constraintTop_toBottomOf="@+id/tvExiVenta" /> | |
263 | 267 | |
264 | 268 | <TextView |
265 | - android:id="@+id/textView9" | |
269 | + android:id="@+id/tvCosto" | |
270 | + android:layout_width="wrap_content" | |
271 | + android:layout_height="wrap_content" | |
272 | + android:text="22.99" | |
273 | + android:textAppearance="@style/TextAppearance.AppCompat.Large" | |
274 | + android:textSize="18sp" | |
275 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView8" | |
276 | + app:layout_constraintEnd_toStartOf="@+id/textView10" | |
277 | + app:layout_constraintStart_toEndOf="@+id/textView8" | |
278 | + app:layout_constraintTop_toBottomOf="@+id/tvExiVenta" /> | |
279 | + | |
280 | + <TextView | |
281 | + android:id="@+id/textView10" | |
266 | 282 | android:layout_width="wrap_content" |
267 | 283 | android:layout_height="wrap_content" |
284 | + android:layout_marginStart="5dp" | |
268 | 285 | android:layout_marginTop="10dp" |
269 | - android:text="De:" | |
286 | + android:text="Unidad de Venta:" | |
270 | 287 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
271 | - android:textSize="14sp" | |
272 | - app:layout_constraintEnd_toStartOf="@id/tvDE" | |
273 | - app:layout_constraintStart_toEndOf="@id/tvBal" | |
274 | - app:layout_constraintTop_toBottomOf="@+id/textView2" /> | |
288 | + android:textSize="15sp" | |
289 | + app:layout_constraintEnd_toStartOf="@id/tvBal" | |
290 | + app:layout_constraintStart_toEndOf="@id/tvCosto" | |
291 | + app:layout_constraintTop_toBottomOf="@+id/tvExiVenta" /> | |
275 | 292 | |
276 | 293 | <TextView |
277 | - android:id="@+id/tvDE" | |
294 | + android:id="@+id/tvBal" | |
278 | 295 | android:layout_width="0dp" |
279 | 296 | android:layout_height="wrap_content" |
280 | - android:layout_marginTop="10dp" | |
281 | - android:text="" | |
297 | + android:text="CENT. CUBICOS" | |
282 | 298 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
283 | - android:textSize="14sp" | |
299 | + android:textSize="18sp" | |
300 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView10" | |
284 | 301 | app:layout_constraintEnd_toEndOf="parent" |
285 | - app:layout_constraintStart_toEndOf="@id/textView9" | |
286 | - app:layout_constraintTop_toBottomOf="@+id/textView2" /> | |
302 | + app:layout_constraintStart_toEndOf="@+id/textView10" /> | |
287 | 303 | |
288 | 304 | |
289 | 305 | <TextView |
290 | - android:id="@+id/textView10" | |
306 | + android:id="@+id/textView11" | |
291 | 307 | android:layout_width="wrap_content" |
292 | 308 | android:layout_height="wrap_content" |
293 | - android:layout_marginTop="10dp" | |
309 | + android:layout_marginStart="5dp" | |
310 | + android:layout_marginTop="8dp" | |
294 | 311 | android:text="Imagen:" |
295 | 312 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
296 | 313 | android:textSize="14sp" |
297 | - app:layout_constraintEnd_toStartOf="@id/tvDE" | |
298 | - app:layout_constraintHorizontal_bias="0.0" | |
314 | + app:layout_constraintHorizontal_bias="0.47" | |
299 | 315 | app:layout_constraintStart_toStartOf="parent" |
300 | - app:layout_constraintTop_toBottomOf="@+id/tvDE" /> | |
316 | + app:layout_constraintTop_toBottomOf="@+id/textView8" /> | |
301 | 317 | |
302 | 318 | <ImageView |
303 | 319 | android:id="@+id/ivImagen" |
304 | 320 | android:layout_width="100dp" |
305 | 321 | android:layout_height="100dp" |
322 | + android:layout_marginStart="5dp" | |
306 | 323 | android:layout_marginTop="10dp" |
307 | 324 | android:src="@drawable/no_imagen" |
308 | 325 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
309 | 326 | android:textSize="14sp" |
310 | 327 | app:layout_constraintEnd_toEndOf="parent" |
311 | - app:layout_constraintHorizontal_bias="0.04" | |
312 | - app:layout_constraintStart_toEndOf="@id/textView10" | |
313 | - app:layout_constraintTop_toBottomOf="@+id/tvDE" /> | |
328 | + app:layout_constraintHorizontal_bias="0.003" | |
329 | + app:layout_constraintStart_toEndOf="@id/textView11" | |
330 | + app:layout_constraintTop_toBottomOf="@+id/tvBal" /> | |
314 | 331 | |
315 | 332 | </androidx.constraintlayout.widget.ConstraintLayout> |
316 | 333 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout/ingresar_cantidad.xml
... | ... | @@ -52,18 +52,18 @@ |
52 | 52 | app:layout_constraintTop_toBottomOf="@id/barraSuperior"> |
53 | 53 | |
54 | 54 | |
55 | - | |
56 | 55 | <EditText |
57 | 56 | android:id="@+id/etCantidad" |
58 | 57 | android:layout_width="match_parent" |
59 | 58 | android:layout_height="wrap_content" |
59 | + android:clickable="true" | |
60 | 60 | android:ems="10" |
61 | - android:gravity="center" | |
62 | - android:textSize="20sp" | |
63 | 61 | android:focusable="true" |
64 | - android:clickable="true" | |
62 | + android:gravity="center" | |
65 | 63 | android:inputType="numberDecimal" |
66 | - android:text="" /> | |
64 | + android:maxLength="8" | |
65 | + android:text="" | |
66 | + android:textSize="20sp" /> | |
67 | 67 | |
68 | 68 | |
69 | 69 | <androidx.appcompat.widget.AppCompatButton |
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | android:textColor="@android:color/white" |
78 | 78 | android:padding="10dp" |
79 | 79 | android:background="@drawable/boton_borde_redondeado" |
80 | - android:text="@string/btnConfirmar" | |
80 | + android:text="@string/btnOk" | |
81 | 81 | android:textAlignment="center" |
82 | 82 | android:textSize="20sp" |
83 | 83 | android:textStyle="bold" |
app/src/main/res/layout/item.xml
... | ... | @@ -37,22 +37,24 @@ |
37 | 37 | android:text="9999" |
38 | 38 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
39 | 39 | android:textColorHint="@android:color/black" |
40 | - android:textSize="14sp" | |
40 | + android:textSize="18sp" | |
41 | 41 | android:textStyle="bold" |
42 | 42 | app:layout_constraintHorizontal_chainStyle="packed" |
43 | 43 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" |
44 | 44 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" |
45 | 45 | app:layout_constraintStart_toEndOf="@+id/textView2" /> |
46 | + | |
47 | + | |
46 | 48 | <TextView |
47 | 49 | android:id="@+id/tvCodigo" |
48 | 50 | android:layout_width="wrap_content" |
49 | 51 | android:layout_height="match_parent" |
50 | - android:layout_marginStart="8dp" | |
51 | 52 | android:text="99999999" |
53 | + android:layout_marginStart="8dp" | |
52 | 54 | app:layout_constraintHorizontal_chainStyle="packed" |
53 | 55 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
54 | 56 | android:textColorHint="@android:color/black" |
55 | - android:textSize="14sp" | |
57 | + android:textSize="18sp" | |
56 | 58 | android:textStyle="bold" |
57 | 59 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" |
58 | 60 | app:layout_constraintEnd_toStartOf="@+id/textView5" |
... | ... | @@ -62,13 +64,13 @@ |
62 | 64 | android:id="@+id/textView5" |
63 | 65 | android:layout_width="wrap_content" |
64 | 66 | android:layout_height="wrap_content" |
65 | - android:layout_marginStart="8dp" | |
67 | + android:layout_marginStart="12dp" | |
66 | 68 | android:text="Cantidad:" |
67 | 69 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
68 | - android:textSize="14sp" | |
69 | - app:layout_constraintTop_toTopOf="parent" | |
70 | + android:textSize="18sp" | |
70 | 71 | app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras" |
71 | - app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | |
72 | + app:layout_constraintStart_toEndOf="@+id/tvCodigo" | |
73 | + app:layout_constraintTop_toTopOf="parent" /> | |
72 | 74 | |
73 | 75 | <TextView |
74 | 76 | android:id="@+id/tvCantidad" |
... | ... | @@ -77,7 +79,7 @@ |
77 | 79 | android:layout_margin="5dp" |
78 | 80 | android:text="12345.12" |
79 | 81 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
80 | - android:textSize="14sp" | |
82 | + android:textSize="18sp" | |
81 | 83 | android:textStyle="bold" |
82 | 84 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" |
83 | 85 | app:layout_constraintEnd_toEndOf="parent" |
... | ... | @@ -131,7 +133,7 @@ |
131 | 133 | android:maxLines="2" |
132 | 134 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" |
133 | 135 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
134 | - android:textSize="14sp" | |
136 | + android:textSize="18sp" | |
135 | 137 | android:textStyle="bold" |
136 | 138 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" |
137 | 139 | app:layout_constraintEnd_toEndOf="parent" |
app/src/main/res/layout/item_codigo_origen.xml
... | ... | @@ -0,0 +1,149 @@ |
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 | + android:layout_width="match_parent" | |
5 | + android:layout_height="wrap_content" | |
6 | + android:layout_margin="5dp" | |
7 | + app:cardCornerRadius="2dp" | |
8 | + app:cardElevation="10dp" | |
9 | + app:contentPadding="5dp" | |
10 | + app:cardPreventCornerOverlap="false"> | |
11 | + | |
12 | + <androidx.constraintlayout.widget.ConstraintLayout | |
13 | + android:layout_width="match_parent" | |
14 | + android:layout_height="wrap_content"> | |
15 | + | |
16 | + <TextView | |
17 | + android:id="@+id/textView2" | |
18 | + android:layout_width="wrap_content" | |
19 | + android:layout_height="wrap_content" | |
20 | + android:layout_marginStart="5dp" | |
21 | + android:text="Código:" | |
22 | + android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | |
23 | + android:textSize="14sp" | |
24 | + app:layout_constraintEnd_toStartOf="@+id/tvSector" | |
25 | + app:layout_constraintHorizontal_bias="0.01" | |
26 | + app:layout_constraintHorizontal_chainStyle="packed" | |
27 | + app:layout_constraintStart_toStartOf="parent" | |
28 | + app:layout_constraintTop_toTopOf="parent" /> | |
29 | + | |
30 | + | |
31 | + <TextView | |
32 | + android:id="@+id/tvSector" | |
33 | + android:layout_width="wrap_content" | |
34 | + android:layout_height="match_parent" | |
35 | + android:layout_marginStart="8dp" | |
36 | + android:text="9999" | |
37 | + android:textAppearance="@style/TextAppearance.AppCompat.Large" | |
38 | + android:textColorHint="@android:color/black" | |
39 | + android:textSize="14sp" | |
40 | + android:textStyle="bold" | |
41 | + app:layout_constraintHorizontal_chainStyle="packed" | |
42 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | |
43 | + app:layout_constraintEnd_toStartOf="@+id/tvCodigo" | |
44 | + app:layout_constraintStart_toEndOf="@+id/textView2" /> | |
45 | + <TextView | |
46 | + android:id="@+id/tvCodigo" | |
47 | + android:layout_width="wrap_content" | |
48 | + android:layout_height="match_parent" | |
49 | + android:layout_marginStart="8dp" | |
50 | + android:text="99999999" | |
51 | + app:layout_constraintHorizontal_chainStyle="packed" | |
52 | + android:textAppearance="@style/TextAppearance.AppCompat.Large" | |
53 | + android:textColorHint="@android:color/black" | |
54 | + android:textSize="14sp" | |
55 | + android:textStyle="bold" | |
56 | + app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | |
57 | + app:layout_constraintEnd_toStartOf="@+id/textView5" | |
58 | + app:layout_constraintStart_toEndOf="@+id/tvSector" /> | |
59 | + | |
60 | + <TextView | |
61 | + android:id="@+id/textView5" | |
62 | + android:layout_width="wrap_content" | |
63 | + android:layout_height="wrap_content" | |
64 | + android:layout_marginStart="8dp" | |
65 | + android:text="Cantidad:" | |
66 | + android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | |
67 | + android:textSize="14sp" | |
68 | + android:visibility="gone" | |
69 | + app:layout_constraintTop_toTopOf="parent" | |
70 | + app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras" | |
71 | + app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | |
72 | + | |
73 | + <TextView | |
74 | + android:id="@+id/tvCantidad" | |
75 | + android:layout_width="wrap_content" | |
76 | + android:layout_height="match_parent" | |
77 | + android:layout_marginStart="8dp" | |
78 | + android:text="Otros Códigos:" | |
79 | + android:textAppearance="@style/TextAppearance.AppCompat.Large" | |
80 | + android:textSize="14sp" | |
81 | + android:textStyle="bold" | |
82 | + android:visibility="visible" | |
83 | + app:layout_constraintEnd_toStartOf="@id/tvCodigoOrigen" | |
84 | + app:layout_constraintStart_toEndOf="@id/textView5" | |
85 | + app:layout_constraintTop_toTopOf="parent" /> | |
86 | + | |
87 | + <TextView | |
88 | + android:id="@+id/tvCodigoOrigen" | |
89 | + android:layout_width="0dp" | |
90 | + android:layout_height="wrap_content" | |
91 | + android:layout_marginStart="3dp" | |
92 | + android:maxLines="2" | |
93 | + android:text="" | |
94 | + android:textAppearance="@style/TextAppearance.AppCompat.Large" | |
95 | + android:textSize="14sp" | |
96 | + android:visibility="visible" | |
97 | + android:textStyle="bold" | |
98 | + app:layout_constraintEnd_toEndOf="parent" | |
99 | + app:layout_constraintStart_toEndOf="@+id/tvCantidad" | |
100 | + app:layout_constraintTop_toTopOf="parent"/> | |
101 | + | |
102 | + <ImageView | |
103 | + android:id="@+id/ivHolder" | |
104 | + android:layout_width="30dp" | |
105 | + android:layout_height="30dp" | |
106 | + android:visibility="gone" | |
107 | + android:src="@drawable/more" | |
108 | + app:layout_constraintBottom_toTopOf="@+id/tvDescripcion" | |
109 | + app:layout_constraintEnd_toEndOf="parent" | |
110 | + app:layout_constraintHorizontal_bias="0.968" | |
111 | + app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras" | |
112 | + app:layout_constraintTop_toTopOf="parent" | |
113 | + app:layout_constraintVertical_bias="0.0" /> | |
114 | + | |
115 | + <TextView | |
116 | + android:id="@+id/textView85" | |
117 | + android:layout_width="wrap_content" | |
118 | + android:layout_height="wrap_content" | |
119 | + android:layout_marginStart="5dp" | |
120 | + android:layout_marginTop="8dp" | |
121 | + android:text="Desc:" | |
122 | + android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | |
123 | + android:textSize="14sp" | |
124 | + app:layout_constraintEnd_toStartOf="@+id/tvDescripcion" | |
125 | + app:layout_constraintHorizontal_bias="0.0" | |
126 | + app:layout_constraintHorizontal_chainStyle="packed" | |
127 | + app:layout_constraintStart_toStartOf="parent" | |
128 | + app:layout_constraintTop_toBottomOf="@id/tvCodigo" /> | |
129 | + | |
130 | + <TextView | |
131 | + android:id="@+id/tvDescripcion" | |
132 | + android:layout_width="0dp" | |
133 | + android:layout_height="wrap_content" | |
134 | + android:layout_marginStart="3dp" | |
135 | + android:layout_marginTop="8dp" | |
136 | + android:maxLines="2" | |
137 | + android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | |
138 | + android:textAppearance="@style/TextAppearance.AppCompat.Large" | |
139 | + android:textSize="14sp" | |
140 | + android:textStyle="bold" | |
141 | + app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | |
142 | + app:layout_constraintEnd_toEndOf="parent" | |
143 | + app:layout_constraintStart_toEndOf="@+id/textView85" | |
144 | + app:layout_constraintTop_toBottomOf="@+id/tvCodigo" /> | |
145 | + | |
146 | + | |
147 | + </androidx.constraintlayout.widget.ConstraintLayout> | |
148 | + | |
149 | +</androidx.cardview.widget.CardView> | |
0 | 150 | \ No newline at end of file |
app/src/main/res/navigation/mobile_navigation.xml
... | ... | @@ -69,6 +69,9 @@ |
69 | 69 | <action |
70 | 70 | android:id="@+id/action_inventarioFragment_to_detalleArtFragment" |
71 | 71 | app:destination="@id/detalleArtFragment" /> |
72 | + <action | |
73 | + android:id="@+id/action_inventarioFragment_to_codigoOriFragment" | |
74 | + app:destination="@id/codigoOriFragment" /> | |
72 | 75 | </fragment> |
73 | 76 | |
74 | 77 | <fragment |
... | ... | @@ -123,4 +126,12 @@ |
123 | 126 | app:popUpTo="@id/servidoresFragment" |
124 | 127 | app:popUpToInclusive="false" /> |
125 | 128 | </fragment> |
129 | + <fragment | |
130 | + android:id="@+id/codigoOriFragment" | |
131 | + android:name="com.focasoftware.deboinventariov20.UI.descripCorigenFragment.CodigoOriFragment" | |
132 | + android:label="CodigoOriFragment" > | |
133 | + <action | |
134 | + android:id="@+id/action_codigoOriFragment_to_inventarioFragment" | |
135 | + app:destination="@id/inventarioFragment" /> | |
136 | + </fragment> | |
126 | 137 | </navigation> |
app/src/main/res/values/strings.xml
... | ... | @@ -30,7 +30,6 @@ |
30 | 30 | <!-- ventana emergente--> |
31 | 31 | <string name="adv">Ingrese la cantidad contada</string> |
32 | 32 | <string name="invVentas">Inventarios Dinamicos de Ventas</string> |
33 | - <string name="btnConfirmar">Confirmar</string> | |
34 | 33 | <string name="btnCancela">Cancelar</string> |
35 | 34 | |
36 | 35 |