<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{314,105,1015,598}</property>
    <property name="Name">[vb_movro_quitar.scr]</property>
    <property name="Caption">[Exibicao de Romaneio]</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("vb_movro"))
//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 zbIsGed := {|nCli,cTipoEnc,nfNum,nFnumPed|sccrcli->(DbGoTo(nCli),Ged_Files("locacao",if(cTipoEnc="DV","RECIBODEV","ADITIVO"),Cr_Cgc,nfNum,nfNumPed))}
//skel variavel zbGetGed:={|nCli,cTipoEnc,nfNum,nFnumPed|sccrcli->(DbGoTo(nCli),Ged_Digitaliza("locacao",if(cTipoEnc="DV","RECIBODEV","ADITIVO"),cr_cgc,nfNum,nfNumPed)),d_ob:Refresh(),.t.}
//skel variavel zbAlteraGed:={|nCli,cTipoEnc,nfNum,nFnumPed|sccrcli->(DbGoTo(nCli),Ged_Digitaliza("locacao","ZOOM"+if(cTipoEnc="DV","RECIBODEV","ADITIVO"),cr_cgc,nfNum,nfNumPed))}
//skel variavel zbHideShow:={|cTipoEnc| If(cTipoEnc="DV", (oJpgAditivo:Hide(),oJpgRECIBODEV:Show()), (oJpgRECIBODEV:Hide(),oJpgAditivo:Show()) )}
//skel variavel zbShowGed:={|nCli,cTipoEnc,nfNum,nFnumPed|eVal(zbHideShow,cTipoEnc),sccrcli->(DbGoTo(nCli), Ged_ShowJpg("locacao",if(cTipoEnc="DV","RECIBODEV","ADITIVO"),cr_cgc,nfNum,nfNumPed))}
//skel variavel zbQuita:={|nCli,cTipoEnc,nfNum,nFnumPed| (cTipoEnc<>"DV".or.StartLocacao("Get_Itens_Devolvidos",nfNumPed)) .and. eVal(zbGetGED,nCli,cTipoEnc,nfNum,nFnumPed) }
//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()),'')

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

// hwg_TbMt(oToolbar,' 13;eVal(zbQuita,fcli,ftipoenc,fnum,fnumped);Enter-Digitaliza ;Enter - Digitaliza recibo de entrega;scanner.ico;;;;;&Digitaliza;;;')
// 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_Btn(oToolbar,10,544,70,24)
//hwg_TbMt(oToolbar,' 13;eVal(zbGetGED,fcli,ftipoenc,fnum,fnumped);Enter-Digitaliza ;Enter - Digitaliza recibo de entrega;sembitmap;;;Lucida Bright;-11;&Digitaliza;;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()

DbGoTop()
d_ob:Refresh()
// MoveWindow(oDlg:Handle, 0,0,1024,662)
// MoveWindow(oContainer2:Handle, oContainer1:nLeft,oContainer1:nTop,oContainer1:nWidth,oContainer1:nHeight)
IF fTipoEnc="DV"
   oContainer2:Show()
   oContainer1:Hide()
   oBrwPnMv:Refresh()
ELSE
   oContainer2:Hide()
   oContainer1:Show()
   oBrwMovNf:Refresh()
endif
EVAL(zbShowGed,fcli,ftipoenc,fnum,fnumped)]]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <part class="status">
    <style>
      <property name="Geometry">{0,568,1015,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{608,152,0}</property>
    </style>
  </part>
  <part class="bitmap">
    <style>
      <property name="Geometry">{214,0,108,78}</property>
      <property name="Name">[oJpgAditivo]</property>
      <property name="Bitmap">[icon\sem_aditivo.jpg]</property>
      <property name="ToolTip">
[Clique para Digitalizar Aditivo / Comprovante de Recebimento]      </property>
    </style>
    <method name="onClick">
      <![CDATA[EVAL(zbGetGED,fcli,ftipoenc,fnum,fnumped)]]>
    </method>
  </part>
  <part class="bitmap">
    <style>
      <property name="Geometry">{354,0,108,78}</property>
      <property name="Name">[oJpgRECIBODEV]</property>
      <property name="Bitmap">[icon\sem_aditivo.jpg]</property>
      <property name="ToolTip">
[Clique para Digitalizar Aditivo / Comprovante de Recebimento]      </property>
    </style>
    <method name="onClick">
      <![CDATA[EVAL(zbGetGED,fcli,ftipoenc,fnum,fnumped)]]>
    </method>
  </part>
  <part class="container">
    <style>
      <property name="Geometry">{5,335,1008,209}</property>
      <property name="Name">[oContainer1]</property>
      <property name="Anchor">6</property>
      <property name="TabIndex">0</property>
    </style>
    <part class="browse">
      <style>
        <property name="Geometry">{10,355,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( vb_movro->fNum, .F. ) ) } 
oBrwMovNf:bLast  := {|| se_movnf->( DBSEEK( vb_movro->fNum, .F., .T. ) ) }
oBrwMovNf:bWhile := {|| vb_movro->fTipoEnc<>'DV'.and.se_movnf->mfnum = vb_movro->fNum}
oBrwMovNf:Refresh()
DbSelectArea( 'vb_movro' )
]]>
      </method>
    </part>
    <part class="label">
      <style>
        <property name="Geometry">{10,336,182,19}</property>
        <property name="Name">[oLabel2]</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="container">
    <style>
      <property name="Geometry">{5,335,1008,209}</property>
      <property name="Name">[oContainer2]</property>
      <property name="Anchor">6</property>
      <property name="TabIndex">0</property>
    </style>
    <part class="browse">
      <style>
        <property name="Geometry">{11,355,996,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, 'Devol;mQdevol;N;999999;6;;')
hwg_TbFi(@oBrwPnMv, 'Adit;pfnum;N;999999999;9;;')
hwg_TbFi(@oBrwPnMv, 'Valor;PrTotal;N;999999.99;9;;')

hwg_TbFi(@oBrwPnMv, 'Dias;pDiasLoca;S;999;3;;')
hwg_TbFi(@oBrwPnMv, 'ValLoca;pValLoca;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( vb_movro->fNumPed, .F. ) ) } 
oBrwPnMv:bLast  := {|| sf_pnmv->( DBSEEK( vb_movro->fNumPed , .F., .T. ) ) }
oBrwPnMv:bWhile := {|| vb_movro->fTipoEnc='DV'.and.sf_pnmv->fNumPed = vb_movro->fNumPed }
oBrwPnMv:Refresh()
DbSelectArea( 'vb_movro' )
]]>
      </method>
    </part>
    <part class="label">
      <style>
        <property name="Geometry">{13,337,292,19}</property>
        <property name="Name">[oLabel3]</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="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"
   oContainer2:Show()
   oContainer1:Hide()
   oBrwPnMv:Refresh()
ELSE
   oContainer2:Hide()
   oContainer1:Show()
   oBrwMovNf:Refresh()
endif
EVAL(zbShowGed,fcli,ftipoenc,fnum,fnumped)]]>
    </method>
    <method name="onInit">
      <![CDATA[   hwg_TbFi(@D_oB,'tr;if(fTipoEnc="AV","Avulso",if(fTipoEnc="VD","Entrega","Devolucao"));P;@S9;9;N;')
   hwg_TbFi(@D_oB,'Hora  Cx;left(FHORA,5)+" "+StrZero(si_caixa,2);C;@S8;8;N;')
   hwg_TbFi(@D_oB,'Bairro;CR_BAIRRO;C;@S15;15;N;')
   hwg_TbFi(@D_oB,'Cliente/Motivo;cr_nome;C;@S30;30;N;')
   if sys_segmento='locacao'
      hwg_TbFi(@D_oB,'Situacao Recibo;IF(fTipoEnc="AV","Avulso",if( eVal(zbIsGed,fCli,fTipoEnc,fNum,fNumPed), "DIGITALIZADO", "NAO_DIGITALIZADO") );P;@S16;16;N;')
      hwg_TbFi(@D_oB,'Pedido;fnumped;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.,"vb_movro",.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">{460,5,415,68}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[Itens do Romaneio]</property>
      <property name="Justify">[Right]</property>
      <property name="TextColor">16711680</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">5</property>
    </style>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{323,0,30,20}</property>
      <property name="Name">[oButtonex1]</property>
      <property name="Caption">[S]</property>
      <property name="Bitmap">[icon\scanner.ico]</property>
      <property name="ToolTip">[Re-scanear Aditivo]</property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onClick">
      <![CDATA[EVAL(zbAlteraGED,fcli,ftipoenc,fnum,fnumped)]]>
    </method>
  </part>
</part>
