- VERSION 4.07.16

- Se agregó el codigo de promociones segmentadas a "Subs.traePromo".
- Se cambió el tamaño de las etiquetas de "lv_promos" para que no se amontone el texto.
- Se cambió el tamaño y posicion de "lv_promos" para que quede mas centrado.
This commit is contained in:
Jose Alberto Guerra Ugalde
2024-07-19 13:44:39 -06:00
parent cf7e180dfb
commit 1c50207b86
5 changed files with 30 additions and 7 deletions

View File

@@ -223,13 +223,13 @@ Sub lv_catalogos_ItemClick (Position As Int, Value As Object)
lfila.text = "PROMOCIONES"
lv_catalogos.Visible = False
lv_promos.Clear
lv_promos.TwoLinesLayout.ItemHeight =80dip
Dim label1 As Label
Dim label1 As B4XView
label1 = lv_promos.TwoLinesLayout.Label
label1.Height = 50dip
label1.TextSize = 15
label1.TextColor = Colors.Black
label1.Gravity = 3
label1.SetTextAlignment("CENTER", "LEFT")
lv_promos.TwoLinesLayout.ItemHeight = 60dip
label1.Height = 40dip
Dim label2 As Label
label2 = lv_promos.TwoLinesLayout.SecondLabel
label2.Top = label1.Height

Binary file not shown.

View File

@@ -1093,7 +1093,7 @@ Version=12.8
#Region Project Attributes
#ApplicationLabel: Mariana
#VersionCode: 1
#VersionName: 4.06.01
#VersionName: 4.07.16
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False

View File

@@ -82,6 +82,6 @@ ModuleClosedNodes6=
ModuleClosedNodes7=
ModuleClosedNodes8=
ModuleClosedNodes9=
NavigationStack=Subs,traeAlmacen,691,0,Diseñador Visual,cliente.bal,-100,1,Diseñador Visual,clientes.bal,-100,6,C_Productos,lv_catalogos_ItemClick,228,6,C_Productos,b_terminar1_Click,592,3,C_Principal,Subir_Click,516,0,C_Principal,connecta_Click,1838,0,C_Subs,CreateNotification,463,0,C_Subs,notiLowReturn,486,0,C_Principal,B4XPage_Appear,432,0,B4XMainPage,B4XPage_Created,211,0
NavigationStack=C_Principal,Subir_Click,516,0,C_Principal,connecta_Click,1838,0,C_Subs,CreateNotification,463,0,C_Subs,notiLowReturn,486,0,C_Principal,B4XPage_Appear,432,0,B4XMainPage,B4XPage_Created,211,0,Subs,getPhnId,19,0,Subs,traePromo,847,0,Visual Designer,productos.bal,-100,1,C_Productos,lv_catalogos_ItemClick,230,6,C_Principal,Class_Globals,0,0
SelectedBuild=0
VisibleModules=2,12,4,5,6,26,10,16,8,13,9,17
VisibleModules=2,12,4,5,6,26,10,16,8,13

View File

@@ -814,6 +814,7 @@ End Sub
' resultado="OK" 'Ok si existe la promocion.
' prodsVariablesRequeridos=5} 'Cantidad de productos variables requeridos para la promoción.
Sub traePromo(promo As String, cliente As String) As Map
Private thisLog As Boolean = True
Private inicioContador As String = DateTime.Now
Private c As Cursor = Starter.skmt.ExecQuery("Select * from promos_comp where cat_pa_id = '"& promo&"'") 'Obtenemos las el maximo de promocioones a otorgar.
Private siHistorico As String = 0
@@ -826,7 +827,29 @@ Sub traePromo(promo As String, cliente As String) As Map
prodsVariables.Initialize
prodsVariablesPrecios.Initialize
c.Position = 0
promoMap = CreateMap("id":promo, "maxXcliente":0, "maxRecurrente":0, "maxPromos":0) 'Ponemos el DEFAULT en CERO. MOD by CHV 11/jul/24
If c.RowCount > 0 Then promoMap = CreateMap("id":promo, "maxXcliente":c.GetString("CAT_PA_MAXPROMCLIE"), "maxRecurrente":c.GetString("CAT_PA_MAXPROMREC"), "maxPromos":c.GetString("CAT_PA_MAXPROM"))
'######### PROMOCIONES SEGMENTADAS ##########
' Si la promo esta en la lista, SOLO los clientes que la tengan la pueden ver.
Private ps As Cursor = Starter.skmt.ExecQuery($"select * from HIST_CLIENTE_CANT_PROMOS where HCCP_PROMO = '${promo}'"$)
' Log($"select * from HIST_CLIENTE_CANT_PROMOS where HCCP_PROMO = '${promo}'"$)
If ps.RowCount > 0 Then LogColor($"ES PROMO SEGMENTADA"$, Colors.red) Else LogColor($"NO ES PROMO SEGMENTADA"$, Colors.red)
If ps.RowCount > 0 Then
ps.Position = 0
promoMap = CreateMap("id":promo, "maxXcliente":0, "maxRecurrente":0, "maxPromos":0) 'Si es segmentada la ponemos en cero, porque SOLO le debe de aparecer a ciertos clientes.
If thisLog Then Log($">>> PROMO "${promo}" SEGMENTADA PARA EL CLIENTE ${ps.GetString("HCCP_CLIENTE")}"$)
' Select hccp_cliente As valido from HIST_CLIENTE_CANT_PROMOS where HCCP_PROMO = '${promo}' and HCCP_CLIENTE = '${traecliente}'
Private ps2 As Cursor = Starter.skmt.ExecQuery($"Select *, ifnull(HCCP_CANT_VENDIDA, 0) as HCCP_CANT_VENDIDA from HIST_CLIENTE_CANT_PROMOS where HCCP_PROMO = '${promo}' and HCCP_CLIENTE = '${cliente}' and HCCP_CANT > ifnull(HCCP_CANT_VENDIDA, 0)"$)
' Log($"Select * from HIST_CLIENTE_CANT_PROMOS where HCCP_PROMO = '${promo}' and HCCP_CLIENTE = '${traeCliente}' and HCCP_CANT > HCCP_CANT_VENDIDA"$)
' Log($"registros:${ps2.RowCount}"$)
If ps2.RowCount > 0 Then
ps2.Position = 0
If thisLog Then Log($"registros:${ps2.RowCount}, cliente: ${ps2.GetString("HCCP_CLIENTE")} cant:${ps2.GetString("HCCP_CANT")}"$)
promoMap = CreateMap("id":promo, "maxXcliente":(ps2.GetString("HCCP_CANT")-ps2.GetString("HCCP_CANT_VENDIDA")), "maxRecurrente":ps2.GetString("HCCP_CANT"), "maxPromos":ps2.GetString("HCCP_CANT")) 'Si es segmentada SOLO le aparece a ciertos clientes.
End If
End If
If thisLog Then Log(promoMap)
' ########## TERMINA PROMOS SEGMENTADAS ##########
c = Starter.skmt.ExecQuery("Select count(*) as hist from HIST_PROMOS where HP_CLIENTE = '"& cliente & "' and HP_CODIGO_PROMOCION = '" & promo & "'") 'Revisamos si hay historico de la promoción.
c.Position = 0
If c.GetString("hist") > 0 Then siHistorico = 1