<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{308,132,1022,598}</property>
    <property name="Name">[os_set.scr]</property>
    <property name="Caption">[]</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,64,64)
IF se_setor->CodSetor="AL"
   hwg_TbMt(oToolbar,'22;Gera_OsSet("informar_all_atendimento");Atend_Tudo;Ins-Confirmar Atendimento de Todas os Itens;cadastrar.ico;;;;;AtendTudo;;;')
   hwg_TbMt(oToolbar,'13;Gera_OsSet("informar_atendimento");Atend_Item;Enter - Confirmar Atendimento Individual;alterar.ico;;;Lucida ;;AtendItem;;;')
ELSE
   hwg_TbMt(oToolbar,'22;Gera_OsSet("informar_all_atendimento");Fez_Todos;Ins-Confirma producao de todos os itens;cadastrar.ico;;;;;FezTodos;;;')
   hwg_TbMt(oToolbar,'13;Gera_OsSet("informar_atendimento");Fez_Esse;Enter - Confirma que Fez Esse Item;alterar.ico;;;;;FezEsse;;;')
ENDIF

// hwg_TbMt(oToolbar,' 65;tb_update(D_OB);A-Altera ;A-Altera;alterar.ico;;;;;&A-Altera;;;')
//hwg_TbMt(oToolbar,'  7;tb_del(D_ob);DEL-DELeta ;DEL-Deleta;deletar.ico;;;;;Deleta;;;')
//hwg_TbMt(oToolbar,' 80;tb_pesq(D_OB);P-Pesquisa ;P-Pesquisa na coluna do cursor;pesquisa.ico;;;;;&P-Pesquisa;;;')

d_ob:lEditable = .t.

//hwg_TbMt(oToolbar,' 79;tb_index(D_OB);O-Ordena ;O-Ordena a coluna do cursor;ordenar.ico;;;;;&O-Ordena;;;')
hwg_TbMt(oToolbar,' 73;lst_alias(D_OB);I-Imprime ;I-Imprime;impressora.ico;;;;;&I-Imprime;;;')
hwg_Btn(oToolbar,10,544,70,24)
hwg_TbMt(oToolbar,' 32;tb_cons();Barra-Exibe ;Barra-Exibe;sembitmap;;;Lucida Bright;-11;Exibe;;6;')
hwg_TbMt(oToolbar,' 13;doget(D_ob);Enter-Edita ;Enter - Edita;sembitmap;;;Lucida Bright;-11;Edita;;6;')
hwg_TbMt(oToolbar,' 61;doget(D_ob,,.t.);=-Repete_Edicao ;= - Repete_Edicao;sembitmap;;;Lucida Bright;-11;&=-Repete_Edicao;;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,' 69;tb_filter(d_ob,"Exp");E-Filtra_Expressao ;E-Filtra Expressao;sembitmap;;;Lucida Bright;-11;&E-Filtra;;6;')
//hwg_TbMt(oToolbar,' 70;tb_filter(d_ob);F-Filtra ;F-Filtra Cursor;sembitmap;;;Lucida Bright;-11;&F-Filtra;;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()
if type("oDlgStatusBar")="B"
   oDlgStatusBar:Anchor:=14
endif
IF OsrSetI->CodSetor="AL"
   opDescInsumo:SetGet("Informar Saida do Almoxarife de ate "+OsrSetI->(LTRIM(TRANSFORM(MQUANT,"@E 99999.999")+" "+ALLTRIM(EVAL(zbPrdUnd,pCodInsumo)))+" de "+eVal(zbPrd,pCodInsumo)))
ELSE
   opDescInsumo:SetGet("Informar Producao de Pecas usando ate "+OsrSetI->(LTRIM(TRANSFORM(MQUANT,"@E 99999.999")+" "+ALLTRIM(EVAL(zbPrdUnd,pCodInsumo)))+" de "+eVal(zbPrd,pCodInsumo)))
EndIf
opDescInsumo:Refresh()]]>
  </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,77,1000,458}</property>
      <property name="Name">[D_oB]</property>
      <property name="Anchor">15</property>
      <property name="font">
        <font name="Lucida Sans Unicode" width="0" height="-16" weight="400"/>
      </property>
      <property name="GridLinesSepColor">0</property>
      <property name="TabIndex">4</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[nBrwAtivo:=1]]>
    </method>
    <method name="onInit">
      <![CDATA[IF OsrSetI->CodSetor = "AL"
    hwg_TbFi(D_oB, 'Solicitadas;Transform(Quant*mQUANT,"@E 99999.999")+" "+eVal(zbPrdUnd,pCodInsumo);P;@S12;12;;', , , , 1, 1)
    hwg_TbFi(D_oB, 'Atendidas; Transform(MQATEND,"@E 99999.999")+" "+eVal(zbPrdUnd,pCodInsumo);P;@S10;10;;')

    hwg_TbFi(D_oB, 'Finalidade;"Fazer "+if(pPecas>0.and.pLargura+pAltura>0,lTrim(Str(Quant*pPecas,6))+" pc "+if(pLargura>0,"de "+Str(pLargura*1000,4)+" mm","")+if(pAltura>0," x "+Str(pAltura*1000,4)+" mm","")+" p/ ","")+lTrim(Str(Quant,7))+" "+eVal(zbPrd,pCod);P;@S40;40;;', , , , 1, 1)

ELSE
    hwg_TbFi(D_oB, 'Solicitadas;if(pPecas>0.and.pLargura+pAltura>0, Transform(Quant*pPecas,"@E 9999999")+" pc" , Transform(Quant*mQUANT,"@E 99999.999")+" "+eVal(zbPrdUnd,pCodInsumo));P;@S12;12;;', , , , 1, 1)
    IF pLargura>0
       hwg_TbFi(D_oB, 'Dimensao da Peca;if(pLargura>0,Str(pLargura*1000,4)+" mm","")+if(pAltura>0," x "+Str(pAltura*1000,4)+" mm","");P;@S18;18;;')
    ENDIF
    hwg_TbFi(D_oB, 'Atendidas; if(pPecas>0.and.pLargura+pAltura>0, Transform(MQATEND,"@E 9999999")+" pc" , Transform(MQATEND,"@E 99999.999")+" "+eVal(zbPrdUnd,pCodInsumo));P;@S10;10;;')
    hwg_TbFi(D_oB, 'QtdComp;Quant;N;9999999;7;;')
    hwg_TbFi(D_oB, 'Composicao;eVal(zbPrd,pCod);P;@S35;35;;')
    hwg_TbFi(D_oB, 'QtdInsumo;if(pPecas>0.and.pLargura+pAltura>0, Transform(Quant*mQUANT,"@E 99999.999")+" "+eVal(zbPrdUnd,pCodInsumo), "");P;@S12;10;;')
ENDIF

hwg_TbFi(D_oB, 'Cliente;sccrcli->(DbGoTo(os_set->fCli),cr_nome);P;@S20;20;;')
    
hwg_TbFi(D_oB, 'OS;fNumPed;N;999999;6;;')
hwg_TbFi(D_oB, 'Data;sf_pn->(DbSeek(OS_SET->FNUMPED),fDataEmi);P;99.99.9999;10;;')
hwg_TbFi(D_oB, 'ObsForma;POBSFORMA;C;@S20; 20;;')
hwg_TbFi(D_oB, 'Pr;PRIORIDADE;C;xx;  2;;')

hwg_TbFi(D_oB, 'CodIns;PCODINSUMO;N;999999;6;;')
hwg_TbFi(D_oB, 'Descricao do Insumo;eVal(zbPrd,pCodInsumo);P;@S35;35;;')

hwg_TbFi(D_oB, 'Setor;CODSETOR;C;xx;5;;')
hwg_TbFi(D_oB, 'QtdOS;QUANT;N;99999;6;;')
hwg_TbFi(D_oB, 'CodComp;PCOD;N;999999;7;;')


D_oB:bColorSel:= RGB(3,23,233)
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.,"OS_SET",.F.,.T.,{||.T.} }

D_oB:lFilter := .T.
D_oB:bFirst := {|| os_set->( DBSEEK( osrseti->(CodSetor+Str(pCodInsumo,6)), .F. ) ) } 
D_oB:bLast  := {|| os_set->( DBSEEK( osrseti->(CodSetor+Str(pCodInsumo,6)), .F., .T. ) ) }
D_oB:bWhile := {|| os_set->(CodSetor+Str(pCodInsumo,6)) = osrseti->(CodSetor+Str(pCodInsumo,6)) }

sHwgKeyEdit:= 61
AADD(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{341,4,547,54}</property>
      <property name="Name">[opDescInsumo]</property>
      <property name="varName">[vEdit1]</property>
      <property name="Multiline">.T.</property>
      <property name="TabIndex">5</property>
    </style>
  </part>
</part>
