Se agrega el apartado de total productos y se corrige el checkbox de facturacion
This commit is contained in:
Javier
2025-09-02 18:23:51 -06:00
parent 6a0b7e972e
commit 3d4a0e3e12
4 changed files with 66 additions and 11 deletions

View File

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

Binary file not shown.

View File

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

View File

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