mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-20 19:49:12 +00:00
- Regresamos C_Promos y C_Productos a la version anterior para "deshabilitar" los cambios a las nuevas promociones.
This commit is contained in:
@@ -326,11 +326,10 @@ Sub lv_catalogos_ItemClick (Position As Int, Value As Object)
|
|||||||
If c2.RowCount > 0 Then
|
If c2.RowCount > 0 Then
|
||||||
For i=0 To c2.RowCount -1
|
For i=0 To c2.RowCount -1
|
||||||
c2.Position=i
|
c2.Position=i
|
||||||
' Private tm As Map = Subs.procesaPromocion(c2.GetString("CAT_GP_ID"), clienteId)
|
Private tm As Map = Subs.procesaPromocion(c2.GetString("CAT_GP_ID"), clienteId)
|
||||||
Private tm As Map = promosC.procesaPromocion(c2.GetString("CAT_GP_ID"), clienteId, Starter.tipov)
|
' promosC.procesaPromocion(c2.GetString("CAT_GP_ID"), clienteId)
|
||||||
' Log(tm)
|
|
||||||
If tm.Get("status") = "ok" Then 'Solo muestrala si hay producto.
|
If tm.Get("status") = "ok" Then 'Solo muestrala si hay producto.
|
||||||
lv_promos.AddTwoLines(c2.GetString("CAT_GP_NOMBRE"),"# " & c2.GetString("CAT_GP_ALMACEN") & " $ " & c2.GetString("CAT_GP_PRECIO") & " F:" & tm.Get("prodsFijosCant") & " V:" & tm.Get("prodsVariablesCant"))
|
lv_promos.AddTwoLines(c2.GetString("CAT_GP_NOMBRE"),"# " & c2.GetString("CAT_GP_ALMACEN") & " $ " & c2.GetString("CAT_GP_PRECIO") & " F:" & tm.Get("mp").As(Map).Get("prodsFijosCant") & " V:" & tm.Get("mp").As(Map).Get("prodsVariablesCant"))
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
@@ -936,7 +935,7 @@ End Sub
|
|||||||
Private Sub lv_promos_ItemLongClick (Position As Int, Value As Object)
|
Private Sub lv_promos_ItemLongClick (Position As Int, Value As Object)
|
||||||
Log("Promo longclic = "&Value)
|
Log("Promo longclic = "&Value)
|
||||||
Private id As String = ""
|
Private id As String = ""
|
||||||
Dim c As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ID from ${Subs.traeTablaProds(Starter.tipov)} where CAT_GP_TIPO = 'PROMOS' and CAT_GP_NOMBRE = '${Value}'"$)
|
Dim c As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ID from cat_gunaprod where CAT_GP_TIPO = 'PROMOS' and CAT_GP_NOMBRE = '${Value}'"$)
|
||||||
If c.RowCount > 0 Then
|
If c.RowCount > 0 Then
|
||||||
c.Position = 0
|
c.Position = 0
|
||||||
id = c.GetString("CAT_GP_ID")
|
id = c.GetString("CAT_GP_ID")
|
||||||
@@ -1009,7 +1008,7 @@ Private Sub b_rechazar_Click
|
|||||||
p_vistaPreviaTrans.Visible = False
|
p_vistaPreviaTrans.Visible = False
|
||||||
End If
|
End If
|
||||||
' Else
|
' Else
|
||||||
'' Msgbox("LA VENTA YA SE TRANSMITIO, FAVOR DE LLAMAR A SOPORTE PARA ASISTENCIA","AVISO") 'ignore
|
'' Msgbox("LA VENTA YA SE TRANSMITIO, FAVOR DE LLAMAR A SOPORTE PARA ASISTENCIA","AVISO") 'ignore
|
||||||
' End If
|
' End If
|
||||||
p_vistaPreviaTrans.Visible=False
|
p_vistaPreviaTrans.Visible=False
|
||||||
Subs.iniciaActividad("Cliente")
|
Subs.iniciaActividad("Cliente")
|
||||||
|
|||||||
@@ -43,12 +43,11 @@ Sub Class_Globals
|
|||||||
Dim prodsPedidoActual As String
|
Dim prodsPedidoActual As String
|
||||||
Dim montoPedidoActual As String
|
Dim montoPedidoActual As String
|
||||||
Dim promosMap As Map
|
Dim promosMap As Map
|
||||||
Dim promosC As Promociones
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'You can add more parameters here.
|
'You can add more parameters here.
|
||||||
Public Sub Initialize As Object
|
Public Sub Initialize As Object
|
||||||
promosC.Initialize(Me, "promosC", Starter.skmt)
|
' promosC.Initialize(Me, "promosC", Starter.skmt)
|
||||||
Return Me
|
Return Me
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -82,65 +81,46 @@ Sub B4XPage_Appear
|
|||||||
End Sub
|
End Sub
|
||||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||||
|
|
||||||
Sub muestraPromo(idPromo As String, cliente As String)
|
Sub muestraPromo(promo As String, cliente As String)
|
||||||
Log("muestraPromo: " & idPromo)
|
Log("muestraPromo:"&promo)
|
||||||
Private thisLog As Boolean = True
|
Private thisLog As Boolean = False
|
||||||
promosC.tablaProds = "CAT_GUNAPROD2"
|
' If thisLog Then Log(promo)
|
||||||
If Starter.tipov = "PREVENTA" Or Starter.tipov = "ABORDO" Then promosC.tablaProds = "CAT_GUNAPROD"
|
estaPromo = promo
|
||||||
' If thisLog Then Log(idPromo)
|
|
||||||
estaPromo = idPromo
|
|
||||||
esteCliente = cliente
|
esteCliente = cliente
|
||||||
' Private mp As Map = Subs.traePromo(idPromo, cliente)
|
Private mp As Map = Subs.traePromo(promo, cliente)
|
||||||
' If thisLog Then LogColor(mp, Colors.blue)
|
If thisLog Then LogColor(mp, Colors.blue)
|
||||||
' Private prodsPromo As Map = mp.Get("productos") 'Los productos de la promoción.
|
Private prodsPromo As Map = mp.Get("productos") 'Los productos de la promoción.
|
||||||
|
' Private invDispPromo As Map = Subs.traemosInventarioDisponibleParaPromo(promo)
|
||||||
' Private invDispPromo As Map = Subs.restaFijosPromo(mp)
|
Private invDispPromo As Map = Subs.restaFijosPromo(mp)
|
||||||
Private invDispPromo As Map = promosC.restaFijosDePromo(idPromo)
|
|
||||||
|
|
||||||
If thisLog Then Log($"invDispPromo=${invDispPromo}"$)
|
If thisLog Then Log($"invDispPromo=${invDispPromo}"$)
|
||||||
If thisLog Then Log("Max promos por inv de prods FIJOS: " & promosC.revisaMaxPromosProdsFijosPorInventario(idPromo))
|
If thisLog Then Log("Max promos por inv de prods FIJOS: " & Subs.revisaMaxPromosProdsFijosPorInventario(mp))
|
||||||
If thisLog Then Log("Max promos por inv de prods VARIABLES: " & promosC.revisaMaxPromosProdsVariablesPorInventario(idPromo))
|
If thisLog Then Log("Max promos por inv de prods VARIABLES: " & Subs.revisaMaxPromosProdsVariablesPorInventario(mp))
|
||||||
|
maxCantPromos = Subs.revisaMaxPromosProdsVariablesPorInventario(mp)
|
||||||
' maxCantPromos = Subs.revisaMaxPromosProdsVariablesPorInventario(mp)
|
|
||||||
maxCantPromos = promosC.revisaMaxPromosProdsVariablesPorInventario(idPromo)
|
|
||||||
Log($"MAXCANTPROMOS: ${maxCantPromos}"$)
|
|
||||||
|
|
||||||
et_promoCant.Text = 1
|
et_promoCant.Text = 1
|
||||||
l_promosCant.text = "Max promos: " & maxCantPromos
|
l_promosCant.text = "Max promos: " & maxCantPromos
|
||||||
Private cs As CSBuilder
|
Private cs As CSBuilder
|
||||||
cs.Initialize
|
cs.Initialize
|
||||||
' If thisLog Then Log(mp)
|
If thisLog Then Log(mp)
|
||||||
' If thisLog Then Log(prodsPromo)
|
If thisLog Then Log(prodsPromo)
|
||||||
'Ponemos la idPromo y descripción.
|
'Ponemos la promo y descripción.
|
||||||
' Dim desc As String = $"Promoción: ${idPromo}${CRLF}${mp.Get("descripcion")}"$
|
' Dim desc As String = $"Promoción: ${promo}${CRLF}${mp.Get("descripcion")}"$
|
||||||
' Dim desc As String = cs.append("Promocion: ").Color(Colors.RGB(100,149,237)).Append(idPromo).pop.append(CRLF).Append(mp.Get("descripcion")).Popall
|
' Dim desc As String = cs.append("Promocion: ").Color(Colors.RGB(100,149,237)).Append(promo).pop.append(CRLF).Append(mp.Get("descripcion")).Popall
|
||||||
Private c As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_NOMBRE from ${Subs.traeTablaProds(Starter.tipov)} where CAT_GP_ID = '${idPromo}'"$)
|
l_promoDesc.Text = cs.Color(Colors.RGB(100,149,237)).append("Promocion: ").pop.append(CRLF).Append(promo).append(CRLF).Append(mp.Get("descripcion")).Popall
|
||||||
Private descripcion As String = "PROMO"
|
|
||||||
If c.RowCount > 0 Then
|
|
||||||
c.Position = 0
|
|
||||||
descripcion = c.GetString("CAT_GP_NOMBRE")
|
|
||||||
End If
|
|
||||||
l_promoDesc.Text = cs.Color(Colors.RGB(100,149,237)).append("Promocion: ").pop.append(CRLF).Append(idPromo).append(CRLF).Append(descripcion).Popall
|
|
||||||
prodsFijosTot = 0
|
prodsFijosTot = 0
|
||||||
'Ponemos el texto en las etiquetas de la cantidad de productos.
|
'Ponemos el texto en las etiquetas de la cantidad de productos.
|
||||||
' Dim pf As List = mp.Get("prodsFijos")
|
' Dim pf As List = mp.Get("prodsFijos")
|
||||||
|
Dim pv As List = mp.Get("prodsVariables")
|
||||||
' Dim pv As List = mp.Get("prodsVariables")
|
Dim listaPreciosPV As List = mp.Get("prodsVariablesPrecios")
|
||||||
Dim pv As List = promosC.traeListaDePromo("P_PRODSVARIABLES", idPromo)
|
|
||||||
|
|
||||||
' Dim listaPreciosPV As List = mp.Get("prodsVariablesPrecios")
|
|
||||||
Dim listaPreciosPV As List = promosC.traeListaDePromo("P_PRODSVARIABLES_PRECIOS", idPromo)
|
|
||||||
|
|
||||||
' Logcolor(listaPreciosPV, Colors.red)
|
' Logcolor(listaPreciosPV, Colors.red)
|
||||||
' If thisLog Then Log(mp)
|
If thisLog Then Log(mp)
|
||||||
tpf = 0
|
tpf = 0
|
||||||
For Each pfp As Int In promosC.traeListaDePromo("P_PRODSFIJOS_PIEZAS", idPromo)
|
For Each pfp As Int In mp.Get("prodsFijosPiezas").As(List)
|
||||||
tpf = tpf + pfp
|
tpf = tpf + pfp
|
||||||
Next
|
Next
|
||||||
tpf2 = tpf
|
tpf2 = tpf
|
||||||
' tpf = tpf * maxCantPromos
|
' tpf = tpf * maxCantPromos
|
||||||
l_prodsFijos.Text = $"Productos fijos (${tpf})"$
|
l_prodsFijos.Text = $"Productos fijos (${tpf})"$
|
||||||
prodsVarReq = promosC.traeInfoDePromo("P_PRODSVARIABLES_REQUERIDOS", idPromo)
|
prodsVarReq = mp.Get("prodsVariablesRequeridos")
|
||||||
prodsVarReq2 = prodsVarReq
|
prodsVarReq2 = prodsVarReq
|
||||||
l_prodsVariables.Text = $"Productos variables requeridos: ${prodsVarReq}"$
|
l_prodsVariables.Text = $"Productos variables requeridos: ${prodsVarReq}"$
|
||||||
If prodsVarReq = 0 Then
|
If prodsVarReq = 0 Then
|
||||||
@@ -157,7 +137,7 @@ Sub muestraPromo(idPromo As String, cliente As String)
|
|||||||
lv_prodsFijos.Clear
|
lv_prodsFijos.Clear
|
||||||
' If pf.Size < 1 Then pf.Add("Sin productos fijos.")
|
' If pf.Size < 1 Then pf.Add("Sin productos fijos.")
|
||||||
lv_prodsFijos.Clear
|
lv_prodsFijos.Clear
|
||||||
agregaFijosALista(idPromo, True)
|
agregaFijosALista(mp, True)
|
||||||
If thisLog Then Log("Total prods fijos = " & prodsFijosTot)
|
If thisLog Then Log("Total prods fijos = " & prodsFijosTot)
|
||||||
' If thisLog Then Log("======="&prodsMap)
|
' If thisLog Then Log("======="&prodsMap)
|
||||||
l_totProds.text = $"Productos: ${tpf}"$
|
l_totProds.text = $"Productos: ${tpf}"$
|
||||||
@@ -178,10 +158,10 @@ Sub muestraPromo(idPromo As String, cliente As String)
|
|||||||
' jpeg = c2.GetBlob("CAT_GP_IMG")
|
' jpeg = c2.GetBlob("CAT_GP_IMG")
|
||||||
' ins.InitializeFromBytesArray(jpeg, 0, jpeg.Length)
|
' ins.InitializeFromBytesArray(jpeg, 0, jpeg.Length)
|
||||||
' bmp.Initialize2(ins)
|
' bmp.Initialize2(ins)
|
||||||
Private indicePV As Int = pv.IndexOf(p)
|
Private indicePV = pv.IndexOf(p)
|
||||||
Private estePrecio As String = listaPreciosPV.Get(indicePV)
|
Private estePrecio = listaPreciosPV.Get(indicePV)
|
||||||
' Private thisProd As Map = prodsPromo.Get(p)
|
Private thisProd As Map = prodsPromo.Get(p)
|
||||||
' If thisLog Then Log(thisProd)
|
If thisLog Then Log(thisProd)
|
||||||
If existenciaProdVariable > 0 Then
|
If existenciaProdVariable > 0 Then
|
||||||
Log($">>>>> AGREGAMOS PROD VARIABLE ${p}"$)
|
Log($">>>>> AGREGAMOS PROD VARIABLE ${p}"$)
|
||||||
clv_prodsVariabes.Add(CreateListItem(Subs.traeProdNombre(p)&CRLF&"Hay " & invDispPromo.Get(p) & " $" & estePrecio, estePrecio, invDispPromo.Get(p), clv_prodsVariabes.AsView.Width, 50dip, Null, p), p)
|
clv_prodsVariabes.Add(CreateListItem(Subs.traeProdNombre(p)&CRLF&"Hay " & invDispPromo.Get(p) & " $" & estePrecio, estePrecio, invDispPromo.Get(p), clv_prodsVariabes.AsView.Width, 50dip, Null, p), p)
|
||||||
@@ -194,13 +174,11 @@ Sub muestraPromo(idPromo As String, cliente As String)
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'Agregamos los productos fijos a una lista para despues meterlos en el pedido.
|
'Agregamos los productos fijos a una lista para despues meterlos en el pedido.
|
||||||
Sub agregaFijosALista(idPromo As String, addListItem As Boolean)
|
Sub agregaFijosALista(mp As Map, addListItem As Boolean)
|
||||||
Private thisLog As Boolean = False
|
Private thisLog As Boolean = False
|
||||||
Private cont As Int = 0
|
Private cont As Int = 0
|
||||||
prodsFijosTot = 0
|
prodsFijosTot = 0
|
||||||
' Dim pf As List = mp.Get("prodsFijos")
|
Dim pf As List = mp.Get("prodsFijos")
|
||||||
Dim pf As List = promosC.traeListaDePromo("P_PRODSFIJOS", idPromo)
|
|
||||||
|
|
||||||
If pf.Size < 1 Then pf.Add("Sin productos fijos.")
|
If pf.Size < 1 Then pf.Add("Sin productos fijos.")
|
||||||
' Private m As Map
|
' Private m As Map
|
||||||
' prodsMap.Put(estaPromo, CreateMap("cant":1, "precio":0))
|
' prodsMap.Put(estaPromo, CreateMap("cant":1, "precio":0))
|
||||||
@@ -213,15 +191,13 @@ Sub agregaFijosALista(idPromo As String, addListItem As Boolean)
|
|||||||
prodsPrecios.Add(0)
|
prodsPrecios.Add(0)
|
||||||
For Each p As String In pf
|
For Each p As String In pf
|
||||||
' Log($"cont=${cont}, mp=${mp}"$)
|
' Log($"cont=${cont}, mp=${mp}"$)
|
||||||
Private prodsFijosPiezas As List = promosC.traeListaDePromo("P_PRODSFIJOS_PIEZAS", idPromo)
|
If mp.Get("prodsFijosPiezas").As(List).Size > 0 Then
|
||||||
If prodsFijosPiezas.Size > 0 Then
|
Private tpi As String = mp.Get("prodsFijosPiezas").As(List).Get(cont)
|
||||||
Private tpi As String = prodsFijosPiezas.Get(cont)
|
|
||||||
Else
|
Else
|
||||||
Private tpi As String = 0
|
Private tpi As String = 0
|
||||||
End If
|
End If
|
||||||
Private prodsFijosPrecios As List = promosC.traeListaDePromo("P_PRODSFIJOS_PRECIOS", idPromo)
|
If mp.Get("prodsFijosPrecios").As(List).Size > 0 Then
|
||||||
If prodsFijosPrecios.Size > 0 Then
|
Private tpr As String = mp.Get("prodsFijosPrecios").As(List).Get(cont)
|
||||||
Private tpr As String = prodsFijosPrecios.Get(cont)
|
|
||||||
Else
|
Else
|
||||||
Private tpr As String = 0
|
Private tpr As String = 0
|
||||||
End If
|
End If
|
||||||
@@ -330,7 +306,7 @@ Sub cuentaProds
|
|||||||
prodsCants2.Clear
|
prodsCants2.Clear
|
||||||
prodsPrecios2.Clear
|
prodsPrecios2.Clear
|
||||||
lv_prodsFijos.Clear
|
lv_prodsFijos.Clear
|
||||||
agregaFijosALista(estapromo, True)
|
agregaFijosALista(Subs.traePromo(estaPromo, esteCliente), True)
|
||||||
' Log(prodsIds)
|
' Log(prodsIds)
|
||||||
Private tcpf As Float = 0 'Total de compra de productos fijos.
|
Private tcpf As Float = 0 'Total de compra de productos fijos.
|
||||||
For pf = 0 To prodsIds.Size - 1
|
For pf = 0 To prodsIds.Size - 1
|
||||||
|
|||||||
@@ -91,6 +91,6 @@ ModuleClosedNodes6=
|
|||||||
ModuleClosedNodes7=
|
ModuleClosedNodes7=
|
||||||
ModuleClosedNodes8=
|
ModuleClosedNodes8=
|
||||||
ModuleClosedNodes9=
|
ModuleClosedNodes9=
|
||||||
NavigationStack=C_Promos,cuentaProds,326,0,Subs,traeProdNombre,807,0,Subs,cuantosVariablesDisponiblesDB,1428,0,C_Productos,Class_Globals,0,0,Subs,revisaMaxPromosProdsVariablesPorInventario,1361,0,Promociones,procesaPromocion,30,0,Promociones,revisaMaxPromosProdsVariablesPorInventario,269,6,Promociones,traePromo,125,0,C_Promos,agregaFijosALista,233,6,C_Promos,muestraPromo,86,6
|
NavigationStack=C_Promos,B4XPage_Appear,70,0,C_Promos,b_terminar1_Click,490,0,C_Promos,revisaInvProdsVariables,456,0,C_Promos,muestraPromo,111,6,C_Promos,Class_Globals,0,0,C_Promos,et_promoCant_TextChanged,518,0,Promociones,traeListaDePromo,457,0,C_Clientes,Class_Globals,0,0,C_Productos,b_rechazar_Click,1004,0,C_Productos,lv_catalogos_ItemClick,304,0,C_Productos,PCLV_AddProds,279,0
|
||||||
SelectedBuild=0
|
SelectedBuild=0
|
||||||
VisibleModules=1,28,11,3,26,29,12,4,13
|
VisibleModules=1,28,11,3,26,29,12,4,13
|
||||||
|
|||||||
Reference in New Issue
Block a user