<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{309,46,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 bCor = {|| if(fSubsidio>0, {16777215,255,16777215,10027008},{16711680,16777215,16776960,10027008})}
//skel VARIAVEL zBlNom = {|xVnd| sf_vend->(dbgoto(xVnd)), sf_vend->nome }
//skel VARIAVEL zBlkPrd = {|nPcod| se_prod->(dbseek(nPcod)), se_prod->pdesc }
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,638,466}</property>
      <property name="Name">[D_oB]</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, 'Prevenda;fnumped;N;999999;  6;N;bCor;')
hwg_TbFi(D_oB, '%Conc;70;P;@E 999.99%;7;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, 'Data;FDATAEMI;D;99.99.99;8;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.},})]]>
    </method>
    <method name="onPaint">
      <![CDATA[SETFOCUS(d_Ob) ]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{648,130,366,337}</property>
      <property name="Name">[oBrwItens]</property>
      <property name="Anchor">9</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_davmv'
oBrwItens:bColorSel:= RGB(3,23,133)
oBrwItens:tColorSel:= RGB(255,255,255)
DbSelectArea( 'sf_davmv' )
hwg_TbFi(@oBrwItens, 'Prod;Cod;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Descricao;eVal(zBlkPrd,Cod);C;@S15;15;;')
hwg_TbFi(@oBrwItens, 'Quant;Quant;N;999999;6;;')
// hwg_TbFi(@oBrwItens, 'Prontas;PrTotal;N;999999.99;9;;')
// hwg_TbFi(@oBrwItens, 'Pendentes;PrTotal;N;999999.99;9;;')
// hwg_TbFi(@oBrwItens, 'Faturadas;PrTotal;N;999999.99;9;;')
// hwg_TbFi(@oBrwItens, 'A Faturar;PrTotal;N;999999.99;9;;')
oBrwItens:lFilter := .T.
oBrwItens:bFirst := {|| sf_davmv->( DBSEEK( Sf_FatP->fNumPed, .F. ) ) } 
oBrwItens:bLast  := {|| sf_davmv->( DBSEEK( Sf_FatP->fNumPed , .F., .T. ) ) }
oBrwItens:bWhile := {|| sf_davmv->fNumPed = Sf_FatP->fNumPed }
oBrwItens:Refresh()
DbSelectArea( 'Sf_FatP' )
]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{649,498,365,99}</property>
      <property name="Name">[oBrwDups]</property>
      <property name="Anchor">9</property>
      <property name="font">
        <font name="Arial" width="0" height="-21" weight="400"/>
      </property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onInit">
      <![CDATA[oBrwDups:Alias := 'sf_davpc'
oBrwDups:bColorSel:= RGB(3,23,133)
oBrwDups:tColorSel:= RGB(255,255,255)
DbSelectArea( 'sf_davpc' )
hwg_TbFi(@oBrwDups, 'Td;cr_tip_dup;C;XXX;3;;')
hwg_TbFi(@oBrwDups, 'Valor;cr_valor;N;999999.99;9;;')
hwg_TbFi(@oBrwDups, 'BomPara;(s_datual+fPrazo);P;99.99.9999;10;;')
oBrwDups:lFilter := .T.
oBrwDups:bFirst := {|| sf_davpc->( DBSEEK( Sf_FatP->fNumPed, .F. ) ) } 
oBrwDups:bLast  := {|| sf_davpc->( DBSEEK( Sf_FatP->fNumPed , .F., .T. ) ) }
oBrwDups:bWhile := {|| sf_davpc->fNumPed = Sf_FatP->fNumPed }
oBrwDups:Refresh()
DbSelectArea( 'Sf_FatP' )
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{7,100,520,26}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[(wTipoDoc+&quot;s pendentes&quot;)]</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="label">
    <style>
      <property name="Geometry">{648,100,208,26}</property>
      <property name="Name">[oLabel2]</property>
      <property name="Caption">[Produtos do DAV]</property>
      <property name="VAlignment">[Bottom]</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="label">
    <style>
      <property name="Geometry">{649,473,213,26}</property>
      <property name="Name">[oLabel3]</property>
      <property name="Caption">[Formas de Pagamento]</property>
      <property name="VAlignment">[Bottom]</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 DAV para 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[reglock()
_FIELD->FG_FAT:="N"
DBCOMMIT()
DBUNLOCK()
ALERT("O DAV FOI DESPACHADO PARA A AREA DE DESPACHO")
D_OB:Refresh()
]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{196,11,89,79}</property>
      <property name="Name">[oButtonex2]</property>
      <property name="Caption">[&amp;3. Alterar DAV]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Altera a DAV]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoPrevenda("EXIBIR_E_INCLUIR")]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{287,11,89,79}</property>
      <property name="Name">[oButtonex3]</property>
      <property name="Caption">[&amp;4. Cancelar DAV]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Cancela a DAV]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoPrevenda("APAGAR")]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{378,11,89,79}</property>
      <property name="Name">[oButtonex4]</property>
      <property name="Caption">[&amp;5. Imprimir DAV]</property>
      <property name="WordWrap">.T.</property>
      <property name="ToolTip">[Imprime a DAV]</property>
      <property name="TabIndex">10</property>
    </style>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{469,11,89,79}</property>
      <property name="Name">[oButtonex5]</property>
      <property name="Caption">[&amp;6.Insumos DAV]</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(,,"DAV",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. Enivar 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[reglock()
_FIELD->FG_FAT:="2"
DBCOMMIT()
DBUNLOCK()
ALERT("O DAV FOI ENVIADO PARA SETOR DE FATURAMENTO")
D_OB:Refresh()
]]>
    </method>
  </part>
</part>
