<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{514,105,1020,650}</property>
    <property name="Name">[SF_NFE.scr]</property>
    <property name="Caption">[(&quot;Relacao de &quot;+wTipoDoc+&quot; pendentes&quot;)]</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 zBlNom = {|xVnd| sf_vend->(dbgoto(xVnd)), sf_vend->nome }
//skel VARIAVEL zBlkPrd = {|nPcod| se_prod->(dbseek(nPcod)), se_prod->pdesc }
////skel VARIAVEL zBlkCli = {|nCli| if(fgdev$"DTE", sccpfor->(DbGoto(nCli),cp_nome), sccrcli->(DbGoto(nCli),cr_nome) ) }
//skel VARIAVEL zBlkCli = {|nCli| sccrcli->(DbGoto(nCli),cr_nome) }

//skel VARIAVEL znAzul0:=16711680
//skel VARIAVEL znAzul1:=10027008
//skel VARIAVEL zAzul2:=16776960
//skel VARIAVEL zW:=16777215
//skel VARIAVEL zBlack:=0
//skel VARIAVEL zRed:=255
//skel VARIAVEL zGreen:=32768
//skel VARIAVEL znCinza:=8421504
//skel VARIAVEL zYellow:=65535
//skel VARIAVEL bCor = {|| IF(IF(DAY(fPrevEnt)>0,fPrevEnt,fBomPara)<s_datual,{zRed,zW,zW,zRed},if(IF(DAY(fPrevEnt)>0,fPrevEnt,fBomPara)=s_datual,{znAzul0,zW,zW,znAzul0},{zBlack,zW,zW,zBlack}) ) }

oContextMenu:=Hwg_ContextMenu()
// hwg_Btn(oToolbar,5,5,188,70)
// hwg_Btn(oToolbar,540,10,150,70)
//----Édrick  hwg_TbMt(oToolbar,'32;AcaoPrevenda("EXIBIR_E_INCLUIR");Enter-Processar ;Enter-Processa prevenda selecionada;;;;Lucida Bright;-14;<Barra>Processa;')
//----Édrick  hwg_TbMt(oToolbar,'7;AcaoPrevenda("APAGAR");DEL-Cancelar ;DEL-Cancela prevenda;;;;Lucida Bright;-14;<Del>Deleta;')
// hwg_Btn(oToolbar,720,,120,70)
// hwg_TbMt(oToolbar,'27;hwg_oDlgKey(oDlg, 27, nBrwAtivo);Saida;Saida;xml\icon\sair.ico;;;Lucida Bright;-14;<Esc>Saida;')
//hwg_Btn(oToolbar,870,100,70,24)
//hwg_TbMt(oToolbar,'27;hwg_oDlgKey(oDlg, 27, nBrwAtivo);Saida;Saida;sembitmap;;;Lucida Bright;-10;&Esc-Sai;')
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() 
wfgfat:='1']]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <method name="onDlgExit">
    <![CDATA[DBCLOSEALL()
RETURN .t.]]>
  </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">{5,130,999,276}</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="TabIndex">4</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[nBrwAtivo:=1]]>
    </method>
    <method name="onPosChange">
      <![CDATA[oBrwItens:Refresh()
// oBrwDups: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, 'Pedido;fnumped;N;999999;6;N;bCor;')
se fieldpos('fidcaixa')>0 entao hwg_TbFi(D_oB, 'IdCaixa;fIdCaixa;C;@S20;20;S;bCor;')
hwg_TbFi(D_oB, 'L/V;if(fgDev="E","OrdProd",if(flocacao="S","Locacao",if(fgDev="U","Ent.Fut","Venda")));P;@S7;7;N;bCor;')
hwg_TbFi(D_oB, 'CodCli;fCli;N;999999; 6;S;bCor;')
hwg_TbFi(D_oB, 'RazSoc;eVal(zBlkCli,fCli);C;@S20;20;N;bCor;')
hwg_TbFi(D_oB, 'DataPed;FDATAEMI;D;99.99.99;8;N;bCor;')
hwg_TbFi(D_oB, 'PrevEntr;if(Day(fPrevEnt)>0,fPrevEnt,if(day(FBOMPARA)=0,FDATAEMI,FBOMPARA));P;99.99.99;8;S;bCor;')
hwg_TbFi(D_oB, 'DiasEnt;Str(Abs(if(day(FBOMPARA)=0,FDATAEMI,FBOMPARA)-date()),6)+"d "+if(if(day(FBOMPARA)=0,FDATAEMI,FBOMPARA)>date(),"AV","VC");P;@S10;10;N;bCor;')
hwg_TbFi(D_oB, '%Val_Reserv;PnDisponivel(fNumPed,@zqEmCasa,@zValEmCasa,@zqReservadas,@zValReservadas,@zqFaturadas,@zValFaturadas,@zqPedidas,@zValPedidas);P;@E 999.99%;8;N;')
hwg_TbFi(D_oB, '%Com_Est;if(zValPedidas>0,100*zValEmCasa/zValPedidas,0);P;@E 999.99%;8;N;')
hwg_TbFi(D_oB, '%Env.Fat;if(zValPedidas>0,100*zValFaturadas/zValPedidas,0);P;@E 999.99%;7;N;')
// hwg_TbFi(D_oB, 'VlrFaturadas;zValFaturadas;P;@E 999999.99;9;N;')
hwg_TbFi(D_oB, 'Fp;FTIPOVEN;C;9;2;N;')
hwg_TbFi(D_oB, 'c.Vd;FVENDEDOR;N;9999;4;N;')
hwg_TbFi(D_oB, 'Vendedor;eval(zBlNom,FVENDEDOR);C;@S15;15;N;') 
//hwg_TbFi(D_oB, 'QtdPedida;zqPedidas;P;@E 999999.99;9;N;')
//hwg_TbFi(D_oB, 'QtdReserv;zqReservadas;P;@E 999999.99;9;N;')
//hwg_TbFi(D_oB, 'QtdComEst;zqEmCasa;P;@E 999999.99;9;N;')
//hwg_TbFi(D_oB, 'QtdFaturadas;zqFaturadas;P;@E 999999.99;9;N;')
//hwg_TbFi(D_oB, 'VlPedido;zValPedidas;P;@E 999999.99;9;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_FATP",.F.,.T.,{||.T.} }
// d_ob:bEdit    := {|D_oB| .t.}

D_oB:lFilter := .T.
D_oB:bFirst := {|| sf_fatp->( DBSEEK( w_chave, .F. ) ) }
D_oB:bLast  := {|| sf_fatp->( DBSEEK( w_chave, .F., .T. ) ) }
D_oB:bWhile := {|| .not.eval(w_block) }

aAdd(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})

oDlg:MAXIMIZE()]]>
    </method>
    <method name="onPaint">
      <![CDATA[SETFOCUS(d_Ob) ]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{9,415,995,168}</property>
      <property name="Name">[oBrwItens]</property>
      <property name="Anchor">14</property>
      <property name="font">
        <font name="Arial" width="0" height="-13" weight="400"/>
      </property>
      <property name="TabIndex">6</property>
    </style>
    <method name="onUpdate">
      <![CDATA[d_ob:Refresh() ]]>
    </method>
    <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, 'Pedida;Quant;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Glb_Estoq;se_prod->pEatual;P;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'Glb_Reserv;se_prod->pComprom;P;9999999.99;10;;')
hwg_TbFi(@oBrwItens, 'Glb_Livres;(se_prod->pEatual-se_prod->pComprom);P;9999999.99;10;;')
hwg_TbFi(@oBrwItens, 'Ja_Reserv;mqReserv;N;999999.99;9;S;')
hwg_TbFi(@oBrwItens, 'Qtd_Pendente;Quant-mqReserv;P;999999.99;9;S;')
hwg_TbFi(@oBrwItens, 'Env.Fat;mqAtend;N;999999.99;9;N;')
hwg_TbFi(@oBrwItens, 'A Env.Fat;Quant-mqAtend;P;999999.99;9;N;')
oBrwItens:lFilter := .T.
oBrwItens:bFirst := {|| sf_pnmv->( DBSEEK( Sf_FatP->fNumPed, .F. ) ) } 
oBrwItens:bLast  := {|| sf_pnmv->( DBSEEK( Sf_FatP->fNumPed , .F., .T. ) ) }
oBrwItens:bWhile := {|| sf_pnmv->fNumPed = Sf_FatP->fNumPed }
oBrwItens:Refresh()
DbSelectArea( 'Sf_FatP' )
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{7,100,194,26}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[Prenotas Pendentes]</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">{105,11,89,79}</property>
      <property name="Name">[oButtonex1]</property>
      <property name="Caption">[&amp;2. Retornar ao DESPACHO]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Retorna DAV para despacho]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[PnEnviarRetirarDaProducao(FnumPed, 'C', 'D', @D_oB)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{288,11,89,79}</property>
      <property name="Name">[oButtonex5]</property>
      <property name="Caption">[&amp;6.Insumos PEDIDO]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Exibe os insumos DAV]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes(,,"PN",fNumPed) ]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{14,11,89,79}</property>
      <property name="Name">[oButtonex6]</property>
      <property name="Caption">[&amp;1. Enviar para Faturamento]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Envia para faturamento]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[PnRefOS(fNumPed, fLocacao)
//reglock()
//_FIELD->FG_FAT:=if(flocacao="S","3","2")
//DBCOMMIT()
//DBUNLOCK()
//ALERT("A PRENOTA FOI ENVIADA PARA SETOR DE EXPEDICAO DE "+IF(flocacao="S","LOCACOES","VENDAS") )
//D_OB:Refresh()
//oBrwItens:Refresh()
]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{800,11,89,79}</property>
      <property name="Name">[oButtonex2]</property>
      <property name="Caption">[Esc - Sair]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Esc para sair.]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[hwg_oDlgKey(oDlg, 27, nBrwAtivo)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{479,11,89,79}</property>
      <property name="Name">[oButtonex3]</property>
      <property name="Caption">[&amp;7.Reservar Estoque]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Exibe os insumos DAV]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("reservar_estoque",,"PN",fNumPed)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{574,11,89,79}</property>
      <property name="Name">[oButtonex7]</property>
      <property name="Caption">[&amp;8.Informar Producao]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Exibe os insumos DAV]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("informar_producao",,"PN",fNumPed)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{670,11,89,79}</property>
      <property name="Name">[oButtonex4]</property>
      <property name="Caption">[&amp;9.Encerrar OrdProd]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">
[Forca o encerramento da ordem de producao independente de que a mesma esteja concluida ou nao]      </property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[BrwComposicoes("marcar_conclusao_forcada_da_ordprod",,"PN",fNumPed)]]>
    </method>
  </part>
</part>
