mirror of
https://github.com/KeymonSoft/Lanterna.git
synced 2026-04-17 21:06:32 +00:00
Se agregaron las categorias de los productos y se configuro el engrane para que solo se vea con KMTS1
This commit is contained in:
@@ -45,6 +45,7 @@ Sub Class_Globals
|
||||
Private p_botones As Panel
|
||||
Private Label3 As Label
|
||||
Private p_server As Panel
|
||||
dim atrasPresionado as Boolean = False
|
||||
End Sub
|
||||
|
||||
Public Sub Initialize
|
||||
@@ -90,10 +91,9 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
p_configuracion.Visible = False
|
||||
Return False
|
||||
Else
|
||||
' If logger Then Log("Saliendo")
|
||||
' B4XPages.ClosePage(Me)
|
||||
' Subs.cierraActividades
|
||||
' Return True
|
||||
If atrasPresionado Then ExitApplication 'Solo salimos de la aplicación si se presiona 'Atras' 2 veces seguidas.
|
||||
ToastMessageShow("Presiona 'Atras' nuevamente para salir de la aplicación.", False)
|
||||
atrasPresionado = True
|
||||
End If
|
||||
Return False
|
||||
End Sub
|
||||
@@ -186,7 +186,7 @@ Sub JobDone(Job As HttpJob)
|
||||
Starter.skmt.ExecNonQuery("delete from cat_gunaprod")
|
||||
Starter.skmt.BeginTransaction
|
||||
For Each records() As Object In result.Rows
|
||||
Log($"ID: ${records(result.Columns.Get("CAT_GP_ID"))}, NOM: ${records(result.Columns.Get("CAT_GP_NOMBRE"))}"$)
|
||||
' Log($"ID: ${records(result.Columns.Get("CAT_GP_ID"))}, NOM: ${records(result.Columns.Get("CAT_GP_NOMBRE"))}"$)
|
||||
Dim CAT_GP_ID As String = records(result.Columns.Get("CAT_GP_ID"))
|
||||
Dim CAT_GP_NOMBRE As String = records(result.Columns.Get("CAT_GP_NOMBRE"))
|
||||
Dim CAT_GP_PRECIO As String = records(result.Columns.Get("CAT_GP_PRECIO"))
|
||||
@@ -206,7 +206,7 @@ Sub JobDone(Job As HttpJob)
|
||||
Starter.skmt.ExecNonQuery("delete from CAT_MESAS")
|
||||
Starter.skmt.BeginTransaction
|
||||
For Each records() As Object In result.Rows
|
||||
Log($"ID: ${records(result.Columns.Get("M_ID"))}, NOM: ${records(result.Columns.Get("M_NOMBRE"))}"$)
|
||||
' Log($"ID: ${records(result.Columns.Get("M_ID"))}, NOM: ${records(result.Columns.Get("M_NOMBRE"))}"$)
|
||||
Dim M_ID As String = records(result.Columns.Get("M_ID"))
|
||||
Dim M_NOMBRE As String = records(result.Columns.Get("M_NOMBRE"))
|
||||
Dim M_NUMERO As String = records(result.Columns.Get("M_NUMERO"))
|
||||
@@ -222,7 +222,7 @@ Sub JobDone(Job As HttpJob)
|
||||
Starter.skmt.ExecNonQuery("delete from CAT_MESEROS")
|
||||
Starter.skmt.BeginTransaction
|
||||
For Each records() As Object In result.Rows
|
||||
Log($"ID: ${records(result.Columns.Get("MS_ID"))}, NOM: ${records(result.Columns.Get("MS_NOMBRE"))}"$)
|
||||
' Log($"ID: ${records(result.Columns.Get("MS_ID"))}, NOM: ${records(result.Columns.Get("MS_NOMBRE"))}"$)
|
||||
Dim MS_ID As String = records(result.Columns.Get("MS_ID"))
|
||||
Dim MS_NOMBRE As String = records(result.Columns.Get("MS_NOMBRE"))
|
||||
Dim MS_MESAS_ASIGNADAS As String = records(result.Columns.Get("MS_MESAS_ASIGNADAS"))
|
||||
@@ -230,13 +230,19 @@ Sub JobDone(Job As HttpJob)
|
||||
Next
|
||||
Starter.skmt.TransactionSuccessful 'Si no se pone TransactionSuccessful no se escribe NADA!!
|
||||
Starter.skmt.EndTransaction
|
||||
B4XPages.MainPage.principal.cb_mesero.SetItems(Subs.traeMeserosLista)
|
||||
If B4XPages.MainPage.principal.cb_mesero.IsInitialized Then B4XPages.MainPage.principal.cb_mesero.SetItems(Subs.traeMeserosLista)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
ToastMessageShow("¡Información cargada!", False)
|
||||
Job.Release
|
||||
End Sub
|
||||
|
||||
Private Sub b_entrar_LongClick
|
||||
' Dim a As Int = "a"
|
||||
' Subs.alineaDerecha(NumberFormat2(1450, 1, 2, 2, True), 30, ".")
|
||||
End Sub
|
||||
|
||||
Private Sub user_TextChanged (Old As String, New As String)
|
||||
If New = "KMTS1" Then i_conf.Visible = True Else i_conf.Visible = False
|
||||
End Sub
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
Build1=Default,mp.keymon.lat,HU2_PUBLIC
|
||||
Build1=Default,lanterna.keymon.lat,HU2_PUBLIC
|
||||
File1=candado.png
|
||||
File10=logoLanter.png
|
||||
File11=logoLanter_192x192.png
|
||||
@@ -18,10 +18,10 @@ File23=vecteezy_white-diagonal-stripes-with-red-line-isolated-on-white.png
|
||||
File3=engrane.png
|
||||
File4=engranes.png
|
||||
File5=errormanager.bal
|
||||
File6=fondoblanco.png
|
||||
File7=kmt.db
|
||||
File8=login.bal
|
||||
File9=logo.png
|
||||
File6=kmt.db
|
||||
File7=login.bal
|
||||
File8=logo.png
|
||||
File9=logoLanter.bmp
|
||||
FileGroup1=Default Group
|
||||
FileGroup10=Default Group
|
||||
FileGroup11=Default Group
|
||||
@@ -77,7 +77,7 @@ NumberOfModules=7
|
||||
Version=12.8
|
||||
@EndOfDesignText@
|
||||
#Region Project Attributes
|
||||
#ApplicationLabel: MarketPlace
|
||||
#ApplicationLabel: Lanterna
|
||||
#VersionCode: 1
|
||||
#VersionName: 4.02.10
|
||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||
27
B4A/Lanterna.b4a.meta
Normal file
27
B4A/Lanterna.b4a.meta
Normal file
@@ -0,0 +1,27 @@
|
||||
ModuleBookmarks0=
|
||||
ModuleBookmarks1=
|
||||
ModuleBookmarks2=
|
||||
ModuleBookmarks3=
|
||||
ModuleBookmarks4=
|
||||
ModuleBookmarks5=
|
||||
ModuleBookmarks6=
|
||||
ModuleBookmarks7=
|
||||
ModuleBreakpoints0=
|
||||
ModuleBreakpoints1=
|
||||
ModuleBreakpoints2=
|
||||
ModuleBreakpoints3=
|
||||
ModuleBreakpoints4=
|
||||
ModuleBreakpoints5=
|
||||
ModuleBreakpoints6=
|
||||
ModuleBreakpoints7=
|
||||
ModuleClosedNodes0=
|
||||
ModuleClosedNodes1=12
|
||||
ModuleClosedNodes2=50,51,52
|
||||
ModuleClosedNodes3=
|
||||
ModuleClosedNodes4=
|
||||
ModuleClosedNodes5=
|
||||
ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=47,48,68
|
||||
NavigationStack=Starter,Service_Start,53,0,C_Principal,B4XPage_Created,169,0,C_Principal,p_mesasItem_Click,925,0,C_Principal,LlenaProdsLL,401,6,C_Principal,b_prodMas_Click,304,0,C_Principal,b_prodMenos_Click,266,0,Visual Designer,principal.bal,-100,1,Visual Designer,login.bal,-100,5,B4XMainPage,user_TextChanged,240,6,B4XMainPage,JobDone,233,0
|
||||
SelectedBuild=0
|
||||
VisibleModules=1,6,7,2,3
|
||||
@@ -1,27 +0,0 @@
|
||||
ModuleBookmarks0=
|
||||
ModuleBookmarks1=
|
||||
ModuleBookmarks2=
|
||||
ModuleBookmarks3=
|
||||
ModuleBookmarks4=
|
||||
ModuleBookmarks5=
|
||||
ModuleBookmarks6=
|
||||
ModuleBookmarks7=
|
||||
ModuleBreakpoints0=
|
||||
ModuleBreakpoints1=
|
||||
ModuleBreakpoints2=
|
||||
ModuleBreakpoints3=
|
||||
ModuleBreakpoints4=
|
||||
ModuleBreakpoints5=
|
||||
ModuleBreakpoints6=
|
||||
ModuleBreakpoints7=
|
||||
ModuleClosedNodes0=
|
||||
ModuleClosedNodes1=12,14
|
||||
ModuleClosedNodes2=11,12,13,14,24,25,27,28,29,30,31,32,33,34,35,46,47,50
|
||||
ModuleClosedNodes3=
|
||||
ModuleClosedNodes4=
|
||||
ModuleClosedNodes5=
|
||||
ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=68
|
||||
NavigationStack=C_Principal,b_envioInfo_Click,1589,3,Starter,Service_Destroy,85,0,B4XMainPage,ListView1_ItemClick,165,0,Visual Designer,login.bal,-100,1,Starter,Service_Start,54,6,Starter,Process_Globals,11,0,Starter,Service_Create,28,0,C_Principal,B4XPage_Appear,147,0,C_Principal,b_cierreTotal_Click,1036,3,B4XMainPage,b_server_Click,117,1
|
||||
SelectedBuild=0
|
||||
VisibleModules=1,6,7,2,4,3,5
|
||||
@@ -57,7 +57,7 @@ Sub Service_Start (StartingIntent As Intent)
|
||||
Logger = False
|
||||
#End If
|
||||
Private c As Cursor = skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER"))
|
||||
Log(c.RowCount)
|
||||
' Log(c.RowCount)
|
||||
If c.RowCount > 0 Then
|
||||
c.Position = 0
|
||||
DBReqServer = c.GetString("CAT_VA_VALOR")
|
||||
|
||||
48
B4A/Subs.bas
48
B4A/Subs.bas
@@ -188,7 +188,7 @@ End Sub
|
||||
|
||||
'Revisa que exista la BD y si es necesario crea algunans tablas dentro de ella
|
||||
Sub revisaBD 'ignore
|
||||
Log("REVISA BD")
|
||||
' Log("REVISA BD")
|
||||
If Not(File.Exists(Starter.ruta, "kmt.db")) Then
|
||||
File.Copy(File.DirAssets, "kmt.db", Starter.ruta, "kmt.db")
|
||||
LogColor("copiamos kmt.db de "&File.DirAssets & " a " & Starter.ruta,Colors.Green)
|
||||
@@ -201,6 +201,9 @@ Sub revisaBD 'ignore
|
||||
kmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS PEDIDO (PE_PRECIO2 TEXT,PE_TIPO TEXT,PE_FOLIO NUMERIC,PE_DESC NUMERIC,PE_COSTO_SIN TEXT,PE_MESA TEXT,PE_CEDIS TEXT,PE_COSTO_TOT NUMERIC,PE_COSTOU NUMERIC,PE_CANT NUMERIC,PE_PRONOMBRE TEXT,PE_PROID TEXT,PE_TICKET TEXT,PE_FECHA TEXT,PE_MESERO TEXT)")
|
||||
kmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS PEDIDO_TICKET (PT_FACT TEXT, PT_COSTO_SIN TEXT, PT_MESA TEXT, PT_PAGO TEXT, PT_ALMACEN TEXT, PT_LON TEXT, PT_LAT TEXT, PT_TICKET TEXT, PT_FECHA TEXT, PT_MESERO TEXT, PT_COMENSALES INTEGER, PT_NOART NUMERIC, PT_MONTO TEXT, PT_ENVIO_OK INTEGER, PT_TIEMPO_TIENDA FLOAT, PT_FACTURA INTEGER)")
|
||||
agregaColumna("PEDIDO_TICKET", "PT_TICKET", "TEXT")
|
||||
agregaColumna("PEDIDO_TICKET", "PT_TARJETA", "TEXT")
|
||||
agregaColumna("PEDIDO_TICKET", "PT_PROPINA", "TEXT")
|
||||
agregaColumna("PEDIDO_TICKET", "PT_PAGO_PROPINA", "TEXT")
|
||||
agregaColumna("PEDIDO", "PE_TICKET", "TEXT")
|
||||
agregaColumna("PEDIDO", "PE_MESA", "TEXT")
|
||||
agregaColumna("PEDIDO", "PE_MESERO", "TEXT")
|
||||
@@ -1183,7 +1186,7 @@ Sub hayPedido As Boolean
|
||||
thisC.Position = 0
|
||||
Private hay As Boolean = False
|
||||
If thisC.GetInt("hayPedido") > 0 Then hay = True
|
||||
' Log($"Cliente actual=${traeTicket}, hayPedido=${hay}"$)
|
||||
' Log($"Cliente actual=${Starter.ticketActual}, hayPedido=${hay}"$)
|
||||
Return hay
|
||||
End Sub
|
||||
|
||||
@@ -1271,7 +1274,7 @@ Sub actualizaProducto(costoU As String, cant As String, nombre As String, prodId
|
||||
End If
|
||||
Else
|
||||
'INSERTAMOS
|
||||
LogColor("INSERTAMOS PROD", Colors.red)
|
||||
' LogColor("INSERTAMOS PROD", Colors.red)
|
||||
If cant > 0 Then guardaProductoSinGestion(costoU, cant, nombre, prodId, ticketId, fecha, mesero, mesa, precioSin, tipoVenta, comensales)
|
||||
End If
|
||||
c.Close
|
||||
@@ -1290,12 +1293,12 @@ Sub guardaProductoSinGestion(costoU As String, cant As String, nombre As String,
|
||||
'Actualizamos el inventario en cat_gunaprod solo si no es RMI
|
||||
Starter.skmt.ExecNonQuery2($"update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? "$, Array As Object(cant, prodId))
|
||||
c = Starter.skmt.ExecQuery($"select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_TICKET = '${ticketId}' and PE_TIPO = 'VENTA' and PE_MESA = '${mesa}'"$)
|
||||
Log($"select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_TICKET = '${ticketId}'"$)
|
||||
' Log($"select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_TICKET = '${ticketId}'"$)
|
||||
c.Position = 0
|
||||
Starter.skmt.ExecNonQuery($"delete from PEDIDO_TICKET where PT_TICKET = '${ticketId}' and PT_MESA = '${mesa}' and PT_PAGO = '${tipoVenta}'"$)
|
||||
' Log($"delete from PEDIDO_TICKET where PT_TICKET = '${ticketId}' and PT_MESA = '${mesa}' and PT_PAGO = '${tipoVenta}'"$)
|
||||
Starter.skmt.ExecNonQuery2("insert into PEDIDO_TICKET(PT_TICKET, PT_PAGO, PT_FECHA, PT_MESERO, PT_NOART, PT_MONTO, PT_MESA, PT_COSTO_SIN, PT_COMENSALES) VALUES (?,?,?,?,?,?,?,?,?)", Array As Object(ticketId, tipoVenta, fecha, mesero, c.GetString("CANT_CLIE"), c.GetString("TOTAL_CLIE"), mesa, c.GetString("TOTAL_CLIE_SIN"), comensales))
|
||||
Log($"insert into PEDIDO_TICKET(PT_TICKET, PT_PAGO, PT_MESERO, PT_NOART, PT_MONTO, PT_MESA, PT_COSTO_SIN, PT_COMENSALES) VALUES (${ticketId}, ${tipoVenta}, ${mesero}, ${c.GetString("CANT_CLIE")}, ${c.GetString("TOTAL_CLIE")}, ${mesa}, ${c.GetString("TOTAL_CLIE_SIN")}, ${comensales})"$)
|
||||
' Log($"insert into PEDIDO_TICKET(PT_TICKET, PT_PAGO, PT_MESERO, PT_NOART, PT_MONTO, PT_MESA, PT_COSTO_SIN, PT_COMENSALES) VALUES (${ticketId}, ${tipoVenta}, ${mesero}, ${c.GetString("CANT_CLIE")}, ${c.GetString("TOTAL_CLIE")}, ${mesa}, ${c.GetString("TOTAL_CLIE_SIN")}, ${comensales})"$)
|
||||
End Sub
|
||||
|
||||
Sub agrupador()
|
||||
@@ -1355,6 +1358,20 @@ Sub traeMeserosLista As List 'ignore
|
||||
Return items
|
||||
End Sub
|
||||
|
||||
'Regresa las categorias de los productos en una lista
|
||||
Sub traeCategorias As List
|
||||
Private c As Cursor = Starter.skmt.ExecQuery($"select distinct CAT_GP_CLASIF from CAT_GUNAPROD order by CAT_GP_CLASIF"$)
|
||||
Private l As List
|
||||
If c.RowCount > 0 Then
|
||||
l.Initialize
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position = i
|
||||
l.Add(c.GetString("CAT_GP_CLASIF"))
|
||||
Next
|
||||
End If
|
||||
Return l
|
||||
End Sub
|
||||
|
||||
'Regresa una lista con el id de los meseros desde la base de datos.
|
||||
Sub traeMeserosIdLista As List 'ignore
|
||||
Private cc As Cursor = Starter.skmt.ExecQuery($"select * from cat_meseros order by ms_nombre"$)
|
||||
@@ -1373,7 +1390,7 @@ Sub traeMeserosIdLista As List 'ignore
|
||||
End Sub
|
||||
|
||||
'Regresa el mesero de la mesa dada.
|
||||
Sub traeMesero(mesaId As String) As String
|
||||
Sub traeMeseroNombre(mesaId As String) As String
|
||||
Private m As String = "NINGUNO"
|
||||
Private c As Cursor = Starter.skmt.ExecQuery($"select IFNULL(M_MESERO, "NINGUNO") as MESERO from CAT_MESAS where M_ID = '${mesaId}'"$)
|
||||
Log($"select IFNULL(M_MESERO, "NINGUNO") as MESERO from CAT_MESAS where M_ID = '${mesaId}'"$)
|
||||
@@ -1446,6 +1463,25 @@ Sub SetButtonTintList(View As View, Disabled As Int, Enabled As Int)
|
||||
jo.RunMethod("setButtonTintList", Array(View, CSL))
|
||||
End Sub
|
||||
|
||||
'Regresa el texto dado, rellenado a la cantidad de espacios especificados.
|
||||
Sub alineaDerecha(texto As String, tamano As Int, relleno As String) As String
|
||||
Private blanco As String = relleno
|
||||
tamano = tamano - texto.Length - 1
|
||||
For E = 0 To tamano - 1
|
||||
blanco = relleno & blanco
|
||||
Next
|
||||
' Log(blanco & texto)
|
||||
Return blanco & texto
|
||||
End Sub
|
||||
|
||||
'Regresa una cadena de espacios del tamaño especificado
|
||||
Sub rellenaHasta(tamano As Int) As String
|
||||
Private relleno As String = ""
|
||||
For i = 0 To tamano - 1
|
||||
relleno = relleno & " "
|
||||
Next
|
||||
Return relleno
|
||||
End Sub
|
||||
|
||||
'CAT_GUNAPRODS, CAT_MESAS y CAT_MESEROS
|
||||
'1782
|
||||
|
||||
Reference in New Issue
Block a user