home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / dbaseii / tdas.ark / STUD5-6.PRG < prev    next >
Encoding:
Text File  |  1986-08-24  |  3.5 KB  |  124 lines

  1. *******************************************************************************
  2. *       This program generates a report of monthly "activity" on              *
  3. *       each student's account.  ...Beginning balance, amount of current      *
  4. *       billing, payments received, and net balance due. STUD5-6.PRG          *
  5. *******************************************************************************
  6. SET Talk OFF
  7. ERASE
  8. *
  9. STORE 0 to totalbal,totalpay,totalchg,totalcrt,page
  10. SET format TO Print
  11. SET Print ON
  12. SET Console OFF
  13. ? CHR(27) + CHR(66) + CHR(2)
  14. ? CHR(27)+Chr(77)+CHR(3)
  15. SET Console ON
  16. SET Print OFF
  17. SET Format to Screen
  18. @ 6,16 SAY "This will take 10 minutes or so.  Take a break!"
  19. SET Format to Print
  20.  
  21. USE Student
  22. SET Index TO Lname
  23. DO WHILE .NOT. EOF
  24.   STORE Page+1 to Page
  25. STORE 'January  February March    April    May      June     '+;
  26. 'July     August   SeptemberOctober  November December ' to Date:str
  27. *
  28. STORE TRIM($(Date:str, VAL($(Cdate,1,2))*9-8,9))+" " +;
  29.   $(Cdate,4,2)+", 19"+$(Cdate,7,2) TO Sdate
  30. *
  31. @ 2,4  SAY 'Page '+STR(Page,1)
  32. @ 2,71 SAY Sdate
  33.   ENDIF
  34.   STORE CHR(174) to A
  35.   STORE CHR(173) to B
  36.   STORE CHR(126) to C
  37.    @ 4,29 SAY "CENTER YOUR COMPANY'S NAME HERE"
  38.    @ 6,27 SAY 'Summary of Activity for Prior Month'
  39.    @ 8,27 SAY "(Including This Month's NEW Billing)"
  40.    @ 10,36 SAY A+B+A+B+A+B+A+B+A+B+A+B+A+B+A+B+A
  41.   @ 12,15 SAY '                     STARTING    PAYMENTS     CREDIT     ;
  42.   NEW           NEW'
  43.   @ 13,1 SAY 'ACCT             NAME               BALANCE    RECEIVED;
  44.      ISSUED     BILLING       BALANCE'
  45.   @ 14,1 SAY C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C;
  46. +C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C;
  47. +C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C+C
  48.   STORE 15 to Line
  49.  
  50.   DO WHILE Line<56 .AND. .NOT. EOF
  51.     SELECT Secondary
  52.     STORE P.Acct:Num to Mcustid
  53.     USE Payments INDEX PID
  54.     FIND &Mcustid
  55.     SUM DCredits TO Custcrt FOR Dacct:num=Mcustid
  56.     SUM DAmount TO Custpay FOR Dacct:num=Mcustid
  57.     STORE P.Lessons*P.Rate TO Custchgs
  58.     @ Line,1 SAY P.Acct:Num
  59.     *
  60.     IF Lname="Zz"
  61.      @ Line,6 SAY "New Trier High School"
  62.     ELSE
  63.     @ Line,6 SAY P.Fname
  64.     @ LINE,17 SAY P.Lname
  65.     ENDIF
  66.     *
  67.     @ Line,35 SAY STR(P.Balance,8,2)
  68.  
  69.     IF Custpay<>0
  70.       @ Line,48 SAY STR(custpay,8,2)
  71.     ENDIF
  72.  
  73.     IF Custcrt<>0
  74.       @ Line,60 SAY STR(Custcrt,8,2)
  75.     ENDIF
  76.  
  77.     IF Custchgs<>0
  78.       @ Line,71 SAY STR(custchgs,8,2)
  79.     ENDIF
  80.  
  81.     IF P.Balance-Custpay-Custcrt+Custchgs = 0
  82.       @ Line,89 SAY "---"
  83.     ELSE
  84.       @ Line,85 SAY STR(P.Balance-Custpay-Custcrt+Custchgs,8,2)
  85.     ENDIF
  86. *
  87.     STORE Line+1 to Line
  88.     STORE totalbal+P.Balance to totalbal
  89.     STORE totalpay+custpay to totalpay
  90.     STORE totalchg+custchgs to totalchg
  91.     STORE Totalcrt+Custcrt to Totalcrt
  92.     Select Primary
  93.     SKIP
  94.   ENDDO
  95.  
  96.   IF EOF
  97.     STORE Line+2 to Line
  98.       @ Line,15 SAY 'TOTALS'
  99.       @ Line,35 SAY STR(totalbal,9,2)
  100.       @ Line,48 SAY STR(totalpay,9,2)
  101.       @ Line,60 SAY STR(totalcrt,9,2)
  102.       @ Line,71 SAY STR(totalchg,9,2)
  103.       @ Line,85 SAY STR(totalbal-totalpay-totalcrt+totalchg,9,2)
  104.     ENDIF
  105.     EJECT
  106. ENDDO
  107. SET Format TO Screen
  108. Select Secondary
  109. USE
  110. Select Primary
  111. USE
  112. RETURN
  113. * EOF
  114.  
  115. TR(totalbal,9,2)
  116.       @ Line,48 SAY STR(totalpay,9,2)
  117.       @ Line,60 SAY STR(totalcrt,9,2)
  118.       @ Line,71 SAY STR(totalchg,9,2)
  119.       @ Line,85 SAY STR(totalbal-totalpay-totalcrt+totalchg,9,2)
  120.     ENDIF
  121.     EJECT
  122. ENDDO
  123. SET Format TO Screen
  124. Select Se