;** Ed_5009 ********************************************************************
;*  Emissao de Duplicatas                                     Metrotextil      *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 27/07/1998 por Anivel Augusto Rodrigues
;Alterado em     : 23/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(54) + AlinhM(LTrim(StrVal(Format("D13",[Answer->Data de Emissao]))),10)

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

Print File ARQIMP "\n\n\n"

Print File ARQIMP Spaces(22)
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("D13",[Data Vencimento]))),10)+"\n"
EndIf
Print File ARQIMP Format("W07,AR",NoNota[1])+Format("W10.2,EIC",VrNota[1])+"\n"

Print File ARQIMP Spaces(28) + Format("W29.2,EIC,AL",[Valor do Desconto])
Print File ARQIMP Format("D13",[Data Limite Desconto]) + "\n\n"

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

Print File ARQIMP Spaces(31) + [Answer->Razao Social Fatura]+" - "+[Answer->Codigo]+"\n"

Print File ARQIMP Spaces(31) + [Answer->Endereco Fatura]+"\n"

Print File ARQIMP Spaces(31) + Format("W37,AL",[Answer->Bairro Fatura])
Print File ARQIMP Substr(FONE,1,13) +"\n"

Print File ARQIMP Spaces(31) + Format("W27,AL",[Answer->Cidade Fatura])+
                  [Answer->UF Fatura]+"         "+[Answer->CEP Fatura] + "\n"

Print File ARQIMP Spaces(31) + [Answer->Endereco de Cobranca] + "\n"

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

Print File ARQIMP Spaces(31) + Format("W28,AL",[Answer->CGC Fatura])+
                  [Answer->IE Fatura]+"\n"

ESCEXT([Valor Duplicata])

Print File ARQIMP Spaces(29) + SubStr(EXTENSO,001,51) + "\n"
Print File ARQIMP Spaces(29) + SubStr(EXTENSO,052,51) + "\n"
Print File ARQIMP Spaces(29) + 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\n\n"
Endif

