home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr3.zip
/
CFBNEWMO.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-01-21
|
3KB
|
109 lines
* Program CFBNEWMO - Updates the ACCOUNTS file for a new month.
Use
Select primary
Store d+':accounts' to MFILE
Use &MFILE index &MFILE
Store d+':ACCOUNTX' to NFILE
Copy structure to &NFILE
Select secondary
Use &NFILE
Select primary
GOTO TOP
?
? ' New ACCOUNTX file is now being created. ',curdate
?
? ' RECEIVED PAID NEW YTD NEW YTD '
?? ' Balance'
? ' Department THIS MONTH THIS MONTH RECEIVED PAID '
?? ' on hand'
?
Store 0.00 to RTMT
Store 0.00 to PTMT
Store 0.00 to RTYT
Store 0.00 to PTYT
Store 0.00 to boht
Store '0' to N
Do while N<>'9'.and.Account='D'.and. .not. EOF
Store str(val(N)+1,1) to N
Store $(account,1,2) to INDEPT
Select secondary
Append blank
Replace prevowed with P.prevowed
Replace PAIDYTD with str(val(P.PAIDYTD)+P.NEWOWED,9,2)
* Replace newpdate with str(val(P.NEWPDATE)-P.NEWOWED,8,2)
Replace newpdate with P.newpdate
Replace account with p.account
Store P.NEWOWED to ptm
Store paidytd to pty
Store 'R'+$(INDEPT,2,1)+' ' to INDEPTR
Store val(P.newpdate)-P.newowed to boh
Append blank
Replace account with indeptr+$(P.ACCOUNT,5,24)
Select primary
Store # to currec
Find &INDEPTR
* Append a Receivables record
Store val(paidytd) to rty
If #=0
Store ' 0.00' to rtm
Select secondary
? 'No Receivables found for Dept.',INDEPT
Replace PAIDYTD with ' 0.00'
else
Store newpaid to rtm
Select secondary
Replace PAIDYTD with str(val(P.PAIDYTD)+P.NEWPAID,9,2)
Replace prevowed with rtm+P.newpaid-ptm
endif
? $(account,2,22),rtm,ptm,paidytd,pty,boh
Store rtmt+rtm to rtmt
Store ptmt+ptm to ptmt
Store rtyt+val(paidytd) to rtyt
Store ptyt+val(pty) to ptyt
Store boht+boh to boht
Select primary
GOTO currec
Store 64 to I
Do while account=INDEPT .and. .not. EOF
SKIP
If !($(account,26,1))='C' .and. $(account,3,1)<>' '
Store prevowed+newowed-newpaid to powed
Select secondary
Append blank
Store I+1 to I
Store chr(I) to N
Replace account with $(P.account,1,2)+N+$(P.account,4,25)
Store 0.00 to npaid
If P.PP='*'
Store P.newpaid to npaid
endif
Replace paidytd with str(val(P.paidytd)+npaid,9,2)
Replace prevowed with powed
Select primary
endif
enddo
enddo
? ' -------- -------- -------- --------'
?? ' --------'
Store str(rtmt,12,2)+str(ptmt,12,2)+str(rty,10,2)+str(ptyt,10,2)+;
str(boht,12,2) to XX
? ' '+XX
?
Select secondary
Use
Select primary
Use
Accept 'Do you want the new ACCOUNTX file to be copied in place of ACCOUNTS? ';
to XX
If !(XX)='Y'
delete file &MFILE
Rename &NFILE to &MFILE
Use &MFILE
Index on account to &MFILE
? 'File',NFILE,'is now copied over file',MFILE,'.'
endif
RELEASE NFILE,RTMT,PTMT,rtyt,ptyt,boht,indept,ptm,pty,indeptr,boh,currec,powed
Release rtm,rty,npaid,acctact
RETURN
ect secondar