mirror of
https://github.com/KeymonSoft/Lanterna_H.git
synced 2026-04-22 07:00:13 +00:00
- Se agregó el boton de imprimir resumen de propinas al cierre
This commit is contained in:
Binary file not shown.
@@ -19,9 +19,9 @@ ModuleClosedNodes1=
|
||||
ModuleClosedNodes2=
|
||||
ModuleClosedNodes3=
|
||||
ModuleClosedNodes4=
|
||||
ModuleClosedNodes5=2,93,94,96,99,100,101
|
||||
ModuleClosedNodes5=
|
||||
ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
NavigationStack=Principal,Globals,181,0,Principal,b_cierreTotal_LongClick,1607,0,Principal,b_imp_Click,1783,3,Principal,b_leyendaDescuento_Click,2963,6,Principal,b_cierraAdmin_Click,1472,0,Principal,b_imp2_Click,2016,6,Visual Designer,resumenItem.bal,-100,6,Principal,b_resumen_Click,3328,6,Visual Designer,principal.bal,-100,6,Principal,acomodaResItems,3343,6,Main,JobDone,282,0
|
||||
NavigationStack=Principal,b_resumen_Click,3328,6,Principal,acomodaResItems,3343,6,Main,JobDone,282,0,Principal,b_reabrirMesa_Click,2710,0,Principal,p_transparenteVerOrden_Click,2695,0,Principal,b_imp_Click,1802,0,Principal,b_imp2_Click,2052,6,Principal,cb_factura_CheckedChange,3519,0,Visual Designer,principal.bal,-100,6,Principal,b_imp3_Click,2109,6
|
||||
SelectedBuild=0
|
||||
VisibleModules=6,5,7
|
||||
|
||||
115
Principal.bas
115
Principal.bas
@@ -190,6 +190,7 @@ Sub Globals
|
||||
Private l_titResPagoTot As Label
|
||||
Private l_titResComprobante As Label
|
||||
Private l_titResFormaPago As Label
|
||||
Private b_imp3 As Button
|
||||
End Sub
|
||||
|
||||
Sub Activity_Create(FirstTime As Boolean)
|
||||
@@ -942,7 +943,7 @@ Private Sub WobbleMenu1_Tab3Click
|
||||
p_transparenteResumen.Visible = False
|
||||
actualizaProductos("Alimentos")
|
||||
' For w = 0 To 150
|
||||
'
|
||||
'
|
||||
' Next
|
||||
End Sub
|
||||
|
||||
@@ -2055,6 +2056,112 @@ Sub b_imp2_Click
|
||||
ProgressDialogHide
|
||||
End Sub
|
||||
|
||||
|
||||
Sub b_imp3_Click
|
||||
Private imprimirAqui As Boolean = Starter.imprimirTicket
|
||||
Private sDate, sTime As String
|
||||
Private c As Cursor
|
||||
sv_resumen.Panel.Height = p_resumen.Height
|
||||
cs.Initialize
|
||||
Private l_total, la_cuenta As Label
|
||||
l_total.Initialize("l")
|
||||
la_cuenta.Initialize("2")
|
||||
b_imp2.Enabled = False
|
||||
ProgressDialogShow("Imprimiendo, un momento ...")
|
||||
If imprimirAqui Then
|
||||
Printer1.DisConnect
|
||||
If Not(Printer1.IsConnected) Then
|
||||
If Starter.logger Then Log("conectando 1")
|
||||
Printer1.Connect
|
||||
Private cont As Int = 0
|
||||
Do While Not(impresoraConectada)
|
||||
Sleep(1000)
|
||||
cont = cont + 1
|
||||
If cont = 7 Then Printer1.Connect 'Tratamos de reconectar
|
||||
If cont > 15 Then impresoraConectada = True
|
||||
Loop
|
||||
Sleep(500)
|
||||
impresoraConectada = False
|
||||
Else
|
||||
If Starter.logger Then Log("conectando 2")
|
||||
Printer1.Connect
|
||||
Private cont As Int = 0
|
||||
Do While Not(impresoraConectada) Or Not(Printer1.IsConnected)
|
||||
Sleep(1000)
|
||||
cont = cont + 1
|
||||
If cont = 2 Then Printer1.Connect
|
||||
If cont > 4 Then impresoraConectada = True
|
||||
Loop
|
||||
Sleep(500)
|
||||
impresoraConectada = False
|
||||
End If
|
||||
Printer1.Reset
|
||||
End If
|
||||
' If imprimirAqui Then Printer1.WriteString(Printer1.UNREVERSE)
|
||||
Try
|
||||
DateTime.DateFormat = "yyyymmdd"
|
||||
sDate = DateTime.Date(DateTime.Now)
|
||||
Printer1.WriteString(Printer1.BOLD)
|
||||
If imprimirAqui Then Printer1.WriteString("LA LANTERNA RISTORANTE" & CRLF)
|
||||
Printer1.WriteString(Printer1.NOBOLD)
|
||||
DateTime.DateFormat = "MM/dd/yyyy"
|
||||
sDate = DateTime.Date(DateTime.Now)
|
||||
sTime = DateTime.Time(DateTime.Now)
|
||||
|
||||
Private c As Cursor = Starter.skmt.ExecQuery($"select M_ESTATUS from CAT_MESAS where M_ESTATUS = 'ABIERTA'"$)
|
||||
'RESUMEN
|
||||
Private rsm As Cursor = Starter.skmt.ExecQuery($"select distinct CAT_GP_CLASIF, sum(pe_cant) as cuantos, sum(pe_costo_tot) as monto from pedido join CAT_GUNAPROD on cat_gp_id = PE_PROID group by CAT_GP_CLASIF order by CAT_GP_CLASIF"$) 'Este query quita los "Consumo de alimentos", que son los tickets que se generan con el multi-ticket, porque en CAT_GUNAPROD no existe el ID CDA01.
|
||||
' Log(rsm.RowCount)
|
||||
If rsm.RowCount > 0 Then
|
||||
'PROPINAS
|
||||
Private prop As ResultSet = Starter.skmt.ExecQuery($"Select PT_PAGO_PROPINA, sum(PT_PROPINA) As PROPINA from PEDIDO_TICKET where pt_pago <> 'MULTI-TICKET' group by PT_PAGO_PROPINA"$)
|
||||
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||
Printer1.WriteString(Printer1.BOLD)
|
||||
If imprimirAqui Then Printer1.WriteString($"*** PROPINAS *** ${CRLF}"$)
|
||||
Printer1.WriteString(Printer1.NOBOLD)
|
||||
cs.Color(Colors.red).Append($"** PROPINAS **${CRLF}"$).pop
|
||||
Log("*** PROPINAS ***")
|
||||
Private tot As String = 0
|
||||
Do While prop.NextRow
|
||||
If prop.GetString("PT_PAGO_PROPINA") <> Null Then
|
||||
Private laPropina As String = prop.GetString("PROPINA")
|
||||
If imprimirAqui Then Printer1.WriteString($"${prop.GetString("PT_PAGO_PROPINA")}${Subs.alineaDerecha("$"&NumberFormat2(laPropina, 1, 2, 2, True), (30 - prop.GetString("PT_PAGO_PROPINA").Length), ".")} ${CRLF}"$)
|
||||
' Log(prop.GetString("PT_PAGO_PROPINA"))
|
||||
cs.Color(Colors.DarkGray).Append($"${prop.GetString("PT_PAGO_PROPINA")}${Subs.alineaDerecha("$"&NumberFormat2(laPropina, 1, 2, 2, True), (30 - prop.GetString("PT_PAGO_PROPINA").Length), ".")} ${CRLF}"$).pop
|
||||
Log($" ${prop.GetString("PT_PAGO_PROPINA")}${Subs.alineaDerecha("$"&NumberFormat2(laPropina, 1, 2, 2, True), (30 - prop.GetString("PT_PAGO_PROPINA").Length), ".")} "$)
|
||||
tot = tot + laPropina
|
||||
End If
|
||||
Loop
|
||||
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||
If imprimirAqui Then Printer1.WriteString($"Total:${Subs.alineaDerecha("$"&NumberFormat2(tot, 1, 2, 2, True), (30 - 6), ".")} ${CRLF}"$)
|
||||
cs.Color(Colors.DarkGray).Append($"Total:${Subs.alineaDerecha("$"&NumberFormat2(tot, 1, 2, 2, True), (30 - 6), ".")} ${CRLF}"$).pop
|
||||
Log($"Total: ${tot}"$)
|
||||
' LogColor($">>>>>>> ${Ceil(25.2)}"$, Colors.red)
|
||||
' LogColor($">>>>>>> ${Ceil(25.5)}"$, Colors.red)
|
||||
' Efectivo...............$300.00
|
||||
' Tarjeta................$910.00
|
||||
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||
End If
|
||||
l_resumen.Text = cs
|
||||
Subs.panelVisible(p_transparenteResumen, 0, 0)
|
||||
' Else
|
||||
' ToastMessageShow("¡Es necesario que NO haya mesas abiertas para realizar el cierre!", True)
|
||||
' End If
|
||||
Sleep(1000)
|
||||
Printer1.DisConnect
|
||||
Catch
|
||||
ToastMessageShow("Error en la impresion 3.", True)
|
||||
Printer1.Disconnect
|
||||
' B4XPages.ShowPage("Principal")
|
||||
Activity_Resume
|
||||
End Try
|
||||
Sleep(1000)
|
||||
b_imp2.Enabled = True
|
||||
ProgressDialogHide
|
||||
End Sub
|
||||
|
||||
Sub b_imp_VIEJO_Click
|
||||
' Log("inicia B_IMP2_Click")
|
||||
Private TAMANO As Int
|
||||
@@ -2674,8 +2781,8 @@ Private Sub lv_historial_ItemLongClick (Position As Int, Value As Object)
|
||||
' Private d() As String = Regex.Split("\|", Value)
|
||||
' lv_verOrden.Clear
|
||||
' Private c As Cursor = Starter.skmt.ExecQuery($"select * from PEDIDO where PE_MESA = '${d(0)}' and PE_TICKET = '${d(1)}' and PE_TIPO = '${d(2)}'"$)
|
||||
'' Log($"select * from PEDIDO where PE_MESA = '${d(0)}' and PE_TICKET = '${d(1)}' and PE_TIPO = '${d(2)}'"$)
|
||||
'' Log(c.RowCount)
|
||||
'' Log($"select * from PEDIDO where PE_MESA = '${d(0)}' and PE_TICKET = '${d(1)}' and PE_TIPO = '${d(2)}'"$)
|
||||
'' Log(c.RowCount)
|
||||
' Private Label1 As Label = lv_verOrden.TwoLinesLayout.Label
|
||||
' Private Label2 As Label = lv_verOrden.TwoLinesLayout.SecondLabel
|
||||
' Label1.TextColor = Colors.RGB(1,127,1)
|
||||
@@ -2686,7 +2793,7 @@ Private Sub lv_historial_ItemLongClick (Position As Int, Value As Object)
|
||||
' For i = 0 To c.RowCount - 1
|
||||
' c.Position = i
|
||||
' Private n1 As String = c.GetString("PE_PRONOMBRE")
|
||||
'' Log(n.Length & " - " & n)
|
||||
'' Log(n.Length & " - " & n)
|
||||
' If n1.Length > 25 Then n1 = n1.SubString2(0, 25)
|
||||
' lv_verOrden.AddTwoLines($"${c.GetString("PE_CANT")} - ${n1}"$, $"Precio: $${c.GetString("PE_COSTOU")}"$)
|
||||
' Next
|
||||
|
||||
Reference in New Issue
Block a user