SF_FATNF;Relacao de Vendas;sys_tbbrow; 6;0;18;79;x;;
:SKEL
VARIAVEL w_colsep:=chr(179)
VARIAVEL w_headsep:=chr(196)
VARIAVEL zbNomeCliFor:={|nCod| if(!fgdev$"DE",sccrcli->(dbgoto(nCod)),sccpfor->(dbgoto(nCod))), if(!fgdev$"DE",sccrcli->cr_nome,sccpfor->cp_nome) }
VARIAVEL zbItens:={||zSele:=Select(),Abra("0",r_siga,"SE_MOVNF","SE_MOVNF","seim_f","mfnum","SEIM_C","PCOD"),Brow_Db('SE_MOVNF',.t.),Se_MOVNF->(DbCloseArea()),DbSelectArea(zSele)}
VARIAVEL zbExibeDeletadas:={||Set(11,'off'), if(sGuiMode, d_ob:Top(), D_oB:goTop())}
VARIAVEL zbNaoExibeDeletadas:={||Set(11,'on'), if(sGuiMode, d_ob:Top(), D_oB:goTop())}
VARIAVEL zNil:=(ChecaSeAdicionaCamposNFE() , ABRA("0RO",r_siga,"sccpfor","sccpfor") , ABRA("0RO",r_siga,"sccrcli","sccrcli") , DbSelectArea('SF_FATNF') )
COMANDO SAIDA zNil:=( Sccrcli->(DbCloseArea()), Sccpfor->(DbCloseArea()) )
:TBMT
 22;tb_insert(D_OB);Ins-Inclui ;
 13;Eval(zbItens);Enter-Produtos ;
 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 ;
 69;doget(D_ob);E-Edita ;
  7;tb_del(D_ob);DEL-DELeta ;
 65;tb_update(D_OB);A-Altera ;
 47;eVal(zbExibeDeletadas);/-Exibe_Deletadas ;
 92;eVal(zbNaoExibeDeletadas);\-NaoExibe_Deletadas ;
:TBFI
N.F.;fnum;N;999999;6;S;
ChaveNFE;fChaveNFE;C;@S44;8;S;
Oper;Ind_Oper;C;X;4;S;
Emit;Ind_Emit;C;X;4;S;
Ser;fSerie;C;XXX;3;S;
Mod;Cod_Mod;C;XX;3;S;
Sit;Cod_Sit;C;XX;3;S;
xSituacao;nfe_xMotiv;C;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;10;S;
CFOP;Fcodop;C;XXXXX;5;S;
Emissao;fdataemi;D;99.99.9999;8;S;
Valor;Fval;N;@E 999,999.99; 10;S;
Del;if(Deleted(),'Del','');P;XXX;3;N;
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;
Pedido;fnumped;N;999999;6;S;
CodCli;Fcli;N;999999;6;S;
Cliente;if(fcli>0,Str(fcli,5)+":"+Eval(zbNomeCliFor,fcli),"     "+if(ftipoven="1","dinheiro",if(ftipoven="2","cheque","cartao")));C;@s20;20;N;
*;FgDev;C;X;1;S;
Prds+Unids;ftipoven+ftv+str(ftotprod,4)+str(ftotunid,4);C;@s11;11;N;
*;fG_FAT;C;!;1;S;
Emissao;dtoc(fdataemi)+" "+left(fhora,5);C;@s14;14;N;