- VERSION 5.09.30

- Se corrigio que cuando se entraba a productos a veces se perdian los productos YA seleccionados.
This commit is contained in:
2025-10-01 12:12:11 -06:00
parent ec467d0d5f
commit ffcd98543d
4 changed files with 32 additions and 15 deletions

View File

@@ -296,7 +296,10 @@ Sub llenaCatalogo(limpiar As Boolean)
Log("LlenaCatalogo") Log("LlenaCatalogo")
If limpiar Then clv_productos.Clear If limpiar Then clv_productos.Clear
Private c2 As Cursor Private c2 As Cursor
c2 = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG, CAT_GP_TIPOPROD, CAT_GP_INICIATIVA from cat_gunaprod where CAT_GP_PRECIO > 0 AND CAT_GP_ALMACEN > 0 and CAT_GP_TIPOPROD <> 'PROMOS' Private cp As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG, CAT_GP_TIPOPROD, CAT_GP_INICIATIVA from cat_gunaprod where CAT_GP_ID in (select pe_proid from pedido where pe_cliente = '${Subs.traeCliente}')"$)
c2 = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG, CAT_GP_TIPOPROD, CAT_GP_INICIATIVA from cat_gunaprod where
CAT_GP_PRECIO > 0 AND CAT_GP_ALMACEN > 0 and CAT_GP_TIPOPROD <> 'PROMOS'
and CAT_GP_ID not in (select pe_proid from pedido where pe_cliente = '${Subs.traeCliente}')
order by order by
Case CAT_GP_TIPOPROD when 'PRIORITARIO' THEN 0 Case CAT_GP_TIPOPROD when 'PRIORITARIO' THEN 0
WHEN 'ESTRATEGICO' THEN 1 WHEN 'ESTRATEGICO' THEN 1
@@ -304,17 +307,30 @@ Sub llenaCatalogo(limpiar As Boolean)
Else 3 Else 3
End, CAT_GP_NOMBRE"$) End, CAT_GP_NOMBRE"$)
' Select cAT_GP_ID, cat_gp_tipoprod from cat_gunaprod order by
' Case CAT_GP_TIPOPROD
' When 'PRIORITARIO' THEN 0
' WHEN 'ESTRATEGICO' THEN 1
' WHEN 'CATALOGO REGULAR' then 2
' Else 3
' End
Private bgColor, textColor As Int Private bgColor, textColor As Int
If c2.RowCount > 0 And clv_productos.Size <> c2.RowCount Then
Private cuantosProds = cp.RowCount + c2.RowCount
If cp.RowCount > 0 And clv_productos.Size <> cuantosProds Then
clv_productos.Clear : Log("limpiamos productos") clv_productos.Clear : Log("limpiamos productos")
For i=0 To cp.RowCount -1
cp.Position=i
If cp.GetString("CAT_GP_TIPOPROD") = "PRIORITARIO" Then
bgColor = Colors.RGB(255, 212, 163) 'naranja
Else If cp.GetString("CAT_GP_TIPOPROD") = "COMPLEMENTARIO" Then
bgColor = Colors.RGB(177, 200, 249)'azul
else If cp.GetString("CAT_GP_TIPOPROD") = "CATALOGO REGULAR" Then
bgColor = Colors.White
else If cp.GetString("CAT_GP_TIPOPROD") = "ESTRATEGICO" Then
bgColor = Colors.RGB(241, 255, 163) 'amarillo
End If
textColor = Colors.Black
clv_productos.Add(CreateListItem(cp.GetString("CAT_GP_NOMBRE"), cp.GetString("CAT_GP_PRECIO"), cp.GetString("CAT_GP_ALMACEN"), clv_productos.AsView.Width, 50dip, bmp, cp.GetString("CAT_GP_ID"), bgColor, textColor), cp.GetString("CAT_GP_NOMBRE"))
Next
End If
If c2.RowCount > 0 And clv_productos.Size <> cuantosProds Then
' clv_productos.Clear : Log("limpiamos productos")
For i=0 To c2.RowCount -1 For i=0 To c2.RowCount -1
c2.Position=i c2.Position=i
If c2.GetString("CAT_GP_TIPOPROD") = "PRIORITARIO" Then If c2.GetString("CAT_GP_TIPOPROD") = "PRIORITARIO" Then
@@ -331,6 +347,7 @@ Sub llenaCatalogo(limpiar As Boolean)
Next Next
End If End If
ponProdsEnCero ponProdsEnCero
cp.Close
c2.Close c2.Close
End Sub End Sub

View File

@@ -187,7 +187,7 @@ Version=12.8
#Region Project Attributes #Region Project Attributes
#ApplicationLabel: Disruptive #ApplicationLabel: Disruptive
#VersionCode: 1 #VersionCode: 1
#VersionName: 4.09.08 #VersionName: 5.09.30
'SupportedOrientations possible values: unspecified, landscape or portrait. 'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait #SupportedOrientations: portrait
#CanInstallToExternalStorage: False #CanInstallToExternalStorage: False

View File

@@ -70,6 +70,6 @@ ModuleClosedNodes6=
ModuleClosedNodes7= ModuleClosedNodes7=
ModuleClosedNodes8= ModuleClosedNodes8=
ModuleClosedNodes9= ModuleClosedNodes9=
NavigationStack=C_Productos,CreateListItem,443,0,C_Productos,llenaCatalogo,288,0,C_Productos,B4XPage_Appear,96,1,C_Productos,lv_catalogos_ItemClick,132,0,C_Productos,b_buscar_Click,640,0,C_Productos,Class_Globals,6,0,C_Productos,BUSCA_TextChanged,403,5,appUpdater,Process_Globals,74,2,B4XMainPage,i_engrane_Click,647,1,B4XMainPage,ocultaProgreso,642,0,Starter,Process_Globals,14,3 NavigationStack=C_Productos,CreateListItem,450,0,C_Productos,cuentaProds,535,0,Starter,Process_Globals,17,3,C_Productos,Class_Globals,1,0,C_Productos,B4XPage_Created,60,0,C_Productos,B4XPage_Appear,99,1,C_Productos,ponProdsEnCero,551,0,Diseñador Visual,proditem.bal,-100,5,Diseñador Visual,login.bal,-100,1,C_Productos,llenaCatalogo,306,6
SelectedBuild=0 SelectedBuild=0
VisibleModules=1,2,3,4,5,6,7,8,9,10,13,21 VisibleModules=21,2,4,5,8,9,10,13,22

Binary file not shown.