mirror of
https://github.com/KeymonSoft/Medicomed_Preventa.git
synced 2026-04-17 21:16:08 +00:00
Se hicieron invisibles normales de la venta, se agregaron 2 botones mas, uno indica que tieene venta y el otro que no tiene, tambien al boton que indica que tiene venta se le agrega una pequeña ventana para agregar la venta que se le indique.
198 lines
6.6 KiB
QBasic
198 lines
6.6 KiB
QBasic
B4A=true
|
|
Group=Default Group
|
|
ModulesStructureVersion=1
|
|
Type=Class
|
|
Version=11.5
|
|
@EndOfDesignText@
|
|
Sub Class_Globals
|
|
Private Root As B4XView 'ignore
|
|
Private xui As XUI 'ignore
|
|
Private p_ticketsdia As Panel
|
|
|
|
Dim c As Cursor
|
|
Dim S As Cursor
|
|
Dim ruta As String
|
|
Dim ListView1 As ListView
|
|
Dim b_noventa As Button
|
|
Dim nombre_boton As String
|
|
Dim STIME As String
|
|
End Sub
|
|
|
|
'You can add more parameters here.
|
|
Public Sub Initialize As Object
|
|
Return Me
|
|
End Sub
|
|
|
|
''This event will be called once, before the page becomes visible.
|
|
'Private Sub B4XPage_Created (Root1 As B4XView)
|
|
' Root = Root1
|
|
' 'load the layout to Root
|
|
' ruta = File.DirInternal
|
|
' Root.LoadLayout("ticketsdia")
|
|
' If File.Exists(ruta, "kmt.db") = False Then
|
|
' File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db")
|
|
' End If
|
|
' c=B4XPages.MainPage.skmt.ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")
|
|
' ListView1.Clear
|
|
' If c.RowCount>0 Then
|
|
' For i=0 To c.RowCount -1
|
|
' c.Position=i
|
|
' Dim label1 As Label
|
|
' label1 = ListView1.TwoLinesLayout.Label
|
|
' label1.TextSize = 10
|
|
' label1.TextColor = Colors.Black
|
|
' Dim label2 As Label
|
|
' label2 = ListView1.TwoLinesLayout.SecondLabel
|
|
' label2.TextSize = 15
|
|
' label2.TextColor = Colors.Blue
|
|
' label2.Height = 60dip
|
|
' label2.Width = ListView1.Width * 0.99
|
|
' ListView1.TwoLinesLayout.ItemHeight = 80dip
|
|
' ListView1.AddTwoLines(c.GetString("PC_CLIENTE"),"Cantidad #"& c.GetString("PC_NOART")& " SubTotal $"& c.GetString("PC_MONTO"))
|
|
' Next
|
|
' End If
|
|
'End Sub
|
|
|
|
'This event will be called once, before the page becomes visible.
|
|
Private Sub B4XPage_Created (Root1 As B4XView)
|
|
Root = Root1
|
|
'load the layout to Root
|
|
ruta = File.DirInternal
|
|
Root.LoadLayout("ticketsdia")
|
|
If File.Exists(ruta, "kmt.db") = False Then
|
|
File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db")
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
|
|
|
Sub B4XPage_Appear
|
|
nombre_boton = "NOVENTA"
|
|
' c=B4XPages.MainPage.skmt.ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART,(select CAT_CL_NOMBRE from kmt_info where cat_cl_codigo = pc_cliente ) as NOMBRE FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")
|
|
' ListView1.Clear
|
|
' If c.RowCount>0 Then
|
|
' For i=0 To c.RowCount -1
|
|
' c.Position=i
|
|
' Dim label1 As Label
|
|
' label1 = ListView1.TwoLinesLayout.Label
|
|
' label1.TextSize = 15
|
|
' label1.TextColor = Colors.Black
|
|
' Dim label2 As Label
|
|
' label2 = ListView1.TwoLinesLayout.SecondLabel
|
|
' label2.TextSize = 10
|
|
' label2.TextColor = Colors.Blue
|
|
' ListView1.AddTwoLines(c.GetString("PC_CLIENTE"),c.GetString("NOMBRE") &" Cantidad #"& c.GetString("PC_NOART")& " SubTotal $"& c.GetString("PC_MONTO"))
|
|
' Next
|
|
' End If
|
|
' c.Close
|
|
c = B4XPages.MainPage.skmt.ExecQuery("select * from venta_no_venta where eventov <> 'SinVenta'")
|
|
ListView1.Clear
|
|
If c.RowCount > 0 Then
|
|
For i = 0 To c.RowCount - 1
|
|
c.Position = i
|
|
Dim label1 As Label
|
|
label1 = ListView1.TwoLinesLayout.Label
|
|
label1.TextSize = 10
|
|
label1.TextColor = Colors.Black
|
|
Dim label2 As Label
|
|
label2 = ListView1.TwoLinesLayout.SecondLabel
|
|
label2.TextSize = 15
|
|
label2.TextColor = Colors.Blue
|
|
label2.Height = 60dip
|
|
label2.Width = ListView1.Width * 0.99
|
|
ListView1.TwoLinesLayout.ItemHeight = 80dip
|
|
ListView1.AddTwoLines(c.GetString("clientev"), "SubTotal $" & c.GetString("montoVentav"))
|
|
Log(c.GetString("clientev") & "SubTotal $" & c.GetString("montoVentav"))
|
|
Next
|
|
End If
|
|
c.Close
|
|
End Sub
|
|
|
|
Sub Regresar_Click
|
|
B4XPages.ShowPage("cliente")
|
|
End Sub
|
|
Sub Activity_KeyPress (key As Int) As Boolean
|
|
' BACK key pressed
|
|
If key=KeyCodes.KEYCODE_BACK Then
|
|
' I want to capture the key here so I return True
|
|
B4XPages.ShowPage("principal")
|
|
'Return True
|
|
End If
|
|
' Returning False signals the system to handle the key
|
|
Return False
|
|
End Sub
|
|
Sub ListView1_ItemLongClick (Position As Int, Value As Object)
|
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from CUENTAA")
|
|
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object(Value))
|
|
DateTime.TimeFormat = "HHmmss"
|
|
STIME=DateTime.Time(DateTime.Now)
|
|
s=B4XPages.MainPage.skmt.ExecQuery("SELECT COUNT(*) AS CUANTOS FROM HIST_STAY_STORE WHERE HSS_IN = 0 AND HSS_CODIGO In (select cuenta from cuentaa)")
|
|
s.Position = 0
|
|
If s.GetString("CUANTOS") = 1 Then
|
|
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_IN = ? where HSS_IN = 0 AND HSS_CODIGO In (select cuenta from cuentaa)", Array As Object(STIME))
|
|
Else
|
|
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO HIST_STAY_STORE(HSS_CODIGO, HSS_IN , HSS_OUT , HSS_TOT) VALUES (?,0,0,0)", Array As Object (Value))
|
|
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_IN = ? where HSS_IN = 0 AND HSS_CODIGO In (select cuenta from cuentaa)", Array As Object(STIME))
|
|
End If
|
|
DateTime.TimeFormat = "HH:mm:ss"
|
|
Subs.guardaClienteHoraInicio(Value)
|
|
B4XPages.MainPage.cliente.venimosDeTicketsDia = True
|
|
B4XPages.ShowPage("cliente")
|
|
End Sub
|
|
|
|
Sub b_noventa_Click
|
|
If nombre_boton = "NOVENTA" Then
|
|
nombre_boton = "VENTA"
|
|
b_noventa.Text ="VENTA"
|
|
c = B4XPages.MainPage.skmt.ExecQuery("select * from venta_no_venta where eventov = 'SinVenta'")
|
|
ListView1.Clear
|
|
If c.RowCount > 0 Then
|
|
For i = 0 To c.RowCount - 1
|
|
c.Position = i
|
|
Dim label1 As Label
|
|
label1 = ListView1.TwoLinesLayout.Label
|
|
label1.TextSize = 10
|
|
label1.TextColor = Colors.Black
|
|
Dim label2 As Label
|
|
label2 = ListView1.TwoLinesLayout.SecondLabel
|
|
label2.TextSize = 15
|
|
label2.TextColor = Colors.Blue
|
|
label2.Height = 60dip
|
|
label2.Width = ListView1.Width * 0.99
|
|
ListView1.TwoLinesLayout.ItemHeight = 80dip
|
|
ListView1.AddTwoLines(c.GetString("clientev"), "SubTotal $" & c.GetString("montoVentav"))
|
|
Log(c.GetString("clientev") & "SubTotal $" & c.GetString("montoVentav"))
|
|
Next
|
|
End If
|
|
Else
|
|
nombre_boton = "NOVENTA"
|
|
b_noventa.Text ="NO VENTA"
|
|
c = B4XPages.MainPage.skmt.ExecQuery("select * from venta_no_venta where eventov <> 'SinVenta'")
|
|
ListView1.Clear
|
|
If c.RowCount > 0 Then
|
|
For i = 0 To c.RowCount - 1
|
|
c.Position = i
|
|
Dim label1 As Label
|
|
label1 = ListView1.TwoLinesLayout.Label
|
|
label1.TextSize = 10
|
|
label1.TextColor = Colors.Black
|
|
Dim label2 As Label
|
|
label2 = ListView1.TwoLinesLayout.SecondLabel
|
|
label2.TextSize = 15
|
|
label2.TextColor = Colors.Blue
|
|
label2.Height = 60dip
|
|
label2.Width = ListView1.Width * 0.99
|
|
ListView1.TwoLinesLayout.ItemHeight = 80dip
|
|
ListView1.AddTwoLines(c.GetString("clientev"), "SubTotal $" & c.GetString("montoVentav"))
|
|
Log(c.GetString("clientev") & "SubTotal $" & c.GetString("montoVentav"))
|
|
Next
|
|
End If
|
|
c.Close
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub p_ticketsdia_Click
|
|
|
|
End Sub |