;** Ed_0212 ********************************************************************
;*  Emissao de Duplicatas                  DAIA                                *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 07/01/2009 por Antonio Marcelo Alves
;Ultima Alteracao: 13/01/2009 por Nikolas
;Motivo Alteracao: Ajustes

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

Print File ARQIMP  CI_10CPP+CI_6LPP
Print File ARQIMP "\n\n\n"
If [Ordem do Documento]<>""
   Then Print File ARQIMP Spaces(66)+"XX"
   Else Print File ARQIMP Spaces(48)+"XX"
EndIf
Print File ARQIMP "\n"

;Print File ARQIMP Spaces(42) + "RODOVIARIO"+ Spaces(12) + Format("W13,AR",[Answer->Descricao da Destinacao])+"\n"
Print File ARQIMP "\n"
Print File ARQIMP Spaces(57) + AlinhM(LTrim(StrVal(Format("D13",[Answer->Data de Emissao]))),10)+"\n"


Print File ARQIMP "\n\n\n\n\n"
Print File ARQIMP Spaces(03)+Format("W11.2,EIC,AR",[Answer->Valor Nota Fiscal])
Print File ARQIMP Spaces(05)+Format("W6,AC",[Answer->Numero do Documento])
Print File ARQIMP Spaces(02)+Format("W11.2,EIC,AR",[Valor Duplicata])
Print File ARQIMP Spaces(03)+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\n\n"
   Else Print File ARQIMP Spaces(02)+AlinhM(LTrim(StrVal(Format("D13",[Data Vencimento]))),10)
EndIf
Print File ARQIMP "\n\n"
Print File ARQIMP Spaces(20) + Format("W14.2,EIC,AL",[Valor do Desconto])
Print File ARQIMP Spaces(08)+Format("D13",[Data Limite Desconto])+"\n"

Print File ARQIMP Spaces(20) + Format("W15,AL",[Answer->Condicoes Especiais])
Print File ARQIMP Spaces(08) + [Answer->Pedido Cliente]
VALOR_JUROS=([Valor Duplicata]*([Taxa de Juros]/[NDias Taxa de Juros]))/100
Print File ARQIMP Spaces(02) + "Juros: "+LTrim(Format("W5.2,EIC",VALOR_JUROS))+" ao Dia"+"\n\n"

Print File ARQIMP Spaces(20) + [Answer->Razao Social Fatura]+" - "+[Answer->Codigo]+"\n"
Print File ARQIMP Spaces(20) + Format("W40,AL",[Answer->Endereco Fatura])+Format("W18,AL",[Answer->Bairro Fatura]) +"\n"

Print File ARQIMP Spaces(20) + FORMAT("W37,AL",[Answer->Cidade Fatura])
Print File ARQIMP Spaces(02) + [Answer->CEP Fatura]+ Spaces(05) + [Answer->UF Fatura]+"\n"
Print File ARQIMP Spaces(20) + FORMAT("W37,AL",[Answer->Cidade Fatura])+"\n"

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


;If Not IsBlank([Answer->Cidade de Cobranca])
;
;   Then
;       ; Print File ARQIMP "\n"
;        Print File ARQIMP Spaces(17) + Format("W40,AL",[Answer->Endereco de Cobranca])+Format("W18,AL",[Answer->Bairro de Cobranca]) +"\n"
;        Print File ARQIMP Spaces(17) + Format("W30,AL",[Answer->Cidade de Cobranca])
;        Print File ARQIMP Spaces(09)+Format("W15,AL",[Answer->CEP de Cobranca]) + "  "+[Answer->UF de Cobranca]+"\n\n"
;   Else Print File ARQIMP Spaces(17) + "O MESMO"+"\n\n\n"
;EndIf

ESCEXT([Valor Duplicata])

Print File ARQIMP Spaces(19) + SubStr(EXTENSO,001,57) + "\n"
Print File ARQIMP Spaces(19) + SubStr(EXTENSO,058,57) + "\n"
Print File ARQIMP Spaces(19) + SubStr(EXTENSO,115,57) + "\n"

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

Print File ARQIMP  CI_INEG

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

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


