mirror of
https://github.com/KeymonSoft/Mariana.git
synced 2026-04-18 21:29:13 +00:00
- VERSION 5.06.24
- Se Agregó un switch para activar/descativar la geocerca, solo se puede modficar dentro del almacen y requiere contraseña de supervisor de un solo uso. - Se agregaron recordatorios de "Envío de venta", a las 10:30, 13:00 y 15:30 y por cada uno de esos horarios, 10, 5, 1 minutos antes.
This commit is contained in:
@@ -144,6 +144,8 @@ 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
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -202,8 +204,11 @@ 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
|
||||
b_noVenta.Enabled = True
|
||||
b_venta.Enabled = True
|
||||
b_noVenta.Visible = False 'Boton deshabilitado por default.
|
||||
b_venta.Visible = False 'Boton deshabilitado por default.
|
||||
' c = Starter.skmt.ExecQuery("SELECT ID FROM VENDIDOS WHERE ID IN (Select cuenta from cuentaa)")
|
||||
' If c.RowCount > 0 Then
|
||||
' b_noVenta.Enabled = False
|
||||
@@ -302,11 +307,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,10 +332,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
|
||||
' If ALMACEN = "16" Or ALMACEN = "13" Then
|
||||
' b_noVenta.Visible = True
|
||||
' b_venta.Visible = True
|
||||
' End If
|
||||
CallSubDelayed(Tracker, "Track")
|
||||
|
||||
If Not(Starter.GPS.GPSEnabled) Then
|
||||
@@ -347,8 +352,14 @@ Sub B4XPage_Appear
|
||||
' Log($"Tenemos UUC: ${Tracker.FLP.GetLastKnownLocation.Latitude},${Tracker.FLP.GetLastKnownLocation.Longitude}"$)
|
||||
GPS_LocationChanged(Tracker.FLP.GetLastKnownLocation)
|
||||
End If
|
||||
b_noVenta.Visible = True
|
||||
b_venta.Visible = True
|
||||
|
||||
Log("DISTANCIA: " & distance)
|
||||
If Subs.hayPedido Or 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
|
||||
|
||||
'Si el cliente es nuevo, no aparece el boton de venta
|
||||
If la_cuenta.text.SubString2(0,1) = "N" Then
|
||||
b_venta.Visible = False
|
||||
@@ -363,7 +374,7 @@ Sub GPS_LocationChanged (Location1 As Location)
|
||||
B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude
|
||||
' Log("Coords set to: " & B4XPages.MainPage.lat_gps & " and " & B4XPages.MainPage.lon_gps)
|
||||
End If
|
||||
|
||||
|
||||
Dim l1, l2 As Location
|
||||
l1.Initialize2(B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps)
|
||||
' Log($"Coordenadas de la tienda - lat:${m_lat}, lon:${m_lon}"$)
|
||||
@@ -372,15 +383,21 @@ Sub GPS_LocationChanged (Location1 As Location)
|
||||
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
|
||||
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) And Not(Subs.geocercaHabilitada) Then
|
||||
b_noVenta.Visible = True
|
||||
b_venta.Visible = True
|
||||
' Log("Botones visibles")
|
||||
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
|
||||
@@ -397,7 +414,7 @@ Sub GPS_LocationChanged (Location1 As Location)
|
||||
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
|
||||
|
||||
CallSubDelayed(Tracker, "CreateLocationRequest")
|
||||
|
||||
Reference in New Issue
Block a user