mirror of
https://github.com/KeymonSoft/Mariana.git
synced 2026-04-21 14:49:16 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b65e1b285f | |||
| 0ddb35fb07 | |||
| 6d2594f482 | |||
| a5280c4d43 | |||
| 694502a9f2 | |||
| 896ce0519f |
@@ -94,6 +94,19 @@ Sub Class_Globals
|
||||
Private b_importarBD As Button
|
||||
Private p_importarBDWA As Panel
|
||||
Dim cb_importarBDWA As CheckBox
|
||||
Private cb_geocerca As CheckBox
|
||||
Private passSupervisor As String = ""
|
||||
Private p_transparente As Panel
|
||||
Private p_passGeocerca As Panel
|
||||
Private et_passGeocerca As EditText
|
||||
Private b_passGeocerca As Button
|
||||
Private l_geocerca As Label
|
||||
Private ime As IME
|
||||
Dim latAlmacen As String = "0"
|
||||
Dim lonAlmacen As String = "0"
|
||||
Dim pantallaActual As B4XView
|
||||
Dim recordatorio As C_Recordatorio
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Initialize
|
||||
@@ -105,6 +118,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
B4XPages.GetManager.LogEvents = True
|
||||
Root = Root1
|
||||
Root.LoadLayout("login")
|
||||
recordatorio.Initialize(Root)
|
||||
s.Initialize(Me, "Subs")
|
||||
B4XPages.SetTitle(Me, "Mariana Preventa")
|
||||
login.Initialize
|
||||
@@ -290,10 +304,14 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
Wait For MES_StorageAvailable
|
||||
End If
|
||||
End If
|
||||
p_transparente.Left = 0 : p_transparente.top = 0
|
||||
p_transparente.Width = Root.Width : p_transparente.Height = Root.Height
|
||||
Subs.centraPanel(p_passGeocerca, Root.Width)
|
||||
End Sub
|
||||
|
||||
Sub B4XPage_Appear
|
||||
|
||||
B4XPages.mainpage.pantallaActual = Root
|
||||
passSupervisor = ""
|
||||
If Starter.muestraProgreso = 1 Then
|
||||
muestraProgreso("Descargando actualización")
|
||||
Starter.muestraProgreso = 0
|
||||
@@ -339,29 +357,34 @@ Sub B4XPage_Appear
|
||||
'Obtenemos el usuario registrado
|
||||
' CallSubDelayed(FirebaseMessaging, "SubscribeToTopics")
|
||||
dameUsuario
|
||||
' If Not(CheckNotificationAccess) Then
|
||||
' Msgbox2Async($"Se necesita acceso a las notificaciones, haga clic en "Aceptar" y en la siguiente pantalla permita el acceso a la aplicación "${Application.LabelName}"."$, "Permisos necesarios", "Aceptar", "Cancelar", "", Null, True)
|
||||
' Wait For Msgbox_Result (resultado As Int)
|
||||
' If resultado = DialogResponse.POSITIVE Then
|
||||
' Dim In As Intent
|
||||
' In.Initialize("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS", "")
|
||||
' StartActivity(In)
|
||||
' End If
|
||||
'' Private cd1 As ColorDrawable
|
||||
'' cd1.Initialize(Colors.red, 10dip)
|
||||
'' b_notifAccess.Background = cd1
|
||||
'' b_notifAccess.TextColor = Colors.White
|
||||
'' b_notifAccess.Text = "Activar Permisos"
|
||||
' Else
|
||||
'' Private cd1 As ColorDrawable
|
||||
'' cd1.Initialize(Colors.RGB(109, 221, 101), 10dip)
|
||||
'' b_notifAccess.Background = cd1
|
||||
'' b_notifAccess.TextColor = Colors.White
|
||||
'' b_notifAccess.Text = "Permisos Activos"
|
||||
' End If
|
||||
If Not(CheckNotificationAccess) Then
|
||||
Msgbox2Async($"Se necesita acceso a las notificaciones, haga clic en "Aceptar" y en la siguiente pantalla permita el acceso a la aplicación "${Application.LabelName}"."$, "Permisos necesarios", "Aceptar", "Cancelar", "", Null, True)
|
||||
Wait For Msgbox_Result (resultado As Int)
|
||||
If resultado = DialogResponse.POSITIVE Then
|
||||
Dim In As Intent
|
||||
In.Initialize("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS", "")
|
||||
StartActivity(In)
|
||||
End If
|
||||
' Private cd1 As ColorDrawable
|
||||
' cd1.Initialize(Colors.red, 10dip)
|
||||
' b_notifAccess.Background = cd1
|
||||
' b_notifAccess.TextColor = Colors.White
|
||||
' b_notifAccess.Text = "Activar Permisos"
|
||||
Else
|
||||
' Private cd1 As ColorDrawable
|
||||
' cd1.Initialize(Colors.RGB(109, 221, 101), 10dip)
|
||||
' b_notifAccess.Background = cd1
|
||||
' b_notifAccess.TextColor = Colors.White
|
||||
' b_notifAccess.Text = "Permisos Activos"
|
||||
End If
|
||||
' ks.Initialize(Me, "ks")
|
||||
' ks.vacuum
|
||||
' ks.centraEtiqueta(l_version, Root.Width)
|
||||
Private cu As Cursor = Starter.skmt.ExecQuery("select USUARIO from USUARIOA")
|
||||
If cu.RowCount > 0 Then
|
||||
cu.Position = 0
|
||||
If cu.GetString("USUARIO") <> "" Then user.Text = cu.GetString("USUARIO")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub ks_etiquetaCentrada(success As Boolean)
|
||||
@@ -546,7 +569,34 @@ Sub JobDone(Job As HttpJob)
|
||||
IMEI_BASE = ""
|
||||
IMEI = ""
|
||||
End If
|
||||
If result.Tag = "traePassGeocerca" Then 'query tag
|
||||
Subs.logJobDoneResultados(result)
|
||||
Log(result.Rows.Size)
|
||||
For Each records() As Object In result.Rows
|
||||
Log($"|${records(result.Columns.Get("TMP_PASS"))}|"$)
|
||||
Dim tmp_pass As String = records(result.Columns.Get("TMP_PASS")).As(String)
|
||||
Log(tmp_pass)
|
||||
|
||||
If et_passGeocerca.Text = tmp_pass Then
|
||||
passSupervisor = et_passGeocerca.Text
|
||||
p_transparente.Visible = False
|
||||
et_passGeocerca.Text = ""
|
||||
p_geocerca_Click
|
||||
Else
|
||||
Msgbox("Contraseña equivocada","ATENCIÓN")
|
||||
End If
|
||||
|
||||
cmd.Initialize
|
||||
cmd.Name = "borraPassGeocerca"
|
||||
cmd.Parameters = Array As Object(Subs.traeAlmacen, Subs.traeRuta)
|
||||
reqManager.ExecuteCommand(cmd , "borraPassGeocerca")
|
||||
Next
|
||||
If result.Rows.Size = 0 Then
|
||||
Msgbox("Contraseña equivocada","ATENCIÓN")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Job.Release
|
||||
End If
|
||||
Log($"Paso1 = ${paso1} - Name: ${name} - IMEI: ${IMEI} - IMEI_BASE: ${IMEI_BASE}"$)
|
||||
@@ -610,10 +660,16 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
End Sub
|
||||
|
||||
Sub GPS_LocationChanged (Location1 As Location)
|
||||
If user.text = "GPS" Then
|
||||
user.Text=Location1.Latitude
|
||||
pass.text=Location1.Longitude
|
||||
End If
|
||||
Log("LocationChanged")
|
||||
l_geocerca.Text = "Habilitar Geocerca"
|
||||
Dim l2 As Location
|
||||
l2.Initialize2(latAlmacen, lonAlmacen) ' Coordenadas del almacen
|
||||
Dim distance As Long = Location1.DistanceTo(l2) 'the result is in meters
|
||||
Log("Distancia a almacen: " & distance)
|
||||
' If user.text = "GPS" Then
|
||||
' user.Text=Location1.Latitude
|
||||
' pass.text=Location1.Longitude
|
||||
' End If
|
||||
End Sub
|
||||
|
||||
Sub PopupMenu_Dismiss
|
||||
@@ -714,14 +770,45 @@ Sub ocultaProgreso
|
||||
End Sub
|
||||
|
||||
Sub i_engrane_Click
|
||||
Log(123456789)
|
||||
l_geocerca.Text = "Buscando ubicación ..."
|
||||
CallSubDelayed(Tracker, "StartFLPSmall")
|
||||
If Tracker.FLP.IsInitialized And Tracker.FLP.GetLastKnownLocation.IsInitialized Then 'Si tenemos "UltimaUbicaccionConocida" la usamos.
|
||||
B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude
|
||||
B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude
|
||||
Log($"Tenemos UUC: ${Tracker.FLP.GetLastKnownLocation.Latitude},${Tracker.FLP.GetLastKnownLocation.Longitude}"$)
|
||||
GPS_LocationChanged(Tracker.FLP.GetLastKnownLocation)
|
||||
End If
|
||||
' Log($"Coordenadas de la tienda - lat:${m_lat}, lon:${m_lon}"$)
|
||||
Private x As Cursor = Starter.skmt.ExecQuery($"select CAT_VA_VALOR from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'COORDS_ALMACEN'"$)
|
||||
If x.RowCount > 0 Then
|
||||
x.Position = 0
|
||||
' Log(x.GetString("CAT_VA_VALOR"))
|
||||
Dim coords() As String = Regex.Split(",", x.GetString("CAT_VA_VALOR"))
|
||||
Dim latAlmacen As String = coords(0)
|
||||
Dim lonAlmacen As String = coords(1)
|
||||
End If
|
||||
Log($"lat:${latAlmacen}, lon: ${lonAlmacen}"$)
|
||||
|
||||
lv_server.Clear
|
||||
lv_server.AddSingleLine("http://keymon.net:1781")
|
||||
If user.Text = "KMTS1" Then lv_server.AddSingleLine("http://192.99.93.204:1781")
|
||||
' l_server.Text = Starter.DBReqServer
|
||||
et_server.Text = Starter.DBReqServer
|
||||
Log(222)
|
||||
p_transparente.Visible = False
|
||||
passSupervisor = ""
|
||||
Dim c As Cursor = Starter.skmt.ExecQuery("select * from cat_variables where cat_va_descripcion = 'GEOCERCA_ACTIVA'")
|
||||
' cb_geocerca.Checked = True
|
||||
If c.RowCount > 0 Then
|
||||
c.Position = 0
|
||||
' Log(c.GetString("CAT_VA_VALOR") & " <-------")
|
||||
If c.GetString("CAT_VA_VALOR") = 0 Then cb_geocerca.Checked = False Else cb_geocerca.Checked = True
|
||||
' Log("----> " & cb_geocerca.Checked)
|
||||
End If
|
||||
' Starter.skmt.ExecNonQuery("delete from cat_variables where cat_va_descripcion = 'GEOCERCA_ACTIVA'")
|
||||
' Starter.skmt.ExecNonQuery($"insert into cat_variables (cat_va_descripcion, cat_va_valor) values ('GEOCERCA_ACTIVA', ${cb_geocerca.Checked})"$)
|
||||
' Log("----> " & cb_geocerca.Checked)
|
||||
cb_importarBDWA.Checked = s.traeUsarIntentBDWA
|
||||
Log(333)
|
||||
If user.Text.Trim = "KMTS1" Then
|
||||
p_importarBDWA.Visible = True
|
||||
Else
|
||||
@@ -807,3 +894,63 @@ Private Sub cb_importarBDWA_CheckedChange(Checked As Boolean)
|
||||
Starter.skmt.ExecNonQuery("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'IMPORTAR_BD_WA'")
|
||||
Starter.skmt.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('IMPORTAR_BD_WA', '${Checked}')"$)
|
||||
End Sub
|
||||
|
||||
Private Sub p_transparente_Click
|
||||
p_transparente.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub b_passGeocerca_Click
|
||||
Log("b_passGeocerca clicked")
|
||||
cmd.Initialize
|
||||
cmd.Name = "traePassGeocerca"
|
||||
cmd.Parameters = Array As Object(Subs.traeAlmacen, Subs.traeRuta, et_passGeocerca.text)
|
||||
|
||||
c=Starter.skmt.ExecQuery("select CAT_CL_RUTA from kmt_info")
|
||||
Private r As String = "0"
|
||||
If c.RowCount > 0 Then
|
||||
c.Position=0
|
||||
r = c.GetString("CAT_CL_RUTA")
|
||||
End If
|
||||
|
||||
Log($"${Subs.traeAlmacen}, ${r}, ${et_passGeocerca.text}"$)
|
||||
reqManager.ExecuteQuery(cmd , 0, "traePassGeocerca")
|
||||
|
||||
' If et_passGeocerca.Text = "12345" Then
|
||||
' passSupervisor = et_passGeocerca.Text
|
||||
' p_transparente.Visible = False
|
||||
' et_passGeocerca.Text = ""
|
||||
' Else
|
||||
' Msgbox("Contraseña equivocada","ATENCIÓN")
|
||||
' End If
|
||||
ime.HideKeyboard
|
||||
End Sub
|
||||
|
||||
Private Sub p_geocerca_Click
|
||||
Log("CLICKED")
|
||||
Dim activa As Int = 1
|
||||
If Subs.estamosEnAlmacen(100) Then
|
||||
If l_geocerca.Text <> "Buscando ubicación ..." Then
|
||||
If passSupervisor = "" Then
|
||||
p_transparente.Visible = True
|
||||
Else
|
||||
If cb_geocerca.Checked = False Then
|
||||
cb_geocerca.Checked = True
|
||||
activa = 1
|
||||
Else
|
||||
cb_geocerca.Checked = False
|
||||
activa = 0
|
||||
End If
|
||||
Starter.skmt.ExecNonQuery("delete from cat_variables where cat_va_descripcion = 'GEOCERCA_ACTIVA'")
|
||||
Starter.skmt.ExecNonQuery($"insert into cat_variables (cat_va_descripcion, cat_va_valor) values ('GEOCERCA_ACTIVA', ${activa})"$)
|
||||
End If
|
||||
Else
|
||||
ToastMessageShow("Es necesario tener ubicación", True)
|
||||
End If
|
||||
Else
|
||||
ToastMessageShow("Es necesario estar en el almacen para esta operación", True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub p_geocerca2_Click
|
||||
p_geocerca_Click
|
||||
End Sub
|
||||
|
||||
@@ -144,6 +144,14 @@ Sub Class_Globals
|
||||
Private b_pedidoYalo As Button
|
||||
Private p_transYalo As Panel
|
||||
Private lv_yalo As ListView
|
||||
Dim distance As Long = 500000000000
|
||||
Dim enGeocerca As Boolean = False
|
||||
Private p_transparenteGeocerca As Panel
|
||||
Private p_passGeocerca As Panel
|
||||
Private b_passGeocerca As Button
|
||||
Private et_passGeocerca As EditText
|
||||
Dim l_geoAlmacen As Label
|
||||
Dim rangoAAlmacen As Int = 50
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -197,13 +205,23 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
lv_yalo.top = (Root.Height / 2) - (lv_yalo.Height / 2)
|
||||
btAdmin.Initialize("BlueTeeth")
|
||||
cmp20.Initialize("Printer")
|
||||
p_transparenteGeocerca.top = 0 : p_transparenteGeocerca.Left = 0
|
||||
p_transparenteGeocerca.height = Root.Height : p_transparenteGeocerca.width = Root.width
|
||||
Subs.centraPanel(p_passGeocerca, Root.Width)
|
||||
End Sub
|
||||
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Sub B4XPage_Appear
|
||||
distance = 500000000000
|
||||
B4XPages.MainPage.lon_gps = 0
|
||||
B4XPages.MainPage.lat_gps = 0
|
||||
B4XPages.mainpage.pantallaActual = Root
|
||||
b_noVenta.Enabled = True
|
||||
b_venta.Enabled = True
|
||||
b_noVenta.Visible = False 'Boton deshabilitado por default.
|
||||
b_venta.Visible = False 'Boton deshabilitado por default.
|
||||
l_geoAlmacen.text = $"Almacen a: N/A"$
|
||||
' c = Starter.skmt.ExecQuery("SELECT ID FROM VENDIDOS WHERE ID IN (Select cuenta from cuentaa)")
|
||||
' If c.RowCount > 0 Then
|
||||
' b_noVenta.Enabled = False
|
||||
@@ -246,7 +264,6 @@ Sub B4XPage_Appear
|
||||
l_total.Text = "0"
|
||||
Else
|
||||
l_total.Text = s.GetString("TOTAL_CLIE")
|
||||
|
||||
End If
|
||||
total_cliente = s.GetString("TOTAL_CLIE")
|
||||
Private factura As String = 0
|
||||
@@ -285,7 +302,6 @@ Sub B4XPage_Appear
|
||||
Else
|
||||
MONTO_COMPRA = "0"
|
||||
End If
|
||||
|
||||
la_saldotot.Text = MONTO_COMPRA
|
||||
If MONTO_COMPRA <> "0" Then
|
||||
META2 = 1200 - MONTO_COMPRA
|
||||
@@ -302,11 +318,11 @@ Sub B4XPage_Appear
|
||||
ALMACEN = C.GetString("ID_ALMACEN")
|
||||
End If
|
||||
c.Close
|
||||
If ALMACEN = "1" Then
|
||||
b_noVenta.Visible = False
|
||||
b_venta.Visible = False
|
||||
' B_GPS.Visible = False
|
||||
End If
|
||||
' If ALMACEN = "1" Then
|
||||
' b_noVenta.Visible = False
|
||||
' b_venta.Visible = False
|
||||
'' B_GPS.Visible = False
|
||||
' End If
|
||||
If ALMACEN = "4" Then
|
||||
' b_like.Visible = True
|
||||
DD=skmt.ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM HIST_VENTAS WHERE HVD_CLIENTE IN (Select cuenta from cuentaa) AND HVD_PRONOMBRE =?", Array As String("KNORR RINDE MAS 70 GR"))
|
||||
@@ -327,12 +343,10 @@ Sub B4XPage_Appear
|
||||
Else
|
||||
' b_like.Visible = False
|
||||
End If
|
||||
If ALMACEN = "16" Or ALMACEN = "13" Then
|
||||
b_noVenta.Visible = True
|
||||
b_venta.Visible = True
|
||||
End If
|
||||
CallSubDelayed(Tracker, "Track")
|
||||
|
||||
' If ALMACEN = "16" Or ALMACEN = "13" Then
|
||||
' b_noVenta.Visible = True
|
||||
' b_venta.Visible = True
|
||||
' End If
|
||||
If Not(Starter.GPS.GPSEnabled) Then
|
||||
ToastMessageShow("Debe Activar el GPS del Equipo.", True)
|
||||
StartActivity(Starter.GPS.LocationSettingsIntent)
|
||||
@@ -340,47 +354,79 @@ Sub B4XPage_Appear
|
||||
Starter.GPS.Start(0, 0)
|
||||
' If Starter.ubicacionActual.Latitude <> 0 Then GPS_LocationChanged(Starter.ubicacionActual)
|
||||
End If
|
||||
CallSubDelayed(Tracker, "StartFLPSmall")
|
||||
If Tracker.FLP.IsInitialized And Tracker.FLP.GetLastKnownLocation.IsInitialized Then 'Si tenemos "UltimaUbicaccionConocida" la usamos.
|
||||
B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude
|
||||
B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude
|
||||
' Log($"Tenemos UUC: ${Tracker.FLP.GetLastKnownLocation.Latitude},${Tracker.FLP.GetLastKnownLocation.Longitude}"$)
|
||||
GPS_LocationChanged(Tracker.FLP.GetLastKnownLocation)
|
||||
Log("Tracker LR Init: " & (Tracker.actualLR.IsInitialized))
|
||||
If Not(Tracker.actualLR.IsInitialized) Then
|
||||
Log("INICIAMOS TRACKER")
|
||||
CallSubDelayed(Tracker, "Track")
|
||||
CallSubDelayed(Tracker, "StartFLPSmall")
|
||||
End If
|
||||
b_noVenta.Visible = True
|
||||
b_venta.Visible = True
|
||||
' If Tracker.FLP.IsInitialized And Tracker.FLP.GetLastKnownLocation.IsInitialized Then 'Si tenemos "UltimaUbicaccionConocida" la usamos.
|
||||
' B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude
|
||||
' B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude
|
||||
'' Log($"Tenemos UUC: ${Tracker.FLP.GetLastKnownLocation.Latitude},${Tracker.FLP.GetLastKnownLocation.Longitude}"$)
|
||||
' GPS_LocationChanged(Tracker.FLP.GetLastKnownLocation)
|
||||
' End If
|
||||
' Log("DISTANCIA: " & distance)
|
||||
' Log("HAY PEDIDO: " & Subs.hayPedido)
|
||||
' Log("GEOCERCA ACTIVA: " & Subs.geocercaHabilitada)
|
||||
' Log("EN ALMACEN: " & Subs.estamosEnAlmacen(50))
|
||||
' If Subs.hayPedido Or distance <= 50 Or Not(Subs.geocercaHabilitada) Or Subs.estamosEnAlmacen(50) Then ' Si estamos dentro de la geocerca, habilitamos los botones de Venta y noVenta
|
||||
' b_noVenta.Visible = True
|
||||
' b_venta.Visible = True
|
||||
' Log("Botones visibles")
|
||||
' End If
|
||||
'Si el cliente es nuevo, no aparece el boton de venta
|
||||
If la_cuenta.text.SubString2(0,1) = "N" Then
|
||||
' If la_cuenta.text.SubString2(0,1) = "N" Then
|
||||
b_venta.Visible = False
|
||||
b_noVenta.Visible = False
|
||||
End If
|
||||
' End If
|
||||
End Sub
|
||||
|
||||
Sub GPS_LocationChanged (Location1 As Location)
|
||||
' LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red)
|
||||
If Tracker.FLP.GetLastKnownLocation.IsInitialized And Tracker.FLP.GetLastKnownLocation.Latitude <> 0 Then
|
||||
B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude
|
||||
B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude
|
||||
' If Tracker.FLP.GetLastKnownLocation.IsInitialized And Tracker.FLP.GetLastKnownLocation.Latitude <> 0 Then
|
||||
B4XPages.MainPage.lat_gps = Location1.Latitude
|
||||
B4XPages.MainPage.lon_gps = Location1.Longitude
|
||||
' Log("Coords set to: " & B4XPages.MainPage.lat_gps & " and " & B4XPages.MainPage.lon_gps)
|
||||
End If
|
||||
' End If
|
||||
|
||||
Dim l1, l2 As Location
|
||||
l1.Initialize2(B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps)
|
||||
l1.Initialize2(Location1.Latitude, Location1.Longitude)
|
||||
' Log($"Coordenadas de la tienda - lat:${m_lat}, lon:${m_lon}"$)
|
||||
l2.Initialize2(m_lat, m_lon)
|
||||
|
||||
BT_QR.Enabled = True
|
||||
LA_GPS.TextColor = Colors.Blue
|
||||
LA_GPS.Text = "CON UBICACION GPS"
|
||||
' B_GPS.Enabled = True
|
||||
'now we need the distance between our location and the target location
|
||||
Dim distance As Long
|
||||
distance = l1.DistanceTo(l2) 'the result is in meter
|
||||
' b_venta.Visible = True
|
||||
' If distance < 100 Then
|
||||
distance = l1.DistanceTo(l2) 'the result is in meter
|
||||
' If distance <= 50 Then ' Si estamos dentro de la geocerca, habilitamos los botones de Venta y noVenta
|
||||
' b_noVenta.Visible = True
|
||||
' b_venta.Visible = True
|
||||
' Log("Botones visibles")
|
||||
' End If
|
||||
' If Subs.estamosEnAlmacen(50) Or Not(Subs.geocercaHabilitada) Then
|
||||
' b_noVenta.Visible = True
|
||||
' b_venta.Visible = True
|
||||
' Log("Botones visibles")
|
||||
' End If
|
||||
Log("###########################################")
|
||||
Log("No geocerca: " & Not(Subs.geocercaHabilitada))
|
||||
Log("estamosEnAlmacen: " & Subs.estamosEnAlmacen(rangoAAlmacen))
|
||||
Log("distance: " & distance)
|
||||
Log("hayPedido: " & Subs.hayPedido)
|
||||
' Subs.estamosEnAlmacen(ramgoAAlmacen)
|
||||
' Log("ENTRAMOS: " & (Subs.hayPedido Or distance <= 50 Or Not(Subs.geocercaHabilitada) Or Subs.estamosEnAlmacen(50)))
|
||||
If Subs.hayPedido Or distance <= 50 Or Not(Subs.geocercaHabilitada) Or Subs.estamosEnAlmacen(rangoAAlmacen) Then ' Si estamos dentro de la geocerca, habilitamos los botones de Venta y noVenta
|
||||
b_noVenta.Visible = True
|
||||
b_venta.Visible = True
|
||||
' Log("Botones visibles")
|
||||
Else
|
||||
b_noVenta.Visible = False
|
||||
b_venta.Visible = False
|
||||
End If
|
||||
LA_GEO.TextColor = Colors.Blue
|
||||
b_noVenta.Visible = True
|
||||
b_venta.Visible = True
|
||||
' b_noVenta.Visible = True
|
||||
' b_venta.Visible = True
|
||||
If la_cuenta.text.SubString2(0,1) = "N" Then
|
||||
b_venta.Visible = False
|
||||
b_noVenta.Visible = False
|
||||
@@ -390,17 +436,20 @@ Sub GPS_LocationChanged (Location1 As Location)
|
||||
' End If
|
||||
LA_GEO.Text= $"$1.2{distance/1000} kms"$
|
||||
skmt.ExecNonQuery("DELETE FROM HIST_GPS")
|
||||
skmt.ExecNonQuery2("INSERT INTO HIST_GPS (HGDATE, HGLAT, HGLON) VALUES(?,?,?) ", Array As Object (sDate & sTime, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps))
|
||||
skmt.ExecNonQuery2("INSERT INTO HIST_GPS (HGDATE, HGLAT, HGLON) VALUES(?,?,?) ", Array As Object (sDate & sTime, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps))
|
||||
|
||||
l_ubicacion2.TextSize = 13
|
||||
l_ubicacion2.Text = $"Precisión GPS $1.0{Location1.Accuracy} m"$
|
||||
If Location1.Accuracy > 200 Then
|
||||
l_ubicacion2.TextColor = Colors.Red
|
||||
l_ubicacion2.TextSize = 16
|
||||
l_ubicacion2.Text = $"Mala señal $1.0{Location1.Accuracy} m"$
|
||||
l_ubicacion2.Text = $"Mala señal GPS $1.0{Location1.Accuracy} m"$
|
||||
End If
|
||||
|
||||
' If Tracker.actualLR.IsInitialized Then LogColor("Tracker Update Req: " & Tracker.actualLR.GetExpirationTime, Colors.red)
|
||||
' Tracker.actualLR.
|
||||
Tracker.FLP.RemoveLocationUpdates
|
||||
CallSubDelayed(Tracker, "CreateLocationRequest")
|
||||
' If Tracker.actualLR.GetNumUpdates < 3 Then CallSubDelayed(Tracker, "StartFLP")
|
||||
End Sub
|
||||
|
||||
Sub ListView1_ItemLongClick (Position As Int, Value As Object)
|
||||
@@ -940,7 +989,30 @@ Sub JobDone(Job As HttpJob)
|
||||
Next
|
||||
skmt.ExecNonQuery($"UPDATE ABONOS set a_enviado = 1 where a_cliente = '${cliente}'"$)
|
||||
End If
|
||||
If resultado.Tag = "traePassGeocerca" Then 'query tag
|
||||
Subs.logJobDoneResultados(resultado)
|
||||
Log(resultado.Rows.Size)
|
||||
b_passGeocerca.Enabled = True
|
||||
For Each records() As Object In resultado.Rows
|
||||
Log($"|${records(resultado.Columns.Get("TMP_PASS"))}|"$)
|
||||
Dim tmp_pass As String = records(resultado.Columns.Get("TMP_PASS")).As(String)
|
||||
Log(tmp_pass)
|
||||
ToastMessageShow("¡¡Listo!!", False)
|
||||
Starter.skmt.ExecNonQuery($"update kmt_info set cat_cl_lat = '${B4XPages.MainPage.lat_gps}', cat_cl_long = '${B4XPages.MainPage.lon_gps}' where cat_cl_codigo = '${Subs.traeCliente}'"$)
|
||||
m_lat = B4XPages.MainPage.lat_gps : m_lon = B4XPages.MainPage.lon_gps
|
||||
p_transparenteGeocerca.Visible = False
|
||||
et_passGeocerca.text = ""
|
||||
cmd.Initialize
|
||||
cmd.Name = "borraPassGeocerca"
|
||||
cmd.Parameters = Array As Object(Subs.traeAlmacen, Subs.traeRuta)
|
||||
reqManager.ExecuteCommand(cmd , "borraPassGeocerca")
|
||||
Next
|
||||
If resultado.Rows.Size = 0 Then
|
||||
Msgbox("Contraseña equivocada","ATENCIÓN")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Job.Release
|
||||
End If
|
||||
End Sub
|
||||
@@ -995,3 +1067,44 @@ End Sub
|
||||
Private Sub p_transYalo_Click
|
||||
p_transYalo.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub p_transparenteGeocerca_Click
|
||||
p_transparenteGeocerca.Visible = False
|
||||
b_passGeocerca.Enabled = True
|
||||
End Sub
|
||||
|
||||
Private Sub LA_GPS_LongClick
|
||||
p_transparenteGeocerca.Visible = True
|
||||
End Sub
|
||||
|
||||
Private Sub LA_GEO_LongClick
|
||||
p_transparenteGeocerca.Visible = True
|
||||
End Sub
|
||||
|
||||
Private Sub b_passGeocerca_Click
|
||||
Log("b_passGeocerca clicked")
|
||||
ToastMessageShow("¡Un momento por favor!", False)
|
||||
b_passGeocerca.Enabled = False
|
||||
If et_passGeocerca.Text.Trim = "KMTS1" Then
|
||||
ToastMessageShow("¡¡Listo!!", False)
|
||||
Starter.skmt.ExecNonQuery($"update kmt_info set cat_cl_lat = '${B4XPages.MainPage.lat_gps}', cat_cl_long = '${B4XPages.MainPage.lon_gps}' where cat_cl_codigo = '${Subs.traeCliente}'"$)
|
||||
m_lat = B4XPages.MainPage.lat_gps : m_lon = B4XPages.MainPage.lon_gps
|
||||
p_transparenteGeocerca.Visible = False
|
||||
et_passGeocerca.text = ""
|
||||
Else
|
||||
' Msgbox("Contraseña equivocada","ATENCIÓN")
|
||||
cmd.Initialize
|
||||
cmd.Name = "traePassGeocerca"
|
||||
cmd.Parameters = Array As Object(Subs.traeAlmacen, Subs.traeRuta, et_passGeocerca.text)
|
||||
|
||||
' c=Starter.skmt.ExecQuery("select CAT_CL_RUTA from kmt_info")
|
||||
' Private r As String = "0"
|
||||
' If c.RowCount > 0 Then
|
||||
' c.Position=0
|
||||
' r = c.GetString("CAT_CL_RUTA")
|
||||
' End If
|
||||
' Log($"${Subs.traeAlmacen}, ${r}, ${et_passGeocerca.text}"$)
|
||||
reqManager.ExecuteQuery(cmd , 0, "traePassGeocerca")
|
||||
End If
|
||||
ime.HideKeyboard
|
||||
End Sub
|
||||
@@ -64,6 +64,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
End Sub
|
||||
|
||||
Sub B4XPage_Appear
|
||||
B4xPages.mainpage.pantallaActual = Root
|
||||
B4XPages.SetTitle(Me, $"Clientes - ${Starter.dia_semana} - ${Application.VersionName}"$)
|
||||
busca.Text = ""
|
||||
entro ="2"
|
||||
|
||||
@@ -56,6 +56,7 @@ End Sub
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Sub B4XPage_Appear
|
||||
B4xPages.mainpage.pantallaActual = Root
|
||||
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||
e_comm.Text=""
|
||||
tgl.Initialize
|
||||
|
||||
@@ -62,6 +62,7 @@ End Sub
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Sub B4XPage_Appear
|
||||
B4xPages.mainpage.pantallaActual = Root
|
||||
If Not(Starter.gps.GPSEnabled) Then
|
||||
ToastMessageShow("Es necesario tener el GPS encendido", True)
|
||||
StartActivity(Starter.gps.LocationSettingsIntent)
|
||||
|
||||
@@ -246,6 +246,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
l_version.Text = Application.VersionName
|
||||
' rd.Initialize 'Inicializamos el respaldo diario.
|
||||
' rd.vacuum
|
||||
|
||||
EJECUTANDO=1
|
||||
Dim ruta As String
|
||||
img2.Visible =False
|
||||
@@ -311,10 +312,10 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
ds.Position = 0
|
||||
Starter.dia_semana = ds.GetString("CAT_CL_DIASEMANA")
|
||||
End If
|
||||
' CallSubDelayed(FirebaseMessaging, "SubscribeToTopics")
|
||||
End Sub
|
||||
|
||||
Sub B4XPage_Appear
|
||||
B4XPages.mainpage.pantallaActual = Root
|
||||
checaPedido
|
||||
' s.reqManagerReInit 'Reiniciamos el DBReqManager de C_Subs por si hay modificacion en el servidor.
|
||||
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||
@@ -518,7 +519,7 @@ Sub Subir_Click
|
||||
'ELSE IF c.GetString("DESCUENTO") = 0 Then
|
||||
PASO = 1
|
||||
'End If
|
||||
If PASO =1 Then
|
||||
If PASO = 1 Then
|
||||
Starter.skmt.ExecNonQuery2("delete from PEDIDO WHERE PE_PRONOMBRE = ? ", Array As String("N/A") )
|
||||
Starter.skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE not In (select PE_CLIENTE from pedido)")
|
||||
c=Starter.skmt.ExecQuery("select usuario from usuarioa")
|
||||
@@ -541,7 +542,7 @@ Sub Subir_Click
|
||||
|
||||
c=Starter.skmt.ExecQuery("SELECT PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT, PC_COSTO_SIN, PC_RUTA, PC_ALMACEN, PC_FACTURA FROM PEDIDO_CLIENTE ")
|
||||
d=Starter.skmt.ExecQuery("SELECT COUNT(*) as CUANTOS_PEDIDOSC FROM PEDIDO_CLIENTE ")
|
||||
If c.RowCount>0 Then
|
||||
If c.RowCount > 0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
c.Position=i
|
||||
Dim cmd As DBCommand
|
||||
@@ -549,6 +550,7 @@ Sub Subir_Click
|
||||
cmd.Name = "insert_pedidos_MARDS"
|
||||
cmd.Parameters = Array As Object(c.GetString("PC_CLIENTE"), c.GetString("PC_FECHA"), c.GetString("PC_USER"), c.GetString("PC_NOART"), c.GetString("PC_MONTO"), c.GetString("PC_LON"), c.GetString("PC_LAT"), ALMACEN, l_ruta.text, c.GetString("PC_COSTO_SIN"), c.GetString("PC_FACTURA"))
|
||||
reqManager.ExecuteCommand(cmd , "ins_pedidos")
|
||||
Starter.skmt.ExecNonQuery($"UPDATE PEDIDO_CLIENTE set PC_ENVIO_OK = 1 where PC_CLIENTE = '${c.GetString("PC_CLIENTE")}'"$)
|
||||
Next
|
||||
End If
|
||||
c.Close
|
||||
@@ -840,7 +842,7 @@ Sub cargar_Click
|
||||
sTime=DateTime.Time(DateTime.Now)
|
||||
|
||||
Dim P As PhoneId
|
||||
' imei = P.GetDeviceId
|
||||
' imei = P.GetDeviceId
|
||||
imei = "yyyy"
|
||||
cmd.Initialize
|
||||
cmd.Name ="insert_drop_MARDS_3" 'Se cambio el query de 2 a 3 para agregar la version de la app al tmp_drop
|
||||
@@ -969,6 +971,11 @@ Sub cargar_Click
|
||||
cmd.Parameters = Array As Object(ALMACEN, e_ruta.text)
|
||||
reqManager.ExecuteQuery(cmd , 0, "promosXruta")
|
||||
|
||||
cmd.Initialize
|
||||
cmd.Name = "traeCoordenadasAlmacen_MARDS"
|
||||
cmd.Parameters = Array As Object(ALMACEN)
|
||||
reqManager.ExecuteQuery(cmd , 0, "traeCoordsAlmacen")
|
||||
|
||||
' cmd.Initialize
|
||||
' cmd.Name = "select_CUEST_INTMEX"
|
||||
' cmd.Parameters = Array As Object(ALMACEN)
|
||||
@@ -1789,6 +1796,18 @@ Sub JobDone(Job As HttpJob)
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO CAT_PEDIDOS_YALO(PY_IDCLIENTE, PY_PRODID, PY_PRODNOMBRE, PY_MARCANOMBRE, PY_COSTO_TOT, PY_CANT, PY_FECHA, PY_TICKET) VALUES (?,?,?,?,?,?,?,?)", Array As Object (PY_IDCLIENTE, PY_PRODID, PY_PRODNOMBRE, PY_MARCANOMBRE, PY_COSTO_TOT, PY_CANT, PY_FECHA, PY_TICKET))
|
||||
Next
|
||||
End If
|
||||
|
||||
Dim RESULT As DBResult = reqManager.HandleJob(Job)
|
||||
If RESULT.Tag = "traeCoordsAlmacen" Then 'query tag
|
||||
For Each records() As Object In RESULT.Rows
|
||||
Dim CAT_AL_LATITUD As String = records(RESULT.Columns.Get("CAT_AL_LATITUD"))
|
||||
Dim CAT_AL_LONGITUD As String = records(RESULT.Columns.Get("CAT_AL_LONGITUD"))
|
||||
Starter.skmt.ExecNonQuery("DELETE FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = 'COORDS_ALMACEN'")
|
||||
Starter.skmt.ExecNonQuery($"INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES ('COORDS_ALMACEN','${CAT_AL_LATITUD},${CAT_AL_LONGITUD}')"$)
|
||||
B4XPages.MainPage.latAlmacen = CAT_AL_LATITUD
|
||||
B4XPages.MainPage.lonAlmacen = CAT_AL_LONGITUD
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Job.Release
|
||||
@@ -1812,9 +1831,11 @@ End Sub
|
||||
'############################################################################################
|
||||
'################### Codigo de prueba JAGU, no poner atencion ############################
|
||||
Sub connecta_LongClick
|
||||
ProgressDialogShow("Enviamos")
|
||||
' ProgressDialogShow("Enviamos")
|
||||
' s.reqManagerReInit 'Reiniciamos el DBReqManager por si hay modificacion en el servidor.
|
||||
s.envioTest 'Llamamos envioTest de C_Subs.
|
||||
' s.envioTest 'Llamamos envioTest de C_Subs.
|
||||
Subs.notiHigh("¡¡ATENCION!!", "Recuerda enviar tu venta.", Main)
|
||||
b4xpages.MainPage.recordatorio.agregaPanelRecordatorio(Root)
|
||||
End Sub
|
||||
|
||||
Sub tickets_dia_LongClick
|
||||
|
||||
@@ -131,6 +131,7 @@ End Sub
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Sub B4XPage_Appear
|
||||
B4xPages.mainpage.pantallaActual = Root
|
||||
clienteId = Subs.traeCliente
|
||||
rutaUsuario = Subs.traeRuta
|
||||
Starter.skmt.ExecNonQuery2("UPDATE CAT_GUNAPROD SET CAT_GP_TIPOPROD = (?) WHERE CAT_GP_TIPOPROD = (?) ",Array As Object("PRIORITARIO","1"))
|
||||
@@ -253,12 +254,12 @@ Sub lv_catalogos_ItemClick (Position As Int, Value As Object)
|
||||
If c2.RowCount > 0 Then
|
||||
For i=0 To c2.RowCount -1
|
||||
c2.Position = i
|
||||
LogColor(">>>>>>>>> " & c2.GetString("CAT_GP_ID") & " <<<<<<<<<<", Colors.red)
|
||||
LogColor(">>>>>>>>> INICIAMOS REVISION DE PROMO " & c2.GetString("CAT_GP_ID") & " <<<<<<<<<<", Colors.red)
|
||||
LogColor(">>>>>>>>> " & c2.GetString("CAT_GP_NOMBRE") & " <<<<<<<<<<", Colors.red)
|
||||
Private tm As Map = Subs.procesaPromocion(c2.GetString("CAT_GP_ID"), clienteId)
|
||||
' Log(c2.GetString("CAT_GP_ID"))
|
||||
Log($"Promo ${c2.GetString("CAT_GP_ID")} - ${tm.Get("status")}"$)
|
||||
If tm.Get("status") = "ok" Then 'Solo muestrala si hay producto.
|
||||
Log($"Promo OK ${CRLF}${tm}"$)
|
||||
Log($"Promo OK - ${c2.GetString("CAT_GP_NOMBRE")} ${CRLF}${tm}"$)
|
||||
lv_promos.AddTwoLines(c2.GetString("CAT_GP_NOMBRE"),"# " & c2.GetString("CAT_GP_ALMACEN") & " $ " & c2.GetString("CAT_GP_PRECIO") & " F:" & tm.Get("mp").As(Map).Get("prodsFijosCant") & " V:" & tm.Get("mp").As(Map).Get("prodsVariablesCant"))
|
||||
End If
|
||||
Next
|
||||
@@ -884,6 +885,8 @@ Private Sub clv_prods_ll_VisibleRangeChanged (FirstIndex As Int, LastIndex As In
|
||||
et_pCant.Enabled = False
|
||||
' b_prodMas.Enabled = False
|
||||
b_prodMenos.Enabled = False
|
||||
' b_prodMenos.Color = Colors.LightGray
|
||||
|
||||
End If
|
||||
End If
|
||||
Private precio As String=NumberFormat2(clv_prods_ll.GetValue(i).As(Map).Get("precio").As(Double),1,2,2,False)
|
||||
|
||||
@@ -56,7 +56,7 @@ End Sub
|
||||
|
||||
'This event will be called once, before the page becomes visible.
|
||||
Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
B4XPages.SetTitle(Me, $"${subs.capitalizar(B4XPages.GetPageId(Me))} - ${Application.VersionName}"$)
|
||||
B4XPages.SetTitle(Me, $"${Subs.capitalizar(B4XPages.GetPageId(Me))} - ${Application.VersionName}"$)
|
||||
Root = Root1
|
||||
'load the layout to Root
|
||||
Root.LoadLayout("promociones")
|
||||
@@ -64,6 +64,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
End Sub
|
||||
|
||||
Sub B4XPage_Appear
|
||||
B4xPages.mainpage.pantallaActual = Root
|
||||
' LogColor(B4XPages.MainPage.productos.prodsMap, Colors.blue)
|
||||
p_promociones.Top=0
|
||||
p_promociones.Left=0
|
||||
|
||||
84
B4A/C_Recordatorio.bas
Normal file
84
B4A/C_Recordatorio.bas
Normal file
@@ -0,0 +1,84 @@
|
||||
B4A=true
|
||||
Group=Default Group
|
||||
ModulesStructureVersion=1
|
||||
Type=Class
|
||||
Version=12.8
|
||||
@EndOfDesignText@
|
||||
Sub Class_Globals
|
||||
Private Root As B4XView 'ignore
|
||||
Private xui As XUI 'ignore
|
||||
Dim panelSombra As Panel 'Panel de sombra.
|
||||
Dim panelActual As Panel
|
||||
Private Root2 As B4XView
|
||||
Private b_Aceptar As Button
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
Public Sub Initialize (Root1 As B4XView) As Object
|
||||
Root = Root1
|
||||
Return Me
|
||||
End Sub
|
||||
|
||||
'This event will be called once, before the page becomes visible.
|
||||
Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
Root = Root1
|
||||
|
||||
'load the layout to Root
|
||||
|
||||
End Sub
|
||||
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Sub agregaPanelRecordatorio (vRoot As B4XView) 'ignore
|
||||
' vRoot.GetAllViewsRecursive
|
||||
For Each v As B4XView In vRoot.GetAllViewsRecursive
|
||||
' Log("Tag: " & v.Tag)
|
||||
If v.Tag.As(String) = "panelSombra" Then
|
||||
Log("--> " & v.tag)
|
||||
v.RemoveViewFromParent
|
||||
End If
|
||||
Next
|
||||
Try
|
||||
Private su As StringUtils
|
||||
panelSombra.Initialize("panelSombra")
|
||||
panelSombra.Tag = "panelSombra"
|
||||
Private cd As ColorDrawable
|
||||
cd.Initialize(Colors.ARGB(125, 98, 98, 98), 0)
|
||||
panelSombra.Background = cd
|
||||
Private panelX As Panel 'Panel de la pregunta.
|
||||
panelX.Initialize("pMsg")
|
||||
panelActual = panelX
|
||||
Private lbl As Label 'Etiqueta de la pregunta.
|
||||
lbl.Initialize("")
|
||||
|
||||
Private cs As CSBuilder
|
||||
cs.Initialize
|
||||
lbl.Text = cs.bold.color(Colors.red).append("¡¡ATENCION!!").pop.pop.bold.Append(CRLF & CRLF & "Recuerda enviar tu venta.").PopAll
|
||||
lbl.TextSize = 18
|
||||
lbl.Gravity = Gravity.CENTER_HORIZONTAL
|
||||
lbl.Left = (vRoot.Width / 2) - (lbl.Width/2)
|
||||
lbl.TextColor = Colors.Black
|
||||
cd.Initialize2(Colors.white, 20, 1, Colors.Gray) 'Borde y esquinas redondeadas del panel de la pregunta.
|
||||
panelX.Background = cd
|
||||
panelSombra.AddView(panelX, 100, 20%y, 80%x, 120dip)
|
||||
panelX.Left = (vRoot.Width / 2) - (panelX.Width / 2)
|
||||
vRoot.AddView(panelSombra, 0, 0, 100%x, 100%y) 'add the panel to the layout
|
||||
panelX.AddView(lbl, 20dip, 20dip, (panelX.Width * 0.9), 40dip) 'Agregamos la etiqueta al panel.
|
||||
lbl.Height = panelX.Height - 5
|
||||
panelSombra.Width = vRoot.Width
|
||||
panelSombra.Height = vRoot.Height
|
||||
panelSombra.Elevation = 100
|
||||
panelSombra.BringToFront
|
||||
Catch
|
||||
Log(LastException)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Oculta el panel de la pregunta.
|
||||
Sub ocultPanelRecordatorio
|
||||
If panelSombra.IsInitialized Then panelSombra.RemoveView
|
||||
End Sub
|
||||
|
||||
Sub panelSombra_Click
|
||||
If panelSombra.IsInitialized Then panelSombra.RemoveView
|
||||
End Sub
|
||||
@@ -57,6 +57,7 @@ End Sub
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Sub B4XPage_Appear
|
||||
B4xPages.mainpage.pantallaActual = Root
|
||||
nombre_boton = "NOVENTA"
|
||||
c=Starter.skmt.ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART,(select CAT_CL_NOMBRE from kmt_info where cat_cl_codigo = pc_cliente ) as NOMBRE FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")
|
||||
ListView1.Clear
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -121,6 +121,7 @@ Sub Activity_Create(FirstTime As Boolean)
|
||||
End Sub
|
||||
|
||||
Sub Activity_Resume
|
||||
' B4xPages.mainpage.pantallaActual = Root
|
||||
Starter.rp.Check(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
|
||||
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
|
||||
If Result Then
|
||||
|
||||
@@ -168,20 +168,22 @@ Module11=C_Pedidos
|
||||
Module12=C_Principal
|
||||
Module13=C_Productos
|
||||
Module14=C_Promos
|
||||
Module15=C_RespaldoDiario
|
||||
Module16=C_Subs
|
||||
Module17=C_TicketsDia
|
||||
Module18=C_UpdateAvailable
|
||||
Module19=CameraExClass2
|
||||
Module15=C_Recordatorio
|
||||
Module16=C_RespaldoDiario
|
||||
Module17=C_Subs
|
||||
Module18=C_TicketsDia
|
||||
Module19=C_UpdateAvailable
|
||||
Module2=B4XMainPage
|
||||
Module20=DBRequestManager
|
||||
Module21=FileHandler
|
||||
Module22=ManageExternalStorage
|
||||
Module23=MAPA_RUTAS
|
||||
Module24=NotificationService
|
||||
Module25=Starter
|
||||
Module26=Subs
|
||||
Module27=Tracker
|
||||
Module20=CameraExClass2
|
||||
Module21=DBRequestManager
|
||||
Module22=FileHandler
|
||||
Module23=ManageExternalStorage
|
||||
Module24=MAPA_RUTAS
|
||||
Module25=Notas
|
||||
Module26=NotificationService
|
||||
Module27=Starter
|
||||
Module28=Subs
|
||||
Module29=Tracker
|
||||
Module3=BatteryUtilities
|
||||
Module4=C_Cliente
|
||||
Module5=C_Clientes
|
||||
@@ -191,13 +193,13 @@ Module8=C_Nota
|
||||
Module9=C_NoVenta
|
||||
NumberOfFiles=63
|
||||
NumberOfLibraries=35
|
||||
NumberOfModules=27
|
||||
NumberOfModules=29
|
||||
Version=12.8
|
||||
@EndOfDesignText@
|
||||
#Region Project Attributes
|
||||
#ApplicationLabel: Mariana
|
||||
#VersionCode: 1
|
||||
#VersionName: 5.06.08
|
||||
#VersionName: 5.07.24
|
||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||
#SupportedOrientations: portrait
|
||||
#CanInstallToExternalStorage: False
|
||||
|
||||
@@ -19,6 +19,8 @@ ModuleBookmarks24=
|
||||
ModuleBookmarks25=
|
||||
ModuleBookmarks26=
|
||||
ModuleBookmarks27=
|
||||
ModuleBookmarks28=
|
||||
ModuleBookmarks29=
|
||||
ModuleBookmarks3=
|
||||
ModuleBookmarks4=
|
||||
ModuleBookmarks5=
|
||||
@@ -47,6 +49,8 @@ ModuleBreakpoints24=
|
||||
ModuleBreakpoints25=
|
||||
ModuleBreakpoints26=
|
||||
ModuleBreakpoints27=
|
||||
ModuleBreakpoints28=
|
||||
ModuleBreakpoints29=
|
||||
ModuleBreakpoints3=
|
||||
ModuleBreakpoints4=
|
||||
ModuleBreakpoints5=
|
||||
@@ -58,15 +62,15 @@ ModuleClosedNodes0=
|
||||
ModuleClosedNodes1=
|
||||
ModuleClosedNodes10=
|
||||
ModuleClosedNodes11=
|
||||
ModuleClosedNodes12=
|
||||
ModuleClosedNodes13=
|
||||
ModuleClosedNodes14=
|
||||
ModuleClosedNodes12=1
|
||||
ModuleClosedNodes13=1
|
||||
ModuleClosedNodes14=2
|
||||
ModuleClosedNodes15=
|
||||
ModuleClosedNodes16=
|
||||
ModuleClosedNodes17=
|
||||
ModuleClosedNodes18=
|
||||
ModuleClosedNodes19=
|
||||
ModuleClosedNodes2=
|
||||
ModuleClosedNodes2=2,4
|
||||
ModuleClosedNodes20=
|
||||
ModuleClosedNodes21=
|
||||
ModuleClosedNodes22=
|
||||
@@ -74,14 +78,16 @@ ModuleClosedNodes23=
|
||||
ModuleClosedNodes24=
|
||||
ModuleClosedNodes25=
|
||||
ModuleClosedNodes26=
|
||||
ModuleClosedNodes27=
|
||||
ModuleClosedNodes27=2,3,4,5,6,7,8,10,11,12,13,14
|
||||
ModuleClosedNodes28=2
|
||||
ModuleClosedNodes29=
|
||||
ModuleClosedNodes3=
|
||||
ModuleClosedNodes4=
|
||||
ModuleClosedNodes4=4
|
||||
ModuleClosedNodes5=
|
||||
ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
ModuleClosedNodes8=
|
||||
ModuleClosedNodes9=
|
||||
NavigationStack=C_Cliente,b_venta_Click,403,0,C_Cliente,StartPrinter,689,0,Diseñador Visual,cliente.bal,-100,6,C_Cliente,B_GUARDA_C_Click,738,0,Diseñador Visual,clientes.bal,-100,5,C_Clientes,B4XPage_Appear,94,6,Subs,CreateBitmapWithNumber,1391,0,Subs,capitalizar,1376,0,MAPA_RUTAS,Globals,20,0,MAPA_RUTAS,MapFragment1_Ready,174,0,Starter,Process_Globals,17,0
|
||||
NavigationStack=C_Cliente,B4XPage_Created,204,0,B4XMainPage,b_passGeocerca_Click,920,0,Starter,timerRecordatorio_Tick,183,4,B4XMainPage,p_geocerca_Click,923,0,Diseñador Visual,cliente.bal,-100,1,C_Cliente,Initialize,154,0,C_Cliente,Class_Globals,146,5,Subs,estamosEnAlmacen,1434,6,C_Cliente,B4XPage_Appear,276,0,C_Cliente,GPS_LocationChanged,414,3,C_Cliente,B_GUARDA_C_Click,779,0
|
||||
SelectedBuild=0
|
||||
VisibleModules=25,2,12,4,5,6,26,16,13,9,23
|
||||
VisibleModules=27,2,12,4,28,29,17
|
||||
|
||||
14
B4A/Notas.bas
Normal file
14
B4A/Notas.bas
Normal file
@@ -0,0 +1,14 @@
|
||||
B4A=true
|
||||
Group=Default Group
|
||||
ModulesStructureVersion=1
|
||||
Type=StaticCode
|
||||
Version=12.8
|
||||
@EndOfDesignText@
|
||||
'Code module
|
||||
Sub Process_Globals
|
||||
' Geocerca a 50 mts.
|
||||
' Los pedidos solo se pueden meter en la tienda (dentro de 50 mts), o en el almacen (con geocerca deshabilitada con contraseña de supervisor de uso unico).
|
||||
' La geocerca se deshabilita entrando al engrane.
|
||||
' A los pedidos se les puede agregar producto (entrando por "Tickets dia") sin estar dentro de la geocerca, obviamente tiene que YA haber pedido.
|
||||
' Al hacer FIN DIA se regresa la geocerca a ACTIVA.
|
||||
End Sub
|
||||
@@ -35,6 +35,8 @@ Sub Process_Globals
|
||||
Dim marcaCel As String = ph.manufacturer
|
||||
Public rp As RuntimePermissions
|
||||
Dim muestraProgreso As String = 0
|
||||
Dim timerRecordatorio As Timer
|
||||
Dim ultimoRecordatorio As String = ""
|
||||
End Sub
|
||||
|
||||
Sub Service_Create
|
||||
@@ -59,6 +61,8 @@ Sub Service_Start (StartingIntent As Intent)
|
||||
If s.traeDBReqServerDeBD(skmt) <> "N/A" Then DBReqServer = s.traeDBReqServerDeBD(skmt)
|
||||
reqManager.Initialize(Me, DBReqServer)
|
||||
' StartService(NotificationService)
|
||||
timerRecordatorio.Initialize("timerRecordatorio", 10 * 1000)
|
||||
timerRecordatorio.Enabled = True
|
||||
End Sub
|
||||
|
||||
Private Sub Timer1_Tick
|
||||
@@ -101,7 +105,6 @@ Sub ENVIA_ULTIMA_GPS
|
||||
Else
|
||||
Log("Sin conexión a internet, no se envió UTR!")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
'Para los Logs
|
||||
@@ -158,3 +161,34 @@ Sub IsConnectedToInternet As Boolean 'ignore
|
||||
End If
|
||||
Return False
|
||||
End Sub
|
||||
|
||||
Private Sub timerRecordatorio_Tick
|
||||
'10:30, 13:00 y 15:30
|
||||
' Log($"${DateTime.GetHour(DateTime.now)}:${DateTime.GetMinute(DateTime.now)}"$)
|
||||
' Log("Revisando la hora - UltimoRecordatorio: " & ultimoRecordatorio)
|
||||
If ultimoRecordatorio <> DateTime.GetHour(DateTime.now) & DateTime.GetMinute(DateTime.now) Then
|
||||
If (DateTime.GetHour(DateTime.now) = 10 And DateTime.GetMinute(DateTime.now) = 20) _ 'Recordatorio de las 10:20
|
||||
Or (DateTime.GetHour(DateTime.now) = 10 And DateTime.GetMinute(DateTime.now) = 25) _ 'Recordatorio de las 10:25
|
||||
Or (DateTime.GetHour(DateTime.now) = 10 And DateTime.GetMinute(DateTime.now) = 29) _ 'Recordatorio de las 10:29
|
||||
Or (DateTime.GetHour(DateTime.now) = 10 And DateTime.GetMinute(DateTime.now) = 30) _ 'Recordatorio de las 10:30
|
||||
Or (DateTime.GetHour(DateTime.now) = 12 And DateTime.GetMinute(DateTime.now) = 50) _ 'Recordatorio de las 12:50
|
||||
Or (DateTime.GetHour(DateTime.now) = 12 And DateTime.GetMinute(DateTime.now) = 55) _ 'Recordatorio de las 12:55
|
||||
Or (DateTime.GetHour(DateTime.now) = 12 And DateTime.GetMinute(DateTime.now) = 59) _ 'Recordatorio de las 12:59
|
||||
Or (DateTime.GetHour(DateTime.now) = 13 And DateTime.GetMinute(DateTime.now) = 0) _ 'Recordatorio de las 13:00
|
||||
Or (DateTime.GetHour(DateTime.now) = 15 And DateTime.GetMinute(DateTime.now) = 20) _ 'Recordatorio de las 15:20
|
||||
Or (DateTime.GetHour(DateTime.now) = 15 And DateTime.GetMinute(DateTime.now) = 25) _ 'Recordatorio de las 15:25
|
||||
Or (DateTime.GetHour(DateTime.now) = 15 And DateTime.GetMinute(DateTime.now) = 29) _ 'Recordatorio de las 15:29
|
||||
Or (DateTime.GetHour(DateTime.now) = 15 And DateTime.GetMinute(DateTime.now) = 30) _ 'Recordatorio de las 15:30
|
||||
Or (DateTime.GetHour(DateTime.now) = 10 And DateTime.GetMinute(DateTime.now) = 70) Then ' HORARIO DE PRUEBA
|
||||
Log("¡¡MANDAMOS RECORDATORIO!!")
|
||||
If Not(B4XPages.GetManager.IsForeground) Then
|
||||
Subs.notiHigh("¡¡ATENCION!!", "Recuerda enviar tu venta.", Main)
|
||||
Else
|
||||
If B4XPages.MainPage.IsInitialized And B4XPages.MainPage.pantallaActual.IsInitialized Then
|
||||
B4XPages.MainPage.recordatorio.agregaPanelRecordatorio(B4XPages.MainPage.pantallaActual)
|
||||
End If
|
||||
End If
|
||||
ultimoRecordatorio = DateTime.GetHour(DateTime.now) & DateTime.GetMinute(DateTime.now)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
71
B4A/Subs.bas
71
B4A/Subs.bas
@@ -90,6 +90,20 @@ Sub notiHigh(title As String, body As String, activity As Object) 'ignore
|
||||
notif.Notify(777)
|
||||
End Sub
|
||||
|
||||
'Regresa el objeto de una notificacion con importancia baja
|
||||
Sub notiLow(title As String, Body As String, activity As Object) ' As Notification 'ignore
|
||||
Private notification As Notification
|
||||
notification.Initialize2(notification.IMPORTANCE_LOW)
|
||||
notification.Icon = "icon"
|
||||
notification.Sound = False
|
||||
notification.Vibrate = False
|
||||
notification.SetInfo(title, Body, activity)
|
||||
notification.Notify(777)
|
||||
' Log("notiLowReturn: "&title)
|
||||
' Log("notiLowReturn SetInfo")
|
||||
' Return notification
|
||||
End Sub
|
||||
|
||||
'Regresa el objeto de una notificacion con importancia baja
|
||||
Sub notiLowReturn(title As String, Body As String, id As Int) As Notification 'ignore
|
||||
Private notification As Notification
|
||||
@@ -848,7 +862,7 @@ Sub traePromo(promo As String, cliente As String) As Map
|
||||
promoMap = CreateMap("id":promo, "maxXcliente":(ps2.GetString("HCCP_CANT")-ps2.GetString("HCCP_CANT_VENDIDA")), "maxRecurrente":ps2.GetString("HCCP_CANT"), "maxPromos":ps2.GetString("HCCP_CANT")) 'Si es segmentada SOLO le aparece a ciertos clientes.
|
||||
End If
|
||||
End If
|
||||
If thisLog Then Log(promoMap)
|
||||
If thisLog Then Log("MAX PROMOS: " & promoMap)
|
||||
' ########## TERMINA PROMOS SEGMENTADAS ##########
|
||||
c = Starter.skmt.ExecQuery("Select count(*) as hist from HIST_PROMOS where HP_CLIENTE = '"& cliente & "' and HP_CODIGO_PROMOCION = '" & promo & "'") 'Revisamos si hay historico de la promoción.
|
||||
c.Position = 0
|
||||
@@ -963,7 +977,7 @@ End Sub
|
||||
'Revisa si tenemos los productos variables requeridos para la promoción (mapa).
|
||||
'Hay que darle como parametro un mapa (traePromo(promo)) con toda la informacion de la promocion.
|
||||
Sub alcanzanLosVariablesParaPromo(promoMap As Map, inventarioSinFijos As Map) As Boolean 'ignore
|
||||
Private thisLog As Boolean = False 'Si es verdadero, muestra los logs de este sub.
|
||||
Private thisLog As Boolean = True 'Si es verdadero, muestra los logs de este sub.
|
||||
If thisLog Then LogColor("Inventario inicial: "&inventarioSinFijos, Colors.Gray) 'Inventario inicial.
|
||||
Private totalProdsVariables As Int = 0
|
||||
' Private prodsmap As Map = promoMap.Get("productos") 'Obtenemos un mapa con todos los productos de la promoción.
|
||||
@@ -989,7 +1003,7 @@ Sub traeMaxPromos(pm As Map) As Int
|
||||
Private vendidas As Int = 0
|
||||
maxPromos.Initialize
|
||||
' If Starter.promosLog Then Log("==== HISTORICO:"&pm.Get("historico"))
|
||||
If thisLog Then Log(pm)
|
||||
' If thisLog Then Log(pm)
|
||||
|
||||
Private maxXruta As String = traeMaxPromosXruta(pm.Get("id"))
|
||||
|
||||
@@ -1000,7 +1014,7 @@ Sub traeMaxPromos(pm As Map) As Int
|
||||
maxPromos.Add(pm.Get("maxXcliente").As(Int)) 'Agregamos maxXcliente
|
||||
If maxXruta <> "" Then maxPromos.Add(maxXruta.As(Int)) 'Agregamos maxXruta
|
||||
maxPromos.Sort(True)
|
||||
Log(maxPromos)
|
||||
' Log("MaxPromos: " & maxPromos)
|
||||
|
||||
' Log($"|${pm.Get("id").As(String).trim}|${traeCliente.Trim}|"$)
|
||||
Private c As Cursor = Starter.skmt.ExecQuery2("select sum(PE_CANT) as vendidas from PEDIDO where PE_PROID = ? and PE_CLIENTE = ? ", Array As String(pm.Get("id").As(String).trim, traeCliente.Trim))
|
||||
@@ -1028,11 +1042,11 @@ Sub traeMaxPromosXruta(idPromo As String) As String
|
||||
End If
|
||||
'Revisamos las promos que ya se hayan vendido y las restamos del máximo.
|
||||
Private cp As Cursor = Starter.skmt.ExecQuery($"select count(PE_CANT) as cuantos from PEDIDO where PE_PROID = '${idPromo}'"$)
|
||||
Log(cp.RowCount)
|
||||
' Log(cp.RowCount)
|
||||
If cp.RowCount > 0 Then
|
||||
Private pa As Int = 0
|
||||
cp.Position = 0
|
||||
Log(cp.GetInt("cuantos"))
|
||||
' Log(cp.GetInt("cuantos"))
|
||||
If IsNumber(cp.GetInt("cuantos")) Then pa = cp.GetInt("cuantos")
|
||||
If maxXruta <> "" Then maxXruta = maxXruta - pa
|
||||
End If
|
||||
@@ -1054,7 +1068,7 @@ End Sub
|
||||
Sub procesaPromocion(idPromo As String, cliente As String) As Map 'ignore
|
||||
Private thisLog As Boolean = True 'Si es verdadero, muestra los logs de este sub.
|
||||
Private inicioContador As String = DateTime.Now
|
||||
If thisLog Then LogColor($"********* Iniciamos revision de Promo ${idPromo} *********"$, Colors.Magenta)
|
||||
If thisLog Then LogColor($"********* Procesamos Promo ${idPromo} *********"$, Colors.Magenta)
|
||||
'Obtenemos el mapa con toda la info de la promoción.
|
||||
Private pm As Map = traePromo(idPromo, cliente)
|
||||
If thisLog Then LogColor(pm, Colors.Blue)
|
||||
@@ -1068,6 +1082,7 @@ Sub procesaPromocion(idPromo As String, cliente As String) As Map 'ignore
|
||||
End If
|
||||
'Restamos del inventario (mapa) las piezas necesarias para los productos fijos.
|
||||
Private inventarioSinFijos As Map = restaFijosPromo(pm)
|
||||
Log(idPromo)
|
||||
If thisLog Then LogColor("inventariosfijos="&inventarioSinFijos, Colors.Green)
|
||||
|
||||
If inventarioSinFijos.Get("resultado") = "ok" Then
|
||||
@@ -1395,3 +1410,45 @@ Sub CreateBitmapWithNumber(OriginalBitmap As Bitmap, Number As Int) As Bitmap 'i
|
||||
Canvas.DrawText(Number, (OriginalBitmap.Width / 2), (OriginalBitmap.Height / 2.4), Typeface.DEFAULT, 15, Colors.White, "CENTER")
|
||||
Return NewBitmap
|
||||
End Sub
|
||||
|
||||
'Regresa verdadero si la geocerca esta activa en CAT_VARIABLES, default true.
|
||||
Sub geocercaHabilitada As Boolean
|
||||
Dim activa As Boolean = True
|
||||
Dim c As Cursor = Starter.skmt.ExecQuery("select cat_va_valor from cat_variables where cat_va_descripcion = 'GEOCERCA_ACTIVA'")
|
||||
If c.RowCount > 0 Then
|
||||
c.Position = 0
|
||||
If c.Getstring("CAT_VA_VALOR") = 0 Then activa = False
|
||||
End If
|
||||
' Log("Geocerca habilitada: " & activa)
|
||||
Return activa
|
||||
End Sub
|
||||
|
||||
Sub estamosEnAlmacen(rango As Int) As Boolean
|
||||
Dim l1, l2 As Location
|
||||
Dim res As Boolean = False
|
||||
Dim latAlmacen As String
|
||||
Dim lonAlmacen As String
|
||||
Try
|
||||
l1.Initialize2(B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps)
|
||||
Private x As Cursor = Starter.skmt.ExecQuery($"select CAT_VA_VALOR from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'COORDS_ALMACEN'"$)
|
||||
If x.RowCount > 0 Then
|
||||
x.Position = 0
|
||||
Dim coords() As String = Regex.Split(",", x.GetString("CAT_VA_VALOR"))
|
||||
latAlmacen = coords(0)
|
||||
lonAlmacen = coords(1)
|
||||
End If
|
||||
' Log($"Coordenadas del almacen - lat:${latAlmacen}, lon:${lonAlmacen}"$)
|
||||
l2.Initialize2(latAlmacen, lonAlmacen)
|
||||
Dim distance As Long = l1.DistanceTo(l2) 'the result is in meters
|
||||
' If distance < 100 Then ToastMessageShow("Distancia a almacen: " & distance, False)
|
||||
' notiHigh("Mariana", "Distancia a almacen: " & distance, Main)
|
||||
' B4XPages.MainPage.cliente.l_geoAlmacen.text = $"Almacen a: ${distance}"$
|
||||
If distance <= rango Then res = True
|
||||
Log("Dentro del almacen: " & res)
|
||||
B4XPages.MainPage.cliente.l_geoAlmacen.Text = $"Almacen a: ${distance} - Rango: ${rango}"$
|
||||
Log(distance)
|
||||
Catch
|
||||
Log(LastException)
|
||||
End Try
|
||||
Return res
|
||||
End Sub
|
||||
@@ -94,6 +94,7 @@ Public Sub StartFLP
|
||||
' Log("sleeping")
|
||||
Loop
|
||||
' If flpStarted = False Then
|
||||
' FLP.RemoveLocationUpdates
|
||||
' Log("RequestLocationUpdates")
|
||||
FLP.RequestLocationUpdates(CreateLocationRequest) 'Buscamos ubicacion
|
||||
' Log("Buscamos ubicacion")
|
||||
@@ -108,6 +109,7 @@ Public Sub StartFLPSmall
|
||||
Sleep(500)
|
||||
Log("sleeping")
|
||||
Loop
|
||||
' FLP.RemoveLocationUpdates
|
||||
dameUltimaUbicacionConocida 'Regresamos ultima ubicacion conocida
|
||||
FLP.RequestLocationUpdates(CreateLocationRequestSmallD) 'Buscamos ubicacion 2 peticiones
|
||||
' Log("Buscamos ubicacion Small displacement")
|
||||
@@ -116,11 +118,14 @@ End Sub
|
||||
|
||||
Private Sub CreateLocationRequest As LocationRequest
|
||||
' Log("CreateLocationRequest")
|
||||
' FLP.RemoveLocationUpdates
|
||||
Dim lr As LocationRequest
|
||||
lr.Initialize
|
||||
lr.SetInterval(10000) 'Intervalo deseado para actualizaciones de ubicacion
|
||||
lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion
|
||||
lr.SetSmallestDisplacement(50) 'Solo registra cambio de ubicacion si es mayor a XX mts
|
||||
lr.setNumUpdates(5)
|
||||
lr.SetExpirationDuration(10000)
|
||||
lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY)
|
||||
actualLR=lr
|
||||
Return lr
|
||||
@@ -128,12 +133,14 @@ End Sub
|
||||
|
||||
Private Sub CreateLocationRequestSmallD As LocationRequest
|
||||
' Log("Iniciamos CreateLocationRequestSmallD")
|
||||
' FLP.RemoveLocationUpdates
|
||||
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.SetExpirationDuration(10000)
|
||||
lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY)
|
||||
actualLR=lr
|
||||
Return lr
|
||||
@@ -192,6 +199,7 @@ Sub flp_LocationChanged (Location1 As Location)
|
||||
End If
|
||||
|
||||
CallSub2(Starter, "GPS_LocationChanged", Location1)
|
||||
CallSub2(B4XPages.MainPage, "GPS_LocationChanged", Location1)
|
||||
' CallSub2(gestion, "GPS_LocationChanged", Location1)
|
||||
' CallSub2(B4XPages.GetPage("Cliente"), "GPS_LocationChanged", Location1)
|
||||
' CallSub2(nuevocliente, "GPS_LocationChanged", Location1)
|
||||
|
||||
Reference in New Issue
Block a user