SF_FATF;Notas de Entrada;sys_tbbrow; 6;0;18;79;x;;
:SKEL
VARIAVEL z_Nil = ChecaFatfSeDeveAdicionarCampos()
VARIAVEL w_colsep = chr(179)
VARIAVEL w_headsep = chr(196)
VARIAVEL w_browrel=.t.
VARIAVEL w_chave = alias()
VARIAVEL Z_Sele = Select()
VARIAVEL Z_SKIPBLK = .F.
VARIAVEL zNomeLst = "lst_exec('NFE05')"
VARIAVEL zBlkPrt = _CreateBlock('zrecn:=recno(),Relat(zNomeLst,"nb"),dbcloseall(),abra_arq("sf_fatf"),dbgoto(zrecn)')
VARIAVEL zBlkForn = {|nForn| sccpfor->(dbgoto(nForn)), sccpfor->(if(empty(cp_fantasi),cp_nome,cp_fantasi)) }
variavel z_BlkItens = #TEXTO_FONTE
   w_chave:=fNum
   Abra("0",r_siga,"SE_MOVNF","SE_MOVNF","seim_f","mfnum","SEIM_C","PCOD")
   DbSetFilter( {||mfges<>"S"} ,'mfges<>"S"')
   Brow_Db('SE_MOVNF',.t.)
   Se_MOVNF->(DbCloseArea())
   DbSelectArea(z_sele)
#FIM_TEXTO_FONTE
COMANDO ANTES Z_NIL = ABRA("0NOIDX",r_siga,"sccpfor","sccpfor")
COMANDO DEPOIS Z_NIL = Sccpfor->(DbCloseArea() )
:TBMT
 22;tb_insert(D_OB);Ins-Inclui ;
 13;Eval(z_BlkItens);Enter-Produtos ;
 69;doget(D_ob);E-Edita ;
 80;tb_pesq(D_OB);P-Pesquisa ;
 79;tb_index(D_OB);O-Ordena ;
 67;tb_locate(D_OB);C-Continua_Busca ;
 84;tb_locate(D_OB);T-Trecho ;
 70;tb_filter(d_ob);F-Filtra ;
 73;lst_alias(D_OB);I-Imprime ;
  7;tb_del(D_ob);DEL-DELeta ;
 65;tb_update(D_OB);A-Altera ;
 85;Fatf2FatnfUpdateEfd();U-Atualiza Descricoes;
:TBFI
N.F.;fnum;N;999999999;9;S;
Ser;fSerie;C;XXX;3;S;
Oper;Ind_Oper;C;X;4;S;
Emit;Ind_Emit;C;X;4;S;
Mod;Cod_Mod;C;XX;3;S;
CFOP;Fcodop;C;XXXXX;5;S;
Emissao;pfdataemi;D;99.99.9999;10;S;
Chegada;pfDataChe;D;99.99.9999;10;S;
Valor;Fval;N;@E 999,999.99; 10;S;
RazSoc;Eval(zBlkForn,fcli);C;@s15;11;N;
Cnpj_CPF;FCNPJCPF;C;99999999999999;14;S;
BaseICM;Fbaseicms;N;@E 999,999.99; 10;S;
%TxICM;Ftaxaicms;N;@E 999.99; 6;S;
ValorICM;Ftoticms;N;@E 999,999.99; 10;S;
ChaveNFE;fChaveNFE;C;@S44;24;S;
CodFor;fcli;N;999999;6;N;
Pedido;fnumped;N;999999;6;S;
Emissao;fdataemi;D;99.99.9999;10;S;
Chegada;fDataCheg;D;99.99.9999;10;S;