mirror of
https://github.com/KeymonSoft/Mariana.git
synced 2026-04-17 12:56:11 +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.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)
|
||||
@@ -923,7 +928,7 @@ End Sub
|
||||
Private Sub p_geocerca_Click
|
||||
Log("CLICKED")
|
||||
Dim activa As Int = 1
|
||||
If Subs.estamosEnAlmacen(500) Then
|
||||
If Subs.estamosEnAlmacen(100) Then
|
||||
If l_geocerca.Text <> "Buscando ubicación ..." Then
|
||||
If passSupervisor = "" Then
|
||||
p_transparente.Visible = True
|
||||
|
||||
@@ -150,7 +150,8 @@ Sub Class_Globals
|
||||
Private p_passGeocerca As Panel
|
||||
Private b_passGeocerca As Button
|
||||
Private et_passGeocerca As EditText
|
||||
dim l_geoAlmacen As Label
|
||||
Dim l_geoAlmacen As Label
|
||||
Dim rangoAAlmacen As Int = 50
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -220,6 +221,7 @@ Sub B4XPage_Appear
|
||||
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
|
||||
@@ -262,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
|
||||
@@ -301,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
|
||||
@@ -347,7 +347,6 @@ Sub B4XPage_Appear
|
||||
' 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)
|
||||
@@ -355,7 +354,6 @@ Sub B4XPage_Appear
|
||||
Starter.GPS.Start(0, 0)
|
||||
' If Starter.ubicacionActual.Latitude <> 0 Then GPS_LocationChanged(Starter.ubicacionActual)
|
||||
End If
|
||||
|
||||
Log("Tracker LR Init: " & (Tracker.actualLR.IsInitialized))
|
||||
If Not(Tracker.actualLR.IsInitialized) Then
|
||||
Log("INICIAMOS TRACKER")
|
||||
@@ -368,23 +366,20 @@ Sub B4XPage_Appear
|
||||
'' 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
|
||||
|
||||
' 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
|
||||
Subs.estamosEnAlmacen(50)
|
||||
' End If
|
||||
End Sub
|
||||
|
||||
Sub GPS_LocationChanged (Location1 As Location)
|
||||
@@ -396,7 +391,7 @@ Sub GPS_LocationChanged (Location1 As Location)
|
||||
' 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
|
||||
@@ -414,16 +409,20 @@ Sub GPS_LocationChanged (Location1 As Location)
|
||||
' b_venta.Visible = True
|
||||
' Log("Botones visibles")
|
||||
' End If
|
||||
' Log("###########################################")
|
||||
' Log("No geocerca: " & Not(Subs.geocercaHabilitada))
|
||||
' Log("estamosEnAlmacen: " & Subs.estamosEnAlmacen(50))
|
||||
' Log("distance: " & distance)
|
||||
' Log("hayPedido: " & Subs.hayPedido)
|
||||
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(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_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
|
||||
|
||||
@@ -312,7 +312,6 @@ 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
|
||||
|
||||
Binary file not shown.
@@ -199,7 +199,7 @@ Version=12.8
|
||||
#Region Project Attributes
|
||||
#ApplicationLabel: Mariana
|
||||
#VersionCode: 1
|
||||
#VersionName: 5.07.07
|
||||
#VersionName: 5.07.24
|
||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||
#SupportedOrientations: portrait
|
||||
#CanInstallToExternalStorage: False
|
||||
|
||||
@@ -62,7 +62,7 @@ ModuleClosedNodes0=
|
||||
ModuleClosedNodes1=
|
||||
ModuleClosedNodes10=
|
||||
ModuleClosedNodes11=
|
||||
ModuleClosedNodes12=
|
||||
ModuleClosedNodes12=1
|
||||
ModuleClosedNodes13=1
|
||||
ModuleClosedNodes14=2
|
||||
ModuleClosedNodes15=
|
||||
@@ -70,7 +70,7 @@ ModuleClosedNodes16=
|
||||
ModuleClosedNodes17=
|
||||
ModuleClosedNodes18=
|
||||
ModuleClosedNodes19=
|
||||
ModuleClosedNodes2=
|
||||
ModuleClosedNodes2=2,4
|
||||
ModuleClosedNodes20=
|
||||
ModuleClosedNodes21=
|
||||
ModuleClosedNodes22=
|
||||
@@ -88,6 +88,6 @@ ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
ModuleClosedNodes8=
|
||||
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
|
||||
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) = 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)
|
||||
If B4XPages.MainPage.IsInitialized And B4XPages.MainPage.pantallaActual.IsInitialized Then
|
||||
B4XPages.MainPage.recordatorio.agregaPanelRecordatorio(B4XPages.MainPage.pantallaActual)
|
||||
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
|
||||
|
||||
@@ -1440,12 +1440,13 @@ Sub estamosEnAlmacen(rango As Int) As Boolean
|
||||
' Log($"Coordenadas del almacen - lat:${latAlmacen}, lon:${lonAlmacen}"$)
|
||||
l2.Initialize2(latAlmacen, lonAlmacen)
|
||||
Dim distance As Long = l1.DistanceTo(l2) 'the result is in meters
|
||||
Log(distance)
|
||||
' 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}"$
|
||||
' 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
|
||||
|
||||
Reference in New Issue
Block a user