mirror of
https://github.com/KeymonSoft/Izca_Reparto_Creditos.git
synced 2026-04-20 14:19:26 +00:00
...
This commit is contained in:
@@ -84,7 +84,7 @@ Sub Class_Globals
|
||||
Private p_principal As Panel
|
||||
Dim ime As IME
|
||||
Private b_tabulador As Button
|
||||
|
||||
Dim paso1 As String
|
||||
Private l_rutasP As Label
|
||||
Private l_rechazo As Label
|
||||
Private Label9 As Label
|
||||
@@ -139,6 +139,11 @@ Sub Class_Globals
|
||||
Private l_pagaresnuevos As Label
|
||||
Private l_montoaliquidar As Label
|
||||
Private Label21 As Label
|
||||
Private b_comodin As Button
|
||||
Private p_validacion As Panel
|
||||
Private b_cancelarcodigo As Button
|
||||
Private b_aceptar As Button
|
||||
Private et_codigo As EditText
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -324,9 +329,9 @@ Sub B4XPage_Appear
|
||||
f1=Starter.skmt.ExecQuery("select sum(hvd_costo_tot) as MONTO_TOTAL_DIA from hist_ventas2 where hvd_cliente in (select cat_cl_codigo from kmt_info ) AND HVD_RECHAZO = 0")
|
||||
f2=Starter.skmt.ExecQuery("select sum(REP_COSTO_TOT) as MONTO_REC_DIA FROM REPARTO where REP_cliente in (Select cat_cl_codigo from kmt_info)")
|
||||
' b=Starter.skmt.ExecQuery("select count(*) as CUANTOS from noventa where nv_cliente in (select cat_cl_codigo from kmt_info where gestion = 3)")
|
||||
b=Starter.skmt.ExecQuery("select count(DISTINCT NV_CLIENTE) as CUANTOS from noventa where nv_motivo <> 'ENTREGA' and NV_CLIENTE <> 63403")
|
||||
b=Starter.skmt.ExecQuery("select count(DISTINCT NV_CLIENTE) as CUANTOS from noventa where nv_motivo <> 'ENTREGA' and NV_CLIENTE NOT IN ('63403', '100000')")
|
||||
' L=Starter.skmt.ExecQuery("select count(*) as CLIENTES_DIA from noventa where nv_cliente in (select cat_cl_codigo from kmt_info where gestion = 2)")
|
||||
L=Starter.skmt.ExecQuery("select count(DISTINCT NV_CLIENTE) as CLIENTES_DIA from noventa where nv_motivo = 'ENTREGA' and NV_CLIENTE <> 63403")
|
||||
L=Starter.skmt.ExecQuery("select count(DISTINCT NV_CLIENTE) as CLIENTES_DIA from noventa where nv_motivo = 'ENTREGA' and NV_CLIENTE NOT IN ('63403', '100000')")
|
||||
f2.Position=0
|
||||
' F4=Starter.skmt.execqUery("select count(*) as CUANTOS FROM PEDIDO")
|
||||
' F4.Position = 0
|
||||
@@ -744,12 +749,14 @@ Sub B4XPage_Appear
|
||||
' b_venta_emp.Visible = False
|
||||
' End If
|
||||
b_venta_emp.Visible = True
|
||||
b_comodin.Visible = True
|
||||
Else
|
||||
Label21.Visible = False
|
||||
l_montoaliquidar.Visible = False
|
||||
Label9.Visible = False '''' PRUEBAS MOVER A TRUE
|
||||
L_MONTOE.Visible = False
|
||||
b_venta_emp.Visible = False '''' PRUEBAS MOVER A TRUE
|
||||
b_comodin.Visible = False
|
||||
End If
|
||||
|
||||
If l_ruta.Text = 0 Then
|
||||
@@ -842,27 +849,229 @@ Sub trabajar_Click
|
||||
End Sub
|
||||
|
||||
Sub Subir_Click
|
||||
If Not(IsConnectedToInternet) Then MsgboxAsync("No hay conexión a conexión a Internet", "Revisa tu conexión")
|
||||
c=Starter.skmt.ExecQuery("select usuario from usuarioa")
|
||||
c.Position = 0
|
||||
usuario = c.GetString("USUARIO")
|
||||
c.Close
|
||||
|
||||
c = Starter.skmt.ExecQuery("SELECT * FROM BLOCKENVIO")
|
||||
If c.RowCount = 0 Then
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO BLOCKENVIO(ENVIADO) VALUES (?)", Array As Object (1))
|
||||
envioinfo
|
||||
Private cg As Cursor = Starter.skmt.ExecQuery("select HVD_PRONOMBRE, IFNULL(SUM(HVD_RECHAZOCANT), 0) AS HVD_RECHAZOCANT, HVD_PROID from HIST_VENTAS WHERE hvd_rechazo <> 2 and HVD_RECHAZOCANT > 0 GROUP BY HVD_PROID order by HVD_PRONOMBRE asc")
|
||||
|
||||
|
||||
If cg.RowCount > 0 Then
|
||||
Dim banderarechazo As Int = 0
|
||||
|
||||
For i = 0 To cg.RowCount - 1
|
||||
cg.Position = i
|
||||
|
||||
|
||||
Private c3 As Cursor=Starter.skmt.ExecQuery($"select Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_PROID ='${cg.GetString("HVD_PROID")}' "$)
|
||||
Private resta As String = 0
|
||||
|
||||
If c3.RowCount > 0 Then
|
||||
c3.Position = 0
|
||||
resta = c3.GetString("PE_CANT")
|
||||
Else
|
||||
resta = 0
|
||||
End If
|
||||
|
||||
If ( cg.GetInt("HVD_RECHAZOCANT") - resta) <= 0 Then
|
||||
|
||||
Else
|
||||
banderarechazo = banderarechazo + 1
|
||||
End If
|
||||
Next
|
||||
|
||||
If banderarechazo = 0 Then
|
||||
If Not(IsConnectedToInternet) Then MsgboxAsync("No hay conexión a conexión a Internet", "Revisa tu conexión")
|
||||
c=Starter.skmt.ExecQuery("select usuario from usuarioa")
|
||||
c.Position = 0
|
||||
usuario = c.GetString("USUARIO")
|
||||
c.Close
|
||||
|
||||
c = Starter.skmt.ExecQuery("SELECT * FROM BLOCKENVIO")
|
||||
If c.RowCount = 0 Then
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO BLOCKENVIO(ENVIADO) VALUES (?)", Array As Object (1))
|
||||
envioinfo
|
||||
Else
|
||||
envioinfo
|
||||
End If
|
||||
c.Close
|
||||
Else
|
||||
Dim pickciego As Cursor = Starter.skmt.ExecQuery("SELECT * FROM PICK_CIEGO")
|
||||
If pickciego.RowCount > 0 Then
|
||||
If Not(IsConnectedToInternet) Then MsgboxAsync("No hay conexión a conexión a Internet", "Revisa tu conexión")
|
||||
c=Starter.skmt.ExecQuery("select usuario from usuarioa")
|
||||
c.Position = 0
|
||||
usuario = c.GetString("USUARIO")
|
||||
c.Close
|
||||
|
||||
c = Starter.skmt.ExecQuery("SELECT * FROM BLOCKENVIO")
|
||||
If c.RowCount = 0 Then
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO BLOCKENVIO(ENVIADO) VALUES (?)", Array As Object (1))
|
||||
envioinfo
|
||||
Else
|
||||
envioinfo
|
||||
End If
|
||||
c.Close
|
||||
Else
|
||||
MsgboxAsync("Para realizar el envio se necesita realizar la incidencia de recibo.", "Atención")
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
envioinfo
|
||||
If Not(IsConnectedToInternet) Then MsgboxAsync("No hay conexión a conexión a Internet", "Revisa tu conexión")
|
||||
c=Starter.skmt.ExecQuery("select usuario from usuarioa")
|
||||
c.Position = 0
|
||||
usuario = c.GetString("USUARIO")
|
||||
c.Close
|
||||
|
||||
c = Starter.skmt.ExecQuery("SELECT * FROM BLOCKENVIO")
|
||||
If c.RowCount = 0 Then
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO BLOCKENVIO(ENVIADO) VALUES (?)", Array As Object (1))
|
||||
envioinfo
|
||||
Else
|
||||
envioinfo
|
||||
End If
|
||||
c.Close
|
||||
End If
|
||||
c.Close
|
||||
|
||||
' cmd.Initialize
|
||||
' cmd.Name = "select_estatus_MAZAPA"
|
||||
' cmd.Parameters = Array As Object(ALMACEN,e_ruta.text)
|
||||
' reqManager.ExecuteQuery(cmd , 0, "estatus")
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Sub imp_LIQUIDACION
|
||||
|
||||
ProgressDialogShow("Imprimiendo, un momento ...")
|
||||
Printer1.DisConnect
|
||||
If Not(Printer1.IsConnected) Then
|
||||
' If logger Then Log("conectando 1")
|
||||
Printer1.Connect
|
||||
Private cont As Int = 0
|
||||
Do While Not(impresoraConectada)
|
||||
Sleep(1000)
|
||||
cont = cont + 1
|
||||
If cont = 7 Then Printer1.Connect 'Tratamos de reconectar
|
||||
If cont > 15 Then impresoraConectada = True
|
||||
Loop
|
||||
Sleep(500)
|
||||
impresoraConectada = False
|
||||
Else
|
||||
' If logger Then Log("conectando 2")
|
||||
Printer1.Connect
|
||||
Private cont As Int = 0
|
||||
Do While Not(impresoraConectada) Or Not(Printer1.IsConnected)
|
||||
Sleep(1000)
|
||||
cont = cont + 1
|
||||
If cont = 2 Then Printer1.Connect
|
||||
If cont > 4 Then impresoraConectada = True
|
||||
Loop
|
||||
Sleep(500)
|
||||
impresoraConectada = False
|
||||
End If
|
||||
|
||||
TAMANO = 0
|
||||
ESPACIO = 29
|
||||
BLANCO = " "
|
||||
Printer1.Justify = 0
|
||||
Dim sDate, sTime As String
|
||||
DateTime.DateFormat = "dd/MM/yyyy"
|
||||
DateTime.TimeFormat = "HH:mm:ss"
|
||||
sDate = DateTime.Date(DateTime.Now)
|
||||
sTime = DateTime.Time(DateTime.Now)
|
||||
Printer1.WriteString("Fecha: " &sDate & CRLF)
|
||||
Printer1.WriteString("Hora: " &sTime & CRLF)
|
||||
Printer1.WriteString("Ruta: " & l_ruta.Text & CRLF)
|
||||
Printer1.WriteString("Usuario: " & Subs.dameUsuarioDeDB & CRLF)
|
||||
Printer1.WriteString("----------LIQUIDACION----------" & CRLF)
|
||||
Printer1.WriteString("--------------------------------" & CRLF)
|
||||
|
||||
Printer1.WriteString("Monto entregado: $" & L_MONTOE.Text & CRLF)
|
||||
Printer1.WriteString("Monto rechazado: $" & l_rechazo.Text & CRLF)
|
||||
Printer1.WriteString("Pagares cobrados: $" & l_pagarescobrados.Text & CRLF)
|
||||
|
||||
If l_pagarescobrados.Text > 0 Then
|
||||
Printer1.WriteString("--------------------------------" & CRLF)
|
||||
Printer1.WriteString(" Cliente Abono" & CRLF)
|
||||
Printer1.WriteString("--------------------------------" & CRLF)
|
||||
' Printer1.WriteString( CRLF)
|
||||
Dim abonoscreditos As Cursor = Starter.skmt.ExecQuery("SELECT a_abono, length(a_abono) as L_abono , length(a_cliente) as L_cliente , a_cliente FROM ABONOS ORDER BY a_cliente")
|
||||
For g = 0 To abonoscreditos.RowCount -1
|
||||
abonoscreditos.Position = g
|
||||
|
||||
TAMANO = abonoscreditos.GetInt("L_abono") + TAMANO
|
||||
ESPACIO = (ESPACIO - TAMANO)/2
|
||||
' Log(ESPACIO)
|
||||
For j =0 To ESPACIO -1
|
||||
BLANCO = " " & BLANCO
|
||||
Next
|
||||
Printer1.Justify = 0
|
||||
Printer1.WriteString( abonoscreditos.GetString("a_cliente") & BLANCO)
|
||||
Printer1.Justify = 1
|
||||
Printer1.WriteString( abonoscreditos.GetString("a_abono"))
|
||||
Printer1.WriteString( CRLF)
|
||||
TAMANO = 0
|
||||
ESPACIO = 29
|
||||
BLANCO = " "
|
||||
Printer1.Justify = 0
|
||||
Next
|
||||
Printer1.WriteString("--------------------------------" & CRLF)
|
||||
Printer1.WriteString( CRLF)
|
||||
End If
|
||||
Printer1.WriteString("Pagares nuevos: $" & l_pagaresnuevos.Text & CRLF)
|
||||
|
||||
If l_pagaresnuevos.Text > 0 Then
|
||||
Printer1.WriteString("--------------------------------" & CRLF)
|
||||
Printer1.WriteString(" Cliente Pagare" & CRLF)
|
||||
Printer1.WriteString("--------------------------------" & CRLF)
|
||||
' Printer1.WriteString( CRLF)
|
||||
Dim abonoscreditos As Cursor = Starter.skmt.ExecQuery("SELECT PA_MONTO, length(PA_MONTO) as L_PA_MONTO , length(PA_CLIENTE) as L_cliente , PA_CLIENTE FROM PAGARES ORDER BY PA_CLIENTE")
|
||||
For g = 0 To abonoscreditos.RowCount -1
|
||||
abonoscreditos.Position = g
|
||||
|
||||
TAMANO = abonoscreditos.GetInt("L_PA_MONTO") + TAMANO
|
||||
ESPACIO = (ESPACIO - TAMANO)/2
|
||||
' Log(ESPACIO)
|
||||
For j =0 To ESPACIO -1
|
||||
BLANCO = " " & BLANCO
|
||||
Next
|
||||
Printer1.Justify = 0
|
||||
Printer1.WriteString( abonoscreditos.GetString("PA_CLIENTE") & BLANCO)
|
||||
Printer1.Justify = 1
|
||||
Printer1.WriteString( abonoscreditos.GetString("PA_MONTO"))
|
||||
Printer1.WriteString( CRLF)
|
||||
TAMANO = 0
|
||||
ESPACIO = 29
|
||||
BLANCO = " "
|
||||
Printer1.Justify = 0
|
||||
Next
|
||||
Printer1.WriteString("--------------------------------" & CRLF)
|
||||
Printer1.WriteString( CRLF)
|
||||
End If
|
||||
Printer1.WriteString("Monto a liquidar: $" & l_montoaliquidar.Text & CRLF)
|
||||
|
||||
|
||||
|
||||
' Dim sumainv As Cursor = Starter.skmt.ExecQuery("SELECT SUM(HVD_CANT) AS CANTIDAD FROM HIST_VENTAS WHERE HVD_CODPROMO <> HVD_PROID")
|
||||
' sumainv.Position = 0
|
||||
'
|
||||
' Printer1.WriteString("------------------------------" & CRLF)
|
||||
' Printer1.WriteString("Total piezas: " & sumainv.GetString("CANTIDAD")& CRLF)
|
||||
Printer1.WriteString("------------------------------" & CRLF)
|
||||
Printer1.Justify = 0
|
||||
Printer1.WriteString(" " & CRLF)
|
||||
Printer1.WriteString(" " & CRLF)
|
||||
Printer1.WriteString(" " & CRLF)
|
||||
Printer1.WriteString(" " & CRLF)
|
||||
Sleep(1000)
|
||||
Printer1.DisConnect
|
||||
ProgressDialogHide
|
||||
|
||||
|
||||
Msgbox2Async("Deseas imprimir de nuevo el ticket?", "ATENCION","SI","", "NO",LoadBitmap(File.DirAssets,"alert2.png"), False)
|
||||
Wait For Msgbox_Result (resultado As Int)
|
||||
If resultado = DialogResponse.POSITIVE Then
|
||||
imp_LIQUIDACION
|
||||
Else
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub envioinfo
|
||||
@@ -1251,6 +1460,8 @@ Sub envioinfo
|
||||
End If
|
||||
'FIN TABULADOR
|
||||
|
||||
imp_LIQUIDACION
|
||||
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
cmd.Name = "insert_drop_rep_IZCA2"
|
||||
@@ -1297,7 +1508,7 @@ Sub cargar_Click
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
cmd.Name = "insert_drop_rep_IZCA2"
|
||||
cmd.Parameters = Array As Object(Subs.dameUsuarioDeDB, l_ruta.Text, ALMACEN, l_ctast.text, Subs.traeEntregados, Subs.traeRechazados, "CARGA",Application.VersionName)
|
||||
cmd.Parameters = Array As Object(Subs.dameUsuarioDeDB, e_ruta.Text, ALMACEN, l_ctast.text, Subs.traeEntregados, Subs.traeRechazados, "CARGA",Application.VersionName)
|
||||
reqManager.ExecuteCommand(cmd , "inst_drop")
|
||||
' reqs.Add("inst_noventa")
|
||||
|
||||
@@ -1463,7 +1674,7 @@ Sub cargar____Click
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
cmd.Name = "insert_drop_rep_IZCA2"
|
||||
cmd.Parameters = Array As Object(Subs.dameUsuarioDeDB, l_ruta.Text, ALMACEN, l_ctast.text, Subs.traeEntregados, Subs.traeRechazados, "CARGA",Application.VersionName)
|
||||
cmd.Parameters = Array As Object(Subs.dameUsuarioDeDB, e_ruta.Text, ALMACEN, l_ctast.text, Subs.traeEntregados, Subs.traeRechazados, "CARGA",Application.VersionName)
|
||||
reqManager.ExecuteCommand(cmd , "inst_drop")
|
||||
' reqs.Add("inst_noventa")
|
||||
|
||||
@@ -1657,6 +1868,7 @@ Sub JobDone(Job As HttpJob)
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO kmt_info(CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_BCREDITO, gestion) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0)", Array As Object (CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_BCREDITO))
|
||||
Next
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO kmt_info(CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_BCREDITO, gestion,SECUENCIA) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,?)", Array As Object (63403,1000, "PRODUCTO DAÑADO","","","","","","","","","","","","","","-98.8357694","19.6906052","0","1"))
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO kmt_info(CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_BCREDITO, gestion,SECUENCIA) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,?)", Array As Object (100000,1000, "CLIENTE COMODIN","","","","","","","","","","","","","","-98.8357694","19.6906052","0","1"))
|
||||
' End If
|
||||
Starter.skmt.TransactionSuccessful
|
||||
Starter.skmt.EndTransaction
|
||||
@@ -1699,7 +1911,7 @@ Sub JobDone(Job As HttpJob)
|
||||
|
||||
Next
|
||||
|
||||
Dim clientes As Cursor = Starter.skmt.ExecQuery("select count(*) as clientes from kmt_info WHERE CAT_CL_CODIGO <> 63403 ")
|
||||
Dim clientes As Cursor = Starter.skmt.ExecQuery("select count(*) as clientes from kmt_info WHERE CAT_CL_CODIGO NOT IN ('63403','100000') ")
|
||||
clientes.Position = 0
|
||||
|
||||
Dim detalleventa As Cursor = Starter.skmt.ExecQuery("select count(*) as detalle from hist_ventas ")
|
||||
@@ -2202,6 +2414,17 @@ Sub JobDone(Job As HttpJob)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
If Job.JobName = "DBRequest" Then
|
||||
Dim result As DBResult = reqManager.HandleJob(Job)
|
||||
If result.Tag = "contra" Then 'query tag
|
||||
For Each records() As Object In result.Rows
|
||||
Dim name As String = records(result.Columns.Get("CONTRA"))
|
||||
|
||||
Next
|
||||
paso1 = 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If Job.JobName = "DBRequest" Then
|
||||
Dim result As DBResult = reqManager.HandleJob(Job)
|
||||
@@ -2225,8 +2448,108 @@ Sub JobDone(Job As HttpJob)
|
||||
End If
|
||||
End If
|
||||
Job.Release
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If paso1 = 1 Then
|
||||
|
||||
|
||||
If name = "OK"&et_codigo.Text Then
|
||||
p_validacion.Visible = False
|
||||
et_codigo.Text = ""
|
||||
Starter.skmt.ExecNonQuery("delete from CUENTAA")
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object("63403"))
|
||||
|
||||
Subs.panelVisible(P_CIEGO,0,0)
|
||||
P_CIEGO.Width = Root.Width
|
||||
P_CIEGO.Height = Root.Height
|
||||
|
||||
CLV_PICK_CIEGO.Clear
|
||||
|
||||
Private c As Cursor = Starter.skmt.ExecQuery("select HVD_PRONOMBRE, IFNULL(SUM(HVD_RECHAZOCANT), 0) AS HVD_RECHAZOCANT, HVD_PROID, ifnull(PC_CANT,0) AS PC_CAN from HIST_VENTAS INNER JOIN PICK_CIEGO ON PC_ID_PROD = HVD_PROID WHERE hvd_rechazo <> 2 and HVD_RECHAZOCANT > 0 and HVD_PRONOMBRE <> 'Cobranza Pendiente' GROUP BY HVD_PROID order by HVD_PRONOMBRE asc")
|
||||
If c.RowCount > 0 Then
|
||||
|
||||
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position = i
|
||||
|
||||
|
||||
Private c3 As Cursor=Starter.skmt.ExecQuery($"select Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_PROID ='${c.GetString("HVD_PROID")}' and PE_TIPO NOT IN ('DANADO','FALTANTE','SOBRANTE')"$)
|
||||
Private resta As String = 0
|
||||
|
||||
If c3.RowCount > 0 Then
|
||||
c3.Position = 0
|
||||
resta = c3.GetString("PE_CANT")
|
||||
Else
|
||||
resta = 0
|
||||
End If
|
||||
If ( c.GetInt("HVD_RECHAZOCANT") - resta) <= 0 Then
|
||||
|
||||
Else
|
||||
CLV_PICK_CIEGO.Add(CreateListItem(c.GetString("HVD_PROID"), c.GetString("HVD_PRONOMBRE"), c.GetString("PC_CAN"),(c.GetInt("HVD_RECHAZOCANT") - resta)),i)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
d = Starter.skmt.ExecQuery("select HVD_PRONOMBRE, IFNULL(SUM(HVD_RECHAZOCANT), 0) AS HVD_RECHAZOCANT, HVD_PROID from HIST_VENTAS WHERE hvd_rechazo <> 2 and HVD_RECHAZOCANT > 0 and HVD_PROID NOT IN (SELECT PC_ID_PROD FROM PICK_CIEGO) and HVD_PRONOMBRE <> 'Cobranza Pendiente' GROUP BY HVD_PROID order by HVD_PRONOMBRE asc")
|
||||
|
||||
For i = 0 To d.RowCount - 1
|
||||
d.Position = i
|
||||
|
||||
|
||||
Private c3 As Cursor=Starter.skmt.ExecQuery($"select Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_PROID ='${d.GetString("HVD_PROID")}' and PE_TIPO NOT IN ('DANADO','FALTANTE','SOBRANTE')"$)
|
||||
Private resta As String = 0
|
||||
|
||||
If c3.RowCount > 0 Then
|
||||
c3.Position = 0
|
||||
resta = c3.GetString("PE_CANT")
|
||||
Else
|
||||
resta = 0
|
||||
End If
|
||||
If ( d.GetInt("HVD_RECHAZOCANT") - resta) <= 0 Then
|
||||
|
||||
Else
|
||||
CLV_PICK_CIEGO.Add(CreateListItem2(d.GetString("HVD_PROID"), d.GetString("HVD_PRONOMBRE"),(d.GetInt("HVD_RECHAZOCANT") - resta)),i)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
Else If c.RowCount = 0 Then
|
||||
d = Starter.skmt.ExecQuery("select HVD_PRONOMBRE, IFNULL(SUM(HVD_RECHAZOCANT), 0) AS HVD_RECHAZOCANT, HVD_PROID from HIST_VENTAS WHERE hvd_rechazo <> 2 and HVD_RECHAZOCANT > 0 and HVD_PRONOMBRE <> 'Cobranza Pendiente' GROUP BY HVD_PROID order by HVD_PRONOMBRE asc")
|
||||
' d=Starter.skmt.ExecQuery($"select CAT_GP_NOMBRE, CAT_GP_ID FROM CAT_GUNAPROD3 WHERE CAT_GP_CLASIF <> 'PROMOS'"$)
|
||||
For i = 0 To d.RowCount - 1
|
||||
d.Position = i
|
||||
|
||||
|
||||
Private c3 As Cursor=Starter.skmt.ExecQuery($"select Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_PROID ='${d.GetString("HVD_PROID")}'and PE_TIPO NOT IN ('DANADO','FALTANTE','SOBRANTE')"$)
|
||||
Private resta As String = 0
|
||||
|
||||
If c3.RowCount > 0 Then
|
||||
c3.Position = 0
|
||||
resta = c3.GetString("PE_CANT")
|
||||
Else
|
||||
resta = 0
|
||||
End If
|
||||
If ( d.GetInt("HVD_RECHAZOCANT") - resta) <= 0 Then
|
||||
|
||||
Else
|
||||
CLV_PICK_CIEGO.Add(CreateListItem2(d.GetString("HVD_PROID"), d.GetString("HVD_PRONOMBRE"),(d.GetInt("HVD_RECHAZOCANT") - resta)),i)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
End If
|
||||
paso1 = 0
|
||||
Else
|
||||
et_codigo.Text = ""
|
||||
Msgbox("Password No valido","Atención") 'ignore
|
||||
End If
|
||||
End If
|
||||
|
||||
If reqs.Size = 0 Then
|
||||
|
||||
|
||||
@@ -2717,91 +3040,11 @@ Private Sub p_prod_Click
|
||||
End Sub
|
||||
|
||||
Private Sub b_venta_emp_Click
|
||||
Starter.skmt.ExecNonQuery("delete from CUENTAA")
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object("63403"))
|
||||
|
||||
Subs.panelVisible(P_CIEGO,0,0)
|
||||
P_CIEGO.Width = Root.Width
|
||||
P_CIEGO.Height = Root.Height
|
||||
|
||||
CLV_PICK_CIEGO.Clear
|
||||
|
||||
Private c As Cursor = Starter.skmt.ExecQuery("select HVD_PRONOMBRE, IFNULL(SUM(HVD_RECHAZOCANT), 0) AS HVD_RECHAZOCANT, HVD_PROID, ifnull(PC_CANT,0) AS PC_CAN from HIST_VENTAS INNER JOIN PICK_CIEGO ON PC_ID_PROD = HVD_PROID WHERE hvd_rechazo <> 2 and HVD_RECHAZOCANT > 0 and HVD_PRONOMBRE <> 'Cobranza Pendiente' GROUP BY HVD_PROID order by HVD_PRONOMBRE asc")
|
||||
If c.RowCount > 0 Then
|
||||
|
||||
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position = i
|
||||
|
||||
|
||||
Private c3 As Cursor=Starter.skmt.ExecQuery($"select Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_PROID ='${c.GetString("HVD_PROID")}' and PE_TIPO NOT IN ('DANADO','FALTANTE','SOBRANTE')"$)
|
||||
Private resta As String = 0
|
||||
|
||||
If c3.RowCount > 0 Then
|
||||
c3.Position = 0
|
||||
resta = c3.GetString("PE_CANT")
|
||||
Else
|
||||
resta = 0
|
||||
End If
|
||||
If ( c.GetInt("HVD_RECHAZOCANT") - resta) <= 0 Then
|
||||
|
||||
Else
|
||||
CLV_PICK_CIEGO.Add(CreateListItem(c.GetString("HVD_PROID"), c.GetString("HVD_PRONOMBRE"), c.GetString("PC_CAN"),(c.GetInt("HVD_RECHAZOCANT") - resta)),i)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
d = Starter.skmt.ExecQuery("select HVD_PRONOMBRE, IFNULL(SUM(HVD_RECHAZOCANT), 0) AS HVD_RECHAZOCANT, HVD_PROID from HIST_VENTAS WHERE hvd_rechazo <> 2 and HVD_RECHAZOCANT > 0 and HVD_PROID NOT IN (SELECT PC_ID_PROD FROM PICK_CIEGO) and HVD_PRONOMBRE <> 'Cobranza Pendiente' GROUP BY HVD_PROID order by HVD_PRONOMBRE asc")
|
||||
|
||||
For i = 0 To d.RowCount - 1
|
||||
d.Position = i
|
||||
|
||||
|
||||
Private c3 As Cursor=Starter.skmt.ExecQuery($"select Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_PROID ='${d.GetString("HVD_PROID")}' and PE_TIPO NOT IN ('DANADO','FALTANTE','SOBRANTE')"$)
|
||||
Private resta As String = 0
|
||||
|
||||
If c3.RowCount > 0 Then
|
||||
c3.Position = 0
|
||||
resta = c3.GetString("PE_CANT")
|
||||
Else
|
||||
resta = 0
|
||||
End If
|
||||
If ( d.GetInt("HVD_RECHAZOCANT") - resta) <= 0 Then
|
||||
|
||||
Else
|
||||
CLV_PICK_CIEGO.Add(CreateListItem2(d.GetString("HVD_PROID"), d.GetString("HVD_PRONOMBRE"),(d.GetInt("HVD_RECHAZOCANT") - resta)),i)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
Else If c.RowCount = 0 Then
|
||||
d = Starter.skmt.ExecQuery("select HVD_PRONOMBRE, IFNULL(SUM(HVD_RECHAZOCANT), 0) AS HVD_RECHAZOCANT, HVD_PROID from HIST_VENTAS WHERE hvd_rechazo <> 2 and HVD_RECHAZOCANT > 0 and HVD_PRONOMBRE <> 'Cobranza Pendiente' GROUP BY HVD_PROID order by HVD_PRONOMBRE asc")
|
||||
' d=Starter.skmt.ExecQuery($"select CAT_GP_NOMBRE, CAT_GP_ID FROM CAT_GUNAPROD3 WHERE CAT_GP_CLASIF <> 'PROMOS'"$)
|
||||
For i = 0 To d.RowCount - 1
|
||||
d.Position = i
|
||||
|
||||
|
||||
Private c3 As Cursor=Starter.skmt.ExecQuery($"select Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_PROID ='${d.GetString("HVD_PROID")}'and PE_TIPO NOT IN ('DANADO','FALTANTE','SOBRANTE')"$)
|
||||
Private resta As String = 0
|
||||
|
||||
If c3.RowCount > 0 Then
|
||||
c3.Position = 0
|
||||
resta = c3.GetString("PE_CANT")
|
||||
Else
|
||||
resta = 0
|
||||
End If
|
||||
If ( d.GetInt("HVD_RECHAZOCANT") - resta) <= 0 Then
|
||||
|
||||
Else
|
||||
CLV_PICK_CIEGO.Add(CreateListItem2(d.GetString("HVD_PROID"), d.GetString("HVD_PRONOMBRE"),(d.GetInt("HVD_RECHAZOCANT") - resta)),i)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
p_validacion.Visible = True
|
||||
p_validacion.Width = Root.Width
|
||||
p_validacion.Height = Root.Height
|
||||
|
||||
End Sub
|
||||
|
||||
'Private Sub connecta_LongClick
|
||||
@@ -3632,4 +3875,35 @@ Sub CreateListItem2(Id_prod As String, Prod As String,cantreal As String) As Pan
|
||||
'cxc.Id_prod = mostrar3
|
||||
'Log(pa.Width)
|
||||
Return pa
|
||||
End Sub
|
||||
|
||||
Private Sub connecta_LongClick
|
||||
imp_LIQUIDACION
|
||||
End Sub
|
||||
|
||||
Private Sub b_comodin_Click
|
||||
Starter.skmt.ExecNonQuery("delete from CUENTAA")
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object("100000"))
|
||||
B4XPages.ShowPage("Cliente")
|
||||
End Sub
|
||||
|
||||
Private Sub b_aceptar_Click
|
||||
If et_codigo.Text <> "" Then
|
||||
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
cmd.Name = "select_PASS_IZCA_REPG"
|
||||
cmd.Parameters = Array As Object(ALMACEN)
|
||||
reqManager.ExecuteQuery(cmd , 0, "contra")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub b_cancelarcodigo_Click
|
||||
p_validacion.Visible = False
|
||||
et_codigo.Text = ""
|
||||
End Sub
|
||||
|
||||
Private Sub p_validacion_Click
|
||||
|
||||
End Sub
|
||||
Reference in New Issue
Block a user