2/11/23 - Código para activar la Geocerca desde el engrane.

- Se agregó código para activar o desactivar la geocerca en el engrane, se requiere ingresar la contraseña del supervisor
This commit is contained in:
2023-11-02 15:02:48 -06:00
parent 626a4eb59c
commit 5ad7ce20f9
5 changed files with 85 additions and 17 deletions

View File

@@ -9,6 +9,7 @@ Sub Class_Globals
Private xui As XUI 'ignore
'// Process Globals
Dim g As GPS
dim kh as kms_helperSubs
Dim reqManager As DBRequestManager
Dim ruta As String
Dim clie_id As String
@@ -281,10 +282,13 @@ Sub Class_Globals
Dim dentroDeGeocerca As Boolean = False
Dim motivoNoVenta As String = ""
Dim precision As Int = 0
Dim clienteDeudor As Boolean = False
Dim usarGeocerca As Boolean = False
End Sub
'You can add more parameters here.
Public Sub Initialize As Object
kh.Initialize(Me, "kh")
Return Me
End Sub
@@ -376,8 +380,8 @@ Sub B4XPage_Appear
b_inicioFinVenta.Visible = False
End If
reqManager.Initialize(Me, Starter.DBReqServer)
usarGeocerca = kh.traeUsarGeocerca
' Log(Subs.traeUltimaActividadBD)
' P_INF_GENERAL.Height = Root.Height
' P_INF_GENERAL.Width = Root.Width
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MACIMP"))
@@ -474,9 +478,11 @@ Sub B4XPage_Appear
If CREDITO = "1" Then
Msgbox("ALTO","A este cliente no se le puede vender ya que tienen adeudo en su crédito") 'ignore
B_VENTA.Visible = False
clienteDeudor = True
' gest.Visible = False
Else
B_VENTA.Visible = True
clienteDeudor = False
' gest.Visible = True
End If
' Msgbox(c.GetString("CAT_CL_NUM_SERIEFISICO"),"AVISO")
@@ -704,27 +710,21 @@ Sub GPS_LocationChanged (Location1 As Location)
'''' GEO CERCA
'''' esto es para la geocerca validar tambien el las variables del whats y del no venta que las borra si existe venta
Dim l1, l2 As Location
' Dim l1, l2 As Location
' Log($"${Starter.lat_gps}, ${Starter.lon_gps}"$)
If Starter.lat_gps = "null" Or Starter.lat_gps = Null Or Starter.lat_gps = "" Then 'Zocalo
Starter.lat_gps = "19.432568527069805"
Starter.lon_gps = "-99.13335030112772"
End If
l1.Initialize2(Starter.lat_gps, Starter.lon_gps)
' Log($"Coordenadas de la tienda - lat:${m_lat}, lon:${m_lon}"$)
l2.Initialize2(m_lat, m_lon)
Dim distance As Long
distance = l1.DistanceTo(l2) ' resultado en metros
' gest.Visible = True
' gps_boton_doe ="1"
' LogColor($"Distancia actual: ${distance}"$, Colors.Blue)
If distance <= 5000000 Or usuario = "KMTSKLL1" Or la_cuenta.Text = "0" Then
'Si no estamos usando la geocerca o ya estanos dentro de la geocerca o el usuario es KMTS1 o es abordo ...
If Not(usarGeocerca) Or dentroDeGeocerca Or usuario = "KMTSKLL1" Or la_cuenta.Text = "0" Then
' If pgs_boton_noventa = "1" Then b_noVenta.Visible = True
' If gps_boton_doe ="1" Then b_whats.Visible = True
B_VENTA.Visible = True
If Not(clienteDeudor) Then B_VENTA.Visible = True 'Si el cliente no tiene adeudo, habilitamos el boton de venta
pedido_doe_muestra
Else
b_noVenta.Visible = False