From 469d7d91a45780b7439eeaf04cec64655e7a56e0 Mon Sep 17 00:00:00 2001 From: Jose Alberto Guerra Ugalde Date: Wed, 28 Feb 2024 16:43:27 -0600 Subject: [PATCH] =?UTF-8?q?-=20Se=20agrego=20la=20opci=C3=B3n=20de=20reasi?= =?UTF-8?q?gnar=20una=20mesa=20haciendo=20clic=20largo=20sobre=20la=20mesa?= =?UTF-8?q?=20en=20cuestion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B4A/C_Principal.bas | 57 +++++++++++++++++++++++++++++++++++++++- B4A/Files/principal.bal | Bin 30785 -> 33380 bytes B4A/Lanterna.b4a | 2 +- B4A/Lanterna.b4a.meta | 4 +-- 4 files changed, 59 insertions(+), 4 deletions(-) diff --git a/B4A/C_Principal.bas b/B4A/C_Principal.bas index 2387516..b06c3be 100644 --- a/B4A/C_Principal.bas +++ b/B4A/C_Principal.bas @@ -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 \ No newline at end of file diff --git a/B4A/Files/principal.bal b/B4A/Files/principal.bal index f3436b7f20ea6aa7d9efe71813476b7eeae12b10..89539196683b5637979e3df8e36561f8814d49bf 100644 GIT binary patch delta 1409 zcmaLXOHWfl6bJB`3JJG7F13n+MOq$3wDPDA-XH=>kwSUMLu2p)6$_=sUX~_Jj2}Qe z3C5kq1&J=yuycnSml&5u9zxx@fG=P?Q>FZaiHraAH<>vz_a^srbyp@HTe8!I5Tlw9 zR{kAX%Q}f40V){ zE=Q`+o5MwFITi~oM2C&ZP;}*&v{{m6^H`>*Ejdo|=K1l3m=Q7OjaV?U5NuDKM0@r^ z`j|E)yQn<fxE#sz&&6;xL1hY)KmAt zLIB(k9sm!rhd4Jm!<^(tN39vN^2f@X3};Tf{(oJdx)j?+&9VDbyA1>lGc+ABVoue^ zs%vqFcfXBOou$q==zNQ5tbEFwG35Hw@QmD`y`YE3@%+xrT<$m3GExY7n;)jH_p0P3 zua{7yK+`vQMSZ_nIuF_gy>G3hhtrz<5l__{$z2{)XUQ+LSXn@y-8wZ!47o)vkDa!9 zn)NMSJUC&Kssm2>omTsOwC2#P>W?aU&Np(^d1<|^iJlCW$!#w8P@tkz-~Ok(gT{v3 z^z*(Zo9M%A4ZW+hlE1xzM*E_2hwB3R&Y_x@K9km3w9JwH%ccbF-6o$iy`cLNZ9u!0n8dgLyaYjghFs(5TzR~5RHJ20*V~K zC*UA-9Ds(Nm#}@sU-KJ1jb@5@zZ0(?N=zl9=LnI;>v1`jFBdCOx8z)T_NC)VS2y(P zBzNOoyQPy0=T;V!7nu@N83B`fdMN57s=G;odFubaSea5LBd zw}2DiR(2cL&UJuIb|=?Gm|KDaFyue=Mmbhi`3V0Q~23`kmfV1G-kNxTen=se{Z-XuH u4tN*52i^xCfDhSu?uaW8g}*