;** Ed_0001   ******************************************************************
;*  Emissao de Duplicatas                                    Divilack          *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 12/11/1998 por Cl udio Ant“nio de Faria Santos
;Ultima Alteracao: 16/09/2003 por Anivel Augusto Rodrigues
;Motivo Alteracao: Ajustes

;*******************************************************************************
;* Rotina de Impressao de Duplicatas                                           *
;*******************************************************************************
Print File ARQIMP CI_10CPP
Print File ARQIMP CI_6LPP

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

Print File ARQIMP Spaces(52) + AlinhM(LTrim(StrVal(Format("D10",[Answer->Data de Emissao]))),8)+"\n"

Print File ARQIMP "\n\n\n"

Print File ARQIMP Spaces(20)
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(3)+"C.APRESENT \n"
   Else Print File ARQIMP Spaces(3)+AlinhM(LTrim(StrVal(Format("D10",[Data Vencimento]))),8)+"\n"
EndIf

Print File ARQIMP Format("W6,AR",NoNota[1])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[1]) + "\n"

Print File ARQIMP Format("W6,AR",NoNota[2])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[2])+ "\n"

Print File ARQIMP Format("W6,AR",NoNota[3])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[3])
Print File ARQIMP Spaces(09) + Format("W29.2,EIC,AL",[Valor do Desconto])
Print File ARQIMP Format("D10",[Data Limite Desconto])+ "\n"

Print File ARQIMP Format("W6,AR",NoNota[4])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[4])
Print File ARQIMP Spaces(14) + [Answer->Condicoes Especiais]
VALOR_JUROS=([Valor Duplicata]*([Taxa de Juros]/[NDias Taxa de Juros]))/100
If VALOR_JUROS>0
   Then Print File ARQIMP "Juros: "+LTrim(Format("W7.2,EIC",VALOR_JUROS))
        Print File ARQIMP "/Dia"
EndIf
Print File ARQIMP "\n"

Print File ARQIMP Format("W6,AR",NoNota[5])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[5]) + "\n"

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

Print File ARQIMP Format("W6,AR",NoNota[7])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[7])
If Not  IsBlank([Answer->Cidade de Cobranca])
   Then Print File ARQIMP Spaces(11) + Format("W40,AL",[Answer->Endereco de Cobranca])+"\n"
   Else Print File ARQIMP Spaces(11) + Format("W40,AL",[Answer->Endereco Fatura])+"\n"
EndIf
Print File ARQIMP Format("W6,AR",NoNota[8])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[8])
If Not  IsBlank([Answer->Cidade de Cobranca])
   Then Print File ARQIMP Spaces(11) + Format("W40,AL",[Answer->Bairro de Cobranca])
        Print File ARQIMP Format("W10,AL",[Answer->CEP de Cobranca])+"\n"
   Else Print File ARQIMP Spaces(11) + Format("W40,AL",[Answer->Bairro Fatura])
        Print File ARQIMP Format("W10,AL",[Answer->CEP Fatura])+"\n"
EndIf

Print File ARQIMP Format("W6,AR",NoNota[9])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[9])
If Not  IsBlank([Answer->Cidade de Cobranca])
   Then Print File ARQIMP Spaces(11) + Format("W27,AL",[Answer->Cidade de Cobranca])
        Print File ARQIMP Format("W02,AL",[Answer->UF de Cobranca])+"  TEL: "
   Else Print File ARQIMP Spaces(11) + Format("W27,AL",[Answer->Cidade Fatura])
        Print File ARQIMP Format("W02,AL",[Answer->UF Fatura])+"  TEL: "
EndIf
Print File ARQIMP substr(FONE,1,13)+"\n"

Print File ARQIMP Format("W6,AR",NoNota[10])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[10])
If Not  IsBlank([Answer->Cidade de Cobranca])
   Then Print File ARQIMP Spaces(11) + [Answer->Cidade de Cobranca] + "/" + [Answer->UF de Cobranca]
        Print File ARQIMP " - " + [Answer->Cep de Cobranca] + "\n"
   Else Print File ARQIMP Spaces(11)+"O MESMO \n"
EndIf

Print File ARQIMP Format("W6,AR",NoNota[11])
Print File ARQIMP Format("W12.2,EIC,AR",VrNota[11])
Print File ARQIMP Spaces(11) + Format("W28,AL",[Answer->CGC Fatura])
Print File ARQIMP Format("W15,AL",[Answer->IE Fatura])+"\n\n"

ESCEXT([Valor Duplicata])

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

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

Print File ARQIMP CI_10CPP
Print File ARQIMP CI_6LPP
