segunda-feira, 1 de julho de 1996

Clipper - 1995-1998 KB - Store data from real solutions in Siemens Network.

http://www.sonicgalaxy.net/img/sprites/gen/sonic/sonic.gif











*
* Programa NOTA.PRG
* Imprime o cupom Fiscal
*******************************************************************

My first was Basic, after that, Pascal, and finally Clipper.
Yes, Clipper. I did a lot of program include the snippet of code bellow.

Clients: Siemens - KB for Support Area - 1997
         Comercial System for Eletronict Store
          

Answer = space(128)

Answer = EnviaCom(chr(27)+".17123.456.789/02}") // ABRIR CUPOM FISCAL
? "Abrir Cupom:"+Answer


Answer = EnviaCom(chr(27)+".0178965432109870001000000000100000000000100AGUA                    T01}") // LANCAR ITEM DE VENDA
? "Lancar Item:"+Answer

Answer = EnviaCom(chr(27)+".022000000000000020}") // DESCONTO NO ITEM
? "Desconto no item:"+Answer


Answer = EnviaCom(chr(27)+".0178965432101230001000000000100000000000100LEITE ESPECIAL          I  }") // LANCAR ITEM DE VENDA
? "Lancar Item:"+Answer


Answer = EnviaCom(chr(27)+".04}") // CANCELAMENTO DE ITEM
? "Cancelamento de item:"+Answer

Answer = EnviaCom(chr(27)+".1001000000000500}") // // TOTALIZAR CUPOM FISCAL
? "Totalizar Cupom:"+Answer

Answer = EnviaCom(chr(27)+".09|0|05 001|01 005}") // // LANCAR INDICADORES
? "Indicadores:"+Answer

Answer = EnviaCom(chr(27)+".12N0     GRATOS PELA PREFERENCIA ! }") // FECHAR CUPOM
? "Fechar Cupom:"+Answer


************************************************************************
FUNCTION EnviaCom(Comando)

* Funcao responsavel pelo envio do comando ao ECF e captura da resposta,
* utilizando o driver SERSWEDA.SYS
************************************************************************

set device to printer
set printer to ifsweda
@ prow(),pcol() say Comando
set printer to
set device to screen

arq = fopen("ifsweda.prn")
status = freadstr(arq,128)
fclose(arq)

return(status)


////////////////
set device to printer
set printer to ifsweda
@ prow(),pcol() say chr(27)+".13N}"
set printer to
set device to screen

arq = fopen("ifsweda.prn")
status = freadstr(arq,128)
fclose(arq)
? "Status = "+status
Postar um comentário