;** Ed_0296 ********************************************************************
;*  Emissao de Duplicatas                                   D'Almeida   ********
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido  em: 09/08/2016 por Bruno Carvalho
;Alterado      em: 09/08/2016 por 
;Motivo Alteracao:

;*******************************************************************************
;* Rotina de Impressao de Duplicatas                                           *
;*******************************************************************************
Print File ARQIMP CI_15CPP
Print File ARQIMP CI_8LPP

Print File ARQIMP "\n\n\n\n\n\n\n"

Print File ARQIMP Spaces(118) + AlinhM(LTrim(StrVal(Format("D13",[Answer->Data de Emissao]))),10)

Print File ARQIMP "\n\n\n\n\n"

Print File ARQIMP Spaces(15)+Format("W07,AR",NoNota[1])+Spaces(10)+Format("W15.2,EIC",VrNota[1])
Print File ARQIMP Spaces(11)+Format("W6,AC",[Answer->Numero do Documento])
If [Ordem do Documento]<>""
   Then Print File ARQIMP "/"+[Ordem do Documento]
   Else Print File ARQIMP "  "
EndIf
Print File ARQIMP Spaces(02)+Format("W16.2,EIC,AR",[Valor Duplicata])
If [NotaC->Descricao CondPagto]="CONTRA APRESENTACAO"
   Then Print File ARQIMP Spaces(05)+"C.APRESENT \n"
   Else Print File ARQIMP Spaces(05)+Format("D13",[Data Vencimento])+"\n"
EndIf

Print File ARQIMP "\n\n\n\n\n\n\n"

Print File ARQIMP Spaces(05)+Format("W07,AR",NoNota[6])+Format("W15.2,EIC",VrNota[6])     
Print File ARQIMP Spaces(15) + [Answer->Razao Social Fatura]+" - "+[Answer->Codigo]+"\n"

Print File ARQIMP Spaces(05)+Format("W07,AR",NoNota[7])+Format("W15.2,EIC",VrNota[7])     
Print File ARQIMP Spaces(15) + [Answer->Endereco Fatura]+" - "+[Answer->Bairro Fatura]+"\n"

Print File ARQIMP Spaces(05)+Format("W07,AR",NoNota[8])+Format("W15.2,EIC",VrNota[8])     
Print File ARQIMP Spaces(15)+RTrim(Format("W27,AL",[Answer->Cidade Fatura]))+" - "+RTrim([Answer->UF Fatura])+Spaces(05)+
                  [Answer->CEP Fatura]+"\n"

Print File ARQIMP Spaces(42) +RTrim(Format("W27,AL",[Answer->Cidade de Cobranca]))+" - "+RTrim([Answer->UF de Cobranca])+Spaces(05)+
                  [Answer->CEP de Cobranca]+"\n"
Print File ARQIMP Spaces(42) +[Answer->Endereco de Cobranca]+" - "+[Answer->Bairro de Cobranca]+"\n\n"
                  
Print File ARQIMP Spaces(05)+Format("W07,AR",NoNota[9])+Format("W15.2,EIC",VrNota[9])     
Print File ARQIMP Spaces(15)+[Answer->CGC Fatura]+Spaces(32)+Format("W22,AL",[Answer->IE Fatura])+"\n\n"

ESCEXT([Valor Duplicata])

Print File ARQIMP Format("W07,AR",NoNota[12])+Format("W10.2,EIC",VrNota[12])
Print File ARQIMP Spaces(24) + SubStr(EXTENSO,001,68) + "\n"
Print File ARQIMP Format("W07,AR",NoNota[13])+Format("W10.2,EIC",VrNota[13])
Print File ARQIMP Spaces(24) + SubStr(EXTENSO,069,68) + "\n"
Print File ARQIMP Format("W07,AR",NoNota[14])+Format("W10.2,EIC",VrNota[14])
Print File ARQIMP Spaces(24) + SubStr(EXTENSO,137,68) + "\n\n"
GetRecord "\\Sistemas\\Cadastro\\Destinat" [Answer->Codigo da Empresa] To RAZ_SOC
If RetVal
   Then RAZ_SOC = RAZ_SOC["Razao Social"]
   Else RAZ_SOC = ""
EndIf
Print File ARQIMP Spaces(22)+"Reconhe‡o(emos) a exatidÆo desta duplicata de VENDA MERCANTIL, na importƒncia acima que pagarei(emos) …"+"\n"  
Print File ARQIMP Spaces(22)+RTrim(Format("W40,AL",RAZ_SOC))+" ou … sua ordem, na pra‡a e vencimento indicados."

If Num_Copia=1
   Then Print File ARQIMP "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 
   Else Print File ARQIMP "\f"    
        Num_Copia=0 
EndIf
