Se añade funcion para que no puedan hacer el envio hasta que se visiten todos los clientes

This commit is contained in:
Javier
2025-09-26 13:06:40 -06:00
parent 327cf1b198
commit 0d1472d1e9
5 changed files with 45 additions and 5 deletions

View File

@@ -229,6 +229,10 @@ Sub Class_Globals
Private l_version As Label
Dim cpb As Cursor
Private Label22 As Label
Private Label27 As Label
Private l_faltan As Label
Private l_visitas As Label
End Sub
'You can add more parameters here.
@@ -319,6 +323,10 @@ End Sub
Sub B4XPage_Appear
checaPedido
l_faltan.Text = 0
l_visitas.Text = 0
cpb = Starter.skmt.ExecQuery("SELECT PC_CLIENTE, PC_MONTO FROM PEDIDO_CLIENTE")
If cpb.RowCount > 0 Then
For i = 0 To cpb.RowCount-1
@@ -403,6 +411,26 @@ Sub B4XPage_Appear
l_ruta.Text = f.GetString("CAT_CL_RUTA")
f.Close
End If
If l_ruta.Text = "0" Then
Label22.Visible = False
Label27.Visible = False
l_faltan.Visible = False
l_visitas.Visible = False
l_faltan.Text = 0
l_visitas.Text = 0
Else
Label22.Visible = True
Label27.Visible = True
l_faltan.Visible = True
l_visitas.Visible = True
Dim totalcisitas As Cursor = Starter.skmt.ExecQuery("SELECT COUNT(*) AS CUENTA FROM KMT_INFO")
totalcisitas.Position = 0
l_visitas.Text = totalcisitas.GetInt("CUENTA")
Dim visitasfaltantes As Cursor = Starter.skmt.ExecQuery("SELECT COUNT(*) AS CUENTA FROM KMT_INFO WHERE gestion = 0")
visitasfaltantes.Position = 0
l_faltan.Text = visitasfaltantes.GetInt("CUENTA")
End If
If Cuantos = 0 Then
L_MONTOD.Text =0
l_cuantosc.Text = 0
@@ -1680,7 +1708,13 @@ Sub JobDone(Job As HttpJob)
Dim VALIDO As String = records(RESULT.Columns.Get("VALIDO"))
If VALIDO = "OK" Then
cargar.Visible = True
Subir.Visible = True
If l_ruta.Text <> 0 And l_faltan.Text = 0 Then
Subir.Visible = True
Else
Subir.Visible = False
End If
inv.Visible = True
connecta.Visible = False
If conn = "1" Then
@@ -1879,6 +1913,12 @@ Sub e_ruta_EnterPressed
Starter.skmt.ExecNonQuery("DELETE FROM HIST_CODIGO_BARRAS")
Starter.skmt.ExecNonQuery("DELETE FROM HIST_FOTO_CLIENTE")
Starter.skmt.ExecNonQuery("DELETE FROM CLIENTES_NUEVOS")
Label22.Visible = False
Label27.Visible = False
l_faltan.Visible = False
l_visitas.Visible = False
B4XPage_Appear
End If
End If