mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-18 02:29:13 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f5fe4c4a52 |
@@ -974,8 +974,6 @@ Private Sub cb_cartaPorte_CheckedChange(Checked As Boolean)
|
||||
Starter.skmt.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('CARTAPORTE', '${Checked}')"$)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
private Sub l_geocerca_Click
|
||||
If cb_geocerca.Enabled = False Then ToastMessageShow("Ingrese la contraseña para modificar", True)
|
||||
End Sub
|
||||
|
||||
@@ -796,8 +796,8 @@ Sub B4XPage_Appear
|
||||
Log(">>>> GUARDAMOS PROMOXMONTO PRODS")
|
||||
Subs.guardaProductoSinGestion(mPromoXMonto.Get("id"), dp.GetString("CAT_DP_PRECIO"), dp.GetString("CAT_DP_PZAS"), Subs.traeProdNombre(dp.GetString("CAT_DP_IDPROD")), dp.GetString("CAT_DP_IDPROD"), Subs.traeCliente, Subs.traeFecha, Subs.traeUsuarioDeBD, Subs.traeRuta, 0, Starter.tipov)
|
||||
' Traemos el monto de las bonificacionos a guardar. -- Trade Spending
|
||||
Log("Monto Bonificacion -->> " & B4XPages.MainPage.promos.ts.traeMontoBonificacion(dp.GetString("CAT_DP_IDPROD"), dp.GetString("CAT_DP_PRECIO"), mPromoXMonto.Get("id")))
|
||||
elMontoTSDeLaVenta = elMontoTSDeLaVenta + (B4XPages.MainPage.promos.ts.traeMontoBonificacion(dp.GetString("CAT_DP_IDPROD"), dp.GetString("CAT_DP_PRECIO"), mPromoXMonto.Get("id")) * dp.GetString("CAT_DP_PZAS"))
|
||||
Log("Monto Bonificacion -->> " & B4XPages.MainPage.promos.ts.traeMontoBonificacion(dp.GetString("CAT_DP_IDPROD"), dp.GetString("CAT_DP_PRECIO"), mPromoXMonto.Get("id"),"LOG_APPEAR1"))
|
||||
elMontoTSDeLaVenta = elMontoTSDeLaVenta + (B4XPages.MainPage.promos.ts.traeMontoBonificacion(dp.GetString("CAT_DP_IDPROD"), dp.GetString("CAT_DP_PRECIO"), mPromoXMonto.Get("id"), "APPEAR2") * dp.GetString("CAT_DP_PZAS"))
|
||||
End If
|
||||
Next
|
||||
B4XPages.MainPage.promos.ts.modTrendSpending("RESTA", "BONIFICACIONES", elMontoTSDeLaVenta)
|
||||
|
||||
@@ -564,7 +564,7 @@ Private Sub b_terminar1_Click
|
||||
|
||||
' ' Asumimos que el índice 0 es el encabezado de la promoción (estaPromo) y no tiene bonificación de producto.
|
||||
If t > 0 Then
|
||||
Private bonificacion_monto As String = ts.traeMontoBonificacion(idProdFijo, prodsPrecio, estaPromo)
|
||||
Private bonificacion_monto As String = ts.traeMontoBonificacion(idProdFijo, prodsPrecio, estaPromo, "b_terminar1_Click")
|
||||
Log(bonificacion_monto)
|
||||
Log("elMontoTSDeLaVenta=" & elMontoTSDeLaVenta)
|
||||
Log($"${elMontoTSDeLaVenta} + (${bonificacion_monto} * ${cantProdFijo})"$)
|
||||
@@ -578,8 +578,8 @@ Private Sub b_terminar1_Click
|
||||
Private pn As String = Subs.traeProdNombre(prodsIds2.Get(t))
|
||||
Subs.guardaProductoSinGestion(estaPromo, prodsPrecios2.Get(t), prodsCants2.Get(t), pn, prodsIds2.Get(t), Subs.traeCliente, Subs.traeFecha, Subs.traeUsuarioDeBD, Subs.traeRuta, 0, Starter.tipov)
|
||||
' Traemos el monto de las bonificacionos a guardar. -- Trade Spending
|
||||
Log("Monto Bonificacion -->> " & ts.traeMontoBonificacion(prodsIds2.Get(t), prodsPrecios2.Get(t), estaPromo))
|
||||
elMontoTSDeLaVenta = elMontoTSDeLaVenta + (ts.traeMontoBonificacion(prodsIds2.Get(t), prodsPrecios2.Get(t), estaPromo) * prodsCants2.Get(t))
|
||||
Log("Monto Bonificacion -->> " & ts.traeMontoBonificacion(prodsIds2.Get(t), prodsPrecios2.Get(t), estaPromo, "LOG_b_terminar1_Click2"))
|
||||
elMontoTSDeLaVenta = elMontoTSDeLaVenta + (ts.traeMontoBonificacion(prodsIds2.Get(t), prodsPrecios2.Get(t), estaPromo, "b_terminar1_Click3") * prodsCants2.Get(t))
|
||||
Log("Acumulado: " & elMontoTSDeLaVenta)
|
||||
Next
|
||||
ts.modTrendSpending("RESTA", "BONIFICACIONES", elMontoTSDeLaVenta)
|
||||
@@ -606,7 +606,7 @@ Private Sub b_continuar_Click
|
||||
|
||||
' ' Asumimos que el índice 0 es el encabezado de la promoción (estaPromo) y no tiene bonificación de producto.
|
||||
If t > 0 Then
|
||||
Private bonificacion_monto As String = ts.traeMontoBonificacion(idProdFijo, prodsPrecio, estaPromo)
|
||||
Private bonificacion_monto As String = ts.traeMontoBonificacion(idProdFijo, prodsPrecio, estaPromo, "b_continuar_Click")
|
||||
Log(bonificacion_monto)
|
||||
Log("elMontoTSDeLaVenta=" & elMontoTSDeLaVenta)
|
||||
Log($"${elMontoTSDeLaVenta} + (${bonificacion_monto} * ${cantProdFijo})"$)
|
||||
@@ -620,8 +620,8 @@ Private Sub b_continuar_Click
|
||||
Private pn As String = Subs.traeProdNombre(prodsIds2.Get(t))
|
||||
Subs.guardaProductoSinGestion(estaPromo, prodsPrecios2.Get(t), prodsCants2.Get(t), pn, prodsIds2.Get(t), Subs.traeCliente, Subs.traeFecha, Subs.traeUsuarioDeBD, Subs.traeRuta, 0, Starter.tipov)
|
||||
' Traemos el monto de las bonificacionos a guardar. -- Trade Spending
|
||||
Log("Monto Bonificacion -->> " & ts.traeMontoBonificacion(prodsIds2.Get(t), prodsPrecios2.Get(t), estaPromo))
|
||||
elMontoTSDeLaVenta = elMontoTSDeLaVenta + (ts.traeMontoBonificacion(prodsIds2.Get(t), prodsPrecios2.Get(t), estaPromo) * prodsCants2.Get(t))
|
||||
Log("Monto Bonificacion -->> " & ts.traeMontoBonificacion(prodsIds2.Get(t), prodsPrecios2.Get(t), estaPromo, "LOG_b_continuar_Click2"))
|
||||
elMontoTSDeLaVenta = elMontoTSDeLaVenta + (ts.traeMontoBonificacion(prodsIds2.Get(t), prodsPrecios2.Get(t), estaPromo, "b_continuar_Click3") * prodsCants2.Get(t))
|
||||
Log("Acumulado: " & elMontoTSDeLaVenta)
|
||||
Next
|
||||
ts.modTrendSpending("RESTA", "BONIFICACIONES", elMontoTSDeLaVenta)
|
||||
|
||||
@@ -347,7 +347,7 @@ Sub traeBonificacionesMaximas(tipo As String, clienteId As String, id As String,
|
||||
If thisLog Then LogColor($" ============ INICIA BONIFICACIONES MAXIMAS (${id}) ========"$, Colors.RGB(0,197,110))
|
||||
If thisLog Then LogColor($" Presupuesto: ${TS_BONIFICACIONES(0)} - Acumulado ayer: ${TS_BONIFICACIONES(1)} - Hoy: ${traeAcumuladoHoyTS("bonificaciones")}"$, Colors.Magenta)
|
||||
If tipo.ToUpperCase = "BONIFICACIONES" Then
|
||||
tsMonto = NumberFormat2(traeMontoBonificacion(id, elPrecioVenta, promoId), 1, 2, 2, False)
|
||||
tsMonto = NumberFormat2(traeMontoBonificacion(id, elPrecioVenta, promoId, "traeBonificacionesMaximas"), 1, 2, 2, False)
|
||||
tsRestantes = (TS_BONIFICACIONES(0) - TS_BONIFICACIONES(1) - traeAcumuladoHoyTS("bonificaciones")) ' Traemos monto restante de Trend Spending para bonificaciones.
|
||||
Log($" PresupuestoBonifs: ${TS_BONIFICACIONES(0)}, AcumuladoBonifs: ${TS_BONIFICACIONES(1)}, traeAcumuladoHoyTS('bonificaciones'): ${traeAcumuladoHoyTS("bonificaciones")}"$)
|
||||
' Log($" ${TS_BONIFICACIONES(0)} - ${TS_BONIFICACIONES(1)} - ${traeAcumuladoHoyTS("bonificaciones")}"$)
|
||||
@@ -369,11 +369,11 @@ End Sub
|
||||
|
||||
' Trae el monto de la bonificacion, que es el precio original MENOS el precio de venta con descuento.
|
||||
' - 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, precio As String, promoId As String) As String
|
||||
' - Si CAT_DP_PRECIOB es 0, la bonificacion es: .
|
||||
Sub traeMontoBonificacion(id As String, precio As String, promoId As String, parent As String) As String
|
||||
Private thisLog As Boolean = True
|
||||
If thisLog Then LogColor($" ============ INICIA MONTO BONIFICACION (${id}) ========"$, Colors.RGB(151,0,171))
|
||||
If thisLog Then LogColor($" ###### ${promoId}, ${precio}, ${id}"$, Colors.Magenta)
|
||||
If thisLog Then LogColor($" ###### ${id}, ${precio}, ${promoId}, ${parent}"$, Colors.Magenta)
|
||||
Private tsMonto As String = 0
|
||||
Private re As Cursor = Starter.skmt.ExecQuery($"select cat_gp_id from cat_gunaprod2 where (cat_gp_tipo like 'REGALO%' or cat_gp_tipo like 'EXHIBIDOR%') and cat_gp_id = '${id}'"$) ' Revisamos si el producto es regalo o exhibidor.
|
||||
If re.RowCount = 0 Then' No es regalo ni exhibidor.
|
||||
@@ -382,6 +382,7 @@ Sub traeMontoBonificacion(id As String, precio As String, promoId As String) As
|
||||
If thisLog Then Log($" Rowcount DP y CGP2: ${c.RowCount}"$)
|
||||
If c.RowCount > 0 Then
|
||||
c.Position = 0
|
||||
LogColor($"Precio original:${c.GetString("CAT_GP_PRECIO")} - Precio Venta:${c.GetString("CAT_DP_PRECIO")}"$, Colors.Blue)
|
||||
If c.GetInt("CAT_DP_PRECIOB") = 1 Or (c.GetInt("CAT_DP_PRECIOB") = 0 And c.GetString("CAT_GP_PRECIO") = c.GetString("CAT_DP_PRECIO")) Then
|
||||
tsMonto = c.GetString("CAT_GP_PRECIO") - c.GetString("CAT_DP_PRECIO") ' Precio original - precio de venta.
|
||||
Else
|
||||
@@ -404,8 +405,9 @@ 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 = False
|
||||
Private logger As Boolean = True
|
||||
Private Maxs As Int = 10000000
|
||||
Private elPrecio As String = 0
|
||||
Private prodsVariablesXPresupuestoBonificaciones As List
|
||||
Private prodsVariablesRequeridos As Int = traeProdsVariablesRequeridos(promo)
|
||||
prodsVariablesXPresupuestoBonificaciones.Initialize
|
||||
@@ -413,8 +415,14 @@ Sub maxPromosPorProdsVariables(idProdsVariables As List, promo As String)As Int
|
||||
For i = 0 To idProdsVariables.Size - 1 'Obtenemos total de productos variables disponibes.
|
||||
If logger Then LogColor($"=>> prodVariable ${i} : ${idProdsVariables.Get(i)}, ${Subs.traeProdNombre(idProdsVariables.Get(i))} <<=="$, Colors.blue)
|
||||
' Log($"Este invDisponible: ${invDispParaPromo.Get(idProdsVariables.Get(i))}"$)
|
||||
If logger Then Log(">> Monto Bonificacion: " & traeMontoBonificacion(idProdsVariables.Get(i), 1, promo))
|
||||
Private maxProds As Int = traeBonificacionesMaximas("bonificaciones", traeCliente, idProdsVariables.Get(i), prodsVariablesRequeridos, 1, promo)
|
||||
' If logger Then Log(">> Monto Bonificacion: " & traeMontoBonificacion(idProdsVariables.Get(i), 1, promo))
|
||||
Private ep As Cursor = Starter.skmt.ExecQuery($"select cat_dp_precio from cat_detalles_paq where cat_dp_id = '${promo}' and cat_dp_idprod = '${idProdsVariables.Get(i)}'"$)
|
||||
If ep.RowCount > 0 Then
|
||||
ep.Position = 0
|
||||
Log("=========>>>> " & ep.GetString("CAT_DP_PRECIO"))
|
||||
elPrecio = ep.GetString("CAT_DP_PRECIO")
|
||||
End If
|
||||
Private maxProds As Int = traeBonificacionesMaximas("bonificaciones", traeCliente, idProdsVariables.Get(i), prodsVariablesRequeridos, elPrecio, promo)
|
||||
prodsVariablesXPresupuestoBonificaciones.Add(maxProds)
|
||||
Next
|
||||
prodsVariablesXPresupuestoBonificaciones.Sort(True)
|
||||
|
||||
@@ -918,7 +918,7 @@ Version=12.8
|
||||
#Region Project Attributes
|
||||
#ApplicationLabel: Kelloggs Venta
|
||||
#VersionCode: 3000
|
||||
#VersionName: 6.02.03
|
||||
#VersionName: 6.03.15
|
||||
#SupportedOrientations: portrait
|
||||
#CanInstallToExternalStorage: False
|
||||
#BridgeLogger:true
|
||||
|
||||
@@ -76,7 +76,7 @@ ModuleClosedNodes12=
|
||||
ModuleClosedNodes13=42
|
||||
ModuleClosedNodes14=
|
||||
ModuleClosedNodes15=
|
||||
ModuleClosedNodes16=1,2,7,8,9
|
||||
ModuleClosedNodes16=2,7,8,9
|
||||
ModuleClosedNodes17=
|
||||
ModuleClosedNodes18=
|
||||
ModuleClosedNodes19=
|
||||
@@ -103,6 +103,6 @@ ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
ModuleClosedNodes8=
|
||||
ModuleClosedNodes9=
|
||||
NavigationStack=C_Cliente,JobDone,4283,0,C_Principal,enviaPedidoBatch0,3517,0,C_Principal,SUBIR_INFO_PEDIDO,3519,0,C_Principal,enviaPedidoBatch,3619,0,C_Cliente,Guardar_Click,1084,0,C_Cliente,mandaPendientes,1099,0,C_TrendSpending,traeInfoTrendSpending,75,0,C_Principal,JobDone,2243,0,Diseñador Visual,principal.bal,-100,1,C_Principal,cargar_Click,1030,0,C_Principal,B4XPage_Appear,555,0
|
||||
NavigationStack=B4XMainPage,ImageView1_LongClick,1073,0,C_Productos,lv_catalogos_ItemClick,357,0,C_Principal,Subir_Click,688,0,C_Principal,enviaPedidoBatch,3520,0,C_Principal,SUBIR_INFO_PEDIDO,3516,0,C_Productos,Class_Globals,32,0,C_Productos,b_prodMas_Click,845,0,Subs,actualizaProducto,966,2,Subs,guardaProducto,896,0,Subs,traeInvDeBD,893,0,Subs,traeUsuarioDeBD,881,0
|
||||
SelectedBuild=0
|
||||
VisibleModules=32,1,13,4,33,16,34,14,15,18
|
||||
|
||||
@@ -975,7 +975,7 @@ Sub actualizaProducto(cedis As String, costoU As String, cant As String, nombre
|
||||
Private antCant As Int = 0
|
||||
If IsNumber(c.GetInt("PE_CANT")) Then antCant=c.GetInt("PE_CANT")
|
||||
Private difCant As Int = cant - antCant
|
||||
Starter.skmt.ExecNonQuery($"update pedido set pe_cant = ${cant}, pe_costou = ${costoU}, pe_costo_tot = ${NumberFormat2((cant*c.GetString("PE_COSTOU")), 1, 2, 2, False)}, pe_tipo = '${tipoVenta}' where pe_cedis = '${cedis}' and pe_proid = '${prodId}' and pe_cliente = '${clienteId}' "$)
|
||||
Starter.skmt.ExecNonQuery($"update pedido set pe_cant = ${cant}, pe_costou = ${costoU}, pe_costo_tot = ${NumberFormat2((cant*c.GetString("PE_COSTOU")), 1, 2, 2, False)}, pe_tipo = '${tipoVenta}', pe_enviado = 0 where pe_cedis = '${cedis}' and pe_proid = '${prodId}' and pe_cliente = '${clienteId}' "$)
|
||||
If cedis <> "DUR" Then Starter.skmt.ExecNonQuery($"update ${traeTablaProds(tipoVenta)} set cat_gp_almacen = cat_gp_almacen - (${difCant}) where cat_gp_id = '${prodId}' "$)
|
||||
If cant = 0 Then
|
||||
LogColor($"BORRAMOS PRODUCTO - ${prodId}"$, Colors.Red)
|
||||
@@ -1219,7 +1219,7 @@ Sub traeMaxPromos(pm As Map) As Int
|
||||
' If thisLog Then LogColor("==== Historico: "&pm.Get("historico"), Colors.Red)
|
||||
' Log("### PRODS VARIABLES: " & pm.Get("prodsVariables"))
|
||||
Private maxPromosXDescPV As String = B4XPages.MainPage.promos.ts.maxPromosPorProdsVariables(pm.Get("prodsVariables"), pm.Get("id"))
|
||||
' Log("########### " & maxPromosXDescPV)
|
||||
Logcolor("########### maxPromosXDescPV " & maxPromosXDescPV, Colors.Yellow)
|
||||
' If thisLog Then Log(pm)
|
||||
maxPromos.Add(maxPromosXDescPV.As(Int))
|
||||
If pm.Get("historico") = "1" Then maxPromos.Add(pm.Get("maxRecurrente")) 'Si hay historico, agregamos maxRecurrente
|
||||
@@ -1385,7 +1385,7 @@ Sub revisaMaxPromosProdsFijosPorInventario(pm As Map) As Int
|
||||
t.Add(x(0).As(Int)) 'Solo guardamos la parte del entero de la division. (promos por inventario)
|
||||
' If thisLog Then LogColor($" ### T: ${t}"$, Colors.Green) 'promos por inventario
|
||||
If thisLog Then LogColor($" >>>>> PROMOS X PRODS FIJOS (${idProdsFijos.Get(p)}): ${x(0)} <<<<<"$, Colors.red)
|
||||
Log($" >>>>> Monto Bonificacion FIJOS (${idProdsFijos.Get(p)}): "$ & B4XPages.MainPage.promos.ts.traeMontoBonificacion(idProdsFijos.Get(p), idProdsFijosPrecios.Get(p), pm.Get("id")))
|
||||
Log($" >>>>> Monto Bonificacion FIJOS (${idProdsFijos.Get(p)}): "$ & B4XPages.MainPage.promos.ts.traeMontoBonificacion(idProdsFijos.Get(p), idProdsFijosPrecios.Get(p), pm.Get("id"),"LOG_revisaMaxPromosProdsFijosPorInventario"))
|
||||
If thisLog Then LogColor(" >> MAX PRODS FIJOS X BONIFICACIONES: " & B4XPages.MainPage.promos.ts.traeBonificacionesMaximas("bonificaciones", clienteActual, idProdsFijos.Get(p), prodsFijosPiezas.Get(p), idProdsFijosPrecios.Get(p), pm.Get("id")), Colors.blue)
|
||||
t.Add(B4XPages.MainPage.promos.ts.traeBonificacionesMaximas("bonificaciones", clienteActual, idProdsFijos.Get(p), prodsFijosPiezas.Get(p), idProdsFijosPrecios.Get(p), pm.Get("id"))) 'Agregamos las promos disponibles por Trade Spending
|
||||
If thisLog Then LogColor($" ### PROMOS X INV: ${t}"$, Colors.Green) 'promos por inventario
|
||||
@@ -1594,7 +1594,7 @@ Sub borraPedidoClienteActual As String
|
||||
Log("precioConDesc: " & precioConDesc)
|
||||
Log(">>>>>>>>>>>>> " & (precioConDesc * thisC.GetString("PE_CANT")))
|
||||
If Not(IsNumber(thisC.GetString("PE_CEDIS"))) Then ' Si es promo, entonces es bonificacion.
|
||||
Private desc As String = B4XPages.MainPage.promos.ts.traeMontoBonificacion(thisC.GetString("PE_PROID"), thisC.GetString("PE_COSTOU"), thisC.GetString("PE_CEDIS"))
|
||||
Private desc As String = B4XPages.MainPage.promos.ts.traeMontoBonificacion(thisC.GetString("PE_PROID"), thisC.GetString("PE_COSTOU"), thisC.GetString("PE_CEDIS"),"borraPedidoClienteActual")
|
||||
desc = desc * thisC.GetString("PE_CANT")
|
||||
Log("Regresamos bonificaciones " & thisC.GetString("PE_PROID") & "=" & desc)
|
||||
modTrendSpending("suma", "bonificaciones", desc)
|
||||
|
||||
Reference in New Issue
Block a user