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

  1. *******************************************************************************
  2. *       STATEONE.PRG    This program allows you to print one statement        *
  3. *       at a time, instead of all the statements at once.                     *
  4. *******************************************************************************
  5. SET Talk OFF
  6. STORE T to Printout
  7. DO WHILE Printout
  8. ERASE
  9. STORE "               " to Mname
  10. USE Student
  11. DO WHILE .NOT. EOF
  12. SET Intensity OFF
  13. SET Color TO 9
  14. @ 2,24 SAY "CENTER YOUR COMPANY'S NAME HERE"
  15. SET Color to 112,7
  16. SET Intensity ON
  17. @ 13,1 SAY "Enter the student's last name or account number";
  18. GET Mname
  19. @ 19,20 SAY "Press >RETURN< (only) to abort this operation."
  20. READ NOUPDATE
  21.  
  22.  IF Mname = "               "
  23.   STORE F to Printout
  24.   RETURN
  25.  ELSE
  26.   IF VAL(Mname)>500
  27.    SET Index TO ID
  28.    STORE $(Mname,1,4) to Findstud
  29.   ELSE
  30.    SET Index TO Lname
  31.    STORE TRIM(Mname) to Findstud
  32.   ENDIF
  33.  ENDIF
  34. FIND &Findstud
  35. *
  36. IF #=0
  37.  STORE 0 to Counter
  38.  DO WHILE Counter<15
  39.  STORE Counter+1 to Counter
  40.  @ 22,0 SAY Findstud+" is not in the record file"
  41.  STORE "               " to Mname
  42. ENDIF
  43. @ 22,0
  44. *
  45. IF #>0
  46.  STORE # to Placemark
  47. *
  48. IF .NOT. Acct:num=Findstud .OR. .NOT. Lname=Findstud
  49.  SKIP
  50.  IF Lname=Findstud .AND..NOT.EOF
  51.    ERASE
  52.    @ 1,1 SAY "Mercy to Betsy!  It would appear we have more than one ";
  53.    +Findstud
  54.    SKIP -1
  55.    ?
  56.    DISPLAY Fname,Lname WHILE Lname=Findstud
  57.    ?
  58.    INPUT "Enter the number from the left column, or enter (numerical);
  59.  0 to abort" to Placemark
  60.   ENDIF
  61. ENDIF
  62.  
  63. IF Placemark>0
  64.  GO Placemark
  65.  COPY Next 1 TO Tempfile
  66.  USE Tempfile
  67. *
  68. SELECT Secondary
  69.  USE Payments
  70.  INDEX on dacct:num TO PID
  71.  SET Index TO PID
  72.  Find &Findstud
  73.  
  74.  
  75. IF #>0
  76.  STORE " " to Post
  77.  ERASE
  78.  @ 7,3 SAY 'Are there any payments or credits in the "Payments" file that ;
  79. should be'
  80.  @ 9,3 SAY "posted to the student's account before the statement is ;
  81. printed (Y/N)?"
  82.  DO WHILE .NOT. Post$"YN"
  83.  @ 12,40 GET Post PICTURE "!"
  84.  READ NOUPDATE
  85.  ENDDO
  86. *
  87. IF Post="Y"
  88.  SUM Dcredits FOR Dacct:num=Placemark to Stucred
  89.  SUM Damount FOR Dacct:num=Placemark to Stupay
  90.  STORE Stucred+Stupay to Mcredit
  91.  SELECT Primary
  92.  REPLACE Curpayment WITH Mcredit
  93. ENDIF
  94. ELSE
  95.  SELECT Primary
  96. ENDIF
  97. *
  98. ERASE
  99. STORE "         " to Mmonth
  100. STORE "  " to Mlessons
  101. @ 5,5 SAY "SPELL the name of the month in which current lessons occurred."
  102. @ 7,35 GET Mmonth PICTURE "!XXXXXXXX"
  103. @ 11,5 SAY 'How many CURRENT lessons are we billing for?'
  104. @ 13,40 GET Mlessons
  105. READ NOUPDATE
  106. REPLACE Month WITH Mmonth
  107. REPLACE Lessons WITH VAL(Mlessons)
  108. *
  109. DO Stateall
  110. CLEAR Gets
  111. ENDDO
  112. ENDDO
  113. DELETE FILE Tempfile
  114. RELEASE Findstud,Placemark,Mcredit,Mmonth,Stucred,Stupay,Mlessons,Printout,;
  115. Counter
  116. SET Talk ON
  117. RETURN
  118. * EOF
  119.  
  120.  
  121.  
  122. 
  123.  READ NOUPDATE
  124.  ENDDO
  125. *
  126. IF Post="Y"
  127.  SUM Dcredits FOR Dacct:num=Placemark to Stucred
  128.  SUM Damount FOR Dacct:num=Placemark to Stupay
  129.  STORE Stucred+Stupay to Mcredit
  130.  SELECT Primary
  131.  REPLACE Curpayment WITH Mcredit
  132. ENDIF
  133. ELSE
  134.  SELECT Primary
  135. ENDIF
  136. *
  137. ERASE
  138. S