![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#4
|
|||
|
|||
|
Impresion con puerto LPT1
Usa el procedimiento siguiente:
procedure TFpto_pollo.imprime_fac(stdoc, stipo:shortstring;sndoc:integer); Var MyPrinter: TextFile; xcan, xdes, xval, xtot, xpag, xcam:shortstring; xsum:real; consulta:string; begin AssignFILE(MyPrinter,'USB'); ReWrite(MyPrinter); Write(MyPrinter, CHR(27) + CHR(64)); // Inicializar Impresora //Write(MyPrinter, CHR(27)+CHR(67)+CHR(44)); // Fijar Tamaño en Lineas Write(MyPrinter,CHR(27)+ CHR(103)); // Tipo de Letra Chicas //Write(MyPrinter,CHR(27)+CHR(197)); // Negrita //Write(MyPrinter,CHR(27)+CHR(179)+CHR(28)); // Espacio entre Lines if stipo='FAC' then Writeln(MyPrinter,'MICROMARKET VIA RAPIDA') else Writeln(MyPrinter,'POLLOS ROSS'); if stipo='FAC' then Writeln(MyPrinter,'AV.ROQUE AGUILERA ESQ.RADIAL CASTILLA') else Writeln(MyPrinter,'AV.SANTOS DUMONT CASI 4TO ANILLO'); if stipo='FAC' then Writeln(MyPrinter,'NIT 2642735017 TELF.3513621') else Writeln(MyPrinter,'NO ES FACTURA TELF.3533417'); if stipo='FAC' then Writeln(MyPrinter,'FACTURA : '+wnrofac.text+' ALFAB.'+walfab.text); if stipo='FAC' then Writeln(MyPrinter,'NR.ORDEN:'+wnorden.text+' FECHA:'+datetostr(now)); if wnomfac.Text<>'' then Writeln(MyPrinter,'Senores : '+wnomfac.text) else Writeln(MyPrinter,'Senores : Clientes Varios'); //---------------------------- consulta:='select * from lgloprod where tdoc='+car+stdoc+car+' and ndoc='+inttostr(sndoc); DModulo.QConsulta.Close; DModulo.QConsulta.sql.Clear; DModulo.QConsulta.sql.add(consulta); DModulo.QConsulta.Open; if wnit.Text<>'' then Writeln(MyPrinter,'NIT : '+wnit.text) else Writeln(MyPrinter,'PARA SERVIRSE EN :'+DModulo.QConsulta.fieldbyname('refer').asstring); //------------------------------ Writeln(MyPrinter,'-------------------------------------'); Writeln(MyPrinter,' Cant. Producto Valor '); Writeln(MyPrinter,'-------------------------------------'); xsum:=0; consulta:='select * from lmovpro where tdoc='+car+stdoc+car+' and ndoc='+inttostr(sndoc); DModulo.QConsulta.Close; DModulo.QConsulta.sql.Clear; DModulo.QConsulta.sql.add(consulta); DModulo.QConsulta.Open; DModulo.QConsulta.First; while not DModulo.QConsulta.Eof do begin xcan:=format('%6.2f',[DModulo.QConsulta.fieldbyname('cant').asfloat]); xdes:=copy(DModulo.QConsulta.fieldbyname('descri').AsString,1,20); xval:=format('%8.2f',[DModulo.QConsulta.fieldbyname('valor_bs').asfloat]); xsum:=xsum+DModulo.QConsulta.fieldbyname('valor_bs').asfloat; Writeln(MyPrinter,xcan+' '+xdes+' '+xval); DModulo.QConsulta.Next; end; Writeln(MyPrinter,'-------------------------------------'); xtot:=format('%8.2f',[xsum]); xpag:=format('%8.2f',[strtofloat(wpagbs.text)]); xcam:=format('%8.2f',[strtofloat(wcamb.text)]); Writeln(MyPrinter,' Total Facturado : '+xtot); Writeln(MyPrinter,' Total Pagado : '+xpag); Writeln(MyPrinter,' Cambio : '+xcam); Writeln(MyPrinter,'-------------------------------------'); if stipo='FAC' then Writeln(MyPrinter,'MICROMARKET VIA RAPIDA LE AGRADECE') else Writeln(MyPrinter,'POLLOS ROSS LE AGRADECE'); Writeln(MyPrinter,'POR SU PREFERENCIA '+stdoc+'-'+inttostr(sndoc)); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); //Write(MyPrinter,#12); // Expulsar la Hoja System.CloseFile(MyPrinter); end; Me funciona de pelicula y es super sencillo y no te complicas como con las otras soluciones que te plantean |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| QuickReport y Ticket | escullar | Impresión | 2 | 20-06-2008 00:53:18 |
| impresion ticket en XP | rebollo75 | Impresión | 2 | 04-11-2004 13:19:37 |
| Impresion de logotipo ticket | luiguiray | Impresión | 2 | 25-08-2004 00:44:54 |
| Impresiòn de un ticket | trex2000 | Impresión | 4 | 06-08-2004 17:05:45 |
| Imprimir en ticket? | pgraciap | Impresión | 1 | 08-11-2003 01:12:17 |
|