Lista parte del Cierre Total, muestra el resumen por mesa, y falta la parte de la impresion y que borre el efectivo!!

This commit is contained in:
2024-02-09 22:08:48 -06:00
parent fef3025db2
commit 83d22bae4f
5 changed files with 46 additions and 11 deletions

View File

@@ -75,6 +75,12 @@ Sub Class_Globals
Dim p_transparenteCierreAdmin As Panel
Private cd1 As ColorDrawable
Private p_botonesCierre As Panel
Private p_transparenteResumen As Panel
Private p_resumen As Panel
Private l_resumen As Label
Private sv_resumen As ScrollView
Dim su As StringUtils
Dim cs As CSBuilder
End Sub
'You can add more parameters here.
@@ -113,8 +119,10 @@ Private Sub B4XPage_Created (Root1 As B4XView)
p_mesas.Height = Root.Height - WobbleMenu1.Height
p_historial.Width = Root.Width
p_historial.Height = Root.Height - WobbleMenu1.Height
p_transparenteCierreAdmin.Height = Root.Height : p_transparenteCierreAdmin.Width = Root.Width
Subs.panelWH(p_transparenteCierreAdmin, Root.Width, Root.Height)
p_transparenteCierreAdmin.Top = 0 : p_transparenteCierreAdmin.left = 0
Subs.panelWH(p_transparenteResumen, Root.Width, Root.Height)
sv_resumen.Panel.LoadLayout("resumenCont")
Dim cs As CSBuilder
cs.Initialize
l_inicioDia.Text = cs.append("Para iniciar día, ingrese el texto ").bold.Append("INICIO DIA").Pop.Append(" y la tecla ").Bold.Append("Retorno").Pop.Append(" del teclado.").Color(Colors.red).Append(" Los datos del día anterior se borraran.").Popall
@@ -186,8 +194,8 @@ Sub B4XPage_CloseRequest As ResumableSub
p_mesa.Visible = False
p_mesas.Visible = True
LlenaMesas(Null, Null)
Else
B4XPages.ShowPage("Login")
Else if p_transparenteResumen.Visible Then
p_transparenteResumen.Visible = False
End If
Return False
End Sub
@@ -656,7 +664,7 @@ Sub llenaHistorial
lv_historial.Clear
lv_historial.Visible = True
Do While rs_hist.NextRow
' cs.Initialize
cs.Initialize
Dim Label1 As Label
Label1 = lv_historial.TwoLinesLayout.Label
Label1.TextSize = 16
@@ -959,8 +967,29 @@ Private Sub b_cierraAdmin_LongClick
ToastMessageShow("¡Cierre administrativo cancelado!", False)
End Sub
Private Sub b_cierreTotal_Click
Private Sub b_cierreTotal_Click
Log("click")
sv_resumen.Panel.Height = p_resumen.Height
cs.Initialize
Log(l_resumen.text)
Private c As Cursor = Starter.skmt.ExecQuery("select PE_MESA, PE_TIPO, sum(PE_COSTO_TOT) as SUBTOT from PEDIDO group by PE_MESA, pe_tipo order by PE_MESA, PE_TIPO desc")
If c.RowCount > 0 Then
c.Position = 0
Private mesaAnt As String = ""
Private tipo As String
' Private texoResumen As String
For i = 0 To c.RowCount - 1
c.Position = i
If c.GetString("PE_TIPO") = "TARJETA" Then tipo = "Tarjeta " Else tipo = "Efectivo "
If mesaAnt <> c.GetString("PE_MESA") Then cs.Color(Colors.red).Append("Mesa " & c.GetString("PE_MESA") & CRLF).pop
cs.Append($"* ${tipo} $${NumberFormat2(c.GetString("SUBTOT"), 0, 2, 2, True)}${CRLF}"$).Popall
mesaAnt = c.GetString("PE_MESA")
Next
l_resumen.Text = cs
l_resumen.Height = su.MeasureMultilineTextHeight(l_resumen, l_resumen.Text)
sv_resumen.Panel.Height = l_resumen.Height
End If
Subs.panelVisible(p_transparenteResumen, 0, 0)
End Sub
Private Sub et_inicioDia_EnterPressed
@@ -974,4 +1003,8 @@ End Sub
Private Sub p_transparenteCierreAdmin_Click
'Para evitar que el clic en pantalla no se siga hacia atras
End Sub
Private Sub p_transparenteResumen_Click
End Sub