- Cambios en el codigo de promocion.

- Cambios en el codigo del listview de servidores en el engrane
This commit is contained in:
2024-04-18 18:01:43 -06:00
parent 25b16f0b25
commit 047d927224
5 changed files with 15 additions and 10 deletions

View File

@@ -968,8 +968,9 @@ End Sub
Sub traeMaxPromos(pm As Map) As Int
Private thisLog As Boolean = False 'Si es verdadero, muestra los logs de este sub.
Private maxPromos As List
Private mp0, mp As String = "0"
Private mp0 As String = "0", mp As String = "0"
maxPromos.Initialize
Log("mp:" & maxPromos)
Private hccp As Cursor = Starter.skmt.ExecQuery($"select HCCP_CANT from HIST_CLIENTE_CANT_PROMOS where HCCP_CLIENTE = '${traeCliente}' and HCCP_PROMO = '${pm.Get("id")}'"$)
' Log($"select HCCP_CANT from HIST_CLIENTE_CANT_PROMOS where HCCP_CLIENTE = '${traeCliente}' and HCCP_PROMO = '${pm.Get("id")}'"$)
' If hccp.RowCount > 0 Then
@@ -981,15 +982,19 @@ Sub traeMaxPromos(pm As Map) As Int
If thisLog Then LogColor("==== HISTORICO:"&pm.Get("historico"), Colors.Red)
If thisLog Then Log(pm)
If pm.Get("historico") = "1" Then maxPromos.Add(pm.Get("maxRecurrente")) 'Si hay historico, agregamos maxRecurrente
maxPromos.Add(pm.Get("maxPromos")) 'Agregamos maxPromos
maxPromos.Add(pm.Get("maxXcliente")) 'Agregamos maxXcliente
If pm.Get("maxPromos") <> Null Then maxPromos.Add(pm.Get("maxPromos")) 'Agregamos maxPromos
If pm.Get("maxXcliente") <> Null Then maxPromos.Add(pm.Get("maxXcliente")) 'Agregamos maxXcliente
Log(hccp.RowCount)
If hccp.RowCount > 0 Then 'Agregamos promos HCCP
hccp.Position = 0
maxPromos.Add(hccp.GetString("HCCP_CANT"))
End If
maxPromos.Sort(True)
Log(maxPromos)
If maxPromos.Size > 0 Then
maxPromos.Sort(True)
mp0 = maxPromos.Get(0)
End If
If thisLog Then Log(maxPromos)
mp0 = maxPromos.Get(0)
mp = mp0 - traePromosVendidas(pm.Get("id"), traeCliente)
If thisLog Then Log($"Max Promos (${mp0}) - promos vendidas (${(traePromosVendidas(pm.Get("id"), traeCliente)).As(Int)}) = ${mp}"$)
Return mp 'Regresamos el numero mas pequeño de las opciones.