Version: 5.03.31

Se le agrego una vista al enviar informacion.
This commit is contained in:
IsR0d
2025-04-01 16:41:11 -06:00
parent c400659e06
commit c1df998ed6
489 changed files with 6317 additions and 4628 deletions

View File

@@ -76,6 +76,7 @@ Sub Class_Globals
Private l_montopag As Label
Private l_efectivo As Label
Private l_montoefec As Label
Dim distance As Long
End Sub
'You can add more parameters here.
@@ -128,6 +129,10 @@ Sub B4XPage_Appear
Subs.centraPanel(p_principal, Root.Width)
Starter.skmt.Initialize(Starter.ruta,"kmt.db", True)
reqManager.Initialize(Me, B4XPages.MainPage.SERVER)
Tar.Visible = False
gest.Visible = False
b_noEntrega.Visible = False
HIST.Visible = False
c=Starter.skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT, CAT_CL_BCREDITO from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
s=Starter.skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
s.Position=0
@@ -297,6 +302,18 @@ Sub B4XPage_Appear
l_montopag.Visible = False
End If
If distance < 50 Then
Tar.Visible = True
gest.Visible = True
b_noEntrega.Visible = True
HIST.Visible = True
Else
Tar.Visible = False
gest.Visible = False
b_noEntrega.Visible = False
HIST.Visible = False
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
@@ -304,14 +321,50 @@ Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub GPS_LocationChanged (Location1 As Location)
' lat_gps=Location1.ConvertToSeconds(Location1.Latitude)
' lon_gps=Location1.ConvertToSeconds(Location1.Longitude)
' 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
Log("Coords set to: " & B4XPages.MainPage.lat_gps & " and " & B4XPages.MainPage.lon_gps)
End If
If LATITUD.Length < 5 Then
Else
Dim l1, l2 As Location
l1.Initialize2(B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps)
Log($"Coordenadas de la tienda - lat:${LATITUD}, lon:${LONGITUD}"$)
l2.Initialize2(LATITUD, LONGITUD)
'now we need the distance between our location and the target location
distance = l1.DistanceTo(l2) 'the result is in meter
If distance < 50 Then
Tar.Visible = True
gest.Visible = True
b_noEntrega.Visible = True
HIST.Visible = True
Else
Tar.Visible = False
gest.Visible = False
b_noEntrega.Visible = False
HIST.Visible = False
End If
Log("DISTANCIA "&distance)
End If
Dim sDate,sTime As String
DateTime.DateFormat = "MM/dd/yyyy"
sDate=DateTime.Date(DateTime.Now)
sTime=DateTime.Time(DateTime.Now)
Starter.skmt.ExecNonQuery("DELETE FROM HIST_GPS")
Starter.skmt.ExecNonQuery2("INSERT INTO HIST_GPS (HGDATE, HGLAT, HGLON) VALUES(?,?,?) ", Array As Object (sDate & sTime, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps))
CallSubDelayed(Tracker, "CreateLocationRequest")
End Sub
Sub ListView1_ItemLongClick (Position As Int, Value As Object)
@@ -363,13 +416,17 @@ Sub Guardado
Starter.skmt.ExecNonQuery("update HIST_VENTAS SET HVD_ESTATUS = 1 WHERE HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
mandaPendientesreparto
Dim mandamapa As Cursor = Starter.skmt.ExecQuery("SELECT * FROM kmt_info WHERE gestion = 0 and CAT_CL_CODIGO <> 63403")
If mandamapa.RowCount > 0 Then
StartActivity(MAPA_RUTAS)
Else If mandamapa.RowCount = 0 Then
B4XPages.ShowPage("Principal")
Msgbox2Async("Pedido entregado","Atención","Ok","", "",LoadBitmap(File.DirAssets,"alert2.png"), False)
Wait For Msgbox_Result (resultado As Int)
If resultado = DialogResponse.POSITIVE Then
Dim mandamapa As Cursor = Starter.skmt.ExecQuery("SELECT * FROM kmt_info WHERE gestion = 0 and CAT_CL_CODIGO <> 63403")
If mandamapa.RowCount > 0 Then
StartActivity(MAPA_RUTAS)
Else If mandamapa.RowCount = 0 Then
B4XPages.ShowPage("Principal")
End If
End If
End Sub
Sub b_noEntrega_Click