<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{395,267,1026,598}</property>
    <property name="Name">[sf_nfs.scr]</property>
    <property name="Caption">[]</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">[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 zbObra={||vb_pref->(DbGoTo(sf_nfs->fObra),cr_fantasi)}
//skel VARIAVEL zBlkClif = {|x_cli| sccrcli->(DbGoto(x_cli)),sccrcli->Cr_fantasi}
//skel VARIAVEL zBlkCli = {|x_cli| sccrcli->(DbGoto(x_cli)),sccrcli->Cr_nome}
//skel VARIAVEL zBlkPrd = {|nPcod| IF(mfges="F", if("Taxa de Rec"$pObs,"Taxa de Recolhimento da Devolucao","Taxa de Entrega"), if(Empty(pDesc),se_prod->(dbseek(nPcod),pdesc),pDesc)) }
//skel VARIAVEL zrecn = 0

//skel VARIAVEL zbPrtConferente := {|| zRecnBrw:=recno(), Relat('lst_exec("SF_NFS")',"nb",,"X"), eVal(zBOpenAll)}
//skel VARIAVEL zbPrtRelat := {|| zRecnBrw:=recno(), Relat('lst_exec("CR_RECFX_EXC")',"nb",,"X"), eVal(zBOpenAll), if(!FgFatura,(RegLock(),_FIELD->FgFatura:=.t.,DbCommit(),DobRefresh()),) }
//skel VARIAVEL zbRemessa := {|| zRecnBrw:=recno(), PrtBordero("HTM",,,"duplicata.htm",,,,,,,,FnumS), eVal(zBOpenAll)}
//skel VARIAVEL zbRemVarias := {|| zRecnBrw:=recno(), PrtBordero("GetFaturas"), eVal(zBOpenAll)}
//skel VARIAVEL zbEmail := {|| zRecnBrw:=recno(), lEmailOk:=StartLocacao("email_fatura_de_servico"), eVal(zBOpenAll), if(lEmailOk.and.!FgEmail,(RegLock(),_FIELD->FgEmail:=.t.,DbCommit(),DobRefresh()),) }
//skel VARIAVEL zbBoleto := {|| zRecnBrw:=recno(), PrtBordero("PDF",,,"duplicata.pdf", fCli, "FS."+LTRIM(STR(fNumS)), "N"), eVal(zBOpenAll) }
                     
// //skel VARIAVEL zbPrtGED := {|| zrecn:=recno(), Relat('lst_exec("SF_NFS")',"nb",'X'), eVal(zbReopenAll), DbGoTo(zRecn) }

// hwg_TbMt(oToolbar,' 71;eVal(zbPrtGED);G-GED;G-Lista relacao de aditivos Digitalizados/Pendentes;impressora.ico;;;;;&G-GED;;;')

oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,5,64,64)
hwg_TbMt(oToolbar,'22;(StartLocacao("acrescimo_desconto_fatura"),DobRefresh(),oBrwItens:PageDown(),oBrwItens:top(),oBrwItens:refresh());Ins-Add_Item ;Ins-Inclui Acrescimo ou Desconto na Fatura de Servicos;cadastrar.ico;;;;;ADD_Acres/Desc;;;')
hwg_TbMt(oToolbar,'65;(StartLocacao("cancelar_item_fatura"),DobRefresh(),oBrwItens:top(),oBrwItens:refresh());A-Cancela Acres/Desc ;A-Cancela Lancamento de Acrescimo ou Desconto;alterar.ico;;;;;&A-Canc_Acres/Desc;;;')
hwg_TbMt(oToolbar, '7;(StartLocacao("cancelar_fatura"),DobRefresh());DEL-Cancela/Desfaz;DEL-Cancela/Desfaz Fatura de Servico;deletar.ico;;;;;Cancela;;;')
hwg_TbMt(oToolbar,'80;tb_pesq(D_OB);P-Pesquisa ;P-Pesquisa na coluna do cursor;pesquisa.ico;;;;;&P-Pesquisa;;;')
d_ob:lEditable = .t.
hwg_TbMt(oToolbar,' 79;tb_index(D_OB);O-Ordena ;O-Ordena a coluna do cursor;ordenar.ico;;;;;&O-Ordena;;;')

hwg_TbMt(oToolbar,'73;eVal(zbPrtConferente);I-Conferente;I-Gera Conferente das Faturas de Servico;impressora.ico;;;;;&I-Conferente;;;')

// hwg_TbMt(oToolbar,' 73;lst_alias(D_OB);I-Imprime ;I-Imprime;impressora.ico;;;;;&I-Imprime;;;')
hwg_TbMt(oToolbar,'73;eVal(zbRemessa);R-Remessa;B-Gera Remessa com boleto referente a fatura de cobranca;impressora.ico;;;;;&R-Remessa;;;')
hwg_TbMt(oToolbar,'72;eVal(zbRemVarias);V-Remessa para Selecao de Faturas;V-Remessa para Selecao de Faturas;impressora.ico;;;;;&V-Rem_Varias;;;')

hwg_TbMt(oToolbar,'73;eVal(zbPrtRelat);F-Fatura;I-Imprime Fatura em Excel;impressora.ico;;;;;&F-Fatura;;;')
hwg_TbMt(oToolbar,'73;eVal(zbEmail);M-eMail;M-Gera Email com Fatura e Boletos de Cobranca;impressora.ico;;;;;&M-eMail;;;')

// hwg_TbMt(oToolbar,' 73;eVal(zbBoleto);B-Boleto;B-Gera Boleto referentes a fatura de cobranca;impressora.ico;;;;;&B-Boleto;;;')

hwg_Btn(oToolbar,10,544,70,24)
hwg_TbMt(oToolbar,' 13;doget(D_ob);Enter-Edita ;Enter - Edita;sembitmap;;;Lucida Bright;-11;Edita;;6;')
hwg_TbMt(oToolbar,' 61;doget(D_ob,,.t.);=-Repete_Edicao ;= - Repete_Edicao;sembitmap;;;Lucida Bright;-11;&=-Repete_Edicao;;6;')
hwg_TbMt(oToolbar,' 84;tb_locate(D_oB);T-Busca_Trecho ;T-Pesquisa Trecho na coluna do cursor;sembitmap;;;Lucida Bright;-11;&T-Trecho;;6;')
hwg_TbMt(oToolbar,' 76;tb_locate(D_oB);L-Busca_Iniciais ;L-Busca pelas Iniciais na coluna do cursor;sembitmap;;;Lucida Bright;-11;&L-Iniciais;;6;')
hwg_TbMt(oToolbar,' 67;tb_locate(D_oB);C-Repete_Busca ;C-Repete Busca na coluna do cursor;sembitmap;;;Lucida Bright;-11;&C-Continua;;6;')
hwg_TbMt(oToolbar,' 70;tb_filter(d_ob);F-Filtra ;F-Filtra Cursor;sembitmap;;;Lucida Bright;-11;&F-Filtra;;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()

oBrwItens:Refresh()
oDlg:MAXIMIZE()]]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <part class="status">
    <style>
      <property name="Geometry">{0,568,1026,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{608,152,0}</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{10,78,1009,180}</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[oBrwItens:Refresh()
oBrwDups:Refresh()]]>
    </method>
    <method name="onInit">
      <![CDATA[hwg_TbFi(D_oB, 'CodCli;FCLI;N;999999;  6;;')
hwg_TbFi(D_oB, 'Nome_Cli;eval(zBlkCli,fcli);P;@s30;30;N;')
hwg_TbFi(D_oB, 'Emissao;FDATAEMI;D;;8;;')
hwg_TbFi(D_oB, 'Vencto;Cr_DT_VENC;D;;8;;')
hwg_TbFi(D_oB, 'Valor;FVAL;N;9999999.99;10;;')
hwg_TbFi(D_oB, 'Oper;Cr_Cfop;C;X.XXX;5;S;')
hwg_TbFi(D_oB, 'Rem;FgRemessa;L;;3;N;')
hwg_TbFi(D_oB, 'Fat;FgFatura;L;;3;N;')
hwg_TbFi(D_oB, 'Bol;FgBoleto;L;;3;N;')
hwg_TbFi(D_oB, 'Ret;FgRetorno;L;;3;;')
hwg_TbFi(D_oB, 'Email;FgEmail;L;;5;N;')
hwg_TbFi(D_oB, 'Fatura;FNUMS;N;99999999;8;;')
hwg_TbFi(D_oB, 'Obra;fObra;N;999999;6;S;')
hwg_TbFi(D_oB, 'iObra;fObraNoCli;N;999;7;S;')
hwg_TbFi(D_oB, 'NomeObra;eVal(zbObra);P;@S25;25;S;')
hwg_TbFi(D_oB, 'Fantasia;eval(zBlkClif,fcli);P;@s30;20;N;')
//hwg_TbFi(D_oB, 'FNUM;FNUM;C;@S9;  9;;')
//hwg_TbFi(D_oB, 'FNUMPED;FNUMPED;C;@S9;  9;;')
//hwg_TbFi(D_oB, 'FNFS;FNFS;N;999999999;  9;;')
//hwg_TbFi(D_oB, 'FCNPJCPF;FCNPJCPF;C;@S18; 18;;')
//hwg_TbFi(D_oB, 'TOMADOR;TOMADOR;C;@S49; 49;;')
//hwg_TbFi(D_oB, 'FBASEISS;FBASEISS;N;999999.99; 11;;')
//hwg_TbFi(D_oB, 'FTAXAISS;FTAXAISS;N;999999.99; 11;;')
//hwg_TbFi(D_oB, 'FVALISS;FVALISS;N;999999.99; 11;;')
//hwg_TbFi(D_oB, 'SITUACAO;SITUACAO;C;@S9;  9;;')
//hwg_TbFi(D_oB, 'SIT_PGTO;SIT_PGTO;C;@S9;  9;;')
//hwg_TbFi(D_oB, 'RETIDO;RETIDO;C;@S9;  9;;')
//hwg_TbFi(D_oB, 'SERVICO;SERVICO;C;@S39; 39;;')
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.,"SF_NFS",.F.,.T.,{||.T.} }
sHwgKeyEdit:= 61
AADD(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{10,263,432,236}</property>
      <property name="Name">[oBrwDups]</property>
      <property name="Anchor">6</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="onInit">
      <![CDATA[DbSelectArea( 'sf_nfsdp' )
oBrwDups:Alias := 'sf_nfsdp'
oBrwDups:bColorSel:= RGB(3,23,133)
oBrwDups:tColorSel:= RGB(255,255,255)
hwg_TbFi(@oBrwDups, 'Vencto;cr_dt_venc;D;; 10;N;')
hwg_TbFi(@oBrwDups, 'Aditivo;fnum;N;999999;6;N;')
hwg_TbFi(@oBrwDups, 'Emissao;cr_dt_emis;D;; 10;N;')
hwg_TbFi(@oBrwDups, 'Valor;cr_Valor;N;@E 999,999.99; 10;N;')
//hwg_TbFi(@oBrwDups, 'Cupom;cr_num_ped;C;999999xx;  8;N;')
//hwg_TbFi(@oBrwDups, 'Val Lqd/Ad;cr_Val_lqd;N;@E 999,999.99; 10;S;')
//hwg_TbFi(@oBrwDups, 'Dt Lqd;cr_dt_lqd;D;; 10;S;')
//hwg_TbFi(@oBrwDups, 'Vd;cr_zona;C;99;  2;N;')
//hwg_TbFi(@oBrwDups, 'Hora;cr_hora;C;99:99;5;N;')
//hwg_TbFi(@oBrwDups, 'Obs;cr_obs;C;@s25;25;S;')
//hwg_TbFi(@oBrwDups, 'DtAlter;cr_data;D;;10;N;')
//hwg_TbFi(@oBrwDups, 'HrAlter;cr_hora;C;xxxxx;5;N;')
//hwg_TbFi(@oBrwDups, 'Usuario;cr_usuario;C;@s8;8;N;')

oBrwDups:lFilter := .T.
oBrwDups:bFirst := {|| sf_nfsdp->( DBSEEK( sf_nfs->fnums, .F. ) ) } 
oBrwDups:bLast  := {|| sf_nfsdp->( DBSEEK( sf_nfs->fnums, .F., .T. ) ) }
oBrwDups:bWhile := {|| sf_nfsdp->fnums = sf_nfs->fnums }
oBrwDups:Refresh()
DbSelectArea( 'sf_nfs' )]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{378,7,483,47}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="Arial" width="0" height="-37" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">5</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{460,263,559,236}</property>
      <property name="Name">[oBrwItens]</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[DbSelectArea( 'sf_nfsmv' )
oBrwItens:Alias := 'sf_nfsmv'
oBrwItens:bColorSel:= RGB(3,23,133)
oBrwItens:tColorSel:= RGB(255,255,255)
hwg_TbFi(@oBrwItens, 'Aditivo;fAditivo;C;@S7;7;;')
hwg_TbFi(@oBrwItens, 'Descricao;eVal(zBlkPrd,pcod);C;@S20;20;;')
hwg_TbFi(@oBrwItens, 'Quant;mQuant;N;@e 99999;5;S;')
hwg_TbFi(@oBrwItens, 'Periodo;pObs;C;@s11;11;S;')
hwg_TbFi(@oBrwItens, 'Status;if(mfges="M","RELOCADO",if(mfges="E","DEVOLVIDO",if(mfges="F","Frete",if(mfges="S","LOCADO",if(mfges="A","Taxa",if(mfges="D","Desconto",""))))));P;@s10;10;;')
hwg_TbFi(@oBrwItens, 'Dias;pDiasLoca;N;999;4;;')
hwg_TbFi(@oBrwItens, 'Locacao;pValLoca;N;9999.99;7;;')
hwg_TbFi(@oBrwItens, 'Controle;mfNum;N;999999;7;;')
hwg_TbFi(@oBrwItens, 'Prod;Pcod;N;999999;6;;;')
// hwg_TbFi(@oBrwItens, 'l;mFgEs;C;X;1;;')
// 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:bFirst := {|| sf_nfsmv->( DBSEEK( sf_nfs->fnums, .F. ) ) } 
oBrwItens:bLast  := {|| sf_nfsmv->( DBSEEK( sf_nfs->fnums, .F., .T. ) ) }
oBrwItens:bWhile := {|| sf_nfsmv->fnums = sf_nfs->fnums }
oBrwItens:Refresh()
DbSelectArea( 'sf_nfs' )
// alert('definiu oBrwItens:alias '+oBrwItens:alias+' Sf_FatNf->fnum '+str(Sf_FatNf->fnum,6)+ ' oBrwItens:nColumns '+str(oBrwItens:nColumns,4) )
]]>
    </method>
  </part>
</part>
