Problemas con impresoras fiscales

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
jreduojeda
Posts: 45
Joined: Thu Feb 19, 2009 12:41 am
DBs Used: DBF, MySql
Location: Buenos Aires - Argentina
Contact:

Problemas con impresoras fiscales

Post by jreduojeda »

Hola a todos...
Tengo una aplicación de gestión que facturaba por comprobante pre-impreso...
Ahora magicamente me piden que imprima por Impresora Fiscal "Hasas 320F", bueno... comencé bajando la Winfis32.dll de la página de http://www.hasar.com y arranqué a jugar con esto.
El tema es que medio como se me está complicando más de la cuenta...

Code: Select all

Function Prueba()
Local cBuffer:=SPACE(500)
local k         // Número de COM a utilizar
local nHandler  // Manejador del puerto serie
local nCod      // Valor de retorno de funciones de winfis32.dll

k:=1

nHandler:=OpenComFiscal( k , 0 )

MsgInfo(STR(nHandler))

if nHandler < 0
   MsgInfo("Error")
ELSE
   MsgInfo("Conectado")
endif

nCod := InitFiscal( nHandler )

...
...
...
Me estoy comunicando con la Winfis32.dll de la siguiente manera.

Code: Select all

DECLARE DLL_TYPE_INT  OpenComFiscal( DLL_TYPE_INT nCom, DLL_TYPE_INT nMode) IN winfis32.DLL
DECLARE DLL_TYPE_INT  ReOpenComFiscal( DLL_TYPe_INT nHand ) IN winfis32.dll
DECLARE DLL_TYPE_VOID CloseComFiscal( DLL_TYPE_INT nHand ) IN winfis32.DLL
DECLARE DLL_TYPE_INT  MandaPaqueteFiscal( DLL_TYPE_INT nHand, DLL_TYPE_LPSTR cString ) IN winfis32.dll
DECLARE DLL_TYPE_INT  UltimaRespuesta( DLL_TYPE_INT nHand, DLL_TYPE_LPSTR cString) IN winfis32.dll
DECLARE DLL_TYPE_INT  InitFiscal( DLL_TYPE_INT nHand ) IN winFis32.dll
DECLARE DLL_TYPE_INT  VersionDLLFiscal() IN winFis32.dll
No se porque motivo siempre me da error.
Si alquien me da una mano estaré muy agradecido.
Saludos, Esteban.
Ojeda, Esteban Eduardo.
ooHg - Minigui - QAC
FiveWin - PellesC - Clipper
ADS Server - MySql - DBF/CDX
FastReport
ClaudioGalera
Posts: 47
Joined: Tue Jul 14, 2009 1:14 pm
Location: Mar del Plata, Argentina

Re: Problemas con impresoras fiscales

Post by ClaudioGalera »

jreduojeda wrote:Hola a todos...
Tengo una aplicación de gestión que facturaba por comprobante pre-impreso...
Ahora magicamente me piden que imprima por Impresora Fiscal "Hasas 320F", bueno... comencé bajando la Winfis32.dll de la página de http://www.hasar.com y arranqué a jugar con esto.
El tema es que medio como se me está complicando más de la cuenta...

Code: Select all

Function Prueba()
Local cBuffer:=SPACE(500)
local k         // Número de COM a utilizar
local nHandler  // Manejador del puerto serie
local nCod      // Valor de retorno de funciones de winfis32.dll

k:=1

nHandler:=OpenComFiscal( k , 0 )

MsgInfo(STR(nHandler))

if nHandler < 0
   MsgInfo("Error")
ELSE
   MsgInfo("Conectado")
endif

nCod := InitFiscal( nHandler )

...
...
...
Me estoy comunicando con la Winfis32.dll de la siguiente manera.

Code: Select all

DECLARE DLL_TYPE_INT  OpenComFiscal( DLL_TYPE_INT nCom, DLL_TYPE_INT nMode) IN winfis32.DLL
DECLARE DLL_TYPE_INT  ReOpenComFiscal( DLL_TYPe_INT nHand ) IN winfis32.dll
DECLARE DLL_TYPE_VOID CloseComFiscal( DLL_TYPE_INT nHand ) IN winfis32.DLL
DECLARE DLL_TYPE_INT  MandaPaqueteFiscal( DLL_TYPE_INT nHand, DLL_TYPE_LPSTR cString ) IN winfis32.dll
DECLARE DLL_TYPE_INT  UltimaRespuesta( DLL_TYPE_INT nHand, DLL_TYPE_LPSTR cString) IN winfis32.dll
DECLARE DLL_TYPE_INT  InitFiscal( DLL_TYPE_INT nHand ) IN winFis32.dll
DECLARE DLL_TYPE_INT  VersionDLLFiscal() IN winFis32.dll
No se porque motivo siempre me da error.
Si alquien me da una mano estaré muy agradecido.
Saludos, Esteban.
Hola Esteban
Te recomiendo que uses el ocx que esta en el zip que bajaste de hasar. Tenes dentro ejemplos en vbasic que sirven para saber cuales son las rutinas del ocx que llaman. Trabaja 100 % sin problemas. Si es la primera vez que vas a trabajar con una impresora fiscal, te recomiendo que te leas los manuales, donde te va a aclarar aspectos a tener en cuenta. En esta direccion hay un emulador fiscal http://www.impresoras-fiscales.com.ar que te va a servir para ver que comando estas enviando y comparar con los que envia los ejemplos.
Saludos
Claudio
User avatar
jreduojeda
Posts: 45
Joined: Thu Feb 19, 2009 12:41 am
DBs Used: DBF, MySql
Location: Buenos Aires - Argentina
Contact:

Re: Problemas con impresoras fiscales

Post by jreduojeda »

Hola Claudio...
Muchas gracias por la respuesta.
Es raro que no funcione esto que estoy haciendo, ya que tengo lo mismo en FiveWin y funciona perfecto.
De todas formas intentaré hacerlo como me dices con el ocx.
Cualquier duda consulto nuevamente.
Nuevamente muchas gracias.
Saludos, Esteban.
Ojeda, Esteban Eduardo.
ooHg - Minigui - QAC
FiveWin - PellesC - Clipper
ADS Server - MySql - DBF/CDX
FastReport
Post Reply