;** FO_0035  *******************************************************************
;** Imprime Ficha Acompanhamento Recurtimento                                  *
;*******************************************************************************
;Autor: Visao/Vise
;Desenvolvido  em: 21/08/2003 por Anivel Augusto Rodrigues
;Alterado em     : 24/09/2003 por Anivel Augusto Rodrigues
;Motivo Alteracao: Ajustes
;Alterado em     : 02/05/2019 por Anivel Augusto Rodrigues
;Motivo Alteracao: Ajustes

;*******************************************************************************
;* Rotina para Impressao Cabecalho                                             *
;*******************************************************************************
Proc Cabecalho()
Private c,tm

If Not IsAssigned(NOMEMPRESA) Then NOMEMPRESA="" EndIf
If Not IsAssigned(SYS_CODIGO_CLIENTE) Then SYS_CODIGO_CLIENTE="" EndIf
Print File ARQIMP CI_6LPP+CI_10CPP+"\n"

Moveto "Recurt_C"
Print File ARQIMP  Fill(Chr(196),80)+"\n"
Print File ARQIMP  Format("W55,AL",NOMEMPRESA)+"Emissao: "+Format("D13",[Recurt_C->Data_Programacao])+"-"+[Recurt_C->Hora_Programacao]+"\n"
Print File ARQIMP  Fill(Chr(196),80)+"\n\n"
Print File ARQIMP  CI_INEG+Format("W56,AL","FICHA DE ACOMPANHAMENTO")       +
                                 "PARTIDA N§ "+CI_IEXP+CI_INEG+Format("W6,AL",AlinhM(StrVal(VSDGNPARTIDA),6))+CI_FEXP+CI_FNEG+"\n\n"

Print File ARQIMP  "CLIENTE  : "+CI_INEG+[Razao Social    ]+" - "+[Codigo]+CI_FNEG+"\n"
Print File ARQIMP  "PEDIDO   : "+CI_INEG+[Numero do Pedido]+               CI_FNEG+"\n"
Print File ARQIMP  Fill(Chr(196),80)+"\n"

Print File ARQIMP  "\n"
Print File ARQIMP  "ARTIGO   : "+ Format("W10,AL",[Codigo do Item]) +" "+CI_INEG+[Descricao do Item      ]+ CI_FNEG+"\n\n"
Print File ARQIMP  "COR      : "+ Spaces(06)+[Codigo da Cor_Tecido] +" "+CI_INEG+[Descricao da Cor_Tecido]+CI_FNEG+"\n\n"


Print File ARQIMP  Fill(Chr(196),80)+"\n"
Print File ARQIMP  "CLASSIFIC.INICIAL : "+CI_INEG+"                   "+CI_FNEG + "CLASSIFIC.FINAL : "+CI_INEG+"         "+CI_FNEG+"\n\n\n"

Print File ARQIMP  Fill(Chr(196),80)+"\n"
Print File ARQIMP  "ESPESSURA INICIAL : "+CI_INEG+"                   "+CI_FNEG + "ESPESSURA FINAL : "+CI_INEG+[Espessura]+CI_FNEG+"\n\n\n"

Print File ARQIMP  Fill(Chr(196),80)+"\n"
Print File ARQIMP  "DT INICIO PRODUCAO: "+CI_INEG+"                   "+CI_FNEG + "DT ENTREGA      : "+CI_INEG+"         "+CI_FNEG+"\n\n\n"

Print File ARQIMP  Fill(Chr(196),80)+"\n"
Print File ARQIMP  "MEIOS: "+CI_INEG+Format("W18,EIC,AL",[Quantidade_Meios])+CI_FNEG+"METROS: "+CI_INEG+format("W18.1,EIC,AL",[Quantidade_Mt])+CI_FNEG+"PESO: "+"\n\n\n"
Print File ARQIMP  Fill(Chr(196),80)+"\n\n"

FO_0035_imprimeobs()
Print File ARQIMP  "\n\n"

Print File ARQIMP  "Anotacoes"+"\n\n"
Print File ARQIMP  Fill(Chr(196),80)+"\n\n\n"
Print File ARQIMP  Fill(Chr(196),80)+"\n\n\n"
Print File ARQIMP  Fill(Chr(196),80)+"\n\n\n"

Endproc

;*******************************************************************************
;* Rotina de Impressao de Observa‡äes                                          *
;*******************************************************************************
proc FO_0035_imprimeobs()
private TamObs, nlobs, posobs, i, s

TamObs=80

s="Observacoes: "+Tira_QuebraLinha([Observacao])

nlobs=Len(s)/tamobs
If nlobs-Int(nlobs)>0
   Then nlobs=Int(nlobs)+1
   Else nlobs=Int(nlobs)
EndIf

posobs=1
For i from 1 to nlobs
  Print File ARQIMP CI_INEG+SubStr(s,posobs,tamobs)+CI_FNEG+"\n"

  posobs=posobs+tamobs
EndFor

endproc



;*******************************************************************************
;* Rotina para Impressao Rodape                                                *
;*******************************************************************************
Proc Rodape()

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


;*******************************************************************************
;* Rotina Principal                                                            *
;*******************************************************************************
ArqImp=PrivDir()+"FO_0035.Txt"
If IsFile(ArqImp)
   Then Deleta_Arquivo(ARQIMP)
EndIf


View "Recurt_C"
Moveto [Numero_Partida]
Locate VSDGNPARTIDA

Cabecalho()
Rodape()

ImpriArq(ARQIMP)

ClearAll
LIMPAGUARDE()

Release Vars RNLinhas
Release Procs Cabecalho, Rodape, Detalhe,FO_0035_imprimeobs
