- VERSION 4.11.02

- Se corrige que cuando en el catalogo de productos se pone una cantidad de producto y luego se borra directamente en la cantidad, se quedaba la cantidad previamente selecionada.
- Se pone codigo para que se maneje Venta y Preventa, se lee la información de CAT_RUTAS/CAT_RU_CATEGORIA, falta la parte de "AMBOS". (En revision por Dulce)
- Se agregaron 7 almacenes para que se active la encuesta de Pedigree.
This commit is contained in:
Jose Alberto Guerra Ugalde
2024-11-05 19:29:19 -06:00
parent 217b955083
commit 35fb2b6401
7 changed files with 98 additions and 69 deletions

View File

@@ -487,9 +487,6 @@ End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage. 'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Sub B4XPage_Appear 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 iniciofin
que_modulo = 1 que_modulo = 1
dentroDeGeocerca = False dentroDeGeocerca = False
@@ -512,13 +509,13 @@ Sub B4XPage_Appear
b_Inicio_Fin_venta.Text = "INICIAR VENTA" b_Inicio_Fin_venta.Text = "INICIAR VENTA"
b_Inicio_Fin_venta.BringToFront b_Inicio_Fin_venta.BringToFront
' LogColor(">>>>>> EN VENTA: " & Starter.enVenta, Colors.red) ' LogColor(">>>>>> EN VENTA: " & Starter.enVenta, Colors.red)
If Not(Starter.enVenta) Then ' If Not(Starter.enVenta) Then
b_Inicio_Fin_venta.Visible = True ' b_Inicio_Fin_venta.Visible = True
Log("EnVenta Visible") ' Log("EnVenta Visible")
Else ' Else
Log("EnVenta NO Visible") ' Log("EnVenta NO Visible")
b_Inicio_Fin_venta.Visible = False ' b_Inicio_Fin_venta.Visible = False
End If ' End If
If Subs.hayPedido Then 'Si hay pedido, deshabilitamos el boton de "No Venta" If Subs.hayPedido Then 'Si hay pedido, deshabilitamos el boton de "No Venta"
Log(">>>>> HAY PEDIDO") Log(">>>>> HAY PEDIDO")
@@ -915,6 +912,10 @@ Sub B4XPage_Appear
b_Inicio_Fin_venta.Visible = False b_Inicio_Fin_venta.Visible = False
' ToastMessageShow("aaa", False) ' ToastMessageShow("aaa", False)
End If 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}"$) ' Log($"ALMACEN: ${ALMACEN}${CRLF}RUTA:${LA_RUTA}"$)
End Sub End Sub
@@ -1118,17 +1119,13 @@ End Sub
'Muestra u oculta el boton de inicio y fin de venta 'Muestra u oculta el boton de inicio y fin de venta
Private Sub iniciofin Private Sub iniciofin
Log(">>>>> " & Starter.enVenta)
If Starter.enVenta = False Then If Starter.enVenta = False Then
Log(333)
p_transparenteInicioFin.BringToFront p_transparenteInicioFin.BringToFront
p_transparenteInicioFin.Visible = True p_transparenteInicioFin.Visible = True
b_Inicio_Fin_venta.Visible = True b_Inicio_Fin_venta.Visible = True
' Log("Hacemos visible el boton de Inicio Venta") ' Log("Hacemos visible el boton de Inicio Venta")
Else Else
Log(4444)
If b_Inicio_Fin_venta.Text <> "TERMINAR VENTA" Then If b_Inicio_Fin_venta.Text <> "TERMINAR VENTA" Then
Log(555)
p_transparenteInicioFin.Visible = False p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False b_Inicio_Fin_venta.Visible = False
End If End If
@@ -1221,13 +1218,24 @@ Sub gest_Click
' En SCAT es ruta 3 ' En SCAT es ruta 3
' Norte 45 (79) Rutas: 702, 703, 707, 718, 730, 732, 733, 734. ' 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 Private rutasEncuesta As List
rutasEncuesta.Initialize2(Array As Int(702, 703, 707, 718, 730, 732, 733, 734)) 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 ' ALMACEN = 79
' LA_RUTA = 732 ' 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)}"$) Log($"${cuest.encuestaIniciada} - ${cuest.clienteConCuestionario(Subs.traeCliente)}"$)
If Not(cuest.encuestaIniciada) And Not(cuest.clienteConCuestionario(Subs.traeCliente)) Then 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")) 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 If
End Sub End Sub
Private Sub b_Inicio_Fin_venta_Click Private Sub b_Inicio_Fin_venta_Click
' b_Inicio_Fin_venta.Visible = False ' 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, "", "") ' 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, "", "")

View File

@@ -347,6 +347,7 @@ Sub B4XPage_Appear
' LogColor($"########## ${Subs.traeRuta} ##########"$, Colors.red) ' LogColor($"########## ${Subs.traeRuta} ##########"$, Colors.red)
p_principal.Visible = True p_principal.Visible = True
' Log($"|${Subs.traeTipoVentaDeBD}|"$) ' Log($"|${Subs.traeTipoVentaDeBD}|"$)
If Subs.traeTipoVentaDeBD = "VENTA" Or Subs.traeTipoVentaDeBD = "ABORDO" Then b_abordo.Visible = True Else b_abordo.Visible = False If Subs.traeTipoVentaDeBD = "VENTA" Or Subs.traeTipoVentaDeBD = "ABORDO" Then b_abordo.Visible = True Else b_abordo.Visible = False
E_RUTA2.Text = "" E_RUTA2.Text = ""
p_ruta2.Visible = False p_ruta2.Visible = False
@@ -844,7 +845,11 @@ Sub Subir_Click
End Sub End Sub
Sub cargar_Click 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 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 Rut_Rep = e_ruta.Text & " " & E_RUTA2.Text
Else Else
Rut_Rep = e_ruta.Text Rut_Rep = e_ruta.Text
@@ -2078,49 +2083,58 @@ Sub connecta_Click
p_transparenteActualizacion.Visible = False p_transparenteActualizacion.Visible = False
B4XPages.ShowPage("Login") B4XPages.ShowPage("Login")
Else ' No hay actualización, continuamos con la carga. Else ' No hay actualización, continuamos con la carga.
p_transparenteActualizacion.Visible = False Try
B4XPages.MainPage.reqManager.Initialize(Me, Starter.server) Private i As Int = Regex.Replace("[^0-9.]", e_ruta.text,"") 'Quitamos alfanumericos y convertimos en entero.
teclado.HideKeyboard Log($"|${i}|"$)
connecta1 = connecta1 + 1 e_ruta.text = i
'imei = p.GetDeviceId p_transparenteActualizacion.Visible = False
conn = "1" B4XPages.MainPage.reqManager.Initialize(Me, Starter.server)
Dim cmd As DBCommand teclado.HideKeyboard
cmd.Initialize connecta1 = connecta1 + 1
cmd.Name = "select_version_GV2" 'imei = p.GetDeviceId
B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "version") conn = "1"
' Cuando nos conectamos verificamos que el usuario guardado en BD sea VALIDO. Dim cmd As DBCommand
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.Initialize
cmd.Name = "select_usuario_guna_GV2_10" cmd.Name = "select_version_GV2"
cmd.Parameters = Array As Object(usrT, passT) B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "version")
B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "usuarioA") ' Cuando nos conectamos verificamos que el usuario guardado en BD sea VALIDO.
End If c=B4XPages.MainPage.skmt.ExecQuery("select USUARIO, PASS from usuarioa")
c.Close c.Position=0
If e_ruta.Text = "BERNA1" Then If c.RowCount > 0 And c.GetString("USUARIO") <> "KMTS1" Then
cargar.Visible = True Private usrT As String = c.GetString("USUARIO")
Subir.Visible = True Private passT As String = c.GetString("PASS")
e_ruta.Text = "" cmd.Initialize
End If cmd.Name = "select_usuario_guna_GV2_10"
ToastMessageShow("Validando Conexión." , True) cmd.Parameters = Array As Object(usrT, passT)
If connecta1 / 2 = 1 Then B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "usuarioA")
'SERVER = "http://177.244.63.54:1782" End If
'SERVER = "http://keymon.com.mx:1782" c.Close
'SERVER = "http://201.99.139.28:1782" If e_ruta.Text = "BERNA1" Then
' B4XPages.MainPage.SERVER = "http://187.189.244.154:1782" cargar.Visible = True
' SERVER = "http://10.0.0.205:1782" Subir.Visible = True
B4XPages.MainPage.reqManager.Initialize(Me, Starter.server) e_ruta.Text = ""
Else End If
'SERVER = "http://keymon.com.mx:1782" ToastMessageShow("Validando Conexión." , True)
'SERVER = "http://201.99.139.28:1782" If connecta1 / 2 = 1 Then
'SERVER = "http://177.244.63.54:1782" 'SERVER = "http://177.244.63.54:1782"
' B4XPages.MainPage.SERVER = "http://187.189.244.154:1782" 'SERVER = "http://keymon.com.mx:1782"
' SERVER = "http://10.0.0.205:1782" 'SERVER = "http://201.99.139.28:1782"
B4XPages.MainPage.reqManager.Initialize(Me, Starter.server) ' B4XPages.MainPage.SERVER = "http://187.189.244.154:1782"
End If ' 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 End If
End If End If

View File

@@ -82,6 +82,7 @@ End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage. 'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Sub B4XPage_Appear Sub B4XPage_Appear
tipo_venta = Subs.traeTipoVentaDeBD
LogColor(tipo_venta, Colors.red) LogColor(tipo_venta, Colors.red)
prodsMap.Initialize prodsMap.Initialize
B4XPages.MainPage.skmt.ExecNonQuery2($"UPDATE ${Subs.traeTablaProds(tipo_venta)} SET CAT_GP_TIPOPROD = (?) WHERE CAT_GP_TIPOPROD = (?)"$,Array As Object("PRIORITARIO","1")) 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 End Sub
Private Sub et_pCant_TextChanged (Old As String, New As String) Private Sub et_pCant_TextChanged (Old As String, New As String)
' LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta) LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta)
Try ' Try
Dim index As Int = clv_productos.GetItemFromView(Sender) Dim index As Int = clv_productos.GetItemFromView(Sender)
Dim pnl0 As B4XView = clv_productos.GetPanel(index) Dim pnl0 As B4XView = clv_productos.GetPanel(index)
Dim pnl As B4XView = pnl0.GetView(0) Dim pnl As B4XView = pnl0.GetView(0)
Dim laCant As B4XView = pnl.GetView(2).GetView(3) Dim laCant As B4XView = pnl.GetView(2).GetView(3)
Dim esteTag As List = Regex.Split("\|", laCant.Tag) 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 esteTag.Get(1) < New Then laCant.Text = esteTag.Get(1)
If Not(Old = "0" And New = "") And etCantHasFocus Then 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) 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 cuentaProds
End If End If
Catch ' Catch
Log(LastException) ' Log(LastException)
End Try ' End Try
End Sub End Sub
Sub et_pCant_Click 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 pnl0 As B4XView = clv_productos.GetPanel(index)
Dim pnl As B4XView = pnl0.GetView(0) Dim pnl As B4XView = pnl0.GetView(0)
Dim laCant As B4XView = pnl.GetView(2).GetView(3) 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) Dim esteTag As List = Regex.Split("\|", laCant.Tag)
Log(esteTag) Log(esteTag)
Log(laCant.text) Log(laCant.text)

Binary file not shown.

View File

@@ -253,7 +253,7 @@ Version=12.8
#Region Project Attributes #Region Project Attributes
#ApplicationLabel: Guna Preventa #ApplicationLabel: Guna Preventa
#VersionCode: 1 #VersionCode: 1
#VersionName: 4.10.28 #VersionName: 4.11.02
'SupportedOrientations possible values: unspecified, landscape or portrait. 'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait #SupportedOrientations: portrait
#CanInstallToExternalStorage: False #CanInstallToExternalStorage: False

View File

@@ -55,7 +55,7 @@ ModuleClosedNodes1=11,13,14
ModuleClosedNodes10= ModuleClosedNodes10=
ModuleClosedNodes11= ModuleClosedNodes11=
ModuleClosedNodes12=6 ModuleClosedNodes12=6
ModuleClosedNodes13=3 ModuleClosedNodes13=1,3
ModuleClosedNodes14=3,17 ModuleClosedNodes14=3,17
ModuleClosedNodes15= ModuleClosedNodes15=
ModuleClosedNodes16= ModuleClosedNodes16=
@@ -70,12 +70,12 @@ ModuleClosedNodes23=3,4,5,6,7,8,9
ModuleClosedNodes24= ModuleClosedNodes24=
ModuleClosedNodes25= ModuleClosedNodes25=
ModuleClosedNodes3= ModuleClosedNodes3=
ModuleClosedNodes4= ModuleClosedNodes4=3
ModuleClosedNodes5= ModuleClosedNodes5=
ModuleClosedNodes6=8,9,10,11 ModuleClosedNodes6=8,9,10,11
ModuleClosedNodes7= ModuleClosedNodes7=
ModuleClosedNodes8= ModuleClosedNodes8=
ModuleClosedNodes9= ModuleClosedNodes9=
NavigationStack=C_Principal,B4XPage_Appear,342,5,Subs,revisaProdFueraDePromo,1699,0,C_Cliente,B4XPage_Created,474,0,C_Cliente,p_pideGeoPass_Click,1106,0,Visual Designer,cliente.bal,-100,6,Subs,traeTipoVentaDeBD,1711,6,Tracker,flp_LocationChanged,174,0,C_Cliente,iniciofin,1110,6,C_Cliente,GPS_LocationChanged,1084,1,C_Cliente,B4XPage_Appear,508,6 NavigationStack=C_Productos,et_pCant_TextChanged,537,6,Visual Designer,cliente.bal,-100,2,Subs,traeTablaProds,1683,0,Subs,agregaColumna,1182,0,Starter,JobDone,139,0,Starter,Application_Error,135,0,C_Principal,e_ruta_Click,2811,0,C_Principal,B_OK_PANEL5_Click,2804,0,C_Principal,JobDone,1177,0,C_Cliente,gest_Click,1226,6,Main,Globals,23,0
SelectedBuild=0 SelectedBuild=0
VisibleModules=23,2,13,24,4,5,14,9,25 VisibleModules=23,2,13,24,4,5,14,9,25

View File

@@ -1687,7 +1687,7 @@ End Sub
Sub traeTablaProds(tipoventa As String) As String Sub traeTablaProds(tipoventa As String) As String
Private tablaProds As String = "cat_gunaprod2" Private tablaProds As String = "cat_gunaprod2"
If tipoventa = "ABORDO" Or tipoventa = "PREVENTA" Then tablaProds = "cat_gunaprod" If tipoventa = "ABORDO" Or tipoventa = "PREVENTA" Then tablaProds = "cat_gunaprod"
LogColor($"Tipo= ${tipoventa}, tabla=${tablaProds}"$, Colors.RGB(200,136,0)) ' LogColor($"Tipo= ${tipoventa}, tabla=${tablaProds}"$, Colors.RGB(200,136,0))
Return tablaProds Return tablaProds
End Sub End Sub