;** Pd_0110S *******************************************************************
;** Imprime a Digitacao do Pedido                         ** ANDRADE TEXTIL    *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido  em: 25/05/2009 por HUMBERTO F. SANTOS.
;Ultima Alteracao: 16/06/2009 por Humberto F.Santos.
;Motivo Alteracao: Ajustes

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

;************************* IMPRESSAO DO CABECALHO *****************************
;f Not IsAssigned(NOMEMPRESA)
 ; Then NOMEMPRESA=""
;ndIf

Print File ARQIMP ASP1+CI_10CPP+ASP2
Print File ARQIMP ASP1+ASP2+"\n"
Print File ARQIMP ASP1+ "  ---------------------------------------------------------------------------" + ASP2+"\n"
Print File ARQIMP ASP1+ Spaces(02)+"Pedido de Venda"+Spaces(25)+"Impressao: "+Format("D13",Today())+"-"+Time()+ ASP2+"\n"
Print File ARQIMP ASP1+ "  ---------------------------------------------------------------------------" +ASP2+ "\n\n"

Print File ARQIMP ASP1+"Cliente:"+[Codigo]+Spaces(05)+"N§ do Pedido:"+Format("W06.3,AL",[Numero do Pedido])+ Spaces(05)+"Emissao:"+Format("D13",[Data de Emissao])+ASP2+"\n"
Print File ARQIMP ASP1 + "Representante:  "+Format("W05,AL",[Codigo do Representante])+[Nome Fantasia Represent]+ASP2+"\n\n\n"
Print File ARQIMP ASP1 + "Cortador:.......................  Embalador:................................."+ASP2+"\n\n" 

Print File ARQIMP ASP1+CI_15CPP+ASP2
;********************* IMPRESSAO DOS ITENS ********************************
Print File ARQIMP ASP1+Spaces(02)+"Sq Item                                                            Cod.Cor  "
Print File ARQIMP " Nome               Quant.Pedido Un   Cortado"+ASP2+"\n"
Print File ARQIMP ASP1+Spaces(02)+"-------------------------------------------------------------------------------------------------"
Print File ARQIMP " -------------------------------- "+ASP2+"\n"
Moveto "PedidoI"
Cont=1
Scan
   Print File ARQIMP ASP1+Spaces(02)+Format("W03,AL",[Item do Pedido])
   Print File ARQIMP Format("W11,AL",[Codigo do Item])
   Print File ARQIMP Format("W31,AL",[Descricao do Item])+Spaces(25)
   Print File ARQIMP Format("W05,AL",[Codigo da Cor_Tecido])+Spaces(04)
   Print File ARQIMP Format("W15,AL",[descricao da Cor_Tecido])
   Print File ARQIMP Format("W11.3,EIC",[Quantidade])+Spaces(03)
   Print File ARQIMP Format("W05,AR",[Unidade Fiscal])+ASP2+"\n"
   Print File ARQIMP ASP1+ "  -----------------------------------------------------------------------------------------------------------------------------------"+ASP2+"\n"
   Cont=Cont+2
   If Cont=53
     Then
     Print File ARQIMP ASP1+ASP2+"\n\n\n"
   EndIf
EndScan

;********************* IMPRESSAO DOS TOTAIS **************************
Moveto "PedidoC"
Print File ARQIMP ASP1+CI_10CPP+ASP2
Print File ARQIMP ASP1+ASP2+"\n\n\n"

Print File ARQIMP ASP1+ " N.Volumes.:              "+LTrim(Format("W15,EIC",[PedidoC->Numero de Volumes]))
Print File ARQIMP "       Peso Liquido: "+LTrim(Format("W11.3,EIC",[PedidoC->Peso Liquido]))+ASP2+"\n\n"
Print File ARQIMP ASP1+ " Peso Bruto: "+LTrim(Format("W16.3,EIC",[PedidoC->Peso Bruto]))+ASP2+"\n"

;************************* IMPRESSAO DO RODAPE ********************************
Moveto "PedidoC"
Print File ARQIMP ASP1+spaces(02)+"Obs. do Pedido..: "+Format("W110,AL",SubStr([Observacao do Pedido],001,110))+"\n"
If Substr([Observacao do Pedido],111,110)<>""
   Then Print File ARQIMP ASP1+ Spaces(20)+Format("W110,AL",SubStr([Observacao do Pedido],111,110))+"\f"
EndIf


EndProc

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

Seta_FilePrint("PD_0110S")
IMPPED()
Imprime_FilePrint("Imprimindo Pedido -> "+PEDIDO,"1")

Release Vars VALOR,DATA
Release Procs IMPPED,VENC,
              Seta_FilePrint, Imprime_FilePrint
