SF_PN;Pedidos Disponiveis;sys_tbbrow; 4; 0;20;79;padrao;;
:SKEL
VARIAVEL w_colsep = chr(179)
VARIAVEL w_headsep = chr(196)
VARIAVEL Zrecn = Recno()
VARIAVEL zBlkCli = {|nCli| If(left(fCodop,1)$"123", sccpfor->(DbGoto(nCli),cp_nome), sccrcli->(DbGoto(nCli),cr_nome) ) }

VARIAVEL zBlEnter={|| Zrecn:=recno(),vb_venda("M",,.t.,,,"/ALTERARPN/"), eVal(zbOpenAll)}
VARIAVEL zBlC={|| Zrecn:=recno(),Nfe_ImprimirDanfe(fNum,fNum), eVal(zbOpenAll)}
VARIAVEL zNomeLst = "lst_exec('NFE10A')"
VARIAVEL zBlkPrt = {||zrecn:=recno(),Relat(zNomeLst,"nb"),eVal(zbOpenAll),dbgoto(zrecn)}
comando antes znil = Abra('0NOIDX',r_siga,'sccrcli','sccrcli')
comando antes znil = Abra('0NOIDX',r_siga,'sccpfor','sccpfor')
comando antes znil = DbSelectArea('sf_pn')
comando saida sccrcli->(DbCloseArea())
comando saida sccpfor->(DbCloseArea())
:TBMT
 13;eVal(zBlEnter);Enter-Altera ;
 65;doget(D_ob);A-Edita ;
 74;eval(zBlJ);J-Email_NFe ; 
 81;eval(zBlQ);Q-Editar_Ini ; 
 32;Eval(zBlkPrt);Barra-Imprime ;
 67;eval(zBlC);C-Imprimir_DANFE ;
 79;tb_index(D_OB);O-Ordena ;
 80;tb_pesq(D_OB);P-Pesquisa ;
 84;tb_locate(D_oB);T-Trecho ;
 61;doget(D_ob,,.t.);=-Repete_Edicao ;
:TBFI
Pedido;fNumPed;N;999999;6;S;
Emissao;fDataEmi;D;; 8;;
Hora;fhora;C;;8;N;
Valor;Fval;N;@E 999,999.99; 10;N;
*;FgDev;C;X; 1;S;
NF;fnum;N;999999; 6;N;
CFOP;fCodOp;C;XXXXX; 5;S;
Situacao;SitPedido(fg_fat);P;@S35;35;N;
CodCli;fCli;N;999999; 6;S;
RazSoc;eVal(zBlkCli,fCli);C;@S20;20;;
Obs;Nfe_xMotiv;C;@S20;20;N;
COO;fnumcoo;N;999999; 6;N;
nProt;nfe_nprot;C;@15;8;;
Chave;fChaveNfe;C;@S44;44;;
XML;nfe_xml;C;@S75;74;;