mirror of
https://github.com/KeymonSoft/Lanterna.git
synced 2026-04-17 21:06:32 +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
|
||||
Binary file not shown.
@@ -82,7 +82,7 @@ Version=12.8
|
||||
#Region Project Attributes
|
||||
#ApplicationLabel: Lanterna
|
||||
#VersionCode: 1
|
||||
#VersionName: 4.03.23
|
||||
#VersionName: 4.03.25
|
||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||
#SupportedOrientations: portrait
|
||||
#CanInstallToExternalStorage: False
|
||||
|
||||
@@ -25,6 +25,6 @@ ModuleClosedNodes5=
|
||||
ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
ModuleClosedNodes8=47,48
|
||||
NavigationStack=Subs,traeSubCategorias,1410,0,Subs,traeTotalTicketActual_P,1169,0,C_Principal,et_buscar_TextChanged,2565,6,C_Principal,b_leyendaDescuento_Click,2485,6,C_Principal,p_mesasItem_Click,975,0,Visual Designer,principal.bal,-100,6,C_Principal,lv_categorias_ItemClick,1168,1,C_Principal,B4XPage_Created,209,0,C_Principal,B4XPage_Appear,276,0,C_Principal,B4XPage_CloseRequest,347,6,C_Principal,WobbleMenu1_Tab1Click,730,0
|
||||
NavigationStack=C_Principal,PCLV_HintRequested,723,0,C_Principal,b_prodMenos_Click,412,5,C_Principal,b_prodMas_Click,431,0,C_Principal,b_renombraVarios_Click,2143,0,C_Principal,l_prodX_LongClick,2136,6,Visual Designer,proditem.bal,-100,6,Visual Designer,principal.bal,-100,4,C_Principal,p_transparenteDescuento_Click,2128,0,C_Principal,LlenaMesas,936,2,C_Principal,clv_mesas_VisibleRangeChanged,933,0,B4XMainPage,JobDone,257,0
|
||||
SelectedBuild=0
|
||||
VisibleModules=1,7,8,2,3,6,4,5
|
||||
|
||||
@@ -1277,11 +1277,13 @@ Sub totalPedido As String
|
||||
End Sub
|
||||
|
||||
Sub actualizaProducto(costoU As String, cant As String, nombre As String, prodId As String, ticketId As String, fecha As String, mesero As String, mesa As String, precioSin As String, tipoVenta As String, comensales As Int)
|
||||
If nombre.Length < 6 Then ToastMessageShow("(actualizaProducto) El nombre del producto no es valido " & nombre, True)
|
||||
If nombre.Length < 2 Then ToastMessageShow("(actualizaProducto) El nombre del producto no es valido " & nombre, True)
|
||||
LogColor($"actualizaProducto, p=${prodId}, nombre=${nombre}, cant=${cant}, tipo=${tipoVenta}, mesa=${mesa}, mesero=${mesero}, comensales=${comensales}, ticket=${ticketId}"$, Colors.Magenta)
|
||||
' Private tablaProds As String = "cat_gunaprod2"
|
||||
' If tipoVenta = "ABORDO" Then tablaProds = "cat_gunaprod"
|
||||
Private c As Cursor=Starter.skmt.ExecQuery($"select * from pedido where PE_PROID = '${prodId}' and PE_TICKET = '${ticketId}' and PE_MESA = '${mesa}' and PE_TIPO = '${tipoVenta}'"$)
|
||||
Log($"select * from pedido where PE_PROID = '${prodId}' and PE_TICKET = '${ticketId}' and PE_MESA = '${mesa}' and PE_TIPO = '${tipoVenta}'"$)
|
||||
Log(c.RowCount)
|
||||
If c.RowCount > 0 Then
|
||||
LogColor("ACTUALIZAMOS PROD", Colors.Blue)
|
||||
c.Position = 0
|
||||
|
||||
Reference in New Issue
Block a user