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:
@@ -11,6 +11,8 @@ Sub Class_Globals
|
||||
Dim cmd As DBCommand
|
||||
Dim b, c, d As Cursor
|
||||
Dim usuario, almacen As String
|
||||
Dim enviando As Boolean = False
|
||||
Dim validando As Boolean = False
|
||||
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
|
||||
End Sub
|
||||
|
||||
@@ -21,6 +23,7 @@ Public Sub Initialize
|
||||
End Sub
|
||||
|
||||
Sub envia
|
||||
enviando = True
|
||||
' carga = "SUBIR"
|
||||
' p_mandaInfo.Width = Root.Width
|
||||
' p_mandaInfo.Height = Root.Height
|
||||
@@ -209,7 +212,7 @@ Sub envia
|
||||
|
||||
' PEDIDO
|
||||
c = B4XPages.MainPage.skmt.ExecQuery("SELECT PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO, PE_COSTO_SIN, PE_RUTA, PE_DESC, PE_FOLIO, PE_CANTC, PE_BCAJAS FROM PEDIDO WHERE PE_FOLIO <> 'RECARGA'")
|
||||
d = B4XPages.MainPage.skmt.ExecQuery("SELECT COUNT(*) as CUANTOS_PEDIDO FROM PEDIDO")
|
||||
d = B4XPages.MainPage.skmt.ExecQuery("SELECT COUNT(*) as CUANTOS_PEDIDO FROM PEDIDO WHERE PE_FOLIO <> 'RECARGA'")
|
||||
If c.RowCount > 0 Then
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position = i
|
||||
@@ -422,4 +425,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