home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
DATABASE
/
DBT123S.ZIP
/
ACCTDE.PRG
< prev
next >
Wrap
Text File
|
1990-07-20
|
6KB
|
220 lines
* Program : ACCTDE.PRG - Account Data Entry
* : (c) 1990 BERNATH COMPUTER
* : 07/20/1990
EXITNOW = .F.
EDITING = .F.
mADDIT = " "
gFG=0
gBG=3
select B
USE ACCOUNTS INDEX ACCOUNTS
mLEVEL = 0
Mgen_det = "G"
DO WHILE .NOT. EXITNOW
DO SCRHEAD WITH "SAMPLE DATA ENTRY","Accounts Data Entry",0,1
SET COLOR TO N/G,+GR/N,,G
CALL DBTOOLS WITH "3,7,10,20,70,0,2,1,0,1"
CALL DBTOOLS WITH "1,9,10,0,2,0,╞═══════════════════════════════════════════════════════════╡"
CALL DBTOOLS WITH "1,8,12,0,2,0,Account number:"
CALL DBTOOLS WITH "1,8,39,0,2,0,Name:"
CALL DBTOOLS WITH "1,10,12,0,2,0,General or Detail (G/D)?"
CALL DBTOOLS WITH "1,10,45,0,2,0,Level (1-5):"
CALL DBTOOLS WITH "1,10,60,0,2,0,Type:"
CALL DBTOOLS WITH "1,12,12,0,2,0,General (parent) Account:"
CALL DBTOOLS WITH "1,13,10,0,2,0,╞═══════════════════════════════════════════════════════════╡"
CALL DBTOOLS WITH "1,14,23,15,2,0,H I S T O R Y"
CALL DBTOOLS WITH "1,15,20,0,2,0,Previous balance:"
CALL DBTOOLS WITH "1,16,29,0,2,0,Current:"
CALL DBTOOLS WITH "1,17,33,0,2,0,MTD:"
CALL DBTOOLS WITH "1,18,33,0,2,0,QTD:"
CALL DBTOOLS WITH "1,19,33,0,2,0,YTD:"
IF .NOT. EDITING
mACCTNUM = SPACE(5)
mDESC = SPACE(24)
mPARENT = SPACE(5)
mBAL_FWD = 0.00
mCURRENT = 0.00
mMTD = 0.00
mQTD = 0.00
mYTD = 0.00
mACCT_TYPE = " "
mHISTFLAG = .F.
CALL DBTOOLS WITH "1,8,45,14,0,0,"+SPACE(24)
CALL DBTOOLS WITH "1,10,39,14,0,0, "
CALL DBTOOLS WITH "1,10,58,14,0,0, "
CALL DBTOOLS WITH "1,10,66,14,0,0, "
CALL DBTOOLS WITH "1,12,39,14,0,0, "
mNEWREC = .F.
ENDIF
OKACCT = .F.
DO WHILE .NOT. OKACCT
@ 8,28 GET mACCTNUM PICTURE "99999"
READ
DO KEYTRAP
IF EXITNOW
EXIT
ENDIF
SEEK mACCTNUM
IF FOUND()
mDESC = ACCTNAME
mGEN_DET = GEN_DET
mLEVEL = LEVEL
mPARENT = PARENT
mBAL_FWD = BAL_FWD
mCURRENT = CURRENT
mMTD = MTD
mQTD = QTD
mYTD = YTD
mACCT_TYPE = ACCT_TYPE
mHISTFLAG = HISTFLAG
mNEWREC = .F.
CALL DBTOOLS WITH "1,8,45,14,0,0,"+mDESC
CALL DBTOOLS WITH "1,10,39,14,0,0,"+mGEN_DET
CALL DBTOOLS WITH "1,10,58,14,0,0,"+STR(mLEVEL,1)
CALL DBTOOLS WITH "1,10,66,14,0,0,"+mACCT_TYPE
CALL DBTOOLS WITH "1,12,39,14,0,0,"+mPARENT
CALL DBTOOLS WITH "1,15,38,15,2,0,"+TRANSFORM(mBAL_FWD,"9,999,999.99")
CALL DBTOOLS WITH "1,16,38,15,2,0,"+TRANSFORM(mCURRENT,"9,999,999.99")
CALL DBTOOLS WITH "1,17,38,15,2,0,"+TRANSFORM(mMTD,"9,999,999.99")
CALL DBTOOLS WITH "1,18,38,15,2,0,"+TRANSFORM(mQTD,"9,999,999.99")
CALL DBTOOLS WITH "1,19,38,15,2,0,"+TRANSFORM(mYTD,"9,999,999.99")
OKACCT = .T.
ELSE
IF gADDBEEP
? CHR(7)
ENDIF
DO CLRSTAT WITH gFG,gBG
CALL DBTOOLS WITH "1,24,20,14,4,0,Account not found. Add it (Y/N)?"
mADDIT = " "
@ 24,53 SAY mADDIT
DO YESNO WITH mADDIT
DO CLRSTAT WITH gFG,gBG
IF EXITNOW
EXIT
ENDIF
mNEWREC = .T.
IF mADDIT = "Y"
OKACCT = .T.
ENDIF
ENDIF
IF EXITNOW
EXIT
ENDIF
ENDDO (OKACCT)
IF EXITNOW
EXIT
ENDIF
@ 8,45 GET mDESC
READ
DO KEYTRAP
IF EXITNOW
EXIT
ENDIF
@ 10,39 SAY mGEN_DET
DO VALIDKEY WITH mGEN_DET,"DG"
DO GETACTYPE WITH mACCTNUM,mACCT_TYPE
@ 10,58 GET mLEVEL PICTURE "9" RANGE 1,5
READ
DO KEYTRAP
IF EXITNOW
EXIT
ENDIF
CALL DBTOOLS WITH "21,5,11,50,18,72,15,3,1,1"
CALL DBTOOLS WITH "1,12,52,15,3,0,ACCOUNT TYPE:"
CALL DBTOOLS WITH "1,13,52,0,3,0,A - Asset"
CALL DBTOOLS WITH "1,14,52,0,3,0,L - Liability"
CALL DBTOOLS WITH "1,15,52,0,3,0,C - Capital/Equity"
CALL DBTOOLS WITH "1,16,52,0,3,0,R - Revenues"
CALL DBTOOLS WITH "1,17,52,0,3,0,E - Expense"
@ 10,66 SAY mACCT_TYPE
DO VALIDKEY WITH mACCT_TYPE,"ALCRE"
CALL DBTOOLS WITH "19,5"
IF EXITNOW
EXIT
ENDIF
IF mLEVEL > 1
IF .NOT. EDITING
mL = LEN(TRIM(mACCTNUM))
IF mLEVEL - 1 > 0
mP = SUBSTR(mACCTNUM,1,mLEVEL-1)
ELSE
mP = SPACE(5)
ENDIF
IF LEN(TRIM(mP))<5
mPARENT = mP + SPACE(5-LEN(mP))
ELSE
mPARENT = mP
ENDIF
ENDIF
GOODPRNT = .F.
mRECNO = RECNO()
DO WHILE .NOT. GOODPRNT
@ 12,39 GET mPARENT PICTURE "99999"
READ
DO KEYTRAP
IF EXITNOW
EXIT
ENDIF
mGOODACT = .F.
SEEK mPARENT
IF FOUND()
IF GEN_DET = "G"
GOODPRNT = .T.
CALL DBTOOLS WITH "5,12,46,12,62,2"
ELSE
CALL DBTOOLS WITH "1,12,46,14,4,0,Not a General account."
CALL DBTOOLS WITH "2"
ENDIF
ELSE
CALL DBTOOLS WITH "1,12,46,14,4,0,Invalid account."
CALL DBTOOLS WITH "2"
ENDIF
ENDDO (GOODPRNT)
IF EXITNOW
EXIT
ENDIF
IF .NOT. mNEWREC
GO mRECNO
ENDIF
ENDIF
mOPT = 1
DO ACQ WITH mOPT
DO CASE mOPT
CASE mOPT = 1
IF mADDIT = "Y"
APPEND BLANK
ENDIF
REPLACE ACCTNUM WITH mACCTNUM,;
ACCTNAME WITH mDESC,;
GEN_DET WITH mGEN_DET,;
LEVEL WITH mLEVEL
REPLACE PARENT WITH mPARENT,;
BAL_FWD WITH mBAL_FWD,;
CURRENT WITH mCURRENT,;
MTD WITH mMTD
REPLACE QTD WITH mQTD,;
YTD WITH mYTD,;
ACCT_TYPE WITH mACCT_TYPE,;
HISTFLAG WITH mHISTFLAG
mADDIT = " "
mNEWREC = .F.
EDITING = .F.
CASE mOPT = 2
EDITING = .T.
CASE mOPT = 3 .OR. mOPT = 0
EXITNOW = .T.
EXIT
ENDCASE
ENDDO
CLOSE DATABASES
RELEASE ALL EXCEPT g*
gNUMOPT = 1
EXITNOW = .F.
ON KEY
RETURN