- VERSION 4.10.02

- Se agregó el almacen a todas las tablas necesarias y a los queries de envio de información.
This commit is contained in:
Jose Alberto Guerra Ugalde
2024-10-03 15:24:11 -06:00
parent e85f953e73
commit ead56c8758
16 changed files with 2900 additions and 358 deletions

View File

@@ -113,13 +113,17 @@ Sub Activity_Create(FirstTime As Boolean)
End Sub
Sub MapFragment1_Ready
' Msgbox("111","AVISO")
gmap = MapFragment1.GetMap
gmap.IsInitialized
'todos= 1
'permisos
' Msgbox("11","AVISO")
If gmap.IsInitialized Then ' Esto es para capturar el "clic largo" de la etiqueta de los marcadores.
Dim jo As JavaObject = gmap
Dim event As Object = jo.CreateEventFromUI("com.google.android.gms.maps.GoogleMap.OnInfoWindowLongClickListener", "InfoWindowLongClick", Null)
jo.RunMethod("setOnInfoWindowLongClickListener", Array(event))
End If
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
@@ -129,14 +133,12 @@ Sub MapFragment1_Ready
JavaMapsObject = gmap.GetUiSettings
JavaMapsObject.RunMethod("setMapToolbarEnabled", Array As Object(True))
' Msgbox("12","AVISO")
'''''''----------------------------MARKER AZUL - POR ENTREGAR
Private esteAzul As Int = 0
Private esteAzul2 As String
If azul = 1 Or todos = 1 Then
c.IsInitialized
c=Starter.skmt.ExecQuery("select CAT_CL_CODIGO, SECUENCIA, CAT_CL_NOMBRE, CAT_CL_LAT, CAT_CL_LONG, CAT_CL_RUTA from kmt_info where gestion = 0 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0 order by CAT_CL_RUTA")
c = Starter.skmt.ExecQuery("select CAT_CL_CODIGO, SECUENCIA, CAT_CL_NOMBRE, CAT_CL_LAT, CAT_CL_LONG, CAT_CL_RUTA from kmt_info where gestion = 0 and CAT_CL_LAT <> 'null' and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0 order by CAT_CL_RUTA")
' Msgbox("2","AVISO")
rutaAnt = ""
For i = 0 To c.RowCount -1
@@ -155,14 +157,14 @@ Sub MapFragment1_Ready
If esteAzul = 4 Then esteAzul2=gmap.HUE_AZURE+50
If esteAzul = 5 Then esteAzul2=gmap.HUE_AZURE+75
' Log(ruta & "|" & esteAzul & "|" & esteAzul2)
MARK_AZUL = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO,LoadBitmap(File.DirAssets, esteAzul2))
MARK_AZUL = gmap.AddMarker3(LatitudRu, LongitudRU, CODIGO, LoadBitmap(File.DirAssets, esteAzul2))
MARK_AZUL.Snippet = "R: " & ruta & " - " & Tienda
rutaAnt = ruta
Next
c .Close
If MARK_AZUL.IsInitialized Then LIST_AZUL.Add(MARK_AZUL)
End If
' Msgbox("3","AVISO")
'''''''----------------------------MARKER VERDE- ENTREGADO
If verde = 1 Or todos = 1 Then
@@ -201,6 +203,7 @@ Sub MapFragment1_Ready
End If
' '''''''----------------------------MARKER ROJO - NO ENTREGADO
Private esteRojo As Int = 0
Private esteRojo2 As String
If rojo = 1 Or todos = 1 Then
@@ -261,6 +264,27 @@ Sub OnInfoWindowClickListener1_click(Marker1 As Marker)
B4XPages.ShowPage("Cliente")
End Sub
'Evento del clic largo de la etiqueta del marcador.
Sub InfoWindowLongClick_Event (MethodName As String, Args() As Object) As Object
Dim m As Marker = Args(0)
Log(m.Snippet)
Log($"Marker: ${m.Title} was long clicked"$)
Private RES As String = Msgbox2($"¿Quieres usar la tienda ${m.Title} como tu punto de inicio?"$, "Punto de inicio", "SI", "", "NO", Null)
If RES = DialogResponse.POSITIVE Then
Private t As ResultSet = Starter.skmt.ExecQuery($"select cat_cl_lat, cat_cl_long from kmt_info where cat_cl_codigo = '${m.Title}'"$)
Do While t.NextRow
Starter.inicioMapa = True
Log($"${m.Title}, ${t.GetString("CAT_CL_LAT")}, ${t.GetString("CAT_CL_LONG")}"$)
Starter.inicioLat = t.GetString("CAT_CL_LAT") + 0.000001
Starter.inicioLon= t.GetString("CAT_CL_LONG") + 0.000001
B4XPages.ShowPage("clientes")
B4XPages.MainPage.clientes.caculaRutaGPS(B4XPages.MainPage.clientes.todosAVisitar)
B4XPages.ShowPage("clientes")
Loop
End If
Return Null
End Sub
Sub GPS_LocationChanged (Parametro As Location)
'MARK_CEDIS.IsInitialized
' Dim sp As Int
@@ -328,6 +352,4 @@ Sub B_AZUL_Click
todos = 0
gmap.Clear
MapFragment1_Ready
End Sub
End Sub