- VERSION 5.03.02.MV

- Se agregó en TicketsDia el estatus de los pedidos segun las validaciones de envio.
- Se agregó que al final, cuando se valida que coincidan las cantidades totales y montos totales del pedido contra Web, si no coinciden, se reinicien las validaciones poniendo en cero PE_ENVIO_OK y PC_ENVIO_OK.
This commit is contained in:
2025-03-04 21:24:23 -06:00
parent de06eec31f
commit e45c86a857
3 changed files with 51 additions and 25 deletions

View File

@@ -32,24 +32,22 @@ Private Sub B4XPage_Created (Root1 As B4XView)
If File.Exists(ruta, "kmt.db") = False Then If File.Exists(ruta, "kmt.db") = False Then
File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db") File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db")
End If End If
c = B4XPages.MainPage.skmt.ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc") ' c = B4XPages.MainPage.skmt.ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")
' ListView1.Clear
' If c.RowCount>0 Then
ListView1.Clear ' For i=0 To c.RowCount -1
If c.RowCount>0 Then ' c.Position=i
For i=0 To c.RowCount -1 ' Dim label1 As Label
c.Position=i ' label1 = ListView1.TwoLinesLayout.Label
Dim label1 As Label ' label1.TextSize = 10
label1 = ListView1.TwoLinesLayout.Label ' label1.TextColor = Colors.Black
label1.TextSize = 10 ' Dim label2 As Label
label1.TextColor = Colors.Black ' label2 = ListView1.TwoLinesLayout.SecondLabel
Dim label2 As Label ' label2.TextSize = 13
label2 = ListView1.TwoLinesLayout.SecondLabel ' label2.TextColor = Colors.Blue
label2.TextSize = 13 ' ListView1.AddTwoLines(c.GetString("PC_CLIENTE"),"Cantidad #"& c.GetString("PC_NOART")& " SubTotal $"& c.GetString("PC_MONTO"))
label2.TextColor = Colors.Blue ' Next
ListView1.AddTwoLines(c.GetString("PC_CLIENTE"),"Cantidad #"& c.GetString("PC_NOART")& " SubTotal $"& c.GetString("PC_MONTO")) ' End If
Next
End If
End Sub End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage. 'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
@@ -61,6 +59,7 @@ Sub B4XPage_Appear
ListView1.Clear ListView1.Clear
If c.RowCount>0 Then If c.RowCount>0 Then
ListView1.TwoLinesLayout.ItemHeight = 70dip
For i=0 To c.RowCount -1 For i=0 To c.RowCount -1
c.Position=i c.Position=i
Dim x As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select IFNULL(sum(PE_CANT),0) as PC_NOART from PEDIDO where PE_CLIENTE = '${c.GetString("PC_CLIENTE")}' AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP)"$) Dim x As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select IFNULL(sum(PE_CANT),0) as PC_NOART from PEDIDO where PE_CLIENTE = '${c.GetString("PC_CLIENTE")}' AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP)"$)
@@ -71,13 +70,40 @@ Sub B4XPage_Appear
End If End If
Dim label1 As Label Dim label1 As Label
label1 = ListView1.TwoLinesLayout.Label label1 = ListView1.TwoLinesLayout.Label
label1.Height = 15dip
label1.TextSize = 10 label1.TextSize = 10
label1.Gravity = Gravity.TOP
label1.TextColor = Colors.Black label1.TextColor = Colors.Black
Dim label2 As Label Dim label2 As Label
label2 = ListView1.TwoLinesLayout.SecondLabel label2 = ListView1.TwoLinesLayout.SecondLabel
label2.TextSize = 13 label2.TextSize = 13
label2.Gravity = Gravity.TOP
label2.TextColor = Colors.Blue label2.TextColor = Colors.Blue
ListView1.AddTwoLines(c.GetString("PC_CLIENTE"),c.GetString("NOMBRE") &" Cantidad #"& noArticulos & " SubTotal $"& c.GetString("PC_MONTO")) label2.Height = 50dip
label2.Top = 15dip
' label2.Color = Colors.Cyan
Private ts As Cursor = Starter.skmt.ExecQuery($"select ifnull(pc_envio_ok, 0) as estatus from pedido_cliente where pc_cliente = '${c.GetString("PC_CLIENTE")}'"$)
Private estatus As String = "Pendiente"
Private color As Int
If ts.RowCount > 0 Then
ts.Position = 0
If ts.GetString("estatus") = 0 Then
estatus = "Guardando"
color = Colors.red
else if ts.GetString("estatus") = 1 Or ts.GetString("estatus") = 2 Then
estatus = "En proceso"
color = Colors.RGB(255,175,1)
else if ts.GetString("estatus") = 3 Then
estatus = "Validado"
color = Colors.RGB(0,146,1)
End If
End If
Log(estatus)
Private cs As CSBuilder
cs.Initialize
ListView1.AddTwoLines(c.GetString("PC_CLIENTE"), _
cs.Color(Colors.blue).append(c.GetString("NOMBRE") &" Cantidad #"& noArticulos & " SubTotal $"& c.GetString("PC_MONTO")).Color(color).append(" - " & estatus).popall)
Next Next
End If End If
c.Close c.Close

View File

@@ -73,7 +73,7 @@ ModuleClosedNodes17=
ModuleClosedNodes18= ModuleClosedNodes18=
ModuleClosedNodes19= ModuleClosedNodes19=
ModuleClosedNodes2= ModuleClosedNodes2=
ModuleClosedNodes20= ModuleClosedNodes20=6
ModuleClosedNodes21= ModuleClosedNodes21=
ModuleClosedNodes22= ModuleClosedNodes22=
ModuleClosedNodes23= ModuleClosedNodes23=
@@ -91,6 +91,6 @@ ModuleClosedNodes6=
ModuleClosedNodes7= ModuleClosedNodes7=
ModuleClosedNodes8= ModuleClosedNodes8=
ModuleClosedNodes9= ModuleClosedNodes9=
NavigationStack=C_RespaldoDiario,agregaColumna,127,0,C_Validador,timerValidador_Tick,47,6,C_Validador,iniciaValidacion,34,6,Subs,totalPedido,702,0,Subs,traeRuta,707,6,C_Principal,cargar_Click,890,0,C_Validador,Class_Globals,5,0,C_Validador,Initialize,21,0,B4XMainPage,B4XPage_Created,180,0,C_Principal,JobDone,1558,0,C_Cliente,Guardar_Click,621,0 NavigationStack=C_TicketsDia,b_noventa_Click,156,0,C_TicketsDia,B4XPage_Created,28,0,C_TicketsDia,B4XPage_Appear,92,6,C_Principal,JobDone,1558,0,C_Principal,Subir_Click,695,0,C_Validador,revisaCantsYMontosTotales,149,0,C_Validador,timerValidador_Tick,52,0,C_Validador,revisaGuardados,93,0,C_Validador,iniciaValidacion,37,0,C_Validador,mandaGuardados,92,0,C_Validador,JobDone,159,0
SelectedBuild=0 SelectedBuild=0
VisibleModules=2,28,13,14,4,20,29,15,16,18 VisibleModules=2,28,13,14,4,20,29,15,16,18