Cambio de texto del Inicio Dia e imagen de login y configuracion

This commit is contained in:
2024-02-09 04:28:51 -06:00
parent 120742c301
commit fef3025db2
6 changed files with 17 additions and 137 deletions

View File

@@ -115,52 +115,33 @@ Private Sub B4XPage_Created (Root1 As B4XView)
p_historial.Height = Root.Height - WobbleMenu1.Height
p_transparenteCierreAdmin.Height = Root.Height : p_transparenteCierreAdmin.Width = Root.Width
p_transparenteCierreAdmin.Top = 0 : p_transparenteCierreAdmin.left = 0
Dim cs As CSBuilder
cs.Initialize
l_inicioDia.Text = cs.append("Para iniciar día, ingrese el texto ").bold.Append("INICIO DIA").Pop.Append(" y la tecla ").Bold.Append("Retorno").Pop.Append(" del teclado.").Color(Colors.red).Append(" Los datos del día anterior se borraran.").Popall
' p_botonesVenta.Top = Root.Height - p_botonesVenta.Height - WobbleMenu1.Height + 10
Subs.centraPanel(p_pago, p_mesaAbierta.Width)
Subs.centraBoton(b_abrirMesa, Root.Width)
b_mesaCerrar.Top = clv_prods_ll.AsView.top + clv_prods_ll.AsView.Height + 15 ' - b_mesaCerrar.Height
' Subs.centraEtiqueta(l_mesa, Root.Width)
' Subs.centraEtiqueta(l_comensales, Root.Width)
' Subs.centraEtiqueta(l_mesero, Root.Width)
Subs.centraPanel(p_mesaCampos, Root.Width)
Subs.centraPanel(p_mesaAbierta, Root.Width)
lv_historial.Height = Root.Height * 0.7
p_botonesCierre.Top = lv_historial.Top + lv_historial.Height + 20dip
Subs.centraPanel(p_botonesCierre, p_historial.Width)
' Dim ri As Cursor = Starter.skmt.ExecQuery($"select count(*) as cuantos from cat_gunaprod"$)
' ri.Position = 0
' If ri.GetString("cuantos") = "0" Then 'Si no hay productos, los descargamos
' Starter.reqManager.Initialize(Me, Starter.server)
' Dim cmd As DBCommand
' cmd.Initialize
' cmd.Name = "selectPedigree"
' cmd.Parameters = Array As Object(DateTime.Date(DateTime.Now))
' Log($"Traemos productos, ${DateTime.Date(DateTime.Now)}"$)
' Starter.reqManager.ExecuteQuery(cmd , 0, "descargaProds")
' End If
' query = "cat_gunaprod"
prodsMap.Initialize
listaProds.Initialize
listaHints.Initialize
listaHintsM.Initialize
p_mesas.Width = Root.Width
' Log(p_meseros.Width)
Subs.panelVisible(p_mesas, 0, 0)
cb_comensales.SetItems(Array As String(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20))
cb_pago.SetItems(Array As String("Tarjeta","Efectivo"))
cb_mesero.SetItems(Subs.traeMeserosLista)
End Sub
Sub B4XPage_Appear
reqManager.Initialize(Me, Starter.DBReqServer)
' ticketId = Subs.traeTicket
' rutaUsuario = Subs.traeMesa
' Log($"${clv_carrito.AsView.Width}, ${Root.Width}"$)
clv = clv_prods_ll
cuentaProds
' LlenaProdsLL(Null, Null)
LlenaMesas(Null, Null)
LlenaProdsLL(Null, Null)
PCLV.lblHint.SetTextSizeAnimated(0,13)
@@ -192,7 +173,6 @@ Sub B4XPage_Appear
PCLVM.pnlOverlay.Width = clv_mesas.AsView.Width
PCLVM.B4XSeekBar1.Update
p_meseros.Height = Root.Height - WobbleMenu1.Height
' If et_busca.Text <> "" Then et_busca.Text =""
If p_mesas.Visible And Subs.revisaCierreAdmin Then p_transparenteCierreAdmin.Visible = True Else p_transparenteCierreAdmin.Visible = False
End Sub
@@ -206,11 +186,6 @@ Sub B4XPage_CloseRequest As ResumableSub
p_mesa.Visible = False
p_mesas.Visible = True
LlenaMesas(Null, Null)
' Else if p_carrito.Visible Then
'' p_carrito.Visible = False
'' p_mesas.Visible = True
' WobbleMenu1_Tab1Click
' WobbleMenu1.SetCurrentTab(1)
Else
B4XPages.ShowPage("Login")
End If
@@ -219,7 +194,6 @@ End Sub
Sub b_prodMenos_Click
etCantHasFocus = False
' If WobbleMenu1.GetCurrentTab = 3 Then clv = clv_carrito Else clv = clv_prods_ll
clv = clv_prods_ll
' Log(Sender.As(Button).text & "|" & Sender.As(Button).tag)
Private buttonTag As String = Sender.As(Button).tag
@@ -235,13 +209,10 @@ Sub b_prodMenos_Click
Dim elNombre As B4XView = pnl.GetView(1)
If WobbleMenu1.GetCurrentTab = 3 Then laCant = pnl.GetView(2).GetView(4)
Log($"${pnl.GetView(1)}${CRLF}${pnl.GetView(2).GetView(2)}${CRLF}${pnl.GetView(2).GetView(3)}${CRLF}${pnl.GetView(2).GetView(4)}"$)
' Log($"precio|stock:${laCant.tag}"$)
' Log("lacant.text="&laCant.text & "|" & buttonTag)
If buttonTag = "vendido" And laCant.Text > 0 Then
Log(clv.GetValue(index).As(Map))
clv.GetValue(index).As(Map).Put("almacen",inv + 1)
Log(clv.GetValue(index).As(Map))
' clv.GetValue(index).As(Map).Get("almacen") = clv.GetValue(index).As(Map).Get("almacen") + 1
End If
If laCant.Text = "" Then laCant.Text = 0
Log($"|${laCant.Text}|"$)
@@ -254,9 +225,6 @@ Sub b_prodMenos_Click
' Log(tmpMap)
prodsMap.Put(id, tmpMap)
If laCant.Text = 0 Then prodsMap.Remove(id)
' LogColor("prodsMap="&prodsMap, Colors.blue)
' (Subs.traeAlmacen, p1.Get("precio"), p1.Get("cant"), pn, p, ticketId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta)
' Private almacenX As String = Subs.traeAlmacen
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)
cuentaProds
@@ -273,7 +241,6 @@ End Sub
Sub b_prodMas_Click
etCantHasFocus = False
' If WobbleMenu1.GetCurrentTab = 3 Then clv = clv_carrito Else clv = clv_prods_ll
clv = clv_prods_ll
Private buttonTag As String = Sender.As(Button).tag
Dim index As Int = clv.GetItemFromView(Sender)
@@ -285,7 +252,6 @@ Sub b_prodMas_Click
If WobbleMenu1.GetCurrentTab = 3 Then laCant = pnl.GetView(2).GetView(4)
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 tmpMap As Map = clv.GetValue(index).As(Map)
Private precio As String=clv.GetValue(index).As(Map).Get("precio")
Private inv As Int = clv.GetValue(index).As(Map).Get("almacen")
Log($"|${laCant.Text}, ${inv}"$)
@@ -298,12 +264,10 @@ Sub b_prodMas_Click
' Log(clv.GetValue(index).As(Map))
End If
else If laCant.Text + 1 <= inv Then
' LogColor(inv, Colors.blue)
laCant.Text = $"$1.0{laCant.Text + 1}"$
Log(Subs.totalPedido)
End If
Private id As String=clv.GetValue(index).As(Map).Get("id")
' Private almacenX As String = Subs.traeAlmacen
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)
@@ -331,10 +295,8 @@ Sub cuentaProds
' Log(Subs.totalPedido)
Private cant0 As String = "0"
Private total0 As String = "0"
If c.GetString("cant") <> Null And c.GetString("cant") <> "null" Then cant0 = c.GetString("cant")
If c.GetString("total") <> Null And c.GetString("total") <> "null" Then total0 = c.GetString("total")
Private p As Cursor = Starter.skmt.ExecQuery("select count(PT_TICKET) as ordenes from PEDIDO_TICKET where PT_PAGO <> 'VENTA'")
p.Position = 0
' Log($"Total Prods: ${cant0}, Total Compra: $$1.2{total0}"$)
@@ -387,7 +349,6 @@ Sub LlenaProdsLL(p As ResultSet, extra As String)
' Log($"${p.GetString("CAT_GP_ID")}, ${p.GetString("CAT_GP_NOMBRE")}, ${cant}"$)
Loop
p.Close
' Log("LISTAPRODS: " & listaProds)
PCLV.Commit
clv_prods_ll.Clear
@@ -429,10 +390,6 @@ Sub LlenaProdsLL(p As ResultSet, extra As String)
End If
End If
Next
' LogColor(clv_prods_ll.Size, Colors.red)
' PCLV.Commit
' Log("CONT=" & cont)
' Log("CLV_PRODSLL="&clv_prods_ll.Size)
If clv_prods_ll.Size > 0 Then
clv_prods_ll.JumpToItem(0) 'Vamos al primer artículo de la lista.
End If
@@ -672,10 +629,6 @@ Private Sub lv_promos_ItemClick (Position As Int, Value As Object)
End Sub
'Private Sub p_mesas_Click
' 'Para evitar que el clic en pantalla no se siga hacia atras
'End Sub
Private Sub p_historial_Click
'Para evitar que el clic en pantalla no se siga hacia atras
End Sub
@@ -684,66 +637,41 @@ Private Sub p_carrito_Click
'Para evitar que el clic en pantalla no se siga hacia atras
End Sub
'Private Sub b_buscar_Click
' forzarBusqueda = True
' et_busca_TextChanged("",et_busca.Text)
'End Sub
Private Sub b_terminar_Click
DateTime.DateFormat= $"yyMMdd-HHmmss-${Starter.ticketActual}"$
Private id As String = DateTime.Date(DateTime.Now)
Starter.skmt.ExecNonQuery($"insert into cat_hist_compras (H_IDCOMPRA, H_FOLIO, H_MESA, H_CEDIS, H_COSTO_TOT, H_COSTOU, H_CANT, H_PRONOMBRE, H_PROID, H_TICKET, H_FECHA) select '${id}', PE_FOLIO, PE_MESA, PE_CEDIS, PE_COSTO_TOT, PE_COSTOU, PE_CANT, PE_PRONOMBRE, PE_PROID, PE_TICKET, PE_FECHA from pedido where PE_TICKET = '${Starter.ticketActual}'"$)
Starter.skmt.ExecNonQuery($"delete from pedido where PE_TICKET = '${Starter.ticketActual}'"$)
' lv_carrito.Clear
' clv_carrito.Clear
' et_busca_TextChanged("", et_busca.Text)
LlenaProdsLL(Null, Null)
l_compraTerminada.Text = $"¡Felicidades!${CRLF}${CRLF}Tu compra con número de orden ${id} ha sido registrada.${CRLF}${CRLF}Llegará en tu siguiente día de entrega."$
l_compraTerminada.Visible = True
l_compraTerminada.BringToFront
' l_totalCarrito.Text = ""
End Sub
Sub llenaHistorial
Dim rs_hist As ResultSet = Starter.skmt.ExecQuery($"Select * from pedido_ticket where PT_PAGO <> 'VENTA' order by PT_PAGO, PT_TICKET"$)
If rs_hist.RowCount > 0 Then
' c_prods.Position = 0
' l_total2.Text = c_prods.GetString("PE_COSTO_TOT")
' lv_historial.BringToFront
l_historialVacio.Visible = False
Private cs As CSBuilder
lv_historial.Clear
lv_historial.Visible = True
Do While rs_hist.NextRow
' Private rs_do As ResultSet = Starter.skmt.ExecQuery($"select * from CAT_HIST_COMPRAS where H_IDCOMPRA = '${rs_hist.GetString("H_IDCOMPRA")}'"$)
cs.Initialize
' cs.Initialize
Dim Label1 As Label
' lv_historial.TwoLinesLayout.ItemHeight = 50dip
Label1 = lv_historial.TwoLinesLayout.Label
Label1.TextSize = 16
' Label1.TextColor = Colors.red
Private elColor As Int = Colors.Red
If rs_hist.GetString("PT_PAGO") = "TARJETA" Then elColor = Colors.RGB(0,0,122)
Label1.color = Colors.White
Label1.Height = 30dip
' Private textColor As Int = Colors.black
Dim label2 As Label
label2 = lv_historial.TwoLinesLayout.SecondLabel
label2.TextSize = 14
label2.TextColor = Colors.RGB(1,127,1)
' Do While rs_do.NextRow
' Log($"${rs_do.GetString("H_IDCOMPRA")}, ${rs_do.GetString("H_PRONOMBRE")}, ${rs_do.GetString("H_CANT")}"$)
' Loop
Private fecha As String = rs_hist.GetString("PT_FECHA")
fecha = fecha.SubString2(1,10)
lv_historial.AddTwoLines(cs.Color(elColor).Append("Orden: " & rs_hist.GetString("PT_TICKET") & " - Mesa: " & rs_hist.GetString("PT_MESA")).PopAll, $"Fecha: ${fecha}, Productos: ${rs_hist.GetString("PT_NOART")}, Total: $${NumberFormat2(rs_hist.GetString("PT_MONTO"), 1, 2, 2, True)}"$)
' totalPedido = totalPedido + (rs_hist.GetString("PE_COSTOU") * rs_hist.GetString("PE_CANT"))
' cantPedido = cantPedido + rs_hist.GetString("PE_CANT")
Loop
' Private c As Cursor = Starter.skmt.ExecQuery("select pc_noart, pc_monto from PEDIDO_TICKET where pc_cliente in (Select CUENTA from cuentaa)")
' c.Position=0
'' l_cant.Text = c.GetString("PC_NOART")
' c.Close
Else
lv_historial.Visible = False
l_historialVacio.Visible = True
@@ -752,48 +680,6 @@ Sub llenaHistorial
rs_hist.Close
End Sub
Sub llenaHistorial_old
' Dim rs_hist As ResultSet = Starter.skmt.ExecQuery($"Select h_idcompra, sum(h_costo_tot) as total, sum(h_cant) as cantidad, h_fecha from cat_hist_compras group by h_idcompra"$)
' If rs_hist.RowCount > 0 Then
'' c_prods.Position = 0
'' l_total2.Text = c_prods.GetString("PE_COSTO_TOT")
'' lv_historial.BringToFront
' Private cs As CSBuilder
' Do While rs_hist.NextRow
'' Private rs_do As ResultSet = Starter.skmt.ExecQuery($"select * from CAT_HIST_COMPRAS where H_IDCOMPRA = '${rs_hist.GetString("H_IDCOMPRA")}'"$)
' cs.Initialize
' Dim Label1 As Label
'' lv_historial.TwoLinesLayout.ItemHeight = 50dip
' Label1 = lv_historial.TwoLinesLayout.Label
' Label1.TextSize = 16
' Label1.TextColor = Colors.red
' Label1.color = Colors.White
' Label1.Height = 30dip
'' Private textColor As Int = Colors.black
' Dim label2 As Label
' label2 = lv_historial.TwoLinesLayout.SecondLabel
' label2.TextSize = 14
' label2.TextColor = Colors.RGB(1,127,1)
'' Do While rs_do.NextRow
'' Log($"${rs_do.GetString("H_IDCOMPRA")}, ${rs_do.GetString("H_PRONOMBRE")}, ${rs_do.GetString("H_CANT")}"$)
'' Loop
' Private fecha As String = rs_hist.GetString("H_FECHA")
' fecha = fecha.SubString2(1,10)
' lv_historial.AddTwoLines("Orden: " & rs_hist.GetString("H_IDCOMPRA"), $"Fecha: ${fecha}, Productos: ${rs_hist.GetString("cantidad")}, Total: $${NumberFormat2(rs_hist.GetString("total"), 1, 2, 2, True)}"$)
'' totalPedido = totalPedido + (rs_hist.GetString("PE_COSTOU") * rs_hist.GetString("PE_CANT"))
'' cantPedido = cantPedido + rs_hist.GetString("PE_CANT")
' Loop
'' Private c As Cursor = Starter.skmt.ExecQuery("select pc_noart, pc_monto from PEDIDO_TICKET where pc_cliente in (Select CUENTA from cuentaa)")
'' c.Position=0
' '' l_cant.Text = c.GetString("PC_NOART")
'' c.Close
' Else
' l_historialVacio.Visible = True
' l_historialVacio.Text = "No hay ordenes en tu historial."
' End If
' rs_hist.Close
End Sub
Sub CreateListItem(Text As String, cant As Int, precioU As String, inv As Int, Width As Int, Height As Int, img As Bitmap, prodId As String) As Panel 'ignore
' Dim p As B4XView = xui.CreatePanel("")
' Dim cs As CSBuilder
@@ -886,10 +772,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, M_TICKET, IFNULL(PT_MONTO, 0) as SUBTOTAL, IFNULL(PT_NOART, 0) as NO_ARTS from CAT_MESAS left join pedido_ticket on M_TICKET = pt_ticket and M_ID = PT_MESA"$)
' Log(p.RowCount)
PCLVM.Commit
clv_mesas.Clear
@@ -925,7 +808,6 @@ Sub LlenaMesas(p As ResultSet, extra As String) 'ignore
reiniciarlistaProds = False
End Sub
'Entramos a la mesa seleccionada.
Private Sub p_mesasItem_Click
Log(Sender.As(Panel).tag)