4. Need to switch between data bases in a browse. Doesn't work with xbrowse. I can get the first one in but switching to the second one displays the top record over and over as if there is no filter or index. Works perfectly on tcbrowse no good in xbrowse.
You asked me to send code regarding this issue.
I'll explain what is happening. The are 2 oBrw's on the screen at the same time..(no problem) ...oBrw and oBrw1
oBrw is working fine. oBrw1 loads the original data base fine but when I go to switch to another data base ( ID 106 ) calls Newfilter() the all goes wrong. It lists in the oBrw1 the first record of the new data base over and over. Its as is there is no filter or index. The code worked perfectly in 16 bit.
Then I hit ID 107 to restore the original data base and nothing happens.
Code: Select all
static function getdata()
local oDlg, oBrw, oCol, oDbf, oFont, obrw1, oDlg1
local oFont1, oDbc
local oFont2
local oFont3
local msize := 0
local mId //:= 105
local oBar
local oCursor
local oLbx
local oBtn
local otmr,osay1,osay2,osay3,oSay4
local mGlaccount
local oBtn1,oBtn2,oBtn3,oBtn4,oBtn5,oBtn6
local oBtn7,oBtn8,oBtn9,oBtn10,oBtn11
local nTop := 0,nBottom := 0,nLeft := 0,nRight := 0
local oGet
local nNetInc := 0
local nAccount := gl->(recno())
local bFont,hFont
local nUnMap := 0
field title
select (cAlias)
set order to 3
gl->(dbseek("7130"))
if gl->a13 == 2
(cAlias)->(dbseek("0047"))
nNetInc := (cAlias)->otherdata
else
(cAlias)->(dbseek("0038"))
nNetInc := (cAlias)->otherdata
endif
select (cAlias)
set order to 2
mfilterset := 1 // SET TO DEFAULT DEPT ONLY
if mFilterset == 1
cDisplay := "Dept. 4 only."
else
cDisplay := "All Depts."
endif
mCurrec := 1
select perm
perm->(dbgotop())
if nUsing == 3
index on perm->title to rec
else
index on perm->account to rec
endif
set index to rec
getcoors(ownd1:nTop,ownd1:nLeft,ownd1:nBottom,ownd1:nRight)
bFont := getFontInfo(hFont)
DEFINE FONT oFont1 NAME "Arial" SIZE 0,-14 //BOLD
DEFINE FONT oFont2 NAME "Ms Sans Serif" SIZE 0,-10
DEFINE FONT oFont3 NAME "Ms Sans Serif" SIZE 0,-12 //BOLD
if bFont[1] > 16 .OR. oWnd1:nRight > 850
define dialog oDlg resource "LRG2browseTest2" of oWnd1 help mhelp font ofont3;
TITLE "Importing Data"
else
define dialog oDlg resource "LRG2browseTest2" of oWnd1 help mhelp font ofont3;
TITLE "Importing Data"
endif
if nfp == .T.
if bFont[1] > 16 .OR. oWnd1:nRight > 850
define dialog oDlg resource "nfpLRG2browseTest2" of oWnd1 help mhelp font ofont3;
TITLE "Importing Data"
else
define dialog oDlg resource "nfpLRG2browseTest2" of oWnd1 help mhelp font ofont3;
TITLE "Importing Data"
endif
endif
redefine column xbrowse oBrw ID 101 of oDlg;
LINES CELL;
FASTEDIT;
AUTOCOLS
oBrw:nMARQueesTYLE := MARQSTYLE_HIGHLROW
database oDbf
oDbf:GoTop()
oBrw:SetoDbf(oDbf)
#xtranslate oDbf:perm: => oDbf:
// PRESS ENTER AND REACT LIKE ON LEFT DBLCLICK // 1/17/96
oBrw:bLDblClick := { | nRow, nCol | obrw1:refresh(),oBrw1:setfocus()}
oBrw:nFreeze := 3 // FREEZE FIRST TWO COLS
msize := 76
ADD COLUMN TO xbrowse oBrw;
DATA {|| oBrw:oDbf:perm:Combined };
SIZE 35 LEFT HEADER "Group" COLOR CLR_BLACK, CLR_WHITE
ADD COLUMN TO xbrowse oBrw;
DATA {|| oBrw:oDbf:perm:Account };
SIZE 65 LEFT HEADER "Account" COLOR CLR_BLACK, CLR_WHITE
ADD COLUMN TO xbrowse oBrw;
DATA {|| oBrw:oDbf:perm:Title };
SIZE 170 LEFT HEADER "Titles" COLOR CLR_BLACK, CLR_WHITE
ADD COLUMN TO xbrowse oBrw;
DATA {|| trans(oBrw:oDbf:perm:debit1, '999,999,999') };
SIZE 64 RIGHT HEADER "Debit" COLOR CLR_BLACK, CLR_WHITE
ADD COLUMN TO xbrowse oBrw;
DATA {|| trans(oBrw:oDbf:perm:credit1, '999,999,999') };
SIZE 64 RIGHT HEADER "Credit" COLOR CLR_BLACK, CLR_WHITE
ADD COLUMN TO xbrowse oBrw;
DATA {|| oBrw:oDbf:perm:glaccount };
SIZE 55 CENTER HEADER "Mapped to" COLOR CLR_BLACK, CLR_HGRAY
ADD COLUMN TO xbrowse oBrw;
DATA {|| oBrw:oDbf:perm:nametogl };
SIZE 120 LEFT HEADER "Mapped To Title" COLOR CLR_BLACK, CLR_HGRAY
ADD COLUMN TO xbrowse oBrw;
DATA {|| oBrw:oDbf:perm:SalesAcNo };
SIZE 50 center HEADER "Prod. No." COLOR CLR_BLACK, CLR_WHITE
ADD COLUMN TO xbrowse oBrw;
DATA {|| trans(oBrw:oDbf:perm:relation, '9999,999,999') };
SIZE 80 RIGHT HEADER "Sub-total" COLOR CLR_BLACK, CLR_WHITE
ADD COLUMN TO xbrowse oBrw;
DATA {|| trans(oBrw:oDbf:perm:pcnt, "999999.99") };
SIZE 35 RIGHT HEADER "% of sales" COLOR CLR_BLACK, CLR_WHITE
redefine button oBtn1 id 102 of oDlg ;
action(accntorder(2),obrw:refresh(),oBrw:setfocus())
redefine button id 103 of oDlg ;
action(printtrial())
redefine button oBtn2 id 104 of odlg ;
action(accntorder(1),obrw:refresh(),oBrw:setfocus())
[b]redefine button oBtn3 id 106 of odlg action(newfilter(2,oBrw,oBrw1,oDbf,oDlg),oBrw1:refresh),oBrw1:setfocus())[/b]
redefine button oBtn4 id 109 of oDlg ;
action(caspace1(),redofilter(.f.,"","",oDlg),gl->(dbsetOrder(3));
,accntorder(1),gl->(dbgotop()),(cAlias)->(dbgotop()),oBrw1:refresh(),perm->(dbgotop()),oBrw:refresh(),oBrw:setfocus(),newfilter(mwhichOne,oBrw,oBrw1,oDbf,oDlg))
redefine button oBtn5 id 111 of oDlg
redefine button oBtn6 id 112 of oDlg ; // DISPLAY BALANCE SHEET
action(caspace1(),gl->(dbsetfilter(1)),gl->(dbsetorder(1)),begbal(),redofilter(.f.,"","",oDlg),gl->(dbgotop()),;
(cAlias)->(dbgotop()),oBrw1:refresh(),accntorder(1),perm->(dbgotop()),newfilter(mwhichOne,oBrw,oBrw1,oDbf,oDlg),oBrw:refresh(),oBrw:setfocus(),cData := "(cAlias)")
perm->(dbgotop())
getRidDup()
select (cAlias)
cData := (cAlias)
DEFINE FONT oFont1 NAME "Arial" SIZE 0,-14 //BOLD
DEFINE FONT oFont2 NAME "Ms Sans Serif" SIZE 0,-10
DEFINE FONT oFont3 NAME "Ms Sans Serif" SIZE 0,-12 //BOLD
(cAlias)->(dbsetorder(3))
redefine column xbrowse oBrw1 ID 105 of oDlg;
LINES CELL
oBrw1:nMARQueesTYLE := MARQSTYLE_HIGHLROW
newfilter(1,oBrw,oBrw1,oDbf)
skip
skip -1
select (cAlias)
(cAlias)->(dbsetorder(3))
database oDbf
oDbf:GoTop()
oBrw1:SetoDbf(oDbf)
#xtranslate oDbf:(cAlias): => oDbf:
oBrw1:nFreeze := 3 // freeze first two cols
msize := 76
ADD COLUMN TO xbrowse oBrw1;
DATA {|| if( (cAlias)->title == repli("-",30), repli(" ",30),;
oBrw1:oDbf:(cAlias):account) };
SIZE 45 LEFT HEADER "Account" COLOR CLR_BLACK, CLR_WHITE
ADD COLUMN TO xbrowse oBrw1;
DATA {|| if((cAlias)->title == repli("-", 30),repli(" ",30),;
if(title == repli("-",20),repli(" ",20),;
oBrw1:oDbf:(cAlias):title )) };
SIZE 126 LEFT HEADER "Up Your Cash Flow(tm) Titles" COLOR CLR_BLACK, CLR_WHITE
redefine say oSAy1 prompt mgetAssets id 200 of odlg picture "999,999,999" update
redefine say oSAy2 prompt mgetLia id 201 of odlg picture "999,999,999" update
redefine say oSAy3 prompt mgetDif id 203 of odlg picture "999,999,999" update
redefine say oSAy4 prompt cDisplay id 204 of odlg Update
redefine get oGet var nNetInc id 118 of oDlg picture "999,999,999" Update Valid (placeNet(oDlg,nNetInc),newfilter(mwhichOne,oBrw,oBrw1,oDbf,oDlg),.t.)
redefine button oBtn7 id 107 of odlg ;
action(newfilter(2,oBrw,oBrw1,oDbf,oDlg),oBrw1:refresh(),oBrw1:setfocus())
redefine button oBtn9 id 110 of oDlg ;
action(findOne())
redefine button oBtn11 id 116 of oDlg ;
action(LstName(oBrw,oBrw1,oDbf,odlg))
redefine button oBtn8 id 113 of oDlg ;
action(mfilterset:= 2,newfilter(1,oBrw,oBrw1,oDbf,oDlg),mfilterset:= 2,gl->(dbsetOrder(3)),obrw1:refresh(),oBrw1:setfocus())
redefine button oBtn10 id 114 of oDlg ;
action(mfilterset:= 1,newfilter(1,oBrw,oBrw1,oDbf,oDlg),mfilterset:= 1,redofilter(.t.,oDbf,oBrw1,odlg),gl->(dbsetOrder(3)),obrw1:refresh(),oBrw1:setfocus())
redefine button id 117 of oDlg ;
action(automap(),gettotalvalue(2,odlg),setpercent(),giveitNames(),;
newfilter(2,oBrw,oBrw1,oDbf,oDlg),(cAlias)->(dbsetorder(1)),oBrw1:refresh(),oBrw:refresh(),oBrw:setFocus())
redefine button id 4002 of oDlg ;
action (CheckPL(odlg,oBrw1),(cAlias)->(dbgotop()),oBrw1:refresh(),oBrw1:setfocus())
if nfp == .T.
oGet:cTooltip := " When working on the statement of financial position you must enter Net Income. "+CRLF+;
" This is necessary because the trial balance does not disclose "+CRLF+;
" the amount of net asset change for the trial balance period. If you "+CRLF+;
" do not do this the opening financial position may be out of balance. "
oBtn1:cToolTip := "List the accounting data in the order"+CRLF+"of the account numbers mapped to in Up Your Cash Flow."
oBtn2:cToolTip := "List the accounting data in trial balance order."
oBtn3:cToolTip := "Display Up Your Cash Flow acitvities accounts."
oBtn4:cToolTip := "Transfer account balances as a percent of revenue to Up Your Cash Flow."
oBtn5:cToolTip := "Read these instruction before brginning the mapping process."
oBtn6:cToolTip := "Review Up Your Cash Flow opening financial position"+CRLF+"after you have mapped the fiancial position accounts."
oBtn7:cToolTip := "Display Up Your Cash Flow financial position accounts."
oBtn8:cToolTip := "Display all the expense departments available in"+CRLF+"Up Your Cash Flow activities."
oBtn9:cToolTip := "An explanation of how expense departments "+CRLF+"are utilized in Up Your Cash Flow."
oBtn10:cToolTip := "Display department 4 for mapping purposes."
oBtn11:cToolTip := "Search Up Your Cash Flow data base for an expense listing."
else
oGet:cTooltip := " When working on the balance sheet you must enter Net Income. "+CRLF+;
" This is necessary because the trial balance does not disclose "+CRLF+;
" the amount of net income for the trial balance period. If you "+CRLF+;
" do not do this the opening balance sheet may be out of balance. "
oBtn1:cToolTip := "List the accounting data in the order"+CRLF+"of the account numbers mapped to in Up Your Cash Flow."
oBtn2:cToolTip := "List the accounting data in trial balance order."
oBtn3:cToolTip := "Display Up Your Cash Flow profit and loss accounts."
oBtn4:cToolTip := "Transfer account balances as a percent of sales to Up Your Cash Flow."
oBtn5:cToolTip := "Read these instruction before brginning the mapping process."
oBtn6:cToolTip := "Review Up Your Cash Flow opening balance sheet"+CRLF+"after you have mapped the balance sheet accounts."
oBtn7:cToolTip := "Display Up Your Cash Flow balance sheet accounts."
oBtn8:cToolTip := "Display all the expense departments available in"+CRLF+"Up Your Cash Flow profit and loss."
oBtn9:cToolTip := "An explanation of how expense departments "+CRLF+"are utilized in Up Your Cash Flow."
oBtn10:cToolTip := "Display department 4 for mapping purposes."
oBtn11:cToolTip := "Search Up Your Cash Flow data base for an expense listing."
endif
* ACTIVATE DIALOG ODLG CENTERED on init(gettotalvalue(2,odlg),;
* oBrw:refresh(),obrw1:refresh(),perm->(dbgotop()),placeNet(oDlg,nNetInc),;
* newfilter(2,oBrw,oBrw1,oDbf,oDlg))
* ACTIVATE DIALOG ODLG CENTERED on init(;
* placeNet(oDlg,nNetInc),oBrw:refresh(),obrw1:refresh(),perm->(dbgotop()))
ACTIVATE DIALOG ODLG CENTERED
select gl
gl->(dbsetorder(1))
set filter to
setcalc2()
return nil
static function newfilter(mWhichOne,oBrw,oBrw1,oDbf,oDlg)
local nFilterType := salestreat()
local oldarea := SELECT()
local nGoTo := perm->(recno())
if nFilterType == 0
nFilterType := 3
endif
giveitNames()
accntorder(1)
if mWhichOne == 1 // P&L
cAlias := "gl"
select (cAlias)
whichdbf := .T. // USING GL
if mFilterSet == 1
if lYesIam == .t.
set filter to .NOT. Account = "3601" ;
.and. .not. account = "0100" .and. .not. account = "0125" ;
.and. .not. account = "0150" .and. .not. account = "0175" ;
.and. .not. account = "0900" .and. .not. account = "0950" ;
.and. .not. (account >= "2055" .and. account <= "2500" ) ; //1
.and. .not. (account >= "3360" .and. account <= "3480" ) ; //2
.and. .not. (account >= "3491" .and. account <= "3544" ) ; //3
.and. .not. (account >= "2520" .and. account <= "2997" ) ; //3
.and. .not. account = "2019" ;
.and. .not. account = "2021" ;
.and. !(gl->account >= '2022' .and. gl->account <= '2029') ;
.and. !(gl->account >= '2031' .and. gl->account <= '2038') ;
.and. !(gl->account >= "2010" .and. gl->account <= "2030") ;
.And. .Not. Account = "2030" ;
.And. .Not. Account = "2021" ;
.And. .Not. Account = "2019" ;
.And. .Not. Account = "2042" ;
.And. .Not. Account = "2044" ;
.and. .not. account = "3800" ;
.and. .not. account > "5000"
else
if nFilterType == 1 // ONE LINE COST OF GOODS SOLD
set filter to .NOT. Account = "3601" ;
.and. .not. account = "0100" .and. .not. account = "0125" ;
.and. .not. account = "0150" .and. .not. account = "0175" ;
.and. .not. account = "0900" .and. .not. account = "0950" ;
.and. .not. (account >= "2055" .and. account <= "2500" ) ; //1
.and. .not. (account >= "3360" .and. account <= "3480" ) ; //2
.and. .not. (account >= "3491" .and. account <= "3544" ) ; //3
.and. .not. (account >= "2520" .and. account <= "2997" ) ; //3
.and. !(gl->account >= "2004" .and. gl->account <= "2008") ;
.AND. !(gl->account >= '2010' .and. gl->account <= '2038') ;
.and. .not. account = "3800" ;
.And. .Not. Account = "2030" ;
.And. .Not. Account = "2021" ;
.And. .Not. Account = "2019" ;
.And. .Not. Account = "2042" ;
.And. .Not. Account = "2044" ;
.and. .not. account > "5000"
skip
endif
if nFilterType == 2 // MATERIAL, LABOR, OVERHEAD & FIXED COSTS
set filter to .NOT. gl->Account = "3601" ;
.and. .not. gl->account = "0100" .and. .not. gl->account = "0125" ;
.and. .not. gl->account = "0150" .and. .not. gl->account = "0175" ;
.and. .not. gl->account = "0900" .and. .not. gl->account = "0950" ;
.and. .not. (gl->account >= "2055" .and. gl->account <= "2500" ) ; //1
.and. .not. (gl->account >= "3360" .and. gl->account <= "3480" ) ; //2
.and. .not. (gl->account >= "3491" .and. gl->account <= "3544" ) ; //3
.and. .not. (gl->account >= "2520" .and. gl->account <= "2997" ) ; //3
.and. .not. (gl->account >= "2004" .and. gl->account <= "2008") ;
.and. .not. gl->account = "3800" ;
.and. .Not. gl->Account = "2042" ;
.and. .Not. gl->Account = "2044" ;
.and. .not. gl->account = "2510" ; //lines
.and. .not. gl->account = "3482" ; //lines
.and. .not. gl->account = "3545" ; //lines
.and. .not. gl->account > "5000" ;
.and. !(gl->account >= '1500' .and. gl->account <= '1538') ;
.and. !(gl->account >= '2022' .and. gl->account <= '2029') ;
.and. !(gl->account >= '2031' .and. gl->account <= '2038')
endif
if nFilterType == 3 // DETAIL COST OF GOODS SOLD
select gl
set filter to .NOT. Account = "3601" ;
.and. .not. account = "0100" .and. .not. account = "0125" ;
.and. .not. account = "0150" .and. .not. account = "0175" ;
.and. .not. account = "0900" .and. .not. account = "0950" ;
.and. .not. (account >= "2055" .and. account <= "2500" ) ; //1
.and. .not. (account >= "3360" .and. account <= "3480" ) ; //2
.and. .not. (account >= "3491" .and. account <= "3544" ) ; //3
.and. .not. (account >= "2520" .and. account <= "2997" ) ; //3
.and. !( gl->account >= "2004" .and. gl->account <= "2008") ;
.and. .not. account = "3800" ;
.And. .Not. Account = "2030" ;
.And. .Not. Account = "2021" ;
.And. .Not. Account = "2019" ;
.And. .Not. Account = "2042" ;
.And. .Not. Account = "2019" ;
.And. .Not. Account = "2021" ;
.And. .Not. Account = "2030" ;
.And. .Not. Account = "2044" ;
.and. .not. account > "5000"
* .and. .not. account = "2510" ; //lines
* .and. .not. account = "3482" ; //lines
* .and. .not. account = "3545" ; //lines
endif
endif
else
if lYesIam == .t.
set filter to .NOT. Account = "3601" ;
.And. .Not. Account = "0100" .And. .Not. Account = "0125" ;
.And. .Not. Account = "0150" .And. .Not. Account = "0175" ;
.and. .not. account = "0900" .and. .not. account = "0950" ;
.AND. .not. account = "2019" ;
.AND. .not. account = "2021" ;
.and. !(gl->account >= '2022' .and. gl->account <= '2029') ;
.AND. !(gl->account >= '2031' .and. gl->account <= '2038') ;
.and. !(gl->account >= "2010" .and. gl->account <= "2030") ;
.and. .not. account = "2021" ;
.And. .Not. Account = "2030" ;
.And. .Not. Account = "2021" ;
.And. .Not. Account = "2019" ;
.And. .Not. Account = "2042" ;
.And. .Not. Account = "2044" ;
.And. .Not. Account > "5000"
* .and. .not. account = "2510" ; //lines
* .and. .not. account = "3482" ; //lines
* .and. .not. account = "3545" ; //lines
* .And. .Not. Account = "2500" ;
* .And. .Not. Account = "3480" ;
* .And. .Not. Account = "3544" ;
* .And. .Not. Account = "3353" ;
* .and. .not. account = "2625" ;
* .and. .not. account = "2720" ;
* .and. .not. account = "2820" ;
* .and. .not. account = "2920" ;
* .and. .not. account = "2996" ;
//.and. .not. (account >= "2520" .and. account <= "2997" ) ; //3
else
if nFilterType == 1 // ONE LINE COST OF GOODS SOLD
set filter to .NOT. Account = "3601" ;
.and. .not. account = "0100" .and. .not. account = "0125" ;
.and. .not. account = "0150" .and. .not. account = "0175" ;
.and. .not. account = "0900" .and. .not. account = "0950" ;
.and. !(gl->account >= "2004" .and. gl->account <= "2008") ;
.AND. !(gl->account >= '2010' .and. gl->account <= '2038') ;
.and. .not. account = "3800" ;
.And. .Not. Account = "2030" ;
.And. .Not. Account = "2021" ;
.And. .Not. Account = "2019" ;
.And. .Not. Account = "2042" ;
.And. .Not. Account = "2044" ;
.and. .not. account > "5000"
* .and. .not. account = "2510" ; //lines
* .and. .not. account = "3482" ; //lines
* .and. .not. account = "3545" ; //lines
* .And. .Not. Account = "2500" ;
* .And. .Not. Account = "3480" ;
* .And. .Not. Account = "3544" ;
* .And. .Not. Account = "3353" ;
* .and. .not. account = "2625" ;
* .and. .not. account = "2720" ;
* .and. .not. account = "2820" ;
* .and. .not. account = "2920" ;
* .and. .not. account = "2996" ;
endif
if nFilterType == 2 // MATERIAL, LABOR, OVERHEAD & FIXED COSTS
set filter to .NOT. Account = "3601" ;
.and. .not. account = "0100" .and. .not. account = "0125" ;
.and. .not. account = "0150" .and. .not. account = "0175" ;
.and. .not. account = "0900" .and. .not. account = "0950" ;
.and. !( gl->account >= "2004" .and. gl->account <= "2008") ;
.and. .not. account = "3800" ;
.And. .Not. Account = "2030" ;
.And. .Not. Account = "2021" ;
.And. .Not. Account = "2019" ;
.And. .Not. Account = "2042" ;
.And. .Not. Account = "2044" ;
.and. .not. account > "5000" ;
.and. !(gl->account >= '2022' .and. gl->account <= '2029') ;
.and. !(gl->account >= '2031' .and. gl->account <= '2038')
* .and. .not. account = "2510" ; //lines
* .and. .not. account = "3482" ; //lines
* .and. .not. account = "3545" ; //lines
* .And. .Not. Account = "2500" ;
* .And. .Not. Account = "3480" ;
* .And. .Not. Account = "3544" ;
* .And. .Not. Account = "3353" ;
* .and. .not. account = "2625" ;
* .and. .not. account = "2720" ;
* .and. .not. account = "2820" ;
* .and. .not. account = "2920" ;
* .and. .not. account = "2996" ;
endif
if nFilterType == 3 // DETAIL COST OF GOODS SOLD
select gl
set filter to .NOT. Account = "3601" ;
.and. .not. account = "0100" .and. .not. account = "0125" ;
.and. .not. account = "0150" .and. .not. account = "0175" ;
.and. .not. account = "0900" .and. .not. account = "0950" ;
.and. !( gl->account >= "2004" .and. gl->account <= "2008") ;
.and. .not. account = "3800" ;
.AND. .not. account = "2019" ;
.AND. .not. account = "2021" ;
.And. .Not. Account = "2030" ;
.And. .Not. Account = "2021" ;
.And. .Not. Account = "2019" ;
.And. .Not. Account = "2042" ;
.And. .Not. Account = "2044" ;
.and. .not. account > "5000"
* .and. .not. account = "2510" ; //lines
* .and. .not. account = "3482" ; //lines
* .and. .not. account = "3545" ; //lines
* .And. .Not. Account = "2500" ;
* .And. .Not. Account = "3480" ;
* .And. .Not. Account = "3544" ;
* .And. .Not. Account = "3353" ;
* .and. .not. account = "2625" ;
* .and. .not. account = "2720" ;
* .and. .not. account = "2820" ;
* .and. .not. account = "2920" ;
* .and. .not. account = "2996" ;
* .and. .not. (account >= "2055" .and. account <= "2500" ) ; //1
* .and. .not. (account >= "3360" .and. account <= "3480" ) ; //2
* .and. .not. (account >= "3491" .and. account <= "3544" ) ; //3
* .and. .not. (account >= "2520" .and. account <= "2997" ) ; //3
endif
endif
endif
* database oDbf
* oDbf:GoTop()
* oBrw1:SetoDbf(oDbf)
* #xtranslate oDbf:(cAlias): => oDbf:
msgwait(" Set","Notice",.5)
if mFilterset == 1
cDisplay := "Dept. 4 only."
else
cDisplay := "All Depts."
endif
perm->(dbgoto(nGoTo))
select gl
(cAlias)->(dbgotop())
return nil
else
cAlias := "bal2"
select (cAlias)
(cAlias)->(dbgotop())
if isAcorp
if lYesIam == .T.
set filter to .NOT. (cAlias)->Account = "0036";
.And. .Not. (cAlias)->Account = "0040" .And. .Not. (cAlias)->Account = "0039" ;
.And. .Not. (cAlias)->Account = "0046" .And. .Not. (cAlias)->Account = "0047" ;
.And. .Not. (cAlias)->Account = "0048" .And. .Not. (cAlias)->Account = "0049" ;
.And. .Not. (cAlias)->Account = "0050" .And. .Not. (cAlias)->Account = "0051" ;
.And. .Not. (cAlias)->Account = "0052" .And. .Not. (cAlias)->Account = "0053" ;
.And. .Not. (cAlias)->Account = "0054"
skip
skip -1
else
select (cAlias)
set filter to .NOT. (cAlias)->Account = "0036";
.And. .Not. (cAlias)->Account = "0040" .And. .Not. (cAlias)->Account = "0039" ;
.And. .Not. (cAlias)->Account = "0046" .And. .Not. (cAlias)->Account = "0047" ;
.And. .Not. (cAlias)->Account = "0048" .And. .Not. (cAlias)->Account = "0049" ;
.And. .Not. (cAlias)->Account = "0050" .And. .Not. (cAlias)->Account = "0051" ;
.And. .Not. (cAlias)->Account = "0052" .And. .Not. (cAlias)->Account = "0053" ;
.And. .Not. (cAlias)->Account = "0054" ;
.And. .Not. (cAlias)->Account = "0055" ;
.And. .Not. (cAlias)->Account = "0056" ;
.And. .Not. (cAlias)->Account = "0058" ;
.And. .Not. (cAlias)->Account = "0059"
skip
skip-1
endif
index on newIndex() to bal3
else
if lYesIam == .T.
select (cAlias)
(cAlias)->(dbgotop())
set filter to .NOT. ((cAlias)->Account >= "0033" .And. (cAlias)->Account <= "0044");
.and. .NOT. ((cAlias)->Account >= "0048" .And. (cAlias)->Account <= "0074")
else
select (cAlias)
(cAlias)->(dbgotop())
set filter to .NOT. ((cAlias)->Account >= "0033" .And. (cAlias)->Account <= "0044");
.and. .NOT. ((cAlias)->Account >= "0048" .And. (cAlias)->Account <= "0074") ;
.And. .Not. (cAlias)->Account = "0055" ;
.And. .Not. (cAlias)->Account = "0056" ;
.And. .Not. (cAlias)->Account = "0058" ;
.And. .Not. (cAlias)->Account = "0059"
endif
endif
(cAlias)->(dbcloseArea())
use ("Generbal.I"+substr(gld,5,3)) alias (cAlias) new
index on (cAlias)->account3 to bal3
index on (cAlias)->account to bal2
set index to bal3,bal2
set order to 1
select (cAlias)
(cAlias)->(dbgotop())
database oDbf
oDbf:GoTop()
oBrw1:SetoDbf(oDbf)
// #xtranslate oDbf:bal2: => oDbf:
endif
select bal2
//index on newIndex() to bal3
(cAlias)->(dbgotop())
oDlg:update()
oBrw1:refresh()
return nil
function newIndex()
local cRetVal
field title, account
do case
case account >= "0001" .AND. account <= "0002"
cRetVal := "A"+ account+title
case account = "0065"
cRetVal := "B"+ account+title
case account >= "0055" .and. account <= "0057"
cRetVal := "C"+ account+title
case account >= "0003" .and. account <= "0010"
cRetVal := "D"+ account+title
case account = "0068"
cRetVal := "E"+ account+title
case account >= "0011" .and. account <= "0022"
cRetVal := "F"+ account+title
case account >= "0058" .and. account <= "0059"
cRetVal := "G"+ account+title
case account >= "0023" .and. account <= "0029"
cRetVal := "H"+ account+title
case account >= "0071" .and. account <= "0074"
cRetVal := "I"+ account+title
case account >= "0030" .and. account <= "0054"
cRetVal := "J"+ account+title
otherwise
cRetVal := "AA"+ account+title
endcase
return cRetVal
function oBal2(nVar)