;** Or_0034 ********************************************************************
;** Imprime a Digitacao do Orcamento        **Auto Molas Sao Cristovao        **
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido  em: 02/07/98 por Anivel Augusto Rodrigues
;Alterado em     : 13/04/2006 por Anivel Augusto Rodrigues
;Motivo Alteracao: Ajustes

;*******************************************************************************
;* Rotina para Impressao do Relatorio                                          *
;*******************************************************************************
Proc IMPORC()

Moveto "Orcac"
;************************* IMPRESSAO DO CABECALHO *****************************
If Not IsAssigned(NOMEMPRESA)
   Then NOMEMPRESA=""
EndIf

Print File ARQIMP ASP1+CI_10CPP
Print File ARQIMP ASP2+"\n"
Print File ARQIMP ASP1+"================================================================================="+ASP2+"\n\n"
Print File ARQIMP ASP1+CI_IEXP
Print File ARQIMP  "      AUTOMOLAS SAO CRISTOVAO LTDA"+ASP2+"\n\n"
Print File ARQIMP ASP1+CI_FEXP
Print File ARQIMP CI_15CPP
Print File ARQIMP  " R. Ant.Pedro de Almeida, 2140 - R.Alegre - Divinopolis  - Fone : (037) 222-0270"+ASP2+"\n"
Print File ARQIMP ASP1+" CGC 20.155.891/0001-62     IE 223.028153-0069"+ASP2+"\n\n"
Print File ARQIMP ASP1+CI_10CPP
Print File ARQIMP CI_IEXP
Print File ARQIMP  "                ORCAMENTO"+ASP2+"\n\n"
Print File ARQIMP ASP1+CI_10CPP

Print File ARQIMP "N§: "
Print File ARQIMP Format("W06.3,AL",[Numero do Orcamento]) + Spaces(2)
Print File ARQIMP "Emissao: "+Format("D13",[Data de Emissao])+Spaces(01)
Print File ARQIMP "Vendedor: "+Format("W21,AL",[Nome Fantasia Represent])
Print File ARQIMP "Validade: "+Format("D13",[Data de Validade])+ASP2+"\n\n"

Print File ARQIMP ASP1+Spaces(02)+"Cliente: "
Print File ARQIMP Format("W05,AL",[Codigo])
Print File ARQIMP Format("W35,AL",[Razao Social])+SPACES(10)+"Veiculo.:"+Spaces(01)+Format("W11,AL",[Placa do Veiculo])+ASP2+"\n"

Print File ARQIMP ASP1+Spaces(11)+Format("W40,AL",[Endereco])
Print File ARQIMP Format("W20,AL",[Bairro])+Spaces(2)+ASP2+"\n"

Print File ARQIMP ASP1+Spaces(11)+Format("W20,AL",[Cidade])+Spaces(2)
Print File ARQIMP Format("W10,AL",[CEP])+Spaces(2)
Print File ARQIMP Format("W2,AL",[UF])+Spaces(2)
Print File ARQIMP Format("W15,AL",[Telefone])+ASP2+"\n"

Print File ARQIMP ASP1+Spaces(11)+Format("W20,AL",[CGC])+Spaces(2)
Print File ARQIMP Format("W15,AL",[IE])+ASP2+"\n\n"

;********************* IMPRESSAO DOS ITENS ********************************
Moveto "OrcaI"
Print File ARQIMP ASP1+"================================================================================"+ASP2+"\n"
Print File ARQIMP ASP1+" Qtdade Un Codigo     Descricao                              Unitario      Total"+ASP2+"\n"
Print File ARQIMP ASP1+"------- -- ---------- ------------------------------------ ---------- ----------"+ASP2+"\n"
Scan
   Print File ARQIMP ASP1+Format("W07,EIC",[Quantidade])+Spaces(01)
   Print File ARQIMP Format("W03,AL",[Unidade Fiscal])
   Print File ARQIMP Format("W11,AL",[Codigo do Item])
   Print File ARQIMP Format("W36,AL",[Descricao do Item])
   Print File ARQIMP Format("W11.2,EIC",[Preco Unitario])
   Print File ARQIMP Format("W11.2,EIC",[Preco Total])+ASP2+"\n"
EndScan

Print File ARQIMP ASP1+Spaces(62)+"Total.."+Format("W11.2,EIC",[OrcaC->Valor Nota Fiscal])+ASP2+"\n\n"
Print File ARQIMP ASP1+"================================================================================"+ASP2+"\n"

Moveto"OrcaCPG"
Print File ARQIMP ASP1+CI_IEXP
Print File ARQIMP "       CONDICOES  DE  PAGAMENTOS  "+ASP2+"\n\n"
Print File ARQIMP ASP1+CI_FEXP
Print File ARQIMP CI_10CPP
Scan
  Print File ARQIMP  Spaces(20)+Format("W20,AL",[Descricao CondPagto])
  Print File ARQIMP  " Vr Total: "+Format("W09.2,EIC",[Orcac->Valor Nota Fiscal]+(([Orcac->Valor Nota Fiscal]*[Taxa Financeira])/100))+ASP2+"\n"
EndScan

Moveto "Orcac"
Print File ARQIMP ASP1+ASP2+"\n"
Print File ARQIMP ASP1+Spaces(02)+"Obs: "
Print File ARQIMP Format("W75,AL",SubStr([Observacao do Orcamento],001,75))
Print File ARQIMP Format("W75,AL",SubStr([Observacao do Orcamento],076,75))
Print File ARQIMP Format("W75,AL",SubStr([Observacao do Orcamento],151,75))+ASP2+"\n\n"

Print File ARQIMP ASP1+Spaces(02)+"                     -   /   /   "+ASP2+"\n"
Print File ARQIMP ASP1+Spaces(02)+"---------------------------------"+ASP2+"\n"
Print File ARQIMP ASP1+Spaces(02)+"   Assinatura do Cliente/Data"+ASP2+"\n"

Print File ARQIMP ASP1+CI_10CPP
Print File ARQIMP CI_6LPP
Print File ARQIMP "\f"+ASP2
EndProc

;*******************************************************************************
;* Rotina Principal                                                            *
;*******************************************************************************

Seta_FilePrint("OR_0034")
IMPORC()
Imprime_FilePrint("Imprimindo Orcamento -> "+ORCA,"1")

Release Vars VALOR,DATA
Release Procs IMPORC,
              Seta_FilePrint, Imprime_FilePrint


