- VERSION 4.10.28

- Se arregló que cuando se agregaba un apromocion, los productoa de esa promocion aparecian como vendidos!!
This commit is contained in:
Jose Alberto Guerra Ugalde
2024-10-29 10:55:27 -06:00
parent d49ef2d100
commit 87fd48c02f
4 changed files with 20 additions and 6 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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