Function Historico()
local oDlgHis, oBrwHis, oBtn1, hBmpOn := LoadBitmap( GetResources(), "CheckOn" ),;
hBmpOFF := LoadBitmap( GetResources(), "CheckOFF" )
HISMES->( OrdSetFocus( "HICLI" ))
HISMES->( ordScope( 0, CLIMES->NUMERO ) )
HISMES->( ordScope( 1, CLIMES->NUMERO ) )
HISMES->( DbGoTop() )
DEFINE DIALOG oDlgHis TITLE "Historico"+"-"+Alltrim(CLIMES->NOME) SIZE 240,270
DEFINE FONT oFont NAME 'Arial' SIZE 0, -10
@ 0, 0 LISTBOX oBrwHis ;
FIELDS IF( HISMES->SEL, hBmpOn, hBmpOFF ),;
HISMES->DATA, HISMES->DESCRITIVO, Transform(HISMES->QUANTIDADE,"99 999.99"),;
Transform(HISMES->PVENDA,"999 999.999"), Transform(HISMES->DESCONTO1,"999.99"),;
Alltrim(HISMES->NOMEDOC), Transform(HISMES->DOCUMENTO,"9999999999") ;
COLSIZES 15,55,120,45,50,45,70,50 ;
HEADERS "X","Data", "Artigo","Qtd","Preço","Desc.","Doc.","Nr." ;
SIZE 120, 114 ;
FONT oFont ;
OF oDlgHis ;
ALIAS 'HISMES'
oBrwHis:bLDblClick = { || HISMES->SEL := !HISMES->SEL, oBrwHIS:Refresh() } // aqui seria necessario refresh so a linha alterada
oBrwHis:bLogicLen = { || HISMES->( OrdKeyCount() ) }
@ 125,00 BTNBMP oBtn2 PROMPT "Retroceder" SIZE 60, 12 action { oDlgHis:End() } OF oDlgHis
ACTIVATE DIALOG oDlgHis CENTERED
HISMES->( ordScope( 0, Nil ) )
HISMES->( ordScope( 1, Nil ) )
Return Nil