' Mybusiness POS v. 2011
Sub Main()
if Ambiente.rstEstacion("torreta") <> 0 Then
if clAt( "LPT", Ambiente.rstEstacion("ptorreta") ) > 0 Then
Out Trim(Ambiente.rstEstacion("ptorreta")), Chr( 12 ) & "Total: $" & Formato( Val2( txtFields(4) ), "###,###.00" )
else
On Error resume next
Ambiente.torreta.PortOpen = True
if Ambiente.torreta.PortOpen Then
Ambiente.Torreta.OutPut = Chr( 12 ) & "Total: $" & Formato( Val2( txtFields(4) ), "###,###.00" )
end if
end if
end if
If Ambiente.rstEstacion("ventasportelefono") <> 0 Then
cSalida = ""
if Ambiente.rstEstacion("Cajon") <> 0 Then
cSalida = cSalida & Chr(27) & Chr(112) & Chr(48) & Chr(20) & Chr(20)
cSalida = cSalida & Chr(7)
' Sansung de inyección
' cSalida = cSalida & Chr(27) & Chr(112) & Chr(48) & Chr(49)
end if
if Ambiente.rstEstacion("ticket") <> 0 Then
if clAt( "LPT", Ambiente.rstEstacion("pticket") ) > 0 Then
Out Trim(Ambiente.rstEstacion("pticket")), cSalida
else
if Ambiente.Ticket.PortOpen Then
Ambiente.Ticket.Output = cSalida
end if
end if
End if
Exit Sub
End If
'If MsgBox( "Desea imprimir el ticket", vbQuestion + vbYesNo + vbDefaultButton2 ) = vbNo Then
' Exit Sub
'End If
' Creamos el recordSet del encabezado de la venta
Set rstEncabezado = Rst("SELECT * FROM ventas WHERE venta = " & prn.Documento, Ambiente.Connection )
' Verificamos que la venta que se desea imprimir exista
if rstEncabezado.EOF Then
MsgBox "No existe la venta seleccionada",vbInformation
Exit Sub
end if
' Creamos el recordSet de las partidas que componen la venta
Set rstPartidas = Rst("SELECT partvta.iespecial, partvta.articulo, prods.precio1,prods.descrip, partvta.precio, partvta.cantidad, partvta.descuento, partvta.impuesto, partvta.preciobase, partvta.prdescrip FROM partvta INNER JOIN prods ON prods.articulo = partvta.articulo WHERE venta =" & rstEncabezado.fields("Venta"), Ambiente.Connection )
' Traemos todos los datos del cliente
Set rstCliente = Rst("SELECT * FROM clients WHERE cliente = '" & rstEncabezado.fields("Cliente") & "'", Ambiente.Connection )
' Traemos los datos de cobranza si es que existe
Set rstCobranza = Rst( "SELECT * FROM cobranza WHERE venta = " & rstEncabezado("venta"), Ambiente.Connection )
cSalida = ""
'Esto abre el cajon de dinero
if Ambiente.rstEstacion("Cajon") <> 0 Then
cSalida = cSalida & Chr(27) & Chr(112) & Chr(48) & Chr(20) & Chr(20)
cSalida = cSalida & Chr(7)
' Sansung de inyección
' cSalida = cSalida & Chr(27) & Chr(112) & Chr(48) & Chr(49)
end if
Set rstTextTicket = CreaRecordSet( "SELECT * FROM tickettext", Ambiente.Connection )
If rstTextTicket.EOF Then
cSalida = cSalida & "" & Ambiente.Empresa & Chr(13) & Chr(10)
cSalida = cSalida & "" & Trim( Ambiente.Direccion1 ) & Chr(13) & Chr(10)
cSalida = cSalida & "" & Trim( Ambiente.Direccion2 ) & Chr(13) & Chr(10)
cSalida = cSalida & "" & Trim( Ambiente.Telefonos ) & Chr(13) & Chr(10)
Else
cSalida = cSalida & rstTextTicket("textheader")
End If
cSalida = cSalida & "" & Trim( rstEncabezado("Usuario") ) & " " & Trim( Ambiente.Estacion ) & " Ticket: " & rstEncabezado("No_referen") & Chr(13) & Chr(10)
cSalida = cSalida & Formato( rstEncabezado("f_emision"),"dd-MM-yyyy" ) & " Hora: " & rstEncabezado("usuHora") & Chr(13) & Chr(10)
cSalida = cSalida & Trim( rstCliente("cliente") ) & " " & Trim( rstCliente("Nombre") ) & Chr(13) & Chr(10)
cSalida = cSalida & Ambiente.rstEstacion("leyendacomodin") & " " & rstEncabezado("comodin") & Chr(13) & Chr(10)
cSalida = cSalida & "Vendedor: " & rstEncabezado("Vend") & Chr(13) & Chr(10)
cSalida = cSalida & "CANT. DESCRIPCION PRECIO IMPORTE" & Chr(13) & Chr(10)
nImporteTotal = 0
nImpuesto = 0
nCantidadTotal = 0
nDescuentoTotal = 0
nImporteOrigen = 0
'PrintText cSalida
If Ambiente.Tag <> "HTML" Then
If Ambiente.rstEstacion("ticket") <> 0 Then
if clAt( "LPT", Ambiente.rstEstacion("pticket") ) > 0 Then
Out Trim(Ambiente.rstEstacion("pticket")), cSalida
else
if Ambiente.Ticket.PortOpen Then
Ambiente.Ticket.Output = cSalida
end if
end if
End if
cSalida = ""
End If
While Not rstPartidas.EOF
nPrecio = rstPartidas("Precio") * ( 1 - (rstPartidas("Descuento")/100) ) * (1 + ( rstPartidas("impuesto") / 100 ) )
nPrecioBase = Round( rstPartidas("PrecioBase") * (1 + ( rstPartidas("impuesto") / 100 ) ), 2)
nDescuento = (nPrecioBase - nPrecio) * rstPartidas("Cantidad")
If nPrecioBase > 0 Then
nDescPor = ( nPrecio / nPrecioBase ) * 100
Else
nDescPor = 0
End If
nDescuentoTotal = nDescuentoTotal + nDescuento
nImporte = nPrecio * rstPartidas("Cantidad")
nCantidad = PadL(Formato( rstPartidas("cantidad"), "##,##0.00" ),3)
cDescrip = Mid( rstPartidas("Descrip"), 1, 16 )
nCantidadTotal = nCantidadTotal + rstPartidas("cantidad")
nImporteTotal = nImporteTotal + nImporte
nImpuesto = nImpuesto + ( nImporteTotal * ( rstPartidas("impuesto") / 100 ) )
nPrecio = 0
nIEspecial = rstPartidas("Precio") * (Val2(rstPartidas("iespecial")) / 100)
nIVa = rstPartidas("Precio") * (rstPartidas("impuesto") / 100)
nPrecio = rstPartidas("Precio") + nIEspecial + nIVa
cPrecio = PadL(Trim(Formato( nPrecio, Ambiente.FDinero )),8)
cImporte = PadL(Trim(Formato( Round( nPrecio, 2) * rstPartidas("cantidad") * (1 - (rstPartidas("descuento") / 100)), Ambiente.FDinero )),8)
nPrecioOrigen = Round( rstPartidas("PrecioBase") * (1 + ( rstPartidas("impuesto") / 100 )),2) * rstPartidas("cantidad")
nImporteOrigen = nImporteOrigen + nPrecioOrigen
strSalida = PadL(Formato( nCantidad, Ambiente.Formato ),2) & " " & cDescrip & " " & cPrecio & " " & cImporte
'If rstPartidas("Precio1") > rstPartidas("Precio") Then
' nDescuentoPartida = ( rstPartidas("Precio1") - rstPartidas("Precio") ) * nCantidad
' strSalida = strSalida & " Descuento: " & Formato( nDescuentoPartida, "##,##0.00" ) & vbCrLf
'End If
cSalida = cSalida & strSalida & Chr(13) & Chr(10)
If Not clEmpty( cNull( rstPartidas("prdescrip") ) ) Then
cSalida = cSalida & Trim( rstPartidas("prdescrip") ) & vbCrLf
End If
rstPartidas.MoveNext
Wend
'PrintText cSalida
If Ambiente.Tag <> "HTML" Then
If Ambiente.rstEstacion("ticket") <> 0 Then
if clAt( "LPT", Ambiente.rstEstacion("pticket") ) > 0 Then
Out Trim(Ambiente.rstEstacion("pticket")), cSalida
else
if Ambiente.Ticket.PortOpen Then
Ambiente.Ticket.Output = cSalida
end if
end if
End if
cSalida = ""
End If
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & " Importe: " & PadL(Formato( Val2(rstEncabezado("importe")), Ambiente.FDinero ),10) & Chr(13) & Chr(10)
cSalida = cSalida & " Impuesto: " & PadL(Formato( Val2(rstEncabezado("impuesto")), Ambiente.FDinero ),10) & Chr(13) & Chr(10)
if Val2(rstEncabezado("iespecial")) > 0 Then
cSalida = cSalida & " Impuesto 2%: " & PadL(Formato( Val2(rstEncabezado("iespecial")), Ambiente.FDinero ),10) & Chr(13) & Chr(10)
end if
if nDescuentoTotal > 0 Then
cSalida = cSalida & " Importe: " & PadL(Formato( nImporteOrigen, Ambiente.FDinero ),10) & Chr(13) & Chr(10)
cSalida = cSalida & " Descuento: " & PadL(Formato( nDescuentoTotal, Ambiente.FDinero ),10) & Chr(13) & Chr(10)
end if
cSalida = cSalida & " Importe: " & PadL(Formato( Val2(rstEncabezado("impuesto")) + Val2(rstEncabezado("importe")) + Val2(rstEncabezado("iespecial")), Ambiente.FDinero ),10) & Chr(13) & Chr(10)
cSalida = cSalida & " Redondeo: " & PadL(Formato( Val2(rstEncabezado("Redondeo")), Ambiente.FDinero ),10) & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & PadL(Formato( nCantidadTotal, "###,###" ),4) & " ----- TOTALES ---- " & PadL(Formato( (Val2(rstEncabezado("impuesto")) + Val2(rstEncabezado("importe")) + Val2(rstEncabezado("iespecial")) + Val2(rstEncabezado("redondeo"))), Ambiente.FDinero ),10) & Chr(13) & Chr(10)
nPagoTotal = Val2(rstEncabezado("Pago1")) + Val2(rstEncabezado("Pago2")) + Val2(rstEncabezado("Pago3"))
if rstEncabezado("Pago1") > 0 Then
cSalida = cSalida & " Pago en " & rstEncabezado("Concepto1") & " " & PadL(Formato( Val2(rstEncabezado("Pago1")), Ambiente.FDinero ),9) & Chr(13) & Chr(10)
end if
if rstEncabezado("Pago2") > 0 Then
cSalida = cSalida & " Pago en " & rstEncabezado("Concepto2") & " " & PadL(Formato( Val2(rstEncabezado("Pago2")), Ambiente.FDinero ),9) & Chr(13) & Chr(10)
end if
if rstEncabezado("Pago3") > 0 Then
cSalida = cSalida & " Pago en " & rstEncabezado("Concepto3") & " " & PadL(Formato( Val2(rstEncabezado("Pago3")), Ambiente.FDinero ),9) & Chr(13) & Chr(10)
end if
Eventos
If rstEncabezado("Comision") > 0 Then
cSalida = cSalida & " Comisión: " & PadL(Formato( Val2(rstEncabezado("comision")), Ambiente.FDinero ),10) & Chr(13) & Chr(10)
End If
nComision = rstEncabezado("comision")
if nPagoTotal < (Val2(rstEncabezado("impuesto")) + Val2(rstEncabezado("importe")) + Val2(rstEncabezado("iespecial")) + Val2(rstEncabezado("redondeo"))) Then
cSalida = cSalida & " Credito: " & PadL(Formato( Val2(rstEncabezado("impuesto")) + Val2(rstEncabezado("iespecial")) + Val2(rstEncabezado("importe")) + Val2(rstEncabezado("redondeo")) - nPagoTotal, Ambiente.FDinero ),9) & Chr(13) & Chr(10)
else
cSalida = cSalida & " Cambio: " & PadL(Formato( nPagoTotal - nComision - Val2(rstEncabezado("impuesto")) - Val2(rstEncabezado("iespecial")) - Val2(rstEncabezado("importe")) - Val2(rstEncabezado("redondeo")), Ambiente.FDinero ),9) & Chr(13) & Chr(10)
end if
Set rstMoneda = CreaRecordSet( "SELECT * FROM monedas WHERE moneda = '" & rstEncabezado("moneda") & "'", Ambiente.Connection )
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Letra( Val2(rstEncabezado("impuesto")) + Val2(rstEncabezado("importe")) + Val2(rstEncabezado("iespecial")), Trim(rstMoneda("Descrip")), True,rstMoneda("Nombre") ) & Chr(13) & Chr(10)
If rstTextTicket.EOF Then
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & "***** GRACIAS POR SU COMPRA *****" & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
cSalida = cSalida & Chr(13) & Chr(10)
Else
cSalida = cSalida & rstTextTicket("textend")
End If
' Esto manda un corte de papel
'PrintText cSalida
if Ambiente.rstEstacion("ticketcorte") <> 0 Then
cSalida = cSalida & Chr(27) & Chr(105)
end if
If Ambiente.Tag = "HTML" Then
Ambiente.Tag = ""
cSalida = Replace( cSalida, Chr(13) & Chr(10), "
" )
cSalida = "" & cSalida & " "
CreaHtml "", (cSalida)
Else
if Ambiente.rstEstacion("ticket") <> 0 Then
if clAt( "LPT", Ambiente.rstEstacion("pticket") ) > 0 Then
Out Trim(Ambiente.rstEstacion("pticket")), cSalida
else
if Ambiente.Ticket.PortOpen Then
Ambiente.Ticket.Output = cSalida
end if
end if
End if
End If
Dormir 100
Eventos
End Sub
CONTACTO ***** jofelchez@gmail.com *****
Soporte Remoto, helpmybusinesspos.info , TeamViewer, Hamachi, Descarga My Business pos 2012 Gratis, crack activar, keygen activador , FACTURACIÓN ELECTRÓNICA, my business pos 2012, MyCBB, Codigo de Barras BiDimensional, configurar facturas, Migración de la Versión 2006 a la Versión 2011, Delta, Configurar 2011, Manuales de Instalación, Errores, Modificar, Respaldos, Nuevo IVA, Red MyBusiness, Problema, Ambiente path, Migración, Impresora, Descarga 2011, Reportes, Presentaciones, Win7, SQL, Manager, Ticket, Etiquetas, Generador, Corte X Z, Restaurar, Zebra, Logo, recomendaciones, Remisiones, Barras, Inventario, hamachi, Delta y LINUX, code39, como cambiar el iva en my business pos, my business pos blogspot, como instalar my busuness delta, TPV, MyMoney, Concentrador POS, Zebra, Datamax, Mobile Business, Commander, Restaurante, MyBusiness POS 2012, Kardex
Mostrando entradas con la etiqueta pticket. Mostrar todas las entradas
Mostrando entradas con la etiqueta pticket. Mostrar todas las entradas
sábado, 12 de noviembre de 2011
Ticket con descuentos
Este es el código fuente del formato "Ticket con descuentos"
miércoles, 9 de noviembre de 2011
Cómo cambiar la fuente del ticket
[wpdm_package id='15747']
[youtube ZW7MkyRe9Bw]
Para poder modificar el tamaño de la fuente en el ticket de My Business POS, primero es necesario conocer cómo está conectada la impresora, así como la configuración de la estación de trabajo.
Existen dos formas de modificar el texto de un ticket:
1. Para las impresoras configuradas por puerto LPT:
Se modifica un procedimiento llamado FORMATOTEXTO (En el Business Manager—Configuración—Personalización—Procedimientos y Rutinas del Usuario)
Ahí está un código como este:
Lo que vamos a hacer es identificar p.Font.Name y p.Font.Size. Puede cambiarlo por una fuente legible y que a la vez se ajuste en el ticket. Se recomienda que utilice los tipos de letra Tahoma o Courier New debido a que estos utilizan caracteres con ancho estándar; sin embargo puede hacer pruebas con la fuente Arial.
Para GUARDAR los cambios, presione F2 o de clic en el botón Guardar.
2. Para impresoras configuradas por puerto USB:
Para este caso, es posible modificar el ticket en la parte final del formato TICKET (En el Business Manager—Configuración—Personalización—FORMATOS) y ubicamos el código, el cual está comentado:
Lo descomentamos, agregamos la fuente y debe quedar de la siguiente manera:
Guardamos (F2) y hacemos la prueba
Para más información por favor visite http://helpmybusinesspos.info/errores-de-mybusiness-pos/como-elegir-la-miniprinter-mas-apropiada-para-su-negocio/
[youtube UPYM_iRZbmg]
[youtube ZW7MkyRe9Bw]
Para poder modificar el tamaño de la fuente en el ticket de My Business POS, primero es necesario conocer cómo está conectada la impresora, así como la configuración de la estación de trabajo.
Existen dos formas de modificar el texto de un ticket:
1. Para las impresoras configuradas por puerto LPT:
Se modifica un procedimiento llamado FORMATOTEXTO (En el Business Manager—Configuración—Personalización—Procedimientos y Rutinas del Usuario)
Ahí está un código como este:
Sub Main()
Dim p, s
On error resume next
Set p = ImpresoraDefault(Ambiente.rstEstacion("pticket"))
' p.ScaleMode = 7 ' Centimetros
'p.PaintPicture LoadPicture(Ambiente.Path & "\images\logo.jpg"), 0, 0, 3, 4
p.Font.Name = "Courier New"
p.Font.Size = 9
p.FontBold True
For n = 1 To 2
s = s & vbCrLf
Next
' pt (print text) imprime el texto indicado (impresora), (texto)
pt (p),(s)
pt (p),(Script.textToFormat)
p.EndDoc
End Sub
Lo que vamos a hacer es identificar p.Font.Name y p.Font.Size. Puede cambiarlo por una fuente legible y que a la vez se ajuste en el ticket. Se recomienda que utilice los tipos de letra Tahoma o Courier New debido a que estos utilizan caracteres con ancho estándar; sin embargo puede hacer pruebas con la fuente Arial.
Para GUARDAR los cambios, presione F2 o de clic en el botón Guardar.
2. Para impresoras configuradas por puerto USB:
Para este caso, es posible modificar el ticket en la parte final del formato TICKET (En el Business Manager—Configuración—Personalización—FORMATOS) y ubicamos el código, el cual está comentado:
'IniciaDocumento
'Say 0,0, cSalida
'FinDocumento
'Exit Sub
Lo descomentamos, agregamos la fuente y debe quedar de la siguiente manera:
IniciaDocumento
EstableceFuente "Courier New", 9
'FontBold True
Say 0,0, cSalida
FinDocumento
Exit Sub
Guardamos (F2) y hacemos la prueba
Para más información por favor visite http://helpmybusinesspos.info/errores-de-mybusiness-pos/como-elegir-la-miniprinter-mas-apropiada-para-su-negocio/
[youtube UPYM_iRZbmg]
Etiquetas:
ambiente,
font bold,
Formatos,
images,
impresoras,
letra negrita,
pticket,
Ticket
Imprime el ticket via Windows
' Mybusiness POS v. 2011
Sub Main()
imprime Ambiente.rstEstacion.fields("ImpRem")
'imprime "\\SERVER2\HP LaserJet 3300 Series PCL 6"
End Sub
Function imprime( cImpresora )
' Formato de remisiones
' Por() Daniel
Dim rstEncabezado 'El recordSet de los datos generales
Dim rstPartidas 'Las partidas de la factura
Dim rstCliente 'El cliente de la venta
Dim rstLotes 'Lista de lotes
Dim rstSeries 'Lista de números de serie
Dim nRenglon 'El número de renglón sobre el que se va a trabajar
Dim strSql 'Una cadena con el query que se va a ejecutar
Dim Estado 'El estado de la venta cancelado o facturado
Dim ImportePartida 'El importe de cada partida
Dim ImporteTotal 'El importe total de la factura
Dim Impuesto 'El impuesto de la factura
Dim rstMoneda 'La moneda de la venta
Dim nLineas 'Un contador para los campos de tipo memo
Dim nSalto
nSalto = 0.7
'Esto abre el cajon de dinero
if Ambiente.rstEstacion("Cajon") <> 0 Then
if Not clEmpty(Ambiente.rstEstacion("pticket")) Then
Out Trim(Ambiente.rstEstacion("pticket")), Chr(27) & Chr(112) & Chr(48) & Chr(20) & Chr(20)
end if
end if
' Creamos el recordSet del encabezado de la venta
Set rstEncabezado = Rst("SELECT * FROM ventas WHERE venta = " & prn.Documento, Ambiente.Connection )
' Verificamos que la venta que se desea imprimir exista
if rstEncabezado.EOF Then
MsgBox "No existe la venta seleccionada",vbInformation
Exit Function
end if
' Creamos el recordSet de las partidas que componen la venta
Set rstPartidas = Rst("SELECT * FROM partvta WHERE venta =" & rstEncabezado.fields("Venta"), Ambiente.Connection )
' Traemos todos los datos del cliente
Set rstCliente = Rst("SELECT * FROM clients WHERE cliente = '" & rstEncabezado.fields("Cliente") & "'", Ambiente.Connection )
'Indicamos cual es la impresora que deseamos utilizar
EstableceImpresora (cImpresora)
' Iniciamos la Impresión del encabezado de la forma
IniciaDocumento
EstableceFuente "Courier New", 9
FontBold True
' Imprimimos el logo del programa
'Picture Ambiente.path & "\Images\Business.jpg", Col(28), Row(1), Col(7),Row(4)
' Imprimimos el Nombre de la empres
'FilledBox 1.5,0.2,5,0.33, RGB( 200, 200, 200 )
nRenglon = 0
nRenglon = nRenglon + nSalto
FontBold True
Say Row(nRenglon),Col(28), Ambiente.Empresa
FontBold False
nRenglon = nRenglon + nSalto
nRenglon = nRenglon + nSalto
Say Prn.Row(nRenglon), Col(28), Ambiente.Direccion1
nRenglon = nRenglon + nSalto
Say Prn.Row(nRenglon), Col(28), Ambiente.Direccion2
nRenglon = nRenglon + nSalto
Say Prn.Row(nRenglon), Col(28), "Ticket: " & rstEncabezado.Fields("No_referen") & " Caja: " & Ambiente.Estacion
nRenglon = nRenglon + nSalto
Say Prn.Row(nRenglon), Col(28), rstEncabezado.Fields("Usuario") & " " & Formato( rstEncabezado.Fields("UsuFecha"), "dd/MM/yyyy") & " " & rstEncabezado.Fields("UsuHora")
if rstEncabezado.Fields("Estado") = "CA" Then
Estado = "CANCELADO"
end if
if rstEncabezado.Fields("Estado") = "CO" Then
Estado = "REMISIONADO"
end if
FontBold False
nRenglon = nRenglon + nSalto
While Not rstPartidas.EOF
' No congelamos el sistema
Ev = DoEvents
'Say Row(nRenglon), Col(36), Trim(rstPartidas.Fields("Articulo"))
Say Row(nRenglon), Col(43), Padl(Formato(rstPartidas.Fields("Precio") * (1 + ( rstPartidas.Fields("Impuesto") / 100)), "###,###,###.00"), 6)
Say Row(nRenglon), Col(40), rstPartidas.Fields("Cantidad")
'Say Row(nRenglon), Col(59), rstPartidas.Fields("Descuento")
' Calculamos el importe
ImportePartida = rstPartidas.Fields("Precio") * rstPartidas.Fields("Cantidad")
ImportePartida = ImportePartida - ( ImportePartida * ( rstPartidas.Fields("Descuento") / 100 ) )
Say Row(nRenglon), Col(47.5), PadL(Formato(ImportePartida * (1 + ( rstPartidas.Fields("Impuesto") / 100)),"###,###,###.00"),6)
' Contamos las lineas que tiene el campo memo
' Imprimimos las lineas al final para poder incrementar los renglones
' sin afectar a las partidas
nLineas = CuantasLineas( rstPartidas.Fields("Observ") )
' Imprimimos cada una de ellas
For n = 1 to nLineas
Say Row(nRenglon), Col(28), Mid( strLinea( Trim(rstPartidas.Fields("Observ")), n), 1, 18 )
nRenglon = nRenglon + nSalto
Next
' Si no existen comentarios no disminuimos en un renglon.
if nLineas > 0 Then
nRenglon = nRenglon - nSalto
end if
rstPartidas.MoveNext
nRenglon = nRenglon + nSalto
If nRenglon >= 60 Then
nRenglon = 1
PaginaNueva
End If
Wend
' Imprimimos las observaciones de la operacion
nLineas = CuantasLineas( rstEncabezado.Fields("Observ") )
' Imprimimos cada una de ellas
For n = 1 to nLineas
nRenglon = nRenglon + 1
Say Row(nRenglon), Col(30), strLinea( rstEncabezado.Fields("Observ"), n)
Next
' Imprimimos la leyenda en letra y los totales
ImporteTotal = rstEncabezado.fields("Importe")
Impuesto = rstEncabezado.fields("Impuesto")
Set rstMoneda = rst("SELECT * FROM monedas WHERE moneda = '" & rstEncabezado.fields("Moneda") & "'", Ambiente.Connection )
nRenglon = nRenglon + nSalto
Say Row(nRenglon), Col(28), "Importe : " & PadL(Formato(ImporteTotal,"###,###,###.00"),12)
nRenglon = nRenglon + nSalto
Say Row(nRenglon), Col(28), "Impuesto: " & PadL(Formato(Impuesto,"###,###,###.00"),12)
nRenglon = nRenglon + nSalto
Say Row(nRenglon), Col(28), "Total : " & PadL(Formato(ImporteTotal + Impuesto,"###,###,###.00"),12)
nRenglon = nRenglon + nSalto
nCobro = rstEncabezado.fields("Pago1") + rstEncabezado.fields("Pago2") + rstEncabezado.fields("Pago3")
Say Row(nRenglon), Col(28), "Su pago : " & PadL( Formato( nCobro, Ambiente.Fdinero ), 12 )
nRenglon = nRenglon + nSalto
nCambio = ImporteTotal + Impuesto - (rstEncabezado.fields("Pago1") + rstEncabezado.fields("Pago2") + rstEncabezado.fields("Pago3"))
Say Row(nRenglon), Col(28), "Cambio : " & PadL( Formato( Abs(nCambio), Ambiente.FDinero ), 12 )
nRenglon = nRenglon + nSalto
nRenglon = nRenglon + nSalto
Say Row(nRenglon), Col(28),Trim( Letra(ImporteTotal + Impuesto, rstMoneda.fields("Descrip"), True, rstMoneda.fields("Nombre") ) )
nRenglon = nRenglon + nSalto
Say Row(nRenglon), Col(28), "Gracias por su preferencia"
' Se da por terminado el documento
FinDocumento
End Function
Suscribirse a:
Entradas (Atom)