Version: 4.10.27

Se agrego una columna a BITACORAGPS para saber si usaron la contraseña de la geocerca, 0 es inactivo y 1 es activo, tambien se manda la version a TMP_DROP
This commit is contained in:
IsR0d
2024-10-28 17:49:47 -06:00
parent 0bf6c528ff
commit d49ef2d100
7 changed files with 82 additions and 74 deletions

View File

@@ -426,6 +426,8 @@ Sub Class_Globals
Private geoCont As Int = 0
Private l_version As Label
Private p_transparenteInicioFin As Panel
Dim b_geo As String
End Sub
'You can add more parameters here.
@@ -944,9 +946,11 @@ Sub GPS_LocationChanged (Location1 As Location)
gest.Visible = True
Tels.Visible = True
iniciofin
b_geo = "0"
Else If geo = "1" Then
gest.Visible = False
Tels.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
End If
End If
@@ -957,6 +961,7 @@ Sub GPS_LocationChanged (Location1 As Location)
gest.Visible = True
iniciofin
precision = "1"
b_geo = "0"
ToastMessageShow("DENTRO de rango GPS", False)
Else If habi = "1" Then
c = skmt.ExecQuery2("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",Array As String("LATITUD"))
@@ -981,17 +986,20 @@ Sub GPS_LocationChanged (Location1 As Location)
LA_GEO.TextColor = Colors.Blue
Tels.Visible = True
gest.Visible = True
b_geo = "1"
iniciofin
ToastMessageShow("DENTRO de rango GPS", False)
Else If distancealm > 50 Then
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
c = skmt.ExecQuery("SELECT PC_CLIENTE FROM PEDIDO_CLIENTE WHERE PC_CLIENTE IN (Select CUENTA from cuentaa)")
If c.RowCount > 0 Then
precision = "0"
Tels.Visible = True
gest.Visible = True
b_geo = "0"
iniciofin
Else If c.RowCount = 0 Then
c = skmt.ExecQuery("SELECT NV_CLIENTE FROM NOVENTA CLIENTE WHERE NV_CLIENTE IN (Select CUENTA from cuentaa)")
@@ -999,15 +1007,18 @@ Sub GPS_LocationChanged (Location1 As Location)
Tels.Visible = True
gest.Visible = True
precision = "0"
b_geo = "0"
iniciofin
Else If c.RowCount = 0 Then
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
LA_GEO.TextColor = Colors.Red
If ALMACEN = "1" Then
Tels.Visible = False
gest.Visible = True
b_geo = "0"
iniciofin
End If
End If
@@ -1016,6 +1027,7 @@ Sub GPS_LocationChanged (Location1 As Location)
If ALMACEN = "1" Then
Tels.Visible = False
gest.Visible = True
b_geo = "0"
iniciofin
End If
End If
@@ -1024,24 +1036,29 @@ Sub GPS_LocationChanged (Location1 As Location)
If c.RowCount > 0 Then
Tels.Visible = True
gest.Visible = True
b_geo = "0"
iniciofin
Else If c.RowCount = 0 Then
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
c = skmt.ExecQuery("SELECT NV_CLIENTE FROM NOVENTA CLIENTE WHERE NV_CLIENTE IN (Select CUENTA from cuentaa)")
If c.RowCount > 0 Then
Tels.Visible = True
gest.Visible = True
b_geo = "0"
iniciofin
Else If c.RowCount = 0 Then
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
LA_GEO.TextColor = Colors.Red
If ALMACEN = "1" Then
Tels.Visible = False
gest.Visible = True
b_geo = "0"
iniciofin
End If
End If
@@ -1049,17 +1066,20 @@ Sub GPS_LocationChanged (Location1 As Location)
If ALMACEN = "1" Then
Tels.Visible = False
gest.Visible = True
b_geo = "0"
iniciofin
End If
End If
Else
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
LA_GEO.TextColor = Colors.Red
If ALMACEN = "1" Then
Tels.Visible = False
gest.Visible = True
b_geo = "0"
iniciofin
End If
End If
@@ -1131,7 +1151,7 @@ End Sub
Sub JobDone(Job As HttpJob)
If Job.Success = False Then
' ToastMessageShow("Error: " & Job.ErrorMessage, True)
LogColor("Error: " & Job.tag & " : " & subs.parseHTTPError(Job.ErrorMessage), Colors.red)
LogColor("Error: " & Job.tag & " : " & Subs.parseHTTPError(Job.ErrorMessage), Colors.red)
' LogColor("Error: " & Job.ErrorMessage, Colors.red)
Else
LogColor("JobDone: '" & reqManager.HandleJob(Job).tag & "' - Registros: " & reqManager.HandleJob(Job).Rows.Size, Colors.Green) 'Mod por CHV - 211110
@@ -2018,21 +2038,6 @@ Sub guardadoventa
End Try
DateTime.TimeFormat = "HH:mm:ss"
B4XPages.ShowPage("Principal")
If la_cuenta.Text <> "0" Then 'Si es ABORDO, no mostramos el boton b_Inicio_Fin_venta y regresamos a Principal.
b_Inicio_Fin_venta.Visible = True
Log("Hacemos visible el boton de Inicio Venta3")
Else
b_Inicio_Fin_venta.Visible = False
Starter.enVenta = False
LogColor(">>>>>> ABORDO: " & Starter.enVenta, Colors.red)
Subs.bitacora(Subs.fechanormal(DateTime.Now), usuario, Subs.traeAlmacen, Subs.traeRutasSup, "Venta Abordo", "0", Subs.fechanormal(DateTime.Now), Subs.fechanormal(DateTime.Now), B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, "", "")
LogColor(">>>>>> Ruta: <<<<<<<<<<<<" & Subs.traeRutasSup, Colors.Blue)
Subs.iniciaActividad("principal")
B4XPages.ShowPageAndRemovePreviousPages("Principal")
End If
End Sub
Sub NUEVO_Click
@@ -4753,7 +4758,7 @@ Private Sub b_Inicio_Fin_venta_Click
motivoNoVisita = ""
p_transparenteInicioFin.Visible = False
If b_Inicio_Fin_venta.Text = "TERMINAR VENTA" Then
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRutaBitacora, "Termina Venta", Subs.traeCliente, "", Subs.fechanormal(DateTime.Now), B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, motivoNoVenta, motivoNoVisita)
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRutaBitacora, "Termina Venta", Subs.traeCliente, "", Subs.fechanormal(DateTime.Now), B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, motivoNoVenta, motivoNoVisita,b_geo)
Starter.enVenta = False
' LogColor($">>>>>> TERMINA VENTA: ${Starter.enVenta} - ${Subs.traeCliente}"$, Colors.red)
B4XPages.ShowPageAndRemovePreviousPages("Principal")
@@ -4764,12 +4769,12 @@ Private Sub b_Inicio_Fin_venta_Click
contadorIniciarVenta = contadorIniciarVenta + 1
If contadorIniciarVenta = 1 And IniVenNO = False And motivoNoVenta <> "NO VENTA" Then
IniVenNO = True
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRutaBitacora, "Inicia Venta", Subs.traeCliente, Subs.fechanormal(DateTime.Now), "", B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, "", "")
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRutaBitacora, "Inicia Venta", Subs.traeCliente, Subs.fechanormal(DateTime.Now), "", B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, "", "",b_geo)
Starter.enVenta = True
' LogColor($">>>>>> INICIA VENTA: ${Starter.enVenta} - ${Subs.traeCliente}"$, Colors.red)
Else If contadorIniciarVenta = 1 And IniVenNO = False And motivoNoVenta = "NO VENTA" Then
IniVenNO = True
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRutaBitacora, "Inicia Venta", Subs.traeCliente, Subs.fechanormal(DateTime.Now), "", B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, motivoNoVenta, "")
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRutaBitacora, "Inicia Venta", Subs.traeCliente, Subs.fechanormal(DateTime.Now), "", B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, motivoNoVenta, "",b_geo)
Starter.enVenta = True
Else If contadorIniciarVenta > 1 Then
b_Inicio_Fin_venta.Visible = False