<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{357,88,1030,650}</property>
    <property name="Name">[SF_NFEPN.scr]</property>
    <property name="Caption">[PreNotas Pendentes]</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="Variables">{oLabProxima,oProxNFCNFE}</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
//skel VARIAVEL Zrecn = Recno()
//skel VARIAVEL zFgFaturaServicos:=(xGetEnv("FATURA_SERVICOS")="S")
//skel VARIAVEL zBlkCli={|nCli| if(fgdev$"DTE", sccpfor->(DbGoto(nCli),cp_nome), sccrcli->(DbGoto(nCli),cr_nome) ) }
//skel VARIAVEL zBlkPrd={|nPcod| se_prod->(dbseek(nPcod)), se_prod->pdesc}
//skel VARIAVEL zBlEnter={||Zrecn:=recno(),wFgVaiGerarNFC:=(VAL(wfModelo)=65),vb_venda(if(!fTipoDig$"MN","M",ftipodig),,.t.,,,"/ALTERARPN/"),wFgVaiGerarNFC:=.f.,eVal(zbOpenAll)}
//skel VARIAVEL zBlQ={||if(fnum>0,(Zini:=s_df_ecfid+if(val(fmodelo)=65,"\nc","\nf")+StrZero(fnum,6)+".ini",__run("notepad "+zini)),Alert("Esse pedido nao esta assinado e validado!"))}
//skel VARIAVEL zBlS={||Zrecn:=recno(),Nfe_CmdLote("TXT_SEFAZ",fNum,fNum),DbGoto(Zrecn)}
//skel VARIAVEL zBlDespacho={||reglock(),_FIELD->FG_FAT:="D",DBCOMMIT(),DBUNLOCK(),ALERT("O PEDIDO FOI DESPACHADO PARA A AREA DE DESPACHO"),D_OB:Refresh()}

//skel VARIAVEL zBlX={|| Set(11,'off'), DbGoTop(), DobRefresh(d_ob) }
//skel VARIAVEL zBlZ={|| Set(11,'on'), 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 m_fnum:=sf_fatnf->fNum, m_fSerie:=sf_fatnf->fSerie, m_fModelo:=sf_fatnf->fModelo, m_fChaveNfe:=sf_fatnf->fChaveNfe
//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 zBlEmDigitacao = #TEXTO_FONTE
//skel   sf_fatnf->(DbCloseArea())
//skel   Abra ('0NOIDX', r_siga, 'sf_pn', 'Sf_FatNF', sf_pn_i, 'fg_fat+ftv', sf_pn_p, 'fnumped', sf_pn_d, 'fdataemi')
//skel   sf_fatnf->( OrdSetFocus(sf_pn_i), DbSeek('5'), debugalert('fg_fat='+fg_fat+'  '+indexkey()) )
//skel   Se sf_fatnf->fg_fat<>'5' entao sf_fatnf->(OrdScope(0,'N'), OrdScope(1,'N'), ALERT("Nao existem pedidos em digitacao...")) senao sf_fatnf->(OrdScope(0,'5'), OrdScope(1,'5'), oBtnPendentes:Show(), oBtnEmDigitacao:Hide())
//skel   sf_fatnf->(DBGOBOTTOM(), DbSkip(0-D_oB:RowCount), z_recno:=Recno(), DobRefresh())
//skel #FIM_TEXTO_FONTE

//skel VARIAVEL zBlPendentes = #TEXTO_FONTE
//skel   sf_fatnf->(OrdScope(0,'N'), OrdScope(1,'N'), DBGOBOTTOM(), DbSkip( 0-D_oB:RowCount ), z_recno:=Recno(), DobRefresh())
//skel   oBtnPendentes:Hide()
//skel   oBtnEmDigitacao:Show()
//skel #FIM_TEXTO_FONTE

//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)) }

//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() }

oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,50,54,54)

d_ob:Move(,120,,263)
IF xGetEnv('GERA_NFC')='S' .AND. VAL(wfModelo)=65
//   hwg_TbMt(oToolbar,"66;AcaoNaSelecaoNFE('NFE_CRIARNFC',.t.,fnumped,.t.);N-Criar NFC;N-Criar NFC referente a venda;xml\icon\nfce_qr1.jpg;47;47;;")
   oNfeAssinar:Hide()
   oNfeEnviar:Hide()
   oNfeImprimir:Hide()
   oNfeConsultar:Hide()
   oNfeAlterar:Hide()
   oNfeDespacho:Hide()
ELSE
   oNfeAssinar:Move(oNfcAssinar:nleft, oNfcAssinar:ntop )
   oNfeEnviar:Move(oNfcEnviar:nleft, oNfcEnviar:ntop )
   oNfeImprimir:Move(oNfcImprimir:nleft, oNfcImprimir:ntop )
   oNfeConsultar:Move(oNfcConsultar:nleft, oNfcConsultar:ntop )
   oNfeAlterar:Move(oNfcAlterar:nleft, oNfcAlterar:ntop )
ENDIF

oBtnEmDigitacao:Move( oBtnPendentes:nLeft )
oBtnPendentes:Hide()

IF VAL(wfModelo)<>65
   oNfcAssinar:Hide()
   oNfcEnviar:Hide()
   oNfcImprimir:Hide()
   oNfcConsultar:Hide()
   oNfcAlterar:Hide()
   //hwg_TbMt(oToolbar,"66;AcaoNaSelecaoNFE('Nfe_CriarLoteXml',.t.,fnumped);B-Criar NFE;B-Cria NFE referente a venda;;;;;")
endif
IF sys_segmento<>'locacao'
   oNfeDespacho:Hide()
endif
oNfeAssinar:SetToolTip( "Assinar Nota Fiscal Eletronica")
oNfcAssinar:SetToolTip( "Assinar Nota Fiscal Eletronica ao Consumidor")
oNfeEnviar:SetToolTip( "Transmitir Nota Fiscal Eletronica")
oNfcEnviar:SetToolTip( "Transmitir Nota Fiscal Eletronica ao Consumidor")
oNfeImprimir:SetToolTip( "Imprimir Danfe da Nota Fiscal Eletronica")
oNfcImprimir:SetToolTip( "Imprimir Cupom da Nota Fiscal Eletronica ao Consummidor")
oNfeAlterar:SetToolTip( "Alterar Emissao da Nota Fiscal Eletronica")
oNfcAlterar:SetToolTip( "Alterar Emissao­ da Nota Fiscal Eletronica ao Consumidor")
oNfeConsultar:SetToolTip( "Consultar Status de Transmissao­ da Nota Fiscal Eletronica")
oNfcConsultar:SetToolTip( "Consultar Status de Transmissao da Nota Fiscal Eletronica ao Consumidor")
oNfeDespacho:SetToolTip( "Envia Prenota para Despacho e Faturamento")

oNfeEditaINI:SetToolTip( "Edita Arquivo de Envio .INI")
oNfeTxtSefaz:SetToolTip( "Texto no Site da Sefaz")
oNfeEditaPN:SetToolTip( "Edita Dados na Coluna")
oNfePesquisa:SetToolTip( "Pesquisa Informacoes")
oNfeDeletaPN:SetToolTip( "Exclui Prenota")

//hwg_TbMt(oToolbar,"68;AcaoNaSelecaoNFE('Nfe_EnviarNFE',.t.,fnumped);D-Enviar_NFE;D-Enviar_NFE;;;;;")
//hwg_TbMt(oToolbar,"67;AcaoNaSelecaoNFE('Nfe_ImprimirDanfe',.t.,fnumped);C-Imprimir_DANFE;C-Imprimir_DANFE;;;;;")
//hwg_TbMt(oToolbar,"69;AcaoNaSelecaoNFE('Nfe_ConsultarNFE',.t.,fnumped);E-Consulta_NFe ;E - Consulta se NFe ja existe na Base so SEFAZ;;;;;;;;;")
//hwg_TbMt(oToolbar,"13;eVal(zBlEnter);Enter-Altera;Enter-AlteraPN;;;;;")

hwg_TbMt(oToolbar,"0;;;espaco;espaco;")
//hwg_TbMt(oToolbar,"81;eval(zBlQ);Q-Editar_Ini;Q-Editar_Ini;;;;;")
//hwg_TbMt(oToolbar,"83;eval(zBlS);S-TXT_SEFAZ;S-TXT_SEFAZ;;;;;")
hwg_TbMt(oToolbar,"0;;;espaco;espaco;")
//hwg_TbMt(oToolbar,"80;tb_pesq(D_OB);P-Pesquisa;P-Pesquisa;;;;;")
//hwg_TbMt(oToolbar,"65;doget(D_ob);A-Edita;A-Edita;;;;;")
//hwg_TbMt(oToolbar,"7;AcaoNaSelecaoNFE('CANCELAR_PN',.t.,fnumped);Del-Apaga Prenota;Del-Deleta Prenota;;;;;;Deleta;;;")

hwg_TbMt(oToolbar,"0;;;espaco;espaco;")
hwg_TbMt(oToolbar,"0;;;espaco;espaco;")
hwg_TbMt(oToolbar,"0;;;espaco;espaco;")
hwg_TbMt(oToolbar,"0;;;espaco;espaco;")
//hwg_TbMt(oToolbar,"27;hwg_oDlgKey(oDlg,27,nBrwAtivo);Saida;Saida;xml\icon\saida.ico;;;;;")

hwg_Btn(oToolbar,10,595,80,24)
hwg_TbMt(oToolbar,'27;Eval(zBlX);Canceladas;Torna visiveis as Prenotas Canceladas;sembitmap;;;Lucida Bright;-11;&1.Canceladas;;6;')
hwg_TbMt(oToolbar,'27;Eval(zBlZ);Ativas;Exibe apenas prenotas ativas;sembitmap;;;Lucida Bright;-11;&2.Ativas;;6;')
hwg_TbMt(oToolbar,'0;;;espaco;espaco;')
hwg_Btn(oToolbar,,,100,24)
hwg_TbMt(oToolbar,'27;Eval(zBlRef);Referenciadas;Exibe Notas Referenciadas da NFE;sembitmap;;;Lucida Bright;-11;&4.Referenciadas;;6;')

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;')


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()

se .not. xGetEnv("DIALOGO_SF_NFEPN_COM_SYNC_PNMV")="S" entao oBtnRecallPNMV:Hide()

EVAL(zbProxNFCNFE)
DBSELECTAREA("SF_FATNF")
]]>
  </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,1030,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{640,160,0}</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{6,202,1020,180}</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()
]]>
    </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. }
se sys_segmento='bares' entao hwg_TbFi(D_oB, 'Ficha;fNumFicha;N;9999; 4;N;')
se sys_segmento='bares' entao hwg_TbFi(D_oB, 'Mesa;fMesa;N;999; 4;N;')
hwg_TbFi(D_oB, 'Prenota;fnumped;N;999999; 6;N;')
hwg_TbFi(D_oB, 'Mod;fModelo;N;99;3;S;')
// hwg_TbFi(D_oB, 'NF;fnum;N;999999;6;'+IF(UserIsAdmin(),'S','N')+';')
hwg_TbFi(D_oB, 'NF;fnum;N;999999;6;S;')
hwg_TbFi(D_oB, 'Valor;fVal;N;9999999.99;10;N;')
hwg_TbFi(D_oB, '*;FgDev;C;X;1;S;')
hwg_TbFi(D_oB, 'CFOP;fCodOp;C;XXXXX; 5;S;')
hwg_TbFi(D_oB, 'Obs;nfe_xmotiv;C;@S58;10;N;')
hwg_TbFi(D_oB, 'DtEmis;fDataEmi;D;; 8;;')
 hwg_TbFi(D_oB, 'CodCli;fCli;N;999999; 6;S;')
hwg_TbFi(D_oB, 'RazSoc;eVal(zBlkCli,fCli);C;@S20;20;;')
hwg_TbFi(D_oB, 'Valor;fval;N;@e 999999.99; 9;S;')
hwg_TbFi(D_oB, 'DtSaida;fDataSai;D;; 8;;')
hwg_TbFi(D_oB, 'nProt;nfe_nprot;C;@15;8;;')
hwg_TbFi(D_oB, 'Chave;fChaveNfe;C;@S45;45;;')
IF zFgFaturaServicos
   hwg_TbFi(D_oB, 'TotalServ;fvalServ;N;@e 999999.99; 9;S;')
   hwg_TbFi(D_oB, 'TotalISS;fvalISS;N;@e 999999.99; 9;S;')
ENDIF
hwg_TbFi(D_oB, 'XML;nfe_xml;C;@S84;84;;')
hwg_TbFi(D_oB, 'DscPeDaNota;fDesconto;N;9999999.99;12;S;')
hwg_TbFi(D_oB, 'Pedido;fNumPed;N;999999;6;S;')
hwg_TbFi(D_oB, 'Vend;fVendedor;N;9999;4;S;')
D_oB:Alias := alias()
d_ob:lEditable:=.t.
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.},})]]>
    </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">{6,386,793,203}</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 := '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;@S30;30;N;')
hwg_TbFi(@oBrwItens, 'Quant;Quant;N;@e 9999.999;8;;')
hwg_TbFi(@oBrwItens, 'PrcUnit;if(Quant>0,PrTotal/Quant,0);P;999999.999;10;N;')
hwg_TbFi(@oBrwItens, 'ValTotal;PrTotal;N;999999.99;9;;')
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;P;99999999;8;N;')
hwg_TbFi(@oBrwItens, 'CF;se_prod->pcategoria;P;XXX;3;N;')
hwg_TbFi(@oBrwItens, 'UN;se_prod->punidade;P;XXX;3;N;')

hwg_TbFi(@oBrwItens, 'BaseIcms;mBaseIcms;N;999999.99;9;;')
hwg_TbFi(@oBrwItens, '%TxICM;mTaxaIcms;N;99.99;6;;')
hwg_TbFi(@oBrwItens, 'TotIcms;mTotIcms;N;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'Desconto;vl_desc;N;999999.99;9;S;')

hwg_TbFi(oBrwItens, 'Und;if(QtdCanc>0,"*Cancelado*",if(fgprom="S".or.pdescbon>0,"*"," "))+pUnidade+" "+AllTrim(pObs);C;XXXXXXxxxxx;11;N;')
hwg_TbFi(oBrwItens, 'QtdEmb;Quant/if(pItens>0,Pitens,1);P;@e 9999.999;8;S;')
hwg_TbFi(oBrwItens, 'PrcEmb.;if(pVluEmb>0, pVluEmb, PRUNIT);P;@e 99999.99;8;S;')

IF zFgFaturaServicos
   hwg_TbFi(@oBrwItens, 'TxISS;Piss;N;99.99;5;S;')
endif
hwg_TbFi(@oBrwItens, 'Pr_Cheio;pVluVenda;N;99999.99;8;S;')
hwg_TbFi(@oBrwItens, 'CodBarra;se_prod->pdic6;N;99999999999999;14;N;')
oBrwItens:lFilter := .T.
oBrwItens:bFirst := {|| sf_pnmv->( DBSEEK( Sf_FatNf->fnumped , .F. ) ) }
oBrwItens:bLast  := {|| sf_pnmv->( DBSEEK( Sf_FatNf->fnumped , .F., .T. ) ) }
oBrwItens:bWhile := {|| sf_pnmv->fnumped = Sf_FatNf->fnumped }
oBrwItens:bFor   := {|| sf_pnmv->fnumped = Sf_FatNf->fnumped .AND. sf_pnmv->( !Deleted() ) }
oBrwItens:Refresh()
DbSelectArea( 'SF_FatNf' )]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{802,386,224,205}</property>
      <property name="Name">[oBrwDups]</property>
      <property name="Anchor">12</property>
      <property name="font">
        <font name="Arial" width="0" height="-21" weight="700"/>
      </property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onInit">
      <![CDATA[oBrwDups:Alias := 'sf_pnpc'
oBrwDups:bColorSel:= RGB(3,23,133)
oBrwDups:tColorSel:= RGB(255,255,255)
DbSelectArea( 'sf_pnpc' )
hwg_TbFi(@oBrwDups, 'Td;cr_tip_dup;C;XXX;3;;')
hwg_TbFi(@oBrwDups, 'Valor;cr_valor;N;999999.99;9;;')
hwg_TbFi(@oBrwDups, 'BomPara;fDataEmi+fPrazo;P;99.99.9999;10;;')
oBrwDups:lFilter := .T.
oBrwDups:bFirst := {|| sf_pnpc->( DBSEEK( Sf_FatNf->fNumPed, .F. ) ) } 
oBrwDups:bLast  := {|| sf_pnpc->( DBSEEK( Sf_FatNf->fNumPed, .F., .T. ) ) }
oBrwDups:bFor   := {|| sf_pnpc->( !Deleted() ) }
oBrwDups:bWhile := {|| sf_pnpc->fNumPed = Sf_FatNf->fNumPed }
oBrwDups:Refresh()
DbSelectArea( 'Sf_FatNf' )
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{9,5,832,25}</property>
      <property name="Name">[oLabel4]</property>
      <property name="Caption">[Prenotas Pendentes de Emissao de Notas]</property>
      <property name="TextColor">198</property>
      <property name="font">
        <font name="Arial" width="0" height="-19" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">9</property>
    </style>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{799,600,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="buttonex">
    <style>
      <property name="Geometry">{10,118,60,80}</property>
      <property name="Name">[oNfeAssinar]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeAssinar.jpg]</property>
      <property name="TabIndex">11</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoNaSelecaoNFE('Nfe_CriarLoteXml',.t.,fnumped)
EVAL(zProxNFCNFE)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{10,34,59,79}</property>
      <property name="Name">[oNfcAssinar]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfcAssinar.jpg]</property>
      <property name="TabIndex">11</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoNaSelecaoNFE('NFE_CRIARNFC',.t.,fnumped,.t.)
EVAL(zProxNFCNFE)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{138,118,60,80}</property>
      <property name="Name">[oNfeImprimir]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeImprimir.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoNaSelecaoNFE('Nfe_ImprimirDanfe',.t.,fnumped)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{620,34,60,79}</property>
      <property name="Name">[oNfePesquisa]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfePesquisa.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[tb_pesq(D_OB)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{557,34,60,79}</property>
      <property name="Name">[oNfeEditaPN]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeEditaPN.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[doget(D_ob)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{683,34,60,79}</property>
      <property name="Name">[oNfeDeletaPN]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeDeletaPN.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoNaSelecaoNFE('CANCELAR_PN',.t.,fnumped)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{431,34,59,79}</property>
      <property name="Name">[oNfeEditaINI]</property>
      <property name="Caption">[]</property>
      <property name="font">
        <font name="" width="0" height="-4" weight="400"/>
      </property>
      <property name="Bitmap">[icon\NfeEditaINI.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[eval(zBlQ)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{494,34,59,79}</property>
      <property name="Name">[oNfeTxtSefaz]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeTXTSefaz.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[eval(zBlS)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{807,34,60,79}</property>
      <property name="Name">[oNfeSAIR]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeSAIR.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[hwg_oDlgKey(oDlg,27,nBrwAtivo)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{138,34,59,79}</property>
      <property name="Name">[oNfcImprimir]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfcImprimir.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoNaSelecaoNFE('Nfe_ImprimirDanfe',.t.,fnumped)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{74,118,60,80}</property>
      <property name="Name">[oNfeEnviar]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeEnviar.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoNaSelecaoNFE('Nfe_EnviarNFE',.t.,fnumped)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{74,34,59,79}</property>
      <property name="Name">[oNfcEnviar]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfcEnviar.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoNaSelecaoNFE('Nfe_EnviarNFE',.t.,fnumped)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{266,34,60,79}</property>
      <property name="Name">[oNfcAlterar]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfcAlterar.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[eVal(zBlEnter)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{202,118,60,80}</property>
      <property name="Name">[oNfeConsultar]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeConsultar.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoNaSelecaoNFE('Nfe_ConsultarNFE',.t.,fnumped)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{202,34,59,79}</property>
      <property name="Name">[oNfcConsultar]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfcConsultar.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[AcaoNaSelecaoNFE('Nfe_ConsultarNFE',.t.,fnumped)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{266,118,60,80}</property>
      <property name="Name">[oNfeAlterar]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeAlterar.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[eVal(zBlEnter)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{335,34,60,79}</property>
      <property name="Name">[oNfeDespacho]</property>
      <property name="Caption">[]</property>
      <property name="Bitmap">[icon\NfeDespacho.jpg]</property>
      <property name="TabIndex">12</property>
    </style>
    <method name="onClick">
      <![CDATA[EVAL(zBlDespacho)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{928,595,98,22}</property>
      <property name="Name">[oBtnPendentes]</property>
      <property name="Caption">[Pendentes]</property>
      <property name="Anchor">6</property>
      <property name="TabIndex">13</property>
    </style>
    <method name="onClick">
      <![CDATA[EVAL(zBlPendentes)]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{827,595,98,22}</property>
      <property name="Name">[oBtnEmDigitacao]</property>
      <property name="Caption">[Em Digitacao]</property>
      <property name="Anchor">6</property>
      <property name="ToolTip">
[Exibe apenas os pedidos que estao em fase de digitacao nos terminais, onde ainda nao foi informada a forma de pagamento]      </property>
      <property name="TabIndex">13</property>
    </style>
    <method name="onClick">
      <![CDATA[EVAL(zBlEmDigitacao)]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{614,597,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">{716,597,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 class="buttonex">
    <style>
      <property name="Geometry">{936,63,80,17}</property>
      <property name="Name">[oBtnRecallPNMV]</property>
      <property name="Caption">[Sinc PNMV]</property>
      <property name="ToolTip">[Sincroniza Prenotas Pendentes]</property>
      <property name="TabIndex">16</property>
    </style>
    <method name="onClick">
      <![CDATA[sf_fatnf->(Mensagem("Aguarde..."), DBGOTOP(), SET(11,"off"), DBEVAL({|| sf_pnmv->(DBSEEK(sf_fatnf->fNumPed), DBEVAL({||RegLock(),DBRECALL()}, {||Deleted()}, {||sf_fatnf->fNumPed=fNumPed})) }), DBCOMMIT(), DBUNLOCK(), SET(11,"on"), DbGoTop(), Mensagem("Operacao concluida...",1))]]>
    </method>
  </part>
</part>
