mirror of
https://github.com/KeymonSoft/Durakelo.git
synced 2026-04-17 19:36:12 +00:00
...
This commit is contained in:
15
B4A/Subs.bas
15
B4A/Subs.bas
@@ -968,9 +968,8 @@ 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 As String = "0", mp As String = "0"
|
||||
Private mp0, 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
|
||||
@@ -982,19 +981,15 @@ 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
|
||||
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)
|
||||
maxPromos.Add(pm.Get("maxPromos")) 'Agregamos maxPromos
|
||||
maxPromos.Add(pm.Get("maxXcliente")) 'Agregamos maxXcliente
|
||||
If hccp.RowCount > 0 Then 'Agregamos promos HCCP
|
||||
hccp.Position = 0
|
||||
maxPromos.Add(hccp.GetString("HCCP_CANT"))
|
||||
End If
|
||||
Log(maxPromos)
|
||||
If maxPromos.Size > 0 Then
|
||||
maxPromos.Sort(True)
|
||||
mp0 = maxPromos.Get(0)
|
||||
End If
|
||||
maxPromos.Sort(True)
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user