mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-20 03:29:14 +00:00
- VERSION 5.10.01
- Se agregó el mandaPendientes en el boton de "Guardar" de "Cliente"
This commit is contained in:
@@ -325,23 +325,24 @@ End Sub
|
||||
' Trae la cantidad máxima de productos con bonificacion por presupuesto.
|
||||
' Si el presupuesto es 10 y la bonificacion del producto es 2, el máximo es 5 productos.
|
||||
Sub traeBonificacionesMaximas(tipo As String, clienteId As String, id As String, laCant As String, promoId As String) As Int
|
||||
Private thisLog As Boolean = False
|
||||
Private tsMaximas As Int = 10000000
|
||||
Private tsRestantes As String = 0
|
||||
Private tsMonto As String
|
||||
LogColor($"Presupuesto: ${TS_BONIFICACIONES(0)} - Acumulado ayer: ${TS_BONIFICACIONES(1)} - Hoy: ${traeAcumuladoHoyTS("bonificaciones")}"$, Colors.Red)
|
||||
If thisLog Then LogColor($"Presupuesto: ${TS_BONIFICACIONES(0)} - Acumulado ayer: ${TS_BONIFICACIONES(1)} - Hoy: ${traeAcumuladoHoyTS("bonificaciones")}"$, Colors.Red)
|
||||
If tipo.ToUpperCase = "BONIFICACIONES" Then
|
||||
tsMonto = NumberFormat2(traeMontoBonificacion(id, promoId), 1, 2, 2, False)
|
||||
tsRestantes = (TS_BONIFICACIONES(0) - TS_BONIFICACIONES(1) - traeAcumuladoHoyTS("bonificaciones")) ' Traemos monto restante de Trend Spending para bonificaciones.
|
||||
End If
|
||||
Log($"Monto de bonificacion: ${tsMonto}"$)
|
||||
Log($"Presupuesto disponible: ${tsRestantes}"$)
|
||||
Log($"Cantidad: ${laCant}"$)
|
||||
Log($"Floor(tsRestantes / (tsMonto * laCant))= ${Floor(tsRestantes / (tsMonto * laCant))}"$)
|
||||
Log($"Floor(${tsRestantes} / (${tsMonto} * ${laCant}))= ${Floor(tsRestantes / (tsMonto * laCant))}"$)
|
||||
If thisLog Then Log($"Monto de bonificacion: ${tsMonto}"$)
|
||||
If thisLog Then Log($"Presupuesto disponible: ${tsRestantes}"$)
|
||||
If thisLog Then Log($"Cantidad: ${laCant}"$)
|
||||
If thisLog Then Log($"Floor(tsRestantes / (tsMonto * laCant))= ${Floor(tsRestantes / (tsMonto * laCant))}"$)
|
||||
If thisLog Then Log($"Floor(${tsRestantes} / (${tsMonto} * ${laCant}))= ${Floor(tsRestantes / (tsMonto * laCant))}"$)
|
||||
If tsMonto > 0 Then
|
||||
tsMaximas = Floor(tsRestantes / (tsMonto * laCant))
|
||||
End If
|
||||
Log(">>> tsMaximas: " & tsMaximas)
|
||||
If thisLog Then Log(">>> tsMaximas: " & tsMaximas)
|
||||
Return tsMaximas
|
||||
End Sub
|
||||
|
||||
@@ -349,6 +350,7 @@ End Sub
|
||||
' - Si CAT_DP_PRECIOB es 1, la bonificacion es: Precio original - precio de venta.
|
||||
' - Si CAT_DP_PRECIOB es 0, la bonificacion es: Precio original.
|
||||
Sub traeMontoBonificacion(id As String, promoId As String) As String
|
||||
private thisLog as boolean = False
|
||||
' Log(promoId)
|
||||
Private tsMonto As String = 0
|
||||
Private c As Cursor = tsdb.ExecQuery($"SELECT CAT_DP_ID, CAT_DP_IDPROD, CAT_DP_PRECIO, CAT_DP_TIPO, CAT_GP_PRECIO, CAT_DP_PRECIOB FROM CAT_DETALLES_PAQ join ${traeTablaProds(Starter.tipov)} on CAT_GP_ID = CAT_DP_IDPROD where CAT_GP_ID = '${id}' and CAT_DP_ID = '${promoId}'"$)
|
||||
@@ -360,7 +362,7 @@ Sub traeMontoBonificacion(id As String, promoId As String) As String
|
||||
tsMonto = c.GetString("CAT_GP_PRECIO") ' Precio original.
|
||||
End If
|
||||
' Log("PRECIOB: " & c.GetInt("CAT_DP_PRECIOB"))
|
||||
Log($"Precio normal: ${c.GetString("CAT_GP_PRECIO")}, Precio desc: ${c.GetString("CAT_DP_PRECIO")}, Monto bonificacion: ${tsMonto}"$)
|
||||
If thisLog Then Log($"Precio normal: ${c.GetString("CAT_GP_PRECIO")}, Precio desc: ${c.GetString("CAT_DP_PRECIO")}, Monto bonificacion: ${tsMonto}"$)
|
||||
End If
|
||||
' Log("ROWCOUNT: " & c.RowCount)
|
||||
Return tsMonto
|
||||
@@ -374,7 +376,7 @@ End Sub
|
||||
' se agoto el presupuesto.
|
||||
' Aunque si hay suficiente para mostrar algunas promos ... pues que si las muestre.
|
||||
Sub maxPromosPorProdsVariables(idProdsVariables As List, promo As String)As Int
|
||||
Private logger As Boolean = True
|
||||
Private logger As Boolean = False
|
||||
Private Maxs As Int = 10000000
|
||||
Private prodsVariablesXPresupuestoBonificaciones As List
|
||||
Private prodsVariablesRequeridos As Int = traeProdsVariablesRequeridos(promo)
|
||||
|
||||
Reference in New Issue
Block a user