From 35fb2b64014652e0621c4e209b95a65b38ba1af3 Mon Sep 17 00:00:00 2001 From: Jose Alberto Guerra Ugalde Date: Tue, 5 Nov 2024 19:29:19 -0600 Subject: [PATCH] =?UTF-8?q?-=20VERSION=204.11.02=20-=20Se=20corrige=20que?= =?UTF-8?q?=20cuando=20en=20el=20catalogo=20de=20productos=20se=20pone=20u?= =?UTF-8?q?na=20cantidad=20de=20producto=20y=20luego=20se=20borra=20direct?= =?UTF-8?q?amente=20en=20la=20cantidad,=20se=20quedaba=20la=20cantidad=20p?= =?UTF-8?q?reviamente=20selecionada.=20-=20Se=20pone=20codigo=20para=20que?= =?UTF-8?q?=20se=20maneje=20Venta=20y=20Preventa,=20se=20lee=20la=20inform?= =?UTF-8?q?aci=C3=B3n=20de=20CAT=5FRUTAS/CAT=5FRU=5FCATEGORIA,=20falta=20l?= =?UTF-8?q?a=20parte=20de=20"AMBOS".=20(En=20revision=20por=20Dulce)=20-?= =?UTF-8?q?=20Se=20agregaron=207=20almacenes=20para=20que=20se=20active=20?= =?UTF-8?q?la=20encuesta=20de=20Pedigree.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B4A/C_Cliente.bas | 39 ++++++++------ B4A/C_Principal.bas | 98 +++++++++++++++++++--------------- B4A/C_Productos.bas | 20 ++++--- B4A/Files/cliente.bal | Bin 47652 -> 47652 bytes B4A/Guna Vistas V3.1.b4a | 2 +- B4A/Guna Vistas V3.1.b4a.meta | 6 +-- B4A/Subs.bas | 2 +- 7 files changed, 98 insertions(+), 69 deletions(-) diff --git a/B4A/C_Cliente.bas b/B4A/C_Cliente.bas index 8ef8bb4..e83f777 100644 --- a/B4A/C_Cliente.bas +++ b/B4A/C_Cliente.bas @@ -487,9 +487,6 @@ End Sub 'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage. Sub B4XPage_Appear - gest.Text = "PreVenta" - If Subs.traeTipoVentaDeBD = "VENTA" Then gest.Text = "Venta" - If la_cuenta.Text = "0" Then gest.Text = "Carga Abordo" iniciofin que_modulo = 1 dentroDeGeocerca = False @@ -512,13 +509,13 @@ Sub B4XPage_Appear b_Inicio_Fin_venta.Text = "INICIAR VENTA" b_Inicio_Fin_venta.BringToFront ' LogColor(">>>>>> EN VENTA: " & Starter.enVenta, Colors.red) - If Not(Starter.enVenta) Then - b_Inicio_Fin_venta.Visible = True - Log("EnVenta Visible") - Else - Log("EnVenta NO Visible") - b_Inicio_Fin_venta.Visible = False - End If +' If Not(Starter.enVenta) Then +' b_Inicio_Fin_venta.Visible = True +' Log("EnVenta Visible") +' Else +' Log("EnVenta NO Visible") +' b_Inicio_Fin_venta.Visible = False +' End If If Subs.hayPedido Then 'Si hay pedido, deshabilitamos el boton de "No Venta" Log(">>>>> HAY PEDIDO") @@ -915,6 +912,10 @@ Sub B4XPage_Appear b_Inicio_Fin_venta.Visible = False ' ToastMessageShow("aaa", False) End If + gest.Text = "PreVenta" + If Subs.traeTipoVentaDeBD = "VENTA" Then gest.Text = "Venta" + Log($">>>>>>>>>> |${la_cuenta.Text.trim}|"$) + If la_cuenta.Text.trim = "0" Then gest.Text = "Carga Abordo" ' Log($"ALMACEN: ${ALMACEN}${CRLF}RUTA:${LA_RUTA}"$) End Sub @@ -1118,17 +1119,13 @@ End Sub 'Muestra u oculta el boton de inicio y fin de venta Private Sub iniciofin - Log(">>>>> " & Starter.enVenta) If Starter.enVenta = False Then - Log(333) p_transparenteInicioFin.BringToFront p_transparenteInicioFin.Visible = True b_Inicio_Fin_venta.Visible = True ' Log("Hacemos visible el boton de Inicio Venta") Else - Log(4444) If b_Inicio_Fin_venta.Text <> "TERMINAR VENTA" Then - Log(555) p_transparenteInicioFin.Visible = False b_Inicio_Fin_venta.Visible = False End If @@ -1221,13 +1218,24 @@ Sub gest_Click ' En SCAT es ruta 3 ' Norte 45 (79) Rutas: 702, 703, 707, 718, 730, 732, 733, 734. +' COACALCO- 35-- +' NORTE 45- 75-- +' ATIZAPAN- 56-- +' VALLEJO- 73-- +' IZTAPALAPA- 43-- +' CEDA- 54-- +' PACHUCA- 15-- + Private rutasEncuesta As List rutasEncuesta.Initialize2(Array As Int(702, 703, 707, 718, 730, 732, 733, 734)) + Private alamcenesEncuesta As List + alamcenesEncuesta.Initialize2(Array As Int(15, 35, 43, 54, 56, 73, 75, 79)) ' Almacenes para la encuesta de Pedigree ' ALMACEN = 79 ' LA_RUTA = 732 +' Or (ALMACEN = 79 And rutasEncuesta.IndexOf(LA_RUTA.As(Int)) > -1) - If (ALMACEN = 6 And LA_RUTA = 3) Or (ALMACEN = 79 And rutasEncuesta.IndexOf(LA_RUTA.As(Int)) > -1) Then + If (alamcenesEncuesta.IndexOf(ALMACEN.As(Int)) > -1 ) Or (ALMACEN = 6 And LA_RUTA = 3) Then Log($"${cuest.encuestaIniciada} - ${cuest.clienteConCuestionario(Subs.traeCliente)}"$) If Not(cuest.encuestaIniciada) And Not(cuest.clienteConCuestionario(Subs.traeCliente)) Then cuest.agregaPreguntaCheckbox("1", "¿Qué productos de Kileo Perro encuentras en esta tienda?", Array As String("Pedigree Adulto", "Pedigree Cachorro", "Pedigree Razas Pequeñas", "Champ", "PAL","DOG CHOW ADULTO","DOG CHOW CACHORRO","DOG CHOW RAZAS PEQUEÑAS","Campeon","Ganador","Poder canino","Perron","Silverkan","Woow","Chapetes","Dyno","Beriscan","Nogacan","Nutrescan","Fidus","Amigo Gourmet","Otros","Ninguno de los anteriores")) @@ -4724,7 +4732,6 @@ Private Sub StopCamera2 End If End Sub - Private Sub b_Inicio_Fin_venta_Click ' b_Inicio_Fin_venta.Visible = False ' Subs.bitacora(Subs.fechanormal(DateTime.Now), usuario, Subs.traeAlmacen, Subs.traeRuta, "Pre-venta", "0", Subs.fechanormal(DateTime.Now), Subs.fechanormal(DateTime.Now), B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, "", "") diff --git a/B4A/C_Principal.bas b/B4A/C_Principal.bas index d936395..081dcb5 100644 --- a/B4A/C_Principal.bas +++ b/B4A/C_Principal.bas @@ -347,6 +347,7 @@ Sub B4XPage_Appear ' LogColor($"########## ${Subs.traeRuta} ##########"$, Colors.red) p_principal.Visible = True ' Log($"|${Subs.traeTipoVentaDeBD}|"$) + If Subs.traeTipoVentaDeBD = "VENTA" Or Subs.traeTipoVentaDeBD = "ABORDO" Then b_abordo.Visible = True Else b_abordo.Visible = False E_RUTA2.Text = "" p_ruta2.Visible = False @@ -844,7 +845,11 @@ Sub Subir_Click End Sub Sub cargar_Click + Private i As Int = Regex.Replace("[^0-9.]", e_ruta.text,"") 'Quitamos alfanumericos y convertimos en entero. + e_ruta.text = i If E_RUTA2.Visible = True Then + Private i2 As Int = Regex.Replace("[^0-9.]", E_RUTA2.text,"") 'Quitamos alfanumericos y convertimos en entero. + E_RUTA2.text = i2 Rut_Rep = e_ruta.Text & " " & E_RUTA2.Text Else Rut_Rep = e_ruta.Text @@ -2078,49 +2083,58 @@ Sub connecta_Click p_transparenteActualizacion.Visible = False B4XPages.ShowPage("Login") Else ' No hay actualización, continuamos con la carga. - p_transparenteActualizacion.Visible = False - B4XPages.MainPage.reqManager.Initialize(Me, Starter.server) - teclado.HideKeyboard - connecta1 = connecta1 + 1 - 'imei = p.GetDeviceId - conn = "1" - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "select_version_GV2" - B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "version") - ' Cuando nos conectamos verificamos que el usuario guardado en BD sea VALIDO. - c=B4XPages.MainPage.skmt.ExecQuery("select USUARIO, PASS from usuarioa") - c.Position=0 - If c.RowCount > 0 And c.GetString("USUARIO") <> "KMTS1" Then - Private usrT As String = c.GetString("USUARIO") - Private passT As String = c.GetString("PASS") + Try + Private i As Int = Regex.Replace("[^0-9.]", e_ruta.text,"") 'Quitamos alfanumericos y convertimos en entero. + Log($"|${i}|"$) + e_ruta.text = i + p_transparenteActualizacion.Visible = False + B4XPages.MainPage.reqManager.Initialize(Me, Starter.server) + teclado.HideKeyboard + connecta1 = connecta1 + 1 + 'imei = p.GetDeviceId + conn = "1" + Dim cmd As DBCommand cmd.Initialize - cmd.Name = "select_usuario_guna_GV2_10" - cmd.Parameters = Array As Object(usrT, passT) - B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "usuarioA") - End If - c.Close - If e_ruta.Text = "BERNA1" Then - cargar.Visible = True - Subir.Visible = True - e_ruta.Text = "" - End If - ToastMessageShow("Validando Conexión." , True) - If connecta1 / 2 = 1 Then - 'SERVER = "http://177.244.63.54:1782" - 'SERVER = "http://keymon.com.mx:1782" - 'SERVER = "http://201.99.139.28:1782" -' B4XPages.MainPage.SERVER = "http://187.189.244.154:1782" -' SERVER = "http://10.0.0.205:1782" - B4XPages.MainPage.reqManager.Initialize(Me, Starter.server) - Else - 'SERVER = "http://keymon.com.mx:1782" - 'SERVER = "http://201.99.139.28:1782" - 'SERVER = "http://177.244.63.54:1782" -' B4XPages.MainPage.SERVER = "http://187.189.244.154:1782" -' SERVER = "http://10.0.0.205:1782" - B4XPages.MainPage.reqManager.Initialize(Me, Starter.server) - End If + cmd.Name = "select_version_GV2" + B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "version") + ' Cuando nos conectamos verificamos que el usuario guardado en BD sea VALIDO. + c=B4XPages.MainPage.skmt.ExecQuery("select USUARIO, PASS from usuarioa") + c.Position=0 + If c.RowCount > 0 And c.GetString("USUARIO") <> "KMTS1" Then + Private usrT As String = c.GetString("USUARIO") + Private passT As String = c.GetString("PASS") + cmd.Initialize + cmd.Name = "select_usuario_guna_GV2_10" + cmd.Parameters = Array As Object(usrT, passT) + B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "usuarioA") + End If + c.Close + If e_ruta.Text = "BERNA1" Then + cargar.Visible = True + Subir.Visible = True + e_ruta.Text = "" + End If + ToastMessageShow("Validando Conexión." , True) + If connecta1 / 2 = 1 Then + 'SERVER = "http://177.244.63.54:1782" + 'SERVER = "http://keymon.com.mx:1782" + 'SERVER = "http://201.99.139.28:1782" +' B4XPages.MainPage.SERVER = "http://187.189.244.154:1782" +' SERVER = "http://10.0.0.205:1782" + B4XPages.MainPage.reqManager.Initialize(Me, Starter.server) + Else + 'SERVER = "http://keymon.com.mx:1782" + 'SERVER = "http://201.99.139.28:1782" + 'SERVER = "http://177.244.63.54:1782" +' B4XPages.MainPage.SERVER = "http://187.189.244.154:1782" +' SERVER = "http://10.0.0.205:1782" + B4XPages.MainPage.reqManager.Initialize(Me, Starter.server) + End If + Catch + Log(LastException) + End Try + + End If End If End If diff --git a/B4A/C_Productos.bas b/B4A/C_Productos.bas index 446c4d1..6b787cb 100644 --- a/B4A/C_Productos.bas +++ b/B4A/C_Productos.bas @@ -82,6 +82,7 @@ End Sub 'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage. Sub B4XPage_Appear + tipo_venta = Subs.traeTipoVentaDeBD LogColor(tipo_venta, Colors.red) prodsMap.Initialize B4XPages.MainPage.skmt.ExecNonQuery2($"UPDATE ${Subs.traeTablaProds(tipo_venta)} SET CAT_GP_TIPOPROD = (?) WHERE CAT_GP_TIPOPROD = (?)"$,Array As Object("PRIORITARIO","1")) @@ -539,22 +540,27 @@ Sub b_prodMas_Click End Sub Private Sub et_pCant_TextChanged (Old As String, New As String) -' LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta) - Try + LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta) +' Try Dim index As Int = clv_productos.GetItemFromView(Sender) Dim pnl0 As B4XView = clv_productos.GetPanel(index) Dim pnl As B4XView = pnl0.GetView(0) Dim laCant As B4XView = pnl.GetView(2).GetView(3) Dim esteTag As List = Regex.Split("\|", laCant.Tag) +' Log($"${esteTag}, ${laCant.text}"$) + If New = "" Then + laCant.Text = "0" + New = "0" + End If If esteTag.Get(1) < New Then laCant.Text = esteTag.Get(1) If Not(Old = "0" And New = "") And etCantHasFocus Then - Log(esteTag) +' Log(esteTag) Subs.actualizaProducto(Subs.traeAlmacen, esteTag.Get(0), laCant.Text, Subs.traeProdNombre(esteTag.Get(2)), esteTag.Get(2), Subs.traeCliente, Subs.traeFecha, Subs.traeUsuarioDeBD, Subs.traeRuta, 0, B4XPages.MainPage.tipo_venta) cuentaProds End If - Catch - Log(LastException) - End Try +' Catch +' Log(LastException) +' End Try End Sub Sub et_pCant_Click @@ -570,6 +576,8 @@ Private Sub et_pCant_FocusChanged (HasFocus As Boolean) Dim pnl0 As B4XView = clv_productos.GetPanel(index) Dim pnl As B4XView = pnl0.GetView(0) Dim laCant As B4XView = pnl.GetView(2).GetView(3) + Log($"LaCant = ${laCant.text}"$) + If laCant.Text = "" Then laCant.Text = "0" Dim esteTag As List = Regex.Split("\|", laCant.Tag) Log(esteTag) Log(laCant.text) diff --git a/B4A/Files/cliente.bal b/B4A/Files/cliente.bal index 29cb8de70a37cc058dd9ac58cb51cbfb3e3b8c6c..a66cfc04249fb593cfd287d1eed195d363bd551d 100644 GIT binary patch delta 21 dcmZ4Tg=xtbrVYDyPTudzHhDvq_~aWqeE@%S3n~Br delta 17 ZcmZ4Tg=xtbrVYDyPFCm^nS6d{C;(K%2^#