<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{360,126,1020,650}</property>
    <property name="Name">[SF_NFE.scr]</property>
    <property name="Caption">[Pedidos de Devolucao Pendentes]</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">[1 - Fixed Single]</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 bCor = {|| if(fSubsidio>0, {16777215,255,16777215,10027008},{16711680,16777215,16776960,10027008})}

//skel VARIAVEL zBlkPrd = {|nPcod| se_prod->(dbseek(nPcod)), se_prod->pdesc }
//skel VARIAVEL zBlkCli = {|nCli| if(fgdev$"DTE".and.fCodOp<>'1.918', sccpfor->(DbGoto(nCli),cp_nome), sccrcli->(DbGoto(nCli),cr_nome) ) }
//skel VARIAVEL zBlEnter={||vb_venda(fTipoDig,,.t.,,,"/ALTERARPN/"),eVal(zbOpenAll)}
//skel VARIAVEL zBlkDelete={||ALERT("Deseja cancelar a Ordem de Devolucao ?",{"1.Sim","2.Nao"})=1.and.(RegLock(),_FIELD->FG_FAT:="C", DBCOMMIT(), DBUNLOCK(), ALERT("Ordem de Devolucao CANCELADA"),.t.)}

//skel VARIAVEL zBlMarca={|| RegLock(), _field->fMarca:=if(EMPTY(fMarca), "S", ""), DBCOMMIT(), DBUNLOCK(), d_ob:Refresh(.f.) }

d_ob:lEditable = .t.

oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,5,64,64)

hwg_TbMt(oToolbar,'13;GravaDevolucao(fNumPed,d_ob,sf_pn->(Recno()));Enter-Seleciona ;Enter-Informa quantidades devolvidas;enter.ico;;;Lucida Bright;-11;&Dev.Itens;;;')
hwg_TbMt(oToolbar,'65;eVal(zBlEnter);A-Altera ;A-Altera Itens do Pedido de Devolucao;alterar.ico;;;;;&A-Altera;;;')
hwg_TbMt(oToolbar,'7;Eval(zBlkDelete);Del-Exclui ;Del-Apaga pedido de Devolucao/Recolhimento;deletar.ico;;;;;Del-Exclui;;;')
hwg_TbMt(oToolbar,'73;StartLocacao("Prt_Itens_A_Ser_Devolvidos",fNumPed);I-Imprime;I-Imprime pedido de Recolhimento/Devolucao;impressora.ico;;;;;&I-Imprime;;;')
hwg_TbMt(oToolbar,'84;StartLocacao("Prt_Itens_A_Ser_Devolvidos_Distribuidos",fNumPed);I-Digitacao;I-Imprime digitacao do pedido de Recolhimento/Devolucao;impressora.ico;;;;;&T-Digitacao;;;')
hwg_TbMt(oToolbar,'69;GeraRom(.f.);E-Entrega;E-Gera romaneio de carga/Entrega com o pedido de devolucao;transportador.ico;;;;;&E-Entrega;;;')

//hwg_Btn(oToolbar,400)
//hwg_TbMt(oToolbar,"0;;;espaco;espaco;")
//hwg_TbMt(oToolbar,"0;;;espaco;espaco;")
hwg_TbMt(oToolbar,'27;hwg_oDlgKey(oDlg, 27, nBrwAtivo);Saida;Saida;xml\icon\sair.ico;;;Lucida Bright;-14;<Esc>Saida;')

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,620,1020,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{640,160,0}</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{3,81,1014,198}</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="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, 'Data;FDATAEMI;D;99.99.99;8;N;')
hwg_TbFi(D_oB, 'CodCli;fCli;N;999999; 6;S;')
hwg_TbFi(D_oB, 'RazSoc;eVal(zBlkCli,fCli);C;@S20;20;;')
hwg_TbFi(D_oB, 'ValorBens;Fval;N;@E 999999.99; 9;N;')
hwg_TbFi(D_oB, 'Marca;fMarca;C;@S5;1;S;')
hwg_TbFi(D_oB, 'Pedido;fnumped;N;999999;  6;N;bCor;')
hwg_TbFi(D_oB, 'Fp;FTIPOVEN;C;9;2;N;')
hwg_TbFi(D_oB, 'c.Vd;FVENDEDOR;N;9999;4;N;')

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.,"SF_PN",.F.,.T.,{||.T.} }
d_ob:bEdit    := {|D_oB| .t.}

aAdd(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})]]>
    </method>
    <method name="onPaint">
      <![CDATA[SETFOCUS(d_Ob) ]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{3,314,1014,274}</property>
      <property name="Name">[oBrwItens]</property>
      <property name="Anchor">11</property>
      <property name="font">
        <font name="Arial" width="0" height="-13" weight="400"/>
      </property>
      <property name="TabIndex">6</property>
    </style>
    <method name="onInit">
      <![CDATA[oBrwItens:Alias := 'sf_pnmv'
oBrwItens:bColorSel:= RGB(3,23,133)
oBrwItens:tColorSel:= RGB(255,255,255)
DbSelectArea( 'sf_pnmv' )
hwg_TbFi(@oBrwItens, 'Prod;Cod;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Descricao;eVal(zBlkPrd,Cod);C;@S35;35;;')
hwg_TbFi(@oBrwItens, 'Quant;Quant;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Devolvida;mqDevol;N;999999.99;9;S;')

hwg_TbFi(@oBrwItens, 'Aditivo;pfnum;N;9999999999;10;N;')
hwg_TbFi(@oBrwItens, 'Data_Adit;pDataEnt;D;99.99.9999;10;N;')

hwg_TbFi(@oBrwItens, 'DiasPendentes;pDiasLoca;N;999;13;;')
hwg_TbFi(@oBrwItens, 'Locacao_Mes;pValLoca;N;999999.99;11;;')
hwg_TbFi(@oBrwItens, 'Valor_Pecas;PrTotal;N;999999.99;12;;')

oBrwItens:lFilter := .T.
oBrwItens:bFirst := {|| sf_pnmv->( DBSEEK( sf_pn->fNumPed, .F. ) ) } 
oBrwItens:bLast  := {|| sf_pnmv->( DBSEEK( sf_pn->fNumPed , .F., .T. ) ) }
oBrwItens:bWhile := {|| sf_pnmv->fNumPed = sf_pn->fNumPed }
oBrwItens:Refresh()
DbSelectArea( 'sf_pn' )
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{509,0,361,73}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[Ordens de Devolucao / Recolhimento Pendentes]</property>
      <property name="Justify">[Right]</property>
      <property name="Anchor">9</property>
      <property name="TextColor">10485760</property>
      <property name="font">
        <font name="Arial" width="0" height="-29" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{2,285,439,26}</property>
      <property name="Name">[oLabel2]</property>
      <property name="Caption">[Produtos Locados na Obra do Pedido Selecionado]</property>
      <property name="VAlignment">[Bottom]</property>
      <property name="Anchor">11</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="400"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{555,284,207,27}</property>
      <property name="Name">[oButtonex1]</property>
      <property name="Caption">[Marcar p/ Gerar Conferente]</property>
      <property name="Anchor">11</property>
      <property name="ToolTip">
[Marca ordem de devolucao para geracao de conferentes &quot;CEGOS&quot; para uso na recepcao]      </property>
      <property name="TabIndex">9</property>
    </style>
    <method name="onClick">
      <![CDATA[//
EVAL(zblMarca)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{770,284,246,27}</property>
      <property name="Name">[oButtonex2]</property>
      <property name="Caption">[Imprimir Conferente Ref. Marcados]</property>
      <property name="Anchor">11</property>
      <property name="ToolTip">
[Marca ordem de devolucao para geracao de conferentes &quot;CEGOS&quot; para uso na recepcao]      </property>
      <property name="TabIndex">9</property>
    </style>
    <method name="onClick">
      <![CDATA[StartLocacao("Prt_ConfCego_Itens_A_Ser_Devolvidos",fNumPed)]]>
    </method>
  </part>
</part>
