In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

TReport+Ticket

Foro público de Xailer en español
Responder
zeasoftware
Mensajes: 1831
Registrado: Mar Oct 11, 2005 9:53 am

TReport+Ticket

Mensaje por zeasoftware »

Alguien ha hecho impresion de tickets usando la clase TReport?
o Podrian darme alguna sugerencia?
Gracias.
--
Ramón Zea
01.993.194.14.27
http://www.paginasprodigy.com/zeasoftware/
zeasoftware@prodigy.net.mx
zeasoftware@hotmail.com
ramonzea@yahoo.com
zeasoft.movil@hotmail.com
visita mi "venta de garage"
Avatar de Usuario
jasm
Mensajes: 447
Registrado: Mar Jul 08, 2008 8:12 pm

TReport+Ticket

Mensaje por jasm »

Ramon,
Yo he usado la TCanvas y he conseguido muy buen efecto tanto en
matriciales como en termicas.
Saludos
Jose A. Suarez
zeasoftware
Mensajes: 1831
Registrado: Mar Oct 11, 2005 9:53 am

TReport+Ticket

Mensaje por zeasoftware »

seria mucho pedir si compartes el ejemplo?
de todos modos empiezo a investgar.
gracias.
--
Ramón Zea
01.993.194.14.27
http://www.paginasprodigy.com/zeasoftware/
zeasoftware@prodigy.net.mx
zeasoftware@hotmail.com
ramonzea@yahoo.com
zeasoft.movil@hotmail.com
visita mi "venta de garage"
"José Alfonso Suárez Moreno" <jasm@tpvsoft.com> escribió en el mensaje
news:463f833a$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Ramon,
>
> Yo he usado la TCanvas y he conseguido muy buen efecto tanto en
> matriciales como en termicas.
>
> Saludos
>
> Jose A. Suarez
desarrollo
Mensajes: 109
Registrado: Lun Abr 02, 2007 10:12 am

TReport+Ticket

Mensaje por desarrollo »

Ramon,
Esta noche cuelgo un ejemplo.
Saludos
Jose A. Suarez
"Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
news:[email=463fdf3a@ozsrv2.ozlan.local...]463fdf3a@ozsrv2.ozlan.local...[/email]
> seria mucho pedir si compartes el ejemplo?
>
> de todos modos empiezo a investgar.
>
> gracias.
>
> --
> Ramón Zea
> 01.993.194.14.27
> http://www.paginasprodigy.com/zeasoftware/
> zeasoftware@prodigy.net.mx
> zeasoftware@hotmail.com
> ramonzea@yahoo.com
> zeasoft.movil@hotmail.com
> visita mi "venta de garage"
> "José Alfonso Suárez Moreno" <jasm@tpvsoft.com> escribió en el mensaje
> news:463f833a$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Ramon,
>>
>> Yo he usado la TCanvas y he conseguido muy buen efecto tanto en
>> matriciales como en termicas.
>>
>> Saludos
>>
>> Jose A. Suarez
>
>
zeasoftware
Mensajes: 1831
Registrado: Mar Oct 11, 2005 9:53 am

TReport+Ticket

Mensaje por zeasoftware »

Alguna mano amiga?
Gracias de antemano
--
Ramón Zea
01.993.194.14.27
http://www.paginasprodigy.com/zeasoftware/
zeasoftware@prodigy.net.mx
zeasoftware@hotmail.com
ramonzea@yahoo.com
zeasoft.movil@hotmail.com
visita mi "venta de garage"
"Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
news:463d8ecf$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Alguien ha hecho impresion de tickets usando la clase TReport?
>
> o Podrian darme alguna sugerencia?
>
> Gracias.
>
> --
> Ramón Zea
> 01.993.194.14.27
> http://www.paginasprodigy.com/zeasoftware/
> zeasoftware@prodigy.net.mx
> zeasoftware@hotmail.com
> ramonzea@yahoo.com
> zeasoft.movil@hotmail.com
> visita mi "venta de garage"
>
PILO
Mensajes: 583
Registrado: Vie Jul 06, 2007 5:18 pm

TReport+Ticket

Mensaje por PILO »

Yo en una funcion aparte en un prg he utilizado
para imprimir en una matricial, lo mismos que he
utilizado en cliper, con las opciones
de Say, has probado ha hacerlo así
"Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
news:[email=4643cf94@ozsrv2.ozlan.local...]4643cf94@ozsrv2.ozlan.local...[/email]
> Alguna mano amiga?
>
> Gracias de antemano
> --
> Ramón Zea
> 01.993.194.14.27
> http://www.paginasprodigy.com/zeasoftware/
> zeasoftware@prodigy.net.mx
> zeasoftware@hotmail.com
> ramonzea@yahoo.com
> zeasoft.movil@hotmail.com
> visita mi "venta de garage"
> "Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
> news:463d8ecf$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Alguien ha hecho impresion de tickets usando la clase TReport?
>>
>> o Podrian darme alguna sugerencia?
>>
>> Gracias.
>>
>> --
>> Ramón Zea
>> 01.993.194.14.27
>> http://www.paginasprodigy.com/zeasoftware/
>> zeasoftware@prodigy.net.mx
>> zeasoftware@hotmail.com
>> ramonzea@yahoo.com
>> zeasoft.movil@hotmail.com
>> visita mi "venta de garage"
>>
>
>
zeasoftware
Mensajes: 1831
Registrado: Mar Oct 11, 2005 9:53 am

TReport+Ticket

Mensaje por zeasoftware »

No, pues lo que quiero es utilizar las clases que se conecten con las
impresoras que windows tenga disponibles.
No se si usando la estructura de clipper, para hacer reportes, pueda ser
compatible aqui, y que el resultado salga aunque la impresora este en un
puerto USB, etc...
Gracias.,
--
Ramón Zea
01.993.194.14.27
http://www.paginasprodigy.com/zeasoftware/
zeasoftware@prodigy.net.mx
zeasoftware@hotmail.com
ramonzea@yahoo.com
zeasoft.movil@hotmail.com
visita mi "venta de garage"
"PILO" <srmpilo@hotmail.com> escribió en el mensaje
news:464414fc$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Yo en una funcion aparte en un prg he utilizado
> para imprimir en una matricial, lo mismos que he
> utilizado en cliper, con las opciones
> de Say, has probado ha hacerlo así
>
> "Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
> news:[email=4643cf94@ozsrv2.ozlan.local...]4643cf94@ozsrv2.ozlan.local...[/email]
>> Alguna mano amiga?
>>
>> Gracias de antemano
>> --
>> Ramón Zea
>> 01.993.194.14.27
>> http://www.paginasprodigy.com/zeasoftware/
>> zeasoftware@prodigy.net.mx
>> zeasoftware@hotmail.com
>> ramonzea@yahoo.com
>> zeasoft.movil@hotmail.com
>> visita mi "venta de garage"
>> "Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
>> news:463d8ecf$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>> Alguien ha hecho impresion de tickets usando la clase TReport?
>>>
>>> o Podrian darme alguna sugerencia?
>>>
>>> Gracias.
>>>
>>> --
>>> Ramón Zea
>>> 01.993.194.14.27
>>> http://www.paginasprodigy.com/zeasoftware/
>>> zeasoftware@prodigy.net.mx
>>> zeasoftware@hotmail.com
>>> ramonzea@yahoo.com
>>> zeasoft.movil@hotmail.com
>>> visita mi "venta de garage"
>>>
>>
>>
>
>
Xevi
Mensajes: 1706
Registrado: Jue Sep 08, 2005 12:58 pm

TReport+Ticket

Mensaje por Xevi »

Ramón,
Como bien dice Jose Alfonso, utiliza la clase TCanvas, unida a TPrinter y
verás que funciona de maravilla.
Léete la documentación de estas dos clases,... yo te dejo un trozo de como
lo utilizo, por ej. en un listado...
....
Printer:nOrientation := DMORIENT_PORTRAIT
Printer:StartDoc()
Printer:oCanvas:nMapMode := mmHIMETRICS
nLines := 56
For n := 1 to Len( aItems )
If nLines > 55
xCap( ::oEditTitol:cText, AppData:nIdioma, AppData:cNomEmpresa )
Printer:oCanvas:oFont:nSize := 8
Printer:oCanvas:oFont:lBold := .T.
PrinterDrawText( aIdioma[2,AppData:nIdioma], { 15, 40, 25, 44 },
TA_LEFT )
PrinterDrawText( aIdioma[3,AppData:nIdioma], { 25, 40, 40, 44 },
TA_LEFT )
PrinterDrawText( aIdioma[4,AppData:nIdioma], { 41, 40, 99, 44 },
TA_LEFT )
PrinterDrawText( aIdioma[5,AppData:nIdioma], { 100, 40, 119, 44 },
TA_RIGHT )
PrinterDrawText( aIdioma[6,AppData:nIdioma], { 120, 40, 130, 44 },
TA_RIGHT )
PrinterDrawText( aIdioma[8,AppData:nIdioma], { 131, 40, 140, 44 },
TA_RIGHT )
PrinterDrawText( aIdioma[7,AppData:nIdioma], { 141, 40, 160, 44 },
TA_RIGHT )
PrinterDrawText( aIdioma[9,AppData:nIdioma], { 161, 40, 180, 44 },
TA_RIGHT )
PrinterDrawText( aIdioma[10,AppData:nIdioma], { 181, 40, 198, 44 },
TA_RIGHT )
PrinterDrawLine( { 15, 43.6, 198, 43.6 }, 2 )
PrinterDrawLine( { 15, 44.2, 198, 44.2 }, 2 )
Printer:oCanvas:oFont:lBold := .F.
nLines := 1
EndIf
nLin := 43 + nLines * 4
Printer:oCanvas:oFont:lBold := .F.
PrinterDrawText( AllTrim( aItems[n,1] ), { nCol := 15, nLin, nCol+=10,
nLin +10 }, TA_LEFT )
PrinterDrawText( aItems[n,2], { nCol, nLin, nCol+=15, nLin +10 },
TA_LEFT )
PrinterDrawText( aItems[n,3], { nCol+1, nLin, nCol+=59, nLin +10 },
TA_LEFT )
PrinterDrawText( Transform( aItems[n,8], "@EZ 99,999,999.99" ), {
nCol+1, nLin, nCol+=20, nLin +10 }, TA_RIGHT )
PrinterDrawText( aItems[n,9], { nCol+1, nLin, nCol+=11, nLin +10 },
TA_RIGHT )
PrinterDrawText( Transform( aItems[n,11], "@EZ 9.99%" ), { nCol+1,
nLin, nCol+=10, nLin +10 }, TA_RIGHT )
PrinterDrawText( Transform( aItems[n,10], "@EZ 99,999,999.99" ), {
nCol+1, nLin, nCol+=20, nLin +10 }, TA_RIGHT )
PrinterDrawText( Transform( aItems[n,12], "@EZ 99,999,999.99" ), {
nCol+1, nLin, nCol+=20, nLin +10 }, TA_RIGHT )
PrinterDrawText( Transform( aItems[n,7], "@EZ 99,999,999.99" ), {
nCol+1, nLin, 198, nLin +10 }, TA_RIGHT )
nTotalBaseImp += aItems[n,8]
nTotalIva += aItems[n,10]
nTotalRE += aItems[n,12]
nTotal += aItems[n,7]
nLines++
Next
If Len( aItems ) > 0
PrinterDrawLine( { 15, nLin+5.5, 198, nLin+5.5 }, 2 )
PrinterDrawLine( { 15, nLin+6.1, 198, nLin+6.1 }, 2 )
Printer:oCanvas:oFont := TFont():Create( "Arial", 9, 0, 800 )
Printer:oCanvas:oFont:nSize := 9
Printer:oCanvas:oFont:lBold := .T.
nLines++
nLin := 43 + nLines * 4
PrinterDrawText( TransForm( nTotalBaseImp, "@EZ 999,999,999.99" ), {
101, nLin, 119, nLin +10 }, TA_RIGHT )
PrinterDrawText( TransForm( nTotalIVA, "@EZ 999,999,999.99" ), { 141,
nLin, 160, nLin +10 }, TA_RIGHT )
PrinterDrawText( TransForm( nTotalRE, "@EZ 999,999,999.99" ), { 161,
nLin, 180, nLin +10 }, TA_RIGHT )
PrinterDrawText( TransForm( nTotal, "@EZ 999,999,999.99" ), { 181,
nLin, 198, nLin +10 }, TA_RIGHT )
EndIf
Printer:EndPage()
Printer:EndDoc()
Application:lBusy := .F.
::Hide()
Printer:lPreviewModal := .F.
Printer:Preview()
Printer:lPreviewModal := lPreviewModal
Un Saludo,
Xevi.
"Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
news:[email=4643cf94@ozsrv2.ozlan.local...]4643cf94@ozsrv2.ozlan.local...[/email]
> Alguna mano amiga?
>
> Gracias de antemano
> --
> Ramón Zea
> 01.993.194.14.27
> http://www.paginasprodigy.com/zeasoftware/
> zeasoftware@prodigy.net.mx
> zeasoftware@hotmail.com
> ramonzea@yahoo.com
> zeasoft.movil@hotmail.com
> visita mi "venta de garage"
> "Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
> news:463d8ecf$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Alguien ha hecho impresion de tickets usando la clase TReport?
>>
>> o Podrian darme alguna sugerencia?
>>
>> Gracias.
>>
>> --
>> Ramón Zea
>> 01.993.194.14.27
>> http://www.paginasprodigy.com/zeasoftware/
>> zeasoftware@prodigy.net.mx
>> zeasoftware@hotmail.com
>> ramonzea@yahoo.com
>> zeasoft.movil@hotmail.com
>> visita mi "venta de garage"
>>
>
>
desarrollo
Mensajes: 109
Registrado: Lun Abr 02, 2007 10:12 am

TReport+Ticket

Mensaje por desarrollo »

Ramon,
Se me paso subir el ejemplo.
Esta noche lo pongo sin falta.
Mis disculpas.
Saludos
Jose A. Suarez
"Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
news:[email=4643cf94@ozsrv2.ozlan.local...]4643cf94@ozsrv2.ozlan.local...[/email]
> Alguna mano amiga?
>
> Gracias de antemano
> --
> Ramón Zea
> 01.993.194.14.27
> http://www.paginasprodigy.com/zeasoftware/
> zeasoftware@prodigy.net.mx
> zeasoftware@hotmail.com
> ramonzea@yahoo.com
> zeasoft.movil@hotmail.com
> visita mi "venta de garage"
> "Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
> news:463d8ecf$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Alguien ha hecho impresion de tickets usando la clase TReport?
>>
>> o Podrian darme alguna sugerencia?
>>
>> Gracias.
>>
>> --
>> Ramón Zea
>> 01.993.194.14.27
>> http://www.paginasprodigy.com/zeasoftware/
>> zeasoftware@prodigy.net.mx
>> zeasoftware@hotmail.com
>> ramonzea@yahoo.com
>> zeasoft.movil@hotmail.com
>> visita mi "venta de garage"
>>
>
>
zeasoftware
Mensajes: 1831
Registrado: Mar Oct 11, 2005 9:53 am

TReport+Ticket

Mensaje por zeasoftware »

Gracias lo voy a revisar, el asunto es que en si al Canvas aun no le
entiendo bien.
Saludos.
--
Ramón Zea
01.993.194.14.27
http://www.paginasprodigy.com/zeasoftware/
zeasoftware@prodigy.net.mx
zeasoftware@hotmail.com
ramonzea@yahoo.com
zeasoft.movil@hotmail.com
visita mi "venta de garage"
"Xevi" <xevicomas@gmail.com> escribió en el mensaje
news:[email=4644267a@ozsrv2.ozlan.local...]4644267a@ozsrv2.ozlan.local...[/email]
> Ramón,
>
> Como bien dice Jose Alfonso, utiliza la clase TCanvas, unida a TPrinter y
> verás que funciona de maravilla.
> Léete la documentación de estas dos clases,... yo te dejo un trozo de como
> lo utilizo, por ej. en un listado...
>
> ...
> Printer:nOrientation := DMORIENT_PORTRAIT
> Printer:StartDoc()
> Printer:oCanvas:nMapMode := mmHIMETRICS
>
> nLines := 56
>
> For n := 1 to Len( aItems )
>
> If nLines > 55
> xCap( ::oEditTitol:cText, AppData:nIdioma, AppData:cNomEmpresa )
>
> Printer:oCanvas:oFont:nSize := 8
> Printer:oCanvas:oFont:lBold := .T.
> PrinterDrawText( aIdioma[2,AppData:nIdioma], { 15, 40, 25, 44 },
> TA_LEFT )
> PrinterDrawText( aIdioma[3,AppData:nIdioma], { 25, 40, 40, 44 },
> TA_LEFT )
> PrinterDrawText( aIdioma[4,AppData:nIdioma], { 41, 40, 99, 44 },
> TA_LEFT )
> PrinterDrawText( aIdioma[5,AppData:nIdioma], { 100, 40, 119, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[6,AppData:nIdioma], { 120, 40, 130, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[8,AppData:nIdioma], { 131, 40, 140, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[7,AppData:nIdioma], { 141, 40, 160, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[9,AppData:nIdioma], { 161, 40, 180, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[10,AppData:nIdioma], { 181, 40, 198,
> 44 }, TA_RIGHT )
> PrinterDrawLine( { 15, 43.6, 198, 43.6 }, 2 )
> PrinterDrawLine( { 15, 44.2, 198, 44.2 }, 2 )
> Printer:oCanvas:oFont:lBold := .F.
> nLines := 1
> EndIf
>
> nLin := 43 + nLines * 4
> Printer:oCanvas:oFont:lBold := .F.
> PrinterDrawText( AllTrim( aItems[n,1] ), { nCol := 15, nLin,
> nCol+=10, nLin +10 }, TA_LEFT )
> PrinterDrawText( aItems[n,2], { nCol, nLin, nCol+=15, nLin +10 },
> TA_LEFT )
> PrinterDrawText( aItems[n,3], { nCol+1, nLin, nCol+=59, nLin +10 },
> TA_LEFT )
> PrinterDrawText( Transform( aItems[n,8], "@EZ 99,999,999.99" ), {
> nCol+1, nLin, nCol+=20, nLin +10 }, TA_RIGHT )
> PrinterDrawText( aItems[n,9], { nCol+1, nLin, nCol+=11, nLin +10 },
> TA_RIGHT )
> PrinterDrawText( Transform( aItems[n,11], "@EZ 9.99%" ), { nCol+1,
> nLin, nCol+=10, nLin +10 }, TA_RIGHT )
> PrinterDrawText( Transform( aItems[n,10], "@EZ 99,999,999.99" ), {
> nCol+1, nLin, nCol+=20, nLin +10 }, TA_RIGHT )
> PrinterDrawText( Transform( aItems[n,12], "@EZ 99,999,999.99" ), {
> nCol+1, nLin, nCol+=20, nLin +10 }, TA_RIGHT )
> PrinterDrawText( Transform( aItems[n,7], "@EZ 99,999,999.99" ), {
> nCol+1, nLin, 198, nLin +10 }, TA_RIGHT )
>
> nTotalBaseImp += aItems[n,8]
> nTotalIva += aItems[n,10]
> nTotalRE += aItems[n,12]
> nTotal += aItems[n,7]
> nLines++
> Next
>
> If Len( aItems ) > 0
> PrinterDrawLine( { 15, nLin+5.5, 198, nLin+5.5 }, 2 )
> PrinterDrawLine( { 15, nLin+6.1, 198, nLin+6.1 }, 2 )
> Printer:oCanvas:oFont := TFont():Create( "Arial", 9, 0, 800 )
> Printer:oCanvas:oFont:nSize := 9
> Printer:oCanvas:oFont:lBold := .T.
> nLines++
> nLin := 43 + nLines * 4
> PrinterDrawText( TransForm( nTotalBaseImp, "@EZ 999,999,999.99" ),
> { 101, nLin, 119, nLin +10 }, TA_RIGHT )
> PrinterDrawText( TransForm( nTotalIVA, "@EZ 999,999,999.99" ), { 141,
> nLin, 160, nLin +10 }, TA_RIGHT )
> PrinterDrawText( TransForm( nTotalRE, "@EZ 999,999,999.99" ), { 161,
> nLin, 180, nLin +10 }, TA_RIGHT )
> PrinterDrawText( TransForm( nTotal, "@EZ 999,999,999.99" ), { 181,
> nLin, 198, nLin +10 }, TA_RIGHT )
> EndIf
>
> Printer:EndPage()
> Printer:EndDoc()
> Application:lBusy := .F.
> ::Hide()
> Printer:lPreviewModal := .F.
> Printer:Preview()
> Printer:lPreviewModal := lPreviewModal
>
>
> Un Saludo,
> Xevi.
>
>
> "Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
> news:[email=4643cf94@ozsrv2.ozlan.local...]4643cf94@ozsrv2.ozlan.local...[/email]
>> Alguna mano amiga?
>>
>> Gracias de antemano
>> --
>> Ramón Zea
>> 01.993.194.14.27
>> http://www.paginasprodigy.com/zeasoftware/
>> zeasoftware@prodigy.net.mx
>> zeasoftware@hotmail.com
>> ramonzea@yahoo.com
>> zeasoft.movil@hotmail.com
>> visita mi "venta de garage"
>> "Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
>> news:463d8ecf$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>> Alguien ha hecho impresion de tickets usando la clase TReport?
>>>
>>> o Podrian darme alguna sugerencia?
>>>
>>> Gracias.
>>>
>>> --
>>> Ramón Zea
>>> 01.993.194.14.27
>>> http://www.paginasprodigy.com/zeasoftware/
>>> zeasoftware@prodigy.net.mx
>>> zeasoftware@hotmail.com
>>> ramonzea@yahoo.com
>>> zeasoft.movil@hotmail.com
>>> visita mi "venta de garage"
>>>
>>
>>
>
>
Avatar de Usuario
jasm
Mensajes: 447
Registrado: Mar Jul 08, 2008 8:12 pm

TReport+Ticket

Mensaje por jasm »

METHOD ImprTicket( oSender, nTicket ) CLASS TForm15
LOCAL cI
LOCAL nI
LOCAL cLinea
LOCAL nTotal := 0
LOCAL cQuery
LOCAL nLin := 0
LOCAL nPaso
LOCAL oFont
LOCAL nIzq
LOCAL oDet := TQuery():New()
LOCAL oCab := TQuery():New()
LOCAL oCli := TQuery():New()
cQuery := "SELECT cabtick.*, fpago.nombre, concat( cliente.nombre, ' ', cliente.apellidos ) FROM cabtick " + ;
"LEFT JOIN fpago ON fpago.id = cabtick.fpago " + ;
"LEFT JOIN cliente ON cliente.id = cabtick.id_vend " + ;
"WHERE id_factura = " + Str( nTicket )
oCab:Query( cQuery )
IF oCab:lError
MsgInfo( oCab:cError )
END IF
cQuery := "SELECT dettick.cantidad, dettick.precio, dettick.cantidad*dettick.precio, articulo.descrip " + ;
"FROM dettick " + ;
"INNER JOIN articulo ON articulo.codigo = dettick.cod_art " + ;
"INNER JOIN cabtick ON cabtick.numero = dettick.numero " + ;
"WHERE cabtick.id_factura = " + Str( nTicket ) + " " + ;
"ORDER BY dettick.linea"
oDet:Query( cQuery )
IF oDet:lError
MsgInfo( oDet:cError )
END IF
IF AppData:lDatosCliente
oCli:Query( "SELECT * FROM cliente WHERE id = " + Str( oCab:aRes[ 1, 11 ] ) )
END IF
IF !Empty( AppData:cPrnName )
IF oDet:nFilas > 0
oFont := TFont():New()
WITH OBJECT oFont
:cName := AppData:cFontTicketName
:nSize := AppData:nFontTicketSize
:lBold := .F.
END WITH
Printer:nPrinterIndex := Ascan( Printer:aPrinterNames, Appdata:cPrnName )
Printer:lPreview := AppData:lPrev
Printer:cJobTitle := "Ticket de caja"
Printer:StartDoc()
Printer:oCanvas:nMapMode := mmHIMETRICS //Selecciono medidas en sistema metrico.
//Las unidades son milímetros * 10
Printer:StartPage()
nLin := Printer:PhysicalOffset()[2]
nIzq := Printer:PhysicalOffset()[1]
WITH OBJECT Printer:oCanvas
:oFont := oFont
nPaso := ( :TextHeight( "." ) / Printer:Resolution()[2] * 254 )
cLinea := PadC( Alltrim( AppData:cNombre ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := PadC( Alltrim( AppData:cDomic ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := PadC( Alltrim( AppData:cLocal ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := PadC( Alltrim( AppData:cProvin ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := PadC( "Telefono: " + Alltrim( AppData:cTelef ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := PadC( "CIF: " + Alltrim( AppData:cCIF ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += ( nPaso * 2 )
FOR nI := 1 TO 6
cI := Alltrim( Str( nI ) )
IF !Empty( AppData:cCab&cI )
:nTextAlignment := taLEFT
:TextOut( nIzq, nLin, PadC( AppData:cCab&cI, 40 ) )
nLin += nPaso
END IF
NEXT
nLin += ( nPaso * 2 )
IF AppData:lDatosCliente .AND. oCli:nFilas > 0
cLinea := "---------- Datos del cliente -----------"
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := Left( oCli:aRes[ 1, 2 ], 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := Left( oCli:aRes[ 1, 3 ], 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := Left( oCli:aRes[ 1, 4 ], 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := Left( StrZero( oCli:aRes[ 1, 5 ], 5 ) + " - " + oCli:aRes[ 1, 6 ], 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := Left( oCli:aRes[ 1, 7 ], 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := Left( "CIF/NIF: " + oCli:aRes[ 1, 8 ], 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := "----------------------------------------"
:TextOut( nIzq, nLin, cLinea )
nLin += ( nPaso * 2 )
END IF
cLinea := DiaSemana( oCab:aRes[ 1, 2 ] ) + ", " + D2L( oCab:aRes[ 1, 2 ] )
cLinea += " (" + Left( oCab:aRes[ 1, 10 ], 5 ) + ")"
cLinea := PadC( cLinea, 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += ( nPaso * 2 )
IF oCab:aRes[ 1, 3 ] != 0 .AND. AppData:cTituloBotonMesas == "&Mesa"
cLinea := PadL( "Mesa N. ..: " + Str( oCab:aRes[ 1, 3 ], 10 ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
END IF
cLinea := PadL( "Factura N.: " + Alltrim( Str( nTicket ) ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += ( nPaso * 3 )
cLinea := "Articulo" + Space( AppData:nLonArticulo - 8 ) + " "
cLinea += "Can" + Space( AppData:nLonCantidad - 3 ) + " "
cLinea += "Pre" + Space( AppData:nLonPrecio - 3 ) + " "
cLinea += "Importe" + Space( AppData:nLonImporte - 7 )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := Replicate( "-", AppData:nLonArticulo ) + " "
cLinea += Replicate( "-", AppData:nLonCantidad ) + " "
cLinea += Replicate( "-", AppData:nLonPrecio ) + " "
cLinea += Replicate( "-", AppData:nLonImporte )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
FOR nI := 1 TO oDet:nFilas
cLinea := Left( oDet:aRes[ nI, 4 ], AppData:nLonArticulo ) + " " + ;
Transform( oDet:aRes[ nI, 1 ], DimePic( AppData:nLonCantidad, AppData:nDecCantidad ) ) + " " + ;
Transform( oDet:aRes[ nI, 2 ], DimePic( AppData:nLonPrecio, AppData:nDecPrecio ) ) + " " + ;
Transform( oDet:aRes[ nI, 3 ], DimePic( AppData:nLonImporte, AppData:nDecImporte ) )
nTotal += oDet:aRes[ nI, 3 ]
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
NEXT
cLinea := " ---------"
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := " Total ..... " + Transform( nTotal, "@ZE 99,999.99" )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
IF ::oMaskEdit3:Value != 0
cLinea := " Entregado . " + Transform( ::oMaskEdit3:Value, "@ZE 99,999.99" )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := " ---------"
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
cLinea := " Cambio .... " + Transform( ::oMaskEdit3:Value - nTotal, "@ZE 99,999.99" )
:TextOut( nIzq, nLin, cLinea )
nLin += nPaso
END IF
cLinea := " ====================="
:TextOut( nIzq, nLin, cLinea )
nLin += ( nPaso * 2 )
cLinea := PadC( "Forma de pago: " + Alltrim( oCab:aRes[ 1, 13 ] ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += ( nPaso * 2 )
cLinea := PadC( "Le atendio: " + Alltrim( oCab:aRes[ 1, 14 ] ), 40 )
:TextOut( nIzq, nLin, cLinea )
nLin += ( nPaso * 2 )
FOR nI := 1 TO 6
cI := Alltrim( Str( nI ) )
IF !Empty( AppData:cPie&cI )
:TextOut( nIzq, nLin, PadC( AppData:cPie&cI, 40 ) )
nLin += nPaso
END IF
NEXT
FOR nI := 1 TO AppData:nLineas
cI := Alltrim( Str( nI ) )
:TextOut( nIzq, nLin, Space( 40 ) )
nLin += nPaso
NEXT
END WITH
Printer:EndPage()
Printer:EndDoc()
Printer:Preview( smMAXIMIZE, AppData:lPrev, Self )
oFont:Destroy()
END IF
END IF
CortarTicket()
RETURN Nil
--
zeasoftware
Mensajes: 1831
Registrado: Mar Oct 11, 2005 9:53 am

TReport+Ticket

Mensaje por zeasoftware »

No es necesario especificar el ancho de la hoja? esto es lo que me estaba
volviendo loco,
Si ese ticket lo veo en un preview, sale en hoja LETTER.
Gracias.
--
Ramón Zea
01.993.194.14.27
http://www.paginasprodigy.com/zeasoftware/
zeasoftware@prodigy.net.mx
zeasoftware@hotmail.com
ramonzea@yahoo.com
zeasoft.movil@hotmail.com
visita mi "venta de garage"
"Xevi" <xevicomas@gmail.com> escribió en el mensaje
news:[email=4644267a@ozsrv2.ozlan.local...]4644267a@ozsrv2.ozlan.local...[/email]
> Ramón,
>
> Como bien dice Jose Alfonso, utiliza la clase TCanvas, unida a TPrinter y
> verás que funciona de maravilla.
> Léete la documentación de estas dos clases,... yo te dejo un trozo de como
> lo utilizo, por ej. en un listado...
>
> ...
> Printer:nOrientation := DMORIENT_PORTRAIT
> Printer:StartDoc()
> Printer:oCanvas:nMapMode := mmHIMETRICS
>
> nLines := 56
>
> For n := 1 to Len( aItems )
>
> If nLines > 55
> xCap( ::oEditTitol:cText, AppData:nIdioma, AppData:cNomEmpresa )
>
> Printer:oCanvas:oFont:nSize := 8
> Printer:oCanvas:oFont:lBold := .T.
> PrinterDrawText( aIdioma[2,AppData:nIdioma], { 15, 40, 25, 44 },
> TA_LEFT )
> PrinterDrawText( aIdioma[3,AppData:nIdioma], { 25, 40, 40, 44 },
> TA_LEFT )
> PrinterDrawText( aIdioma[4,AppData:nIdioma], { 41, 40, 99, 44 },
> TA_LEFT )
> PrinterDrawText( aIdioma[5,AppData:nIdioma], { 100, 40, 119, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[6,AppData:nIdioma], { 120, 40, 130, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[8,AppData:nIdioma], { 131, 40, 140, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[7,AppData:nIdioma], { 141, 40, 160, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[9,AppData:nIdioma], { 161, 40, 180, 44 },
> TA_RIGHT )
> PrinterDrawText( aIdioma[10,AppData:nIdioma], { 181, 40, 198,
> 44 }, TA_RIGHT )
> PrinterDrawLine( { 15, 43.6, 198, 43.6 }, 2 )
> PrinterDrawLine( { 15, 44.2, 198, 44.2 }, 2 )
> Printer:oCanvas:oFont:lBold := .F.
> nLines := 1
> EndIf
>
> nLin := 43 + nLines * 4
> Printer:oCanvas:oFont:lBold := .F.
> PrinterDrawText( AllTrim( aItems[n,1] ), { nCol := 15, nLin,
> nCol+=10, nLin +10 }, TA_LEFT )
> PrinterDrawText( aItems[n,2], { nCol, nLin, nCol+=15, nLin +10 },
> TA_LEFT )
> PrinterDrawText( aItems[n,3], { nCol+1, nLin, nCol+=59, nLin +10 },
> TA_LEFT )
> PrinterDrawText( Transform( aItems[n,8], "@EZ 99,999,999.99" ), {
> nCol+1, nLin, nCol+=20, nLin +10 }, TA_RIGHT )
> PrinterDrawText( aItems[n,9], { nCol+1, nLin, nCol+=11, nLin +10 },
> TA_RIGHT )
> PrinterDrawText( Transform( aItems[n,11], "@EZ 9.99%" ), { nCol+1,
> nLin, nCol+=10, nLin +10 }, TA_RIGHT )
> PrinterDrawText( Transform( aItems[n,10], "@EZ 99,999,999.99" ), {
> nCol+1, nLin, nCol+=20, nLin +10 }, TA_RIGHT )
> PrinterDrawText( Transform( aItems[n,12], "@EZ 99,999,999.99" ), {
> nCol+1, nLin, nCol+=20, nLin +10 }, TA_RIGHT )
> PrinterDrawText( Transform( aItems[n,7], "@EZ 99,999,999.99" ), {
> nCol+1, nLin, 198, nLin +10 }, TA_RIGHT )
>
> nTotalBaseImp += aItems[n,8]
> nTotalIva += aItems[n,10]
> nTotalRE += aItems[n,12]
> nTotal += aItems[n,7]
> nLines++
> Next
>
> If Len( aItems ) > 0
> PrinterDrawLine( { 15, nLin+5.5, 198, nLin+5.5 }, 2 )
> PrinterDrawLine( { 15, nLin+6.1, 198, nLin+6.1 }, 2 )
> Printer:oCanvas:oFont := TFont():Create( "Arial", 9, 0, 800 )
> Printer:oCanvas:oFont:nSize := 9
> Printer:oCanvas:oFont:lBold := .T.
> nLines++
> nLin := 43 + nLines * 4
> PrinterDrawText( TransForm( nTotalBaseImp, "@EZ 999,999,999.99" ),
> { 101, nLin, 119, nLin +10 }, TA_RIGHT )
> PrinterDrawText( TransForm( nTotalIVA, "@EZ 999,999,999.99" ), { 141,
> nLin, 160, nLin +10 }, TA_RIGHT )
> PrinterDrawText( TransForm( nTotalRE, "@EZ 999,999,999.99" ), { 161,
> nLin, 180, nLin +10 }, TA_RIGHT )
> PrinterDrawText( TransForm( nTotal, "@EZ 999,999,999.99" ), { 181,
> nLin, 198, nLin +10 }, TA_RIGHT )
> EndIf
>
> Printer:EndPage()
> Printer:EndDoc()
> Application:lBusy := .F.
> ::Hide()
> Printer:lPreviewModal := .F.
> Printer:Preview()
> Printer:lPreviewModal := lPreviewModal
>
>
> Un Saludo,
> Xevi.
>
>
> "Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
> news:[email=4643cf94@ozsrv2.ozlan.local...]4643cf94@ozsrv2.ozlan.local...[/email]
>> Alguna mano amiga?
>>
>> Gracias de antemano
>> --
>> Ramón Zea
>> 01.993.194.14.27
>> http://www.paginasprodigy.com/zeasoftware/
>> zeasoftware@prodigy.net.mx
>> zeasoftware@hotmail.com
>> ramonzea@yahoo.com
>> zeasoft.movil@hotmail.com
>> visita mi "venta de garage"
>> "Ramón Zea" <zeasoftware@hotmail.com> escribió en el mensaje
>> news:463d8ecf$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>> Alguien ha hecho impresion de tickets usando la clase TReport?
>>>
>>> o Podrian darme alguna sugerencia?
>>>
>>> Gracias.
>>>
>>> --
>>> Ramón Zea
>>> 01.993.194.14.27
>>> http://www.paginasprodigy.com/zeasoftware/
>>> zeasoftware@prodigy.net.mx
>>> zeasoftware@hotmail.com
>>> ramonzea@yahoo.com
>>> zeasoft.movil@hotmail.com
>>> visita mi "venta de garage"
>>>
>>
>>
>
>
zeasoftware
Mensajes: 1831
Registrado: Mar Oct 11, 2005 9:53 am

TReport+Ticket

Mensaje por zeasoftware »

lo reviso.
Mil gracias.
--
Ramón Zea
01.993.194.14.27
http://www.paginasprodigy.com/zeasoftware/
zeasoftware@prodigy.net.mx
zeasoftware@hotmail.com
ramonzea@yahoo.com
zeasoft.movil@hotmail.com
visita mi "venta de garage"
"José Alfonso Suárez Moreno" <jasm@tpvsoft.com> escribió en el mensaje
news:[email=4644e324@ozsrv2.ozlan.local...]4644e324@ozsrv2.ozlan.local...[/email]
> Ramon,
>
> Adjunto lo que uso yo para imprimir tickets con TCanvas.
>
> En APPDATA llevo estos valores:
>
> cPrnName ---> Nombre de la impresora en Windows
>
> cFontTicketName ---> Nombre del tipo de letra a usar (para las termicas)
> nFontTicketSize ---> Tamaño del tipo de letra a usar (para las termicas)
>
> lPrev ---> Si quiero previsualizar
>
>
> El resto de cosas que tengo en APPDATA son datos a imprimir.
>
> Saludos
>
> Jose A. Suarez
>
------------------------------------------------------------ --------------------
> METHOD ImprTicket( oSender, nTicket ) CLASS TForm15
>
> LOCAL cI
> LOCAL nI
> LOCAL cLinea
> LOCAL nTotal := 0
> LOCAL cQuery
> LOCAL nLin := 0
> LOCAL nPaso
> LOCAL oFont
> LOCAL nIzq
> LOCAL oDet := TQuery():New()
> LOCAL oCab := TQuery():New()
> LOCAL oCli := TQuery():New()
>
> cQuery := "SELECT cabtick.*, fpago.nombre, concat( cliente.nombre, ' ',
> cliente.apellidos ) FROM cabtick " + ;
> "LEFT JOIN fpago ON fpago.id = cabtick.fpago " + ;
> "LEFT JOIN cliente ON cliente.id = cabtick.id_vend " + ;
> "WHERE id_factura = " + Str( nTicket )
> oCab:Query( cQuery )
>
> IF oCab:lError
> MsgInfo( oCab:cError )
> END IF
>
> cQuery := "SELECT dettick.cantidad, dettick.precio,
> dettick.cantidad*dettick.precio, articulo.descrip " + ;
> "FROM dettick " + ;
> "INNER JOIN articulo ON articulo.codigo = dettick.cod_art " +
> ;
> "INNER JOIN cabtick ON cabtick.numero = dettick.numero " + ;
> "WHERE cabtick.id_factura = " + Str( nTicket ) + " " + ;
> "ORDER BY dettick.linea"
>
> oDet:Query( cQuery )
> IF oDet:lError
> MsgInfo( oDet:cError )
> END IF
>
> IF AppData:lDatosCliente
> oCli:Query( "SELECT * FROM cliente WHERE id = " + Str( oCab:aRes[ 1,
> 11 ] ) )
> END IF
>
> IF !Empty( AppData:cPrnName )
>
> IF oDet:nFilas > 0
> oFont := TFont():New()
>
> WITH OBJECT oFont
> :cName := AppData:cFontTicketName
> :nSize := AppData:nFontTicketSize
> :lBold := .F.
> END WITH
>
> Printer:nPrinterIndex := Ascan( Printer:aPrinterNames,
> Appdata:cPrnName )
>
> Printer:lPreview := AppData:lPrev
> Printer:cJobTitle := "Ticket de caja"
> Printer:StartDoc()
> Printer:oCanvas:nMapMode := mmHIMETRICS //Selecciono medidas
> en sistema metrico.
> //Las unidades son
> milímetros * 10
>
> Printer:StartPage()
>
> nLin := Printer:PhysicalOffset()[2]
> nIzq := Printer:PhysicalOffset()[1]
>
> WITH OBJECT Printer:oCanvas
>
> :oFont := oFont
>
> nPaso := ( :TextHeight( "." ) / Printer:Resolution()[2] * 254 )
>
> cLinea := PadC( Alltrim( AppData:cNombre ), 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
>
> cLinea := PadC( Alltrim( AppData:cDomic ), 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
>
> cLinea := PadC( Alltrim( AppData:cLocal ), 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
>
> cLinea := PadC( Alltrim( AppData:cProvin ), 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
>
> cLinea := PadC( "Telefono: " + Alltrim( AppData:cTelef ), 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
>
> cLinea := PadC( "CIF: " + Alltrim( AppData:cCIF ), 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += ( nPaso * 2 )
>
> FOR nI := 1 TO 6
> cI := Alltrim( Str( nI ) )
> IF !Empty( AppData:cCab&cI )
> :nTextAlignment := taLEFT
> :TextOut( nIzq, nLin, PadC( AppData:cCab&cI, 40 ) )
> nLin += nPaso
> END IF
> NEXT
>
> nLin += ( nPaso * 2 )
>
>
> IF AppData:lDatosCliente .AND. oCli:nFilas > 0
> cLinea := "---------- Datos del cliente -----------"
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := Left( oCli:aRes[ 1, 2 ], 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := Left( oCli:aRes[ 1, 3 ], 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := Left( oCli:aRes[ 1, 4 ], 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := Left( StrZero( oCli:aRes[ 1, 5 ], 5 ) + " - " +
> oCli:aRes[ 1, 6 ], 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := Left( oCli:aRes[ 1, 7 ], 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := Left( "CIF/NIF: " + oCli:aRes[ 1, 8 ], 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := "----------------------------------------"
> :TextOut( nIzq, nLin, cLinea )
> nLin += ( nPaso * 2 )
> END IF
>
> cLinea := DiaSemana( oCab:aRes[ 1, 2 ] ) + ", " + D2L(
> oCab:aRes[ 1, 2 ] )
> cLinea += " (" + Left( oCab:aRes[ 1, 10 ], 5 ) + ")"
> cLinea := PadC( cLinea, 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += ( nPaso * 2 )
>
> IF oCab:aRes[ 1, 3 ] != 0 .AND. AppData:cTituloBotonMesas ==
> "&Mesa"
> cLinea := PadL( "Mesa N. ..: " + Str( oCab:aRes[ 1, 3 ],
> 10 ), 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> END IF
> cLinea := PadL( "Factura N.: " + Alltrim( Str( nTicket ) ),
> 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += ( nPaso * 3 )
>
> cLinea := "Articulo" + Space( AppData:nLonArticulo - 8 ) + " "
> cLinea += "Can" + Space( AppData:nLonCantidad - 3 ) + " "
> cLinea += "Pre" + Space( AppData:nLonPrecio - 3 ) + " "
> cLinea += "Importe" + Space( AppData:nLonImporte - 7 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
>
> cLinea := Replicate( "-", AppData:nLonArticulo ) + " "
> cLinea += Replicate( "-", AppData:nLonCantidad ) + " "
> cLinea += Replicate( "-", AppData:nLonPrecio ) + " "
> cLinea += Replicate( "-", AppData:nLonImporte )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
>
> FOR nI := 1 TO oDet:nFilas
>
> cLinea := Left( oDet:aRes[ nI, 4 ], AppData:nLonArticulo ) +
> " " + ;
> Transform( oDet:aRes[ nI, 1 ], DimePic(
> AppData:nLonCantidad, AppData:nDecCantidad ) ) + " " + ;
> Transform( oDet:aRes[ nI, 2 ], DimePic(
> AppData:nLonPrecio, AppData:nDecPrecio ) ) + " " + ;
> Transform( oDet:aRes[ nI, 3 ], DimePic(
> AppData:nLonImporte, AppData:nDecImporte ) )
>
> nTotal += oDet:aRes[ nI, 3 ]
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> NEXT
>
> cLinea := " ---------"
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := " Total ..... " + Transform(
> nTotal, "@ZE 99,999.99" )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> IF ::oMaskEdit3:Value != 0
> cLinea := " Entregado . " + Transform(
> ::oMaskEdit3:Value, "@ZE 99,999.99" )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := " ---------"
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> cLinea := " Cambio .... " + Transform(
> ::oMaskEdit3:Value - nTotal, "@ZE 99,999.99" )
> :TextOut( nIzq, nLin, cLinea )
> nLin += nPaso
> END IF
> cLinea := " ====================="
> :TextOut( nIzq, nLin, cLinea )
> nLin += ( nPaso * 2 )
> cLinea := PadC( "Forma de pago: " + Alltrim( oCab:aRes[ 1,
> 13 ] ), 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += ( nPaso * 2 )
> cLinea := PadC( "Le atendio: " + Alltrim( oCab:aRes[ 1, 14 ] ),
> 40 )
> :TextOut( nIzq, nLin, cLinea )
> nLin += ( nPaso * 2 )
>
> FOR nI := 1 TO 6
> cI := Alltrim( Str( nI ) )
> IF !Empty( AppData:cPie&cI )
> :TextOut( nIzq, nLin, PadC( AppData:cPie&cI, 40 ) )
> nLin += nPaso
> END IF
> NEXT
>
> FOR nI := 1 TO AppData:nLineas
> cI := Alltrim( Str( nI ) )
> :TextOut( nIzq, nLin, Space( 40 ) )
> nLin += nPaso
> NEXT
> END WITH
>
> Printer:EndPage()
> Printer:EndDoc()
> Printer:Preview( smMAXIMIZE, AppData:lPrev, Self )
> oFont:Destroy()
>
> END IF
>
> END IF
>
> CortarTicket()
>
> RETURN Nil
>
PILO
Mensajes: 583
Registrado: Vie Jul 06, 2007 5:18 pm

TReport+Ticket

Mensaje por PILO »

Lo que hago es para LPT
Responder