- VERSION 5.12.12

- Se agrego el codigo para las promociones por rango y se aplico en los tickets impresoso y pdfs
This commit is contained in:
2025-12-18 16:54:23 -06:00
parent 5f6f3ac545
commit 7fff665461
13 changed files with 272 additions and 149 deletions

View File

@@ -377,7 +377,7 @@ Sub Service_Start (StartingIntent As Intent)
End Sub
Public Sub Track
' Log("Inicia Track - Tracking : "&Tracking)
Log("Inicia Track - Tracking : "&Tracking)
If Not(FLP.IsInitialized) Then FLP.Initialize("flp")
If Not(FLP.IsConnected) Then FLP.Connect
If Tracking And actualLR.IsInitialized Then
@@ -393,7 +393,7 @@ Public Sub Track
End Sub
Public Sub StartFLP
' Log("StartFLP - flpStarted="&flpStarted)
Log("StartFLP - flpStarted="&flpStarted)
Do While FLP.IsConnected = False
Sleep(500)
' Log("sleeping")
@@ -407,8 +407,22 @@ Public Sub StartFLP
' End If
End Sub
Public Sub StartFLP2
Log("StartFLP2")
Private logger As Boolean = True
If logger Then Log("StartFLP2 - flpStarted="&flpStarted)
Do While FLP.IsConnected = False
Sleep(500)
If logger Then Log("kll - sleeping")
Loop
dameUltimaUbicacionConocida 'Regresamos ultima ubicacion conocida
FLP.RequestLocationUpdates(CreateLocationRequest2) 'Buscamos ubicacion 2 peticiones
If logger Then LogColor("Buscamos ubicacion (movimientoMinimo = "&actualLR.GetSmallestDisplacement&")", Colors.Magenta)
' If logger Then Log(actualLR.GetSmallestDisplacement)
End Sub
Public Sub StartFLPSmall
' Log("StartFLPSmall - flpStarted="&flpStarted)
Log("StartFLPSmall - flpStarted="&flpStarted)
Do While FLP.IsConnected = False
Sleep(500)
Log("sleeping")
@@ -420,25 +434,25 @@ Public Sub StartFLPSmall
End Sub
Private Sub CreateLocationRequest As LocationRequest
' Log("CreateLocationRequest")
Log("CreateLocationRequest")
Dim lr As LocationRequest
lr.Initialize
lr.SetInterval(1) 'Intervalo deseado para actualizaciones de ubicacion
lr.SetInterval(2000) 'Intervalo deseado para actualizaciones de ubicacion
lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion
lr.SetSmallestDisplacement(10) 'Solo registra cambio de ubicacion si es mayor a XX mts
lr.SetSmallestDisplacement(15) 'Solo registra cambio de ubicacion si es mayor a XX mts
lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY)
actualLR=lr
Return lr
End Sub
Private Sub CreateLocationRequestSmallD As LocationRequest
' Log("Iniciamos CreateLocationRequestSmallD")
Log("Iniciamos CreateLocationRequestSmallD")
Dim lr As LocationRequest
lr.Initialize
lr.SetInterval(2000) 'Intervalo deseado para actualizaciones de ubicacion
lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion
lr.setNumUpdates(2) 'Solicitamos solo 2 actualizaciones con estos parametros
lr.SetSmallestDisplacement(0) 'Solo registra cambio de ubicacion si es mayor a XX mts
lr.SetSmallestDisplacement(1) 'Solo registra cambio de ubicacion si es mayor a XX mts
lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY)
actualLR=lr
Return lr
@@ -455,26 +469,13 @@ Sub dameUltimaUbicacionConocida
End Sub
Public Sub StopFLP
'Log("StopFLP")
Log("StopFLP")
If flpStarted Then
FLP.RemoveLocationUpdates 'Eliminamos todas las solicitudes de ubicacion
flpStarted = False
End If
End Sub
Public Sub StartFLP2
Private logger As Boolean = True
If logger Then Log("StartFLP2 - flpStarted="&flpStarted)
Do While FLP.IsConnected = False
Sleep(500)
If logger Then Log("kll - sleeping")
Loop
dameUltimaUbicacionConocida 'Regresamos ultima ubicacion conocida
FLP.RequestLocationUpdates(CreateLocationRequest2) 'Buscamos ubicacion 2 peticiones
If logger Then LogColor("Buscamos ubicacion (movimientoMinimo = "&actualLR.GetSmallestDisplacement&")", Colors.Magenta)
' If logger Then Log(actualLR.GetSmallestDisplacement)
End Sub
Private Sub CreateLocationRequest2 As LocationRequest
Private logger As Boolean = True
If logger Then Log("Iniciamos CreateLocationRequest2")
@@ -490,8 +491,8 @@ Private Sub CreateLocationRequest2 As LocationRequest
End Sub
Sub flp_LocationChanged (Location1 As Location)
' ToastMessageShow("Loc changed", False)
Log($"Loc changed:${Location1.Longitude},${Location1.Latitude}"$)
' ToastMessageShow("Loc changed", False)
B4XPages.MainPage.lat_gps = Location1.Latitude
B4XPages.MainPage.lon_gps = Location1.Longitude
UUGCoords = Location1
@@ -524,9 +525,10 @@ Sub flp_LocationChanged (Location1 As Location)
End If
CallSub2(Starter, "GPS_LocationChanged", Location1)
CallSub2(B4XPages.MainPage.cliente, "GPS_LocationChanged", Location1)
' CallSub2(B4XPages.MainPage.cliente, "GPS_LocationChanged", Location1)
' CallSub2(gestion, "GPS_LocationChanged", Location1)
If B4XPages.MainPage.cliente.IsInitialized Then
If B4XPages.MainPage.cliente.IsInitialized And Starter.enCliente Then
CallSub2(B4XPages.GetPage("Cliente"), "GPS_LocationChanged", Location1)
End If
If B4XPages.MainPage.nuevoCliente.IsInitialized Then