;** RM_0380G *******************************************************************
;** Imprime a Digitacao do Pedido/Grade                                        *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido  em: 13/03/2019 por Anivel Augusto Rodrigues
;Ultima Altera‡Æo: 23/09/2019 por Bruno Carvalho 
;Motivo Alteracao: Ajustes p/ ser impresso [Nome Fantasia EmitDest] -> RM_0380G_Cabecalho_Ped() 
;Ultima Alteracao: 22/09/2020 por Anivel Augusto Rodrigues 
;Motivo Alteracao: InclusÆo modelo 05C e filtro data fatura

;*******************************************************************************
;* Checa linha na area de impressao dos itens                                  *
;*******************************************************************************
Proc RM_0380G_Checa_Linha(nl,tp)
Private nl,tp,ntab

ntab=table()

If (nlin+nl) >= 64              
   Then 
        Print File ARQIMP "\n"
        Print File ARQIMP Format("W131,AC","*** Continua proxima pagina ==> ")    

        Print File ARQIMP CI_10CPP
        Print File ARQIMP "\f"

        RM_0380G_Cabecalho_Tit()

        If tp="Item"
           Then RM_0380G_Cabecalho_Item()
        EndIf
EndIf

nlin=nlin+nl
moveto ntab

EndProc ;Checa_Linha()

;*******************************************************************************
;* Verifica as Grades no Pedido                                                *
;*******************************************************************************
Proc RM_0380G_Verifica_Grades()
Private i

SEQ  = 0

Release vars Array_Grade, array_tittm, array_tqtd

DynArray Array_Grade[]
   Array array_tittm[12]
   Array array_tqtd[14]                             

For i From 1 to 12
  array_tittm[i]=""
EndFor

For i From 1 to 14
  array_tqtd[i]=0
EndFor

Moveto "\\Sistemas\\Estoque\\TpGrade"
Moveto [Codigo da Grade]
Locate Grad
If RetVal
   Then array_tittm[1] =[Titulo Grade1 ]
        array_tittm[2] =[Titulo Grade2 ]
        array_tittm[3] =[Titulo Grade3 ]
        array_tittm[4] =[Titulo Grade4 ]
        array_tittm[5] =[Titulo Grade5 ]
        array_tittm[6] =[Titulo Grade6 ]
        array_tittm[7] =[Titulo Grade7 ]
        array_tittm[8] =[Titulo Grade8 ]
        array_tittm[9] =[Titulo Grade9 ]
        array_tittm[10]=[Titulo Grade10]
        array_tittm[11]=[Titulo Grade11]
        array_tittm[12]=[Titulo Grade12]
EndIf

Grade=Grad+ESPACO+
      Format("W4,AR",array_tittm[01])+ESPACO+
      Format("W4,AR",array_tittm[02])+ESPACO+
      Format("W4,AR",array_tittm[03])+ESPACO+
      Format("W4,AR",array_tittm[04])+ESPACO+
      Format("W4,AR",array_tittm[05])+ESPACO+
      Format("W4,AR",array_tittm[06])+ESPACO+
      Format("W4,AR",array_tittm[07])+ESPACO+
      Format("W4,AR",array_tittm[08])+ESPACO+
      Format("W4,AR",array_tittm[09])+ESPACO+
      Format("W4,AR",array_tittm[10])+ESPACO+
      Format("W4,AR",array_tittm[11])+ESPACO+
      Format("W4,AR",array_tittm[12])+ESPACO


EndProc

;*******************************************************************************
;* Rotina para Impressao do Cabecalho titulo                                   *
;*******************************************************************************
Proc RM_0380G_Cabecalho_Tit()
NPAG = NPAG + 1

If Not IsAssigned(NOMEMPRESA)
   Then NOMEMPRESA=""
EndIf

Moveto "Answer"
Print File ARQIMP CI_6LPP+CI_15CPP+"\n"
Print File ARQIMP Fill("-",133)+"\n"
Print File ARQIMP  Completa(NOMEMPRESA,55," ")+"Pedido de Venda"+Spaces(24)+"Emissao: "+Format("D13",Today())+"-"+Time()+
                        "   Pag: "+Format("W3,EIC",npag)+"\n"
Print File ARQIMP Fill("-",133)+"\n"

Print File ARQIMP Spaces(99)+"N§ do Pedido : "+CI_INEG+CI_IEXP+Format("W06.3,AL",[Numero do Pedido])+CI_FNEG+CI_FEXP+"\n\n"

NLIN = 6

EndProc ;Cabecalho_Tit()

;*******************************************************************************
;* Rotina para Impressao do Cabecalho do Pedido                                *
;*******************************************************************************
Proc RM_0380G_Cabecalho_Ped()
private FRETECONTA

RM_0380G_Cabecalho_Tit()

Moveto "Answer"
Print File ARQIMP "Cliente: "
Print File ARQIMP Format("W05,AL",[Codigo])
Print File ARQIMP Format("W39,AL",[Razao Social])+Spaces(1)
Print File ARQIMP Format("W25,AL",[Nome Fantasia EmitDest])
Print File ARQIMP "Contato: "+Format("W14,AL",CONTATO)
Print File ARQIMP "Ped.Origem: "+[Numero Pedido Origem]+"\n"

Print File ARQIMP Spaces(14)+Format("W40,AL",[Endereco])
Print File ARQIMP Format("W18,AL",[CGC])+Spaces(07)+"Emissao: "
Print File ARQIMP Format("D13",[Data de Emissao])+"\n"

Print File ARQIMP Spaces(14)+Format("W20,AL",[Bairro])
Print File ARQIMP Format("W20,AL",[CEP])
Print File ARQIMP Format("W25,AL",[IE])
Print File ARQIMP "Entrega: "+Format("D13",[Data de Entrega])+"\n"

Print File ARQIMP Spaces(14)+Format("W40,AL",[Cidade]+"/"+[UF])
Print File ARQIMP Format("W25,AL",[Telefone])
Print File ARQIMP "Empresa: "+Format("W05,AL",[Codigo da Empresa])+Format("W20,AL",[Nome Fantasia Empresa])+"\n\n"

Print File ARQIMP "Representante: "+Format("W05,AL",[Codigo do Representante])
Print File ARQIMP Format("W25,AL",[Nome Fantasia Represent])
Print File ARQIMP "Destinacao: "+Format("W04,AL",[Codigo da Destinacao])
Print File ARQIMP Format("W25,AL",[Descricao da Destinacao])
Print File ARQIMP "CFO: "+Format("W09,AL",[CFO])+"      Tabela: "+[Codigo da Tabela]+"\n"

FRETECONTA=""
Switch
  Case [Frete por Conta]="0" : FRETECONTA="SEM FRETE"
  Case [Frete por Conta]="1" : FRETECONTA="EMITENTE"
  Case [Frete por Conta]="2" : FRETECONTA="DESTINATARIO"
  Case [Frete por Conta]="3" : FRETECONTA="TERCEIROS"
EndSwitch

Print File ARQIMP "Transportador: "+Format("W05,AL",[Codigo da Transportadora])
Print File ARQIMP Format("W28,AL",[Nome Fantasia Transport])
Print File ARQIMP "Veiculo: "+Format("W08,AL",[Placa do Veiculo])+"-"+Format("W08,AL",[UF Veiculo])
Print File ARQIMP "Frete por Conta: "+[Frete por Conta]+" "+FRETECONTA+"\n\n"

NLIN = NLIN + 8

RM_0380G_Cabecalho_Item()

EndProc ;Cabecalho_Ped()

;*******************************************************************************
;* Rotina para Impressao do Cabecalho do Item                                  *
;*******************************************************************************
Proc RM_0380G_Cabecalho_Item()
Private wc

RM_0380G_Checa_Linha(3,"")

Print File ARQIMP Spaces(1)+Fill("-",133)+"\n"
Print File ARQIMP Spaces(1)+"Seq"+ESPACO+"Ref   "+ESPACO+"Descricao                  "+ESPACO+"S"+ESPACO+" "+
                             Grade+" Total"+ESPACO+"UN"+ESPACO+"  PrUnit"+ESPACO+"   PrTotal"+"\n"
Print File ARQIMP Spaces(1)+"---+------+---------------------------+-+--+----+----+----+----+----+----+----+----+----+----+----+----+------+--+--------+----------"+"\n"

EndProc ;Cabecalho_Item()

;*******************************************************************************
;* Imprime Totalizador                                                         *
;*******************************************************************************
Proc RM_0380G_Totalizador()


For wi From 1 to 12
  If array_tqtd[wi]=0 then array_tqtd[wi]=BlankNum() EndIf
  array_tqtd[13]=array_tqtd[13]+array_tqtd[wi]
EndFor
 
RM_0380G_Checa_Linha(4,"")
Print File ARQIMP Spaces(1)+"-------------------------------------------+----+----+----+----+----+----+----+----+----+----+----+----+------+----------------------"+"\n"

Print File ARQIMP Spaces(44)+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[01])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[02])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[03])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[04])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[05])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[06])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[07])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[08])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[09])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[10])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[11])+ESPACO
Print File ARQIMP Format("W04,EIC",array_tqtd[12])+ESPACO
Print File ARQIMP Format("W06,EIC",array_tqtd[13])+ESPACO
Print File ARQIMP Spaces(11)+ESPACO
Print File ARQIMP Format("W10.2,EIC",array_tqtd[14])+"\n"

Print File ARQIMP Spaces(1)+Fill("-",133)+"\n\n"

EndProc ;Totalizador()

;*******************************************************************************
;* Rotina para Impressao do Relatorio                                          *
;*******************************************************************************
Proc RM_0380G_ImpPed()
Private SEQ

ESPACO= "|"

SEQ  = 0
NPAG = 0
NLIN = 0

TOTQ = 0
TOTP = 0

MUDOU_GRADE = False

Moveto TabelaG
Moveto [Numero do Pedido]
Locate [Answer->Numero do Pedido]
if retval 
   then CONTATO = ""
        GetRecord "\\Sistemas\\Cadastro\\Destinat" [Answer->Codigo] To REG_CONTATO
        If RetVal
           Then CONTATO=REG_CONTATO["Contato"]
        EndIf
    
        Grad=[Codigo da Grade]
        RM_0380G_Verifica_Grades()
        RM_0380G_Cabecalho_Ped()
        
        Moveto TabelaG
        while [Numero do Pedido]=[Answer->Numero do Pedido]

          If Grad<>[Codigo da Grade]
            Then 
                 MUDOU_GRADE = True
                 Grad=[Codigo da Grade]
          
                 RM_0380G_Totalizador()
          
                 Moveto TabelaG
                 RM_0380G_Verifica_Grades()
                 RM_0380G_Cabecalho_Item()

                 Moveto TabelaG
          EndIf
          
          SEQ  = SEQ + 1

          RM_0380G_Checa_Linha(1,"Item")
          
          Print File ARQIMP Format("W04,AR",AlinhM(StrVal(SEQ),3))+ESPACO
          Print File ARQIMP Format("W06,AL",[Referencia])+ESPACO
          Print File ARQIMP Format("W27,AL",[Descricao do Item])+ESPACO
          Print File ARQIMP Format("W1,AL",[ItemSortido])+ESPACO+" "
          Print File ARQIMP Format("W01,AL",[Codigo da Grade])+ESPACO 
          Print File ARQIMP Format("W04,EIC",[Qtd1])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd2])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd3])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd4])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd5])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd6])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd7])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd8])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd9])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd10])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd11])+ESPACO
          Print File ARQIMP Format("W04,EIC",[Qtd12])+ESPACO
          Print File ARQIMP Format("W06,EIC",[Qtd1]+[Qtd2 ]+[Qtd3 ]+[Qtd4 ]+
                                            [Qtd5]+[Qtd6 ]+[Qtd7 ]+[Qtd8 ]+
                                            [Qtd9]+[Qtd10]+[Qtd11]+[Qtd12])+ESPACO
          Print File ARQIMP Format("W02,AL",[Unidade Fiscal])+ESPACO
          Print File ARQIMP Format("W08.2,EIC",[Preco Unitario])+ESPACO
          Print File ARQIMP Format("W10.2,EIC",[Preco Total])+"\n"
          
          TOTQ = TOTQ + ([Qtd1]+[Qtd2 ]+[Qtd3 ]+[Qtd4 ]+
                         [Qtd5]+[Qtd6 ]+[Qtd7 ]+[Qtd8 ]+
                         [Qtd9]+[Qtd10]+[Qtd11]+[Qtd12])  
          TOTP = TOTP + [Preco Total] 
          
          array_tqtd[01]=array_tqtd[01]+[Qtd1 ]
          array_tqtd[02]=array_tqtd[02]+[Qtd2 ]
          array_tqtd[03]=array_tqtd[03]+[Qtd3 ]
          array_tqtd[04]=array_tqtd[04]+[Qtd4 ]
          array_tqtd[05]=array_tqtd[05]+[Qtd5 ]
          array_tqtd[06]=array_tqtd[06]+[Qtd6 ]
          array_tqtd[07]=array_tqtd[07]+[Qtd7 ]
          array_tqtd[08]=array_tqtd[08]+[Qtd8 ]
          array_tqtd[09]=array_tqtd[09]+[Qtd9 ]
          array_tqtd[10]=array_tqtd[10]+[Qtd10]
          array_tqtd[11]=array_tqtd[11]+[Qtd11]
          array_tqtd[12]=array_tqtd[12]+[Qtd12]
          
          array_tqtd[14]=array_tqtd[14]+[Preco Total]
          
          Skip
          If EOT() Then QuitLoop EndIf
        EndWhile

        RM_0380G_Totalizador()  
        RM_0380G_Rodape(False)
endif
moveto "Answer"

EndProc ;ImpPed()

;*******************************************************************************
;* Rotina para Impressao do Rodape                                             *
;*******************************************************************************
Proc RM_0380G_Rodape(QUEBRAFORM)
Private QUEBRAFORM

Moveto "Answer"
Print File ARQIMP CI_6LPP+CI_15CPP

If MUDOU_GRADE
   Then 
        RM_0380G_Checa_Linha(4,"")
        Print File ARQIMP " -------------------------------------------------------------------------------------------------------------------------------------"+"\n"
        Print File ARQIMP Spaces(90)+"Total Geral   "+ESPACO
        Print File ARQIMP Format("W06,EIC",TOTQ)+ESPACO+Spaces(11)+ESPACO+Format("W10.2,EIC",TOTP)+"\n"
        Print File ARQIMP " -------------------------------------------------------------------------------------------------------------------------------------"+"\n\n"
EndIf

RM_0380G_Checa_Linha(3,"")
Print File ARQIMP "\n"+"  Mecadorias         Desconto     Liquido    Frete    Seguro   Desp.Aces         IPI       Total     BC.ICMS        ICMS"+"\n"

Print File ARQIMP Format("W12.2,EIC",[Valor Mercadoria])
Print File ARQIMP Format("W06.2,EIC",[Taxa de Desconto])+"%"
Print File ARQIMP Format("W10.2,EIC",[Valor do Desconto])
Print File ARQIMP Format("W12.2,EIC",[Valor Mercadoria Liquido])
Print File ARQIMP Format("W09.2,EIC",[Valor do Frete])
Print File ARQIMP Format("W10.2,EIC",[Valor do Seguro])
Print File ARQIMP Format("W012.2,EIC",[Valor Despesas Acessorias])
Print File ARQIMP Format("W012.2,EIC",[Valor IPI])
Print File ARQIMP Format("W012.2,EIC",[Valor Nota Fiscal])
Print File ARQIMP Format("W012.2,EIC",[Valor BCICMS])
Print File ARQIMP Format("W012.2,EIC",[Valor ICMS])+"\n\n"

RM_0380G_imprimeobs("Observacoes: "+Tira_QuebraLinha([Observacao do Pedido]))
RM_0380G_imprimeobs("             "+Tira_QuebraLinha([Observacao na Nota Fiscal]))

RM_0380G_Checa_Linha(1,"")
Print File ARQIMP "Cond. Pagamento.: "+[Descricao CondPagto]
Print File ARQIMP "   FP: "+[Forma de Pagamento]
Print File ARQIMP "   NP: "+StrVal([Numero de Parcelas])
Print File ARQIMP "   CD: "+[Composicao de Dias]+"\n"

RM_0380G_Imprime_Vencimentos("Imprimir")

RM_0380G_Checa_Linha(6,"")
Print File ARQIMP "\n"
Print File ARQIMP "Local p/ Entrega: "+Format("W20,AL",[Answer->Endereco de Entrega])+"\n"

Print File ARQIMP Spaces(18)+Format("W15,AL",[Answer->Bairro de Entrega])+Format("W11,AL",[Answer->CEP de Entrega])
Print File ARQIMP Spaces(40)+"______________________________________________"+"\n"

Print File ARQIMP Spaces(18)+Format("W15,AL",[Answer->Cidade de Entrega])+Format("W03,AL",[Answer->UF de Entrega])
Print File ARQIMP Spaces(58)+"Data/Assinatura Responsavel"+"\n\n"

Print File ARQIMP Fill("-",133)

Print File ARQIMP CI_10CPP
Print File ARQIMP "\f"

EndProc ;Rodape()

;*******************************************************************************
;* Imprime Vencimentos                                                         *
;*******************************************************************************
Proc RM_0380G_Imprime_Vencimentos(Param)
Private kv,s1,s2,s3, ntab

ntab=table()

s1="  Vencimentos: "
s2="               "
s3="               "

KV=0

Moveto "PedidoV"
moveto [Numero do Pedido]
locate [Answer->Numero do Pedido]
if retval
   then while [Numero do Pedido]=[Answer->Numero do Pedido]

          if isblank([Data])
            then quitloop
          endif    
          
          if kv=10
            then 
                 RM_0380G_Checa_Linha(3,"")
                 Print File ARQIMP s1+"\n"
                 Print File ARQIMP s2+"\n"
                 Print File ARQIMP s3+"\n"
          
                 kv=0
                 s1="               "
                 s2="               "
                 s3="               "
                 
          endif
          
          kv=kv+1
          s1=s1+spaces(08)+[Forma de Pagamento]+Spaces(02)
          s2=s2+Format("D13",[Data])           +Spaces(02)
          s3=s3+Format("W10.2,EIC",[Valor])    +Spaces(02)
          
          skip
          if eot() then quitloop endif
        endwhile

endif
if kv>0
  then 
       RM_0380G_Checa_Linha(3,"")
       Print File ARQIMP s1+"\n"
       Print File ARQIMP s2+"\n"
       Print File ARQIMP s3+"\n"
endif

moveto ntab

EndProc ;Imprime_Vencimentos()

;*******************************************************************************
;* Rotina de Impressao de Observa‡äes                                          *
;*******************************************************************************
proc RM_0380G_imprimeobs(s)
private TamObs, nlobs, posobs, i, s

TamObs=133

nlobs=Len(s)/tamobs
If nlobs-Int(nlobs)>0
   Then nlobs=Int(nlobs)+1
   Else nlobs=Int(nlobs)
EndIf

posobs=1
For i from 1 to nlobs

  RM_0380G_Checa_Linha(1,"")
  Print File ARQIMP CI_INEG+subStr(s,posobs,tamobs)+CI_FNEG+"\n"
  
  posobs=posobs+tamobs
EndFor

endproc

;*******************************************************************************
;* Rotina p/ Selecionar e Ordernar Registros                                   *
;*******************************************************************************
proc RM_0380G_Seleciona()
ClearAll

If VSDGOPDTPEEIRF="4" Or
   VSDGOPDTPEEIRF="5"
   then 
        {Ask} typeIn TabelaRPedidos Enter
        Moveto [Numero do Pedido        ] Example "Pedido"
        {Ask} TypeIn "\\Sistemas\\Vendas\\PedidoC" Enter 
        Moveto [Numero do Pedido        ] Example "Pedido" Check
   else
        {Ask} TypeIn "\\Sistemas\\Vendas\\PedidoC" Enter 
        Moveto [Numero do Pedido        ] Check

        if not isblank(VSDGPEDIDO)
           then 
                Moveto [Numero do Pedido] TypeIn "~VSDGPEDIDO.."
           else 
                Moveto [Numero do Pedido] TypeIn ">=~VSDGNPEDIDOI, <=~VSDGNPEDIDOF"
                Moveto [Codigo da Empresa       ] TypeIn "~VSDGEMPRESA.."
        
                if VSDGOPDTPEEIRF="1" Then Moveto [Data de Entrega ] TypeIn ">=~VSDGDTINI,<=~VSDGDTFIM" endif
                If VSDGOPDTPEEIRF="2" Then Moveto [Data de Emissao ] TypeIn ">=~VSDGDTINI,<=~VSDGDTFIM" endif
                if VSDGOPDTPEEIRF="3" Then Moveto [Data_Inclusao   ] TypeIn ">=~VSDGDTINI,<=~VSDGDTFIM" endif
        
                Moveto [Situacao do Pedido    ]
                switch
                  case VSDGSITUACAOPEDIDO="JUNTAR ABERTO+SUSPENSO"     : TypeIn "ABERTO or SUSPENSO"
                  case VSDGSITUACAOPEDIDO="IGNORAR CANCELADO+SUSPENSO" : TypeIn "not CANCELADO, not SUSPENSO"
                  case VSDGSITUACAOPEDIDO="IGNORAR CANCELADO"          : TypeIn "not CANCELADO"
                  case VSDGSITUACAOPEDIDO<>"TODAS"                     : TypeIn "~VSDGSITUACAOPEDIDO.."
                endswitch
                Moveto [Codigo                 ] TypeIn "~VSDGDESTINAT.."
                Moveto [Codigo do Representante] TypeIn "~VSDGREPRESEN.."
        endif   
endif   
Do_It!
ClearAll

TabelaC=Adiciona_Indice_Temp("Numero do Pedido")

{Ask} typeIn TabelaC Enter
Moveto [Numero do Pedido        ] Example "Pedido"
{Ask} TypeIn "\\Sistemas\\Vendas\\PedidoG" Enter Check
Moveto [Numero do Pedido        ] Example "Pedido"
Do_It!
ClearAll

TabelaG=Adiciona_Indice_Temp("Numero do Pedido,Codigo da Grade,Referencia,Codigo do Item,Item do Pedido")

{Ask} typeIn TabelaC Enter
Moveto [Numero do Pedido        ] Example "Pedido"
{Ask} TypeIn "\\Sistemas\\Vendas\\PedidoC" Enter Check
Moveto [Numero do Pedido        ] Example "Pedido"
Do_It!
ClearAll

Delete TabelaC
        
EndProc    ; (Seleciona)

;*******************************************************************************
;* Rotina Principal                                                            *
;*******************************************************************************
ArqImp=PrivDir()+"RM_0380G.Txt"
If IsFile(ARQIMP)
  Then ImpriArq(ARQIMP)
       Deleta_Arquivo(ARQIMP)
EndIf 

RM_0380G_Seleciona()
If IsEmpty(TabelaG)
   Then MENSAGEM("N„o existem registros a processar")
   else
        View "\\Sistemas\\Estoque\\TpGrade"
        View "PedidoV"
        View TabelaG
        View "Answer"
        scan
          AGUARDE("Imprimindo Pedido -> "+[Numero do Pedido])
        
          RM_0380G_ImpPed()
        
        endscan
        ClearAll
        
        LimpAguarde()
        ImpriArq(ARQIMP)
endif

Delete TabelaG

LimpAguarde()

Release Vars  NLIN,NPAG,
              Grade,Grad,MUDOU_GRADE,
              Array_Grade,array_tqtd,array_tittm,
              TOTQ,TOTP,
              ESPACO,ARQIMP

Release Procs RM_0380G_Checa_Linha, RM_0380G_Verifica_Grades, RM_0380G_Cabecalho_Tit, RM_0380G_Cabecalho_Ped, RM_0380G_Cabecalho_Item,
              RM_0380G_Rodape,      RM_0380G_Totalizador,     RM_0380G_ImpPed,        RM_0380G_imprimeobs,
              RM_0380G_Imprime_Vencimentos, RM_0380G_Seleciona
