mirror of
https://github.com/KeymonSoft/Durakelo.git
synced 2026-04-20 20:59:26 +00:00
CAMBIOS EN IMPRESION
This commit is contained in:
@@ -170,14 +170,14 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
l_total.Text = s.GetString("TOTAL_CLIE")
|
l_total.Text = s.GetString("TOTAL_CLIE")
|
||||||
total_cliente = s.GetString("TOTAL_CLIE")
|
total_cliente = s.GetString("TOTAL_CLIE")
|
||||||
End If
|
End If
|
||||||
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MACIMP"))
|
' c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MACIMP"))
|
||||||
If c.RowCount > 0 Then
|
' If c.RowCount > 0 Then
|
||||||
c.Position = 0
|
' c.Position = 0
|
||||||
Starter.MAC_IMPRESORA = c.GetString("CAT_VA_VALOR")
|
' Starter.MAC_IMPRESORA = c.GetString("CAT_VA_VALOR")
|
||||||
End If
|
' End If
|
||||||
If Starter.MAC_IMPRESORA = "" Then Starter.MAC_IMPRESORA = "0"
|
' If Starter.MAC_IMPRESORA = "" Then Starter.MAC_IMPRESORA = "0"
|
||||||
Log("|" & Starter.MAC_IMPRESORA & "|")
|
' Log("|" & Starter.MAC_IMPRESORA & "|")
|
||||||
Printer1.Initialize(Me, "Printer1")
|
' Printer1.Initialize(Me, "Printer1")
|
||||||
|
|
||||||
TOMAR_FOTO = 0
|
TOMAR_FOTO = 0
|
||||||
g.Initialize("GPS")
|
g.Initialize("GPS")
|
||||||
@@ -187,6 +187,16 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub B4XPage_Appear
|
Sub B4XPage_Appear
|
||||||
|
|
||||||
|
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MACIMP"))
|
||||||
|
If c.RowCount > 0 Then
|
||||||
|
c.Position = 0
|
||||||
|
Starter.MAC_IMPRESORA = c.GetString("CAT_VA_VALOR")
|
||||||
|
End If
|
||||||
|
If Starter.MAC_IMPRESORA = "" Then Starter.MAC_IMPRESORA = "0"
|
||||||
|
Log("|" & Starter.MAC_IMPRESORA & "|")
|
||||||
|
Printer1.Initialize(Me, "Printer1")
|
||||||
|
|
||||||
BT_QR.Enabled = False
|
BT_QR.Enabled = False
|
||||||
b_factura.Visible = False
|
b_factura.Visible = False
|
||||||
FACTURA =0
|
FACTURA =0
|
||||||
@@ -265,10 +275,12 @@ Sub B4XPage_Appear
|
|||||||
Else
|
Else
|
||||||
META2 = 300
|
META2 = 300
|
||||||
End If
|
End If
|
||||||
If META2 < 1 Then
|
If META2 = 0 Then
|
||||||
META2 = "CUBIERTO"
|
META2 = "CUBIERTO"
|
||||||
|
Else
|
||||||
|
|
||||||
|
la_saldooper.Text = NumberFormat2(META2, 1, 3, 2, False)
|
||||||
End If
|
End If
|
||||||
la_saldooper.Text = numberformat2(META2, 1, 3, 2, False)
|
|
||||||
|
|
||||||
If Printer1.IsConnected = False Then
|
If Printer1.IsConnected = False Then
|
||||||
Printer1.Connect
|
Printer1.Connect
|
||||||
@@ -424,6 +436,7 @@ Sub b_mapa_Click
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub B_IMP_Click
|
Sub B_IMP_Click
|
||||||
|
' Printer1.Connect2
|
||||||
c=Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL"))
|
c=Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL"))
|
||||||
c.Position =0
|
c.Position =0
|
||||||
perfil = c.GetString("CUANTOS")
|
perfil = c.GetString("CUANTOS")
|
||||||
@@ -447,6 +460,7 @@ Sub B_IMP_Click
|
|||||||
c.Position = 0
|
c.Position = 0
|
||||||
sucursal = c.GetString("CAT_VA_VALOR")
|
sucursal = c.GetString("CAT_VA_VALOR")
|
||||||
c.Close
|
c.Close
|
||||||
|
|
||||||
ProgressDialogShow("Imprimiendo, un momento ...")
|
ProgressDialogShow("Imprimiendo, un momento ...")
|
||||||
Printer1.DisConnect
|
Printer1.DisConnect
|
||||||
If Not(Printer1.IsConnected) Then
|
If Not(Printer1.IsConnected) Then
|
||||||
@@ -636,6 +650,7 @@ Sub B_IMP_Click
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub B_IMP2_Click
|
Sub B_IMP2_Click
|
||||||
|
' Printer1.Connect2
|
||||||
c=Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL"))
|
c=Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL"))
|
||||||
c.Position =0
|
c.Position =0
|
||||||
perfil = c.GetString("CUANTOS")
|
perfil = c.GetString("CUANTOS")
|
||||||
@@ -810,6 +825,7 @@ Sub B_IMP2_Click
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub B_INV_Click
|
Sub B_INV_Click
|
||||||
|
'' Printer1.Connect2
|
||||||
c=Starter.skmt.ExecQuery("select USUARIO from usuarioa")
|
c=Starter.skmt.ExecQuery("select USUARIO from usuarioa")
|
||||||
c.Position=0
|
c.Position=0
|
||||||
usuario = c.GetString("USUARIO")
|
usuario = c.GetString("USUARIO")
|
||||||
@@ -817,7 +833,35 @@ Sub B_INV_Click
|
|||||||
sDate=DateTime.Date(DateTime.Now)
|
sDate=DateTime.Date(DateTime.Now)
|
||||||
sTime=DateTime.Time(DateTime.Now)
|
sTime=DateTime.Time(DateTime.Now)
|
||||||
c.Close
|
c.Close
|
||||||
|
ProgressDialogShow("Imprimiendo, un momento ...")
|
||||||
|
' Printer1.DisConnect
|
||||||
|
If Not(Printer1.IsConnected) Then
|
||||||
|
Log("conectando 1")
|
||||||
|
Printer1.Connect
|
||||||
|
Private cont As Int = 0
|
||||||
|
Do While Not(impresoraConectada)
|
||||||
|
' Log("conectando ...")
|
||||||
|
Sleep(1000)
|
||||||
|
cont = cont + 1
|
||||||
|
If cont = 3 Then Printer1.Connect 'Tratamos de reconectar
|
||||||
|
If cont > 15 Then impresoraConectada = True
|
||||||
|
Loop
|
||||||
|
Sleep(500)
|
||||||
|
impresoraConectada = False
|
||||||
|
Else
|
||||||
|
Log("conectando 2")
|
||||||
|
Printer1.Connect
|
||||||
|
Private cont As Int = 0
|
||||||
|
Do While Not(impresoraConectada) Or Not(Printer1.IsConnected)
|
||||||
|
' Log("conectando ...")
|
||||||
|
Sleep(1000)
|
||||||
|
cont = cont + 1
|
||||||
|
If cont = 2 Then Printer1.Connect
|
||||||
|
If cont > 4 Then impresoraConectada = True
|
||||||
|
Loop
|
||||||
|
Sleep(500)
|
||||||
|
impresoraConectada = False
|
||||||
|
End If
|
||||||
TAMANO = 5
|
TAMANO = 5
|
||||||
ESPACIO = 21
|
ESPACIO = 21
|
||||||
BLANCO = " "
|
BLANCO = " "
|
||||||
@@ -914,6 +958,8 @@ Sub B_INV_Click
|
|||||||
Printer1.WriteString("------------------------------" & CRLF)
|
Printer1.WriteString("------------------------------" & CRLF)
|
||||||
Printer1.WriteString(" " & CRLF)
|
Printer1.WriteString(" " & CRLF)
|
||||||
' printer.Flush
|
' printer.Flush
|
||||||
|
ProgressDialogHide
|
||||||
|
Printer1.DisConnect
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub B_VENTA_Click
|
Sub B_VENTA_Click
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ Sub B4XPage_Appear
|
|||||||
If c2.RowCount > 0 Then
|
If c2.RowCount > 0 Then
|
||||||
For i=0 To c2.RowCount - 1
|
For i=0 To c2.RowCount - 1
|
||||||
c2.Position=i
|
c2.Position=i
|
||||||
|
LogColor(c2.GetString("CAT_GP_ID"),Colors.Green)
|
||||||
Private tm As Map = Subs.procesaPromocion(c2.GetString("CAT_GP_ID"), clienteId) 'Revisamos que la promo tenga inventario suficiente.
|
Private tm As Map = Subs.procesaPromocion(c2.GetString("CAT_GP_ID"), clienteId) 'Revisamos que la promo tenga inventario suficiente.
|
||||||
If tm.Get("status") = "ok" Then 'Si tiene inventario suficiente, la agregamos al mapa de proveedores
|
If tm.Get("status") = "ok" Then 'Si tiene inventario suficiente, la agregamos al mapa de proveedores
|
||||||
' LogColor($">>>>>>>>>> ${c2.GetString("CAT_GP_NOMBRE")} - "$, Colors.red)
|
' LogColor($">>>>>>>>>> ${c2.GetString("CAT_GP_NOMBRE")} - "$, Colors.red)
|
||||||
@@ -347,6 +348,7 @@ Sub lv_catalogos_ItemClick (Position As Int, Value As Object)
|
|||||||
If c2.RowCount > 0 Then
|
If c2.RowCount > 0 Then
|
||||||
For i=0 To c2.RowCount -1
|
For i=0 To c2.RowCount -1
|
||||||
c2.Position=i
|
c2.Position=i
|
||||||
|
Logcolor(c2.GetString("CAT_GP_ID"),Colors.Green)
|
||||||
Private tm As Map = Subs.procesaPromocion(c2.GetString("CAT_GP_ID"), clienteId)
|
Private tm As Map = Subs.procesaPromocion(c2.GetString("CAT_GP_ID"), clienteId)
|
||||||
If tm.Get("status") = "ok" Then 'Solo muestrala si hay producto.
|
If tm.Get("status") = "ok" Then 'Solo muestrala si hay producto.
|
||||||
Log(c2.GetString("CAT_GP_NOMBRE"))
|
Log(c2.GetString("CAT_GP_NOMBRE"))
|
||||||
|
|||||||
@@ -64,6 +64,6 @@ ModuleClosedNodes6=1,3
|
|||||||
ModuleClosedNodes7=
|
ModuleClosedNodes7=
|
||||||
ModuleClosedNodes8=
|
ModuleClosedNodes8=
|
||||||
ModuleClosedNodes9=1,3,7,31,35,36,37,38,39,40,41,42
|
ModuleClosedNodes9=1,3,7,31,35,36,37,38,39,40,41,42
|
||||||
NavigationStack=C_Nota,Class_Globals,0,0,C_Nota,B4XPage_Appear,110,5,B4XMainPage,b_envioBD_Click,478,0,C_Productos,b_terminar1_Click,838,0,C_Productos,b_prodMas_Click,628,3,C_Productos,b_prodMenos_Click,595,0,C_Principal,Subir_Click,456,0,C_Principal,cargar_Click,794,0,C_Principal,Class_Globals,0,0,C_Principal,JobDone,1677,6
|
NavigationStack=Diseñador Visual,Cliente.bal,-100,4,C_Cliente,Printer1_Connected,1054,0,EscPosPrinter,Connect,104,0,Diseñador Visual,login.bal,-100,2,C_Cliente,B4XPage_Appear,184,0,C_Cliente,B4XPage_Created,166,0,C_Cliente,GPS_LocationChanged,306,0,Subs,procesaPromocion,1003,0,Subs,traePromosVendidas,998,0,B4XMainPage,B_IMPRESORA_Click,431,0
|
||||||
SelectedBuild=0
|
SelectedBuild=0
|
||||||
VisibleModules=19,1,8,16,6,3,9,20,10,21
|
VisibleModules=19,1,8,16,6,3,9,20,10,21,13
|
||||||
|
|||||||
@@ -135,6 +135,40 @@ Public Sub Connect As Boolean
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Sub Connect2 As Boolean
|
||||||
|
'leos
|
||||||
|
' Serial1.Connect("88:6B:0F:3E:53:9E")
|
||||||
|
' Return True
|
||||||
|
' Try
|
||||||
|
' If Starter.MAC_IMPRESORA = "0" Then
|
||||||
|
Dim PairedDevices As Map
|
||||||
|
PairedDevices = Serial1.GetPairedDevices
|
||||||
|
Dim l As List
|
||||||
|
l.Initialize
|
||||||
|
For i = 0 To PairedDevices.Size - 1
|
||||||
|
l.Add(PairedDevices.GetKeyAt(i))
|
||||||
|
Next
|
||||||
|
Dim Res As Int
|
||||||
|
Res = InputList(l, "Choose a printer", -1) 'show list with paired devices 'ignore
|
||||||
|
If Res <> DialogResponse.CANCEL Then
|
||||||
|
Serial1.Connect(PairedDevices.Get(l.Get(Res))) 'convert the name to mac address
|
||||||
|
'Msgbox(PairedDevices.Get(l.Get(Res)),"mac")
|
||||||
|
Starter.mac_impresora = PairedDevices.Get(l.Get(Res))
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
' Else
|
||||||
|
' Serial1.Connect(Starter.mac_impresora)
|
||||||
|
' ' Starter.mac_impresora = colonia.MAC_IMPRESORA
|
||||||
|
' Return True
|
||||||
|
' End If
|
||||||
|
' Catch
|
||||||
|
' Log(LastException)
|
||||||
|
' End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
' Disconnect the printer
|
' Disconnect the printer
|
||||||
Public Sub DisConnect
|
Public Sub DisConnect
|
||||||
Serial1.Disconnect
|
Serial1.Disconnect
|
||||||
|
|||||||
Reference in New Issue
Block a user