mirror of
https://github.com/KeymonSoft/Durakelo.git
synced 2026-04-17 19:36:12 +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")
|
||||
total_cliente = s.GetString("TOTAL_CLIE")
|
||||
End If
|
||||
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")
|
||||
' 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")
|
||||
|
||||
TOMAR_FOTO = 0
|
||||
g.Initialize("GPS")
|
||||
@@ -187,6 +187,16 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
End Sub
|
||||
|
||||
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
|
||||
b_factura.Visible = False
|
||||
FACTURA =0
|
||||
@@ -265,10 +275,12 @@ Sub B4XPage_Appear
|
||||
Else
|
||||
META2 = 300
|
||||
End If
|
||||
If META2 < 1 Then
|
||||
If META2 = 0 Then
|
||||
META2 = "CUBIERTO"
|
||||
Else
|
||||
|
||||
la_saldooper.Text = NumberFormat2(META2, 1, 3, 2, False)
|
||||
End If
|
||||
la_saldooper.Text = numberformat2(META2, 1, 3, 2, False)
|
||||
|
||||
If Printer1.IsConnected = False Then
|
||||
Printer1.Connect
|
||||
@@ -424,6 +436,7 @@ Sub b_mapa_Click
|
||||
End Sub
|
||||
|
||||
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.Position =0
|
||||
perfil = c.GetString("CUANTOS")
|
||||
@@ -447,6 +460,7 @@ Sub B_IMP_Click
|
||||
c.Position = 0
|
||||
sucursal = c.GetString("CAT_VA_VALOR")
|
||||
c.Close
|
||||
|
||||
ProgressDialogShow("Imprimiendo, un momento ...")
|
||||
Printer1.DisConnect
|
||||
If Not(Printer1.IsConnected) Then
|
||||
@@ -636,6 +650,7 @@ Sub B_IMP_Click
|
||||
End Sub
|
||||
|
||||
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.Position =0
|
||||
perfil = c.GetString("CUANTOS")
|
||||
@@ -810,6 +825,7 @@ Sub B_IMP2_Click
|
||||
End Sub
|
||||
|
||||
Sub B_INV_Click
|
||||
'' Printer1.Connect2
|
||||
c=Starter.skmt.ExecQuery("select USUARIO from usuarioa")
|
||||
c.Position=0
|
||||
usuario = c.GetString("USUARIO")
|
||||
@@ -817,7 +833,35 @@ Sub B_INV_Click
|
||||
sDate=DateTime.Date(DateTime.Now)
|
||||
sTime=DateTime.Time(DateTime.Now)
|
||||
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
|
||||
ESPACIO = 21
|
||||
BLANCO = " "
|
||||
@@ -914,6 +958,8 @@ Sub B_INV_Click
|
||||
Printer1.WriteString("------------------------------" & CRLF)
|
||||
Printer1.WriteString(" " & CRLF)
|
||||
' printer.Flush
|
||||
ProgressDialogHide
|
||||
Printer1.DisConnect
|
||||
End Sub
|
||||
|
||||
Sub B_VENTA_Click
|
||||
|
||||
Reference in New Issue
Block a user