ERASE c:\ticket.txt SET CONSOLE off SET DEVICE TO FILE c:\ticket.txt &&PRINTER SELECT factura **rr** 07-08-2008 SCAN *setea la ticketera *SET PRINTER TO c:\ticket.txt *SET PRINTER TO LPT1 *SET PRINTER FONT "Arial Narrow",11 *SET PRINTER FONT "FontB11",8 *** Imprime la cabecera del ticket *??? "0123456789012345678901234567890123456789" @1,0 say alltrim(ologixuser.user_cia_descripcion) @2,0 say alltrim(ologixUser.user_oficina_dir) @3,0 say "RUC: " +alltrim(ologixUser.ruc_cia) @4,0 say 'TK ' + iif(empty(cruc_cliente),'BOLETA','FACTURA') + ; ' Nro.: ' +rtrim(cserie_documento)+'-'+ ; rtrim(cnumero_documento)+" "+DTOC(factura.dfecha_documento) @5,0 say 'S/N : ' +PADC(rtrim(lcnro_serial),20) + " " + TIME() @6,0 say 'CORRE: ' + rtrim(cnumero_documento)+' CAJA : ' +padl(lcnro_caja,3,'0') @7,0 say 'AUT. SUNAT: ' + alltrim(lcnro_autorizacion) @8,0 say 'CLIENTE: '+ rtrim(cid_clie) @9,0 say rtrim(cnombre_cliente) x=9 IF !EMPTY(alltrim(factura.cruc_cliente)) x=x+1 @x,0 say 'RUC : ' +alltrim(factura.cruc_cliente) ELSE IF !EMPTY(alltrim(factura.cdni)) x=x+1 @x,0 say 'DNI : ' +alltrim(factura.cdni) endif ENDIF @x+1,0 say 'DIR : ' +alltrim(factura.cdireccion)+' '+rtrim(factura.cdescripcion_ubigeo) @x+2,0 say 'DIR ENVIO: ' +alltrim(factura.cdireccion_entrega) @x+3,0 say rtrim(factura.cdescripcion_ubigeo_entrega) @x+4,0 say '========================================' @x+5,0 say 'F.P.: ' + alltrim(factura.cdescripcion_forma_pago) + ' VCTO: '+ DTOC(factura.dfecha_vencimiento) *** Imprime el detalle del Ticket oldnum=cnumero_documento x=x+5+2 llgratuito = .f. DO WHILE oldnum=cnumero_documento and !EOF() @x,0 say LEFT(alltrim(factura.carticulos_nombre),40) + ' - ' + Alltrim(factura.carticulos_id) x=x+1 @x,0 say STR(factura.ncantidad_pedido,10,2)+" "+; PADR(ALLTRIM(factura.cunidad_de_venta),3," ") @x,15 say "("+Alltrim(Str(Int(factura.ncantidad_pedido/factura.nfactor_conversion),3))+' - '+Alltrim(Str(Mod(factura.ncantidad_pedido,factura.nfactor_conversion),3))+")"+ " " + iif(factura.lgratuito,'(*)','') @x,22+6+2 say STR(factura.nimporte_total_d ,10,2) if factura.lgratuito llgratuito = .t. endif if !Empty(ALLTRIM(mobservacion)) x=x+1 iF LEN(ALLTRIM(mobservacion))<= 245 &&40 @x,0 say alltrim(mobservacion) else FOR I =1 TO INT(LEN(ALLTRIM(mobservacion))/ 245) + 1 && 40)+1 @x,0 say SUBSTR(alltrim(mobservacion),(i-1)*245+1,245) &&*40+1,40) x=x+1 ENDFOR endif endif SKIP x=x+1 ENDDO SKIP -1 *** Imprime el resumen del ticket IF llgratuito @x,0 say '(*)PROMOC.MERCAD.VALORIZ.CUMPLIM.ART.6-RS067/93 EF-SUNAT' ENDIF IF !Empty(factura.cruc_cliente) x=x+1 @x,0 say 'IGV : ' @x,10 say iif(cid_moneda='N',' S/. ',' $ ') @x,22+6 say factura.nimporte_igv ENDIF x=x+1 @x,0 say 'TOTAL : ' @x,10 say iif(cid_moneda='N',' S/. ',' $ ') @x,22+6 say factura.nimporte_neto x=x+1 @x,22-6+4 say '====================' @x+1,0 say 'T.Cambio : ' @x+1,22+6 say factura.nmonto_tipo_cambio @x+2,0 say "V: "+ alltrim(factura.cnomb_vend) IF factura.ctipo_referencia = 'RE' @x+3,0 say 'R.Caja: '+ alltrim(factura.cserie_referencia)+IIF(EMPTY(factura.cserie_referencia),'','-')+Allt(factura.cdcto_referencia) endif IF factura.ctipo_referencia = 'PE' @x+3,0 say 'Pedido: '+ alltrim(factura.cserie_referencia)+IIF(EMPTY(factura.cserie_referencia),'','-')+Allt(factura.cdcto_referencia) endif @x+4,0 say 'T: '+Allt(cproveedor_nombre) @x+5,0 say " " @x+6,0 say " " @x+7,0 say " " @x+8,0 say " " @x+9,0 say " " @x+10,0 say " " @x+11,0 say " " @x+12,0 say CHR(27)+CHR(109) * Cuts the Paper ***ENDSCAN SET DEVICE TO SCREEN SET CONSOLE on SET PRINTER OFF SET PRINTER TO COPY file c:\ticket.txt to lpt1: