mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-20 11:39:13 +00:00
28/10/23 - Se agrega còdigo para indicar la fecha del respaldo a restaurar.
- Si se agrega un numero negativo despues de la contraseña de la carga local, se toma el respaldo de "hoy menos x dias" para restaurar.
This commit is contained in:
@@ -210,43 +210,43 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
' ruta = File.DirInternal
|
||||
DateTime.DateFormat = "MM/dd/yyyy"
|
||||
fecha=DateTime.Date(DateTime.Now)
|
||||
b=Starter.skmt.ExecQuery("Select count(*) as CUANTOS from pedido_cliente")
|
||||
b.Position=0
|
||||
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.Position=0
|
||||
d = Starter.skmt.ExecQuery("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0")
|
||||
D.Position = 0
|
||||
b.Close
|
||||
e=Starter.skmt.ExecQuery("select count(*) as POR_VISITAR from kmt_info")
|
||||
e.Position=0
|
||||
f=Starter.skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info")
|
||||
f.Position=0
|
||||
e = Starter.skmt.ExecQuery("select count(*) as POR_VISITAR from kmt_info")
|
||||
e.Position = 0
|
||||
f = Starter.skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info")
|
||||
f.Position = 0
|
||||
l_ruta.Text = f.GetString("CAT_CL_RUTA")
|
||||
f.Close
|
||||
If l_ruta.Text = 0 Then
|
||||
l_ruta.Text =0
|
||||
l_ruta.Text = 0
|
||||
Else
|
||||
f=Starter.skmt.ExecQuery("select CAT_CL_RUTA from kmt_info")
|
||||
f.Position=0
|
||||
f = Starter.skmt.ExecQuery("select CAT_CL_RUTA from kmt_info")
|
||||
f.Position = 0
|
||||
l_ruta.Text = f.GetString("CAT_CL_RUTA")
|
||||
RUTA1.Text = l_ruta.TEXT
|
||||
f.Close
|
||||
End If
|
||||
If Cuantos = 0 Then
|
||||
L_MONTOD.Text =0
|
||||
L_MONTOD.Text = 0
|
||||
l_cuantosc.Text = 0
|
||||
l_cuantosn.Text = 0
|
||||
drop = 0
|
||||
l_drop.Text = 0
|
||||
efectiva = 0
|
||||
l_efectiva.text =0
|
||||
l_efectiva.text = 0
|
||||
l_ctast.Text = d.GetString("TOTAL_VISITAR")
|
||||
' l_porvisitar.Text = e.GetString("POR_VISITAR")
|
||||
Else
|
||||
c=Starter.skmt.ExecQuery("select sum(pc_monto) as MONTO_DIA, count(pc_cliente) AS CLIENTES_DIA from pedido_cliente ")
|
||||
b=Starter.skmt.ExecQuery("select count(*) as CUANTOS from noventa")
|
||||
c = Starter.skmt.ExecQuery("select sum(pc_monto) as MONTO_DIA, count(pc_cliente) AS CLIENTES_DIA from pedido_cliente ")
|
||||
b = Starter.skmt.ExecQuery("select count(*) as CUANTOS from noventa")
|
||||
'where pc_fecha = ?", Array As String(fecha)
|
||||
C.Position=0
|
||||
b.Position=0
|
||||
C.Position = 0
|
||||
b.Position = 0
|
||||
L_MONTOD.Text = c.GetString("MONTO_DIA")
|
||||
l_cuantosc.Text = c.GetString("CLIENTES_DIA")
|
||||
l_cuantosn.Text = b.GetString("CUANTOS")
|
||||
@@ -297,27 +297,27 @@ Sub B4XPage_Appear
|
||||
End If
|
||||
e_ruta.Enabled = True
|
||||
Starter.rutaV = l_ruta.Text
|
||||
c=Starter.skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER"))
|
||||
c.Position =0
|
||||
c = Starter.skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER"))
|
||||
c.Position = 0
|
||||
If c.GetString("CUANTOS") = 0 Then
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER", Starter.DBReqServer))
|
||||
Else
|
||||
c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER"))
|
||||
c.Position =0
|
||||
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER"))
|
||||
c.Position = 0
|
||||
Starter.DBReqServer = c.GetString("CAT_VA_VALOR")
|
||||
End If
|
||||
c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FECHA"))
|
||||
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FECHA"))
|
||||
If c.RowCount > 0 Then
|
||||
c.Position = 0
|
||||
Starter.FECHA_HOY = c.GetString("CAT_VA_VALOR")
|
||||
End If
|
||||
c=Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SEMANA"))
|
||||
c.Position =0
|
||||
c = Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SEMANA"))
|
||||
c.Position = 0
|
||||
SEMANA = c.GetString("CUANTOS")
|
||||
c.Close
|
||||
If SEMANA > 0 Then
|
||||
c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SEMANA"))
|
||||
c.Position =0
|
||||
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SEMANA"))
|
||||
c.Position = 0
|
||||
SEMANA = c.GetString("CAT_VA_VALOR")
|
||||
c.Close
|
||||
End If
|
||||
@@ -327,7 +327,7 @@ Sub B4XPage_Appear
|
||||
Starter.clientesTotal = c.GetString("CUANTOS")
|
||||
l_porvisitar.Text = Starter.clientesTotal
|
||||
PASO = 0
|
||||
If EJECUTANDO =0 Then
|
||||
If EJECUTANDO = 0 Then
|
||||
Listo1 = 0
|
||||
Listo2 = 0
|
||||
Listo3 = 0
|
||||
@@ -338,24 +338,24 @@ Sub B4XPage_Appear
|
||||
End If
|
||||
DateTime.DateFormat = "MM/dd/yyyy"
|
||||
fecha=DateTime.Date(DateTime.Now)
|
||||
b=Starter.skmt.ExecQuery("Select count(*) as CUANTOS from pedido_cliente where pc_cliente <> 0")
|
||||
b.Position=0
|
||||
b = Starter.skmt.ExecQuery("Select count(*) as CUANTOS from pedido_cliente where pc_cliente <> 0")
|
||||
b.Position = 0
|
||||
Cuantos = b.GetString("CUANTOS")
|
||||
' If Starter.marcaCel <> "LGE" Then ToastMessageShow(Cuantos , True)
|
||||
d=Starter.skmt.ExecQuery2("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0 and cat_cl_codigo <> 0 AND CAT_CL_DIAS_VISITA = (SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?)", Array As String("DIA_VISITA"))
|
||||
D.Position=0
|
||||
d = Starter.skmt.ExecQuery2("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0 and cat_cl_codigo <> 0 AND CAT_CL_DIAS_VISITA = (SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?)", Array As String("DIA_VISITA"))
|
||||
D.Position = 0
|
||||
b.Close
|
||||
e=Starter.skmt.ExecQuery2("select count(*) as POR_VISITAR from kmt_info where cat_cl_codigo <> 0 and CAT_CL_DIAS_VISITA = (SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?) ", Array As String("DIA_VISITA"))
|
||||
e.Position=0
|
||||
f=Starter.skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info where cat_cl_codigo <> 0")
|
||||
f.Position=0
|
||||
e = Starter.skmt.ExecQuery2("select count(*) as POR_VISITAR from kmt_info where cat_cl_codigo <> 0 and CAT_CL_DIAS_VISITA = (SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?) ", Array As String("DIA_VISITA"))
|
||||
e.Position = 0
|
||||
f = Starter.skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info where cat_cl_codigo <> 0")
|
||||
f.Position = 0
|
||||
l_ruta.Text = f.GetString("CAT_CL_RUTA")
|
||||
f.Close
|
||||
If l_ruta.Text = 0 Then
|
||||
l_ruta.Text =0
|
||||
l_ruta.Text = 0
|
||||
Else
|
||||
f=Starter.skmt.ExecQuery("select CAT_CL_RUTA from kmt_info")
|
||||
f.Position=0
|
||||
f = Starter.skmt.ExecQuery("select CAT_CL_RUTA from kmt_info")
|
||||
f.Position = 0
|
||||
l_ruta.Text = f.GetString("CAT_CL_RUTA")
|
||||
f.Close
|
||||
End If
|
||||
@@ -364,8 +364,8 @@ Sub B4XPage_Appear
|
||||
usuario = c.GetString("USUARIO")
|
||||
Starter.usuario = usuario
|
||||
c.Close
|
||||
c=Starter.skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN")
|
||||
C.Position =0
|
||||
c = Starter.skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN")
|
||||
C.Position = 0
|
||||
ALMACEN = C.GetString("ID_ALMACEN")
|
||||
C.Close
|
||||
Cursor_check = Starter.skmt.ExecQuery("select count(*) as CUANTOS from TMP_INSPECCION_AUTO_DIARIA where tmp_auto_kilometraje <> '' ")
|
||||
@@ -397,10 +397,10 @@ Sub B4XPage_Appear
|
||||
L_SUPLENCIA.Visible = False
|
||||
Label4.Visible = False
|
||||
Starter.montoActual = L_MONTOD.Text
|
||||
Starter.clientesventa = l_cuantosc.Text
|
||||
Starter.clientesventa = l_cuantosc.Text
|
||||
Starter.clientesvisitados = l_porvisitar.TEXT
|
||||
Starter.ALMACEN = ALMACEN
|
||||
Starter.rutapreventa = l_ruta.text
|
||||
Starter.rutapreventa = l_ruta.text
|
||||
CallSub(Starter, "ENVIA_ULTIMA_GPS")
|
||||
c.Close
|
||||
' Subs.guardaUltimaActividadBD("principal")
|
||||
@@ -437,8 +437,8 @@ Sub trabajar_Click
|
||||
Msgbox("No se ha realizado aún el 'Checklist' del vehículo, por favor completelo antes de realizar una venta.", "FALTA EL CHECKLIST") 'ignore
|
||||
Return
|
||||
End If
|
||||
c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MARCAS"))
|
||||
c.Position =0
|
||||
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MARCAS"))
|
||||
c.Position = 0
|
||||
If c.RowCount > 0 Then
|
||||
MARCASQ = c.GetString("CAT_VA_VALOR")
|
||||
c.Close
|
||||
@@ -479,9 +479,9 @@ Sub Subir_Click
|
||||
PASO = 1
|
||||
'End If
|
||||
If PASO = 1 Then
|
||||
c=Starter.skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_RUTA from kmt_info")
|
||||
If c.RowCount>0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
c = Starter.skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_RUTA from kmt_info")
|
||||
If c.RowCount > 0 Then
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position=i
|
||||
Starter.skmt.ExecNonQuery2("update PEDIDO set PE_RUTA = ? where PE_CLIENTE = ? ", Array As Object(c.GetString("CAT_CL_RUTA"),c.GetString("CAT_CL_CODIGO")))
|
||||
Next
|
||||
@@ -517,7 +517,7 @@ Sub cargar_Click
|
||||
Sleep(1000)
|
||||
If logger Then Log("Descargando Carta Porte (Loop cargar_Click)")
|
||||
Loop
|
||||
Else If (DateTime.Date(File.LastModified(File.DirInternal,"cartaPorte.pdf")) < hoy And Starter.rutaTipo <> "FORANEA") Then ' si la fecha del pdf NO es de hoy y la ruta NO es foranea entonces ...
|
||||
Else If (DateTime.Date(File.LastModified(File.DirInternal,"cartaPorte.pdf")) < hoy And Starter.rutaTipo <> "FORANEA") Then ' si la fecha del pdf NO es de hoy y la ruta NO es foranea entonces ...
|
||||
LogColor("La carta porte es vieja.", Colors.Red)
|
||||
If logger Then Log(Starter.rutaTipo)
|
||||
descargaCartaPorte ' la descargamos.
|
||||
@@ -847,8 +847,6 @@ Sub cargar_Click
|
||||
inv.Visible = False
|
||||
If Starter.marcaCel <> "LGE" Then ToastMessageShow("Se Actualizarán los datos. Este proceso podria tardar hasta un minuto, gracias" , True)
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Sub JobDone(Job As HttpJob)
|
||||
@@ -916,7 +914,7 @@ Sub JobDone(Job As HttpJob)
|
||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
End If
|
||||
End If
|
||||
bcarga1 = 20
|
||||
@@ -1120,7 +1118,7 @@ Sub JobDone(Job As HttpJob)
|
||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1160,9 +1158,9 @@ Sub JobDone(Job As HttpJob)
|
||||
c.Close
|
||||
If cuantos_pedidosc > 0 Then
|
||||
' c=Starter.skmt.ExecQUERY("SELECT PE_PROID, SUM(PE_CANT) AS PE_CANT FROM PEDIDO WHERE PE_CLIENTE <> 0 GROUP BY PE_PROID")
|
||||
c=Starter.skmt.ExecQUERY("SELECT PE_PROID, SUM(PE_CANT) AS PE_CANT, PE_PRONOMBRE FROM PEDIDO WHERE PE_CLIENTE <> '0' AND PE_PRONOMBRE NOT LIKE '%CAMBIO%' GROUP BY PE_PROID, PE_PRONOMBRE")
|
||||
If c.RowCount>0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
c = Starter.skmt.ExecQUERY("SELECT PE_PROID, SUM(PE_CANT) AS PE_CANT, PE_PRONOMBRE FROM PEDIDO WHERE PE_CLIENTE <> '0' AND PE_PRONOMBRE NOT LIKE '%CAMBIO%' GROUP BY PE_PROID, PE_PRONOMBRE")
|
||||
If c.RowCount > 0 Then
|
||||
For i = 0 To c.RowCount -1
|
||||
c.Position=i
|
||||
Starter.skmt.ExecNonQuery2("update CAT_GUNAPROD2 set CAT_GP_ALMACEN = CAT_GP_ALMACEN - ? where CAT_GP_ID = ? ", Array As Object(c.GetString("PE_CANT"),c.GetString("PE_PROID")))
|
||||
Next
|
||||
@@ -1220,11 +1218,11 @@ Sub JobDone(Job As HttpJob)
|
||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1267,11 +1265,11 @@ Sub JobDone(Job As HttpJob)
|
||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1312,11 +1310,11 @@ Sub JobDone(Job As HttpJob)
|
||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1336,7 +1334,7 @@ Sub JobDone(Job As HttpJob)
|
||||
Next
|
||||
Starter.skmt.TransactionSuccessful
|
||||
Starter.skmt.EndTransaction
|
||||
Listo3 =1
|
||||
Listo3 = 1
|
||||
If PB1.Progress = 0 Then
|
||||
PB1.Progress = 30
|
||||
S_CH.Text = "CARGANDO"
|
||||
@@ -1347,10 +1345,10 @@ Sub JobDone(Job As HttpJob)
|
||||
S_CH.Text = "LISTO"
|
||||
End If
|
||||
' ToastMessageShow("Venta historico Actualizado." , True)
|
||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||
If Listo1 = 1 And Listo2 = 1 And Listo3 = 1 And Listo4 = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1379,10 +1377,10 @@ Sub JobDone(Job As HttpJob)
|
||||
S_CH.Text = "LISTO"
|
||||
End If
|
||||
' ToastMessageShow("Venta historico Actualizado." , True)
|
||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||
If Listo1 = 1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||
B4XPage_Appear
|
||||
img2.Visible=False
|
||||
EJECUTANDO=0
|
||||
EJECUTANDO = 0
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1558,10 +1556,10 @@ Sub JobDone(Job As HttpJob)
|
||||
If RESULT.Rows.Size = 0 Then ToastMessageShow("No hay ruta para ese usuario", True)
|
||||
For Each records() As Object In RESULT.Rows
|
||||
Dim VALIDO As String = records(RESULT.Columns.Get("VALIDO"))
|
||||
Log("|"&VALIDO&"|")
|
||||
if starter.Logger then Log("|"&VALIDO&"|")
|
||||
' If Logger Then Log(records(RESULT.Columns.Get("CAT_RU_CATEGORIA")))
|
||||
Starter.rutaTipo = records(RESULT.Columns.Get("CAT_RU_CATEGORIA")) 'Traemos el tipo de ruta para que cuando sean foraneas no carguen la carta porte todos los dias.
|
||||
Log($"========= TIPO RUTA = ${Starter.rutaTipo}"$)
|
||||
If Starter.Logger Then Log($"========= TIPO RUTA = ${Starter.rutaTipo}"$)
|
||||
If VALIDO = "OK" Then
|
||||
cargar.Visible = True
|
||||
Subir.Visible = True
|
||||
@@ -2134,17 +2132,17 @@ End Sub
|
||||
|
||||
Sub B_OK_PAS_Click
|
||||
If CARGA = "SUBIR" And S_CP.Text = "INFO OK" Then
|
||||
c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL"))
|
||||
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL"))
|
||||
PERFIL = "0"
|
||||
If c.RowCount > 0 Then
|
||||
c.Position =0
|
||||
c.Position = 0
|
||||
PERFIL = c.GetString("CAT_VA_VALOR")
|
||||
End If
|
||||
c.Close
|
||||
c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("NUMERO_PEDIDO"))
|
||||
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("NUMERO_PEDIDO"))
|
||||
NUMERO_PEDIDO = "0"
|
||||
If c.RowCount > 0 Then
|
||||
c.Position =0
|
||||
c.Position = 0
|
||||
NUMERO_PEDIDO = c.GetString("CAT_VA_VALOR")
|
||||
End If
|
||||
c.Close
|
||||
@@ -2266,35 +2264,35 @@ Sub Resumen_Click
|
||||
DateTime.DateFormat = "MM/dd/yyyy"
|
||||
fecha=DateTime.Date(DateTime.Now)
|
||||
Starter.skmt.ExecNonQuery2("update PEDIDO set PE_TIPO = ? where PE_CLIENTE =?", Array As Object("ABORDO", "0"))
|
||||
b=Starter.skmt.ExecQuery("Select count(*) as CUANTOS from pedido_cliente where pc_cliente <> 0")
|
||||
b.Position=0
|
||||
b = Starter.skmt.ExecQuery("Select count(*) as CUANTOS from pedido_cliente where pc_cliente <> 0")
|
||||
b.Position = 0
|
||||
Cuantos = b.GetString("CUANTOS")
|
||||
' ToastMessageShow(Cuantos , True)
|
||||
d=Starter.skmt.ExecQuery2("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0 and cat_cl_codigo <> 0 AND CAT_CL_DIAS_VISITA = (SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?)", Array As String("DIA_VISITA"))
|
||||
D.Position=0
|
||||
d = Starter.skmt.ExecQuery2("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0 and cat_cl_codigo <> 0 AND CAT_CL_DIAS_VISITA = (SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?)", Array As String("DIA_VISITA"))
|
||||
D.Position = 0
|
||||
b.Close
|
||||
e=Starter.skmt.ExecQuery2("select count(*) as POR_VISITAR from kmt_info where cat_cl_codigo <> 0 and CAT_CL_DIAS_VISITA = (SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?) ", Array As String("DIA_VISITA"))
|
||||
e.Position=0
|
||||
f=Starter.skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info where cat_cl_codigo <> 0")
|
||||
f.Position=0
|
||||
e = Starter.skmt.ExecQuery2("select count(*) as POR_VISITAR from kmt_info where cat_cl_codigo <> 0 and CAT_CL_DIAS_VISITA = (SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?) ", Array As String("DIA_VISITA"))
|
||||
e.Position = 0
|
||||
f = Starter.skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info where cat_cl_codigo <> 0")
|
||||
f.Position = 0
|
||||
l_ruta.Text = f.GetString("CAT_CL_RUTA")
|
||||
f.Close
|
||||
If l_ruta.Text = 0 Then
|
||||
l_ruta.Text =0
|
||||
l_ruta.Text = 0
|
||||
Else
|
||||
f=Starter.skmt.ExecQuery("select CAT_CL_RUTA from kmt_info")
|
||||
f.Position=0
|
||||
f = Starter.skmt.ExecQuery("select CAT_CL_RUTA from kmt_info")
|
||||
f.Position = 0
|
||||
l_ruta.Text = f.GetString("CAT_CL_RUTA")
|
||||
f.Close
|
||||
End If
|
||||
If Cuantos = 0 Then
|
||||
L_MONTOD.Text =0
|
||||
L_MONTOD.Text = 0
|
||||
l_cuantosc.Text = 0
|
||||
l_cuantosn.Text = 0
|
||||
drop = 0
|
||||
l_drop.Text = 0
|
||||
efectiva = 0
|
||||
l_efectiva.text =0
|
||||
l_efectiva.text = 0
|
||||
l_ctast.Text = d.GetString("TOTAL_VISITAR")
|
||||
'l_porvisitar.Text = e.GetString("POR_VISITAR")
|
||||
d.Close
|
||||
@@ -2343,12 +2341,15 @@ Sub Resumen_Click
|
||||
l_monto_c3.Text = 2000
|
||||
End If
|
||||
DDD.Close
|
||||
c=Starter.skmt.ExecQuery("select sum(pc_monto) as MONTO_DIA, count(pc_cliente) AS CLIENTES_DIA from pedido_cliente where pc_cliente <> 0")
|
||||
b=Starter.skmt.ExecQuery("select count(*) as CUANTOS from noventa")
|
||||
c = Starter.skmt.ExecQuery("select sum(pc_monto) as MONTO_DIA, count(pc_cliente) AS CLIENTES_DIA from pedido_cliente where pc_cliente <> 0")
|
||||
b = Starter.skmt.ExecQuery("select count(*) as CUANTOS from noventa")
|
||||
'where pc_fecha = ?", Array As String(fecha)
|
||||
C.Position=0
|
||||
b.Position=0
|
||||
C.Position = 0
|
||||
b.Position = 0
|
||||
L_MONTOD.Text = c.GetString("MONTO_DIA")
|
||||
L_MONTOD.Text = Subs.sumaPedido(Subs.traeCliente) 'Trae el monto sin el redondeo que a veces hace el SUM().
|
||||
' Log(Subs.sumaPedido(Subs.traeCliente) & " - " & L_MONTOD.Text)
|
||||
Subs.sumaPedido(Subs.traeCliente)
|
||||
l_cuantosc.Text = c.GetString("CLIENTES_DIA")
|
||||
l_cuantosn.Text = b.GetString("CUANTOS")
|
||||
efectiva = c.GetString("CLIENTES_DIA") / e.GetString("POR_VISITAR")
|
||||
@@ -2376,8 +2377,8 @@ Sub Resumen_Click
|
||||
c.Close
|
||||
b.Close
|
||||
End If
|
||||
b=Starter.skmt.ExecQuery("Select count(*) as CUANTOS from pedido where pe_cliente = 0")
|
||||
b.Position=0
|
||||
b = Starter.skmt.ExecQuery("Select count(*) as CUANTOS from pedido where pe_cliente = 0")
|
||||
b.Position = 0
|
||||
Cuantos = b.GetString("CUANTOS")
|
||||
If Cuantos > 0 Then
|
||||
c=Starter.skmt.ExecQuery("Select sum(PE_COSTO_TOT) AS TOTAL from pedido where pe_cliente = 0")
|
||||
@@ -2912,7 +2913,7 @@ End Sub
|
||||
'Descarga del servidor el PDF de la carta porte del dia de hoy y la
|
||||
'guarda en el almacenamiento externo con el nombre "cartaPorte.pdf"
|
||||
Sub descargaCartaPorte
|
||||
Log("Inicia descargaCartaPorte")
|
||||
If Starter.Logger Then Log("Inicia descargaCartaPorte")
|
||||
cartaPorteLista = False
|
||||
'Generamos el nombre del PDF de la carta porte
|
||||
DateTime.DateFormat = "ddMMyyyy"
|
||||
@@ -2934,12 +2935,12 @@ Sub descargaCartaPorte
|
||||
ProgressBarPDF.Progress = 0
|
||||
' Log("Ocultamos panel descarga")
|
||||
Subs.panelOculto(p_downloadPDF)
|
||||
Log(p_progress1.Visible)
|
||||
If Starter.Logger Then Log(p_progress1.Visible)
|
||||
End Sub
|
||||
|
||||
'Muestra el panel de descarga de la carta porte con barra de progreso
|
||||
Sub descargaCartaPorteyProgreso (urlx As String) As ResumableSub
|
||||
Log("Iniciamos descargaCartaPorteyProgreso")
|
||||
If Starter.Logger Then Log("Iniciamos descargaCartaPorteyProgreso")
|
||||
If logger Then Log("Mostramos panel descarga")
|
||||
Subs.panelVisible(p_downloadPDF, 0, 0)
|
||||
Subs.centraPanel(p_progress1, Root.Width)
|
||||
@@ -2969,24 +2970,24 @@ Sub descargaCartaPorteyProgreso (urlx As String) As ResumableSub
|
||||
Sleep(10)
|
||||
Loop
|
||||
Dim bx() As Boolean = Array As Boolean(False)
|
||||
Log("Llamamos TrackProgress")
|
||||
If Starter.Logger Then Log("Llamamos TrackProgress")
|
||||
TrackProgress(job_PDF, bx, TaskId)
|
||||
'**** Termina barra de progreso
|
||||
|
||||
Log("Iniciamos Wait for JobDone Descarga")
|
||||
Log("Mostramos panel descarga")
|
||||
If Starter.Logger Then Log("Iniciamos Wait for JobDone Descarga")
|
||||
If Starter.Logger Then Log("Mostramos panel descarga")
|
||||
Subs.panelVisible(p_downloadPDF, 0, 0)
|
||||
Wait for (job_PDF) JobDone (job_PDF As HttpJob)
|
||||
' Log("Terminamos Wait for JobDone Descarga ")
|
||||
If job_PDF.Success = False Then Log("Error PDF")
|
||||
If job_PDF.Success = True Then
|
||||
Log("Carta descargada con exito")
|
||||
Log("Ocultamos downloader")
|
||||
If Starter.Logger Then Log("Ocultamos downloader")
|
||||
cartaPorteLista = True
|
||||
' // Delete existing file
|
||||
' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
|
||||
' Wait For B4XPAges_PermissionResult (Permission As String, Result As Boolean)
|
||||
Log("Ocultamos downloader 2")
|
||||
If Starter.Logger Then Log("Ocultamos downloader 2")
|
||||
If File.Exists(File.DirInternal,"cartaPorte.pdf") Then
|
||||
' Log("Borramos carta anterior")
|
||||
File.Delete(File.DirInternal,"cartaPorte.pdf")
|
||||
|
||||
Reference in New Issue
Block a user