<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{308,132,1022,598}</property>
    <property name="Name">[_kits.scr]</property>
    <property name="Caption">[Composicoes Cadastradas]</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">[3 - Sizable (Default)]</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">[1 - Normal (Default)]</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
oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,5,54,54)
hwg_TbMt(oToolbar,' 22;BrwComposicoes("addcomp",Pcod);Ins-Cria Nova Composicao ;Ins-Cria Nova Composicao;add.jpg;;;;;Inclui;;')
hwg_TbMt(oToolbar,'  7;BrwComposicoes("delcomp",Pcod);Del-Apaga ;Del-Deleta;deleta.jpg;;;;;Deleta;;')
hwg_TbMt(oToolbar,' 80;tb_pesq(D_OB);P-Pesquisa ;P-Pesquisa na coluna do cursor;pesquisa.jpg;;;;;&P-Pesquisa;;')
hwg_TbMt(oToolbar,' 79;tb_index(D_OB);O-Ordena ;O-Ordena a coluna do cursor;ordena.jpg;;;;;&O-Ordena;;')
hwg_TbMt(oToolbar,' 73;lst_alias(D_OB);I-Imprime ;I-Imprime;impressora.jpg;;;;;&I-Imprime;;')
hwg_Btn(oToolbar,10, 520,70,24)
hwg_TbMt(oToolbar,' 13;BrwComposicoes("showkit",Pcod,d_ob);Enter-Altera ;Enter - Altera;sembitmap;;;Lucida Bright;-11;Altera;;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,' 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,' 67;tb_locate(D_oB);C-Repete_Busca ;C-Repete Busca na coluna do cursor;sembitmap;;;Lucida Bright;-11;&C-Continua;;6;')
hwg_TbMt(oToolbar,' 70;tb_filter(d_ob);F-Filtra ;F-Filtra Cursor;sembitmap;;;Lucida Bright;-11;&F-Filtra;;6;')
// hwg_TbMt(oToolbar,' 32;BrwComposicoes("ativar",Pcod);Barra-Ativar_Desativar ;Barra - Ativar_Desativar;sembitmap;;;Lucida Bright;-11;&Ativar;;6;')
// hwg_TbMt(oToolbar,' 43;BrwComposicoes("additem",Pcod);+-Add_Insumo ;+ - Add_Insumo;sembitmap;;;Lucida Bright;-11;&+-Add_Insumo;;')
// hwg_TbMt(oToolbar,' 45;BrwComposicoes("delitem",Pcod);--Del_Insumo ; - -Del_Insumo;sembitmap;;;Lucida Bright;-11;&--Del_Insumo;;')
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,568,1022,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{608,152,0}</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{10,69,999,227}</property>
      <property name="Name">[D_oB]</property>
      <property name="Anchor">15</property>
      <property name="GridLinesSepColor">0</property>
      <property name="TabIndex">4</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[nBrwAtivo:=1]]>
    </method>
    <method name="onPosChange">
      <![CDATA[oBrwItens:Refresh()
oBtnAtivarDesativar:Caption(ALLTRIM(_Kits->pDesc))]]>
    </method>
    <method name="onInit">
      <![CDATA[hwg_TbFi(D_oB, 'Cod;PCOD;N;999999;  6;;')
hwg_TbFi(D_oB, 'Descricao da Composicao;PDESC;C;@S35;35;;')
hwg_TbFi(D_oB, 'Saldo;PEATUAL;N;999999;  6;;')
hwg_TbFi(D_oB, 'Baixa dos Itens;fg_sit;C;@S15;15;;')
hwg_TbFi(D_oB, 'p/Montar;MQUANT;N;999999;  8;;')
hwg_TbFi(D_oB, 'PrVenda;pvluvenda;N;999999.99;9;;')
hwg_TbFi(D_oB, 'PrItens;prtotal;N;999999.99;9;;')
hwg_TbFi(D_oB, 'QtdPrd;FTOTPROD;N;999999;  6;;')
hwg_TbFi(D_oB, 'Itens;FTOTUNID;N;999999;  6;;')
D_oB:bColorSel:= RGB(3,23,133)
D_oB:tColorSel:= RGB(255,255,255)
D_oB:Alias := alias()
D_oB:lDisableVScrollPos := .t.
D_oB:bKeyDown := {|self, wParam| (aBrowses[nBrwAtivo,2])->(hwg_oDlgKey(self, wparam,1)) , .T. }
D_oB:bOther:={|o,m,wp,lp| MessagesBrowse(o,m,wp,lp)}
D_oB:cargo:={.T.,.T.,"_KITS",.F.,.T.,{||.T.} }
d_ob:bEdit := {|D_oB| .t.}
AADD(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{411,0,483,47}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[Composicoes Cadastradas]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="Arial" width="0" height="-37" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">5</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{255,311,754,204}</property>
      <property name="Name">[oBrwItens]</property>
      <property name="Anchor">14</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 := '_itkits'
oBrwItens:bColorSel:= RGB(3,23,133)
oBrwItens:tColorSel:= RGB(255,255,255)
DbSelectArea( '_itkits' )
hwg_TbFi(@oBrwItens, 'Insumo;PcodInsumo;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Descricao;pdesc;C;@S35;35;;')
hwg_TbFi(@oBrwItens, 'QtdEm1Kit;mQuant;N;@e 99999.99;9;;')
hwg_TbFi(@oBrwItens, 'PrVenda;pVluVenda;N;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'Saldo;peAtual;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Kits;mqAtend;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Sobra;peAtual-mQuant*mqAtend;P;999999;6;;')
hwg_TbFi(@oBrwItens, 'Prod;Pcod;N;999999;6;;')
// alert('vai definir filtros oBrwItens:alias '+oBrwItens:alias+' Sf_FatNf->fnum '+str(Sf_FatNf->fnum,6)+ ' oBrwItens:nColumns '+str(oBrwItens:nColumns,4) )
oBrwItens:lFilter := .T.
oBrwItens:bFirst := {|| _itkits->( DBSEEK( _kits->pcod, .F. ) ) } 
oBrwItens:bLast  := {|| _itkits->( DBSEEK( _kits->pcod, .F., .T. ) ) }
oBrwItens:bWhile := {|| _itkits->pCod = _kits->pcod }
oBrwItens:Refresh()
DbSelectArea( '_kits' )
// alert('definiu oBrwItens:alias '+oBrwItens:alias+' Sf_FatNf->fnum '+str(Sf_FatNf->fnum,6)+ ' oBrwItens:nColumns '+str(oBrwItens:nColumns,4) )]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{10,411,238,47}</property>
      <property name="Name">[oButtonex1]</property>
      <property name="Caption">[Adicionar Item na Composicao]</property>
      <property name="Anchor">6</property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("additem",Pcod)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{11,466,238,47}</property>
      <property name="Name">[oButtonex2]</property>
      <property name="Caption">[Retirar Item da Composicao]</property>
      <property name="Anchor">6</property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("delitem",Pcod)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{12,311,236,92}</property>
      <property name="Name">[oBtnAtivarDesativar]</property>
      <property name="Caption">
[(&apos;ATIVAR_DESATIVAR (Cod&apos;+ltrim(str(_kits-&gt;pcod))+&apos;) &apos;+alltrim(_Kits-&gt;pDesc)+&apos; :&apos;)]      </property>
      <property name="Anchor">6</property>
      <property name="WordWrap">.T.</property>
      <property name="Transparent">.T.</property>
      <property name="ToolTip">
[Tecle aqui para Ativar ou Desativar a Baixa nos Componentes ao Vender ou ao Montar]      </property>
      <property name="TabIndex">8</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("ativar",Pcod)]]>
    </method>
  </part>
</part>
