home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG102.ARC
/
LEDGERII.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
5KB
|
166 lines
*LEDGERII.PRG
*PREPARE A STATEMENT FROM THE NAMELIST WHERE THERE IS
*A BALANCE IN THE ACCOUNT BUT NO TRADING DURING THE MONTH
RELEASE ALL
RESTORE FROM A:NAME
SELECT PRIMARY
GO TOP
SET INTENSITY OFF
STORE 0 TO SBAL
ERASE
@ 15,0 SAY '*****************SYSTEM WORKING LEDGERII.PRG ******************'
SET CONSOLE OFF
SET FORMAT TO PRINT
SET TALK OFF
DO WHILE T
DO WHILE .NOT. EOF
IF STATDATE=DATE() .OR. LAST:BAL <0 .OR. LAST:BAL=0
SKIP
LOOP
ENDIF
STORE ACCNUM TO ACCNUMA
STORE NAME TO NAMEA
STORE STREET TO STREETA
STORE CITYPC TO CITYPCA
STORE LAST:BAL TO SBAL
STORE THIRTY TO THIRTY:BAL
STORE SIXTY TO SIX:BAL
STORE NINETY TO NINE:BAL
SET PRINT ON
STORE 0 TO X
**** HEADING
?? &NORMAL
@ 1,0 SAY TRIM(LINE1)
@ 1,50 SAY TRIM(SLINE1)
@ 2,0 SAY TRIM(LINE2)
@ 2,50 SAY TRIM(SLINE2)
@ 3,0 SAY TRIM(LINE3)
@ 3,50 SAY TRIM(SLINE3)
@ 4,0 SAY TRIM(SLINE3)
@ 4,50 SAY TRIM(LINE4)
@ 5,0 SAY TRIM(LINE5)
@ 5,50 SAY TRIM(SLINE5)
@ 8,10 SAY 'ACCOUNT NUMBER'
@ 8,30 SAY ACCNUMA
@ 8,51 SAY 'ACCOUNT NUMBER'
@ 8,72 SAY ACCNUMA
@ 12,10 SAY NAMEA
@ 12,50 SAY NAMEA
@ 13,10 SAY STREETA
@ 13,50 SAY STREETA
@ 14,10 SAY CITYPCA
@ 14,50 SAY CITYPCA
@ 17,0 SAY'INTEREST OF 10% PER ANNUM MAY BE CHARGED ON OVERDUE ACCOUNTS'
@ 19,0 SAY 'STATEMENT FOR PERIOD ENDING'
@ 19,37 SAY DATE()
@ 19,50 SAY 'PERIOD ENDING'
@ 19,65 SAY DATE()
@ 21,0 SAY 'DATE'
@ 21,7 SAY 'REFERENCE'
@ 21,19 SAY 'DEBIT'
@ 21,27 SAY 'CREDIT'
@ 21,38 SAY 'BALANCE'
@ 21,50 SAY 'DATE'
@ 21,58 SAY 'REFER'
@ 21,67 SAY 'AMOUNT'
?? &COMPRESS
**************************************************
@ 23,0 SAY 'BALANCE BROUGHT FORWARD FROM LAST PERIOD'
@ 23,64 SAY SBAL
@ 23,85 SAY 'BAL. B/F'
@ 23,115 SAY SBAL
**********************IF SIXTY DAYS OVER DUE ADD INTEREST****
IF SIX:BAL <>0 .OR. NINE:BAL <>0
@ 26,0 SAY'INTEREST ON OVERDUE ACCOUNT '
@ 27,0 SAY'CALCULATED AT 10% PER ANNUM '
@ 28,0 SAY'ON THE OUTSTANDING AMOUNT OF'
@ 28,29 SAY SBAL
@ 29,0 SAY 'AT 10% PER ANNUM PER MONTH'
*TO GIVE CALCULATOR RESULTS TO TWO DECIMAL PLACES
********************ROUNDOFF DECIMAL TO TWO PLACES************
STORE (SBAL*.1)/12 TO INT
***********************************CONVERT $ TO STRING
STORE STR(INT,10,3) TO R
***********************************ESTABLISH DEC POINT IN STRING
STORE @('.',R) TO POINT
*****************BREAKUP STRING AND ISOLATE THIRD CHAR RIGHT OF DECIMAL POINT
*****************CONVERT TO NUMERAL
STORE VAL($(R,POINT+3,1)) TO DECIMAL
**************************************ROUND UP
IF DECIMAL>5
STORE (1/100)-(DECIMAL/1000) TO ROUND
STORE INT+ROUND TO INT
ENDIF
**************************************ROUND DOWN
IF DECIMAL<6
STORE DECIMAL/1000 TO ROUND
STORE INT-ROUND TO INT
ENDIF
**************************************************************
@ 29,33 SAY INT USING '####.##'
@ 32,0 SAY 'WE FIND IT MOST DISTURBING'
@ 33,0 SAY 'THAT YOU HAVE NOT BROUGHT'
@ 34,0 SAY 'THIS ACCOUNT UPTO DATE EARLIER,'
@ 35,0 SAY 'AND CONSIDERING THAT WE HAVE'
@ 36,0 SAY 'TO PAY FOR OUR GOODS IN'
@ 37,0 SAY 'ADVANCE , IT DISTRESSESS US'
@ 38,0 SAY 'TO HAVE TO REMIND YOU THAT'
@ 39,0 SAY 'YOUR ACCOUNT IS OVERDUE'
STORE INT+SBAL TO SBAL
ENDIF
@ 54,0 SAY 'PAYMENTS RECEIVED AFTER THE '
@ 54,28 SAY DATE()
@ 54,36 SAY ' HAVE NOT BEEN INCLUDED IN THIS STATEMENT'
@ 57,0 SAY 'OVERDUE 90 DAYS'
@ 57,22 SAY 'OVERDUE 60 DAYS'
@ 57,43 SAY 'OVERDUE 30 DAYS'
@ 57,66 SAY 'BALANCE'
@ 59,0 SAY NINE:BAL
@ 59,22 SAY SIX:BAL
@ 59,43 SAY THIRTY:BAL
@ 59,66 SAY SBAL USING '######.##'
@ 59,83 SAY'BALANCE'
@ 59,115 SAY SBAL USING '######.##'
@ 62,0 SAY 'OVERDUE AND PAYABLE IMMEDIATELY'
@ 62,66 SAY SBAL USING '######.##'
@ 62,85 SAY 'AMOUNT PAID'
@ 63,0
REPLACE NINETY WITH NINETY+SIXTY
REPLACE SIXTY WITH THIRTY
IF SIX:BAL<>0 .OR. NINE:BAL <>0
REPLACE THIRTY WITH (SBAL*.1)/12
ELSE
REPLACE THIRTY WITH 0
ENDIF
REPLACE LAST:BAL WITH SBAL
REPLACE STATDATE WITH DATE()
SKIP
ENDDO
SET TALK ON
SET CONSOLE ON
SET PRINT ON
?? &NORMAL
SET PRINT OFF
SET FORMAT TO SCREEN
RETURN
T BUT NO TRADING DURING THE MONTH
RELEASE ALL
RESTORE FROM A:NAME
SELECT PRIMARY
GO TOP
SET INTENSITY OFF
STORE 0 TO SBAL
ERASE
@ 15,0 SAY '*****************SYSTEM WORKING LEDGERII.PRG ******************'
SET CONSOLE OFF
SET FORMAT TO PRINT
SET TALK OFF
DO WHILE T
DO WHILE .NOT. EOF
IF STATDATE=DATE() .OR. LAST:BAL <0 .OR. LAST:BAL=0
SKIP
LOOP
ENDIF
STORE