mirror of
https://github.com/KeymonSoft/Lanterna.git
synced 2026-04-21 14:49:26 +00:00
- Se corrigio el orden de las mesas (antes las ordenaba como string).
- Se corrigió que cuando se reabria una mesa el tab se quedaba en el 3. - Se corrigió que cuando se cambiaba la cantidad de un producto de varios, el nombre se regresaba al default. - Se agregó que al ticket de NO PAGADO se le pueda agregar que muestre el descuento por efectivo.
This commit is contained in:
@@ -139,6 +139,8 @@ Sub Class_Globals
|
||||
Dim n As Int
|
||||
Private et_buscar As EditText
|
||||
Private p_buscar As Panel
|
||||
Private p_transparenteDescuento As Panel
|
||||
Private cb_mostrarDescuento As CheckBox
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -188,6 +190,8 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
Subs.panelWH(p_transparenteResumen, Root.Width, Root.Height)
|
||||
Subs.panelWH(p_transparentePago, Root.Width, Root.Height)
|
||||
p_transparentePago.Top = 0 : p_transparentePago.left = 0
|
||||
Subs.panelWH(p_transparenteDescuento, Root.Width, Root.Height)
|
||||
p_transparenteDescuento.Top = 0 : p_transparenteDescuento.left = 0
|
||||
sv_resumen.Panel.LoadLayout("resumenCont")
|
||||
Subs.centraEtiqueta(l_pago, p_pago.Width)
|
||||
Subs.centraPanel(p_propina, p_pago.Width)
|
||||
@@ -316,8 +320,9 @@ Sub B4XPage_CloseRequest As ResumableSub
|
||||
' BACK key pressed
|
||||
'Return True to close, False to cancel
|
||||
' Log($"${lv_categorias.Visible} And ${Starter.nivelActual}, ${Starter.catActual}"$)
|
||||
|
||||
If lv_categorias.Visible And n = 0 Then 'Or Starter.catActual = "VARIOS") And Starter.nivelActual = "SubCats"
|
||||
If p_transparenteDescuento.Visible Then
|
||||
p_transparenteDescuento.Visible = False
|
||||
else If lv_categorias.Visible And n = 0 Then 'Or Starter.catActual = "VARIOS") And Starter.nivelActual = "SubCats"
|
||||
clv_prods_ll.AsView.Visible = False
|
||||
p_buscar.Visible = False
|
||||
lv_categorias.Visible = True
|
||||
@@ -411,12 +416,13 @@ Sub b_prodMenos_Click
|
||||
Private tmpMap As Map = clv.GetValue(index).As(Map)
|
||||
Private precio As String = clv.GetValue(index).As(Map).Get("precio")
|
||||
Private id As String=clv.GetValue(index).As(Map).Get("id")
|
||||
Private prodNombre As String = clv.GetValue(index).As(Map).Get("prod")
|
||||
Private tmpMap As Map = CreateMap("precio":precio, "cant":laCant.Text, "almacen":Subs.traeAlmacen)
|
||||
' Log(tmpMap)
|
||||
prodsMap.Put(id, tmpMap)
|
||||
If laCant.Text = 0 Then prodsMap.Remove(id)
|
||||
Private nombreX As String = Subs.traeProdNombre(id)
|
||||
Subs.actualizaProducto(precio, laCant.text, nombreX, id, Starter.ticketActual, Subs.traeFecha, Starter.meseroActual, Starter.mesaActual, 0, Starter.tipov, Starter.comensalesActuales)
|
||||
' Private nombreX As String = Subs.traeProdNombre(id)
|
||||
Subs.actualizaProducto(precio, laCant.text, prodNombre, id, Starter.ticketActual, Subs.traeFecha, Starter.meseroActual, Starter.mesaActual, 0, Starter.tipov, Starter.comensalesActuales)
|
||||
cuentaProds
|
||||
Dim cs As CSBuilder
|
||||
cs.Initialize
|
||||
@@ -443,6 +449,7 @@ Sub b_prodMas_Click
|
||||
' Log($"${pnl.GetView(2).GetView(1)}${CRLF}${pnl.GetView(2).GetView(2)}${CRLF}${pnl.GetView(2).GetView(3)}${CRLF}${pnl.GetView(2).GetView(4)}"$)
|
||||
If laCant.Text = "" Then laCant.Text = 0
|
||||
Private precio As String=clv.GetValue(index).As(Map).Get("precio")
|
||||
Private prodNombre As String = clv.GetValue(index).As(Map).Get("prod")
|
||||
Private inv As Int = clv.GetValue(index).As(Map).Get("almacen")
|
||||
' Log($"|${laCant.Text}, ${inv}"$)
|
||||
If buttonTag = "vendido" Then
|
||||
@@ -458,9 +465,9 @@ Sub b_prodMas_Click
|
||||
Log(Subs.totalPedido)
|
||||
End If
|
||||
Private id As String=clv.GetValue(index).As(Map).Get("id")
|
||||
Private nombreX As String = Subs.traeProdNombre(id)
|
||||
' Private nombreX As String = Subs.traeProdNombre(id)
|
||||
Private precioX As String = precio
|
||||
Subs.actualizaProducto(precioX, laCant.text, nombreX, id, Starter.ticketActual, Subs.traeFecha, Starter.meseroActual, Starter.mesaActual, 0, Starter.tipov, Starter.comensalesActuales)
|
||||
Subs.actualizaProducto(precioX, laCant.text, prodNombre, id, Starter.ticketActual, Subs.traeFecha, Starter.meseroActual, Starter.mesaActual, 0, Starter.tipov, Starter.comensalesActuales)
|
||||
cuentaProds
|
||||
Dim cs As CSBuilder
|
||||
cs.Initialize
|
||||
@@ -935,7 +942,7 @@ Sub LlenaMesas(p As ResultSet, extra As String) 'ignore
|
||||
Private o As Cursor = Starter.skmt.ExecQuery("select count(PT_TICKET) as ordenes from PEDIDO_TICKET where PT_PAGO <> 'VENTA'")
|
||||
o.Position = 0
|
||||
If o.GetInt("ordenes") > 0 Then WobbleMenu1.SetBadge(3, o.GetInt("ordenes"), Colors.white, Colors.red) Else WobbleMenu1.RemoveBadge(3)
|
||||
Dim p As ResultSet = Starter.skmt.ExecQuery($"select *, IFNULL(M_ESTATUS, 'CERRADA') as ESTATUS2, IFNULL(M_MESERO, 'NINGUNO') as MESERO, IFNULL(M_COMENSALES, 0) as COMENSALES from cat_mesas"$)
|
||||
Dim p As ResultSet = Starter.skmt.ExecQuery($"select *, IFNULL(M_ESTATUS, 'CERRADA') as ESTATUS2, IFNULL(M_MESERO, 'NINGUNO') as MESERO, IFNULL(M_COMENSALES, 0) as COMENSALES from cat_mesas order by cast(M_ID as INTEGER)"$)
|
||||
' Log(p.RowCount)
|
||||
PCLVM.Commit
|
||||
clv_mesas.Clear
|
||||
@@ -1062,6 +1069,7 @@ Private Sub b_cambioMesa_Click
|
||||
End If
|
||||
p_transparenteCambioMesa.Visible = False
|
||||
WobbleMenu1_Tab1Click
|
||||
WobbleMenu1.SetCurrentTab(1)
|
||||
End Sub
|
||||
|
||||
Private Sub b_abrirMesa_Click
|
||||
@@ -1240,6 +1248,7 @@ Private Sub b_pagoCerrar_Click
|
||||
b_leyendaDescuento_Click
|
||||
Sleep(1000)
|
||||
WobbleMenu1_Tab1Click
|
||||
WobbleMenu1.SetCurrentTab(1)
|
||||
End Sub
|
||||
|
||||
Private Sub cb_pago_SelectedIndexChanged (Index As Int)
|
||||
@@ -2096,6 +2105,7 @@ End Sub
|
||||
|
||||
Private Sub b_regresarProds_Click
|
||||
WobbleMenu1_Tab1Click
|
||||
WobbleMenu1.SetCurrentTab(1)
|
||||
End Sub
|
||||
|
||||
Sub imprimeTicket (ticket As String, pago As String) As ResumableSub
|
||||
@@ -2105,8 +2115,9 @@ Sub imprimeTicket (ticket As String, pago As String) As ResumableSub
|
||||
End Sub
|
||||
|
||||
Private Sub b_imprimirTicket_Click
|
||||
p_leyendaDescuento.Visible = True
|
||||
p_leyendaDescuento.BringToFront
|
||||
p_transparenteDescuento.Visible = True
|
||||
' p_leyendaDescuento.Visible = True
|
||||
' p_leyendaDescuento.BringToFront
|
||||
cb_leyendaDescuento.Checked = True
|
||||
End Sub
|
||||
|
||||
@@ -2118,9 +2129,19 @@ Private Sub p_transparenteCambioMesa_Click
|
||||
'Para evitar que el clic en pantalla no se siga hacia atras
|
||||
End Sub
|
||||
|
||||
Private Sub p_transparenteDescuento_Click
|
||||
'Para evitar que el clic en pantalla no se siga hacia atras
|
||||
End Sub
|
||||
|
||||
Private Sub l_prodX_LongClick
|
||||
Log(Sender.As(Label).tag)
|
||||
Private m As Map = Sender.As(Label).tag.As(Map)
|
||||
Log(Sender.As(View).Parent.As(Panel).GetView(2).As(Panel).GetView(4).As(EditText).text)
|
||||
'Sender.As(View).Parent.As(Panel) = p_prods
|
||||
'Sender.As(View).Parent.As(Panel).GetView(2) = p_botMasMen
|
||||
'Sender.As(View).Parent.As(Panel).GetView(2).As(Panel).GetView(4)
|
||||
'Sender.As(View).Parent.As(Panel).GetView(2).As(Panel).GetView(4).As(EditText) = et_pCant
|
||||
Private laCant As Int = Sender.As(View).Parent.As(Panel).GetView(2).As(Panel).GetView(4).As(EditText).text '
|
||||
If m.Get("prod").As(String).Contains("Alimentos Varios") Or m.Get("prod").As(String).Contains("Bebidas Varias") Then
|
||||
p_renombraVarios.BringToFront
|
||||
et_nombreVariable.Text = m.Get("prod")
|
||||
@@ -2268,6 +2289,7 @@ Private Sub et_montoPago2_FocusChanged (HasFocus As Boolean)
|
||||
End Sub
|
||||
|
||||
Private Sub cb_opcionEfectivo_CheckedChange(Checked As Boolean)
|
||||
Log(">> OPCION EFECTIVO CAMBIO - ACTUALIZAMOS PEDIDO")
|
||||
Private desc As String = 1 / Subs.traeDescXefectivo
|
||||
Private tot As String = Subs.traeTotalTicketActual_P("VENTA")
|
||||
If Checked Then
|
||||
@@ -2278,7 +2300,7 @@ Private Sub cb_opcionEfectivo_CheckedChange(Checked As Boolean)
|
||||
Starter.skmt.ExecNonQuery($"update PEDIDO set PE_DESC = '0' where PE_TIPO = 'VENTA' and PE_MESA = '${Starter.mesaActual}' and PE_TICKET = '${Starter.ticketActual}'"$)
|
||||
' et_montoPago2.Text = tot
|
||||
End If
|
||||
et_montoPago2.Text = Subs.traeTotalTicketActual_P("VENTA")
|
||||
If et_montoPago2.IsInitialized Then et_montoPago2.Text = Subs.traeTotalTicketActual_P("VENTA")
|
||||
End Sub
|
||||
|
||||
Private Sub lv_historial_ItemLongClick (Position As Int, Value As Object)
|
||||
@@ -2329,8 +2351,10 @@ Private Sub b_reabrirMesa_Click
|
||||
Starter.skmt.EndTransaction
|
||||
p_reabrirMesaMulti.Visible = False
|
||||
p_transparenteVerOrden.Visible = False
|
||||
WobbleMenu1_Tab1Click
|
||||
End If
|
||||
Log("Vamos a Tab1")
|
||||
WobbleMenu1_Tab1Click
|
||||
WobbleMenu1.SetCurrentTab(1)
|
||||
End Sub
|
||||
|
||||
Private Sub p_reabrirMesaMulti_Click
|
||||
@@ -2354,6 +2378,7 @@ Private Sub b_reabrirMesaMulti_Click
|
||||
p_reabrirMesaMulti.Visible = False
|
||||
p_transparenteVerOrden.Visible = False
|
||||
WobbleMenu1_Tab1Click
|
||||
WobbleMenu1.SetCurrentTab(1)
|
||||
End Sub
|
||||
|
||||
Private Sub b_imprimirCerrar_Click
|
||||
@@ -2471,6 +2496,7 @@ Private Sub b_leyendaDescuento_Click
|
||||
Private elNombre As String = c.GetString("PE_PRONOMBRE")
|
||||
If elNombre.Length > 30 Then elNombre.SubString2(0, 30)
|
||||
If c.GetString("CAT_GP_TIPO") = "ALIMENTOS" Then
|
||||
' Log($">> APLICAMOS DESC POR ALIMENTOS"$)
|
||||
elSubTotal = c.GetString("PE_COSTO_TOT") - (c.GetString("PE_COSTO_TOT") * (c.GetString("DESC") / 100))
|
||||
Else
|
||||
elSubTotal = c.GetString("PE_COSTO_TOT")
|
||||
@@ -2564,12 +2590,19 @@ Private Sub b_leyendaDescuento_Click
|
||||
Sleep(1000)
|
||||
b_imprimirTicket.Enabled = True
|
||||
ProgressDialogHide
|
||||
p_leyendaDescuento.Visible = False
|
||||
' p_leyendaDescuento.Visible = False
|
||||
p_transparenteDescuento.Visible = False
|
||||
' B4XPage_CloseRequest
|
||||
cb_mostrarDescuento.Checked = False
|
||||
' cb_opcionEfectivo_CheckedChange(False)
|
||||
End Sub
|
||||
|
||||
Private Sub et_buscar_TextChanged (Old As String, New As String)
|
||||
Private c As ResultSet = Starter.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD, CAT_GP_IMG from cat_gunaprod where CAT_GP_PRECIO > 0 And CAT_GP_CLASIF <> 'PROMOS' and CAT_GP_TIPO = '${Starter.catActual}' and CAT_GP_NOMBRE like '%${New}%' order by CAT_GP_NOMBRE"$)
|
||||
LlenaProdsLL(c, Null)
|
||||
Log(c.RowCount)
|
||||
End Sub
|
||||
|
||||
Private Sub cb_mostrarDescuento_CheckedChange(Checked As Boolean)
|
||||
cb_opcionEfectivo_CheckedChange(Checked)
|
||||
End Sub
|
||||
Reference in New Issue
Block a user