diff --git a/B4A/C_Productos.bas b/B4A/C_Productos.bas index 21f68c1..ddb33c0 100644 --- a/B4A/C_Productos.bas +++ b/B4A/C_Productos.bas @@ -537,7 +537,7 @@ Sub b_prodMas_Click End Sub Private Sub et_pCant_TextChanged (Old As String, New As String) - LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta) +' LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta) Try Dim index As Int = clv_productos.GetItemFromView(Sender) Dim pnl0 As B4XView = clv_productos.GetPanel(index) @@ -642,7 +642,7 @@ Sub ponProdsEnCero Private pProds As B4XView = p0.GetView(0) 'Panel p_prods Private cant1 As B4XView = pProds.GetView(2).GetView(3) Private x() As String = Regex.Split("\|", cant1.tag) 'El ultimo dato de cant1.tag es el id del producto. - If prodsVendidosList.IndexOf(x(x.Length-1)) > -1 Then 'Revisamos si el producto es en la tabla "PEDIDO". + If prodsVendidosList.IndexOf(x(x.Length-1)) > -1 And Subs.revisaProdFueraDePromo(x(x.Length-1)) Then 'Revisamos si el producto es en la tabla "PEDIDO" y si forma parte de una promoción. lVendido.Visible = True pProds.GetView(2).As(Panel).Visible = False Else diff --git a/B4A/Guna Vistas V3.1.b4a b/B4A/Guna Vistas V3.1.b4a index de295f4..7dcc63d 100644 --- a/B4A/Guna Vistas V3.1.b4a +++ b/B4A/Guna Vistas V3.1.b4a @@ -251,7 +251,7 @@ Version=12.8 #Region Project Attributes #ApplicationLabel: Guna Preventa #VersionCode: 1 - #VersionName: 4.10.27 + #VersionName: 4.10.28 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: portrait #CanInstallToExternalStorage: False diff --git a/B4A/Guna Vistas V3.1.b4a.meta b/B4A/Guna Vistas V3.1.b4a.meta index d058117..a307b3e 100644 --- a/B4A/Guna Vistas V3.1.b4a.meta +++ b/B4A/Guna Vistas V3.1.b4a.meta @@ -56,7 +56,7 @@ ModuleClosedNodes10= ModuleClosedNodes11= ModuleClosedNodes12=6 ModuleClosedNodes13= -ModuleClosedNodes14=17,18,20 +ModuleClosedNodes14=17,20 ModuleClosedNodes15= ModuleClosedNodes16= ModuleClosedNodes17=4 @@ -76,6 +76,6 @@ ModuleClosedNodes6=8,9,10,11 ModuleClosedNodes7= ModuleClosedNodes8= ModuleClosedNodes9= -NavigationStack=C_Clientes,Class_Globals,1,0,C_Principal,cargar_Click,924,0,C_Principal,JobDone,1143,0,Subs,bitacora,1309,0,C_Principal,Subir_Click,622,6,C_Cliente,Guardar_Click,1962,6,C_Cliente,p_pideGeoPass_Click,1095,0,C_Cliente,Class_Globals,423,0,C_Cliente,B4XPage_Appear,903,0,C_Cliente,GPS_LocationChanged,991,0 +NavigationStack=C_Cliente,p_pideGeoPass_Click,1095,0,C_Cliente,Class_Globals,423,0,C_Cliente,B4XPage_Appear,903,0,C_Productos,Class_Globals,13,0,C_Productos,et_pCant_TextChanged,533,0,Subs,traeUsuarioDeBD,738,0,C_Productos,cuentaProds,617,0,Subs,revisaProdFueraDePromo,1691,6,Subs,traeTablaProds,1686,0,C_Productos,ponProdsEnCero,632,6 SelectedBuild=0 -VisibleModules=23,24,4,5,13,14,25,9,19,10,2 +VisibleModules=23,24,4,5,13,14,25,9,19,10 diff --git a/B4A/Subs.bas b/B4A/Subs.bas index 347375d..9afb12d 100644 --- a/B4A/Subs.bas +++ b/B4A/Subs.bas @@ -1689,4 +1689,18 @@ Sub traeTablaProds(tipoventa As String) As String If tipoventa = "ABORDO" Or tipoventa = "PREVENTA" Then tablaProds = "cat_gunaprod" ' LogColor($"Tipo= ${tipoventa}, tabla=${tablaProds}"$, Colors.RGB(200,136,0)) Return tablaProds +End Sub + +'Revisa si el producto dado se encuentra en el pedido sin formar parte de una promoción. +'Regresa verdadero o falso. +Sub revisaProdFueraDePromo(prodId As String) As Boolean + Private fueraDePromo As Boolean = False + Private p As Cursor = Starter.skmt.ExecQuery($"select PE_CEDIS from PEDIDO where PE_PROID = '${prodId}' and PE_CEDIS in (select id_almacen from CAT_ALMACEN) and PE_CLIENTE = '${B4XPages.MainPage.cliente.la_cuenta.text}'"$) + Log("rowcount: " & p.RowCount) + If p.RowCount > 0 Then + p.Position = 0 +' Log($"|${p.GetString("PE_CEDIS")}|${prodId}|"$) + fueraDePromo = True + End If + Return fueraDePromo End Sub \ No newline at end of file