;** Et_0268 ********************************************************************
;* Monta Etiqueta Impressora Termica - Zebra -                                **
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 19/06/2015 por Bruno Carvalho
;Ultima Alteracao: 17/04/2017 por Bruno Carvalho
;Motivo Alteracao: Novos Ajustes                      
;Ultima Alteracao: 27/09/2016 por Anivel Augusto Rodrigues
;Motivo Alteracao: Ajustes inversÆo na impressÆo         
                                                             
;*******************************************************************************
Proc Monta_Etiqueta()
Moveto "Answer"

Print File Arquivo "O\n"
Print File Arquivo "N\n"
Print File Arquivo "q600\n"
Print File Arquivo "Q240\n"
Print File Arquivo "S2\n"
Print File Arquivo "D8\n"
Print File Arquivo "ZT\n"
;Print File Arquivo "ZB\n"
 
;Etiqueta com a logo do lado ao contr rio do atual que foi confeccionada a partir desta atualiza‡Æo de 17/04/2017                                      
;If Not IsBlank(CDBAR[1])
;   Then Print File Arquivo "A200,10,0,2,1,2,N,\""+DITEA[1]+"\"\n"
;        Print File Arquivo "B270,60,0,E30,2,4,80,B,\""+CDBAR[1]+"\"\n"
;        Print File Arquivo "A220,165,0,2,1,1,N,\""+DITEC[1]+"\"\n"
;        Print File Arquivo "A220,185,0,2,1,1,N,\""+DITED[1]+"\"\n"
;        Print File Arquivo "A220,205,0,2,1,1,N,\""+DITEE[1]+"\"\n"
;EndIf

;If Not IsBlank(CDBAR[1])
;   Then Print File Arquivo "A050,05,0,2,1,2,N,\""+DITEA[1]+"\"\n"
;        Print File Arquivo "B120,55,0,E30,2,4,80,B,\""+CDBAR[1]+"\"\n"
;        Print File Arquivo "A070,160,0,2,1,1,N,\""+DITEC[1]+"\"\n"
;        Print File Arquivo "A070,180,0,2,1,1,N,\""+DITED[1]+"\"\n"
;        Print File Arquivo "A070,200,0,2,1,1,N,\""+DITEE[1]+"\"\n"
;EndIf

If Not IsBlank(CDBAR[1])
   Then Print File Arquivo "A210,05,0,2,1,2,N,\""+DITEA[1]+"\"\n"
        Print File Arquivo "B280,55,0,E30,2,4,80,B,\""+CDBAR[1]+"\"\n"
        Print File Arquivo "A230,160,0,2,1,1,N,\""+DITEC[1]+"\"\n"
        Print File Arquivo "A230,180,0,2,1,1,N,\""+DITED[1]+"\"\n"
        Print File Arquivo "A230,200,0,2,1,1,N,\""+DITEE[1]+"\"\n"
EndIf

Print File Arquivo "P1\n"

EndProc ;Monta_Etiqueta()

;*******************************************************************************
;* Monta Comandos p/ Impressora Termica                                        *
;*******************************************************************************
Proc Monta_Comandos()
If IsAssigned(DITEA) 
   Then Release Vars CDBAR,DITEA,DITEB,DITEC,DITED,DITEE
EndIf

Array DITEA[1]
Array DITEB[1]
Array DITEC[1]
Array DITED[1]
Array DITEE[1]
Array CDBAR[1]

Arquivo="CR.ejf"
Deleta_Arquivo(Arquivo)

DITEC[1] = "   CNPJ 10.275.904-0001-83  "
DITED[1] = "   www.rigfundidos.com.br   " 
DITEE[1] = "(37) 3381-1172 - CLAUDIO/ MG"

Coedit "Answer"
Scan
  te=[Quantidade]
  DITEA[1] = Ltrim([Descricao do Item])
  CDBAR[1] = [Codigo de Barras]
  While True    
    Monta_Etiqueta()
    te = te - 1
    If te <=0 Then  QuitLoop EndIf
  EndWhile
EndScan               
Do_It!
ClearAll

ImpriArq(Arquivo)

Sleep 700
Deleta_Arquivo(Arquivo)
ClearAll
EndProc

Monta_Comandos()
Release Procs Monta_Etiqueta,Monta_Comandos
