mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-17 18:26:11 +00:00
22/11/23 - Se borran los clienets nuevos si no tienen venta.
This commit is contained in:
@@ -197,7 +197,7 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
End Sub
|
||||
|
||||
Sub borra_Click
|
||||
If folio = "0" Then 'Si el folio es 0 o el cliente actual es "abordo", los deja borrar. - Mod por CHV 220512 'Para que el abordo borre siempre " Or Subs.clienteActual = "0""
|
||||
If folio = "0" Then 'Si el folio es 0 o el cliente actual es "abordo", los deja borrar. - Mod por CHV 220512 'Para que el abordo borre siempre agregar -> " Or Subs.clienteActual = "0""
|
||||
result = Msgbox2("¿Seguro que desea borrar el pedido?","Cancelar pedido", "Si", "", "No", LoadBitmap(File.DirAssets,"alert2.png")) 'ignore
|
||||
If result = DialogResponse.POSITIVE Then
|
||||
' c = Starter.skmt.ExecQuery("select PE_PROID, PE_CANT, PE_TIPO, PE_CEDIS FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) ")
|
||||
@@ -363,7 +363,7 @@ Private Sub clv_pedidos_ItemLongClick (position As Int, Value As Object)
|
||||
c.Close
|
||||
c = Starter.skmt.ExecQuery2("select PE_PRONOMBRE, PE_COSTO_TOT, PE_CANT, PE_FOLIO FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) AND PE_PRONOMBRE = ? order by PE_PRONOMBRE asc", Array As String(Value) )
|
||||
c.Position = 0
|
||||
If c.GetString("PE_FOLIO") = "0" Then 'Para que el abordo borre siempre " Or Subs.clienteActual = "0" "
|
||||
If c.GetString("PE_FOLIO") = "0" Then 'Para que el abordo borre siempre agregar -> " Or Subs.clienteActual = "0" "
|
||||
result = Msgbox2("Seguro que desea borrar este articulo?","Borrar Articulo", "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) 'ignore
|
||||
If result = DialogResponse.POSITIVE Then
|
||||
Private prod As Cursor = Starter.skmt.ExecQuery2("select PE_PROID, PE_CANT, PE_CEDIS FROM PEDIDO where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa) ", Array As String(Value))
|
||||
|
||||
@@ -282,6 +282,7 @@ Sub B4XPage_Appear
|
||||
' End If
|
||||
' End If
|
||||
If Subs.traeUltimaActividadBD <> "principal" Then Subs.iniciaActividad(Subs.traeUltimaActividadBD)
|
||||
borraClientesNuevosSinVenta
|
||||
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||
' If Not(btAdmin.IsEnabled) Then btAdmin.Enable 'Si no esta prendido el BT, lo prendemos.
|
||||
If kh.RD_Init_IsInitialized Then
|
||||
@@ -381,13 +382,21 @@ Sub B4XPage_Appear
|
||||
' If Not(File.Exists(File.DirInternal,"FOTO4.jpg")) Then Log("Falta foto4")
|
||||
Cedis_Check = 0
|
||||
End If
|
||||
If Cedis_Check = 0 And l_ruta.Text <> 0 Then
|
||||
Btn_CheckList.Visible = True
|
||||
|
||||
Log(">>>> CHECKLIST: |" & Cedis_Check & "|")
|
||||
|
||||
Btn_CheckList.Visible = False
|
||||
If Cedis_Check = 0 Then ' And l_ruta.Text <> 0
|
||||
If l_ruta.Text <> 0 Then Btn_CheckList.Visible = True
|
||||
B_MAPA_RUTA.Visible = False
|
||||
NUEVO.Visible = False
|
||||
B_PROXIMA.Visible = False
|
||||
Else
|
||||
' PONER EN FALSE
|
||||
Btn_CheckList.Visible = False
|
||||
B_MAPA_RUTA.Visible = True
|
||||
NUEVO.Visible = True
|
||||
B_PROXIMA.Visible = True
|
||||
If usuario = "JOSELUIS" Then Btn_CheckList.Visible = True 'Mod por CHV - 211125
|
||||
End If
|
||||
contador_strem = 0
|
||||
@@ -509,7 +518,7 @@ Sub cargar_Click
|
||||
DateTime.DateFormat = "yyyyMMdd"
|
||||
Dim hoy As String = DateTime.Date(DateTime.Now)
|
||||
' If Logger Then Log(DateTime.Date(File.LastModified(File.DirInternal,"cartaPorte.pdf")) & " - " & hoy )
|
||||
If kh.traeUsarCartaPorte Then 'Si necesitamos la carta porte ...
|
||||
If kh.traeUsarCartaPorte Then 'Si se requiere la carta porte para cagar dia ...
|
||||
If Not(File.Exists(File.DirInternal,"cartaPorte.pdf")) Then 'Si no existe la descargamos ...
|
||||
If logger Then LogColor("No hay carta porte.", Colors.Red)
|
||||
descargaCartaPorte ' la descargamos.
|
||||
@@ -2164,8 +2173,8 @@ Sub B_OK_PAS_Click
|
||||
End If
|
||||
P1.Visible = False
|
||||
trabajar.Visible = True
|
||||
B_PROXIMA.Visible =True
|
||||
NUEVO.Visible =True
|
||||
' B_PROXIMA.Visible =True
|
||||
' NUEVO.Visible =True
|
||||
BUSCA.Visible=True
|
||||
connecta.Visible=True
|
||||
Resumen.Visible= True
|
||||
@@ -2175,7 +2184,7 @@ Sub B_OK_PAS_Click
|
||||
Msgbox("Tiene que subir de nuevo la información","Atención") 'ignore
|
||||
P1.Visible = False
|
||||
trabajar.Visible = True
|
||||
NUEVO.Visible =True
|
||||
' NUEVO.Visible =True
|
||||
BUSCA.Visible=True
|
||||
connecta.Visible=True
|
||||
Resumen.Visible= True
|
||||
@@ -2186,8 +2195,8 @@ Sub B_OK_PAS_Click
|
||||
If res = DialogResponse.POSITIVE Then
|
||||
P1.Visible = False
|
||||
trabajar.Visible = True
|
||||
B_PROXIMA.Visible =True
|
||||
NUEVO.Visible =True
|
||||
' B_PROXIMA.Visible =True
|
||||
' NUEVO.Visible =True
|
||||
BUSCA.Visible=True
|
||||
connecta.Visible=True
|
||||
Resumen.Visible= True
|
||||
@@ -2203,8 +2212,8 @@ Sub B_OK_PAS_Click
|
||||
c.Close
|
||||
P1.Visible = False
|
||||
trabajar.Visible = True
|
||||
B_PROXIMA.Visible =True
|
||||
NUEVO.Visible =True
|
||||
' B_PROXIMA.Visible =True
|
||||
' NUEVO.Visible =True
|
||||
BUSCA.Visible=True
|
||||
connecta.Visible=True
|
||||
Resumen.Visible= True
|
||||
@@ -2218,8 +2227,8 @@ Sub B_OK_PAS_Click
|
||||
If res = DialogResponse.POSITIVE Then
|
||||
P1.Visible = False
|
||||
trabajar.Visible = True
|
||||
B_PROXIMA.Visible =True
|
||||
NUEVO.Visible =True
|
||||
' B_PROXIMA.Visible =True
|
||||
' NUEVO.Visible =True
|
||||
BUSCA.Visible=True
|
||||
connecta.Visible=True
|
||||
Resumen.Visible= True
|
||||
@@ -3196,4 +3205,16 @@ Private Sub connecta_LongClick
|
||||
'' TMP_ALMACEN, TMP_RUTA, TMP_USUARIO, TMP_FECHA_SINC, TMP_ID_CLIENTE, TMP_EVENTO, TMP_INICIO, TMP_FINAL, TMP_LATITUD, TMP_LONGITUD, TMP_MOTIVO_NO_VENTA, TMP_MOTIVO_NO_VISITA, TMP_NOMBRE_CLIENTE,TMP_PRESICION
|
||||
' cmd.Parameters = Array As Object( ALMACEN, cliente, evento, fecha, e_ruta.text, )
|
||||
' reqManager.ExecuteQuery(cmd , 0, "HIST_ENCUESTA2")
|
||||
End Sub
|
||||
|
||||
'Borramos los clientes nuevosd que no tengan venta.
|
||||
Sub borraClientesNuevosSinVenta 'ignore
|
||||
Private x As Cursor = Starter.skmt.ExecQuery("Select CAT_CL_CODIGO from kmt_info where CAT_CL_CODIGO like 'N%' and CAT_CL_CODIGO not in (Select pe_cliente from pedido)")
|
||||
If x.RowCount > 0 Then
|
||||
x.Position = 0
|
||||
For i = 0 To x.RowCount - 1
|
||||
Starter.skmt.ExecNonQuery($"delete from kmt_info where CAT_CL_CODIGO = '${x.GetString("CAT_CL_CODIGO")}'"$)
|
||||
LogColor($"Cliente nuevo "${x.GetString("CAT_CL_CODIGO")}" BORRADO!!"$, Colors.red)
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
@@ -870,7 +870,7 @@ Version=12.5
|
||||
#Region Project Attributes
|
||||
#ApplicationLabel: Kelloggs Venta
|
||||
#VersionCode: 3000
|
||||
#VersionName: 3.11.19 PRUEBA V4
|
||||
#VersionName: 3.11.22 PRUEBA V4
|
||||
#SupportedOrientations: portrait
|
||||
#CanInstallToExternalStorage: False
|
||||
#BridgeLogger:true
|
||||
|
||||
@@ -61,7 +61,7 @@ ModuleBreakpoints7=
|
||||
ModuleBreakpoints8=
|
||||
ModuleBreakpoints9=
|
||||
ModuleClosedNodes0=
|
||||
ModuleClosedNodes1=
|
||||
ModuleClosedNodes1=35
|
||||
ModuleClosedNodes10=
|
||||
ModuleClosedNodes11=1,50,51,52
|
||||
ModuleClosedNodes12=1,15,16
|
||||
@@ -74,7 +74,7 @@ ModuleClosedNodes18=3,4,5,7,8,9,10,11,12,13,15,16,18
|
||||
ModuleClosedNodes19=
|
||||
ModuleClosedNodes2=
|
||||
ModuleClosedNodes20=
|
||||
ModuleClosedNodes21=20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
|
||||
ModuleClosedNodes21=20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
|
||||
ModuleClosedNodes22=
|
||||
ModuleClosedNodes23=
|
||||
ModuleClosedNodes24=
|
||||
@@ -91,6 +91,6 @@ ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
ModuleClosedNodes8=
|
||||
ModuleClosedNodes9=
|
||||
NavigationStack=C_NuevoCliente,GPS_LocationChanged,75,4,C_NuevoCliente,Class_Globals,24,6,C_NuevoCliente,B4XPage_Created,41,0,C_NuevoCliente,B4XPage_Appear,50,6,kms_helperSubs,traeUsarCartaPorte,655,0,Visual Designer,nuevocliente.bal,-100,2,kms_helperSubs,traeMaxClientesNuevos,659,0,B4XMainPage,Class_Globals,23,0,Visual Designer,login.bal,-100,6,B4XMainPage,B4XPage_CloseRequest,541,6,B4XMainPage,b_extras_Click,815,1
|
||||
NavigationStack=Visual Designer,principal.bal,-100,3,C_Nota,borra_Click,193,1,C_Nota,clv_pedidos_ItemLongClick,368,1,Main,Activity_Pause,49,0,Main,Process_Globals,21,0,C_Principal,B_OK_PAS_Click,2166,0,C_Principal,B4XPage_Created,253,0,C_Principal,cargar_Click,514,5,kms_helperSubs,Class_Globals,17,0,C_Principal,B4XPage_Appear,281,6,kms_helperSubs,RD_Init,69,0
|
||||
SelectedBuild=0
|
||||
VisibleModules=1,28,11,24,3,29,14,12,9
|
||||
VisibleModules=1,28,11,24,3,29,14,12,9,21,7
|
||||
|
||||
@@ -1053,13 +1053,15 @@ End Sub
|
||||
'Hay que darle como parametro un mapa (traePromo(promo)) con toda la informacion de la promocion.
|
||||
'Regresa en el mapa la llave "resultado" que nos da "ok" o "No hay suficiente producto para la promocion".
|
||||
Sub restaFijosPromo(promoMap As Map) As Map 'ignore
|
||||
Private thisLog As Boolean = False 'Si es verdadero, muestra los logs de este sub.
|
||||
Private thisLog As Boolean = True 'Si es verdadero, muestra los logs de este sub.
|
||||
Private inventariosDisponiblesParaEstaPromo As Map = traemosInventarioDisponibleParaPromo(promoMap.Get("id")) 'Obtenemos un mapa con el inventario disponible para cada producto de la promocion desde la base de datos.
|
||||
If thisLog Then LogColor(inventariosDisponiblesParaEstaPromo, Colors.red)
|
||||
If thisLog Then LogColor("Inventario inicial antes de FIJOS: "&inventariosDisponiblesParaEstaPromo, Colors.Gray) 'Inventario inicial.
|
||||
Private i As Int
|
||||
Private prodsmap As Map = promoMap.Get("productos") 'Obtenemos un mapa con todos los productos de la promoción.
|
||||
Private prodsFijos As List = promoMap.get("prodsFijos") 'Obtenemos un a lista con los productos fijos de la promoción.
|
||||
If thisLog Then LogColor("ProdsFijos > " & prodsFijos, Colors.red)
|
||||
inventariosDisponiblesParaEstaPromo.Put("resultado", "No hay suficiente producto para la promocion.") 'Valor por default
|
||||
For p = 0 To prodsFijos.Size - 1
|
||||
Private t As String = prodsFijos.Get(p) 'Obtenemos el Id de este producto desde la lista de productos fijos.
|
||||
Private p2 As Map = prodsmap.Get(t) 'Obtenemos un mapa con los datos de este producto (id, precio, almacen, tipo, piezas, etc.)
|
||||
@@ -1156,7 +1158,7 @@ Sub traePromosVendidas(promo As String, cliente As String) As Int
|
||||
End Sub
|
||||
|
||||
Sub procesaPromocion(idPromo As String, cliente As String) As Map 'ignore
|
||||
Private thisLog As Boolean = False 'Si es verdadero, muestra los logs de este sub.
|
||||
Private thisLog As Boolean = True 'Si es verdadero, muestra los logs de este sub.
|
||||
Private inicioContador As String = DateTime.Now
|
||||
Private mp = 0
|
||||
If thisLog Then LogColor($"********* Iniciamos revision de Promo ${idPromo} *********"$, Colors.red)
|
||||
|
||||
Reference in New Issue
Block a user