<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{305,34,1019,650}</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,' 73;BrwComposicoes("imprimir","kit_prt_cortecompleto");P-PlanoCorte ;P-Imprime Plano de Corte;impressora.jpg;;;;;&P-PlanoCorte;;')
hwg_TbMt(oToolbar,' 73;BrwComposicoes("imprimir");I-Insumos ;I-Imprime Insumos, Faltas, etc.;impressora.jpg;;;;;&I-Insumos;;')
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()

SET(5,1960)
CiSetKey( "K_F2","BrwComposicoes('additem',Pcod)",,,"F2:Adicionar Item")
CiSetKey( "K_F3","BrwComposicoes('delitem',Pcod)",,,"F3:Retirar Item")
CiSetKey( "K_F4","BrwComposicoes('ativar',Pcod)",,,"F4:Ativar")
CiSetKey( "K_F5","BrwComposicoes('copiardeoutro',Pcod)",,,"F5:Copiar Composicao de Outro Item")

oDlg:Maximize()
]]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <part class="status">
    <style>
      <property name="Geometry">{0,620,1019,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{608,152,0}</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{15,95,993,70}</property>
      <property name="Name">[D_oB]</property>
      <property name="Anchor">11</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="400"/>
      </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, 'Saldo;PEATUAL;N;999999;  6;;')
hwg_TbFi(D_oB, 'Montaveis;MQUANT;N;999999;  8;;')
hwg_TbFi(D_oB, 'PrCstKit;pvluCst;N;99999.99;8;;')
hwg_TbFi(D_oB, 'PrVdaKit;pvluvenda;N;99999.99;8;;')
// hwg_TbFi(D_oB, 'PrCstTotal;MQUANT*pvluCst;P;99999.99;8;;')
hwg_TbFi(D_oB, 'PrVdaInsumos;prtotal;N;99999.99;9;;')
hwg_TbFi(D_oB, 'Baixa dos Itens;fg_sit;C;@S15;15;;')
hwg_TbFi(D_oB, 'QtdPrd;FTOTPROD;N;999999;  6;;')
// hwg_TbFi(D_oB, 'Unids;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">{107,0,771,47}</property>
      <property name="Name">[vEdit1]</property>
      <property name="Caption">[(&quot;Composicao de &quot;+lTrim(_kits-&gt;pDesc))]</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">{13,180,994,375}</property>
      <property name="Name">[oBrwItens]</property>
      <property name="Anchor">15</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </property>
      <property name="Border">.F.</property>
      <property name="TabIndex">6</property>
    </style>
    <method name="onUpdate">
      <![CDATA[BrwComposicoes('gravagrid')]]>
    </method>
    <method name="onInit">
      <![CDATA[DbSelectArea( '_itkits' )
oBrwItens:ALIAS := '_itkits' 
oBrwItens:bColorSel:= RGB(3,23,133)
oBrwItens:tColorSel:= RGB(255,255,255)
hwg_TbFi(@oBrwItens, 'Insumo;PcodInsumo;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Descricao;pdesc;C;@S30;30;;')
hwg_TbFi(@oBrwItens, 'LoteProducao;pcLoteProd;N;@e 99999999.999;12;;')
hwg_TbFi(@oBrwItens, 'QtdEm1Kit;mQuant;N;@e 99999.999;10;;')
hwg_TbFi(@oBrwItens, 'PrTotCst;mQuant*pVluCst;P;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'PrTotRec;mQuant*pVluVen3;P;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'PrVenda;pVluVenda;N;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'Pecas;pPecas;N;999.99;6;;')
hwg_TbFi(@oBrwItens, 'TamPeca;pLargura;N;9999.999;8;;')
hwg_TbFi(@oBrwItens, 'Altura;pAltura;N;9999.999;8;;')
hwg_TbFi(@oBrwItens, 'UnCpr;pUnidade;C;@S5;5;;')
hwg_TbFi(@oBrwItens, 'PrCompra;pVluVen3;N;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'PrCusto;pVluCst;N;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'TamCompra;pLargCompr;N;9999.99;7;;')
hwg_TbFi(@oBrwItens, 'AltCompra;pAltCompr;N;9999.99;7;;')
hwg_TbFi(@oBrwItens, 'PesoCompra;pPesoCompr;N;9999.99;7;;')
hwg_TbFi(@oBrwItens, 'Saldo;peAtual;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'PodeMontar;mqAtend;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Sobra;peAtual-mQuant*mqAtend;P;999999;6;;')
hwg_TbFi(@oBrwItens, 'ObsCorte;pObsForma;C;@S20;18;;')
hwg_TbFi(@oBrwItens, 'Setores;Setores;C;@S20;20;;')
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">{304,567,114,47}</property>
      <property name="Name">[oButtonex1]</property>
      <property name="Caption">[F2 Adicionar Item]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </property>
      <property name="WordWrap">.T.</property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("additem",Pcod)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{422,567,112,47}</property>
      <property name="Name">[oButtonex2]</property>
      <property name="Caption">[F3 Retirar Item]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </property>
      <property name="WordWrap">.T.</property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("delitem",Pcod)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{549,567,135,47}</property>
      <property name="Name">[oBtnAtivarDesativar]</property>
      <property name="Caption">[F4 Baixa Itens ao Montar/Vender]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </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 class="buttonex">
    <style>
      <property name="Geometry">{712,567,106,47}</property>
      <property name="Name">[oButtonex3]</property>
      <property name="Caption">[F5 Copiar Composicao]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </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("copiardeoutro",Pcod)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{833,567,73,47}</property>
      <property name="Name">[oButtonex4]</property>
      <property name="Caption">[F6 Setores]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </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("show_setores_da_composicao",Pcod)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{916,567,93,47}</property>
      <property name="Name">[oButtonex5]</property>
      <property name="Caption">[Substituir Insumo]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </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("substituir_insumo",Pcod)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{1023,567,93,47}</property>
      <property name="Name">[oButtonex6]</property>
      <property name="Caption">[Ficha do Insumo]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </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("ficha_do_insumo",_itkits->pCodInsumo, _KITS->pCod)]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{168,583,114,32}</property>
      <property name="Name">[owQtdMontar]</property>
      <property name="varName">[wQtdMontar]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="700"/>
      </property>
      <property name="cPicture">[999999]</property>
      <property name="TabIndex">11</property>
    </style>
    <method name="onLostFocus">
      <![CDATA[BrwComposicoes("montar")
RETURN .t.]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{37,583,114,32}</property>
      <property name="Name">[owQtdDesmontar]</property>
      <property name="varName">[wQtdDesmontar]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="700"/>
      </property>
      <property name="cPicture">[999999]</property>
      <property name="TabIndex">11</property>
    </style>
    <method name="onLostFocus">
      <![CDATA[BrwComposicoes("desmontar")
RETURN .t.]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{203,58,96,32}</property>
      <property name="Name">[oPcLoteProd]</property>
      <property name="varName">[m_PcLoteProd]</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="700"/>
      </property>
      <property name="cPicture">[999999]</property>
      <property name="TabIndex">11</property>
    </style>
    <method name="onLostFocus">
      <![CDATA[BrwComposicoes("AlteraLoteProducao")
RETURN .t.]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{406,58,96,32}</property>
      <property name="Name">[opcMatPri]</property>
      <property name="varName">[m_pcMatPri]</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="700"/>
      </property>
      <property name="cPicture">[999999.99]</property>
      <property name="TabIndex">11</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[.f.]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{837,58,97,32}</property>
      <property name="Name">[oPcImpress]</property>
      <property name="varName">[m_pcImpress]</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="700"/>
      </property>
      <property name="cPicture">[999999.99]</property>
      <property name="TabIndex">11</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[.f.]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{622,58,96,32}</property>
      <property name="Name">[opcMaoObra]</property>
      <property name="varName">[m_pcMaoObra]</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="700"/>
      </property>
      <property name="cPicture">[999999.99]</property>
      <property name="TabIndex">11</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[.f.]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{160,563,120,18}</property>
      <property name="Name">[oLabel5]</property>
      <property name="Caption">[Quant.a Montar:]</property>
      <property name="Justify">[Right]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="" width="0" height="-13" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">12</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{11,563,140,18}</property>
      <property name="Name">[oLabel6]</property>
      <property name="Caption">[Quant.a Desmontar:]</property>
      <property name="Justify">[Right]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="" width="0" height="-13" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">12</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{122,56,77,34}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[Lote de Producao:]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="" width="0" height="-13" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">12</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{332,56,70,34}</property>
      <property name="Name">[oLabel2]</property>
      <property name="Caption">[Custo Mat. Prima:]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="" width="0" height="-13" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">12</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{764,56,71,34}</property>
      <property name="Name">[oLabel3]</property>
      <property name="Caption">[Custo Impressao:]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="" width="0" height="-13" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">12</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{555,56,63,34}</property>
      <property name="Name">[oLabel4]</property>
      <property name="Caption">[Custo Servicos:]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="" width="0" height="-13" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">12</property>
    </style>
  </part>
</part>
