mirror of
https://github.com/KeymonSoft/Mariana.git
synced 2026-04-17 21:06:16 +00:00
- VERSION 5.07.24
- Cambios en el código de la geoceca, que no se activaba/desactivaba cuando estaba cerca del almacen.
This commit is contained in:
@@ -380,6 +380,11 @@ Sub B4XPage_Appear
|
|||||||
' ks.Initialize(Me, "ks")
|
' ks.Initialize(Me, "ks")
|
||||||
' ks.vacuum
|
' ks.vacuum
|
||||||
' ks.centraEtiqueta(l_version, Root.Width)
|
' 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
|
End Sub
|
||||||
|
|
||||||
Sub ks_etiquetaCentrada(success As Boolean)
|
Sub ks_etiquetaCentrada(success As Boolean)
|
||||||
@@ -923,7 +928,7 @@ End Sub
|
|||||||
Private Sub p_geocerca_Click
|
Private Sub p_geocerca_Click
|
||||||
Log("CLICKED")
|
Log("CLICKED")
|
||||||
Dim activa As Int = 1
|
Dim activa As Int = 1
|
||||||
If Subs.estamosEnAlmacen(500) Then
|
If Subs.estamosEnAlmacen(100) Then
|
||||||
If l_geocerca.Text <> "Buscando ubicación ..." Then
|
If l_geocerca.Text <> "Buscando ubicación ..." Then
|
||||||
If passSupervisor = "" Then
|
If passSupervisor = "" Then
|
||||||
p_transparente.Visible = True
|
p_transparente.Visible = True
|
||||||
|
|||||||
@@ -150,7 +150,8 @@ Sub Class_Globals
|
|||||||
Private p_passGeocerca As Panel
|
Private p_passGeocerca As Panel
|
||||||
Private b_passGeocerca As Button
|
Private b_passGeocerca As Button
|
||||||
Private et_passGeocerca As EditText
|
Private et_passGeocerca As EditText
|
||||||
dim l_geoAlmacen As Label
|
Dim l_geoAlmacen As Label
|
||||||
|
Dim rangoAAlmacen As Int = 50
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'You can add more parameters here.
|
'You can add more parameters here.
|
||||||
@@ -220,6 +221,7 @@ Sub B4XPage_Appear
|
|||||||
b_venta.Enabled = True
|
b_venta.Enabled = True
|
||||||
b_noVenta.Visible = False 'Boton deshabilitado por default.
|
b_noVenta.Visible = False 'Boton deshabilitado por default.
|
||||||
b_venta.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)")
|
' c = Starter.skmt.ExecQuery("SELECT ID FROM VENDIDOS WHERE ID IN (Select cuenta from cuentaa)")
|
||||||
' If c.RowCount > 0 Then
|
' If c.RowCount > 0 Then
|
||||||
' b_noVenta.Enabled = False
|
' b_noVenta.Enabled = False
|
||||||
@@ -262,7 +264,6 @@ Sub B4XPage_Appear
|
|||||||
l_total.Text = "0"
|
l_total.Text = "0"
|
||||||
Else
|
Else
|
||||||
l_total.Text = s.GetString("TOTAL_CLIE")
|
l_total.Text = s.GetString("TOTAL_CLIE")
|
||||||
|
|
||||||
End If
|
End If
|
||||||
total_cliente = s.GetString("TOTAL_CLIE")
|
total_cliente = s.GetString("TOTAL_CLIE")
|
||||||
Private factura As String = 0
|
Private factura As String = 0
|
||||||
@@ -301,7 +302,6 @@ Sub B4XPage_Appear
|
|||||||
Else
|
Else
|
||||||
MONTO_COMPRA = "0"
|
MONTO_COMPRA = "0"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
la_saldotot.Text = MONTO_COMPRA
|
la_saldotot.Text = MONTO_COMPRA
|
||||||
If MONTO_COMPRA <> "0" Then
|
If MONTO_COMPRA <> "0" Then
|
||||||
META2 = 1200 - MONTO_COMPRA
|
META2 = 1200 - MONTO_COMPRA
|
||||||
@@ -347,7 +347,6 @@ Sub B4XPage_Appear
|
|||||||
' b_noVenta.Visible = True
|
' b_noVenta.Visible = True
|
||||||
' b_venta.Visible = True
|
' b_venta.Visible = True
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
If Not(Starter.GPS.GPSEnabled) Then
|
If Not(Starter.GPS.GPSEnabled) Then
|
||||||
ToastMessageShow("Debe Activar el GPS del Equipo.", True)
|
ToastMessageShow("Debe Activar el GPS del Equipo.", True)
|
||||||
StartActivity(Starter.GPS.LocationSettingsIntent)
|
StartActivity(Starter.GPS.LocationSettingsIntent)
|
||||||
@@ -355,7 +354,6 @@ Sub B4XPage_Appear
|
|||||||
Starter.GPS.Start(0, 0)
|
Starter.GPS.Start(0, 0)
|
||||||
' If Starter.ubicacionActual.Latitude <> 0 Then GPS_LocationChanged(Starter.ubicacionActual)
|
' If Starter.ubicacionActual.Latitude <> 0 Then GPS_LocationChanged(Starter.ubicacionActual)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Log("Tracker LR Init: " & (Tracker.actualLR.IsInitialized))
|
Log("Tracker LR Init: " & (Tracker.actualLR.IsInitialized))
|
||||||
If Not(Tracker.actualLR.IsInitialized) Then
|
If Not(Tracker.actualLR.IsInitialized) Then
|
||||||
Log("INICIAMOS TRACKER")
|
Log("INICIAMOS TRACKER")
|
||||||
@@ -368,23 +366,20 @@ Sub B4XPage_Appear
|
|||||||
'' Log($"Tenemos UUC: ${Tracker.FLP.GetLastKnownLocation.Latitude},${Tracker.FLP.GetLastKnownLocation.Longitude}"$)
|
'' Log($"Tenemos UUC: ${Tracker.FLP.GetLastKnownLocation.Latitude},${Tracker.FLP.GetLastKnownLocation.Longitude}"$)
|
||||||
' GPS_LocationChanged(Tracker.FLP.GetLastKnownLocation)
|
' GPS_LocationChanged(Tracker.FLP.GetLastKnownLocation)
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' Log("DISTANCIA: " & distance)
|
' Log("DISTANCIA: " & distance)
|
||||||
' Log("HAY PEDIDO: " & Subs.hayPedido)
|
' Log("HAY PEDIDO: " & Subs.hayPedido)
|
||||||
' Log("GEOCERCA ACTIVA: " & Subs.geocercaHabilitada)
|
' Log("GEOCERCA ACTIVA: " & Subs.geocercaHabilitada)
|
||||||
' Log("EN ALMACEN: " & Subs.estamosEnAlmacen(50))
|
' 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
|
' 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_noVenta.Visible = True
|
||||||
b_venta.Visible = True
|
' b_venta.Visible = True
|
||||||
Log("Botones visibles")
|
' Log("Botones visibles")
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
'Si el cliente es nuevo, no aparece el boton de venta
|
'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_venta.Visible = False
|
||||||
b_noVenta.Visible = False
|
b_noVenta.Visible = False
|
||||||
End If
|
' End If
|
||||||
Subs.estamosEnAlmacen(50)
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub GPS_LocationChanged (Location1 As Location)
|
Sub GPS_LocationChanged (Location1 As Location)
|
||||||
@@ -396,7 +391,7 @@ Sub GPS_LocationChanged (Location1 As Location)
|
|||||||
' End If
|
' End If
|
||||||
|
|
||||||
Dim l1, l2 As Location
|
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}"$)
|
' Log($"Coordenadas de la tienda - lat:${m_lat}, lon:${m_lon}"$)
|
||||||
l2.Initialize2(m_lat, m_lon)
|
l2.Initialize2(m_lat, m_lon)
|
||||||
BT_QR.Enabled = True
|
BT_QR.Enabled = True
|
||||||
@@ -414,16 +409,20 @@ Sub GPS_LocationChanged (Location1 As Location)
|
|||||||
' b_venta.Visible = True
|
' b_venta.Visible = True
|
||||||
' Log("Botones visibles")
|
' Log("Botones visibles")
|
||||||
' End If
|
' End If
|
||||||
' Log("###########################################")
|
Log("###########################################")
|
||||||
' Log("No geocerca: " & Not(Subs.geocercaHabilitada))
|
Log("No geocerca: " & Not(Subs.geocercaHabilitada))
|
||||||
' Log("estamosEnAlmacen: " & Subs.estamosEnAlmacen(50))
|
Log("estamosEnAlmacen: " & Subs.estamosEnAlmacen(rangoAAlmacen))
|
||||||
' Log("distance: " & distance)
|
Log("distance: " & distance)
|
||||||
' Log("hayPedido: " & Subs.hayPedido)
|
Log("hayPedido: " & Subs.hayPedido)
|
||||||
|
' Subs.estamosEnAlmacen(ramgoAAlmacen)
|
||||||
' Log("ENTRAMOS: " & (Subs.hayPedido Or distance <= 50 Or Not(Subs.geocercaHabilitada) Or Subs.estamosEnAlmacen(50)))
|
' 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(50) Then ' Si estamos dentro de la geocerca, habilitamos los botones de Venta y noVenta
|
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_noVenta.Visible = True
|
||||||
b_venta.Visible = True
|
b_venta.Visible = True
|
||||||
' Log("Botones visibles")
|
' Log("Botones visibles")
|
||||||
|
Else
|
||||||
|
b_noVenta.Visible = False
|
||||||
|
b_venta.Visible = False
|
||||||
End If
|
End If
|
||||||
LA_GEO.TextColor = Colors.Blue
|
LA_GEO.TextColor = Colors.Blue
|
||||||
' b_noVenta.Visible = True
|
' b_noVenta.Visible = True
|
||||||
|
|||||||
@@ -312,7 +312,6 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
ds.Position = 0
|
ds.Position = 0
|
||||||
Starter.dia_semana = ds.GetString("CAT_CL_DIASEMANA")
|
Starter.dia_semana = ds.GetString("CAT_CL_DIASEMANA")
|
||||||
End If
|
End If
|
||||||
' CallSubDelayed(FirebaseMessaging, "SubscribeToTopics")
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub B4XPage_Appear
|
Sub B4XPage_Appear
|
||||||
|
|||||||
Binary file not shown.
@@ -199,7 +199,7 @@ Version=12.8
|
|||||||
#Region Project Attributes
|
#Region Project Attributes
|
||||||
#ApplicationLabel: Mariana
|
#ApplicationLabel: Mariana
|
||||||
#VersionCode: 1
|
#VersionCode: 1
|
||||||
#VersionName: 5.07.07
|
#VersionName: 5.07.24
|
||||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||||
#SupportedOrientations: portrait
|
#SupportedOrientations: portrait
|
||||||
#CanInstallToExternalStorage: False
|
#CanInstallToExternalStorage: False
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ ModuleClosedNodes0=
|
|||||||
ModuleClosedNodes1=
|
ModuleClosedNodes1=
|
||||||
ModuleClosedNodes10=
|
ModuleClosedNodes10=
|
||||||
ModuleClosedNodes11=
|
ModuleClosedNodes11=
|
||||||
ModuleClosedNodes12=
|
ModuleClosedNodes12=1
|
||||||
ModuleClosedNodes13=1
|
ModuleClosedNodes13=1
|
||||||
ModuleClosedNodes14=2
|
ModuleClosedNodes14=2
|
||||||
ModuleClosedNodes15=
|
ModuleClosedNodes15=
|
||||||
@@ -70,7 +70,7 @@ ModuleClosedNodes16=
|
|||||||
ModuleClosedNodes17=
|
ModuleClosedNodes17=
|
||||||
ModuleClosedNodes18=
|
ModuleClosedNodes18=
|
||||||
ModuleClosedNodes19=
|
ModuleClosedNodes19=
|
||||||
ModuleClosedNodes2=
|
ModuleClosedNodes2=2,4
|
||||||
ModuleClosedNodes20=
|
ModuleClosedNodes20=
|
||||||
ModuleClosedNodes21=
|
ModuleClosedNodes21=
|
||||||
ModuleClosedNodes22=
|
ModuleClosedNodes22=
|
||||||
@@ -88,6 +88,6 @@ ModuleClosedNodes6=
|
|||||||
ModuleClosedNodes7=
|
ModuleClosedNodes7=
|
||||||
ModuleClosedNodes8=
|
ModuleClosedNodes8=
|
||||||
ModuleClosedNodes9=
|
ModuleClosedNodes9=
|
||||||
NavigationStack=Subs,estamosEnAlmacen,1446,6,B4XMainPage,i_engrane_LongClick,814,0,Main,Process_Globals,21,0,Main,Activity_ActionBarHomeClick,35,0,Main,Activity_Create,27,0,B4XMainPage,Class_Globals,22,0,B4XMainPage,B4XPage_Appear,305,0,Diseñador Visual,cliente.bal,-100,6,B4XMainPage,B4XPage_Created,295,0,Main,Activity_Pause,49,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
|
SelectedBuild=0
|
||||||
VisibleModules=27,2,12,4,28,29,17
|
VisibleModules=27,2,12,4,28,29,17
|
||||||
|
|||||||
@@ -181,9 +181,12 @@ Private Sub timerRecordatorio_Tick
|
|||||||
Or (DateTime.GetHour(DateTime.now) = 15 And DateTime.GetMinute(DateTime.now) = 30) _ 'Recordatorio de las 15:30
|
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
|
Or (DateTime.GetHour(DateTime.now) = 10 And DateTime.GetMinute(DateTime.now) = 70) Then ' HORARIO DE PRUEBA
|
||||||
Log("¡¡MANDAMOS RECORDATORIO!!")
|
Log("¡¡MANDAMOS RECORDATORIO!!")
|
||||||
If Not(B4XPages.GetManager.IsForeground) Then Subs.notiHigh("¡¡ATENCION!!", "Recuerda enviar tu venta.", Main)
|
If Not(B4XPages.GetManager.IsForeground) Then
|
||||||
If B4XPages.MainPage.IsInitialized And B4XPages.MainPage.pantallaActual.IsInitialized Then
|
Subs.notiHigh("¡¡ATENCION!!", "Recuerda enviar tu venta.", Main)
|
||||||
B4XPages.MainPage.recordatorio.agregaPanelRecordatorio(B4XPages.MainPage.pantallaActual)
|
Else
|
||||||
|
If B4XPages.MainPage.IsInitialized And B4XPages.MainPage.pantallaActual.IsInitialized Then
|
||||||
|
B4XPages.MainPage.recordatorio.agregaPanelRecordatorio(B4XPages.MainPage.pantallaActual)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
ultimoRecordatorio = DateTime.GetHour(DateTime.now) & DateTime.GetMinute(DateTime.now)
|
ultimoRecordatorio = DateTime.GetHour(DateTime.now) & DateTime.GetMinute(DateTime.now)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1440,12 +1440,13 @@ Sub estamosEnAlmacen(rango As Int) As Boolean
|
|||||||
' Log($"Coordenadas del almacen - lat:${latAlmacen}, lon:${lonAlmacen}"$)
|
' Log($"Coordenadas del almacen - lat:${latAlmacen}, lon:${lonAlmacen}"$)
|
||||||
l2.Initialize2(latAlmacen, lonAlmacen)
|
l2.Initialize2(latAlmacen, lonAlmacen)
|
||||||
Dim distance As Long = l1.DistanceTo(l2) 'the result is in meters
|
Dim distance As Long = l1.DistanceTo(l2) 'the result is in meters
|
||||||
Log(distance)
|
|
||||||
' If distance < 100 Then ToastMessageShow("Distancia a almacen: " & distance, False)
|
' If distance < 100 Then ToastMessageShow("Distancia a almacen: " & distance, False)
|
||||||
notiHigh("Mariana", "Distancia a almacen: " & distance, Main)
|
' notiHigh("Mariana", "Distancia a almacen: " & distance, Main)
|
||||||
B4XPages.MainPage.cliente.l_geoAlmacen.text = $"Almacen a ${distance}"$
|
' B4XPages.MainPage.cliente.l_geoAlmacen.text = $"Almacen a: ${distance}"$
|
||||||
If distance <= rango Then res = True
|
If distance <= rango Then res = True
|
||||||
Log("Dentro del almacen: " & res)
|
Log("Dentro del almacen: " & res)
|
||||||
|
B4XPages.MainPage.cliente.l_geoAlmacen.Text = $"Almacen a: ${distance} - Rango: ${rango}"$
|
||||||
|
Log(distance)
|
||||||
Catch
|
Catch
|
||||||
Log(LastException)
|
Log(LastException)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
Reference in New Issue
Block a user