<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{376,61,1022,598}</property>
    <property name="Name">[gera_re.scr]</property>
    <property name="Caption">[Gerar Romaneio de Entrega/Recolhimento]</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
//skel VARIAVEL znil:=(Abra ("0NOIDX", r_siga, "sf_pnmv", "sf_pnmv",  "sf_pnmv", "fnumped"), Abra ("0NOIDX",r_siga,"se_movnf","se_movnf","seim_f","mfnum"))
//skel VARIAVEL znil:=(Abra ("0NOIDX", r_siga, "se_prod", "se_prod",  "seip_c", "pcod"), DbSelectArea("gera_re"))
//skel VARIAVEL zTelaOrig := if(sGuiMode,'',SaveScreen(0,40,4,79))
//skel VARIAVEL zBlkPrd = {|nPcod| se_prod->(dbseek(nPcod)), se_prod->pdesc }
//skel variavel zBlCli := {|nCli| sccrcli->( if(nCli<>Recno(),DbGoTo(nCli),""), str(nCli,6)+"-"+cr_nome) }
//skel variavel zBlDadosAdic := #TEXTO_FONTE
//skel    Private zcor, zCli:=fCli,zr,zc,zn
//skel    SccrCli->(dbGoto(zCli))
//skel    zn:=if(ftipoenc=='AV', sccrcli->cr_nome, str(fcli,6)+"-"+cr_nome)
//skel    if !sGuiMode
//skel       (zcor:=SetColor('R/W'),zr:=row(),zc:=col(),Scroll(0,40,4,79,0),DispBox(0,40,4,79))
//skel       if ftipoenc=='AV'
//skel          (DevPos(0,42), DevOut("*SERVICO AVULSO*"))
//skel          (DevPos(2,42), DevOut("Ref.Cupom: "+str(fnumped,6)))
//skel       else
//skel          if sys_segmento<>"locacao"
//skel             ( DevPos(0,42) , DevOut("Pedido:" +str(fnumped,6)+" Valor: "+transform(fval,"@E 999,999.99")))
//skel          endif
//skel          ( DevPos(1,42) , DevOut("Cli: "+left(sccrcli->cr_tip_cli,1)+"."+left(zn,30)))
//skel          ( DevPos(2,42) , DevOut("P.Ref: "+left(sccrcli->cr_pontore,30)) )
//skel          ( DevPos(3,42) , DevOut("Fone: "+sccrcli->cr_fone) )
//skel       endif
//skel       ( SetColor(zcor), devpos(zr,zc) )
//skel    endif
//skel #FIM_TEXTO_FONTE
//skel COMANDO DEPOIS zNil:=if(sGuiMode,'',RestScreen(0,40,4,79,zTelaOrig))
//skel COMANDO SAIDA zNil:=if(Select('se_movnf')>0,se_movnf->(DbCloseArea()),'')
//skel COMANDO SAIDA zNil:=if(Select('sf_pnmv')>0,sf_pnmv->(DbCloseArea()),'')
//skel COMANDO SAIDA zNil:=if(Select('se_prod')>0,se_prod->(DbCloseArea()),'')

//skel VARIAVEL zbMarca:= {|| marca(d_ob), DobRefresh()}
//--skel VARIAVEL zbPrtRelat := {|| zrecn:=recno(), Relat('lst_exec("CR_RECFX")',"nb"), eVal(zbReopenAll), DbGoTo(zRecn) }
//--skel VARIAVEL zBlPrtContrato:={||zRecnBrw:=Recno(), m_fcli:=fCli, PrtFormRtf("locacao_autforn","doc",.f.), eVal(zBOpenAll) } 

d_ob:lEditable = .t.
oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,5,64,64)
hwg_TbMt(oToolbar,'22;tb_insert(D_OB);Ins-Inclui ;Ins-Inclui;cadastrar.ico;;;;;Inclui;;;')
hwg_TbMt(oToolbar,'80;tb_pesq(d_ob);P-Pesquisa ;P-Pesquisa na coluna do cursor;pesquisa.ico;;;;;&P-Pesquisa;;;')
hwg_TbMt(oToolbar,'7;CancelaOrdemEntrega();DEL-Entrega;DEL-Confirma que ja houve entrega no Balcao;deletar.ico;;;;;Del-Balcao;;;')

//--hwg_TbMt(oToolbar,"67;eVal(zBlPrtContrato);A-Contrato;A-Imprime autorizacao de Fornecimento;xml\icon\alterar.ico;;;;;&Contrato;;;")
//--hwg_TbMt(oToolbar,'73;eVal(zbPrtRelat);I-Carrego;I-Imprime o Conferente de Carrego e Viagem;impressora.ico;;;;;&I-Carrego;;;')
//--hwg_TbMt(oToolbar,'73;eVal(zbPrtRelat);V-Viagem;V-Imprime o Romaneio de Viagem;transportador.ico;;;;;&V-Viagem;;;')

hwg_Btn(oToolbar,10,544,70,24)
hwg_TbMt(oToolbar,'13;eVal(zbMarca);Enter-Seleciona ;Enter - Seleciona;sembitmap;;;Lucida Bright;-11;Seleciona;;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()

// MoveWindow(oDlg:Handle, 0,0,1024,662)
MoveWindow(oContainer2:Handle, oContainer1:nLeft,oContainer1:nTop,oContainer1:nWidth,oContainer1:nHeight)

IF fTipoEnc="DV"
   oContainer1:Show()
   oContainer2:Hide()
   oBrwPnMv:Refresh()
ELSE
   oContainer2:Show()
   oContainer1:Hide()
   oBrwMovNf:Refresh()
endif
]]>
  </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="container">
    <style>
      <property name="Geometry">{4,334,1007,212}</property>
      <property name="Name">[oContainer1]</property>
      <property name="TabIndex">0</property>
    </style>
    <part class="browse">
      <style>
        <property name="Geometry">{10,355,997,185}</property>
        <property name="Name">[oBrwPnMv]</property>
        <property name="Anchor">6</property>
        <property name="font">
          <font name="Arial" width="0" height="-13" weight="400"/>
        </property>
        <property name="TabIndex">6</property>
      </style>
      <method name="onInit">
        <![CDATA[oBrwPnMv:Alias := 'sf_pnmv'
oBrwPnMv:bColorSel:= RGB(3,23,133)
oBrwPnMv:tColorSel:= RGB(255,255,255)
DbSelectArea( 'sf_pnmv' )
hwg_TbFi(@oBrwPnMv, 'Prod;Cod;N;999999;6;;')
hwg_TbFi(@oBrwPnMv, 'Descricao;eVal(zBlkPrd,Cod);C;@S15;15;;')
hwg_TbFi(@oBrwPnMv, 'Quant;Quant;N;999999;6;;')
hwg_TbFi(@oBrwPnMv, 'Adit;pfnum;N;999999999;9;;')
hwg_TbFi(@oBrwPnMv, 'Valor;PrTotal;N;999999.99;9;;')
//hwg_TbFi(@oBrwPnMv, 'Glb_Estoq;se_prod->pEatual;P;999999.99;9;;')
//hwg_TbFi(@oBrwPnMv, 'Glb_Reserv;se_prod->pComprom;P;9999999.99;10;;')
//hwg_TbFi(@oBrwPnMv, 'Glb_Livres;(se_prod->pEatual-se_prod->pComprom);P;9999999.99;10;;')
//hwg_TbFi(@oBrwPnMv, 'Faturadas;mqAtend;N;999999.99;9;N;')
//hwg_TbFi(@oBrwPnMv, 'A Faturar;Quant-mqAtend;P;999999.99;9;N;')
oBrwPnMv:lFilter := .T.
oBrwPnMv:bFirst := {|| sf_pnmv->( DBSEEK( gera_re->fNumPed, .F. ) ) } 
oBrwPnMv:bLast  := {|| sf_pnmv->( DBSEEK( gera_re->fNumPed , .F., .T. ) ) }
oBrwPnMv:bWhile := {|| sf_pnmv->fNumPed = gera_re->fNumPed }
oBrwPnMv:Refresh()
DbSelectArea( 'gera_re' )
]]>
      </method>
    </part>
    <part class="label">
      <style>
        <property name="Geometry">{10,336,292,19}</property>
        <property name="Name">[oLdevol]</property>
        <property name="Caption">[Itens da Ordem de Devolucao/Recolhimento]</property>
        <property name="Anchor">6</property>
        <property name="TabIndex">7</property>
      </style>
    </part>
  </part>
  <part class="container">
    <style>
      <property name="Geometry">{1032,335,1012,212}</property>
      <property name="Name">[oContainer2]</property>
      <property name="TabIndex">0</property>
    </style>
    <part class="browse">
      <style>
        <property name="Geometry">{1035,356,997,185}</property>
        <property name="Name">[oBrwMovNf]</property>
        <property name="Anchor">6</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[oBrwMovNf:Alias := 'se_movnf'
oBrwMovNf:bColorSel:= RGB(3,23,133)
oBrwMovNf:tColorSel:= RGB(255,255,255)
DbSelectArea( 'se_movnf' )
hwg_TbFi(@oBrwMovNf, 'Prod;Pcod;N;999999;6;;;')
hwg_TbFi(@oBrwMovNf, 'Descricao;eVal(zBlkPrd,pcod);C;@S30;30;;')
hwg_TbFi(@oBrwMovNf, 'Quant;mQuant;N;@e 9999.999;8;;')
hwg_TbFi(@oBrwMovNf, 'Devol;mQdevol;N;@e 9999.999;8;;')
hwg_TbFi(@oBrwMovNf, 'Saldo;mQuant-mQdevol;P;@e 9999.999;8;;')
hwg_TbFi(@oBrwMovNf, 'Valor;mValor;N;999999.99;9;;')
hwg_TbFi(@oBrwMovNf, 'NCM;se_prod->pcodclafis;P;99999999;8;;')
hwg_TbFi(@oBrwMovNf, 'ST;se_prod->pCATEGORIA;P;XXX;3;;')
hwg_TbFi(@oBrwMovNf, 'Un;se_prod->pUNIDADE;P;XXX;3;;')
hwg_TbFi(@oBrwMovNf, 'Barra;se_prod->pdic6;P;9999999999999;13;;')
oBrwMovNf:lFilter := .T.
oBrwMovNf:bFirst := {|| se_movnf->( DBSEEK( gera_re->fNum, .F. ) ) } 
oBrwMovNf:bLast  := {|| se_movnf->( DBSEEK( gera_re->fNum, .F., .T. ) ) }
oBrwMovNf:bWhile := {|| gera_re->fNum<>0.and.se_movnf->mCodForC=gera_re->fCli .and. se_movnf->mfnum = gera_re->fNum}
oBrwMovNf:Refresh()
DbSelectArea( 'gera_re' )
]]>
      </method>
    </part>
    <part class="label">
      <style>
        <property name="Geometry">{1037,337,182,19}</property>
        <property name="Name">[oLentrega]</property>
        <property name="Caption">[Itens da Ordem de Entrega]</property>
        <property name="Anchor">6</property>
        <property name="TabIndex">7</property>
      </style>
    </part>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{10,77,1000,251}</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="onPosChange">
      <![CDATA[IF fTipoEnc="DV"
   oContainer1:Show()
   oContainer2:Hide()
   oBrwPnMv:Refresh()
ELSE
   oContainer2:Show()
   oContainer1:Hide()
   oBrwMovNf:Refresh()
endif

]]>
    </method>
    <method name="onInit">
      <![CDATA[   // hwg_TbFi(@D_oB,'Sel;if(reg_SEL="S","*"," ");C;!;1;N;')
   hwg_TbFi(@D_oB,'Sel;reg_SEL;C;XXX;3;N;')
   hwg_TbFi(@D_oB,'tr;if(fTipoEnc="AV","Avulso",if(fTipoEnc="VD","Entrega","Devolucao"));P;@S9;9;N;')
   hwg_TbFi(@D_oB,'Emissao;fDataEmi;D;99.99.99;8;N;')
   hwg_TbFi(@D_oB,'Hora  Cx;left(FHORA,5)+" "+StrZero(si_caixa,2);C;@S8;8;N;')
   hwg_TbFi(@D_oB,'Cliente/Motivo;eval(zBlCli,fCli);C;@S20;20;N;')
   hwg_TbFi(@D_oB,'Bairro;CR_BAIRRO;C;@S15;15;N;')
   if sys_segmento='locacao'
      hwg_TbFi(@D_oB,"NomeObra;vb_pref->(DbGoTo(gera_re->fObra),cr_fantasi);P;@s20;20;N;")
      hwg_TbFi(@D_oB,'Pedido;fnumped;N;999999;6;N;')
      hwg_TbFi(@D_oB,"Obra;fobra;N;999999;6;N;")
      hwg_TbFi(@D_oB,'Cfop;fCodOp;C;@S5;6;N;')
      hwg_TbFi(@D_oB,'t;fgdev;C;!;1;N;')
   else
      hwg_TbFi(@D_oB,'Cupom;fnumped;N;999999;6;N;')
      hwg_TbFi(@D_oB,'Valor;ftipoenc+str(fvAL,9,2);X;@s11;11;N;')
   endif
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.,"GERA_REA",.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">{410,0,459,68}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">
[Tecle ENTER sobre as ordens a lançar no romaneio, depois ESC]      </property>
      <property name="Justify">[Right]</property>
      <property name="TextColor">16711680</property>
      <property name="font">
        <font name="Arial" width="0" height="-29" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">5</property>
    </style>
  </part>
</part>
