mirror of
https://github.com/KeymonSoft/Mazapa-Reparto.git
synced 2026-04-20 14:29:17 +00:00
...
This commit is contained in:
@@ -94,6 +94,7 @@ Sub Class_Globals
|
||||
Private p_prod As Panel
|
||||
Private b_regreso As Button
|
||||
Private lv_prod_Prin As ListView
|
||||
Private b_venta_emp As Button
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -117,10 +118,10 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
b=Starter.skmt.ExecQuery("Select count(*) as CUANTOS from pedido_cliente")
|
||||
b.Position=0
|
||||
Cuantos = b.GetString("CUANTOS")
|
||||
d=Starter.skmt.ExecQuery("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0")
|
||||
d=Starter.skmt.ExecQuery("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0 AND CAT_CL_RUTA <> 1000")
|
||||
D.Position=0
|
||||
b.Close
|
||||
e=Starter.skmt.ExecQuery("select count(*) as POR_VISITAR from kmt_info")
|
||||
e=Starter.skmt.ExecQuery("select count(*) as POR_VISITAR from kmt_info WHERE CAT_CL_RUTA <> 1000")
|
||||
e.Position=0
|
||||
If Cuantos = 0 Then
|
||||
l_aLiquidar.Text = 0
|
||||
@@ -209,7 +210,7 @@ Sub B4XPage_Appear
|
||||
l_ruta.Text = 0
|
||||
l_rutasP.Text = 0
|
||||
Else
|
||||
f=Starter.skmt.ExecQuery("select distinct CAT_CL_RUTA from kmt_info order by CAT_CL_RUTA")
|
||||
f=Starter.skmt.ExecQuery("select distinct CAT_CL_RUTA from kmt_info WHERE CAT_CL_RUTA <> 1000 order by CAT_CL_RUTA")
|
||||
' f.Position=0
|
||||
l_rutasP.Text = ""
|
||||
For i = 0 To f.RowCount - 1
|
||||
@@ -227,10 +228,10 @@ Sub B4XPage_Appear
|
||||
b=Starter.skmt.ExecQuery("Select count(*) as CUANTOS from kmt_info")
|
||||
b.Position=0
|
||||
If b.RowCount > 0 Then Cuantos = b.GetString("CUANTOS")
|
||||
d=Starter.skmt.ExecQuery("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0")
|
||||
d=Starter.skmt.ExecQuery("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0 AND CAT_CL_RUTA <> 1000")
|
||||
D.Position=0
|
||||
b.Close
|
||||
e=Starter.skmt.ExecQuery("select count(*) as POR_VISITAR from kmt_info")
|
||||
e=Starter.skmt.ExecQuery("select count(*) as POR_VISITAR from kmt_info WHERE CAT_CL_RUTA <> 1000")
|
||||
e.Position=0
|
||||
' f=Starter.skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info")
|
||||
' f.Position=0
|
||||
@@ -267,9 +268,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'")
|
||||
b=Starter.skmt.ExecQuery("select count(DISTINCT NV_CLIENTE) as CUANTOS from noventa where nv_motivo <> 'ENTREGA' and NV_CLIENTE <> 63403")
|
||||
' 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'")
|
||||
L=Starter.skmt.ExecQuery("select count(DISTINCT NV_CLIENTE) as CLIENTES_DIA from noventa where nv_motivo = 'ENTREGA' and NV_CLIENTE <> 63403")
|
||||
f2.Position=0
|
||||
' F4=Starter.skmt.execqUery("select count(*) as CUANTOS FROM PEDIDO")
|
||||
' F4.Position = 0
|
||||
@@ -594,9 +595,18 @@ Sub B4XPage_Appear
|
||||
If l_ctast.Text = 0 And l_porvisitar.Text <> 0 Then
|
||||
Label9.Visible = True
|
||||
L_MONTOE.Visible = True
|
||||
|
||||
'' hacer validacion su hay rechazo
|
||||
c=Starter.skmt.ExecQuery("select * from HIST_VENTAS WHERE hvd_rechazo <> 2 and HVD_RECHAZOCANT > 0 order by HVD_CODPROMO desc, HVD_PRONOMBRE asc")
|
||||
If c.RowCount > 0 Then
|
||||
b_venta_emp.Visible = True
|
||||
Else
|
||||
b_venta_emp.Visible = False
|
||||
End If
|
||||
Else
|
||||
Label9.Visible = False
|
||||
L_MONTOE.Visible = False
|
||||
b_venta_emp.Visible = False
|
||||
End If
|
||||
|
||||
' If l_ctast.Text = 0 Then
|
||||
@@ -671,6 +681,9 @@ Sub Subir_Click
|
||||
End Sub
|
||||
|
||||
Sub envioinfo
|
||||
|
||||
|
||||
|
||||
' NOVENTA
|
||||
c = Starter.skmt.ExecQuery("SELECT NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_COMM,NV_LAT,NV_LON, NV_FOTO FROM NOVENTA")
|
||||
D=Starter.skmt.ExecQuery("SELECT COUNT(*) AS CUANTOS_NOVENTA FROM NOVENTA")
|
||||
@@ -805,9 +818,10 @@ Sub envioinfo
|
||||
If c.RowCount > 0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
c.Position = i
|
||||
Log(c.GetString("HVD_CLIENTE"))
|
||||
Private d4 As Cursor = Starter.skmt.ExecQuery($"SELECT CAT_CL_RUTA FROM kmt_info WHERE CAT_CL_CODIGO = '${c.GetString("HVD_CLIENTE")}'"$)
|
||||
d4.Position = 0
|
||||
|
||||
Log(d4.GetString("CAT_CL_RUTA"))
|
||||
Private d5 As Cursor = Starter.skmt.ExecQuery($"SELECT IFNULL(Sum(PE_CANT),0) AS PE_CANT FROM PEDIDO WHERE PE_CLIENTEOR = '${c.GetString("HVD_CLIENTE")}' AND PE_PROID = '${c.GetString("HVD_PROID")}' AND CONSECUTIVO = '${c.GetString("CONSECUTIVO")}'"$)
|
||||
d5.Position = 0
|
||||
Private restacant As String = d5.GetString("PE_CANT")
|
||||
@@ -834,6 +848,7 @@ Sub envioinfo
|
||||
Else
|
||||
cmd.Initialize
|
||||
cmd.Name = "update_HVD_MAZAPArep2"
|
||||
Log( c.GetString("CANTC")& c.GetString("HVD_CLIENTE")& c.GetString("HVD_PROID")&fecha3&" "&hora(0)& d4.GetString("CAT_CL_RUTA")&ALMACEN&l_ruta.Text&c.GetString("HVD_CODPROMO")&c.GetString("HVD_NUM_TICKET")& c.GetString("HVD_CANT"))
|
||||
cmd.Parameters = Array As String("",c.GetString("BCAJAS"), c.GetString("CANTC"),"","", c.GetString("HVD_CLIENTE"), c.GetString("HVD_PROID"),fecha3&" "&hora(0), d4.GetString("CAT_CL_RUTA"),ALMACEN,l_ruta.Text,c.GetString("HVD_CODPROMO"),c.GetString("HVD_NUM_TICKET"), c.GetString("HVD_CANT"))
|
||||
reqManager.ExecuteCommand(cmd, "update_hvd")
|
||||
End If
|
||||
@@ -1047,6 +1062,7 @@ Sub JobDone(Job As HttpJob)
|
||||
' Log(reqs.Size)
|
||||
End If
|
||||
Starter.skmt.BeginTransaction
|
||||
' If reqManager.HandleJob(Job).Rows.Size > 0 Then
|
||||
For Each records() As Object In result.Rows
|
||||
Dim CAT_CL_CODIGO As String = records(result.Columns.Get("CAT_CL_CODIGO"))
|
||||
Dim CAT_CL_RUTA As String = records(result.Columns.Get("CAT_CL_RUTA"))
|
||||
@@ -1071,6 +1087,8 @@ Sub JobDone(Job As HttpJob)
|
||||
' Log(" ++ insert into kmt_info: "&CAT_CL_RUTA&","&CAT_CL_CODIGO&","&CAT_CL_RUTA&","&CAT_CL_NOMBRE)
|
||||
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 (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,CAT_CL_SECUENCIA))
|
||||
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, "VENTA RECHAZO","","","","","","","","","","","","","","-98.8357694","19.6906052","0","1"))
|
||||
' End If
|
||||
Starter.skmt.TransactionSuccessful
|
||||
Starter.skmt.EndTransaction
|
||||
Listo1 = 1
|
||||
@@ -1572,7 +1590,7 @@ Sub connecta_Click
|
||||
reqManager.ExecuteQuery(cmd , 0, "version")
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
cmd.Name = "select_ruta_re_REPG_MAZAPA5"
|
||||
cmd.Name = "select_ruta_re_REPG_MAZAPA6"
|
||||
cmd.Parameters = Array As Object(ALMACEN, e_ruta.text, imei)
|
||||
' Log($"${ALMACEN}, ${e_ruta.text}, ${imei}"$)
|
||||
reqManager.ExecuteQuery(cmd , 0, "ruta")
|
||||
@@ -1975,4 +1993,10 @@ End Sub
|
||||
|
||||
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"))
|
||||
B4XPages.ShowPage("Cliente")
|
||||
End Sub
|
||||
Reference in New Issue
Block a user