home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr3.zip
/
CFBUDGMO.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-01-21
|
7KB
|
227 lines
* Program CFBUDGMO - View/edit the church year-to-date budget
Select primary
? 'Now reading the Department Account summaries.'
Store D+':ACCOUNT'+DF to MFILE
USE &MFILE INDEX &MFILE
Release LEVEL2,MSEL,validd1,XX,DF
Store ' ' to NSEL
Do while !(NSEL)<>'Q'
Store '0' to NNN
Store ' ' to NSEL
GOTO TOP
Store $(account,1,2) to inaccnt
If inaccnt<>'D1'
? 'Department 1 lead code =',inaccnt,'which is invalid. (Must be "D1")'
Accept 'The ACCOUNT file must be rebuilt. Press <RETURN> to exit.' to XX
RETURN
endif
Store '0' to N
Store 0.00 to acctytd
Store 0.00 to acctp
Store 0.00 to acctact
Store 0.00 to acctrcv
Store 0.00 to acctpr
Store 0.00 to accnt1
Store 0.00 to accnt2
Store 0.00 to accnt3
Store 0.00 to accnt4
Store 0.00 to accnt5
Store 0.00 to accnt6
Store 0.00 to accnt7
Store 0.00 to accnt8
Store 0.00 to accnt9
Store 0.00 to acctbala
Do while .not. EOF .and. N<>'9' .and. account='D'
Store str(val(N)+1,1) to N
If $(account,2,1)<>N .and. NNN='0'
Store N to NNN
endif
Store val(paidytd)+acctytd to acctytd
Store prevowed to accnt&N
Store newpaid to acctpr&N
Store acctpr+newpaid to acctpr
Store newowed to acctp&N
Store acctp+newowed to acctp
Store $(account,2,23)+paidytd to accname&N
Store $(account,1,2) to inaccnt
Store val(newpdate) to acctrcv&N
Store acctrcv+acctrcv&N to acctrcv
Do while account=inaccnt .and. .not. EOF
SKIP
enddo
enddo
GOTO TOP
Store N to NN
Do while !(NSEL)<>'D' .and. !(NSEL)<>'Q' .and. !(NSEL)<>'A'
erase
@ 0,1 say MFILE
@ 0,62 say curdate
@ 1,16 say CHNAME+' Monthly Budget - by Department'
If !(NSEL)='B'
@ 2,35 say '*******'
endif
@ 3,23 say ' Year- current current current current projectd'
@ 4,5 say 'Department to-date month received month month'
@ 4,73 say 'BALANCE'
@ 5,23 say ' actual budget balance actual projectd ON-HAND'
Store '0' to N
Set colon off
Do while N<>NN
Store val(N)+1 to I
Store str(I,1) to N
@ I+6,0 say accname&N
If !(NSEL)='B'
@ I+6,32 get accnt&N
else
@ I+6,32 say accnt&N
endif
@ I+6,42 say str(acctrcv&N,9,2)
@ I+6,51 say str(acctp&N,9,2)
@ I+6,60 say acctpr&N
Store acctrcv&N-acctp&N-acctpr&N to acctbal
@ I+6,70 say acctbal
Store acctbal+acctbala to acctbala
enddo
@ I+7,23 say '--------- -------- ------- ------- -------- --------'
READ
Store accnt1+accnt2+accnt3+accnt4+accnt5+accnt6+accnt7+accnt8+accnt9 to accnt
@ I+8,22 say acctytd
@ I+8,32 say accnt
@ I+8,42 say str(acctrcv,9,2)
@ I+8,51 say str(acctp,9,2)
@ I+8,60 say acctpr
@ I+8,70 say acctbala
?
? 'Select: [B]udget editing [A]dd a department [R]eport'
Accept ' [E]dit a department [D]elete a department [Q]uit ' to NSEL
Store $(nsel,1,1) to xx
Do while @(XX,'BbAaDdEeQqRr')=0
Accept 'Invalid entry. Please enter again ' to nsel
Store $(nsel,1,1) to xx
enddo
Do case
CASE !(NSEL)='B'
Store '0' to N
CASE !(NSEL)='E'
Store '0' to N
Do while N<>'9'
Store str(val(N)+1,1) to N
Release acctp&n,acctpr&n,acctrcv&N,accname&n,acctytd&N
enddo
Release acctp,acctpr,acctact,acctrcv,acctprb,acctbal,inaccnt,accnt,NNN
Do CFBUDGDE.CMD
CASE !(NSEL)='A'
If NN='9'
? 'Illegal ADD - 9 maximum Departments allowed.'
else
If NNN<>'0'
Store NNN to NN
else
Store str(val(NN)+1,1) to NN
endif
Clear gets
Set colon on
Store ' ' to N
@ I+13,8 say 'Enter DEPARTMENT NAME ' get N
READ
Set colon off
Append blank
Replace account with 'D'+nn+' '+N
Replace paidytd with ' 0.00'
Replace newpdate with ' 0.00'
endif
CASE !(NSEL)='D'
?
Accept ' Enter DEPARTMENT number to be deleted ' to N
If !(N)='1'
? 'Invalid Department. Can't delete "Utilities"'
else
Store 'D'+N to N
Find &N
If #=0
?
? ' Department number not found. '
else
If val(paidytd)<>0 .or. newpaid<>0 .or. newpdate<>' 0.00'
? ' Invalid DELETE request. This Department has paid amounts.'
else
Replace account with 'ED '+$(account,5,30)
Replace newpdate with date()
? ' Department',account,'is deleted.'
Do while ACCOUNT=N
DELETE
SKIP
enddo
endif
endif
endif
CASE !(NSEL)='R'
Set format to print
GOTO TOP
@ 0,2 say MFILE
@ 0,60 day curdate
@ 1,15 say CHNAME+' Monthly Budget - by Department'
@ 3,23 say ' Year- current current current current projectd'
@ 4,5 say 'Department to-date month received month month'
@ 4,73 say 'BALANCE'
@ 5,23 say ' actual budget balance actual projectd ON-HAND'
Store '0' to N
Set colon off
Do while N<>NN
Store val(N)+1 to I
Store str(I,1) to N
@ I+6,0 say accname&N
@ I+6,32 say accnt&N
@ I+6,42 say str(acctrcv&N,9,2)
@ I+6,51 say str(acctp&N,9,2)
@ I+6,60 say acctpr&N
Store acctrcv&N-acctp&N-acctpr&N to acctbal
@ I+6,70 say acctbal
Store acctbal+acctbala to acctbala
enddo
@ I+7,23 say '--------- -------- ------- ------- -------- --------'
@ I+8,22 say acctytd
@ I+8,32 say accnt
@ I+8,42 say str(acctrcv,9,2)
@ I+8,51 say str(acctp,9,2)
@ I+8,60 say acctpr
@ I+8,70 say acctbala
EJECT
Set format to screen
CASE !(NSEL)='Q'
GOTO TOP
Store $(account,1,2) to inaccnt
If inaccnt<>'D1'
? 'Department 1 lead code =',inaccnt,'which is invalid ("D1").'
Accept 'The ACCOUNT file must be fixed or re-built. Press <retn> ' to xx
else
Store '0' to N
Do while N<>NN .and. .not. EOF
Store str(val(N)+1,1) to N
Replace prevowed with accnt&N
Store $(account,1,2) to inaccnt
Do while account=inaccnt
SKIP
enddo
enddo
endif
ENDCASE
ENDDO
ENDDO
Release inval1,accnt1,accnt2,accnt3,accnt4,accnt5,accnt6,accnt7,accnt8,accnt9
ENDDO
Set colon on
USE
Select primary
Use
Release acct,NN,NNN,acctytd,accnt,inaccnt,acctp,acctact,acctrcv,acctpr,acctbala
Store '0' to N
Do while N<>'9'
Store str(val(N)+1,1) to N
Release ACCNAME&N,acctrcv&N,acctytd&N,acctpr&N,acctp&N,accnt&N
enddo
Store T to LEVEL2
Store T to validd1
Store '1' to msel
RETURN