;** EP_0298 ********************************************************************
;*  Emissao de Nota Promissoria               MG Textil             ************
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 13/09/2011 por Anivel Augusto Rodrigues
;Alterado em     :   /  /     por
;Motivo Alteracao:

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

 Print File ARQIMP chr(27)+chr(67)+chr(33) ;Imprime 33 Linhas por pagina
 Print File ARQIMP CI_10CPP
 Print File ARQIMP CI_6LPP

 Print File ARQIMP "+------------------------------------------------------------------------------+"+"\n"
 Print File ARQIMP "|                   N O T A    P R O M I S S O R I A                           |"+"\n"
 Print File ARQIMP "|                   ================================                           |"+"\n"
 Print File ARQIMP "|                    Republica Federativa do Brasil                            |"+"\n"
 Print File ARQIMP "|                                                                              |"+"\n"
 Print File ARQIMP "| Vencimento(s):                                                               |"+"\n"
;                   |   999999/A   999999/A   999999/A   999999/A   999999/A   999999/A   999999/A |
;                   | 99/99/9999 99/99/9999 99/99/9999 99/99/9999 99/99/9999 99/99/9999 99/99/9999 | 
;                   | 999.999,99 999.999,99 999.999,99 999.999,99 999.999,99 999.999,99 999.999,99 | 
 
 LinhaV1="| "
 LinhaV2="| "
 LinhaV3="| "
 i3=0
 For i2 From 1 to 14
   If Not IsBlank(DtVencto[i2])
      Then  
           LINHAV1=LINHAV1+Spaces(2)+Format("W6,AC",[Answer->Numero do Documento])
           If NoORdem[i2]<>""
              Then LINHAV1=LINHAV1+"/"+NoORdem[i2]+" "
              Else LINHAV1=LINHAV1+"   "
           EndIf
           LINHAV2=LINHAV2+Format("D13"  ,DtVencto[i2])+" "
           LINHAV3=LINHAV3+Format("W10.2",VrVencto[i2])+" "
           i3=i3+1   
   EndIf       
   If i3=7 Or i2=14
      Then
           If i2=14 And i3=0 Then QuitLoop EndIf

           Print File ARQIMP Completa(LINHAV1,79," ")+"|\n"
           Print File ARQIMP Completa(LINHAV2,79," ")+"|\n"
           Print File ARQIMP Completa(LINHAV3,79," ")+"|\n"
      
           LinhaV1="| "
           LinhaV2="| "
           LinhaV3="| "
           i3=0
   EndIf
 EndFor  

 Print File ARQIMP "|                                                                              |"+"\n"
 Print File ARQIMP "| Nos vencimentos acima citados , pagarei seus respectivos valores conforme  a |"+"\n"
 Print File ARQIMP "| presente NOTA PROMISSORIA a                                                  |"+"\n"
 Print File ARQIMP "| "+Format("W30,AL",EMPRESA)+Spaces(47)+"|"+"\n"
 Print File ARQIMP "| Inscrita no CNPJ: "+Format("W18,AL",CNPJEMP)+" ou sua ordem "
 Print File ARQIMP "a quantia totalizada de    |"+"\n"

 ESCEXT([Valor Nota Fiscal])
 Print File ARQIMP "|                                                                              |"+"\n"

 Print File ARQIMP "|"+Spaces(04) + SubStr(EXTENSO,001,60) +Spaces(14)+"|" +"\n"
 Print File ARQIMP "|"+Spaces(04) + SubStr(EXTENSO,061,60) +Spaces(14)+"|" +"\n"
 Print File ARQIMP "|"+Spaces(04) + SubStr(EXTENSO,122,60) +Spaces(14)+"|" +"\n"

 Print File ARQIMP "|                                                                              |"+"\n"

 Print File ARQIMP "| Emitente: "+[Answer->Codigo]+" - "+ Format("W40,AL",[Answer->Razao Social Fatura])+Spaces(20)+"|"+"\n"
 Print File ARQIMP "| CNPJ/CPF: "+Format("W18,AL",[Answer->CGC Fatura])+Spaces(48)+" |"+"\n"
 Print File ARQIMP "| Endereco: "+Format("W38,AL",[Answer->Endereco Fatura])
 Print File ARQIMP "Bairro: "+Format("W20,AL",[Answer->Bairro Fatura])+" |"+"\n"
 Print File ARQIMP "| Cidade..: "+[Answer->Cep Fatura]+" - "+Format("W20,AL",[Answer->Cidade Fatura])+Spaces(5)
 Print File ARQIMP "    Uf: "+[Answer->UF Fatura]+Spaces(18) + " |"+"\n"
 Print File ARQIMP "|                                                                              |"+"\n"
 Print File ARQIMP "| "+COMPLETA(CIDEMP+", "+StrVal(Day([Answer->Data de Emissao]))+" de "+
                        RTrim(MesExt(Month([Answer->Data de Emissao])))+" de "+
                        Strval(Year([Answer->Data de Emissao])),47," ")
 Print File ARQIMP "___________________________"+Spaces(03)+"|"+"\n"
 Print File ARQIMP "|                                                                              |"+"\n"
 Print File ARQIMP "+------------------------------------------------------------------------------+"+"\n"

 Print File ARQIMP CI_10CPP
 Print File ARQIMP CI_6LPP+"\f"

 Print File ARQIMP chr(27)+chr(67)+chr(66) ;Imprime 66 Linhas por pagina


