home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
database
/
ledgers.lbr
/
LRDYTD.CZD
/
LRDYTD.CMD
Wrap
OS/2 REXX Batch file
|
1987-05-10
|
3KB
|
127 lines
NOTE * Program...: LRDYTD.CMD
NOTE * Version...: 2.0
NOTE * Author....: Terry Hazen
NOTE * Date......: 12/06/85
NOTE * Notice....: Copyright (c) 1985, n/SYSTEMS
IF 'A'$rn2
SELECT PRIMARY
SET INDEX TO ndx1
SELECT SECONDARY
USE laccount
?
?
? rline1
?
? rline2
?
? '==========================================================================='
DO WHILE .not. eof
STORE a:number TO rfind
SELECT PRIMARY
FIND &rfind
IF # <> 0
? 'Account ' + a:number + ' ... ' + a:name
? '============================================='
? 'CkNo Tr Date Payee Memo Amount'
? '---------------------------------------------------------------------------'
STORE 0 TO rtrans
STORE 0 TO rctot
DO WHILE l:account = a:number .AND. .NOT. EOF
DISPLAY OFF FIELDS l:check,l:type,l:date,l:payee,l:memo,l:amount
STORE rtrans + 1 TO rtrans
STORE rctot + l:amount TO rctot
SKIP
ENDD
? '---------------------------------------------------------------------------'
? 'Transactions: '+STR(rtrans,3) + ' Total: ' + STR(rctot,9,2)
?
?
ENDI
GO TOP
SELECT SECONDARY
SKIP
ENDD
ENDI
IF 'C'$rn2
SELECT PRIMARY
SET INDEX TO ndx2
SELECT SECONDARY
USE lcat
STORE 'I' TO r1
STORE 'Income: ' TO r1d
STORE c:category TO r2
STORE c:desc TO r2d
STORE "l:check,l:type,l:date,l:payee,$(l:memo,1,19),l:account,l:amount" TO rfields
STORE 0 TO rctot
?
?
? rline1
?
? rline2
?
? '==========================================================================='
?
?
DO WHILE .not. EOF
STORE r1 TO rfind
SELECT PRIMARY
FIND &rfind
IF # <> 0
STORE 0 TO rtrans
STORE 0 TO rctot
DO WHILE rfind$l:category .AND. .NOT. r2$l:category.AND. .NOT. EOF
SKIP
ENDD
IF r2$l:category
? 'Categories ' + r1 + r2 + ' ... ' + r1d + TRIM(r2d)
? '============================================='
? 'CkNo Tr Date Payee Memo Acct Amount'
? '---------------------------------------------------------------------------'
DO WHILE rfind$l:category .AND. .NOT. EOF
IF r2$l:category
DISPLAY OFF FIELDS &rfields
STORE rtrans + 1 TO rtrans
STORE rctot + l:amount TO rctot
ENDI
SKIP
ENDD
? '---------------------------------------------------------------------------'
? $(STR(0,80),1,16) + 'Transactions: ' + STR(rtrans,3)+ $(STR(0,80),1,26) + 'Total: ' + STR(rctot,9,2)
?
?
ENDI
ENDI
SELECT SECONDARY
STORE T TO rnext
DO WHILE rnext .AND. .NOT. EOF
SKIP
IF c:category = 'E' .OR. c:category = 'I' .OR. c:category = 'O'.OR. c:category = 'X'
LOOP
ELSE
STORE c:category TO r2
STORE c:desc TO r2d
ENDI
STORE F TO rnext
ENDD
IF EOF .AND. r1 = 'I'
STORE 'E' TO r1
STORE 'Expense: ' TO r1d
?
GO TOP
STORE c:category TO r2
STORE c:desc TO r2d
ELSE
IF EOF .AND. r1 = 'E'
STORE 'X' TO r1
STORE 'Capital: ' TO r1d
?
GO TOP
STORE c:category TO r2
STORE c:desc TO r2d
ENDI
ENDI
ENDD
? '==========================================================================='
ENDI
RETU