<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{316,81,1030,649}</property>
    <property name="Name">[SF_NFE.scr]</property>
    <property name="Caption">[Relacao de Notas Geradas NFE]</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">[0 - No Border]</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
// oDlg:Move( , , MAX(798,GetDesktopWidth()*0.95), MAX(570,GetDesktopHeight()*0.90), 1 )
oDlg:CENTER()
//skel VARIAVEL zBlkCli = {|nCli| If(fgdev$"DTE", sccpfor->(DbGoto(nCli),cp_nome), sccrcli->(DbGoto(nCli),cr_nome) ) }
//skel VARIAVEL zBlkForn = {|nCli| sccpfor->(DbGoto(nCli)), sccpfor->cp_nome }
//skel VARIAVEL zBlkPrd = {|nPcod| se_prod->(dbseek(nPcod)), se_prod->pdesc }
//skel zFiltEmit = "Val(nfe_nprot)>0"
//skel VARIAVEL zBlU={|| DbSetFilter({||val(nfe_nprot)>0},"val(nfe_nprot)>0"), DbGoTop(), DobRefresh(d_ob) }
//skel VARIAVEL zBlV={|| DbSetFilter({||'Cancelament'$nfe_xmotiv},"'Cancelament'$nfe_xmotiv"), DbGoTop(), DobRefresh(d_ob)}
//skel VARIAVEL zBlV={|| DbSetFilter({||'Inutiliza'$nfe_xmotiv.and.'Autoriza'$nfe_xmotiv},"'Inutiliza'$nfe_xmotiv.and.'Autoriza'$nfe_xmotiv"), DbGoTop(), DobRefresh(d_ob)}
//skel VARIAVEL zBlX={|| DbSetFilter({||'Inutiliza'$nfe_xmotiv.and.!'Autoriza'$nfe_xmotiv},"'Inutiliza'$nfe_xmotiv.and.!'Autoriza'$nfe_xmotiv"), DbGoTop(), DobRefresh(d_ob)}
//skel VARIAVEL zBlZ={|| DbClearFilter(),DbGoTop(),DobRefresh(d_ob)}
//skel VARIAVEL zBlQ={||Zini:=s_df_ecfid+if(val(fmodelo)=65,"\nc","\nf")+StrZero(fnum,6)+".ini",WaitRun("%comspec% /c notepad "+zini)}

//skel VARIAVEL zBlW={|| DbSetFilter({||wfModelo=fmodelo.or.val(fmodelo)<10},"wfModelo=fmodelo.or.val(fmodelo)<10"), DbGoTop(), DobRefresh(d_ob)}

//skel VARIAVEL zBlRef = #TEXTO_FONTE
//skel    Private m_fnum:=sf_fatnf->fNum, m_fSerie:=sf_fatnf->fSerie, m_fModelo:=sf_fatnf->fModelo
//skel    (Abra ('0NOIDX', r_siga, 'nf_nfref', 'nf_nfref', 'nf_nfref', 'fmodelo+str(fnum,10)+fserie'), brow_db('NF_NFREF'), Nf_NfRef->(DbCloseArea()), DbSelectArea('sf_fatnf') )
//skel #FIM_TEXTO_FONTE

//skel VARIAVEL zBlCCe = #TEXTO_FONTE
//skel    Private zbOpenAll, m_fnum:=sf_fatnf->fNum, m_fSerie:=sf_fatnf->fSerie, m_fModelo:=sf_fatnf->fModelo, m_fChaveNfe:=sf_fatnf->fChaveNfe, m_fDataEmi:=sf_fatnf->fDataEmi, m_fHora:=sf_fatnf->fHora
//skel    zbOpenAll:={||Abra ('0NOIDX', r_siga, 'nf_cce', 'nf_cce', 'nf_cce', 'fmodelo+str(fnum,10)+fserie')}
//skel    eVal(zbOpenAll)
//skel    brow_db('NF_CCE',,,,,,,,zbOpenAll)
//skel    Nf_CCE->(DbCloseArea())
//skel    se select("sf_fatnf")>0 entao DbSelectArea("sf_fatnf")
//skel    // (Abra ('0NOIDX', r_siga, 'nf_cce', 'nf_cce', 'nf_cce', 'fmodelo+str(fnum,10)+fserie'), brow_db('NF_CCE'), Nf_CCE->(DbCloseArea()), DbSelectArea('sf_fatnf') )
//skel #FIM_TEXTO_FONTE

//skel variavel zProxNFCNFE:=0
//skel variavel zbProxNFCNFE:={|| if(val(wfModelo)=65, (oLabProxima:Title('Proxima NFC'),zProxNFCNFE:=SiSemaf("CAPTE_PROXIMO_NUMERO","/NFC/")), (oLabProxima:Title('Proxima NFE'),zProxNFCNFE:=SiSemaf("CAPTE_PROXIMO_NUMERO","/NFE/"))), oLabProxima:Refresh(),oProxNFCNFE:Refresh() }

//skel VARIAVEL zBdbGetCli  := {|nCli| if(sf_fatnf->fgdev$"DTE", sccpfor->(DbGet("SCCPFOR",2)), sccrcli->(DbGet("SCCRCLI",2))) }
//skel VARIAVEL zBdbGetProd := {|nPcod| SE_PROD->(DbGet("SE_PROD",2)) }

oContextMenu:=Hwg_ContextMenu()
//hwg_Btn(oToolbar,5,5,54,54)
hwg_Btn(oToolbar,11,45,54,54)
IF xGetEnv('GERA_NFC')='S' .AND. VAL(wfModelo)=65
   hwg_TbMt(oToolbar,'66;AcaoNaSelecaoNFE("NFE_CRIARNFC");N-Criar NFC;N-Criar NFC referente a venda;xml\icon\nfce_qr1.jpg;47;47;;')
ENDIF
IF VAL(wfModelo)<>65
   hwg_TbMt(oToolbar,'66;AcaoNaSelecaoNFE("Nfe_CriarLoteXml");B-Criar NFE;B-Cria NFE referente a venda;xml\icon\AssinarNfe.ico;47;47;;')
ENDIF
hwg_TbMt(oToolbar,'68;(AcaoNaSelecaoNFE("Nfe_EnviarNFE"),DobRefresh(d_ob));D-Enviar_NFE;D - Enviar_NFE;xml\icon\enviarnfe.ico;;;;;;;;')
hwg_TbMt(oToolbar,'0;;;espaco;espaco;')
hwg_TbMt(oToolbar,'67;AcaoNaSelecaoNFE("Nfe_ImprimirDanfe");C-Imprimir_DANFE ;C - Imprimir_DANFE;xml\icon\imprimenfe.ico;;;;;;;;')
hwg_TbMt(oToolbar,'74;AcaoNaSelecaoNFE("NFE_Email");J-Email_NFe ;J - Email_NFe;xml\icon\emailnfe.ico;;;;;;;;')
hwg_TbMt(oToolbar,'69;(AcaoNaSelecaoNFE("Nfe_ConsultarNFE"),DobRefresh(d_ob));E-Consulta_NFe ;E - Consulta_NFe na Base so SEFAZ;xml\icon\consultarnfe.ico;;;;;;;;')
hwg_TbMt(oToolbar,'0;;;espaco;espaco;')
hwg_TbMt(oToolbar,'70;(AcaoNaSelecaoNFE("Nfe_CancelarNFE"),DobRefresh(d_ob));F-Cancelar_NFe ;F - Cancelar_NFe na Base da SEFAZ;xml\icon\cancelarnfe.ico;;;;;;;;')
hwg_TbMt(oToolbar,'71;(AcaoNaSelecaoNFE("Nfe_InutilizarNFE"),DobRefresh(d_ob));G-Inutilizar_NFe ;G - Inutilizar_NFe na Base da SEFAZ;xml\icon\inutilizarnfe.ico;;;;;;;;')
hwg_TbMt(oToolbar,'70;(AcaoNaSelecaoNFE("ESTORNAR_NFE_CANC_FORA_PRAZO"),DobRefresh(d_ob));F-Estorna ;F - Gera Nota de Estorno ou Ajuste Ref. Cancelamento de NFe Fora do Prazo Permitido;deletar.ico;;;;;;;;')
hwg_TbMt(oToolbar,"81;eval(zBlQ);Q-Editar_Ini;Q-Editar_Ini;xml\icon\Q.ico;47;47;;")
hwg_TbMt(oToolbar,'0;;;espaco;espaco;')
hwg_TbMt(oToolbar,'80;tb_pesq(D_OB);P-Pesquisa ;P-Pesquisa;xml\icon\pesquisa.ico;;;;;;;;')
hwg_TbMt(oToolbar,'79;tb_index(D_OB);O-Ordena ;O - Ordena;xml\icon\ordenar.ico;;;;;;;;')
hwg_TbMt(oToolbar,'0;;;espaco;espaco;')
IF sys_segmento='locacao'
   hwg_TbMt(oToolbar,'82;AcaoNaSelecaoNFE("Nfe_DocLocacao");A-Contrato;A-Contrato;xml\icon\alterar.ico;47;47;;')
ENDIF

hwg_TbMt(oToolbar,'27;Eval(zBdbGetCli,SF_FATNF->fCli);FichaCli;Exibe/Altera dados da Ficha do Cliente da NFE;xml\icon\alterar.ico;;;Lucida Bright;-11;&5.FichaCli;;;')
hwg_TbMt(oToolbar,'27;Eval(zBdbGetProd,se_movnf->pCod);FichaProd;Exibe/Altera dados da Ficha do Produto Selecionado;xml\icon\alterar.ico;;;Lucida Bright;-11;&6.FichaProd;;;')
hwg_TbMt(oToolbar,'27;ci_MDFe("mdfe_criar_pela_nfe");GeraMDFe;Gera MDFe referente a nota selecionada;xml\icon\transportador.ico;;;Lucida Bright;-11;&7.geraMDFe;;;')

//hwg_TbMt(oToolbar,'27;Eval(zBdbGetCli,SF_FATNF->fCli);FichaCli;Exibe/Altera dados da Ficha do Cliente da NFE;sembitmap;;;Lucida Bright;-11;&5.FichaCli;;6;')
//hwg_TbMt(oToolbar,'27;Eval(zBdbGetProd,sf_pnmv->Cod);FichaProd;Exibe/Altera dados da Ficha do Produto Selecionado;sembitmap;;;Lucida Bright;-11;&6.FichaProd;;6;')

//skel VARIAVEL zbPrtDanfe:= {||z_recno:=Recno(), NFe_XmlToPdf(fChaveNfe), eVal(zbOpenAll) }
hwg_TbMt(oToolbar,'73;eVal(zbPrtDanfe);I-Danfe ;I-Imprime Copia do Danfe;impressora.ico;;;;;&I-Danfe;;;')

// hwg_TbMt(oToolbar,'66;tb_insert(D_OB);Reimportar NFE ;Reimportar NFE;;;')
// hwg_TbMt(oToolbar,'13;doget(D_ob);Enter-Editar ;Enter-Edita coluna;;;')
hwg_Btn(oToolbar,10,595,70,24)
hwg_TbMt(oToolbar,'27;Eval(zBlU);Emitidas;Exibe apenas notas emitidas;sembitmap;;;Lucida Bright;-11;&1.Emitidas;;6;')
hwg_TbMt(oToolbar,'27;Eval(zBlV);Canceladas;Exibe apenas notas Canceladas;sembitmap;;;Lucida Bright;-11;&2.Canceladas;;6;')
hwg_TbMt(oToolbar,'27;Eval(zBlX);Inutilizadas;Exibe apenas notas Inutilizadas;sembitmap;;;Lucida Bright;-11;&3.Inutilizadas;;6;')
hwg_TbMt(oToolbar,'27;Eval(zBlW);NF+NaoTrn;Exibe NF geradas juntamente com as nao transmitidas;sembitmap;;;Lucida Bright;-11;&4.NF+NaoTrans;;6;')
hwg_TbMt(oToolbar,'27;Eval(zBlZ);;Exibe apenas todas as notas;sembitmap;;;Lucida Bright;-11;&4.Todas;;6;')

hwg_TbMt(oToolbar,'0;;;espaco;espaco;')

hwg_Btn(oToolbar,,,100,24)
hwg_TbMt(oToolbar,'27;Eval(zBlCCe);Correcoes;Exibe Lancamentos de Correcoes da NFE;sembitmap;;;Lucida Bright;-11;&5.CCe-Correcoes;;6;')
hwg_TbMt(oToolbar,'27;Eval(zBlRef);Referenciadas;Exibe Notas Referenciadas da NFE;sembitmap;;;Lucida Bright;-11;&6.Referenciadas;;6;')

// hwg_Btn(oToolbar,21,558,70,70)
// hwg_TbMt(oToolbar,'0;;;espaco;espaco;')
// hwg_TbMt(oToolbar,'27;Eval(zBlU);Emitidas;Emitidas;xml\icon\nfe_enviadas.jpg;47;47;;;')
// hwg_TbMt(oToolbar,'27;Eval(zBlV);Canceladas;Canceladas;xml\icon\nfe_canceladas.jpg;47;47;;;')
// hwg_TbMt(oToolbar,'27;Eval(zBlX);Inutilizadas;Inutilizadas;xml\icon\nfe_inutilizadas.jpg;47;47;;;')
// hwg_TbMt(oToolbar,'27;Eval(zBlZ);Todas;Todas;xml\icon\nfe_todas.jpg;47;47;;;')

//hwg_TbMt(oToolbar,'27;hwg_oDlgKey(oDlg, 27, nBrwAtivo);Saida;Saida;xml\icon\saida.ico;28;28;;;;')
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()

EVAL(zbProxNFCNFE)

oBrwDups:Hide()

]]>
  </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,619,1030,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{640,160,0}</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{3,117,1025,263}</property>
      <property name="Name">[D_oB]</property>
      <property name="font">
        <font name="Arial" width="0" height="-13" weight="400"/>
      </property>
      <property name="Border">.F.</property>
      <property name="TabIndex">4</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[nBrwAtivo:=1]]>
    </method>
    <method name="onPosChange">
      <![CDATA[oBrwItens:Refresh()
oBrwDups:Refresh()
      // alert('definiu oBrwItens:alias '+oBrwItens:alias+' Sf_FatNf->fnum '+str(Sf_FatNf->fnum,6)+ ' oBrwItens:nColumns '+str(oBrwItens:nColumns,4) ) ]]>
    </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, 'NF;fnum;N;999999;6;'+IF(UserIsAdmin(),'S','N')+';')
hwg_TbFi(D_oB, 'Mod;fModelo;N;99;3;S;')
hwg_TbFi(D_oB, 'Valor;Transform(fval,"@E 999,999.99");C;XXXXXXXXXX;10;;')
hwg_TbFi(D_oB, 'DtEmis;fDataEmi;D;;8;;')
hwg_TbFi(D_oB, 'Prenota;fPrenota;N;99999999;8;N;')
hwg_TbFi(D_oB, 'Controle;fNumPed;N;99999999;8;;')
hwg_TbFi(D_oB, 'f;fg_fat;C;!;1;S;')
hwg_TbFi(D_oB, 'Sit;Cod_Sit;C;99;3;S;')
hwg_TbFi(D_oB, 'Status;nfe_xmotiv;C;@S10;10;S;')
hwg_TbFi(D_oB, 'CodCli;fCli;N;999999;  6;;')
hwg_TbFi(D_oB, 'RazSoc;eVal(zBlkCli,fCli);C;@S20;20;;')
hwg_TbFi(D_oB, '*;fgdev;C;X;3;S;')
hwg_TbFi(D_oB, 'CFOP;fcodop;C;XXXXX;5;;')
hwg_TbFi(D_oB, 'DtSaida;fDataSai;D;;8;N;')
hwg_TbFi(D_oB, 'nProt;nfe_nprot;C;@15;15;;')
hwg_TbFi(D_oB, 'Chave;fChaveNfe;C;@S44;44;;')
hwg_TbFi(D_oB, 'Serie;fSerie;C;999;3;;')
hwg_TbFi(D_oB, 'XML;nfe_xml;C;@S75;74;;')
hwg_TbFi(D_oB, 'Pedido;fNumPed;N;999999;6;S;')
hwg_TbFi(D_oB, 'Vend;fVendedor;N;9999;4;S;')
D_oB:Alias := alias()
DBGOBottom()
DbSkip( 0-D_oB:RowCount )
D_oB:bOther:={|o,m,wp,lp| MessagesBrowse(o,m,wp,lp)}
D_oB:cargo:={.T.,.T.,"SF_FATNF",.F.,.T.,{||.T.} }
aAdd(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})

// d_ob:bFor := {||fnum>0.AND.((VAL(wfModelo)=65 .AND. Val(fModelo)<>55) .OR. (val(wfModelo)<>65.and.Val(fModelo)<>65)) } ]]>
    </method>
    <method name="onPaint">
      <![CDATA[SETFOCUS(d_Ob)
      if( select("SF_FATNF")=0, eval(zbOpenAll), DbSelectArea("SF_FATNF") ) ]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{2,386,796,202}</property>
      <property name="Name">[oBrwItens]</property>
      <property name="Anchor">9</property>
      <property name="font">
        <font name="Arial" width="0" height="-11" weight="400"/>
      </property>
      <property name="Border">.F.</property>
      <property name="TabIndex">6</property>
    </style>
    <method name="onInit">
      <![CDATA[oBrwItens:Alias := 'se_movnf'
oBrwItens:bColorSel:= RGB(3,23,133)
oBrwItens:tColorSel:= RGB(255,255,255)
DbSelectArea( 'se_movnf' )
hwg_TbFi(@oBrwItens, 'Prod;Pcod;N;999999;6;;')
hwg_TbFi(@oBrwItens, 'Descricao;eVal(zBlkPrd,pcod);C;@S18;18;;')
hwg_TbFi(@oBrwItens, 'Quant;mQuant;N;@e 9999.999;8;;')
hwg_TbFi(@oBrwItens, 'PrcUnit;if(mQuant>0,mValor/mQuant,0);P;9999.99;8;;')
hwg_TbFi(@oBrwItens, 'ValTotal;mValor;N;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'S;MFGES;C;X;1;;')
hwg_TbFi(@oBrwItens, 'Cfop;pCfop;C;99999;5;S;')
hwg_TbFi(@oBrwItens, 'CST;cst_icms;C;999;3;S;')
hwg_TbFi(@oBrwItens, 'NCM;se_prod->pcodclafis;N;99999999;8;N;')
hwg_TbFi(@oBrwItens, 'CF;se_prod->pcategoria;C;XXX;3;N;')
hwg_TbFi(@oBrwItens, 'UN;se_prod->punidade;C;XXX;3;N;')
hwg_TbFi(@oBrwItens, 'Pr_Cheio;pVluVenda;N;99999.99;8;S;')
hwg_TbFi(@oBrwItens, 'PesoBru;se_prod->pPesoBru;P;9999999;7;S;')
hwg_TbFi(@oBrwItens, 'PesoLiq;se_prod->pPesoLiq;P;9999999;7;S;')
hwg_TbFi(@oBrwItens, 'CodBarra;se_prod->pdic6;N;99999999999999;14;N;')
// alert('vai definir filtros oBrwItens:alias '+oBrwItens:alias+' Sf_FatNf->fnum '+str(Sf_FatNf->fnum,6)+ ' oBrwItens:nColumns '+str(oBrwItens:nColumns,4) )
oBrwItens:lFilter := .T.
// oBrwItens:bFor := {|| Sf_FatNf->fnum<>0.AND.se_movnf->mData=Sf_FatNf->fDataSai.and.Sf_FatNf->fNumPed=se_movnf->fNumPed } 
oBrwItens:bFor := {|| Sf_FatNf->fnum<>0.AND.se_movnf->mData=Sf_FatNf->fDataRef.and.Sf_FatNf->fNumPed=se_movnf->fNumPed } 
oBrwItens:bFirst := {|| se_movnf->( DBSEEK( Sf_FatNf->fnum, .F. ) ) } 
oBrwItens:bLast  := {|| se_movnf->( DBSEEK( Sf_FatNf->fnum , .F., .T. ) ) }
oBrwItens:bWhile := {|| se_movnf->mfnum = Sf_FatNf->fnum }
oBrwItens:Refresh()
DbSelectArea( 'SF_FatNf' )
// alert('definiu oBrwItens:alias '+oBrwItens:alias+' Sf_FatNf->fnum '+str(Sf_FatNf->fnum,6)+ ' oBrwItens:nColumns '+str(oBrwItens:nColumns,4) )
]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{799,386,229,202}</property>
      <property name="Name">[oBrwDups]</property>
      <property name="Anchor">12</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 := 'sccrdup'
oBrwDups:bColorSel:= RGB(3,23,133)
oBrwDups:tColorSel:= RGB(255,255,255)
DbSelectArea( 'sccrdup' )
hwg_TbFi(@oBrwDups, 'Td;cr_tip_dup;C;XXX;3;;')
hwg_TbFi(@oBrwDups, 'Valor;cr_valor;N;999999.99;9;;')
hwg_TbFi(@oBrwDups, 'BomPara;CR_DT_VENC;P;99.99.9999;10;;')
oBrwDups:lFilter := .T.
oBrwDups:bFor   := {|| sccrdup->Cr_Dt_Emis=Sf_FatNf->fDataEmi.AND.Sf_FatNf->fNumPed=sccrdup->fNumPed } 
oBrwDups:bFirst := {|| sccrdup->( DBSEEK( StrZero(Sf_FatNf->fNumPed,6), .F. ) ) } 
oBrwDups:bLast  := {|| sccrdup->( DBSEEK( StrZero(Sf_FatNf->fNumPed,6), .F., .T. ) ) }
oBrwDups:bWhile := {|| sccrdup->fNumPed = Sf_FatNf->fNumPed }
oBrwDups:Refresh()
DbSelectArea( 'Sf_FatNf' )
]]>
    </method>
  </part>
  <part class="button">
    <style>
      <property name="Geometry">{940,592,79,24}</property>
      <property name="Name">[oButton1]</property>
      <property name="Id">[IDCANCEL]</property>
      <property name="Caption">[Esc - Sair]</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{6,3,418,44}</property>
      <property name="Name">[oLabel4]</property>
      <property name="Caption">[Notas Fiscais Emitidas]</property>
      <property name="TextColor">4194304</property>
      <property name="font">
        <font name="Arial" width="0" height="-37" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">9</property>
    </style>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{878,601,13,16}</property>
      <property name="Name">[oButtonex1]</property>
      <property name="Caption">[&amp;J]</property>
      <property name="Anchor">6</property>
      <property name="TextColor">4194304</property>
      <property name="font">
        <font name="Arial" width="0" height="-13" weight="400"/>
      </property>
      <property name="ToolTip">[Redefine Numero da PROXIMA NFC]</property>
      <property name="TabIndex">10</property>
    </style>
    <method name="onClick">
      <![CDATA[Nfe_SetProximoNumero(.t.,if(val(wfModelo)=65,'/NFC/','/NFE/'))
//skel variavel zbProxNFCNFE:={|| if(val(wfModelo)=65, (oLabProxima:Title('Proxima NFC'),zProxNFCNFE:=SiSemaf("CAPTE_PROXIMO_NUMERO","/NFC/")), (oLabProxima:Title('Proxima NFE'),zProxNFCNFE:=SiSemaf("CAPTE_PROXIMO_NUMERO","/NFE/"))), oLabProxima:Refresh(),oProxNFCNFE:Refresh() }

]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{701,598,89,19}</property>
      <property name="Name">[oLabProxima]</property>
      <property name="Caption">[Proxima:]</property>
      <property name="Justify">[Right]</property>
      <property name="Anchor">6</property>
      <property name="TabIndex">14</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{793,595,80,22}</property>
      <property name="Name">[oProxNFcNFe]</property>
      <property name="varName">[zProxNFCNFE]</property>
      <property name="Anchor">6</property>
      <property name="cPicture">[999999999]</property>
      <property name="nMaxLength">9</property>
      <property name="ToolTip">[Informa a proxima numeracao a ser gerada]</property>
      <property name="TabIndex">15</property>
    </style>
    <method name="onLostFocus">
      <![CDATA[Nfe_SetProximoNumero(.t.,if(val(wfModelo)=65,'/NFC/','/NFE/'))]]>
    </method>
    <method name="onGetFocus">
      <![CDATA[.f.]]>
    </method>
  </part>
</part>
