mirror of
https://github.com/KeymonSoft/Lanterna_H.git
synced 2026-04-19 21:59:18 +00:00
- VERSION 4.07.10
- Se corrigió el código del resumen A+B. - Se corrigió el código del resumen de grupos.
This commit is contained in:
Binary file not shown.
@@ -88,7 +88,7 @@ Version=12.8
|
|||||||
#Region Project Attributes
|
#Region Project Attributes
|
||||||
#ApplicationLabel: Lanterna
|
#ApplicationLabel: Lanterna
|
||||||
#VersionCode: 1
|
#VersionCode: 1
|
||||||
#VersionName: 4.07.08
|
#VersionName: 4.07.10
|
||||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||||
#SupportedOrientations: landscape
|
#SupportedOrientations: landscape
|
||||||
#CanInstallToExternalStorage: False
|
#CanInstallToExternalStorage: False
|
||||||
@@ -349,7 +349,7 @@ Sub JobDone(Job As HttpJob)
|
|||||||
Dim CAT_GP_TIPO2 As String = records(result.Columns.Get("CAT_GP_TIPO2"))
|
Dim CAT_GP_TIPO2 As String = records(result.Columns.Get("CAT_GP_TIPO2"))
|
||||||
Dim CAT_GP_ORDENAMIENTO As Int = records(result.Columns.Get("CAT_GP_ORDENAMIENTO"))
|
Dim CAT_GP_ORDENAMIENTO As Int = records(result.Columns.Get("CAT_GP_ORDENAMIENTO"))
|
||||||
Dim CAT_GP_ORDEN_GRUPOS As Int = records(result.Columns.Get("CAT_GP_ORDEN_GRUPOS"))
|
Dim CAT_GP_ORDEN_GRUPOS As Int = records(result.Columns.Get("CAT_GP_ORDEN_GRUPOS"))
|
||||||
Log($"${CAT_GP_NOMBRE}, ${CAT_GP_TIPO2}"$)
|
Log($"${CAT_GP_NOMBRE}, ${CAT_GP_ORDEN_GRUPOS}"$)
|
||||||
Starter.skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_PRECIO,CAT_GP_ALMACEN,CAT_GP_IMG,CAT_GP_FECHA,CAT_GP_FECHA_MOD, CAT_GP_CLASIF, CAT_GP_TIPO, CAT_GP_TIPO2, CAT_GP_ORDENAMIENTO,CAT_GP_ORDEN_GRUPOS) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_PRECIO,CAT_GP_ALMACEN,CAT_GP_IMG,CAT_GP_FECHA,CAT_GP_FECHA_MOD,CAT_GP_CLASIF,CAT_GP_TIPO,CAT_GP_TIPO2,CAT_GP_ORDENAMIENTO,CAT_GP_ORDEN_GRUPOS))
|
Starter.skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_PRECIO,CAT_GP_ALMACEN,CAT_GP_IMG,CAT_GP_FECHA,CAT_GP_FECHA_MOD, CAT_GP_CLASIF, CAT_GP_TIPO, CAT_GP_TIPO2, CAT_GP_ORDENAMIENTO,CAT_GP_ORDEN_GRUPOS) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_PRECIO,CAT_GP_ALMACEN,CAT_GP_IMG,CAT_GP_FECHA,CAT_GP_FECHA_MOD,CAT_GP_CLASIF,CAT_GP_TIPO,CAT_GP_TIPO2,CAT_GP_ORDENAMIENTO,CAT_GP_ORDEN_GRUPOS))
|
||||||
Next
|
Next
|
||||||
For v = 1 To 20 'Agregamos productos varios (editables)
|
For v = 1 To 20 'Agregamos productos varios (editables)
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ ModuleClosedNodes6=
|
|||||||
ModuleClosedNodes7=
|
ModuleClosedNodes7=
|
||||||
ModuleClosedNodes8=
|
ModuleClosedNodes8=
|
||||||
ModuleClosedNodes9=
|
ModuleClosedNodes9=
|
||||||
NavigationStack=Principal,p_resItem_LongClick,3881,6,Principal,b_resumen_Click,3734,3,Principal,b_cambioPagos_Click,3900,3,Visual Designer,principal.bal,-100,6,Principal,llenaHistorial,1014,0,numeroATexto,Class_Globals,18,0,numeroATexto,Initialize,21,0,updateAvailable,Process_Globals,0,0,updateAvailable,Activity_Resume,43,0,appUpdater,Process_Globals,80,1
|
NavigationStack=Visual Designer,principal.bal,-100,1,Principal,b_imp_Click,1793,0,Principal,b_resumen_Click,4316,0,Principal,b_impAB_Click,2847,6,Subs,revisaUUG,358,0,Subs,revisaFLP,385,0,Subs,agregaColumna,1259,0,Principal,Process_Globals,7,0,Principal,b_reimprimirTicket_Click,4456,0,Principal,imprimeResumenGrupos,2005,6,Principal,b_imp2_Click,1954,0
|
||||||
SelectedBuild=0
|
SelectedBuild=0
|
||||||
VisibleModules=7,6,8,5,9,1
|
VisibleModules=7,6,8
|
||||||
|
|||||||
742
Principal.bas
742
Principal.bas
@@ -393,6 +393,7 @@ Sub l_prods_Click
|
|||||||
Catch
|
Catch
|
||||||
Log(LastException)
|
Log(LastException)
|
||||||
End Try
|
End Try
|
||||||
|
et_selBuscar.Text = ""
|
||||||
Log(listaProdsOrden)
|
Log(listaProdsOrden)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1018,7 +1019,7 @@ Private Sub b_terminar_Click
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub llenaHistorial
|
Sub llenaHistorial
|
||||||
Dim rs_hist As ResultSet = Starter.skmt.ExecQuery($"Select *, ifnull(PT_PAGO2,"") as pt from pedido_ticket where PT_PAGO <> 'VENTA' and PT_PAGO <> 'MULTI-TICKET' order by PT_PAGO desc, PT_TICKET"$)
|
Dim rs_hist As ResultSet = Starter.skmt.ExecQuery($"Select *, ifnull(PT_PAGO2,"") as pt from pedido_ticket where PT_PAGO <> 'VENTA' and PT_PAGO <> 'MULTI-TICKET' order by PT_PAGO desc, PT_TICKET"$)
|
||||||
If rs_hist.RowCount > 0 Then
|
If rs_hist.RowCount > 0 Then
|
||||||
l_historialVacio.Visible = False
|
l_historialVacio.Visible = False
|
||||||
Private cs As CSBuilder
|
Private cs As CSBuilder
|
||||||
@@ -1047,7 +1048,7 @@ Sub llenaHistorial
|
|||||||
pt = "Amex"
|
pt = "Amex"
|
||||||
else if rs_hist.GetString("pt") = "Efectivo" Then
|
else if rs_hist.GetString("pt") = "Efectivo" Then
|
||||||
pt = "Efectivo"
|
pt = "Efectivo"
|
||||||
Else
|
Else
|
||||||
pt = rs_hist.GetString("pt")
|
pt = rs_hist.GetString("pt")
|
||||||
End If
|
End If
|
||||||
Private co As String = rs_hist.GetString("PT_COMENSALES")
|
Private co As String = rs_hist.GetString("PT_COMENSALES")
|
||||||
@@ -1383,7 +1384,11 @@ Private Sub b_mesaCerrar_Click
|
|||||||
End If
|
End If
|
||||||
pagoPropina = "Amex"
|
pagoPropina = "Amex"
|
||||||
cb_pagoPropina.SelectedIndex = 0
|
cb_pagoPropina.SelectedIndex = 0
|
||||||
cb_pago2.SelectedIndex = 0
|
Try
|
||||||
|
cb_pago2.SelectedIndex = 0
|
||||||
|
Catch
|
||||||
|
Log(LastException)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub b_mesaEditar_Click
|
Private Sub b_mesaEditar_Click
|
||||||
@@ -1473,7 +1478,7 @@ Private Sub b_pagoCerrar_Click
|
|||||||
If et_propina.Text <> "" Then
|
If et_propina.Text <> "" Then
|
||||||
laPropina = et_propina.Text
|
laPropina = et_propina.Text
|
||||||
End If
|
End If
|
||||||
If tipoPago = "TARJETA" Then 'primeraVez And
|
If tipoPago = "TARJETA" Then 'primeraVez And
|
||||||
Log("INSERTAMOS TARJETA")
|
Log("INSERTAMOS TARJETA")
|
||||||
Log($"${listaFormaDePago.Get(fdp)}"$)
|
Log($"${listaFormaDePago.Get(fdp)}"$)
|
||||||
Private pa As ResultSet = Starter.skmt.ExecQuery($"select * from PEDIDO where PE_MESA = '${Starter.mesaActual}' and PE_TICKET = '${sigTicketMT}' and PE_TIPO = 'MULTI-TICKET'"$)
|
Private pa As ResultSet = Starter.skmt.ExecQuery($"select * from PEDIDO where PE_MESA = '${Starter.mesaActual}' and PE_TICKET = '${sigTicketMT}' and PE_TIPO = 'MULTI-TICKET'"$)
|
||||||
@@ -1792,6 +1797,14 @@ Sub Printer1_Error
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub b_imp_Click
|
Sub b_imp_Click
|
||||||
|
b_impAB_Click
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub b_imp_LongClick
|
||||||
|
imprimeResumenMesas
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub imprimeResumenMesas
|
||||||
Private imprimirAqui As Boolean = Starter.imprimirTicket
|
Private imprimirAqui As Boolean = Starter.imprimirTicket
|
||||||
Private sDate, sTime As String
|
Private sDate, sTime As String
|
||||||
Private c As Cursor
|
Private c As Cursor
|
||||||
@@ -1904,12 +1917,10 @@ Sub b_imp_Click
|
|||||||
If imprimirAqui Then Printer1.WriteString($"${CRLF}Total Tarjeta: ${NumberFormat2(tt.GetString("total"), 1,2,2,True)}${CRLF}"$)
|
If imprimirAqui Then Printer1.WriteString($"${CRLF}Total Tarjeta: ${NumberFormat2(tt.GetString("total"), 1,2,2,True)}${CRLF}"$)
|
||||||
cs.color(Colors.RGB(1,127,1)).Append($"Total Efectivo: ${NumberFormat2(totalEfectivo, 1,2,2,True)}${CRLF}"$).popall
|
cs.color(Colors.RGB(1,127,1)).Append($"Total Efectivo: ${NumberFormat2(totalEfectivo, 1,2,2,True)}${CRLF}"$).popall
|
||||||
If imprimirAqui Then Printer1.WriteString($"Total Efectivo: ${NumberFormat2(totalEfectivo, 1,2,2,True)}${CRLF}"$)
|
If imprimirAqui Then Printer1.WriteString($"Total Efectivo: ${NumberFormat2(totalEfectivo, 1,2,2,True)}${CRLF}"$)
|
||||||
Else
|
Else
|
||||||
cs.color(Colors.RGB(1,127,1)).Append($"${CRLF}Total: ${NumberFormat2(tt.GetString("total"), 1,2,2,True)}${CRLF}"$).popall
|
cs.color(Colors.RGB(1,127,1)).Append($"${CRLF}Total: ${NumberFormat2(tt.GetString("total"), 1,2,2,True)}${CRLF}"$).popall
|
||||||
If imprimirAqui Then Printer1.WriteString($"${CRLF}Total: ${NumberFormat2(tt.GetString("total"), 1,2,2,True)}${CRLF}"$)
|
If imprimirAqui Then Printer1.WriteString($"${CRLF}Total: ${NumberFormat2(tt.GetString("total"), 1,2,2,True)}${CRLF}"$)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
l_resumen.Text = cs
|
l_resumen.Text = cs
|
||||||
l_resumen.Height = su.MeasureMultilineTextHeight(l_resumen, l_resumen.Text)
|
l_resumen.Height = su.MeasureMultilineTextHeight(l_resumen, l_resumen.Text)
|
||||||
sv_resumen.Panel.Height = l_resumen.Height
|
sv_resumen.Panel.Height = l_resumen.Height
|
||||||
@@ -1941,6 +1952,14 @@ Sub b_imp_Click
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub b_imp2_Click
|
Sub b_imp2_Click
|
||||||
|
imprimeResumenGrupos
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Sub b_imp2_LongClick
|
||||||
|
' b_impAB_Click
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Sub imprimeResumenGrupos
|
||||||
Private imprimirAqui As Boolean = Starter.imprimirTicket
|
Private imprimirAqui As Boolean = Starter.imprimirTicket
|
||||||
Private sDate, sTime As String
|
Private sDate, sTime As String
|
||||||
Private c As Cursor
|
Private c As Cursor
|
||||||
@@ -2003,7 +2022,7 @@ Sub b_imp2_Click
|
|||||||
Private c As Cursor = Starter.skmt.ExecQuery($"select M_ESTATUS from CAT_MESAS where M_ESTATUS = 'ABIERTA'"$)
|
Private c As Cursor = Starter.skmt.ExecQuery($"select M_ESTATUS from CAT_MESAS where M_ESTATUS = 'ABIERTA'"$)
|
||||||
' Log(c.RowCount)
|
' Log(c.RowCount)
|
||||||
' If c.RowCount = 0 Then 'Si no hay mesas abiertas entonces ...
|
' If c.RowCount = 0 Then 'Si no hay mesas abiertas entonces ...
|
||||||
Private c As Cursor = Starter.skmt.ExecQuery("select distinct PE_PRONOMBRE, PE_PROID, CAT_GP_TIPO2, 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 where PE_TIPO <> 'VENTA' group by CAT_GP_TIPO2, PE_PRONOMBRE order by CAT_GP_ORDEN_GRUPOS, CAT_GP_TIPO2, PE_PRONOMBRE") '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.
|
Private c As Cursor = Starter.skmt.ExecQuery("select distinct PE_PRONOMBRE, PE_PROID, CAT_GP_TIPO2, 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 where PE_TIPO <> 'VENTA' and PE_TIPO <> 'MULTI-TICKET' group by CAT_GP_TIPO2, PE_PRONOMBRE order by CAT_GP_ORDEN_GRUPOS, CAT_GP_TIPO2, PE_PRONOMBRE") '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(c.RowCount)
|
' Log(c.RowCount)
|
||||||
If c.RowCount > 0 Then
|
If c.RowCount > 0 Then
|
||||||
c.Position = 0
|
c.Position = 0
|
||||||
@@ -2016,77 +2035,81 @@ Sub b_imp2_Click
|
|||||||
Printer1.WriteString(Printer1.BOLD)
|
Printer1.WriteString(Printer1.BOLD)
|
||||||
If imprimirAqui Then Printer1.WriteString($"*** GRUPOS ***${CRLF}"$)
|
If imprimirAqui Then Printer1.WriteString($"*** GRUPOS ***${CRLF}"$)
|
||||||
Printer1.WriteString(Printer1.NOBOLD)
|
Printer1.WriteString(Printer1.NOBOLD)
|
||||||
For i = 0 To c.RowCount - 1
|
' For i = 0 To c.RowCount - 1
|
||||||
c.Position = i
|
' c.Position = i
|
||||||
' Log($"${catAnt} - ${c.GetString("CAT_GP_TIPO2")}"$)
|
'' Log($"${catAnt} - ${c.GetString("CAT_GP_TIPO2")}"$)
|
||||||
If catAnt <> c.GetString("CAT_GP_TIPO2") Then
|
' If catAnt <> c.GetString("CAT_GP_TIPO2") Then
|
||||||
' Private tm As Cursor = Starter.skmt.ExecQuery($"select sum(PT_MONTO) as totalMesa from PEDIDO_TICKET where PT_MESA = '${c.GetString("PE_MESA")}' and PT_PAGO <> 'MULTI-TICKET'"$)
|
'' Private tm As Cursor = Starter.skmt.ExecQuery($"select sum(PT_MONTO) as totalMesa from PEDIDO_TICKET where PT_MESA = '${c.GetString("PE_MESA")}' and PT_PAGO <> 'MULTI-TICKET'"$)
|
||||||
' tm.Position = 0
|
'' tm.Position = 0
|
||||||
If catAnt <> "" Then
|
' If catAnt <> "" Then
|
||||||
|
' Private primerEspacioLargo As Int = 45 - "Total ".Length - catAnt.Length - 5 - catTotal.Length - NumberFormat2(catMontoTotal,1,0,0,True).Length
|
||||||
Private primerEspacioLargo As Int = 45 - catAnt.Length - ("xxxx".Length + 1) - 6
|
' Private primerEspacio As String = ""
|
||||||
Private primerEspacio As String = ""
|
' For n = 1 To primerEspacioLargo
|
||||||
For n = 1 To primerEspacioLargo
|
' primerEspacio = primerEspacio & "."
|
||||||
primerEspacio = primerEspacio & "."
|
' Next
|
||||||
Next
|
'' Log("primer espacio : " & primerEspacioLargo)
|
||||||
|
' cs.Color(Colors.Green).Append($"Total ${catAnt}: ${catTotal}${primerEspacio}$${NumberFormat2(catMontoTotal,1,0,0,True)}${CRLF}"$).pop
|
||||||
cs.Color(Colors.Green).Append($"Total ${catAnt}: ${catTotal}${primerEspacio}$${NumberFormat2(catMontoTotal,1,2,2,True)}${CRLF}"$).pop
|
' Log($"Total ${catAnt}: ${catTotal}${primerEspacio}$${NumberFormat2(catMontoTotal,1,0,0,True)}${CRLF}"$)
|
||||||
Log($"Total ${catAnt}: ${catTotal}${primerEspacio}$${NumberFormat2(catMontoTotal,1,2,2,True)}${CRLF}"$)
|
' If imprimirAqui Then
|
||||||
If imprimirAqui Then
|
' Printer1.WriteString(Printer1.BOLD)
|
||||||
Printer1.WriteString(Printer1.BOLD)
|
' Printer1.WriteString($"Total ${catAnt}: ${catTotal}${primerEspacio}$${NumberFormat2(catMontoTotal,1,0,0,True)}${CRLF}${CRLF}"$)
|
||||||
Printer1.WriteString($"Total ${catAnt}: ${catTotal}${primerEspacio}$${NumberFormat2(catMontoTotal,1,2,2,True)}${CRLF}${CRLF}"$)
|
' Printer1.WriteString(Printer1.NOBOLD)
|
||||||
Printer1.WriteString(Printer1.NOBOLD)
|
' End If
|
||||||
End If
|
'' Log($">>>>>>> CAT TOTAL ${catAnt}: ${catTotal}"$ )
|
||||||
' Log($">>>>>>> CAT TOTAL ${catAnt}: ${catTotal}"$ )
|
' End If
|
||||||
End If
|
' cs.Color(Colors.red).Append($"++ ${c.GetString("CAT_GP_TIPO2")} ++${CRLF}"$).pop
|
||||||
cs.Color(Colors.red).Append($"++ ${c.GetString("CAT_GP_TIPO2")} ++${CRLF}"$).pop
|
' LogColor($"++ ${c.GetString("CAT_GP_TIPO2")} ++${CRLF}"$, Colors.blue)
|
||||||
LogColor($"++ ${c.GetString("CAT_GP_TIPO2")} ++${CRLF}"$, Colors.blue)
|
' Printer1.WriteString(Printer1.BOLD)
|
||||||
Printer1.WriteString(Printer1.BOLD)
|
' If imprimirAqui Then Printer1.WriteString($"++ ${c.GetString("CAT_GP_TIPO2")} ++${CRLF}"$)
|
||||||
If imprimirAqui Then Printer1.WriteString($"++ ${c.GetString("CAT_GP_TIPO2")} ++${CRLF}"$)
|
' Printer1.WriteString(Printer1.NOBOLD)
|
||||||
Printer1.WriteString(Printer1.NOBOLD)
|
' Private tipoAnt As String = ""
|
||||||
Private tipoAnt As String = ""
|
' catTotal = 0
|
||||||
catTotal = 0
|
' catMontoTotal = 0
|
||||||
catMontoTotal = 0
|
' End If
|
||||||
End If
|
' Private elNombre As String = c.GetString("PE_PRONOMBRE")
|
||||||
Private elNombre As String = c.GetString("PE_PRONOMBRE")
|
' If c.GetString("PE_PROID").StartsWith("LA") Then
|
||||||
If c.GetString("PE_PROID").StartsWith("LA") Then
|
' Private nn As ResultSet = Starter.skmt.ExecQuery($"select CAT_GP_NOMBRE from CAT_GUNAPROD where CAT_GP_ID = '${c.GetString("PE_PROID")}'"$)
|
||||||
Private nn As ResultSet = Starter.skmt.ExecQuery($"select CAT_GP_NOMBRE from CAT_GUNAPROD where CAT_GP_ID = '${c.GetString("PE_PROID")}'"$)
|
' Do While nn.NextRow
|
||||||
Do While nn.NextRow
|
' elNombre = nn.GetString("CAT_GP_NOMBRE")
|
||||||
elNombre = nn.GetString("CAT_GP_NOMBRE")
|
' Loop
|
||||||
Loop
|
' End If
|
||||||
End If
|
' Private monto As String = NumberFormat2(c.GetString("monto"), 1, 0, 0, True)
|
||||||
Private monto As String = NumberFormat2(c.GetString("monto"), 1, 0, 0, True)
|
' Private cuantos As String = c.GetString("cuantos")
|
||||||
Private cuantos As String = c.GetString("cuantos")
|
' Private nom() As String = Regex.Split("\$", elNombre)
|
||||||
Private nom() As String = Regex.Split("\$", elNombre)
|
' If nom.Length > 1 Then elNombre = nom(0)
|
||||||
If nom.Length > 1 Then elNombre = nom(0)
|
' If elNombre.Length > 45 Then elNombre = elNombre.SubString2(0, 45)
|
||||||
If elNombre.Length > 45 Then elNombre = elNombre.SubString2(0, 45)
|
' Log($"${elNombre} - ${c.GetString("cuantos")} .. $${monto}"$) '${c.Position} - ${elNombre.Length} -
|
||||||
Log($"${elNombre} - ${c.GetString("cuantos")} .. $${monto}"$) '${c.Position} - ${elNombre.Length} -
|
' cs.Color(Colors.DarkGray).Append($"${elNombre} - ${c.GetString("cuantos")} .. $${monto} ${CRLF}"$).pop
|
||||||
cs.Color(Colors.DarkGray).Append($"${elNombre} - ${c.GetString("cuantos")} .. $${monto} ${CRLF}"$).pop
|
'' Log(cs.Length)
|
||||||
' Log(cs.Length)
|
' Private primerEspacioLargo As Int = 45 - elNombre.Length - c.GetString("cuantos").Length - (monto.Length + 1) - 6
|
||||||
|
' Private primerEspacio As String = ""
|
||||||
Private primerEspacioLargo As Int = 45 - elNombre.Length - (cuantos.Length + 1) - 6
|
' For n = 1 To primerEspacioLargo
|
||||||
Private primerEspacio As String = ""
|
' primerEspacio = primerEspacio & "."
|
||||||
For n = 1 To primerEspacioLargo
|
' Next
|
||||||
primerEspacio = primerEspacio & "."
|
'' If imprimirAqui Then Printer1.WriteString($"${elNombre}${Subs.alineaDerecha(c.GetString("cuantos"), (31 - elNombre.Length), ".")} ${CRLF}"$)
|
||||||
Next
|
' If imprimirAqui Then Printer1.WriteString($"${elNombre}${primerEspacio}${c.GetString("cuantos")}..$${monto} ${CRLF}"$)
|
||||||
' If imprimirAqui Then Printer1.WriteString($"${elNombre}${Subs.alineaDerecha(c.GetString("cuantos"), (31 - elNombre.Length), ".")} ${CRLF}"$)
|
' catTotal = catTotal + c.GetString("cuantos")
|
||||||
If imprimirAqui Then Printer1.WriteString($"${elNombre}${primerEspacio}${c.GetString("cuantos")}..$${monto} ${CRLF}"$)
|
' catMontoTotal = catMontoTotal + c.GetString("monto")
|
||||||
catTotal = catTotal + c.GetString("cuantos")
|
'' Log($">>>> ${catAnt} - ${c.GetString("CAT_GP_TIPO2")}"$)
|
||||||
catMontoTotal = catMontoTotal + c.GetString("monto")
|
' If i = c.RowCount - 1 Then
|
||||||
' Log($">>>> ${catAnt} - ${c.GetString("CAT_GP_TIPO2")}"$)
|
' Private primerEspacioLargo As Int = 45 - "Total ".Length - c.GetString("CAT_GP_TIPO2").Length - 5 - catTotal.Length - NumberFormat2(catMontoTotal,1,0,0,True).Length
|
||||||
If i = c.RowCount - 1 Then
|
' Private primerEspacio As String = ""
|
||||||
Log($"Total ${c.GetString("CAT_GP_TIPO2")}: ${catTotal} ${primerEspacio}$${NumberFormat2(catMontoTotal,1,2,2,True)}${CRLF}"$)
|
' For n = 1 To primerEspacioLargo
|
||||||
cs.Color(Colors.Green).Append($"Total ${c.GetString("CAT_GP_TIPO2")}: ${catTotal} ${primerEspacio}$${NumberFormat2(catMontoTotal,1,2,2,True)}${CRLF}"$).pop
|
' primerEspacio = primerEspacio & "."
|
||||||
If imprimirAqui Then
|
' Next
|
||||||
Printer1.WriteString(Printer1.BOLD)
|
'' Log("PRIMER ESPACIO:" & primerEspacio.Length)
|
||||||
Printer1.WriteString($"Total ${c.GetString("CAT_GP_TIPO2")}: ${catTotal} ${primerEspacio}$${NumberFormat2(catMontoTotal,1,2,2,True)}${CRLF}"$)
|
' Log($"Total ${c.GetString("CAT_GP_TIPO2")}: ${catTotal} ${primerEspacio}$${NumberFormat2(catMontoTotal,1,0,0,True)}${CRLF}"$)
|
||||||
Printer1.WriteString(Printer1.NOBOLD)
|
' cs.Color(Colors.Green).Append($"Total ${c.GetString("CAT_GP_TIPO2")}: ${catTotal} ${primerEspacio}$${NumberFormat2(catMontoTotal,1,0,0,True)}${CRLF}"$).pop
|
||||||
End If
|
' If imprimirAqui Then
|
||||||
End If
|
' Printer1.WriteString(Printer1.BOLD)
|
||||||
Private tipoAnt As String = ""
|
' Printer1.WriteString($"Total ${c.GetString("CAT_GP_TIPO2")}: ${catTotal} ${primerEspacio}$${NumberFormat2(catMontoTotal,1,0,0,True)}${CRLF}"$)
|
||||||
catAnt = c.GetString("CAT_GP_TIPO2")
|
' Printer1.WriteString(Printer1.NOBOLD)
|
||||||
' Log(i)
|
' End If
|
||||||
Next
|
' End If
|
||||||
|
' Private tipoAnt As String = ""
|
||||||
|
' catAnt = c.GetString("CAT_GP_TIPO2")
|
||||||
|
'' Log(i)
|
||||||
|
' Next
|
||||||
If imprimirAqui Then Printer1.WriteString(CRLF)
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
|
||||||
' l_resumen.Text = cs
|
' l_resumen.Text = cs
|
||||||
@@ -2100,27 +2123,154 @@ Sub b_imp2_Click
|
|||||||
Private rsm As Cursor = Starter.skmt.ExecQuery($"select distinct CAT_GP_TIPO2, sum(pe_cant) as cuantos, sum(pe_costo_tot) as monto from pedido join CAT_GUNAPROD on cat_gp_id = PE_PROID where PE_TIPO <> 'VENTA' group by CAT_GP_TIPO2 order by CAT_GP_ORDEN_GRUPOS, CAT_GP_TIPO2"$) '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.
|
Private rsm As Cursor = Starter.skmt.ExecQuery($"select distinct CAT_GP_TIPO2, sum(pe_cant) as cuantos, sum(pe_costo_tot) as monto from pedido join CAT_GUNAPROD on cat_gp_id = PE_PROID where PE_TIPO <> 'VENTA' group by CAT_GP_TIPO2 order by CAT_GP_ORDEN_GRUPOS, CAT_GP_TIPO2"$) '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)
|
' Log(rsm.RowCount)
|
||||||
If rsm.RowCount > 0 Then
|
If rsm.RowCount > 0 Then
|
||||||
Printer1.WriteString(Printer1.BOLD)
|
|
||||||
If imprimirAqui Then Printer1.WriteString($"*** RESUMEN *** ${CRLF}"$)
|
|
||||||
Log($"*** RESUMEN ***${CRLF}"$)
|
' Printer1.WriteString(Printer1.BOLD)
|
||||||
cs.Color(Colors.red).Append($"** RESUMEN **${CRLF}"$).pop
|
' If imprimirAqui Then Printer1.WriteString($"*** GRUPOS *** ${CRLF}"$)
|
||||||
Printer1.WriteString(Printer1.NOBOLD)
|
' Log($"*** GRUPOS ***${CRLF}"$)
|
||||||
For i = 0 To rsm.RowCount - 1
|
' cs.Color(Colors.red).Append($"*** GRUPOS ***${CRLF}"$).pop
|
||||||
rsm.Position = i
|
' Printer1.WriteString(Printer1.NOBOLD)
|
||||||
Private laCat As String = rsm.GetString("CAT_GP_TIPO2")
|
|
||||||
If laCat.Length > 20 Then laCat = laCat.SubString2(0, 20)
|
|
||||||
' Log($"${rsm.Position} - ${laCat.Length} - ${laCat}"$)
|
|
||||||
Private monto As String = NumberFormat2(rsm.GetString("monto"), 1, 0, 0, True)
|
' For i = 0 To rsm.RowCount - 1
|
||||||
Private cuantos As String = rsm.GetString("cuantos")
|
' rsm.Position = i
|
||||||
|
' Private laCat As String = rsm.GetString("CAT_GP_TIPO2")
|
||||||
|
' If laCat.Length > 20 Then laCat = laCat.SubString2(0, 20)
|
||||||
|
'' Log($"${rsm.Position} - ${laCat.Length} - ${laCat}"$)
|
||||||
|
' Private monto As String = NumberFormat2(rsm.GetString("monto"), 1, 0, 0, True)
|
||||||
|
' Private cuantos As String = rsm.GetString("cuantos")
|
||||||
|
' Private primerEspacioLargo As Int = 30 - laCat.Length - (cuantos.Length + 1) - 6
|
||||||
|
' Private primerEspacio As String = ""
|
||||||
|
' For n = 1 To primerEspacioLargo
|
||||||
|
' primerEspacio = primerEspacio & "."
|
||||||
|
' Next
|
||||||
|
' If imprimirAqui Then Printer1.WriteString($"${laCat}${primerEspacio}${cuantos}..$${monto} ${CRLF}"$)
|
||||||
|
' cs.Color(Colors.DarkGray).Append($"${laCat}${primerEspacio}${cuantos}..$${monto} ${CRLF}"$).pop
|
||||||
|
' Log($"${laCat}${primerEspacio}${cuantos}..$${monto} ${CRLF}"$)
|
||||||
|
' Next
|
||||||
|
|
||||||
|
Private totAlimentos As String = "0"
|
||||||
|
Private totBebidas As String = "0"
|
||||||
|
Private cuantosAlimentos As String = "0"
|
||||||
|
Private cuantosBebidas As String = "0"
|
||||||
|
Private laCat, laCatAnt As String = ""
|
||||||
|
Private cuantos As String = 0
|
||||||
|
|
||||||
|
Private grps As ResultSet = Starter.skmt.ExecQuery($"select PE_MESA, PE_PRONOMBRE, PE_TIPO, ifnull(PE_DESC,0) as PE_DESC,PE_COSTO_TOT, PE_CANT, CAT_GP_TIPO, CAT_GP_TIPO2, CAT_GP_ORDEN_GRUPOS from pedido join CAT_GUNAPROD on cat_gp_id = PE_PROID where PE_TIPO <> 'VENTA' and PE_TIPO <> 'MULTI-TICKET' and pe_ticket <> 'null' order by CAT_GP_ORDEN_GRUPOS, PE_PRONOMBRE"$)
|
||||||
|
Private elProd, prodAnt As String
|
||||||
|
Private grpsCant As String = "0"
|
||||||
|
Private grpsProdCant As String = "0"
|
||||||
|
Private grpsCantAnt As String = "0"
|
||||||
|
Private grpsMonto As String = "0"
|
||||||
|
Private grpsProdMonto As String = "0"
|
||||||
|
Private grpsMontoAnt As String = "0"
|
||||||
|
Private mProds As Map '= CreateMap("prod":"", "info":"")
|
||||||
|
Private mGrupos As Map
|
||||||
|
mProds.Initialize
|
||||||
|
mGrupos.Initialize
|
||||||
|
Do While grps.NextRow
|
||||||
|
Private laCat As String = grps.GetString("CAT_GP_TIPO2")
|
||||||
|
' If laCat <> laCatAnt Then
|
||||||
|
' Log("** " & laCat & " **")
|
||||||
|
' End If
|
||||||
|
Private n2() As String = Regex.Split("\$", grps.GetString("PE_PRONOMBRE"))
|
||||||
|
' Private m As Map = CreateMap("prod":"", "grupo":"", "cant":"","monto":"")
|
||||||
|
If grps.GetString("PE_PRONOMBRE") <> prodAnt Then
|
||||||
|
grpsProdCant = 0
|
||||||
|
grpsProdMonto = 0
|
||||||
|
End If
|
||||||
|
Log("") 'NO BORRAR O COMENTAR ESTE LOG, PORQUE MANDA ERROR!!!!
|
||||||
|
' Log(">>>>> " & n2(0))
|
||||||
|
elProd = grps.GetString("PE_PRONOMBRE")
|
||||||
|
grpsProdCant = grpsProdCant + grps.GetString("PE_CANT")
|
||||||
|
Private elMonto2 As String = grps.GetString("PE_COSTO_TOT")
|
||||||
|
If grps.GetString("CAT_GP_TIPO2") = "ALIMENTOS" And grps.GetString("PE_DESC") > 0 Then
|
||||||
|
elMonto2 = elMonto2 - ((grps.GetString("PE_DESC")/100) * elMonto2)
|
||||||
|
End If
|
||||||
|
' Log(elMonto2)
|
||||||
|
grpsProdMonto = grpsProdMonto + elMonto2
|
||||||
|
Private m As Map = CreateMap("prod":elProd, "grupo":laCat, "cant":grpsProdCant,"monto":grpsProdMonto)
|
||||||
|
mProds.Put(elProd, m)
|
||||||
|
prodAnt = grps.GetString("PE_PRONOMBRE")
|
||||||
|
laCatAnt = laCat
|
||||||
|
Loop
|
||||||
|
|
||||||
|
' Log(mProds.Size)
|
||||||
|
laCat = ""
|
||||||
|
Private grpsMontoTotal As String
|
||||||
|
Private grpsCantTotal As String
|
||||||
|
Private totMontoAlimentos As String = "0"
|
||||||
|
Private totCantAlimentos As String = "0"
|
||||||
|
Private totMontoBebidas As String = "0"
|
||||||
|
Private totCantBebidas As String = "0"
|
||||||
|
For Each elProd2 As String In mProds.keys
|
||||||
|
' Log(elProd2)
|
||||||
|
Private tm As Map = mProds.Get(elProd2)
|
||||||
|
' Log(tm)
|
||||||
|
Private elNom As String = tm.Get("prod")
|
||||||
|
Private n3() As String = Regex.Split("\$", tm.Get("prod"))
|
||||||
|
If n3.Length > 1 Then elNom = n3(0)
|
||||||
|
' Log($"${tm.Get("grupo")}, ${elNom}, ${tm.Get("cant")}, ${tm.Get("monto")}"$)
|
||||||
|
|
||||||
|
|
||||||
|
If tm.Get("grupo") <> laCatAnt Then
|
||||||
|
|
||||||
|
If grpsCant > 0 Or grpsMonto > 0 Then 'Imprimimos el total de cantidad y monto del grupo.
|
||||||
|
Private primerEspacioLargo As Int = 30 - laCatAnt.Length - (grpsCant.Length + 1) - 6
|
||||||
|
Private primerEspacio As String = ""
|
||||||
|
For n = 1 To primerEspacioLargo
|
||||||
|
primerEspacio = primerEspacio & "."
|
||||||
|
Next
|
||||||
|
' Log($"${grpsCant}, ${grpsMonto}, |${tm.Get("grupo")}|"$)
|
||||||
|
If laCatAnt = "ALIMENTOS" Then
|
||||||
|
totMontoAlimentos = totMontoAlimentos + Ceil(grpsMonto)
|
||||||
|
totCantAlimentos = totCantAlimentos + grpsCant
|
||||||
|
Else
|
||||||
|
totMontoBebidas = totMontoBebidas + Ceil(grpsMonto)
|
||||||
|
totCantBebidas = totCantBebidas + grpsCant
|
||||||
|
End If
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"Total ${laCatAnt}${primerEspacio}${grpsCant}..$${NumberFormat2(grpsMonto, 1, 0, 0, True)} ${CRLF}"$)
|
||||||
|
Log($" Total ${laCatAnt}: .......... "$ & grpsCant & " ..... " & NumberFormat2(grpsMonto, 1, 0, 0, True))
|
||||||
|
cs.Color(Colors.DarkGray).Append($"Total ${laCatAnt}${primerEspacio}${grpsCant}..$${NumberFormat2(grpsMonto, 1, 0, 0, True)} ${CRLF}"$).pop
|
||||||
|
|
||||||
|
End If
|
||||||
|
grpsCant = 0
|
||||||
|
grpsMonto = 0
|
||||||
|
' Log($"** ${tm.Get("grupo")} **"$)
|
||||||
|
|
||||||
|
If imprimirAqui Then Printer1.WriteString("** " & tm.Get("grupo") & " **" & CRLF)
|
||||||
|
cs.Color(Colors.DarkGray).Bold.Append("** " & tm.Get("grupo") & " **" & CRLF).pop
|
||||||
|
Log("** " & tm.Get("grupo") & " **")
|
||||||
|
End If
|
||||||
|
|
||||||
Private primerEspacioLargo As Int = 30 - laCat.Length - (cuantos.Length + 1) - 6
|
Private primerEspacioLargo As Int = 30 - laCat.Length - (cuantos.Length + 1) - 6
|
||||||
Private primerEspacio As String = ""
|
Private primerEspacio As String = ""
|
||||||
For n = 1 To primerEspacioLargo
|
For n = 1 To primerEspacioLargo
|
||||||
primerEspacio = primerEspacio & "."
|
primerEspacio = primerEspacio & "."
|
||||||
Next
|
Next
|
||||||
If imprimirAqui Then Printer1.WriteString($"${laCat}${primerEspacio}${cuantos}..$${monto} ${CRLF}"$)
|
If imprimirAqui Then Printer1.WriteString($"${elNom}${primerEspacio}${tm.Get("cant")}..$${tm.Get("monto")} ${CRLF}"$)
|
||||||
cs.Color(Colors.DarkGray).Append($"${laCat}${primerEspacio}${cuantos}..$${monto} ${CRLF}"$).pop
|
cs.Color(Colors.DarkGray).Append($"${elNom} ..... ${tm.Get("cant")}..$${tm.Get("monto")} ${CRLF}"$).pop
|
||||||
Log($"${laCat}${primerEspacio}${cuantos}..$${monto} ${CRLF}"$)
|
Log($" ${elNom}${primerEspacio}${tm.Get("cant")}..$${tm.Get("monto")} ${CRLF}"$)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
' Log($" ${tm.Get("prod")}, ${tm.Get("cant")}, ${tm.Get("monto")}"$)
|
||||||
|
grpsCant = grpsCant + tm.Get("cant")
|
||||||
|
grpsMonto = grpsMonto + Ceil(tm.Get("monto"))
|
||||||
|
laCatAnt = tm.Get("grupo")
|
||||||
Next
|
Next
|
||||||
|
totMontoBebidas = totMontoBebidas + grpsMonto
|
||||||
|
totCantBebidas = totCantBebidas + grpsCant
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"${laCatAnt}${primerEspacio}${grpsCant}..$${grpsMonto} ${CRLF}"$)
|
||||||
|
Log($"${laCatAnt}: .......... "$ & grpsCant & " ..... " & NumberFormat2(grpsMonto, 1, 0, 0, True))
|
||||||
|
cs.Color(Colors.DarkGray).Append($"${laCatAnt}${primerEspacio}${grpsCant}..$${NumberFormat2(grpsMonto, 1, 0, 0, True)} ${CRLF}"$).pop
|
||||||
|
' Log(grpsCant & "|" & grpsMonto)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'COMENSALES
|
'COMENSALES
|
||||||
LogColor("sleeping ....", Colors.Magenta)
|
LogColor("sleeping ....", Colors.Magenta)
|
||||||
@@ -2210,6 +2360,7 @@ Sub b_imp2_Click
|
|||||||
Printer1.WriteString(Printer1.BOLD)
|
Printer1.WriteString(Printer1.BOLD)
|
||||||
If imprimirAqui Then Printer1.WriteString($"*** PROPINAS *** ${CRLF}"$)
|
If imprimirAqui Then Printer1.WriteString($"*** PROPINAS *** ${CRLF}"$)
|
||||||
Printer1.WriteString(Printer1.NOBOLD)
|
Printer1.WriteString(Printer1.NOBOLD)
|
||||||
|
cs.Append(CRLF)
|
||||||
cs.Color(Colors.red).Append($"** PROPINAS **${CRLF}"$).pop
|
cs.Color(Colors.red).Append($"** PROPINAS **${CRLF}"$).pop
|
||||||
Log("*** PROPINAS ***")
|
Log("*** PROPINAS ***")
|
||||||
Do While prop.NextRow
|
Do While prop.NextRow
|
||||||
@@ -2253,7 +2404,6 @@ Sub b_imp2_Click
|
|||||||
ProgressDialogHide
|
ProgressDialogHide
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Sub b_imp3_Click
|
Sub b_imp3_Click
|
||||||
Private imprimirAqui As Boolean = Starter.imprimirTicket
|
Private imprimirAqui As Boolean = Starter.imprimirTicket
|
||||||
Private sDate, sTime As String
|
Private sDate, sTime As String
|
||||||
@@ -2316,6 +2466,7 @@ Sub b_imp3_Click
|
|||||||
Printer1.WriteString(Printer1.BOLD)
|
Printer1.WriteString(Printer1.BOLD)
|
||||||
If imprimirAqui Then Printer1.WriteString($"*** PROPINAS *** ${CRLF}"$)
|
If imprimirAqui Then Printer1.WriteString($"*** PROPINAS *** ${CRLF}"$)
|
||||||
Printer1.WriteString(Printer1.NOBOLD)
|
Printer1.WriteString(Printer1.NOBOLD)
|
||||||
|
cs.Append(CRLF)
|
||||||
cs.Color(Colors.red).Append($"** PROPINAS **${CRLF}"$).pop
|
cs.Color(Colors.red).Append($"** PROPINAS **${CRLF}"$).pop
|
||||||
Log("*** PROPINAS ***")
|
Log("*** PROPINAS ***")
|
||||||
Private tot As String = 0
|
Private tot As String = 0
|
||||||
@@ -2361,6 +2512,387 @@ Sub b_imp3_Click
|
|||||||
ProgressDialogHide
|
ProgressDialogHide
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Sub b_impAB_Click
|
||||||
|
Private imprimirAqui As Boolean = Starter.imprimirTicket
|
||||||
|
Private sDate, sTime As String
|
||||||
|
Private montoAmex = "0", montoMifel = "0", montoEfectivo = "0" 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_imp.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
|
||||||
|
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'"$)
|
||||||
|
' Log(c.RowCount)
|
||||||
|
|
||||||
|
'RESUMEN
|
||||||
|
' LogColor("sleeping ....", Colors.Magenta)
|
||||||
|
' If imprimirAqui Then Sleep(4000)
|
||||||
|
Private rsm As Cursor = Starter.skmt.ExecQuery($"select distinct CAT_GP_TIPO2, sum(pe_cant) as cuantos, sum(pe_costo_tot) as monto from pedido join CAT_GUNAPROD on cat_gp_id = PE_PROID where PE_TIPO <> 'VENTA' and PE_TIPO <> 'MULTI-TICKET' and pe_ticket <> 'null' group by CAT_GP_TIPO2 order by CAT_GP_ORDEN_GRUPOS, CAT_GP_TIPO2"$) '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
|
||||||
|
Printer1.WriteString(Printer1.BOLD)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"*** RESUMEN *** ${CRLF}"$)
|
||||||
|
Log($"*** RESUMEN ***${CRLF}"$)
|
||||||
|
cs.Color(Colors.red).Append($"** RESUMEN **${CRLF}"$).pop
|
||||||
|
Printer1.WriteString(Printer1.NOBOLD)
|
||||||
|
Private totAlimentos As String = "0"
|
||||||
|
Private totBebidas As String = "0"
|
||||||
|
Private cuantosAlimentos As String = "0"
|
||||||
|
Private cuantosBebidas As String = "0"
|
||||||
|
Private laCat, laCatAnt As String = ""
|
||||||
|
Private cuantos As String = 0
|
||||||
|
' For i = 0 To rsm.RowCount - 1
|
||||||
|
' rsm.Position = i
|
||||||
|
' Private laCat As String = rsm.GetString("CAT_GP_TIPO2")
|
||||||
|
' If laCat.Length > 20 Then laCat = laCat.SubString2(0, 20)
|
||||||
|
'' Log($"${rsm.Position} - ${laCat.Length} - ${laCat}"$)
|
||||||
|
' Private monto As String = NumberFormat2(rsm.GetString("monto"), 1, 0, 0, True)
|
||||||
|
'
|
||||||
|
' If rsm.GetString("CAT_GP_TIPO2") = "ALIMENTOS" Then
|
||||||
|
' totAlimentos = totAlimentos + rsm.GetString("monto")
|
||||||
|
' cuantosAlimentos = cuantosAlimentos + rsm.GetString("cuantos")
|
||||||
|
' Else
|
||||||
|
' totBebidas = totBebidas + rsm.GetString("monto")
|
||||||
|
' cuantosBebidas = cuantosBebidas + rsm.GetString("cuantos")
|
||||||
|
' End If
|
||||||
|
'
|
||||||
|
' Private cuantos As String = rsm.GetString("cuantos")
|
||||||
|
' Private primerEspacioLargo As Int = 30 - laCat.Length - (cuantos.Length + 1) - 6
|
||||||
|
' Private primerEspacio As String = ""
|
||||||
|
' For n = 1 To primerEspacioLargo
|
||||||
|
' primerEspacio = primerEspacio & "."
|
||||||
|
' Next
|
||||||
|
' If imprimirAqui Then Printer1.WriteString($"${laCat}${primerEspacio}${cuantos}..$${monto} ${CRLF}"$)
|
||||||
|
' cs.Color(Colors.DarkGray).Append($"${laCat}${primerEspacio}${cuantos}..$${monto} ${CRLF}"$).pop
|
||||||
|
' Log($"${laCat}${primerEspacio}${cuantos}..$${monto} ${CRLF}"$)
|
||||||
|
' Next
|
||||||
|
|
||||||
|
|
||||||
|
Private grps As ResultSet = Starter.skmt.ExecQuery($"select PE_MESA, PE_PRONOMBRE, PE_TIPO, ifnull(PE_DESC,0) as PE_DESC,PE_COSTO_TOT, PE_CANT, CAT_GP_TIPO, CAT_GP_TIPO2, CAT_GP_ORDEN_GRUPOS from pedido join CAT_GUNAPROD on cat_gp_id = PE_PROID where PE_TIPO <> 'VENTA' and PE_TIPO <> 'MULTI-TICKET' and pe_ticket <> 'null' order by CAT_GP_ORDEN_GRUPOS, PE_PRONOMBRE"$)
|
||||||
|
Private elProd, prodAnt As String
|
||||||
|
Private grpsCant As String = "0"
|
||||||
|
Private grpsProdCant As String = "0"
|
||||||
|
Private grpsCantAnt As String = "0"
|
||||||
|
Private grpsMonto As String = "0"
|
||||||
|
Private grpsProdMonto As String = "0"
|
||||||
|
Private grpsMontoAnt As String = "0"
|
||||||
|
Private mProds As Map '= CreateMap("prod":"", "info":"")
|
||||||
|
Private mGrupos As Map
|
||||||
|
mProds.Initialize
|
||||||
|
mGrupos.Initialize
|
||||||
|
Do While grps.NextRow
|
||||||
|
Private laCat As String = grps.GetString("CAT_GP_TIPO2")
|
||||||
|
' If laCat <> laCatAnt Then
|
||||||
|
' Log(laCat)
|
||||||
|
' End If
|
||||||
|
Private n2() As String = Regex.Split("\$", grps.GetString("PE_PRONOMBRE"))
|
||||||
|
' Private m As Map = CreateMap("prod":"", "grupo":"", "cant":"","monto":"")
|
||||||
|
If grps.GetString("PE_PRONOMBRE") <> prodAnt Then
|
||||||
|
grpsProdCant = 0
|
||||||
|
grpsProdMonto = 0
|
||||||
|
End If
|
||||||
|
Log("") 'NO BORRAR O COMENTAR ESTE LOG, PORQUE MANDA ERROR!!!!
|
||||||
|
' Log(">>>>> " & n2(0))
|
||||||
|
elProd = grps.GetString("PE_PRONOMBRE")
|
||||||
|
grpsProdCant = grpsProdCant + grps.GetString("PE_CANT")
|
||||||
|
Private elMonto2 As String = grps.GetString("PE_COSTO_TOT")
|
||||||
|
If grps.GetString("CAT_GP_TIPO2") = "ALIMENTOS" And grps.GetString("PE_DESC") > 0 Then
|
||||||
|
elMonto2 = elMonto2 - ((grps.GetString("PE_DESC")/100) * elMonto2)
|
||||||
|
End If
|
||||||
|
' Log(elMonto2)
|
||||||
|
grpsProdMonto = grpsProdMonto + elMonto2
|
||||||
|
Private m As Map = CreateMap("prod":elProd, "grupo":laCat, "cant":grpsProdCant,"monto":grpsProdMonto)
|
||||||
|
mProds.Put(elProd, m)
|
||||||
|
prodAnt = grps.GetString("PE_PRONOMBRE")
|
||||||
|
laCatAnt = laCat
|
||||||
|
Loop
|
||||||
|
|
||||||
|
' Log(mProds.Size)
|
||||||
|
laCat = ""
|
||||||
|
Private grpsMontoTotal As String
|
||||||
|
Private grpsCantTotal As String
|
||||||
|
Private totMontoAlimentos As String = "0"
|
||||||
|
Private totCantAlimentos As String = "0"
|
||||||
|
Private totMontoBebidas As String = "0"
|
||||||
|
Private totCantBebidas As String = "0"
|
||||||
|
For Each elProd2 As String In mProds.keys
|
||||||
|
' Log(elProd2)
|
||||||
|
Private tm As Map = mProds.Get(elProd2)
|
||||||
|
' Log(tm)
|
||||||
|
' Log($"${tm.Get("grupo")}, ${tm.Get("prod")}, ${tm.Get("cant")}, ${tm.Get("monto")}"$)
|
||||||
|
If tm.Get("grupo") <> laCatAnt Then
|
||||||
|
If grpsCant > 0 Or grpsMonto > 0 Then
|
||||||
|
Private primerEspacioLargo As Int = 30 - laCatAnt.Length - (grpsCant.Length + 1) - 6
|
||||||
|
Private primerEspacio As String = ""
|
||||||
|
For n = 1 To primerEspacioLargo
|
||||||
|
primerEspacio = primerEspacio & "."
|
||||||
|
Next
|
||||||
|
' Log($"${grpsCant}, ${grpsMonto}, |${tm.Get("grupo")}|"$)
|
||||||
|
If laCatAnt = "ALIMENTOS" Then
|
||||||
|
totMontoAlimentos = totMontoAlimentos + Ceil(grpsMonto)
|
||||||
|
totCantAlimentos = totCantAlimentos + grpsCant
|
||||||
|
Else
|
||||||
|
totMontoBebidas = totMontoBebidas + Ceil(grpsMonto)
|
||||||
|
totCantBebidas = totCantBebidas + grpsCant
|
||||||
|
End If
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"${laCatAnt}${primerEspacio}${grpsCant}..$${NumberFormat2(grpsMonto, 1, 0, 0, True)} ${CRLF}"$)
|
||||||
|
Log($"${laCatAnt}: .......... "$ & grpsCant & " ..... " & NumberFormat2(grpsMonto, 1, 0, 0, True))
|
||||||
|
' cs.Color(Colors.DarkGray).Append($"${laCatAnt}: .......... "$ & grpsCant & " ..... " & NumberFormat2(grpsMonto, 1, 0, 0, True) & CRLF).pop
|
||||||
|
cs.Color(Colors.DarkGray).Append($"${laCatAnt}${primerEspacio}${grpsCant}..$${NumberFormat2(grpsMonto, 1, 0, 0, True)} ${CRLF}"$).pop
|
||||||
|
|
||||||
|
End If
|
||||||
|
grpsCant = 0
|
||||||
|
grpsMonto = 0
|
||||||
|
' Log($"** ${tm.Get("grupo")} **"$)
|
||||||
|
End If
|
||||||
|
' Log($" ${tm.Get("prod")}, ${tm.Get("cant")}, ${tm.Get("monto")}"$)
|
||||||
|
grpsCant = grpsCant + tm.Get("cant")
|
||||||
|
grpsMonto = grpsMonto + Ceil(tm.Get("monto"))
|
||||||
|
laCatAnt = tm.Get("grupo")
|
||||||
|
Next
|
||||||
|
totMontoBebidas = totMontoBebidas + grpsMonto
|
||||||
|
totCantBebidas = totCantBebidas + grpsCant
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"${laCatAnt}${primerEspacio}${grpsCant}..$${grpsMonto} ${CRLF}"$)
|
||||||
|
Log($"${laCatAnt}: .......... "$ & grpsCant & " ..... " & NumberFormat2(grpsMonto, 1, 0, 0, True))
|
||||||
|
cs.Color(Colors.DarkGray).Append($"${laCatAnt}${primerEspacio}${grpsCant}..$${NumberFormat2(grpsMonto, 1, 0, 0, True)} ${CRLF}"$).pop
|
||||||
|
' Log(grpsCant & "|" & grpsMonto)
|
||||||
|
|
||||||
|
'COMENSALES
|
||||||
|
If imprimirAqui Then Sleep(3000)
|
||||||
|
Private coms As Cursor = Starter.skmt.ExecQuery($"select sum(PT_COMENSALES) as totComensales from PEDIDO_TICKET where ifnull(PT_ALMACEN,0) <> 'MULTI-TICKET'"$)
|
||||||
|
Private totalComensales As Int = 0
|
||||||
|
If coms.RowCount > 0 Then
|
||||||
|
coms.Position = 0
|
||||||
|
totalComensales = coms.GetInt("totComensales")
|
||||||
|
End If
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"Comensales ...........${totalComensales} ${CRLF}"$)
|
||||||
|
cs.Color(Colors.DarkGray).Append($"Comensales ..........${totalComensales} ${CRLF}"$).pop
|
||||||
|
Log($"Comensales ..........${totalComensales} ${CRLF}"$)
|
||||||
|
|
||||||
|
'TOTAL ALIMENTOS Y BEBIDAS
|
||||||
|
Log("*** TOTAL CONSUMO ***")
|
||||||
|
Log($"TOTAL ALIMENTOS: ${NumberFormat2(totMontoAlimentos, 1, 0, 0, True)}"$)
|
||||||
|
Log($"TOTAL BEBIDAS: ${NumberFormat2(totMontoBebidas,1,0,0,True)}"$)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"${CRLF}"$)
|
||||||
|
Private primerEspacioLargo As Int = 30 - laCat.Length - (cuantos.Length + 1) - 6
|
||||||
|
Private primerEspacio As String = ""
|
||||||
|
For n = 1 To primerEspacioLargo
|
||||||
|
primerEspacio = primerEspacio & "."
|
||||||
|
Next
|
||||||
|
Printer1.WriteString(Printer1.BOLD)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"*** TOTAL CONSUMO *** ${CRLF}"$)
|
||||||
|
Printer1.WriteString(Printer1.NOBOLD)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"TOTAL ALIMENTOS ....... ${totCantAlimentos} ${Subs.alineaDerecha(NumberFormat2(totMontoAlimentos,1,0,0,True), 35 - $"TOTAL ALIMENTOS ....... ${totCantAlimentos}"$.Length, ".")} ${CRLF}"$)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"TOTAL BEBIDAS ......... ${totCantBebidas} ${Subs.alineaDerecha(NumberFormat2(totMontoBebidas,1,0,0,True), 35 - $"TOTAL BEBIDAS ......... ${totCantBebidas}"$.Length, ".")} ${CRLF}"$)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"TOTAL ${Subs.alineaDerecha(NumberFormat2((totMontoAlimentos+totMontoBebidas),1,0,0,True), 35 - "TOTAL ".Length, ".")} ${CRLF}"$)
|
||||||
|
' If imprimirAqui Then Printer1.WriteString($"${CRLF}"$)
|
||||||
|
cs.Append($"${CRLF}"$)
|
||||||
|
cs.Color(Colors.red).Append($"*** TOTAL DE CONSUMOS ***${CRLF}"$).pop
|
||||||
|
cs.Color(Colors.DarkGray).Append($"TOTAL ALIMENTOS ${Subs.alineaDerecha("$"&NumberFormat2(totMontoAlimentos, 1, 0, 0, True), 45 - "TOTAL ALIMENTOS".Length, ".")} ${CRLF}"$).pop
|
||||||
|
cs.Color(Colors.DarkGray).Append($"TOTAL BEBIDAS ${Subs.alineaDerecha("$"&NumberFormat2(totMontoBebidas, 1, 0, 0, True), 45 - "TOTAL BEBIDAS".Length, ".")} ${CRLF}"$).pop
|
||||||
|
cs.Color(Colors.DarkGray).Append($"TOTAL: ${Subs.alineaDerecha("$"&NumberFormat2(totMontoAlimentos+totMontoBebidas,1,0,0,True), 45 - "TOTAL BEBIDAS".Length, ".")} ${CRLF}"$).pop
|
||||||
|
cs.Append($"${CRLF}"$)
|
||||||
|
Log($"TOTAL ALIMENTOS ...........${NumberFormat2(totMontoAlimentos, 1, 0, 0, True)} ${CRLF}"$)
|
||||||
|
Log($"TOTAL BEBIDAS ...........${NumberFormat2(totMontoBebidas, 1, 0, 0, True)} ${CRLF}"$)
|
||||||
|
'PAGOS
|
||||||
|
' If imprimirAqui Then Sleep(1000)
|
||||||
|
Private pgs As Cursor = Starter.skmt.ExecQuery($"Select PT_PAGO2, sum(PT_NOART) As arts, sum(PT_MONTO) As monto from PEDIDO_TICKET where pt_pago <> 'MULTI-TICKET' and pt_pago <> 'VENTA' group by PT_PAGO2
|
||||||
|
order by CASE PT_PAGO_PROPINA
|
||||||
|
WHEN 'Amex' THEN 0
|
||||||
|
WHEN 'Mifel' THEN 1
|
||||||
|
WHEN 'Efectivo' THEN 2
|
||||||
|
END"$)
|
||||||
|
Private totalComensales As Int = 0
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"${CRLF}"$)
|
||||||
|
Printer1.WriteString(Printer1.BOLD)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"*** PAGOS *** ${CRLF}"$)
|
||||||
|
Printer1.WriteString(Printer1.NOBOLD)
|
||||||
|
cs.Color(Colors.red).Append($"** PAGOS **${CRLF}"$).pop
|
||||||
|
Log("*** PAGOS ***")
|
||||||
|
Private totalPagos As String = 0
|
||||||
|
For i = 0 To pgs.RowCount - 1
|
||||||
|
pgs.Position = i
|
||||||
|
Private elPago As String = pgs.GetString("PT_PAGO2")
|
||||||
|
If elPago.Length > 20 Then elPago = elPago.SubString2(0, 20)
|
||||||
|
' Log($"${pgs.Position} - ${elPago.Length} - ${elPago}"$)
|
||||||
|
Private monto As String = pgs.GetString("monto")
|
||||||
|
Private cuantos As String = pgs.GetString("arts")
|
||||||
|
Private primerEspacioLargo As Int = 30 - elPago.Length - (cuantos.Length + 1) - 6
|
||||||
|
Private primerEspacio As String = ""
|
||||||
|
For n = 1 To primerEspacioLargo
|
||||||
|
primerEspacio = primerEspacio & "."
|
||||||
|
Next
|
||||||
|
' monto = NumberFormat2(monto.As(Double), 1, 0, 0, True)
|
||||||
|
' Log(monto)
|
||||||
|
' Aqui se sacan las PROPINAS para sumarselas a los subtotals de cada pago.
|
||||||
|
Private propAmex = "0", propMifel = "0", propMifelDebito = "0", propEfectivo = "0" As String
|
||||||
|
Private rt As ResultSet = Starter.skmt.ExecQuery($"Select sum(pt_monto) as ptMonto, sum(pt_propina) as ptPropina, * from pedido_ticket where pt_pago <> 'VENTA' and PT_PAGO <> 'MULTI-TICKET' group by pt_pago2"$)
|
||||||
|
Private rtpa As ResultSet = Starter.skmt.ExecQuery($"Select ifnull(sum(pt_propina),0) as ptPropina, * from pedido_ticket where pt_pago_propina = 'Amex' group by pt_pago_propina"$)
|
||||||
|
Do While rtpa.NextRow
|
||||||
|
propAmex = rtpa.GetString("ptPropina")
|
||||||
|
Loop
|
||||||
|
Private rtpmc As ResultSet = Starter.skmt.ExecQuery($"Select ifnull(sum(pt_propina),0) as ptPropina, * from pedido_ticket where pt_pago_propina = 'Mifel' group by pt_pago_propina"$)
|
||||||
|
Do While rtpmc.NextRow
|
||||||
|
propMifel = rtpmc.GetString("ptPropina")
|
||||||
|
Loop
|
||||||
|
' Private rtpmd As ResultSet = Starter.skmt.ExecQuery($"Select ifnull(sum(pt_propina),0) as ptPropina, * from pedido_ticket where pt_pago_propina = 'Visa/Mastercard Debito' group by pt_pago_propina"$)
|
||||||
|
' Do While rtpmd.NextRow
|
||||||
|
' propMifelDebito = rtpmd.GetString("ptPropina")
|
||||||
|
' Loop
|
||||||
|
Private rtpe As ResultSet = Starter.skmt.ExecQuery($"Select ifnull(sum(pt_propina),0) as ptPropina, * from pedido_ticket where pt_pago_propina = 'Efectivo' group by pt_pago_propina"$)
|
||||||
|
Do While rtpe.NextRow
|
||||||
|
propEfectivo = rtpe.GetString("ptPropina")
|
||||||
|
Loop
|
||||||
|
If elPago = "Amex" Then
|
||||||
|
' Log("ES AMEX")
|
||||||
|
montoAmex = monto
|
||||||
|
monto = monto + propAmex
|
||||||
|
else If elPago = "Mifel" Then
|
||||||
|
' Log("ES MIFEL")
|
||||||
|
montoMifel = monto
|
||||||
|
monto = monto + propMifel
|
||||||
|
else If elPago = "Efectivo" Then
|
||||||
|
montoEfectivo = monto
|
||||||
|
monto = monto + propEfectivo
|
||||||
|
End If
|
||||||
|
' Log($"########## ${elPago}, ${monto}, ${propAmex}, ${propMifel} "$)
|
||||||
|
' Log($"${elPago} - ${monto}"$)
|
||||||
|
If elPago = "Amex" Then elPago = "Amex"
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"${elPago}${primerEspacio}.. $${NumberFormat2(monto, 1, 0, 0, True)} ${CRLF}"$)
|
||||||
|
cs.Color(Colors.DarkGray).Append($"${elPago}${primerEspacio}.. $${NumberFormat2(monto, 1, 0, 0, True)} ${CRLF}"$).pop
|
||||||
|
Log($"${elPago}${primerEspacio}.. $${NumberFormat2(monto, 1, 0, 0, True)} ${CRLF}"$)
|
||||||
|
totalPagos = totalPagos + monto
|
||||||
|
Next
|
||||||
|
totalPagos = NumberFormat2(totalPagos, 1, 0, 0, True)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"TOTAL PAGOS ........... $${totalPagos} ${CRLF}"$)
|
||||||
|
cs.Color(Colors.DarkGray).Append($"TOTAL PAGOS: ........... $${totalPagos} ${CRLF}"$).pop
|
||||||
|
Log($"TOTAL PAGOS: .........${i}.. $${totalPagos} ${CRLF}"$)
|
||||||
|
|
||||||
|
'PROPINAS
|
||||||
|
' If imprimirAqui Then Sleep(1000)
|
||||||
|
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
|
||||||
|
order by CASE PT_PAGO_PROPINA
|
||||||
|
WHEN 'Amex' THEN 0
|
||||||
|
WHEN 'Mifel' THEN 1
|
||||||
|
WHEN 'Efectivo' THEN 2
|
||||||
|
END"$)
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
Printer1.WriteString(Printer1.BOLD)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"*** PROPINAS *** ${CRLF}"$)
|
||||||
|
Printer1.WriteString(Printer1.NOBOLD)
|
||||||
|
cs.Append(CRLF)
|
||||||
|
cs.Color(Colors.red).Append($"** PROPINAS **${CRLF}"$).pop
|
||||||
|
Log("*** PROPINAS ***")
|
||||||
|
Private totPropinas 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), ".")} "$)
|
||||||
|
totPropinas = totPropinas + laPropina
|
||||||
|
End If
|
||||||
|
Loop
|
||||||
|
'TOTAL PROPINAS
|
||||||
|
If imprimirAqui Then
|
||||||
|
Printer1.WriteString(Printer1.BOLD)
|
||||||
|
Printer1.WriteString($"Total: ${Subs.alineaDerecha("$"&NumberFormat2(totPropinas, 1, 2, 2, True), (30 - "Total: ".Length), ".")} ${CRLF}"$)
|
||||||
|
Printer1.WriteString(Printer1.NOBOLD)
|
||||||
|
End If
|
||||||
|
cs.Color(Colors.DarkGray).Append($"Total: ${Subs.alineaDerecha("$"&NumberFormat2(totPropinas, 1, 2, 2, True), (30 - "Total: ".Length), ".")} ${CRLF}"$).pop
|
||||||
|
Log($"Total: ${Subs.alineaDerecha("$"&NumberFormat2(totPropinas, 1, 0, 0, True), (30 - totPropinas.Length), ".")} "$)
|
||||||
|
|
||||||
|
'TOTAL SIN PROPINAS
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
Printer1.WriteString(Printer1.BOLD)
|
||||||
|
If imprimirAqui Then Printer1.WriteString($"*** PAGOS SIN PROPINAS *** ${CRLF}"$)
|
||||||
|
Printer1.WriteString(Printer1.NOBOLD)
|
||||||
|
cs.Append(CRLF)
|
||||||
|
cs.Color(Colors.red).Append($"** TOTAL SIN PROPINAS **${CRLF}"$).pop
|
||||||
|
Log("*** TOTAL SIN PROPINAS ***")
|
||||||
|
If imprimirAqui Then
|
||||||
|
Printer1.WriteString($"Total Tarjetas: ${Subs.alineaDerecha("$"&NumberFormat2(montoAmex+montoMifel, 1, 2, 2, True), (30 - "Total Tarjetas: ".Length), ".")} ${CRLF}"$)
|
||||||
|
Printer1.WriteString($"Total Efectivo: ${Subs.alineaDerecha("$"&NumberFormat2(montoEfectivo, 1, 2, 2, True), (30 - "Total Efectivo: ".Length), ".")} ${CRLF}"$)
|
||||||
|
Printer1.WriteString($"Total: ${Subs.alineaDerecha("$"&NumberFormat2(montoAmex+montoMifel+montoEfectivo, 1, 2, 2, True), (30 - "Total: ".Length), ".")} ${CRLF}"$)
|
||||||
|
End If
|
||||||
|
cs.Color(Colors.DarkGray).Append($"Total Tarjetas: ${Subs.alineaDerecha("$"&NumberFormat2(montoAmex+montoMifel, 1, 2, 2, True), (30 - "Total Tarjetas: ".Length), ".")} ${CRLF}"$).pop
|
||||||
|
cs.Color(Colors.DarkGray).Append($"Total Efectivo: ${Subs.alineaDerecha("$"&NumberFormat2(montoEfectivo, 1, 2, 2, True), (30 - "Total Efectivo: ".Length), ".")} ${CRLF}"$).pop
|
||||||
|
cs.Color(Colors.DarkGray).Append($"Total: ${Subs.alineaDerecha("$"&NumberFormat2(montoAmex+montoMifel+montoEfectivo, 1, 2, 2, True), (30 - "Total: ".Length), ".")} ${CRLF}"$).pop
|
||||||
|
Log($"Total Tarjetas: ${Subs.alineaDerecha("$"&NumberFormat2(montoAmex+montoMifel, 1, 0, 0, True), (30 - "Total Tarjetas: ".Length), ".")} "$)
|
||||||
|
Log($"Total Efectivo: ${Subs.alineaDerecha("$"&NumberFormat2(montoEfectivo, 1, 0, 0, True), (30 - "Total Efectivo: ".Length), ".")} "$)
|
||||||
|
Log($"Total: ${Subs.alineaDerecha("$"&NumberFormat2(montoAmex+montoMifel+montoEfectivo, 1, 0, 0, True), (30 - "Total: ".Length), ".")} "$)
|
||||||
|
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
If imprimirAqui Then Printer1.WriteString(CRLF)
|
||||||
|
End If
|
||||||
|
l_resumen.Text = cs
|
||||||
|
l_resumen.Height = su.MeasureMultilineTextHeight(l_resumen, l_resumen.Text)
|
||||||
|
sv_resumen.Panel.Height = l_resumen.Height
|
||||||
|
Subs.panelVisible(p_transparenteResumen, 0, 0)
|
||||||
|
' Else
|
||||||
|
' ToastMessageShow("¡Es necesario que NO haya mesas abiertas para realizar el cierre!", True)
|
||||||
|
' End If
|
||||||
|
If imprimirAqui Then Sleep(1000)
|
||||||
|
Printer1.DisConnect
|
||||||
|
Catch
|
||||||
|
ToastMessageShow("Error en la impresion 2.", True)
|
||||||
|
Printer1.Disconnect
|
||||||
|
' B4XPages.ShowPage("Principal")
|
||||||
|
Activity_Resume
|
||||||
|
End Try
|
||||||
|
If imprimirAqui Then Sleep(1000)
|
||||||
|
b_imp.Enabled = True
|
||||||
|
ProgressDialogHide
|
||||||
|
End Sub
|
||||||
|
|
||||||
Sub b_imp_VIEJO_Click
|
Sub b_imp_VIEJO_Click
|
||||||
' Log("inicia B_IMP2_Click")
|
' Log("inicia B_IMP2_Click")
|
||||||
Private TAMANO As Int
|
Private TAMANO As Int
|
||||||
@@ -2836,6 +3368,16 @@ Sub agregaFormaDePago(left0 As Int, top0 As Int, tag0 As Int, brinco As Int)
|
|||||||
p_formasDePago.AddView(p_num, left0, top0, p_formasDePago.Width, 40dip)
|
p_formasDePago.AddView(p_num, left0, top0, p_formasDePago.Width, 40dip)
|
||||||
b_pagoCerrar.Enabled = False
|
b_pagoCerrar.Enabled = False
|
||||||
If listaFormaDePago.Size > 1 Then l_faltaMonto.Visible = True
|
If listaFormaDePago.Size > 1 Then l_faltaMonto.Visible = True
|
||||||
|
Try
|
||||||
|
et_montoPago2_TextChanged("","1")
|
||||||
|
Log(l_faltaMonto.Text)
|
||||||
|
Private f() As String = Regex.Split(" ", l_faltaMonto.Text)
|
||||||
|
If f.Length > 0 And f(0) = "FALTAN" Then
|
||||||
|
et_montoPago2.Text = f(1)
|
||||||
|
End If
|
||||||
|
Catch
|
||||||
|
Log(LastException)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub cb_pago2_SelectedIndexChanged (Index As Int)
|
Private Sub cb_pago2_SelectedIndexChanged (Index As Int)
|
||||||
@@ -2866,7 +3408,7 @@ Private Sub cb_pago2_SelectedIndexChanged (Index As Int)
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub et_montoPago2_TextChanged (Old As String, New As String)
|
Private Sub et_montoPago2_TextChanged (Old As String, New As String)
|
||||||
' Log("TEXT CHANGED")
|
Log("TEXT CHANGED")
|
||||||
' Log(Starter.totalActual)
|
' Log(Starter.totalActual)
|
||||||
subtotal = 0
|
subtotal = 0
|
||||||
Private enBlanco As Boolean = False
|
Private enBlanco As Boolean = False
|
||||||
@@ -3227,8 +3769,8 @@ Private Sub b_leyendaDescuento_Click
|
|||||||
c.Position = i
|
c.Position = i
|
||||||
Private elNombre As String = c.GetString("PE_PRONOMBRE")
|
Private elNombre As String = c.GetString("PE_PRONOMBRE")
|
||||||
elPU = c.GetString("PE_COSTOU")
|
elPU = c.GetString("PE_COSTOU")
|
||||||
If elNombre.Length > 45 Then elNombre.SubString2(0, 45)
|
If elNombre.Length > 45 Then elNombre.SubString2(0, 45)
|
||||||
If c.GetString("CAT_GP_TIPO") = "ALIMENTOS" Then
|
If c.GetString("CAT_GP_TIPO") = "ALIMENTOS" Or c.GetString("CAT_GP_TIPO") = "MEDIA" Then
|
||||||
' Log($">> APLICAMOS DESC POR ALIMENTOS"$)
|
' Log($">> APLICAMOS DESC POR ALIMENTOS"$)
|
||||||
Private elSubTIndividual As String = c.GetString("PE_COSTOU") - (c.GetString("PE_COSTOU") * (c.GetString("DESC") / 100))
|
Private elSubTIndividual As String = c.GetString("PE_COSTOU") - (c.GetString("PE_COSTOU") * (c.GetString("DESC") / 100))
|
||||||
elSubTotal = Ceil(elSubTIndividual) * c.GetString("PE_CANT")
|
elSubTotal = Ceil(elSubTIndividual) * c.GetString("PE_CANT")
|
||||||
@@ -3320,7 +3862,7 @@ Private Sub b_leyendaDescuento_Click
|
|||||||
Log("xxxxxxxxxxxxxxxxx")
|
Log("xxxxxxxxxxxxxxxxx")
|
||||||
If imprimirEste Then Printer1.WriteString($"${CRLF} ${tot1}"$)
|
If imprimirEste Then Printer1.WriteString($"${CRLF} ${tot1}"$)
|
||||||
If imprimirEste Then Printer1.WriteString($"${CRLF} ${tot2}"$)
|
If imprimirEste Then Printer1.WriteString($"${CRLF} ${tot2}"$)
|
||||||
Else
|
Else
|
||||||
If imprimirEste Then Printer1.WriteString($"${CRLF} ${n2t.NumberToWords(NumberFormat2(elTotal, 1, 2, 2, False))}"$)
|
If imprimirEste Then Printer1.WriteString($"${CRLF} ${n2t.NumberToWords(NumberFormat2(elTotal, 1, 2, 2, False))}"$)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -3778,7 +4320,7 @@ Private Sub b_resumen_Click
|
|||||||
Private propAmex = "0", propMifel = "0", propMifelDebito = "0", propEfectivo = "0" As String
|
Private propAmex = "0", propMifel = "0", propMifelDebito = "0", propEfectivo = "0" As String
|
||||||
Private rt As ResultSet = Starter.skmt.ExecQuery($"Select sum(pt_monto) as ptMonto, sum(pt_propina) as ptPropina, * from pedido_ticket where pt_pago <> 'VENTA' and PT_PAGO <> 'MULTI-TICKET' group by pt_pago2"$)
|
Private rt As ResultSet = Starter.skmt.ExecQuery($"Select sum(pt_monto) as ptMonto, sum(pt_propina) as ptPropina, * from pedido_ticket where pt_pago <> 'VENTA' and PT_PAGO <> 'MULTI-TICKET' group by pt_pago2"$)
|
||||||
Private rtpa As ResultSet = Starter.skmt.ExecQuery($"Select ifnull(sum(pt_propina),0) as ptPropina, * from pedido_ticket where pt_pago_propina = 'Amex' group by pt_pago_propina"$)
|
Private rtpa As ResultSet = Starter.skmt.ExecQuery($"Select ifnull(sum(pt_propina),0) as ptPropina, * from pedido_ticket where pt_pago_propina = 'Amex' group by pt_pago_propina"$)
|
||||||
Do While rtpa.NextRow
|
Do While rtpa.NextRow
|
||||||
propAmex = rtpa.GetString("ptPropina")
|
propAmex = rtpa.GetString("ptPropina")
|
||||||
Loop
|
Loop
|
||||||
Private rtpmc As ResultSet = Starter.skmt.ExecQuery($"Select ifnull(sum(pt_propina),0) as ptPropina, * from pedido_ticket where pt_pago_propina = 'Mifel' group by pt_pago_propina"$)
|
Private rtpmc As ResultSet = Starter.skmt.ExecQuery($"Select ifnull(sum(pt_propina),0) as ptPropina, * from pedido_ticket where pt_pago_propina = 'Mifel' group by pt_pago_propina"$)
|
||||||
|
|||||||
19
Subs.bas
19
Subs.bas
@@ -1565,7 +1565,26 @@ Sub rellenaHasta(tamano As Int) As String
|
|||||||
Return relleno
|
Return relleno
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Sub GroupAndCountRS(RS1 As ResultSet, iColumn As Int) As Map
|
||||||
|
Dim i As Int
|
||||||
|
Dim oMap As Map
|
||||||
|
Dim strKey As String
|
||||||
|
oMap.Initialize
|
||||||
|
For i = 0 To RS1.RowCount - 1
|
||||||
|
RS1.Position = i
|
||||||
|
strKey = RS1.GetString2(iColumn)
|
||||||
|
If oMap.ContainsKey(strKey) Then
|
||||||
|
oMap.Put(strKey, CInt(oMap.Get(strKey)) + 1)
|
||||||
|
Else
|
||||||
|
oMap.Put(strKey, 1)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return oMap
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub CInt(o As Object) As Int
|
||||||
|
Return Floor(o)
|
||||||
|
End Sub
|
||||||
|
|
||||||
'CAT_GUNAPRODS, CAT_MESAS y CAT_MESEROS
|
'CAT_GUNAPRODS, CAT_MESAS y CAT_MESEROS
|
||||||
'1782
|
'1782
|
||||||
|
|||||||
Reference in New Issue
Block a user