VENDA;Produtos da Nota Fiscal;sys_tbbrow;8;0;23;79;NOTAF;;
:SKEL
VARIAVEL w_colsep = chr(179)
VARIAVEL w_headsep = chr(196)
VARIAVEL zbEdit:={|cLote,oC,fipos| Compl_Lotes(cod,quant), .t.}

variavel #TEXTO_FONTE
   //ONINIT
      If xGetEnv("PEDE_EMBALAGEM_DE_CADA_ITEM_NA_VENDA")="S"
         hwg_TbFi(D_oB, 'Qtd_Fech;Quant/if(pItens=0,1,pItens);P;99999.99;8;N;')
         hwg_TbFi(D_oB, 'Prc_Fech;pVluEmb;N;99999.99;8;S;')
         hwg_TbFi(D_oB, 'UnidFech;pUnidade;C;@S10;10;S;')
      else
         hwg_TbFi(D_oB, 'Quant;Quant;N;99999.99;8;S;')
         hwg_TbFi(D_oB, 'Pr Unit;PRUNIT;N;99999.99; 8;N;')
         //hwg_TbFi(D_oB, 'PrCheio;pVluVenda;N;99999.99; 8;S;')
         //hwg_TbFi(D_oB, 'Vl_Desc;Desconto;N;99999.99; 8;S;')
         //hwg_TbFi(D_oB, '%Dsc;if(prtotal>0,100*Desconto/prtotal,0);P;99999.99; 8;N;')
      endif
      hwg_TbFi(D_oB, 'Produto;DESC;C;@S30; 28;;')
      IF sys_segmento='farma'
         // hwg_TbFi(D_oB, 'Lote;pLote;C;@S10;10;S;;;zbEdit;')
         hwg_TbFi(D_oB, 'Lote;pLote;C;@S10;10;S;;;;')
         hwg_TbFi(D_oB, 'DtVenc;data_venc;D;@S10;10;S;')
      ELSE
         hwg_TbFi(D_oB, 'Estq;INDICE;C;XXXXX; 5;;')
      ENDIF
      hwg_TbFi(D_oB, 'Pr Total;PRTOTAL;N;99999.99; 8;S;')
      hwg_TbFi(D_oB, 'Cfop;pCfop;C;99999;5;S;')
      If xGetEnv("PEDE_EMBALAGEM_DE_CADA_ITEM_NA_VENDA")="S"
         hwg_TbFi(D_oB, 'ItensEmb;pItens;N;999999;8;S;')
         hwg_TbFi(D_oB, 'QtdItens;Quant;N;99999.99;8;S;')
         hwg_TbFi(D_oB, 'Pr_Item;PRUNIT;N;99999.99; 8;N;')
      endif
      hwg_TbFi(D_oB, 'Cod/CodBarra;COD;N;9999999999999; 13;;')
      hwg_TbFi(D_oB, '*;if(fgprom="S".or.pdescbon>0,"*"," ");C;!;1;N;')
      hwg_TbFi(D_oB, 'dsv;Pdesconto;N;99.99;5;;')
      hwg_TbFi(D_oB, 'dsm;Pdescvnd;N;99.99;5;S;')
      IF FIELDPOS('CST_ICMS')>0
         hwg_TbFi(D_oB, 'CstIcm;Cst_Icms;C;xxx;6;S;')
         hwg_TbFi(D_oB, 'CstPIS;Cst_Pis;C;xxx;6;S;')
         hwg_TbFi(D_oB, 'CstCOF;Cst_Cofins;C;xxx;6;S;')
         hwg_TbFi(D_oB, 'Base_ICM;mBaseIcms;N;9999.99;8;S;')
         hwg_TbFi(D_oB, '%ICMs;mTaxaIcms;N;99.99;5;S;')
         hwg_TbFi(D_oB, 'Tot_ICM;mTotIcms;N;9999.99;8;S;')
         hwg_TbFi(D_oB, 'BaseST;mBaseRetid;N;9999.99;8;S;')
         hwg_TbFi(D_oB, '%ST;mTaxaST;N;99.99;5;S;')
         hwg_TbFi(D_oB, 'ICM_ST;mIcmRetido;N;9999.99;8;S;')
         hwg_TbFi(D_oB, 'BasePIS;vl_bc_pis;N;9999.99;8;S;')
         hwg_TbFi(D_oB, '%PIS;aliq_pis;N;99.99;5;S;')
         hwg_TbFi(D_oB, 'Tot_PIS;vl_pis;N;9999.99;8;S;')
         hwg_TbFi(D_oB, 'BaseCOF;vlbccofins;N;9999.99;8;S;')
         hwg_TbFi(D_oB, '%COF;aliqcofins;N;99.99;5;S;')
         hwg_TbFi(D_oB, 'Tot_COF;vl_cofins;N;9999.99;8;S;')
      endif
   //ENDONINIT
   //ONDLGINIT
       sHwgKeyEdit := 13 
       d_ob:lEditable := .t.
       d_ob:bEdit := {|D_oB| nKey:=13,vb_DoGet(D_oB) }
       oDlg:Maximize()
   //ENDDLGINIT
// 93;disp_sdse(cod);]-Demanda ;
// 13;vb_DoGet(D_oB);Enter-Altera ;
#FIM_TEXTO_FONTE

:TBMT
 22,.not.sGuiMode;vb_prd(D_oB);Ins-Inclui ;
 13;vb_DoGet(D_oB);A-Altera ;Enter - Altera a Quantidade ou Preco. Para isso leve o cursor ate a coluna da Quantidade ou Preco e Clique no Botao Alterar;alterar.ico;;;;;&A-Altera;;;
 32;vb_DoGet(D_oB, "GET_DADOS_FISCAIS");Barra-Dados_Fiscais ;
 69;(DoGet(D_oB),Update_PnMv_pelo_ArqVnd("UPD"));E-Edita ;
 83;sel_prd_transf();S-Selecoes ;
 73;lst_alias(D_OB);I-Imprime ;
 82;RedefineCfops(D_OB);R-RedefineCFOPs ;
 80;tb_pesq(D_OB);P-Pesquisa ;
 84;tb_locate(D_oB);T-Busca_Trecho ;
 67;tb_locate(D_oB);C-Repete_Busca ;
 79;tb_index(D_OB);O-Ordena ;
 70;tb_filter(d_ob);F-Filtra ;
 61;doget(D_ob,,.t.);=-Repete_Edicao ;
 76,sys_segmento="farma";vb_DoGet(D_oB, "POE_LOTES");L-Poe_Lotes ;
