#include "hwgui.ch"
STATIC Thisform

FUNCTION se_movnf_fnum_loc.scr( p1, p2, p3, p4 )
 RETURN _se_movnf_fnum_loc.scr( p1, p2 ,p3 ,p4)

FUNCTION _se_movnf_fnum_loc.scr
 PRIVATE oDlgStatusBar, D_oB, oLabel1

  INIT DIALOG sf_fatf.scr TITLE "Notas de Entrada" ;
        COLOR 14215660 BACKGROUND BITMAP HBitmap():AddFile('icon\tela.jpg')  ;
    AT 308,132 SIZE 1022,598 ;
        FONT HFont():Add( 'Verdana',0,-13,400,,,) CLIPPER  ;
     STYLE WS_CAPTION+WS_SYSMENU+WS_MAXIMIZEBOX+WS_SIZEBOX+DS_CENTER  ;
     ON INIT {|oDlg| onDlgInit( oDlg ) }
    Thisform := sf_fatf.scr

   ADD STATUS oDlgStatusBar TO sf_fatf.scr  ; 
        PARTS 608, 152, 0
   @ 10,69 BROWSE D_oB DATABASE SIZE 1000,458 ;
        STYLE WS_TABSTOP        ;
        ON GETFOCUS {|| nBrwAtivo:=1 } ; 
        ON INIT {|| D_oB_onInit(  ) }
    // CREATE D_oB   //  SCRIPT GENARATE BY DESIGNER

        D_oB:Anchor := 15 
   @ 410,0 SAY oLabel1 CAPTION "Lancamentos do Pedido"  TRANSPARENT SIZE 483,47 ;
        STYLE SS_RIGHT    ;
        FONT HFont():Add( 'Arial',0,-37,700,,,)

   ACTIVATE DIALOG sf_fatf.scr NOMODAL

    SETFOCUS(sf_fatf.scr:Handle) 

RETURN sf_fatf.scr:lresult

STATIC FUNCTION onDlgInit
parameters oDlg
d_ob:lEditable = .t.
oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,5,54,54)
hwg_TbMt(oToolbar,'  7;tb_del(D_ob);DEL-DELeta ;DEL-Deleta;deleta.jpg;;;;;Deleta;;;')
hwg_Btn(oToolbar,10,544,70,24)
hwg_TbMt(oToolbar,' 32;doget(d_ob);Barra-Edita ;Barra - 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,' 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()

RETURN Nil

STATIC FUNCTION D_oB_onInit
DbSelectArea( 'se_movnf' )
d_ob:Alias := 'se_movnf'
d_ob:bColorSel:= RGB(3,23,133)
d_ob:tColorSel:= RGB(255,255,255)
hwg_TbFi(@oBrwObras,"Obra;fobra;N;999;4;S;")
hwg_TbFi(@d_ob, 'Descricao;eVal(zBlkPrd,pcod);C;@S50;35;;')
hwg_TbFi(@d_ob, 'Quant;mQuant;N;999999;6;S;')
hwg_TbFi(@d_ob, 'Devol;mQdevol;N;999999;6;S;')
hwg_TbFi(@d_ob, 'Saldo;mQuant-mQdevol;P;999999;6;;')
hwg_TbFi(@d_ob, 'R$Loc;pValLoca;N;9999.99;7;;')
hwg_TbFi(@d_ob, "Obra;fobra;N;999;4;S;")
hwg_TbFi(@d_ob, 'Prod;Pcod;N;999999;6;;;')
hwg_TbFi(@d_ob, 'Un;se_prod->pUNIDADE;P;XXX;3;;')
hwg_TbFi(@d_ob, 'Valor;mValor;N;999999.99;9;;')
hwg_TbFi(@d_ob, 'Barra;se_prod->pdic6;P;9999999999999;13;;')
hwg_TbFi(@d_ob, 'ST;se_prod->pCATEGORIA;P;XXX;3;;')
hwg_TbFi(@d_ob, 'NCM;se_prod->pcodclafis;P;99999999;8;;')
hwg_TbFi(@d_ob, 'l;mFgEs;C;X;1;;')
hwg_TbFi(@d_ob, '*;if(mTipoVen="C","Cancelado","");P;@S9;9;;')
d_ob:lFilter := .T.
d_ob:bFirst := {|| se_movnf->( DBSEEK( Sf_FatNF->fnum, .F. ) ) } 
d_ob:bLast  := {|| se_movnf->( DBSEEK( Sf_FatNF->fnum , .F., .T. ) ) }
d_ob:bWhile := {|| Sf_FatNF->cr_cod_cli=sccrcli->cr_cod_cli .AND. se_movnf->mfnum = Sf_FatNF->fnum }
d_ob:Refresh()
AADD(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})

RETURN Nil

