home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr3.zip
/
CFBUDGPC.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-01-21
|
5KB
|
174 lines
* Program CFBUDGPC - Prints/Posts payments marked "posted" onto check forms.
Use
Select primary
USE BDIRFILE index BDIRFILE
GOTO 18
Store !($(spact,31,1)) to plong
SKIP
Store val($(spact,26,2)) to chkdater
Store val($(spact,29,2)) to chkdatec
SKIP
Store val($(spact,27,2)) to chklamtr
Store val($(spact,30,2)) to chklamtc
SKIP
Store val($(spact,27,2)) to chksamtr
Store val($(spact,30,2)) to chksamtc
SKIP
Store val($(spact,26,2)) to chknamer
Store val($(spact,29,2)) to chknamec
GOTO 25
Store val($(spact,27,2)) to chkspacing
Store d+':ACCOUNT'+DF to MFILE
USE &MFILE index &MFILE
?
If msel='4'
Accept 'Now about to post payments for all marked amounts. OK? ' to xx
else
Accept 'Now about to print checks for all amounts marked to be posted. OK? ' ;
to XX
endif
If !(xx)<>'Y'
RETURN
endif
?
? ' Expenditures Postings - ',curdate
Store 'one two threefour five six seveneightnine ' to snumber
Store 'ten eleven twelve thirteen fourteen fifteen ' to snumteen
Store snumteen+'sixteen seventeeneighteen nineteen ' to snumteen
Store 'twenty thirty forty fifty sixty seventyeighty ninety ' to snumtens
Store F to ENDOF
If msel='3'
Set format to print
endif
Store $(account,1,2) to dept
If dept<>'D1'
Accept 'Invalid ACCOUNTS file. No "D1" Department. Press <retn> ' to xx
RETURN
endif
Do while .not. ENDOF
Store 0.00 to newpaidt
Store $(account,1,2) to dept
Store # to curdept
SKIP
Store F to posted
Store 0 to ln
Do while account=DEPT .and. .not. ENDOF
If msel='3'.and. !(PP)='C'
Store T to posted
Replace PP with '*C'
@ chkdater+ln,chkdatec say curdate
If plong='Y'
Store chklamtc to chkc
Store str(newpaid,8,2) to newp
If $(newp,2,1)<>' '
If $(newp,1,1)<>' '
@ chklamtr+ln,chkc say $(newp,1,2)+' thousand '
store chkc+12 to chkc
else
Store trim($(snumber,val($(newp,2,1))*5-4,5)) to tnewp
@ chklamtr+ln,chkc say tnewp+' thousand '
Store len(tnewp)+10+chkc to chkc
endif
endif
* Now do hundreds
Store val($(newp,3,1)) to N
If N>0
Store trim($(snumber,val($(newp,3,1))*5-4,5)) to tnewp
@ chklamtr+ln,chkc say tnewp+' hundred '
Store len(tnewp)+9+chkc to chkc
endif
Store val($(newp,4,2)) to N
If N>0
If N<20
If N>9
Store trim($(snumteen,N*9-89,9))+' ' to tnewp
else
Store trim($(snumber,val($(newp,4,2))*5-4,5))+' ' to tnewp
endif
else
Store trim($(snumtens,val($(newp,4,1))*7-13,7))+' ' to tnewp
If val($(newp,5,1))>0
Store tnewp+trim($(snumber,val($(newp,5,1))*5-4,5))+' ' to tnewp
endif
endif
@ chklamtr+ln,chkc say tnewp
Store len(tnewp)+chkc to chkc
endif
If chkc<>chklamtc
@ chklamtr+ln,chkc say 'and '
Store chkc+4 to chkc
endif
If val($(newp,7,2))>0
@ chklamtr+ln,chkc say $(newp,7,2)+'/100'
else
@ chklamtr+ln,chkc say 'no/100'
endif
endif
If chkc+6<chksamtc
@ chksamtr+ln,chksamtc say newpaid
else
? 'Error in long amount run-over - Only the long amount is printed.'
endif
@ chknamer+ln,chknamec say $(account,5,21)
If address<>' '
@ chknamer+ln+1,chknamec say address
@ chknamer+ln+2,chknamec say city:state
endif
Store chkspacing+ln to ln
If ln+chkspacing>66
EJECT
Store 0 to ln
endif
Replace PP with '*C'
REPLACE NEWPDATE WITH DATE()
Store newpaidt+newpaid to newpaidt
? ACCOUNT,NEWPAID
ENDIF * !(PP)='C' .and.MSEL='3'
If msel='4'.and.!(PP)='P'
Replace PP with '*P'
Replace newpdate with date()
Store T to posted
Store newpaidt+newpaid to newpaidt
? account,newpaid
endif
SKIP
If EOF .or. account<>'D'
Store T to ENDOF
endif
enddo
If posted
Store # to newdept
GOTO curdept
replace newowed with newowed+newpaidt
Replace newpaid with newpaid-newpaidt
GOTO newdept
endif
enddo
If msel='3'
EJECT
Set format to screen
endif
USE
Release chkdater,chkdatec,chknamer,chknamec,snumber,snumteen,snumtens,dept
Release chksamtr,chksamtc,chklamtr,chklamtc,curdept,newpaidt,posted,chkc
Release newp,tnewp,newpaidt,newdept,curdept,plong,chkspacing,endof,acctbal,ln
Accept 'All postings are complete. Press <RETURN> ' to N
RETURN
$(spact,27,2)) to chkspacing
Store d+':ACCOUNT'+DF to MFILE
USE &MFILE index &MFILE
?
If msel='4'
Accept 'Now about to post payments for all marked amounts. OK? ' to xx
else
Accept 'Now about to print checks for all amounts marked to be posted. OK? ' ;
to XX
endif
If !(xx)<>'Y'
RETURN
endif
?
? ' Expenditures Postings - ',curdate
Store 'one two threefour five six seveneightnine ' to snumber
Store 'ten eleven twelve thirteen fourteen fifteen ' to snumteen
St