237 lines
7.1 KiB
Plaintext
237 lines
7.1 KiB
Plaintext
|
* MSD.PLEDGE.REPORT
|
|||
|
***********************************************************************
|
|||
|
* AUTHOR / DATE / PURPOSE *
|
|||
|
***********************************************************************
|
|||
|
*
|
|||
|
* BY: ED HOUSE 01-12-90
|
|||
|
*
|
|||
|
* PURPOSE: Generate a report to show giving record of each partner based
|
|||
|
* on their Pledges.
|
|||
|
*
|
|||
|
* UPDATED:
|
|||
|
*
|
|||
|
* WAG 01-23-90 : To default out of program if no items selected
|
|||
|
*
|
|||
|
* ELH 02-12-90 : Create TOTALS line.
|
|||
|
*
|
|||
|
***********************************************************************
|
|||
|
* OPENS / INCLUDES / DIMENSIONS / VARIABLE INITIALIZATION *
|
|||
|
***********************************************************************
|
|||
|
*
|
|||
|
OPEN "TITLE" TO TITLE ELSE ABORT
|
|||
|
OPEN "PM.PLEDGES" TO PMP ELSE ABORT
|
|||
|
OPEN "PM.TRANS" TO PMT ELSE ABORT
|
|||
|
OPEN "PM" TO PM ELSE ABORT
|
|||
|
OPEN "TEMP.WORK" TO PLG.WORK ELSE ABORT
|
|||
|
*
|
|||
|
$INCLUDE GEN.COM2
|
|||
|
*
|
|||
|
DIM PART.NUM(40)
|
|||
|
DIM NAME(40)
|
|||
|
DIM PLG.DTE(40)
|
|||
|
DIM PLG.AMT(40)
|
|||
|
DIM PLG.PD(40)
|
|||
|
DIM TRAN.AMT(40)
|
|||
|
DIM TRAN.DTE(40)
|
|||
|
DIM PLG.BAL(40)
|
|||
|
DIM PLG.CNT(40)
|
|||
|
DIM TRAN.CNT(40)
|
|||
|
*
|
|||
|
MAT PART.NUM=''
|
|||
|
MAT NAME=''
|
|||
|
MAT PLG.DTE=''
|
|||
|
MAT PLG.AMT=''
|
|||
|
MAT PLG.PD=''
|
|||
|
MAT TRAN.AMT=''
|
|||
|
MAT TRAN.DTE=''
|
|||
|
MAT PLG.BAL=''
|
|||
|
MAT PLG.CNT=''
|
|||
|
MAT TRAN.CNT=''
|
|||
|
*
|
|||
|
EOF=0
|
|||
|
TST=0
|
|||
|
P.CNT=0
|
|||
|
EXS=''
|
|||
|
PRINT.LINE=''
|
|||
|
TOT.PLG=0
|
|||
|
TOT.TRAN=0
|
|||
|
TOT.PD=0
|
|||
|
TOT.BAL=0
|
|||
|
*
|
|||
|
***********************************************************************
|
|||
|
* PAINT SCREEN *
|
|||
|
***********************************************************************
|
|||
|
*
|
|||
|
WHO = ICONV('','U50BB')
|
|||
|
OPR = FIELD(WHO,' ',2)
|
|||
|
PORT = FIELD(WHO,' ',1)
|
|||
|
HD = "** ":OPR:" **"
|
|||
|
HDL = (80-LEN(HD))/2
|
|||
|
HD2 = TIMEDATE()
|
|||
|
HDL2 = 79-LEN(TIMEDATE())
|
|||
|
STR80 = STR('=',80)
|
|||
|
CRT @(-1)
|
|||
|
CRT @(HDL,0):HD
|
|||
|
CRT @(0,0):"MASTER SOFTWARE DESIGN, INC."
|
|||
|
CRT @(HDL2,0):HD2
|
|||
|
CRT @(0,1):STR80
|
|||
|
CRT @(0,2):CR:"MSD.PLEDGE.REPORT.RANGE"
|
|||
|
CRT @(17,3):RV:" P L E D G E / G I V I N G R E P O R T ":ERV
|
|||
|
CRT @(0,6):"Do you want to process this report (Y/N)?":
|
|||
|
INPUT Y.N
|
|||
|
IF Y.N # "Y" THEN
|
|||
|
GO 9999
|
|||
|
END
|
|||
|
10 *
|
|||
|
PRINT @(0,8):CR
|
|||
|
CRT @(0,8):"Enter Beginning Date: ":
|
|||
|
INPUT DATE1
|
|||
|
IF DATE1="/" THEN GO 9999 ELSE IF ICONV(DATE1,"DJ")="" THEN GO 10
|
|||
|
BEG.DATE=ICONV(DATE1,"DJ")
|
|||
|
PRINT @(22,8):OCONV(BEG.DATE,"D2/")
|
|||
|
20 *
|
|||
|
CRT @(0,10):CL:"Enter Ending Date: ":
|
|||
|
INPUT DATE2
|
|||
|
IF DATE2="/" THEN GO 9999 ELSE IF ICONV(DATE2,"DJ")="" THEN GO 20
|
|||
|
END.DATE=ICONV(DATE2,"DJ")
|
|||
|
PRINT @(19,10):OCONV(END.DATE,"D2/")
|
|||
|
IF END.DATE < BEG.DATE THEN GO 10
|
|||
|
EXECUTE"EX PRINTER"
|
|||
|
*
|
|||
|
***********************************************************************
|
|||
|
* REPORT PROCESSING *
|
|||
|
***********************************************************************
|
|||
|
*
|
|||
|
*ELH* EXS='SSELECT PM.PLEDGES BY LNAME BY FNAME WITH PLEDGE.DATES GE "':BEG.DATE:'" AND LE "':END.DATE:'" OR WITH '
|
|||
|
*ELH* EXS=EXS:'TRANS.DATES GE "[':BEG.DATE:']" AND LE "[':END.DATE:']"'
|
|||
|
*ELH* EXECUTE EXS RETURNING ERRS
|
|||
|
*ELH* IF ERRS = 401 THEN GO 9999 ;* End - none selected
|
|||
|
*
|
|||
|
PRINTER ON
|
|||
|
*
|
|||
|
HEAD1="PAGE 'P' HIGHER DIMENSION EVANGELICAL CHURCH 'DLLC'PLEDGE REPORT'LLC'"
|
|||
|
HEAD1=HEAD1:"DATE RANGE OF PLEDGE AND/OR TRANSACTION: ":OCONV(BEG.DATE,"D2/"):" - ":OCONV(END.DATE,"D2/"):"'LL'"
|
|||
|
HEAD1=HEAD1:" Pledge Pledge Pledge Paid Trans. Trans. Pledge'L'"
|
|||
|
HEAD1=HEAD1:"Partner Name / Address Date Amount (#) Amount Amount (#) Date Balance'L'"
|
|||
|
HEAD1=HEAD1:STR("-",129)
|
|||
|
HEADING HEAD1
|
|||
|
*
|
|||
|
CLEARFILE PLG.WORK
|
|||
|
*
|
|||
|
SELECT PM
|
|||
|
*
|
|||
|
LOOP
|
|||
|
READNEXT KEY ELSE EOF=1
|
|||
|
UNTIL EOF DO
|
|||
|
TST=TST+1
|
|||
|
READ PM.REC FROM PM,KEY THEN
|
|||
|
READ PMP.REC FROM PMP,KEY THEN
|
|||
|
READ PMT.REC FROM PMT,KEY THEN
|
|||
|
QUAL=0
|
|||
|
CNT=DCOUNT(PMT.REC<2>,VM)
|
|||
|
FOR X=1 TO CNT
|
|||
|
IF PMT.REC<2,X> GE BEG.DATE AND PMT.REC<2,X> LE END.DATE AND PMT.REC<15,X> # "" THEN QUAL=1
|
|||
|
NEXT X
|
|||
|
CNT=DCOUNT(PMP.REC<2>,VM)
|
|||
|
FOR X=1 TO CNT
|
|||
|
IF PMP.REC<2,X> GE BEG.DATE AND PMP.REC<2,X> LE END.DATE THEN QUAL=1
|
|||
|
NEXT X
|
|||
|
IF QUAL=1 THEN WRITE KEY ON PLG.WORK,KEY
|
|||
|
END
|
|||
|
END
|
|||
|
END
|
|||
|
REPEAT
|
|||
|
*
|
|||
|
DATA "SSELECT PM BY LNAME BY FNAME"
|
|||
|
EXECUTE "SELECT TEMP.WORK"
|
|||
|
*
|
|||
|
EOF=0
|
|||
|
*
|
|||
|
LOOP
|
|||
|
READNEXT KEY ELSE EOF=1
|
|||
|
UNTIL EOF DO
|
|||
|
READ PM.REC FROM PM,KEY THEN
|
|||
|
READ PMP.REC FROM PMP,KEY THEN
|
|||
|
READ PMT.REC FROM PMT,KEY THEN
|
|||
|
READ TITLE.REC FROM TITLE,PM.REC<1> THEN
|
|||
|
PART.NUM(1)=KEY
|
|||
|
IF TITLE.REC # "" THEN
|
|||
|
NAME(1)=TITLE.REC:" ":PM.REC<2>:" ":PM.REC<5>
|
|||
|
END ELSE
|
|||
|
NAME(1)=PM.REC<2>:" ":PM.REC<5>
|
|||
|
END
|
|||
|
NAME(2)=PM.REC<6>
|
|||
|
NAME(3)=PM.REC<7>:", ":PM.REC<8>:" ":PM.REC<9>
|
|||
|
MATPARSE PLG.DTE FROM PMP.REC<2>,"<22>"
|
|||
|
MATPARSE PLG.PD FROM PMP.REC<11>,"<22>"
|
|||
|
MATPARSE PLG.BAL FROM PMP.REC<12>,"<22>"
|
|||
|
FOR X1=1 TO DCOUNT(PMP.REC<1>,VM)
|
|||
|
PLG.AMT(X1)=PMP.REC<7,X1>/100
|
|||
|
PLG.CNT(X1)=" (":PMP.REC<1,X1>:")"
|
|||
|
PLG.PD(X1)=PLG.PD(X1)/100
|
|||
|
PLG.BAL(X1)=PLG.BAL(X1)/100
|
|||
|
NEXT X1
|
|||
|
POS=DCOUNT(PMT.REC<15>,VM)+1
|
|||
|
X1=0
|
|||
|
LOOP
|
|||
|
POS=POS-1
|
|||
|
UNTIL POS=0 DO
|
|||
|
IF PMT.REC<15,POS> # "" THEN
|
|||
|
X1=X1+1
|
|||
|
TRAN.AMT(X1)=PMT.REC<6,POS>/100
|
|||
|
TRAN.CNT(X1)=" (":PMT.REC<15,POS>:")"
|
|||
|
TRAN.DTE(X1)=PMT.REC<2,POS>
|
|||
|
END
|
|||
|
REPEAT
|
|||
|
X=0
|
|||
|
LOOP
|
|||
|
X=X+1
|
|||
|
TOT.PLG=TOT.PLG+PLG.AMT(X)
|
|||
|
TOT.TRAN=TOT.TRAN+TRAN.AMT(X)
|
|||
|
TOT.PD=TOT.PD+PLG.PD(X)
|
|||
|
TOT.BAL=TOT.BAL+PLG.BAL(X)
|
|||
|
IF PLG.AMT(X) = "" THEN FD1=STR(" ",16) ELSE FD1=PLG.AMT(X)'R2,($#11)':PLG.CNT(X)'L#4'
|
|||
|
IF PLG.PD(X) = "" THEN FD2=STR(" ",12) ELSE FD2=PLG.PD(X)'R2,($#11)'
|
|||
|
IF TRAN.AMT(X) = "" THEN FD3=STR(" ",16) ELSE FD3=TRAN.AMT(X)'R2,($#11)':TRAN.CNT(X)'L#4'
|
|||
|
IF PLG.BAL(X) = "" THEN FD4=STR(" ",12) ELSE FD4=PLG.BAL(X)'R2,($#11)'
|
|||
|
PRINT.LINE=PART.NUM(X)'L#8':" ":NAME(X)'L#35':" ":OCONV(PLG.DTE(X),"D2/")'L#8':" ":FD1:" ":FD2:" "
|
|||
|
PRINT.LINE=PRINT.LINE:FD3:" ":OCONV(TRAN.DTE(X),"D2/")'L#8':" ":FD4
|
|||
|
TEST.LINE=PART.NUM(X):NAME(X):PLG.DTE(X):PLG.AMT(X):PLG.PD(X):TRAN.AMT(X):TRAN.DTE(X):PLG.BAL(X)
|
|||
|
UNTIL TRIM(TEST.LINE) = "" DO
|
|||
|
P.CNT=P.CNT+1
|
|||
|
PRINT PRINT.LINE
|
|||
|
REPEAT
|
|||
|
IF P.CNT LE 40 THEN
|
|||
|
P.CNT=P.CNT+1
|
|||
|
PRINT STR("-",129)
|
|||
|
END ELSE
|
|||
|
P.CNT=0
|
|||
|
PAGE
|
|||
|
END
|
|||
|
MAT PART.NUM=''
|
|||
|
MAT NAME=''
|
|||
|
MAT PLG.DTE=''
|
|||
|
MAT PLG.AMT=''
|
|||
|
MAT PLG.PD=''
|
|||
|
MAT TRAN.AMT=''
|
|||
|
MAT TRAN.DTE=''
|
|||
|
MAT PLG.BAL=''
|
|||
|
MAT PLG.CNT=''
|
|||
|
MAT TRAN.CNT=''
|
|||
|
END
|
|||
|
END
|
|||
|
END
|
|||
|
END
|
|||
|
REPEAT
|
|||
|
IF P.CNT GT 50 THEN PAGE
|
|||
|
PRINT "TOTALS"'L#57':TOT.PLG'R2,($#11)':" "'L#6':TOT.PD'R2,($#11)':" ":TOT.TRAN'R2,($#11)':" "'L#16':TOT.BAL'R2,($#11)'
|
|||
|
PRINTER CLOSE
|
|||
|
*
|
|||
|
***********************************************************************
|
|||
|
* TERMINATE PROGRAM *
|
|||
|
***********************************************************************
|
|||
|
*
|
|||
|
9999 *
|
|||
|
*
|
|||
|
END
|