;** Ed_0126 ********************************************************************
;*  Emissao de Duplicatas                                     Unibras      *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 27/07/1998 por Anivel Augusto Rodrigues
;Alterado em     : 12/07/2005 por Humberto F. Santos
;Motivo Alteracao: Ajustes no ARQIMP

;*******************************************************************************
;* Rotina de Impressao de Duplicatas                                           *
;*******************************************************************************

Print File ARQIMP CI_10CPP
Print File ARQIMP CI_6LPP

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

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

If [Codigo da Empresa]<>"0003"
   Then Print File ARQIMP "  Empresa: "+[Codigo da Empresa] + "\n\n"
   Else Print File ARQIMP "\n"
EndIf

Print File ARQIMP "\n\n"

Print File ARQIMP Spaces(14)
Print File ARQIMP Format("W11,AC",NoNota[1])
Print File ARQIMP Format("W13.2,EIC,AR",[Valor Duplicata])
Print File ARQIMP Spaces(3)+Format("W6,AC",[Answer->Numero do Documento])
If [Ordem do Documento]<>""
   Then Print File ARQIMP "/"+[Ordem do Documento]
   Else Print File ARQIMP "  "
EndIf

If [NotaC->Descricao CondPagto]="CONTRA APRESENTACAO"
   Then Print File ARQIMP Spaces(4)+"C.APRESENT \n\n\n\n"
   Else Print File ARQIMP Spaces(4)+AlinhM(LTrim(StrVal(Format("D13",[Data Vencimento]))),10)+"\n\n\n\n\n"
EndIf



Print File ARQIMP Spaces(22) + Format("W22,AL",[Answer->Condicoes Especiais])+Spaces(8)+Format("W29.2,EIC,AL",[Valor do Desconto])
;VALOR_JUROS=([Valor Duplicata]*([Taxa de Juros]/[NDias Taxa de Juros]))/100
;Print File ARQIMP "Juros: "+LTrim(Format("W7.2,EIC",VALOR_JUROS))+" ao Dia"
Print File ARQIMP "\n"

Print File ARQIMP Spaces(22) + Format("W30,AL",[Answer->Razao Social Fatura])+Spaces(12)+[Answer->Codigo]+"\n"
Print File ARQIMP Spaces(22) + Format("W31,AL",[Answer->Endereco Fatura]) + Spaces(5)+Format("W20,AL",[Answer->Bairro Fatura])+ "\n"
Print File ARQIMP Spaces(22) + Format("W31,AL",[Answer->CEP Fatura])+Spaces(5)+ FONE +"\n"
Print File ARQIMP Spaces(22) + Format("W31,AL",[Answer->Cidade Fatura])+ Spaces(05)+[Answer->UF Fatura]+ "\n"

Print File ARQIMP Spaces(22) + " " + "\n" ;pca pagto
Print File ARQIMP Spaces(22) + Format("W25,AL",[Answer->CGC Fatura])+Spaces(10)+[Answer->IE Fatura]+"\n\n"
                                                                                                         
Print File ARQIMP Spaces(20) + [Answer->Endereco de Cobranca] + "\n"

If Not IsBlank([Answer->Cidade de Cobranca])
   Then Print File ARQIMP Spaces(20) + [Answer->Cidade de Cobranca] + "/" + [Answer->UF de Cobranca]
        Print File ARQIMP " - " + [Answer->Cep de Cobranca] + "\n\n"
   Else Print File ARQIMP "\n\n"
EndIf


ESCEXT([Valor Duplicata])

Print File ARQIMP Spaces(20) + SubStr(EXTENSO,001,51) + "\n"
Print File ARQIMP Spaces(20) + SubStr(EXTENSO,052,51) + "\n"
Print File ARQIMP Spaces(20) + SubStr(EXTENSO,103,51) + "\n"

Print File ARQIMP "\n\n\n"

Print File ARQIMP Spaces(05)+SubStr(MSGDUP,001,75)+"\n"
Print File ARQIMP Spaces(05)+SubStr(MSGDUP,076,150)+"\n"

Print File ARQIMP  Chr(27)+Chr(69)

Print File ARQIMP "\n"
Print File ARQIMP  Chr(27)+Chr(70)

If [Codigo da Empresa]<>"0003"
   Then Print File ARQIMP "\n"
Endif

