SP_MOVF;Produtos a Receber;sys_tbbrow; 8; 0;21;79;sp_movfn;;
:SKEL
VARIAVEL w_colsep = chr(179)
VARIAVEL w_headsep = chr(196)
COMANDO ANTES abra_arq("sccpfab")
COMANDO ANTES DbSelectArea("SP_MOVF")
COMANDO DEPOIS sccpfab->(DbCloseArea())
VARIAVEL z_blkdsp = 'zpcod:=pcod,zseek:=zpcod<>se_prod->pcod,znil:=prd_dados("DAGO"),znil:=if(zseek,se_prod->(DbSeek(zpcod)),NIL),zlab:=se_prod->pprincforn,sccpfab->(DbGoto(zlab)),'
VARIAVEL z_blkdsp = z_blkdsp + 'znil:=if(zseek.and.se_prod->pitens>1,alert_tef("Produto fracionado!",1),NIL),zcor:=SetColor("R/W"),DevPos(6,41),DevOut("Fabr:"+sccpfab->cp_fantasi),SetColor(ZCOR)'
VARIAVEL z_blkdsp = _CreateBlock( z_blkdsp )
comando durante znil = eval(z_blkdsp)
// VARIAVEL w_colsep = " "+chr(179)
// 22;ins_prd(D_oB,"R");Ins-Inclui ;
//Pedida;unid_Fech;N;9999;  4;N;
//Frc;pitens;N;999;  3;N;
//Pr Total;MvALor;N;99999.99;8;N;
:TBMT
 22;ins_prd(D_oB,"R",.t.,.t.);Ins-Inclui ;
 43;insprdsm(D_oB,"R",.f.,.t.);+-Inclui ;
 13;pf_DoGet(D_oB,"R");Enter-Altera ;
  7;tb_del(D_oB);Del-Cancela ;
 73;Lst_alias(D_OB);I-Imprime Pedido ;
 66;pf_ean(nrow,d_ob);B-Cod_Barras ;
 82;pfrecquant(D_oB);R-Confirma_Todos ;
 86;pfvalor(D_oB);V-Valor_Pedido ;
 63;chk_sp_movf(,,,"CALCULA_VALOR");?-Valor_NF ;
 47;chk_sp_movf(,,D_oB,"AJUSTA_TODOS");/-Ajusta_Valores ;
 32;OrdSetFocus(0);Barra-Ordem_Digitacao ;
 79;tb_index(D_OB);O-Ordena ;
 69;dispent(pcod);E-Entradas ;
 76;lestmax(d_ob);L-Excessos ;
 68;upd_dic(d_ob,,pcod);D-Dic_Altera ;
 67;checadic(pcod);C-Dic_Consulta ;
:TBFI
Cod;PCOD;N;99999;  5;N;
Desc;PDESC;C;@S24; 22;N;
Receb;mqatend;N;9999;  4;S;
PrTab;pvlutab;N;9999.99;7;S;
%Negoc;PdscCompr;N;999.99;6;S;
PrUnNf;pvluven3;N;9999.99;7;S;
%Prd;Pdesconto;N;999.99;6;N;
CstTotl;mvalor3;N;9999.99;7;S;
Cfop;pCfop;C;9999;4;S;
%Rod;PdscRodape;N;999.99;6;S;
*;pnegpos;C;x;1;S;
Frc;pitens;N;9999;  4;N;
Pr Vend;pvluvenda;N;9999.99;7;S;
Cf;pcategoria;C;xxx;3;S;
XmlCf;xml_categf;C;xxx;5;S;
CstIcm;Cst_Icms;C;xxx;6;S;
CstPIS;Cst_Pis;C;xxx;6;S;
CstCOF;Cst_Cofins;C;xxx;6;S;
Base_ICM;mBaseIcms;N;9999.99;8;S;
%ICMs;mTaxaIcms;N;99.99;5;S;
Tot_ICM;mTotIcms;N;9999.99;8;S;
BaseST;mBaseRetid;N;9999.99;8;S;
%ST;mTaxaST;N;99.99;5;S;
ICM_ST;mIcmRetido;N;9999.99;8;S;
BasePIS;vl_bc_pis;N;9999.99;8;S;
%PIS;aliq_pis;N;99.99;5;S;
Tot_PIS;vl_pis;N;9999.99;8;S;
BaseCOF;vlbccofins;N;9999.99;8;S;
%COF;aliqcofins;N;99.99;5;S;
Tot_COF;vl_cofins;N;9999.99;8;S;
%Repas;prepasse;N;999.99;6;S;
%IPI;pipient;N;999.99;6;S;
%Liq;PdescComp;N;999.99;6;S;
%Distr;PdescDist;N;999.99;6;S;
%DscTt;if(mvalor3>0,100*(mqatend*pvlutab-mvalor3)/(mqatend*pvlutab),0);N;999.99;6;N;
Pend;unid_fech-mqatend;N;9999; 4;N;
UndVnd;mquant;N;999999;  6;N;
xmlCstIcm;xml_csticm;C;xxx;9;S;
xmlCstPis;xml_cstpis;C;xxx;9;S;
xmlCstCof;xml_cstcof;C;xxx;9;S;
XmlBaseICM;xml_IcmBC;N;9999.99;10;S;
Xml%ICM;xml_IcmTx;N;99.99;7;S;
XmlTotICM;xml_ICMVl;N;9999.99;9;S;
