<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{262,20,1022,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_os");I-Imprime ;I-Imprime;impressora.jpg;;;;;&I-Imprime;;')
//hwg_TbMt(oToolbar,' 73;BrwComposicoes("imprimir");I-Imprime ;I-Imprime;impressora.jpg;;;;;&I-Imprime;;')
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('imprimir_os')",,,"F2:Adicionar Item")
//CiSetKey( "K_F3","BrwComposicoes('imprimir')",,,"F3:Retirar Item")

]]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <part class="status">
    <style>
      <property name="Geometry">{0,620,1022,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,109}</property>
      <property name="Name">[D_oB]</property>
      <property name="Anchor">15</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, 'Cod;pCod;N;999999;  6;;')
hwg_TbFi(D_oB, 'Descricao;pDesc;C;@S25;25;;')
hwg_TbFi(D_oB, 'QtdOs;mQtdOs;N;999999;  6;;')
// hwg_TbFi(D_oB, 'QtdFalta;mQtdFalta;N;999999;  6;;')
hwg_TbFi(D_oB, 'Saldo;PEATUAL;N;999999;  6;;')
hwg_TbFi(D_oB, 'Montaveis;MQUANT;N;999999;  8;;')
hwg_TbFi(D_oB, 'PrCusto;pvluven3;N;99999.99;8;;')
hwg_TbFi(D_oB, 'PrVenda;pvluvenda;N;99999.99;8;;')
hwg_TbFi(D_oB, 'PrCstItens;mvalor3;N;99999.99;8;;')
hwg_TbFi(D_oB, 'PrVdaItens;prtotal;N;99999.99;8;;')
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">{414,0,472,47}</property>
      <property name="Name">[vEdit1]</property>
      <property name="Caption">
[(&quot;Composicoes do Pedido &quot;+lTrim(Str(m_fNumPed,10)))]      </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,214,994,341}</property>
      <property name="Name">[oBrwItens]</property>
      <property name="Anchor">14</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[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;@S30;30;;')
hwg_TbFi(@oBrwItens, 'Saldo;peAtual;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'QtdEm1Kit;mQuant;N;@e 99999.99;9;;')
hwg_TbFi(@oBrwItens, 'PodeMontar;mqAtend;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Sobra;peAtual-mQuant*mqAtend;P;999999;6;;')
hwg_TbFi(@oBrwItens, 'Prod;Pcod;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'PrCusto;pVluVen3;N;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.99;7;;')
hwg_TbFi(@oBrwItens, 'Altura;pAltura;N;9999.99;7;;')
hwg_TbFi(@oBrwItens, 'ObsCorte;pObsForma;C;@S20;20;;')
hwg_TbFi(@oBrwItens, 'UnCpr;pUnidade;C;@S5;5;;')
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;;')
// 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">{332,567,150,47}</property>
      <property name="Name">[oButtonex1]</property>
      <property name="Caption">[F2 - Insumos da OS]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("imprimir_os")]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{488,567,174,47}</property>
      <property name="Name">[oButtonex2]</property>
      <property name="Caption">[F3 - Plano Corte Item]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("imprimir_item", pcod)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{765,568,242,47}</property>
      <property name="Name">[oButtonex7]</property>
      <property name="Caption">[F4 - Planejamento Producao]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-16" weight="400"/>
      </property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("set_plan_prod", pcod, pCodInsumo)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{290,7,89,79}</property>
      <property name="Name">[oButtonex3]</property>
      <property name="Caption">[&amp;1. Imprimir Faltas]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Imprime Faltas]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("imprimir_os","kit_prt_os_faltas")
]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{108,7,89,79}</property>
      <property name="Name">[oButtonex4]</property>
      <property name="Caption">[&amp;2. Imprimir Plano de Corte da OS]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Imprime plano de corte detalhado]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("imprimir_os","kit_prt_os_cortecompleto")
]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{199,7,89,79}</property>
      <property name="Name">[oButtonex5]</property>
      <property name="Caption">[&amp;3. Plano de Corte do Item Selecionado]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Imprime plano de corte Simplificado]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("imprimir_os","kit_prt_os_cortesimples")]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{17,7,89,79}</property>
      <property name="Name">[oButtonex6]</property>
      <property name="Caption">[&amp;4. Imprimir Insumos da OS]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Imprime insumos da OS]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("imprimir_os")]]>
    </method>
  </part>
</part>
