mirror of
https://github.com/KeymonSoft/Guna_Reparto_Imp.git
synced 2026-04-19 21:59:31 +00:00
Se puede entrar a pagares desde el boton y manda al cliente
Se actualiza el tiempo real Se actualiza el tiempo real por cliente Vista cxc
This commit is contained in:
@@ -32,6 +32,15 @@ Sub Class_Globals
|
||||
Dim rutaGenerada As Boolean = False
|
||||
Dim rutaacambiar As String
|
||||
Dim mostrarProgressDialog As Boolean
|
||||
Private nombrecliente As Label
|
||||
Private numerocliente As Label
|
||||
Private p_datosclie As Panel
|
||||
Private CREDITO As Label
|
||||
Private cxc As Label
|
||||
Private direccion As Label
|
||||
Dim d As Cursor
|
||||
|
||||
Private CustomListView1 As CustomListView
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -74,6 +83,25 @@ Sub B4XPage_Appear
|
||||
ListView1.Top = lv1Top + 100
|
||||
End If
|
||||
c=Starter.skmt.ExecQuery("select codigo, indice, CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_NOEXT from waypoints inner join kmt_info on waypoints.codigo = kmt_info.CAT_CL_CODIGO where gestion = 0 AND CAT_CL_RUTA <> 1000 order by indice")
|
||||
|
||||
|
||||
|
||||
|
||||
' d = Starter.skmt.ExecQuery($"select IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO FROM kmt_info WHERE CAT_CL_CODIGO = '${c.GetString("CAT_CL_CODIGO")}'"$)
|
||||
'' LogColor(d.RowCount,Colors.Blue)
|
||||
' If d.RowCount > 0 Then
|
||||
' d.Position = 0
|
||||
' If d.GetString("CAT_CL_BCREDITO") = "1" Then
|
||||
' CREDITO.Visible = False
|
||||
' Else
|
||||
' CREDITO.Visible = False
|
||||
' End If
|
||||
' d.Close
|
||||
' Else
|
||||
' CREDITO.Visible = False
|
||||
' End If
|
||||
|
||||
|
||||
If c.RowCount > 0 Then 'Ya hay waypoints en la base de datos
|
||||
c.Position = 0
|
||||
' Log("Ya hay waypoints.")
|
||||
@@ -90,7 +118,16 @@ Sub B4XPage_Appear
|
||||
' t1 = Starter.waypointsOrdered.Get(k)
|
||||
' c.GetString("codigo")
|
||||
' Log(c.GetString("indice"))
|
||||
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
d = Starter.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${c.GetString("codigo")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
Else
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")&" CXC").PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
Else
|
||||
generaListViewRutas
|
||||
@@ -190,7 +227,17 @@ Sub ListView1_ItemClick (Position As Int, Value As Object)
|
||||
m1 = distOrderedMap.Get(k)
|
||||
m1.Get("codigo")
|
||||
' Log(m1.Get("nomDirDist"))
|
||||
ListView1.AddTwoLines(m1.Get("codigo"), m1.Get("nomDirDist"))
|
||||
|
||||
d = Starter.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${m1.Get("codigo")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(m1.Get("codigo"), m1.Get("nomDirDist"))
|
||||
Else
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(m1.Get("codigo")&" CXC", m1.Get("nomDirDist"))
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
End If
|
||||
c2.Close
|
||||
@@ -198,7 +245,9 @@ Sub ListView1_ItemClick (Position As Int, Value As Object)
|
||||
Else If entro = "3" Then
|
||||
' LogColor("Guardamos CLIENTE " & Value, Colors.red)
|
||||
Starter.skmt.ExecNonQuery("delete from CUENTAA")
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object(Value))
|
||||
Dim sValue As String = Value
|
||||
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object(sValue.Replace(" CXC","")))
|
||||
B4XPages.ShowPage("Cliente")
|
||||
End If
|
||||
End Sub
|
||||
@@ -249,6 +298,25 @@ End Sub
|
||||
Sub BUSCA_TextChanged (Old As String, New As String)
|
||||
q_buscar = "%" & busca.Text & "%"
|
||||
c2=Starter.skmt.ExecQuery2("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info where CAT_CL_NOMBRE like ? and gestion = 0 AND CAT_CL_RUTA <> 1000 order by CAT_CL_CODIGO ", Array As String(q_buscar))
|
||||
|
||||
|
||||
|
||||
' d = Starter.skmt.ExecQuery($"select IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO FROM kmt_info WHERE CAT_CL_CODIGO = '${c2.GetString("CAT_CL_CODIGO")}'"$)
|
||||
'' LogColor(d.RowCount,Colors.Blue)
|
||||
' If d.RowCount > 0 Then
|
||||
' d.Position = 0
|
||||
'' LogColor(d.GetString("CAT_CL_BCREDITO"),Colors.Blue)
|
||||
' If d.GetString("CAT_CL_BCREDITO") = "1" Then
|
||||
' CREDITO.Visible = False
|
||||
' Else
|
||||
' CREDITO.Visible = False
|
||||
' End If
|
||||
' d.Close
|
||||
' Else
|
||||
' CREDITO.Visible = False
|
||||
' End If
|
||||
|
||||
|
||||
ListView1.Clear
|
||||
lfila.text = "Nombre y Calle"
|
||||
Subs.SetDivider(ListView1, Colors.Blue, 2)
|
||||
@@ -265,7 +333,19 @@ Sub BUSCA_TextChanged (Old As String, New As String)
|
||||
label2.TextSize = 20
|
||||
label2.Typeface = Typeface.CreateNew(Typeface.DEFAULT_BOLD, Typeface.STYLE_BOLD)
|
||||
label2.TextColor = Colors.White
|
||||
ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE"))
|
||||
|
||||
d = Starter.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${c2.GetString("CAT_CL_CODIGO")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO")&"cxc", c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE"))
|
||||
Else
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO")&" CXC", c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE"))
|
||||
' ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
End If
|
||||
entro = "3"
|
||||
@@ -473,7 +553,18 @@ Sub traeRutaDia(aVisitar As B4XOrderedMap)
|
||||
c.Position=i
|
||||
cs.Initialize
|
||||
cs2.Initialize
|
||||
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
|
||||
d = Starter.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${c.GetString("codigo")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
Else
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")&" CXC").PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
|
||||
End If
|
||||
|
||||
' ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")&"cxc").PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
Next
|
||||
End If
|
||||
c.Close
|
||||
@@ -669,7 +760,18 @@ Sub caculaRutaGPS(coords As List, agregarActual As Boolean)
|
||||
c.Position = i
|
||||
cs.Initialize
|
||||
cs2.Initialize
|
||||
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
|
||||
d = Starter.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${c.GetString("codigo")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
' ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
Else
|
||||
' cxc.Visible = False
|
||||
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")&" CXC").PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
|
||||
|
||||
End If
|
||||
|
||||
ultimaLat = c.GetString("CAT_CL_LAT") 'Obtenemos las coordenadas de la ultima tienda.
|
||||
ultimaLon = c.GetString("CAT_CL_LONG")
|
||||
Next
|
||||
@@ -726,3 +828,19 @@ Sub todosAVisitar As List
|
||||
Log(aVisitar)
|
||||
Return aVisitar
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CreateListItem(mostrar As String, mostrar1 As String, mostrar2 As String) As Panel
|
||||
Dim p As B4XView = xui.CreatePanel("")
|
||||
p.SetLayoutAnimated(0, 0, 0, 1, 220)
|
||||
p.LoadLayout("datoscliente")
|
||||
p.Height= 60dip
|
||||
' p.Width = clv_orden.GetBase.Width
|
||||
nombrecliente.Text = mostrar
|
||||
direccion.Text = mostrar1
|
||||
numerocliente.Text = mostrar2
|
||||
p_datosclie.Tag = mostrar2
|
||||
' cxc.Text = mostrar3
|
||||
' Log(p.Width)
|
||||
Return p
|
||||
End Sub
|
||||
Reference in New Issue
Block a user