mirror of
https://github.com/KeymonSoft/Lanterna.git
synced 2026-04-20 14:19:23 +00:00
- Se agrego la opción de reasignar una mesa haciendo clic largo sobre la mesa en cuestion
This commit is contained in:
@@ -94,6 +94,12 @@ Sub Class_Globals
|
||||
' Private p_test As Panel
|
||||
Private tipoPago As String = "VENTA"
|
||||
Dim n2t As numeroATexto
|
||||
Private p_transparenteCambioMesa As Panel
|
||||
Private p_cambioMesa As Panel
|
||||
Private l_cambioMesa2 As Label
|
||||
Private cb_cambioMesa As B4XComboBox
|
||||
Private b_cambioMesa As Button
|
||||
Private l_cambioMesa As Label
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -132,6 +138,9 @@ 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
|
||||
Subs.centraPanel(p_cambioMesa, p_transparenteCambioMesa.Width)
|
||||
p_transparenteCambioMesa.Top = 0 : p_transparenteCambioMesa.Left = 0
|
||||
p_transparenteCambioMesa.Height = Root.Height : p_transparenteCambioMesa.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)
|
||||
@@ -237,7 +246,9 @@ End Sub
|
||||
Sub B4XPage_CloseRequest As ResumableSub
|
||||
' BACK key pressed
|
||||
'Return True to close, False to cancel
|
||||
If p_pago.visible Then 'Si se esta mostrando el popup de pago, lo cerramos.
|
||||
If p_transparenteCambioMesa.Visible Then
|
||||
p_transparenteCambioMesa.Visible = False
|
||||
Else If p_pago.visible Then 'Si se esta mostrando el popup de pago, lo cerramos.
|
||||
p_pago.Visible = False
|
||||
Else If clv_prods_ll.AsView.Visible Then 'SI se muestran los
|
||||
clv_prods_ll.AsView.Visible = False
|
||||
@@ -965,6 +976,46 @@ Private Sub p_mesasItem_Click
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub p_mesasItem_LongClick
|
||||
Private m As Map = Sender.As(Panel).tag
|
||||
If m.Get("estatus") <> "CERRADA" Then
|
||||
Log(m)
|
||||
Private c As Cursor = Starter.skmt.ExecQuery($"select M_ID from CAT_MESAS where ifnull(M_ESTATUS, 0) <> 'ABIERTA' order by M_ID"$)
|
||||
If c.RowCount > 0 Then
|
||||
Private listaMesas As List
|
||||
listaMesas.Initialize
|
||||
Log(c.RowCount)
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position = i
|
||||
listaMesas.Add(c.GetInt("M_ID"))
|
||||
Next
|
||||
listaMesas.Sort(True)
|
||||
End If
|
||||
cb_cambioMesa.SetItems(listaMesas)
|
||||
l_cambioMesa2.Text = $"Reasignar la mesa ${m.Get("id")} a la mesa:"$
|
||||
b_cambioMesa.Tag = m.Get("id")
|
||||
p_transparenteCambioMesa.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub b_cambioMesa_Click
|
||||
Private c As Cursor = Starter.skmt.ExecQuery($"select * from CAT_MESAS where M_ID = '${Sender.As(Button).tag}'"$)
|
||||
Log($"select * from CAT_MESAS where M_ID = '${Sender.As(Button).tag}'"$)
|
||||
If c.RowCount > 0 Then
|
||||
c.Position = 0
|
||||
Starter.skmt.BeginTransaction
|
||||
Starter.skmt.ExecNonQuery($"update CAT_MESAS set M_ESTATUS = '${c.GetString("M_ESTATUS")}', M_TICKET = '${c.GetString("M_TICKET")}', M_MESERO = '${c.GetString("M_MESERO")}', M_COMENSALES = '${c.GetString("M_COMENSALES")}' where M_ID = '${cb_cambioMesa.SelectedItem}'"$)
|
||||
Log($"update CAT_MESAS set M_ESTATUS = '${c.GetString("M_ESTATUS")}', M_TICKET = '${c.GetString("M_TICKET")}', M_MESERO = '${c.GetString("M_MESERO")}', M_COMENSALES = '${c.GetString("M_COMENSALES")}' where M_ID = '${cb_cambioMesa.SelectedItem}'"$)
|
||||
Starter.skmt.ExecNonQuery($"update CAT_MESAS set M_ESTATUS = null, M_TICKET = null, M_MESERO = null, M_COMENSALES = null where M_ID = '${Sender.As(Button).tag}'"$)
|
||||
Starter.skmt.ExecNonQuery($"update PEDIDO set PE_MESA = '${cb_cambioMesa.SelectedItem}' where PE_TIPO = 'VENTA' and PE_TICKET = '${c.GetString("M_TICKET")}' and PE_MESA = '${Sender.As(Button).tag}'"$)
|
||||
Starter.skmt.ExecNonQuery($"update PEDIDO_TICKET set PT_MESA = '${cb_cambioMesa.SelectedItem}' where PT_PAGO = 'VENTA' and PT_TICKET = '${c.GetString("M_TICKET")}' and PT_MESA = '${Sender.As(Button).tag}'"$)
|
||||
Starter.skmt.TransactionSuccessful
|
||||
Starter.skmt.EndTransaction
|
||||
End If
|
||||
p_transparenteCambioMesa.Visible = False
|
||||
WobbleMenu1_Tab1Click
|
||||
End Sub
|
||||
|
||||
Private Sub b_abrirMesa_Click
|
||||
If cb_mesero.SelectedIndex <> 0 Then
|
||||
Private c As Cursor = Starter.skmt.ExecQuery($"select M_ESTATUS from CAT_MESAS where M_ID = '${Starter.mesaActual}' and M_ESTATUS = 'ABIERTA'"$)
|
||||
@@ -1838,4 +1889,8 @@ End Sub
|
||||
|
||||
Private Sub cb_pagoPropina_SelectedIndexChanged (Index As Int)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub p_transparenteCambioMesa_Click
|
||||
|
||||
End Sub
|
||||
Reference in New Issue
Block a user