<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{328,118,1018,626}</property>
    <property name="Name">[psfnfref.scr]</property>
    <property name="Caption">[Selecione NFE/NFS de Referencia]</property>
    <property name="AlwaysOnTop">.F.</property>
    <property name="AutoCenter">.T.</property>
    <property name="Font">
      <font name="Verdana" width="0" height="-13" weight="400"/>
    </property>
    <property name="FormType">[dlgModal]</property>
    <property name="Modal">.F.</property>
    <property name="ScopeVarObj">[Private]</property>
    <property name="lClipper">.T.</property>
    <property name="lExitOnEnter">.F.</property>
    <property name="lExitOnESC">.T.</property>
    <property name="FromStyle">[Center]</property>
    <property name="Clipsiblings">.F.</property>
    <property name="Clipchildren">.F.</property>
    <property name="TitleBar">.T.</property>
    <property name="StyleBorder">[0 - No Border]</property>
    <property name="nBackColor">14215660</property>
    <property name="Icon">[]</property>
    <property name="Bitmap">[icon\tela.jpg]</property>
    <property name="NoIcon">.F.</property>
    <property name="SystemMenu">.T.</property>
    <property name="Minimizebox">.F.</property>
    <property name="Maximizebox">.T.</property>
    <property name="AbsAlignment">.T.</property>
    <property name="WindowState">[3 - Maximized]</property>
    <property name="minHeight">-1</property>
    <property name="maxHeight">-1</property>
    <property name="minWidth">-1</property>
    <property name="maxWidth">-1</property>
    <property name="ScrollBars">[0 - None (Default)]</property>
    <property name="DSControl">.F.</property>
  </style>
  <method name="onDlgInit">
    <![CDATA[PARAMETERS oDlg
//skel VARIAVEL zNil=if(sys_segmento='locacao', sf_fat->(Abra('0NOIDX',r_siga,'vb_pref','vb_pref')), '')
//skel VARIAVEL zbObra={||vb_pref->(DbGoTo(SF_FAT->fObra),cr_fantasi)}
//skel VARIAVEL zBlkCli = {|nCli| sccrcli->(DbGoto(nCli)), sccrcli->cr_nome }
//skel VARIAVEL zBlkPrd = {|nPcod| se_prod->(dbseek(nPcod)), se_prod->pdesc }
oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,5,64,64)
hwg_TbMt(oToolbar,' 80;tb_pesq(D_OB);P-Pesquisa Chave;P-Pesquisa na coluna do cursor;pesquisa.ico;;;;;&P-Pesquisa;;;')
hwg_TbMt(oToolbar,' 79;tb_index(D_OB);O-Ordena ;O-Ordena a coluna do cursor;ordenar.ico;;;;;&O-Ordena;;;')
hwg_Btn(oToolbar,10,544+30,70,24)
hwg_TbMt(oToolbar,' 13;psq_enter();Enter-Confirma;Enter - Confirma selecao da nota sob o cursor;sembitmap;;;Lucida Bright;-11;Confirma;;6;')
hwg_TbMt(oToolbar,' 76;tb_locate(D_oB);L-Busca_Iniciais ;L-Busca pelas Iniciais na coluna do cursor;sembitmap;;;Lucida Bright;-11;&L-Iniciais;;6;')
hwg_TbMt(oToolbar,' 84;tb_locate(D_oB);T-Busca_Trecho ;T-Pesquisa Trecho na coluna do cursor;sembitmap;;;Lucida Bright;-11;&T-Trecho;;6;')
hwg_TbMt(oToolbar,' 67;tb_locate(D_oB);C-Repete_Busca ;C-Repete Busca na coluna do cursor;sembitmap;;;Lucida Bright;-11;&C-Continua;;6;')
SetDlgKey(oDlg,8,26,{|| (aBrowses[nBrwAtivo,2])->(moveRec(aBrowses[nBrwAtivo,1],"UP"))})
SetDlgKey(oDlg,8,28,{|| (aBrowses[nBrwAtivo,2])->(moveRec(aBrowses[nBrwAtivo,1],"DOWN"))})
Hwg_EndMenu()]]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <part class="status">
    <style>
      <property name="Geometry">{0,596,1018,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{640,160,0}</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{3,85,1006,273}</property>
      <property name="Name">[D_oB]</property>
      <property name="font">
        <font name="Arial" width="0" height="-13" weight="400"/>
      </property>
      <property name="Border">.F.</property>
      <property name="TabIndex">4</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[nBrwAtivo:=1]]>
    </method>
    <method name="onPosChange">
      <![CDATA[oBrwItens:Refresh()]]>
    </method>
    <method name="onInit">
      <![CDATA[D_oB:bColorSel:= RGB(3,23,133)
D_oB:tColorSel:= RGB(255,255,255)
D_oB:bKeyDown := {|self, wParam| (aBrowses[nBrwAtivo,2])->(hwg_oDlgKey(self, wparam,1)) , .T. }
hwg_TbFi(D_oB, 'DtEmis;fDataEmi;D;;8;;')
hwg_TbFi(D_oB, 'Controle;fnum;N;999999999;9;;')
hwg_TbFi(D_oB, 'Mod;if(fnum>0,"NFE","NFS");P;XXX;3;;')
IF sys_segmento='locacao'
   hwg_TbFi(D_oB, 'Val_Loca;fvalLoca;N;@E 999,999.99;10;;')
   hwg_TbFi(D_oB, 'Aditivo;lTrim(Str(fObraNoCli,2))+"."+lTrim(str(fAditivo,2))+".0";P;@S7;  8;;')
   hwg_TbFi(D_oB, 'NomeObra;eVal(zbObra);P;@S25;25;S;')
ELSE
   hwg_TbFi(D_oB, 'Val_Prods;fval;N;@E 999,999.99;10;;')
   hwg_TbFi(D_oB, 'Unids;ftotunid;N;@E 999,999;7;;')
ENDIF
hwg_TbFi(D_oB, 'Pedido;if(fgdev="E","DEVOL",str(fprenota,6));P;@S6;6;;')
hwg_TbFi(D_oB, 'CodCli;fCli;N;999999;  6;;')
hwg_TbFi(D_oB, 'RazSoc;eVal(zBlkCli,fCli);C;@S25;25;;')
IF sys_segmento='locacao'
   hwg_TbFi(D_oB, 'Obra;fObra;N;999999;6;S;')
   hwg_TbFi(D_oB, 'iObra;fObraNoCli;N;999;7;S;')
ENDIF
hwg_TbFi(D_oB, 'Obs;nfe_xmotiv;C;@S10;10;;')
hwg_TbFi(D_oB, 'nProt;nfe_nprot;C;@15;15;;')
hwg_TbFi(D_oB, 'Chave;fChaveNfe;C;@S44;44;;')
hwg_TbFi(D_oB, 'XML  ;nfe_xml;C;@S75;74;;')
D_oB:Alias := alias()
D_oB:bOther:={|o,m,wp,lp| MessagesBrowse(o,m,wp,lp)}
D_oB:cargo:={.T.,.T.,"SF_FAT",.F.,.T.,{||.T.} }
aAdd(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})

d_oB:bedit := {|| .f. }
d_ob:lEditable = .t.

]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{209,367,800,185}</property>
      <property name="Name">[oBrwItens]</property>
      <property name="Anchor">9</property>
      <property name="font">
        <font name="Arial" width="0" height="-12" weight="400"/>
      </property>
      <property name="Border">.F.</property>
      <property name="TabIndex">6</property>
    </style>
    <method name="onInit">
      <![CDATA[oBrwItens:Alias := 'se_movnf'
oBrwItens:bColorSel:= RGB(3,23,133)
oBrwItens:tColorSel:= RGB(255,255,255)
DbSelectArea( 'se_movnf' )
hwg_TbFi(@oBrwItens, 'Prod;Pcod;N;999999;6;;;')
hwg_TbFi(@oBrwItens, 'Descricao;eVal(zBlkPrd,pcod);C;@S30;30;;')
hwg_TbFi(@oBrwItens, 'Quant;mQuant;N;@e 9999.999;8;;')
hwg_TbFi(@oBrwItens, 'Devol;mQdevol;N;@e 9999.999;8;;')
hwg_TbFi(@oBrwItens, 'Saldo;mQuant-mQdevol;P;@e 9999.999;8;;')
hwg_TbFi(@oBrwItens, 'Valor;mValor;N;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'Un;se_prod->pUNIDADE;P;XXX;3;;')
hwg_TbFi(@oBrwItens, 'Barra;se_prod->pdic6;P;9999999999999;13;;')
hwg_TbFi(@oBrwItens, 'NCM;se_prod->pcodclafis;P;99999999;8;;')
hwg_TbFi(@oBrwItens, 'ST;se_prod->pCATEGORIA;P;XXX;3;;')
oBrwItens:lFilter := .T.
oBrwItens:bFirst := {|| se_movnf->( DBSEEK( Sf_Fat->fnum, .F. ) ) } 
oBrwItens:bLast  := {|| se_movnf->( DBSEEK( Sf_Fat->fnum , .F., .T. ) ) }
oBrwItens:bWhile := {|| se_movnf->mfnum = Sf_Fat->fnum }
oBrwItens:Refresh()
DbSelectArea( 'SF_Fat' )
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{96,368,106,35}</property>
      <property name="Name">[oLabel3]</property>
      <property name="Caption">[Produtos da Nota Selecionada]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="Arial" width="0" height="-13" weight="400"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">7</property>
    </style>
  </part>
  <part class="button">
    <style>
      <property name="Geometry">{969,53,37,18}</property>
      <property name="Name">[oButton1]</property>
      <property name="Id">[IDCANCEL]</property>
      <property name="Caption">[Sair]</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{424,2,415,33}</property>
      <property name="Name">[oLabel4]</property>
      <property name="Caption">[Selecione Nota de Referencia]</property>
      <property name="font">
        <font name="Arial" width="0" height="-29" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">9</property>
    </style>
  </part>
</part>
