mirror of
https://github.com/KeymonSoft/DBCheck.git
synced 2026-04-17 19:37:09 +00:00
VERSION 6.03.19
- Correcion en envio de datos de venta y reparto
This commit is contained in:
@@ -13,6 +13,8 @@ Sub Class_Globals
|
||||
Dim usuario, almacen As String
|
||||
Dim datos_iguales, almacen, carga, paso, conteo, porcentaje, perfil, cuantos, NUMERO_PEDIDO, usuario, cuantos_exib, cuantos_pedidosc, cuantos_noventa, cuantos_ped, cuantos_pedido As String
|
||||
Dim l_ruta As Label
|
||||
Dim enviando As Boolean = False
|
||||
Dim validando As Boolean = False
|
||||
End Sub
|
||||
|
||||
'Initializes the object. You can add parameters to this method if needed.
|
||||
@@ -23,6 +25,7 @@ Public Sub Initialize
|
||||
End Sub
|
||||
|
||||
Sub envia
|
||||
enviando = True
|
||||
l_ruta.text = Subs.traeRuta
|
||||
' carga = "SUBIR"
|
||||
' P1.Visible = True
|
||||
@@ -298,4 +301,67 @@ Public Sub ConfigurarYEnviar(ServidorURL As String)
|
||||
' 'Me' aquí es C_Intmex, asegurando que C_Intmex.JobDone sea llamado.
|
||||
reqManager.Initialize(Me, ServidorURL)
|
||||
envia ' Llama a la función de envío original de C_Intmex
|
||||
End Sub
|
||||
|
||||
Sub JobDone(Job As HttpJob)
|
||||
Log("JOBDONE - " & almacen)
|
||||
|
||||
' 1. Tachamos el request de la lista
|
||||
If reqManager.reqsList.IsInitialized Then
|
||||
Dim index As Int = reqManager.reqsList.IndexOf(Job.tag)
|
||||
If index <> -1 Then reqManager.reqsList.RemoveAt(index)
|
||||
End If
|
||||
|
||||
If Not(Job.Success) Then
|
||||
LogColor("Error en red: " & Job.tag & " : " & Subs.parseHTTPError(Job.ErrorMessage), Colors.Red)
|
||||
Else
|
||||
' 2. Procesamos validaciones
|
||||
Dim RESULT As DBResult = reqManager.HandleJob(Job)
|
||||
|
||||
If Job.JobName = "DBRequest" Then
|
||||
If RESULT.Tag = "valida_pedido" Then
|
||||
Subs.logJobDoneResultados(RESULT)
|
||||
For Each records() As Object In RESULT.Rows
|
||||
Dim CUANTOSP As Int = records(RESULT.Columns.Get("CUANTOSP"))
|
||||
B4XPages.MainPage.l_vProds2.Text = $"${CUANTOSP}/${cuantos_pedido}"$
|
||||
' Mantenemos tu lógica permisiva
|
||||
If cuantos_pedido <= CUANTOSP Then
|
||||
datos_iguales = "ok"
|
||||
Else
|
||||
LogColor("Faltan pedidos. Envíe nuevamente: " & CUANTOSP & "/" & cuantos_pedido, Colors.Red)
|
||||
End If
|
||||
Next
|
||||
Else If RESULT.Tag = "valida_pedidoc" Then
|
||||
Subs.logJobDoneResultados(RESULT)
|
||||
For Each records() As Object In RESULT.Rows
|
||||
Dim CUANTOSC As Int = records(RESULT.Columns.Get("CUANTOSC"))
|
||||
B4XPages.MainPage.l_vPedidos2.Text = $"${CUANTOSC}/${cuantos_pedidosc}"$
|
||||
Next
|
||||
Else If RESULT.Tag = "valida_noventa" Then
|
||||
Subs.logJobDoneResultados(RESULT)
|
||||
For Each records() As Object In RESULT.Rows
|
||||
Dim CUANTOSN As Int = records(RESULT.Columns.Get("CUANTOSN"))
|
||||
B4XPages.MainPage.l_vNoVenta2.Text = $"${CUANTOSN}/${cuantos_noventa}"$
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Job.Release
|
||||
|
||||
' 3. Control de flujo seguro
|
||||
If reqManager.reqsList.size = 0 Then
|
||||
B4XPages.MainPage.p_progressDialog.Visible = False
|
||||
If enviando Then
|
||||
enviando = False
|
||||
B4XPages.MainPage.l_progressDialog.Text = "Validando "
|
||||
B4XPages.MainPage.p_progressDialog.Visible = True
|
||||
Sleep(200)
|
||||
valida
|
||||
Else If validando Then
|
||||
validando = False
|
||||
Sleep(300)
|
||||
B4XPages.MainPage.p_validacion.Visible = True
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Reference in New Issue
Block a user