;** EB_0334 ********************************************************************
;*  Emissao de Boletas - SICOOB - MODELO ESPECIFICO         ** Casa Fonseca ** *
;*******************************************************************************
;Autor: Visao/Vise
;Desenvolvido    : 01/08/2013  por Bruno Carvalho
;Ultima Alteracao: 01/08/2013  por Bruno Carvalho 
;Motivo Alteracao: Adicionado calculo diario de juros na observa‡Æo 

;*******************************************************************************
;* Rotina de Impressao de Duplicatas                                           *
;*******************************************************************************
Print File ARQIMP CI_10CPP+CI_8LPP+"\n\n"
Print File ARQIMP Spaces(55)+Format("D10",[Data Vencimento])+"\n"
Print File ARQIMP "\n\n\n"

Print File ARQIMP Spaces(03)+Format("W08,AL",Format("D10",[Answer->Data de Emissao]))

If [Ordem do Documento]<>""
   Then Print File ARQIMP Spaces(04)+Format("W08,AL",[Answer->Numero do Documento]+"/"+[Ordem do Documento])
   Else Print File ARQIMP Spaces(04)+Format("W08,AL",[Answer->Numero do Documento]+"  ")
EndIf

Print File ARQIMP Spaces(06)+"DM"+"\n"

Print File ARQIMP "\n"

Print File ARQIMP Spaces(51)+Format("W12.2,EIC,AR",[Valor Duplicata])+"\n"

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

;*** Calculo de juros di rio ***************************************************
Switch
  Case PARAM_FORMA_TXJUROS="D" : TX_JUROS_DIA = PARAM_TXJUROS 
  Case PARAM_FORMA_TXJUROS="M" : TX_JUROS_DIA = ((PARAM_TXJUROS/30 )/100)
  Case PARAM_FORMA_TXJUROS="A" : TX_JUROS_DIA = ((PARAM_TXJUROS/365)/100)
  OtherWise                    : TX_JUROS_DIA = 0
EndSwitch
DIARIO = Format("W10.2",TX_JUROS_DIA*[Valor Duplicata])

Print File ARQIMP Spaces(03)+LTrim(SubStr(MSGDUP,001,41))+"\n"
Print File ARQIMP Spaces(03)+LTrim(SubStr(MSGDUP,042,41))+"\n"
If TX_JUROS_DIA <> 0
   Then Print File ARQIMP Spaces(03)+"VALOR DE JUROS AO DIA: R$ "+Ltrim(DIARIO)+"\n\n"
   Else Print File ARQIMP "\n\n" 
EndIf   

;Print File ARQIMP Spaces(03)+SubStr(MSGDUP,083,41)+"\n"
;Print File ARQIMP Spaces(03)+SubStr(MSGDUP,124,41)+"\n"

Print File ARQIMP CI_15CPP+CI_8LPP+"\n"                                      

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

If IsBlank([Answer->Endereco de Cobranca]) Or [Answer->Endereco de Cobranca]="O MESMO"
   Then Print File ARQIMP Spaces(11)+[Answer->Endereco Fatura]+" -   " + [Answer->Bairro Fatura]+"\n"
        Print File ARQIMP Spaces(11)+[Answer->Cidade Fatura]+"/"+[Answer->UF Fatura]+" -   "+[Answer->CEP Fatura]+"\n"
   Else
        Print File ARQIMP Spaces(11)+[Answer->Endereco de Cobranca]+" -   " + [Answer->Bairro de Cobranca]+"\n"
        Print File ARQIMP Spaces(11)+[Answer->Cidade de Cobranca]+"/"+[Answer->UF de Cobranca]+" -   "+[Answer->CEP de Cobranca]+"\n"
EndIf

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