Hola,
por lo que e leido en el foro, parace que no se puede imprimir asi como en FWH.
si tengo un impresor toshiba tec, por bluetooh ya tengo el driver instalado, puedo hacer un report, igual como en fwh o no?
saludos,
Mauricio
#define GENERIC_READ 0x80000000
#define GENERIC_WRITE 0x40000000
#define OPEN_EXISTING 3
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#define FILE_FLAG_OVERLAPPED 0x40000000
#define NEW_LINE chr(10)+chr(13)
/// otro codigo ....
static function ImprimeCorte(nContado, nCredito, nAbonos)
local nRen := 3, cCliente
local nImporte := 0
local nUnidades := 0, nTotal := 0
local hFile := fCreate(curdir() + '\corte.txt')
// datos del ticket
fwrite(hFile, ticket->Empresa + NEW_LINE)
fwrite(hFile, ticket->Direccion + NEW_LINE)
fwrite(hFile, ticket->Rfc + NEW_LINE)
fwrite(hFile, ticket->Tel + NEW_LINE)
fwrite(hFile, ticket->Vendedor + NEW_LINE)
fwrite(hFile, dtoc( date()) + space(5) + time() + NEW_LINE)
fwrite(hFile, replicate('-',32) + NEW_LINE)
fwrite(hFile,NEW_LINE)
fwrite(hFile, "CORTE DE VENTAS" + NEW_LINE)
fwrite(hFile, replicate('-',32) + NEW_LINE)
fwrite(hFile, 'Contado .. $ ' + transform(nContado,'99,999,999.99') + NEW_LINE)
fwrite(hFile, 'Credito .. $ ' + transform(nCredito,'99,999,999.99') + NEW_LINE)
fwrite(hFile, replicate('-',32) + NEW_LINE)
fwrite(hFile, 'Ventas.... $ ' + transform(nCredito+nContado,'99,999,999.99') + NEW_LINE)
fwrite(hFile, replicate('-',32) + NEW_LINE)
fwrite(hFile, 'Abonos..,. $ ' + transform(nAbonos,'99,999,999.99') + NEW_LINE)
fwrite(hFile, replicate('-',32) + NEW_LINE)
fwrite(hFile, replicate('_',32) + NEW_LINE)
fwrite(hFile, 'Total...... $ ' + transform(nCredito+nContado+nAbonos,'99,999,999.99') + NEW_LINE)
fwrite(hFile, replicate('-',32) + NEW_LINE)
fwrite(hFile,NEW_LINE)
fwrite(hFile,NEW_LINE)
fwrite(hFile,NEW_LINE)
fclose(hFile)
SendText( MemoRead( curdir()+ '\corte.txt')) //Envio al puerto serie
return nil
static FUNCTION SendText( cText )
//---------------------------------
LOCAL i, hOut := CreateFile( "COM7:",GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL )
IF hOut==-1
MsgStop('No se pudo abrir el puerto de impresora')
ELSE
FOR i = 1 TO Len( cText )
WriteByte( hOut, Asc( SubStr( cText, i, 1 ) ) )
NEXT
CloseHandle( hOut )
ENDIF
RETURN NIL
Return to FiveWin para Pocket PC
Users browsing this forum: No registered users and 38 guests