From 3d4a0e3e12525d2a526d36f7d0c7b66da884fa4e Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 2 Sep 2025 18:23:51 -0600 Subject: [PATCH] 5.08.31 Se agrega el apartado de total productos y se corrige el checkbox de facturacion --- B4A/C_Productos.bas | 71 +++++++++++++++++++++++++++++++++++++----- B4A/Files/cliente.bal | Bin 37860 -> 37860 bytes B4A/INTMEX.b4a | 4 +-- B4A/INTMEX.b4a.meta | 2 +- 4 files changed, 66 insertions(+), 11 deletions(-) diff --git a/B4A/C_Productos.bas b/B4A/C_Productos.bas index e26bca5..672a889 100644 --- a/B4A/C_Productos.bas +++ b/B4A/C_Productos.bas @@ -203,8 +203,8 @@ Sub B4XPage_Appear End If Sleep(100) - l_total.Visible = False - l_totProds.Visible = False +' l_total.Visible = False +' l_totProds.Visible = False l_total.Left = 5dip l_totProds.Width = Root.Width * 0.19 l_total.Left = l_totProds.Width + 20 @@ -253,7 +253,21 @@ Sub lv_catalogos_ItemClick (Position As Int, Value As Object) ' lv_tipo.Visible = True If clv_prods_ll.Size = 0 Then LlenaProdsLL(Null) clv_prods_ll.AsView.Visible = True - If hayPedido Then p_botonesVenta.Visible = True 'Si ya hay pedido, entonces mostramos los botones. + + If hayPedido Then + p_botonesVenta.Visible = True 'Si ya hay pedido, entonces mostramos los botones. + + End If + c = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) ") + If c.RowCount > 0 Then + C.Position = 0 + Log($"registros: ${c.RowCount}, arts: ${c.GetString("PC_NOART")}, monto:${c.GetString("PC_MONTO")}"$) + l_totProds.Text = "Prods: " & c.GetString("PC_NOART") + l_total.Text = "Total: $" & c.GetString("PC_MONTO") + If l_total.Text = Null Or l_total.Text = "null" Or l_total.Text = "" Then l_total.Text = "Total: $0.0" + If l_totProds.Text = Null Or l_totProds.Text = "null" Or l_totProds.Text = "" Then l_totProds.Text = "Prods: 0" + End If + Else clv_prods_ll.AsView.Visible = False lv_promos.Visible = True @@ -433,16 +447,16 @@ Private Sub B4XPage_CloseRequest As ResumableSub lv_promos.Visible = False lv_catalogos.Visible = True p_botonesVenta.Visible = False - l_total.Visible = False - l_totProds.Visible = False +' l_total.Visible = False +' l_totProds.Visible = False Return False else if clv_prods_ll.AsView.Visible Then lfila.text = "CATALOGO" clv_prods_ll.AsView.Visible = False lv_subtipo.Visible = False p_botonesVenta.Visible = False - l_total.Visible = False - l_totProds.Visible = False +' l_total.Visible = False +' l_totProds.Visible = False lv_catalogos.Visible = True Return False ' else if lv_subtipo.Visible Then @@ -557,6 +571,20 @@ Sub b_prodMenos_Click End If If Subs.totalPedido < 1 Then laCant.Text = "0" invTotal = laCant.Text + Subs.traeinventario(id) + + If hayPedido Then + p_botonesVenta.Visible = True 'Si ya hay pedido, entonces mostramos los botones. + + End If + c = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) ") + If c.RowCount > 0 Then + C.Position = 0 + Log($"registros: ${c.RowCount}, arts: ${c.GetString("PC_NOART")}, monto:${c.GetString("PC_MONTO")}"$) + l_totProds.Text = "Prods: " & c.GetString("PC_NOART") + l_total.Text = "Total: $" & c.GetString("PC_MONTO") + If l_total.Text = Null Or l_total.Text = "null" Or l_total.Text = "" Then l_total.Text = "Total: $0.0" + If l_totProds.Text = Null Or l_totProds.Text = "null" Or l_totProds.Text = "" Then l_totProds.Text = "Prods: 0" + End If ' LogColor("InvTotal PRODMAS: " & invTotal, Colors.Red) End Sub @@ -625,6 +653,19 @@ Sub b_prodMas_Click ' Log(lProdX.Text) End If invTotal = laCant.Text + Subs.traeinventario(id) + If hayPedido Then + p_botonesVenta.Visible = True 'Si ya hay pedido, entonces mostramos los botones. + + End If + c = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) ") + If c.RowCount > 0 Then + C.Position = 0 + Log($"registros: ${c.RowCount}, arts: ${c.GetString("PC_NOART")}, monto:${c.GetString("PC_MONTO")}"$) + l_totProds.Text = "Prods: " & c.GetString("PC_NOART") + l_total.Text = "Total: $" & c.GetString("PC_MONTO") + If l_total.Text = Null Or l_total.Text = "null" Or l_total.Text = "" Or l_total.Text = "Total: $null" Then l_total.Text = "Total: $0.0" + If l_totProds.Text = Null Or l_totProds.Text = "null" Or l_totProds.Text = "" Or l_totProds.Text = "Prods: null" Then l_totProds.Text = "Prods: 0" + End If ' LogColor("InvTotal PRODMAS: " & invTotal, Colors.Red) End Sub @@ -704,7 +745,21 @@ Private Sub et_pCant_TextChanged (Old As String, New As String) If New = "" Then New = 0 lProdX.Text = cs.Color(Colors.red).append(nombreX).pop.Append(CRLF).Append("Existencias: " & (Subs.traeinventario(id))).Color(0xFF017F01).Append($" $${NumberFormat2(precio, 1, 2, 2, False)}"$).Popall + If hayPedido Then + p_botonesVenta.Visible = True 'Si ya hay pedido, entonces mostramos los botones. + + End If + c = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) ") + If c.RowCount > 0 Then + C.Position = 0 + Log($"registros: ${c.RowCount}, arts: ${c.GetString("PC_NOART")}, monto:${c.GetString("PC_MONTO")}"$) + l_totProds.Text = "Prods: " & c.GetString("PC_NOART") + l_total.Text = "Total: $" & c.GetString("PC_MONTO") + If l_total.Text = Null Or l_total.Text = "null" Or l_total.Text = "" Then l_total.Text = "Total: $0.0" + If l_totProds.Text = Null Or l_totProds.Text = "null" Or l_totProds.Text = "" Then l_totProds.Text = "Prods: 0" + End If End If + End If End Sub @@ -1060,7 +1115,7 @@ Private Sub clv_prods_ll_VisibleRangeChanged (FirstIndex As Int, LastIndex As In b_prodMenos.Enabled = False End If End If - + Log(clv_prods_ll.GetValue(i)) Private precio As String=NumberFormat2(clv_prods_ll.GetValue(i).As(Map).Get("precio").As(Double),1,2,2,False) If clv_prods_ll.GetValue(i).As(Map).Get("cant") <> Null Then et_pCant.Text = clv_prods_ll.GetValue(i).As(Map).Get("cant") l_prodX.Text = cs.Color(Colors.red).append(clv_prods_ll.GetValue(i).As(Map).Get("prod")).pop.append(CRLF).Append("Existencias: " & clv_prods_ll.GetValue(i).As(Map).Get("almacen")).Color(0xFF017F01).Append($" $${precio}"$).Popall diff --git a/B4A/Files/cliente.bal b/B4A/Files/cliente.bal index 3ea1f67bd68d38cc1ef5e83737dea221ee2f4b54..d973343ed7a816a2e4e6e9adf6de5118dcb539bb 100644 GIT binary patch delta 19 ZcmaE|oaxDOrVS?xS^fjT=Cg(3N&s@33oifw delta 19 bcmaE|oaxDOrVS?xS>zcQ7&f0R6juTORnP}g diff --git a/B4A/INTMEX.b4a b/B4A/INTMEX.b4a index 1eb339b..e645306 100644 --- a/B4A/INTMEX.b4a +++ b/B4A/INTMEX.b4a @@ -159,12 +159,12 @@ Module9=C_Nota NumberOfFiles=46 NumberOfLibraries=33 NumberOfModules=30 -Version=13 +Version=12.8 @EndOfDesignText@ #Region Project Attributes #ApplicationLabel: Intmex #VersionCode: 1 - #VersionName: 5.05.30 + #VersionName: 5.08.31 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: portrait #CanInstallToExternalStorage: False diff --git a/B4A/INTMEX.b4a.meta b/B4A/INTMEX.b4a.meta index a675d83..27ea769 100644 --- a/B4A/INTMEX.b4a.meta +++ b/B4A/INTMEX.b4a.meta @@ -91,6 +91,6 @@ ModuleClosedNodes6= ModuleClosedNodes7= ModuleClosedNodes8= ModuleClosedNodes9= -NavigationStack=C_Promos,CalcularTotalFijos,1706,6,C_Promos,Class_Globals,62,0,C_Promos,GenerarFijos,844,4,C_Promos,muestraPromo,506,0,C_Promos,btnMenosPromo_Click,511,6,C_Promos,btnGuardaPromo_Click,1343,0,DiseƱador Visual,cliente.bal,-100,3,C_Promos,btnContinuar_Click,1446,6,C_Cliente,Class_Globals,155,0,C_Cliente,B4XPage_Appear,242,3,C_Cliente,B_GUARDA_C_Click,1032,0 +NavigationStack=C_Productos,B4XPage_CloseRequest,429,0,C_Productos,llenaCatalogo,391,0,DiseƱador Visual,productos.bal,-100,6,C_Productos,cuentaProds,764,0,C_Productos,B4XPage_Appear,216,0,C_Productos,LlenaProdsLL,1176,0,C_Productos,lv_catalogos_ItemClick,254,1,C_Productos,b_prodMenos_Click,572,0,C_Productos,b_prodMas_Click,649,6,C_Productos,et_pCant_TextChanged,745,6 SelectedBuild=0 VisibleModules=28,2,13,20,14,29,17,15,9,4