1  IDENTIFICATION DIVISION.
   2  
   3  PROGRAM-ID.    SRB$FEE_CALCULATION.
   4  AUTHOR.        DAVID HEISE.
   5  DATE-WRITTEN.  NOVEMBER 1992.
   6  DATE-COMPILED.
   7  *
   8  *******************************************************************************
   9  *
  10  * BUSINESS OFFICE STUDENT FEES CALCULATION
  11  *
  12  * Subroutine which may be called by any program which requires a fees
  13  * calculation
  14  *
  15  *******************************************************************************
  16  *
  17  *------------------------------------------------------------------------------
  18  * MODIFICATION HISTORY
  19  *
  20  *   Date   Modification                                                     Who
  21  *------------------------------------------------------------------------------
  22  * 15.05.98 Year 2000 compliance                                             EJR
  23  *          Merge SR_STUDENT_PERSONAL2 into SR_STUDENT_PERSONAL              .98
  24  * 11.09.97 Always return S_FE_FIN_REGO_REBATE = 0                           EJR
  25  *          (i.e. uncomment MOVE ZERO TO S_FE_FIN_REGO_REBATE)               .97
  26  * 17.03.97 Allow full-fee-paying O/S students to receive college scholarshp EJR
  27  * 22.01.97 *5 Remove 27.11.96 addition                                      EJR
  28  * 31.12.96 *4 Add S_P2_RESIDENCE_OPTION (Will become S_PE_...)              EJR
  29  * 27.11.96 Apply Dependents Discount to HECS for EDU students               EJR
  30  * 24.10.96 Part-restructure of fees for 1997.1 fee estimates                EJR
  31  *          Rename P_FE_FIN_REGO_REBATE to P_FE_TUITION_FEE_POST_97          .96
  32  *          and    P_FE_TUITION_FEE     to P_FE_TUITION_FEE_PRE_97           .96
  33  *          Registration rebate concept has changed to % discount for paying .96
  34  *          by the due date; ignore it here?  Discount details show on fee   .96
  35  *          schedule.                                                        .96
  36  *          Add SR_STUDENT_PERSONAL2                                         .96
  37  * 23.07.96 Read CI_PERSONAL immediately after SR_STUDENT_PERSONAL           EJR
  38  *          (was only reading for siblings)                                  .96
  39  * 29.01.96 Convert to new file formats and names                            EJR
  40  * 08.01.96 *SL1 Convert to automatically created GLEDYY.IDX                 DLH
  41  * 19.12.95 OSHC is if Returning After Absence as well as New students       DLH
  42  * 18.07.95 Handle starting_semester=0                                       EJR
  43  * 07.04.95 Remove special code for BEd 3+1                                  DLH
  44  * 26.10.94 OSHC fee (if S_PE_NZ_NON_RES_FEE flag is "S","F") from SRPFEES   EJR
  45  * 11.04.94 Convert to new SR_STUDENT_PERSONAL file and underscore_naming    EJR
  46  *          Add CI_PERSON_NAME_FILE                                          .94
  47  * 21.03.94 Dependents discount should be at indoor rates for                DLH
  48  *          all Wahroonga students                                           .94
  49  * 14.03.94 Ensure PR-STUDENT-LEDGER-FILE is open before READ                EJR
  50  * 03.05.93 Convert STUDENT-SUBJECT-FILE                                     DLH
  51  * 31.03.93 Rename SRB$FEES_CALCULATION to SRB$FEE_CALCULATION               DLH
  52  * 11.93.93 Full fee paying OS EDU students pay tuition                      DLH
  53  * 23.02.93 Round all recorded fees details to 10 cents (DIV BY 2 PROBLEM)   LJH
  54  * 19.01.93 Add year to CODE-COURSE-MASTER-FILE key                          MAR
  55  * 10.12.92 No board for B.Ed Primary 079 during practicum                   DLH
  56  * 10.12.92 No Facility Fees for subjects PP3501 & PP3511                    DLH
  57  * 10.11.92 Round all recorded fees details to 5 cents                       DLH
  58  * 04.11.92 Based on SRB$FEES_CALCULATION written by Richard Reynolds        DLH
  59  * 13.05.92 Exclude GEN-SERV-OTH1-FEE for conversion nurses (course 1031)    DLH
  60  * 25.03.92 Use 1st day of semester for calculating student age              DLH
  61  * 17.03.92 Remove references to CRS-CODE-OLD-NURSING                        DLH
  62  * 14.02.92 Modify to access PERSONAL and COURSE files through               MAR
  63  *          SIBLING stream for sibling validation                            .92
  64  * 14.11.91 Revise reference to NEW-NURSING course to NOT OLD-NURSING        DLH
  65  * 12.11.91 Charge processing fee to all students                            DLH
  66  * 12.11.91 Allow registration rebate to students who are flagged            DLH
  67  * 11.10.91 Pass appropriate PARAM- records via LINKAGE, no read each time   DLH
  68  * 02.09.91 Round dependents discount to nearest 2 cents                     DLH
  69  * 16.08.91 Conversion to version 2 format commenced.                        .91
  70  * 16.08.91 *1 - SYSTEM VALUES FILES                                         MAR
  71  * 22.08.91 *2 - STUDENT FEES FILE                                           DLH
  72  * 09.09.91 *3 - CODE COURSE MASTER                                          DLH
  73  * 22.07.91 All nursing students should pay room deposits in 2nd semester    DLH
  74  * 14.05.91 Remove BURSARY from DEPENDENT-DISCOUNT                           DLH
  75  * 22.04.91 Remove optical/dental                                            DLH
  76  * 09.04.91 Change ASP_ logicals to SRS_ etc                                 DLH
  77  * 13.03.91 Charge single orientation fee if MARITAL-STATUS not = 'M'        DLH
  78  * 13.02.91 Change COPY "..._FILE" to COPY "SR..." (files created on PC)     RMD
  79  * 24.01.90 Rename AC- ledger fields to PR- for prior year                   DLH
  80  * 24.01.91 Base decision to include previous year student ledger balance on DLH
  81  *          flags maintained by Business Office                              .91
  82  * 04.12.90 On DISPLAY statements, add AT COLUMN & NO ADVANCING              DLH
  83  * 16.11.90 Change SAH-BURSARY to BURSARY                                    DLH
  84  * 23.08.90 Pass whole STUDENT-FEES-REC to FEES_CALCULATION, do not read it  DLH
  85  * 22.08.89 Implement late registration fees                                 DLH
  86  * 21.08.90 Include music lessons and practice fee calculations              DLH
  87  * 01.08.90 Disallow dependents discount if student is married               DLH
  88  * 03.07.90 Use " only for COPY and CALL statements, else use '              DLH
  89  * 03.07.90 Merge FIELD_VALIDATION_DATA.LIB and CODE_MEANINGS_DATA.LIB into  DLH
  90  *          CODE_VALUES_DATA.LIB                                             .90
  91  * 21.06.90 Use constants rather than literals for all coded fields          DLH
  92  * 19.06.90 STUDENT-SUBJECT file not needed, read credit-points from SUPPL   DLH
  93  * 13.06.90 For students starting in 2nd semester, 1st semester fees should  DLH
  94  *          be zero                                                          DLH
  95  * 22.05.90 Read SYSTEM-FEES record according to APPLICANT or ACADEMIC year  DLH
  96  * 19.03.90 Remove references to year 89 or 90                               DLH
  97  * 15.12.89 Add application received to sibling eligibility requirement      DLH
  98  * 15.12.89 Add acceptance to sibling eligibility requirement                DLH
  99  * 14.12.89 Add NURSES-GENERAL-FEE as GEN-SERV-OTH1-FEE                      DLH
 100  * 13.12.89 ST-FIN data is now 307, not 198 bytes                            DLH
 101  * 06.12.89 If APPLICANT-YEAR NOT = ACADEMIC-YEAR, include student ledger    DLH
 102  *          balance from ACADEMIC-YEAR ledger for applicants                 .89
 103  * 19.09.89 Move DATE-COMMENCED from PERSONAL-FILE to COURSE-FILE            DLH
 104  * 19.09.89 Remove APPLICATION-STATUS from COURSE-FILE                       DLH
 105  * 23.08.89 Remove reference to SUBJECT-YY-FILE                              DLH
 106  * 26.05.89 Coding commenced                                                 RNR
 107  *------------------------------------------------------------------------------
 108  *
 109  ENVIRONMENT DIVISION.
 110  
 111  CONFIGURATION SECTION.
 112  
 113  SOURCE-COMPUTER.   MICROVAX-II.
 114  OBJECT-COMPUTER.   MICROVAX-II.
 115  /
 116  INPUT-OUTPUT SECTION.
 117  FILE-CONTROL.
 118  *
 119  COPY "SRS_INCLUDE:SRCCOURS_SELECT".
 120  *
 121  COPY "SRS_INCLUDE:SRSCOURS_SELECT".
 122  COPY "SRS_INCLUDE:SIBCOURS_SELECT".
 123  COPY "SRS_INCLUDE:SRSDENOM_SELECT".
 124  COPY "SRS_INCLUDE:SRSPERSN_SELECT".
 125  COPY "SRS_INCLUDE:SIBPERSN_SELECT".
 126  COPY "SRS_INCLUDE:PERSONAL_SELECT".
 127  *
 128  *SL1     SELECT PR_STUDENT_LEDGER_FILE
 129  *            ASSIGN TO 'SRS_DATA_GL:'
 130  *            ORGANIZATION IS INDEXED
 131  *            ACCESS MODE IS DYNAMIC
 132  *            RECORD KEY IS PR_SL_ACCOUNT
 133  *            FILE STATUS IS FILE_STATUS.
 134  *
 135       SELECT  PR_STUDENT_LEDGER_FILE
 136               ASSIGN TO 'GL_DATA:'
 137               ORGANIZATION IS INDEXED
 138               ACCESS MODE IS DYNAMIC
 139               RECORD KEY IS PR_SL_LEDGER_KEY
 140               FILE STATUS IS FILE_STATUS.
 141  *SL1     SELECT STUDENT_LEDGER_FILE
 142  *            ASSIGN TO 'SRS_DATA_GL:'
 143  *            ORGANIZATION IS INDEXED
 144  *            ACCESS MODE IS DYNAMIC
 145  *            RECORD KEY IS SL_ACCOUNT
 146  *            FILE STATUS IS FILE_STATUS.
 147       SELECT STUDENT_LEDGER_FILE
 148              ASSIGN TO 'GL_DATA:'
 149              ORGANIZATION IS INDEXED
 150              ACCESS MODE IS DYNAMIC
 151              RECORD KEY IS SL_LEDGER_KEY
 152              FILE STATUS IS FILE_STATUS.
 153  *
 154  I-O-CONTROL.
 155  
 156  APPLY LOCK-HOLDING ON CODE_COURSE_MASTER_FILE
 157                        STUDENT_COURSE_FILE
 158                        SIBLING_COURSE_FILE
 159                        STUDENT_DENOM_EMP_FILE
 160                        SR_STUDENT_PERSONAL
 161                        SR_SIBLING_PERSONAL
 162                        CI_PERSONAL
 163  
 164                        PR_STUDENT_LEDGER_FILE
 165                        STUDENT_LEDGER_FILE.
 166  /
 167  DATA DIVISION.
 168  
 169  FILE SECTION.
 170  *
 171  FD  CODE_COURSE_MASTER_FILE EXTERNAL.
 172  COPY "SRS_INCLUDE:SRCCOURS".
 173  *
 174  *
 175  FD  STUDENT_COURSE_FILE 
 176      VALUE OF ID IS COURSE_FILE_NAME EXTERNAL.
 177  COPY "SRS_INCLUDE:SRSCOURS".
 178  *
 179  FD  SIBLING_COURSE_FILE
 180      VALUE OF ID IS SIBLING_COURSE_FILE_NAME EXTERNAL.
 181  COPY "SRS_INCLUDE:SIBCOURS".
 182  *
 183  FD  STUDENT_DENOM_EMP_FILE 
 184      VALUE OF ID IS DENOM_EMP_FILE_NAME EXTERNAL.
 185  COPY "SRS_INCLUDE:SRSDENOM".
 186  *
 187  FD  SR_STUDENT_PERSONAL
 188      VALUE OF ID IS SR_PERSONAL_FILE_NAME EXTERNAL.
 189  COPY "SRS_INCLUDE:SRSPERSN".
 190  *
 191  FD  SR_SIBLING_PERSONAL
 192      VALUE OF ID IS SR_SIBLING_PERSONAL_FILE_NAME EXTERNAL.
 193  COPY "SRS_INCLUDE:SIBPERSN".
 194  *
 195  FD  CI_PERSONAL EXTERNAL.
 196  COPY "SRS_INCLUDE:PERSONAL".
 197  *
 198  FD  PR_STUDENT_LEDGER_FILE
 199      VALUE OF ID IS PR_SL_FILE_NAME EXTERNAL.
 200  *SL1 COPY "SRS_INCLUDE:PR_STUDENT_LEDGER_FILE".
 201  COPY "SRS_INCLUDE:PRSLEDYY".
 202  *
 203  FD  STUDENT_LEDGER_FILE
 204      VALUE OF ID IS SL_FILE_NAME EXTERNAL.
 205  *SL1 COPY "SRS_INCLUDE:STUDENT_LEDGER_FILE".
 206  COPY "SRS_INCLUDE:SLEDYY".
 207  *
 208  /
 209  WORKING-STORAGE SECTION.
 210  
 211  01  FILE_NAME_VARIABLES EXTERNAL.
 212      03 COURSE_FILE_NAME                    PIC X(30). 
 213      03 SIBLING_COURSE_FILE_NAME            PIC X(30). 
 214      03 DENOM_EMP_FILE_NAME                 PIC X(30).
 215      03 FEES_FILE_NAME                      PIC X(30).
 216      03 SR_PERSONAL_FILE_NAME               PIC X(30).
 217      03 SR_SIBLING_PERSONAL_FILE_NAME       PIC X(30).
 218      03 SUBJECT_FILE_NAME                   PIC X(30).
 219  01  FILE_NAME_VALUES.
 220      03 FILLER                              PIC X(30) VALUE 'SRACOURS.IDX'.
 221      03 FILLER                              PIC X(30) VALUE 'SRSCOURS.IDX'.
 222      03 FILLER                              PIC X(30) VALUE 'SRADENOM.IDX'.
 223      03 FILLER                              PIC X(30) VALUE 'SRSDENOM.IDX'.
 224      03 FILLER                              PIC X(30) VALUE 'SRAFEES.IDX'.
 225      03 FILLER                              PIC X(30) VALUE 'SRSFEES.IDX'.
 226      03 FILLER                              PIC X(30) VALUE 'SRAPERSN.IDX'.
 227      03 FILLER                              PIC X(30) VALUE 'SRSPERSN.IDX'.
 228      03 FILLER                              PIC X(30) VALUE 'SRASUB.IDX'.
 229      03 FILLER                              PIC X(30) VALUE 'SRSSUB.IDX'.
 230  01  FILE_NAME_TABLE REDEFINES FILE_NAME_VALUES.
 231      03 V_COURSE_FILE                       PIC X(30) OCCURS 2.
 232      03 V_DENOM_EMP_FILE                    PIC X(30) OCCURS 2.
 233      03 V_FEES_FILE                         PIC X(30) OCCURS 2.
 234      03 V_SR_PERSONAL_FILE                  PIC X(30) OCCURS 2.
 235      03 V_SUBJECT_FILE                      PIC X(30) OCCURS 2.
 236  
 237  01  PR_SL_FILE_NAME                        PIC X(10) EXTERNAL.
 238  01  SL_FILE_NAME                           PIC X(10) EXTERNAL.
 239  
 240  COPY "SRS_INCLUDE:WORKING_STORAGE_DATA".
 241  COPY "SRS_INCLUDE:CODE_VALUES_DATA".
 242  
 243  01  WS_DATE_OF_BIRTH                       PIC X(8).
 244  01  WS_SIBLING_DATE_OF_BIRTH               PIC X(8).
 245  01  WS_CRS_DATE_COMMENCED                  PIC X(8).
 246  01  WS_S_FE_LEDGER_BALANCE                 PIC S9(9)V99.
 247  01  PR_S_FE_LEDGER_BALANCE                 PIC 9(5)V99.
 248  01  WS_PR_S_FE_LEDGER_BALANCE              PIC S9(5)V99.
 249  01  WS_FE_DEBIT_CREDIT                     PIC 9.
 250  *SL1
 251  01  WS_SP_PRIOR_SL_YEAR                    PIC X(4)    VALUE ZEROS.
 252  01  WS_SP_CURRENT_SL_YEAR                  PIC X(4)    VALUE ZEROS.
 253  *
 254  01  WS_WHOLE_STRING                        PIC X(9)  JUSTIFIED.
 255  01  WS_DECIMAL_STRING                      PIC XX.
 256  01  WS_WHOLE_PART                          PIC 9(9).
 257  01  WS_DECIMAL_PART                        PIC 99.
 258  01  WS_HOLD_DELIM                          PIC XXX.
 259  *
 260  01  WS_TOTAL_CREDIT_POINTS                 PIC 999V9.    
 261  *
 262  01  WS_DEPNT_DISC_PCENT                    PIC 99V9.
 263  01  WS_DISC_AMT_TUITION                    PIC 9(5)V99.
 264  01  WS_DISC_AMT_RES                        PIC 9(5)V99.
 265  *
 266  *5 * temporary storage for D2819_DEPEND_DISCOUNT; holds S_FE_TUITION_FEE or 0.75 x S_PE_HECS_PREXMT_TOT [up-front HECS amount]
 267  *5 01  WS_WHATEVER_FEE                        PIC 9(5)V99.
 268  *
 269  01  WS_SAVE_BUFFER                         PIC X(1000).
 270  01  WS_SAVE_STATUS_FLAG                    PIC 9.
 271  01  WS_NUM_UNITS                           PIC 9.
 272  *
 273  01  ILLEGAL_VALUE_MSG.
 274      03 MSG1_TEXT                           PIC X(25)  VALUE 'Illegal value.  See help'.
 275      03 FILLER                              PIC X      VALUE SPACE.
 276      03 MSG1_FIELD_NAME                     PIC X(30).
 277      03 FILLER                              PIC X      VALUE SPACE.
 278      03 MSG1_FIELD_VALUE                    PIC X(30).
 279  *
 280  01  AGE                                    PIC S999.
 281  01  DISPLAY_STATUS                         PIC -(8)9.
 282  01  V_YES_RESPONSE                         PIC XXX.
 283      88 YES_RESPONSE           VALUE 'Y  ' 'YES'.
 284  01  VALIDITY                               PIC 9.
 285  01  NOT_OK                                 PIC 9     VALUE 0.
 286  01  SIBLING_ELIGIBILITY_STATUS             PIC 9.
 287      88 NOT_ELIGIBLE           VALUE 0.
 288      88 ELIGIBLE               VALUE 1.
 289  01  V_NOT_ELIGIBLE                         PIC 9     VALUE 0.
 290  01  V_ELIGIBLE                             PIC 9     VALUE 1.
 291  01  WS_STARTING_SEMESTER                   PIC 9.
 292  /
 293  COPY "SRS_INCLUDE:DATA_ENTRY_STATUS_DATA".
 294  
 295  01  FMS_LINE                               PIC S9(9)  COMP  VALUE 24.
 296  /
 297  COPY "SRS_INCLUDE:FILE_STATUS_DATA".
 298  COPY "SRS_INCLUDE:OLD_FILE_STATUS_DATA".
 299  *SL1 01  PR_SL_OPEN                             PIC 9     VALUE 0.
 300  
 301  LINKAGE SECTION.
 302  
 303  01  STUDENT_ACCOUNT                        PIC X(8).
 304  01  LINK_REQUESTED_SEMESTER                PIC 9.
 305  COPY "SRS_INCLUDE:SRPACCTS".
 306  COPY "SRS_INCLUDE:SRPFEES".
 307  COPY "SRS_INCLUDE:SRPVALUS".
 308  COPY "SRS_INCLUDE:SRSFEES".
 309  01  SIBLING_MESSAGE                        PIC X(30).
 310  01  FILE_TYPE_LETTER                       PIC X.
 311  /
 312  *******************************************************************************
 313  * START OF PROCEDURE DIVISION - SRB$FEE_CALCULATION
 314  *******************************************************************************
 315  
 316  PROCEDURE DIVISION USING STUDENT_ACCOUNT
 317                           LINK_REQUESTED_SEMESTER
 318                           PARAM_ACCOUNTS_REC
 319                           PARAM_FEES_REC
 320                           PARAM_VALUES_REC
 321                           STUDENT_FEES_REC
 322                           SIBLING_MESSAGE
 323                           FILE_TYPE_LETTER.
 324  
 325  *COPY "SRS_INCLUDE:DECLARATIVES_CODE".
 326  
 327  A0010_MAINLINE SECTION.
 328  
 329  A0011_MAINLINE.
 330  
 331       PERFORM B1010_INITIALIZE.
 332       PERFORM B2010_MAIN_MENU.
 333       EXIT PROGRAM.
 334  
 335  A0019_MAINLINE_EXIT.
 336       EXIT.
 337  /
 338  B1010_INITIALIZE SECTION.
 339  
 340  *******************************************************************************
 341  * FUNCTION:
 342  *******************************************************************************
 343  
 344  B1011_INITIALIZE.
 345  
 346  B1019_INITIALIZE_EXIT.
 347      EXIT.
 348  /
 349  B2010_MAIN_MENU SECTION.
 350  
 351  ********************************************************************************
 352  * FUNCTION: NO MENU REQUIRED. SUBROUTINE TO CALCULATE FEES ONLY.
 353  ********************************************************************************
 354  
 355  B2011_MAIN_MENU.
 356  
 357       MOVE LINK_REQUESTED_SEMESTER TO REQUESTED_SEMESTER.
 358       PERFORM C0000_ZERO_FIELDS.
 359       PERFORM C1000_READ_FILES.
 360       PERFORM C1100_CREDIT_POINTS.
 361       PERFORM C1200_TUITION_FEES.
 362       PERFORM C1300_RESIDENCE_FEES.
 363       PERFORM C2000_COLLEGE_SCHOLARSHIP.
 364       PERFORM C2100_DISCOUNTS.
 365       PERFORM C2150_OTHER_FEES.
 366       PERFORM C2200_TOTAL_FEES.
 367       PERFORM C2300_TOTAL_DISCOUNTS.
 368       PERFORM C2900_LEDGER_BALANCE.
 369       PERFORM C3000_NET_AMOUNT_DUE.
 370  *! what about an indoor education student with no total_credit_points?
 371       IF WS_TOTAL_CREDIT_POINTS = ZERO THEN
 372          MOVE S_FE_LEDGER_BALANCE TO PR_S_FE_LEDGER_BALANCE
 373          MOVE S_FE_DEBIT_CREDIT   TO WS_FE_DEBIT_CREDIT
 374          PERFORM C0000_ZERO_FIELDS
 375  *!        MOVE SPACES TO S_FE_BURSARY_PROVIDER
 376          MOVE PR_S_FE_LEDGER_BALANCE TO S_FE_LEDGER_BALANCE
 377          MOVE WS_FE_DEBIT_CREDIT     TO S_FE_DEBIT_CREDIT
 378       END-IF.
 379  
 380  B2019_MAIN_MENU_EXIT.
 381       EXIT.
 382  /
 383  C0000_ZERO_FIELDS SECTION.
 384  
 385  *******************************************************************************
 386  * FUNCTION; Initialize fee fields to zero
 387  *******************************************************************************
 388  
 389  C0001_ZERO_FIELDS.
 390  
 391       MOVE 0 TO S_FE_LATE_ACAD_REGO_FEE
 392                 S_FE_PROCESSING_DEPOSIT
 393                 S_FE_TUITION_FEE
 394                 S_FE_BRIDGING_TUITION_FEE
 395                 S_FE_MUSIC_LESSONS_FEE
 396                 S_FE_MUSIC_PRACTICE_FEE
 397                 S_FE_FACILITY_FEE
 398                 S_FE_RESIDENCE_FEE
 399                 S_FE_SINGLE_ROOM_FEE
 400                 S_FE_ROOM_DEPOSIT
 401                 S_FE_BRIDGING_RESID_FEE
 402                 S_FE_ORIENT_RESID_FEE
 403                 S_FE_COL_SSHIP
 404                 S_FE_BURSARY_AMT
 405                 S_FE_DEPNT_DISC_TUITION
 406                 S_FE_DEPNT_DISC_RES
 407                 S_FE_FAMILY_DISC_TUITION
 408                 S_FE_FAMILY_DISC_RES
 409                 S_FE_FIN_REGO_REBATE  
 410                 S_FE_LEDGER_BALANCE
 411                 S_FE_DEBIT_CREDIT
 412                 S_FE_TUITION_FEE_TOT
 413                 S_FE_TUITION_DISC_TOT
 414                 S_FE_RESIDENCE_FEE_TOT
 415                 S_FE_RESIDENCE_DISC_TOT
 416                 S_FE_OTHER_FEES_TOT
 417                 S_FE_NET_FEES_PAYABLE_TOT.
 418       MOVE SPACES TO S_FE_BURSARY_PROVIDER.
 419  
 420  C0009_ZERO_FIELDS_EXIT.
 421       EXIT.
 422  /
 423  C1000_READ_FILES SECTION.
 424  
 425  ********************************************************************************
 426  * FUNCTION: READ ALL REQUIRED DATA FILES
 427  ********************************************************************************
 428  
 429  C1001_READ_FILES.
 430  
 431       IF FILE_TYPE_LETTER = FTL_APPLICANT THEN
 432          MOVE P_VA_APPLICATION_YEAR TO S_CO_YEAR
 433                                        SB_CO_YEAR
 434       ELSE
 435          MOVE P_VA_ACADEMIC_YEAR    TO S_CO_YEAR
 436                                        SB_CO_YEAR
 437       END-IF.
 438  *SL1
 439       MOVE P_AC_CURRENT_SL_YEAR    TO WS_SP_CURRENT_SL_YEAR.
 440       MOVE P_AC_PRIOR_SL_YEAR      TO WS_SP_PRIOR_SL_YEAR.
 441       MOVE STUDENT_ACCOUNT TO S_PE_ACCOUNT_NUMBER.
 442       PERFORM W3653_READ_S_PE_BY_ACCOUNT.
 443  
 444  *! handle not on file
 445       if s_pe_not_found then
 446             display s_pe_account_number at line 24 column 1 ' not in personal file.  Please exit by pressing Ctrl-Y.' erase to end of line with bell no advancing
 447             accept ans from column 76
 448       end-if.
 449  
 450       MOVE SPACES TO CI_PERSONAL_REC.
 451       MOVE S_PE_NAME_NUMBER TO I_PE_NAME_NUMBER.
 452       PERFORM WI0350_READ_I_PE.
 453  *! handle not on file     
 454          if i_pe_not_found then
 455             display i_pe_name_number at line 24 column 1 ' not in name file.  Please exit by pressing Ctrl-Y.' erase to end of line with bell no advancing
 456             accept ans from column 76
 457          end-if.
 458  
 459  * Allow for STARTING_SEMESTER = 0 (treat as 1)
 460       IF S_PE_STARTING_SEMESTER = 0 THEN
 461          MOVE 1                      TO WS_STARTING_SEMESTER
 462       ELSE
 463          MOVE S_PE_STARTING_SEMESTER TO WS_STARTING_SEMESTER
 464       END-IF.
 465  
 466       MOVE S_PE_NAME_NUMBER                              TO S_CO_NAME_NUMBER.
 467       MOVE S_PE_COURSE_RECORD_NUMBER(REQUESTED_SEMESTER) TO S_CO_COURSE_RECORD_NUMBER.
 468       PERFORM W3351_READ_S_CO.
 469  *! handle not on file
 470          if s_co_not_found then
 471             display s_co_course_key at line 24 column 1 ' not in course file.  Please exit.' no advancing
 472             accept ans from column 76
 473          end-if.
 474  
 475       MOVE S_CO_COURSE_CODE TO C_CM_COURSE_CODE.
 476       MOVE S_CO_YEAR        TO C_CM_YEAR.
 477       PERFORM WC0150_READ_C_CM.
 478  *! handle not on file
 479          if c_cm_not_found then
 480             display c_cm_course_code at line 24 column 1 ' not in course master file.  Please exit.' no advancing
 481             accept ans from column 76
 482          end-if.
 483  
 484  *SL1
 485       MOVE 'AS'                  TO SL_LEDGER_CODE.
 486       MOVE WS_SP_CURRENT_SL_YEAR TO SL_LEDGER_YEAR.
 487       MOVE STUDENT_ACCOUNT TO SL_ACCOUNT.
 488       PERFORM WSL51_READ_SL.
 489  *! handle not on file
 490          if sl_not_found then
 491             move all zeros to sl_current_balance
 492             display sl_account at line 24 column 1 ' not in ' sl_file_name no advancing
 493             accept ans from column 76
 494          end-if.
 495       IF P_AC_PRIOR_SL_YEAR NOT = ZEROS THEN
 496  *SL1         IF PR_SL_OPEN = 0 THEN
 497  *           MOVE 3 TO PR_SL_OPEN
 498  *           MOVE "SL511" TO I_O_OPERATION
 499  *           OPEN INPUT PR_STUDENT_LEDGER_FILE  ALLOWING ALL
 500  *        END-IF
 501  *SL1
 502          MOVE 'AS'                TO PR_SL_LEDGER_CODE
 503          MOVE WS_SP_PRIOR_SL_YEAR TO PR_SL_LEDGER_YEAR
 504          MOVE STUDENT_ACCOUNT TO PR_SL_ACCOUNT
 505          PERFORM WSL51_READ_PR_SL
 506  *! HANDLE NOT ON FILE
 507          IF PR_SL_NOT_FOUND THEN
 508             MOVE ALL ZEROS TO PR_SL_CURRENT_BALANCE
 509          END-IF
 510       END-IF.
 511  
 512  C1009_READ_FILES_EXIT.
 513       EXIT.
 514  /
 515  C1100_CREDIT_POINTS SECTION.
 516  
 517  ********************************************************************************
 518  * FUNCTION: COMPUTE NUMBER OF CREDIT POINTS BEING TAKEN
 519  ********************************************************************************
 520  
 521  C1101_CREDIT_POINTS.
 522  
 523       COMPUTE WS_TOTAL_CREDIT_POINTS = S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 524                                      + S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 525                                      + S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 526                                      + S_PE_MA_CREDIT(REQUESTED_SEMESTER).
 527       IF FILE_TYPE_LETTER = FTL_APPLICANT THEN
 528          IF WS_TOTAL_CREDIT_POINTS = ZERO THEN
 529             PERFORM D1100_GET_STANDARD_CPTS
 530             COMPUTE WS_TOTAL_CREDIT_POINTS = S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 531                                            + S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 532                                            + S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 533                                            + S_PE_MA_CREDIT(REQUESTED_SEMESTER)
 534          END-IF
 535       END-IF.
 536  
 537  C1109_CREDIT_POINTS_EXIT.
 538       EXIT.
 539  /
 540  C1200_TUITION_FEES SECTION.
 541  
 542  ********************************************************************************
 543  * FUNCTION: COMPUTE TUITION FEES
 544  ********************************************************************************
 545  
 546  C1201_TUITION_FEES.
 547  
 548       PERFORM D1210_LATE_ACAD_REGO_FEE.
 549       PERFORM D1220_PROCESSING_DEPOSIT.
 550       PERFORM D1230_TUITION_FEE.
 551       PERFORM D1240_BRIDGING_TUITION_FEE.
 552       PERFORM D1250_MUSIC_LESSONS_FEE.
 553       PERFORM D1260_MUSIC_PRACTICE_FEE
 554       PERFORM D1270_FACILITY_FEE.
 555  
 556  C1209_TUITION_FEES_EXIT.
 557       EXIT.
 558  /
 559  C1300_RESIDENCE_FEES SECTION.
 560  
 561  ********************************************************************************
 562  * FUNCTION: COMPUTE RESIDENCE FEES
 563  ********************************************************************************
 564  
 565  C1301_RESIDENCE_FEES.
 566  
 567       PERFORM D1310_RESIDENCE_FEES.
 568       PERFORM D1320_BRIDGING_RESID_FEE.
 569       PERFORM D1330_ORIENT_RESID_FEE.
 570  
 571  C1309_RESIDENCE_FEES_EXIT.
 572       EXIT.
 573  /
 574  C2000_COLLEGE_SCHOLARSHIP SECTION.
 575  
 576  ********************************************************************************
 577  * FUNCTION: COMPUTE COLLEGE SCHOLARHIP
 578  ********************************************************************************
 579  
 580  C2001_COLLEGE_SCHOLARSHIP.
 581  
 582       IF S_PE_COLLEGE_SSHIP(REQUESTED_SEMESTER) = COLLEGE_SSHIP_YES AND
 583          (C_CM_AOU NOT = AOU_EDUCATION OR
 584           S_PE_FEE_STUDENT = FEE_FULL_FEE_PAYING_OS)                THEN
 585          COMPUTE S_FE_COL_SSHIP ROUNDED = WS_TOTAL_CREDIT_POINTS * P_FE_COL_SSHIP / 10
 586          MULTIPLY 10 BY S_FE_COL_SSHIP
 587       ELSE
 588          MOVE ZERO TO S_FE_COL_SSHIP
 589       END-IF.
 590  *----------     
 591       MOVE S_PE_BURSARY_AMT(REQUESTED_SEMESTER) TO S_FE_BURSARY_AMT.
 592  
 593  C2009_COLLEGE_SCHOLARSHIP_EXIT.
 594       EXIT.
 595  /
 596  C2100_DISCOUNTS SECTION.
 597  
 598  ********************************************************************************
 599  * FUNCTION: COMPUTE DISCOUNTS
 600  ********************************************************************************
 601  
 602  C2101_DISCOUNTS.
 603  
 604       PERFORM D2810_DEP_DISCOUNT.
 605       PERFORM D2820_FAMILY_DISCOUNT.
 606  *      PERFORM D2840_FIN_REGO_REBATE.
 607  
 608  C2109_DISCOUNTS_EXIT.
 609       EXIT.
 610  /
 611  C2150_OTHER_FEES SECTION.
 612  
 613  ********************************************************************************
 614  * FUNCTION: COMPUTE OTHER FEES
 615  ********************************************************************************
 616  
 617  C2151_OTHER_FEES.
 618  
 619  *    New Zealand Citizens without Australian Resident status pay Overseas Student Health Cover for the first year
 620  *    through the College at either the single or family rate, unless already covered by a paid family rate:
 621       MOVE ZERO TO S_FE_OSHC_FEE.
 622       IF (S_PE_APPLICATION_TYPE = APT_NEW_STUDENT             OR
 623           S_PE_APPLICATION_TYPE = APT_RETURNING_AFTER_ABSENCE)   AND
 624          WS_STARTING_SEMESTER = REQUESTED_SEMESTER               THEN
 625          EVALUATE S_PE_NZ_NON_RES_FEE
 626             WHEN  NZ_OSHC_SINGLE    MOVE P_FE_NZ_OSHC_SINGLE   TO S_FE_OSHC_FEE
 627             WHEN  NZ_OSHC_FAMILY    MOVE P_FE_NZ_OSHC_FAMILY   TO S_FE_OSHC_FEE
 628          END-EVALUATE
 629       END-IF.
 630  
 631  C2159_OTHER_FEES_EXIT.
 632       EXIT.
 633  /
 634  C2200_TOTAL_FEES SECTION.
 635  
 636  ********************************************************************************
 637  * FUNCTION: COMPUTE TOTAL FEES BEFORE ALLOWANCES
 638  ********************************************************************************
 639  
 640  C2201_TOTAL_FEES.
 641  
 642       COMPUTE S_FE_TUITION_FEE_TOT = S_FE_LATE_ACAD_REGO_FEE
 643                                    + S_FE_PROCESSING_DEPOSIT
 644                                    + S_FE_TUITION_FEE
 645                                    + S_FE_BRIDGING_TUITION_FEE
 646                                    + S_FE_MUSIC_LESSONS_FEE
 647                                    + S_FE_MUSIC_PRACTICE_FEE
 648                                    + S_FE_FACILITY_FEE
 649                                    - S_FE_COL_SSHIP
 650                                    - S_FE_BURSARY_AMT.
 651  *                                   - S_FE_FIN_REGO_REBATE.
 652       COMPUTE S_FE_RESIDENCE_FEE_TOT = S_FE_RESIDENCE_FEE
 653                                      + S_FE_SINGLE_ROOM_FEE
 654                                      + S_FE_BRIDGING_RESID_FEE
 655                                      + S_FE_ORIENT_RESID_FEE.
 656  
 657       IF WS_TOTAL_CREDIT_POINTS = ZERO THEN
 658          MOVE ZERO TO S_FE_TUITION_FEE_TOT
 659                       S_FE_RESIDENCE_FEE_TOT
 660       END-IF.
 661  
 662  *    11/1994: Currently S_FE_OSHC_FEE is the only fee that doesn't fit other total groups.
 663  *    - hence "S_FE_OTHER_FEES_TOT" only consists of S_FE_OSHC_FEE:
 664  
 665       MOVE S_FE_OSHC_FEE TO S_FE_OTHER_FEES_TOT.
 666  
 667  C2209_TOTAL_FEES_EXIT.
 668       EXIT.
 669  /
 670  C2300_TOTAL_DISCOUNTS SECTION.
 671  
 672  ********************************************************************************
 673  * FUNCTION: COMPUTE TOTAL DISCOUNTS
 674  ********************************************************************************
 675  
 676  C2301_TOTAL_DISCOUNTS.
 677  
 678       COMPUTE S_FE_TUITION_DISC_TOT = S_FE_DEPNT_DISC_TUITION
 679                                     + S_FE_FAMILY_DISC_TUITION.
 680  
 681       COMPUTE S_FE_RESIDENCE_DISC_TOT = S_FE_DEPNT_DISC_RES
 682                                       + S_FE_FAMILY_DISC_RES.
 683  
 684       IF WS_TOTAL_CREDIT_POINTS = ZERO THEN
 685          MOVE ZERO TO S_FE_TUITION_FEE_TOT
 686                       S_FE_RESIDENCE_FEE_TOT
 687       END-IF.
 688  
 689  C2309_TOTAL_DISCOUNTS_EXIT.
 690       EXIT.
 691  /
 692  C2900_LEDGER_BALANCE SECTION.
 693  
 694  ********************************************************************************
 695  * FUNCTION: GET LEDGER BALANCE FROM STUDENT LEDGER AND CONVERT FROM
 696  *           PIC X(12) TO PIC 9(5)V99
 697  ********************************************************************************
 698  
 699  C2901_LEDGER_BALANCE.
 700  
 701       MOVE ZERO TO S_FE_DEBIT_CREDIT
 702                    WS_PR_S_FE_LEDGER_BALANCE
 703                    WS_S_FE_LEDGER_BALANCE.
 704  *SL1     IF SL_CURRENT_BALANCE NOT = ALL ZEROS THEN
 705  *        INSPECT SL_CURRENT_BALANCE REPLACING LEADING ' ' BY '0'
 706  *        UNSTRING SL_CURRENT_BALANCE DELIMITED BY '.'
 707  *          INTO WS_WHOLE_STRING      DELIMITER IN WS_HOLD_DELIM
 708  *               WS_DECIMAL_STRING    DELIMITER IN WS_HOLD_DELIM
 709  *        INSPECT WS_WHOLE_STRING TALLYING S_FE_DEBIT_CREDIT FOR ALL '-'
 710  *        IF S_FE_DEBIT_CREDIT = 1 THEN
 711  *           INSPECT WS_WHOLE_STRING REPLACING ALL '-' BY '0'
 712  *        END-IF
 713  **!        STRING WS_WHOLE_STRING      DELIMITED BY SIZE
 714  **!          INTO WS_WHOLE_PART
 715  *        MOVE WS_WHOLE_STRING        TO WS_WHOLE_PART
 716  *        MOVE WS_DECIMAL_STRING      TO WS_DECIMAL_PART
 717  *        STRING WS_WHOLE_PART        DELIMITED BY SIZE
 718  *               WS_DECIMAL_PART      DELIMITED BY SIZE
 719  *          INTO WS_S_FE_LEDGER_BALANCE
 720  *        IF S_FE_DEBIT_CREDIT = 1 THEN
 721  *           MULTIPLY -1 BY WS_S_FE_LEDGER_BALANCE 
 722  *        END-IF
 723  *     END-IF.
 724       MOVE SL_CURRENT_BALANCE TO WS_S_FE_LEDGER_BALANCE.
 725  
 726       IF FILE_TYPE_LETTER = FTL_APPLICANT               AND
 727          P_AC_PRIOR_SL_YEAR NOT = 0                     AND
 728  *SL1        P_VA_ACADEMIC_YEAR NOT = P_VA_APPLICATION_YEAR AND
 729          PR_SL_FOUND                                    THEN
 730          MOVE ZERO TO S_FE_DEBIT_CREDIT
 731  *SL1        INSPECT PR_SL_CURRENT_BALANCE REPLACING LEADING ' ' BY '0'
 732  *        UNSTRING PR_SL_CURRENT_BALANCE DELIMITED BY '.'
 733  *          INTO WS_WHOLE_STRING      DELIMITER IN WS_HOLD_DELIM
 734  *               WS_DECIMAL_STRING    DELIMITER IN WS_HOLD_DELIM
 735  *        INSPECT WS_WHOLE_STRING TALLYING S_FE_DEBIT_CREDIT FOR ALL '-'
 736  *        IF S_FE_DEBIT_CREDIT = 1 THEN
 737  *           INSPECT WS_WHOLE_STRING REPLACING ALL '-' BY '0'
 738  *        END-IF
 739  *        STRING WS_WHOLE_STRING      DELIMITED BY SIZE
 740  *          INTO WS_WHOLE_PART
 741  *        MOVE WS_DECIMAL_STRING      TO WS_DECIMAL_PART
 742  *        STRING WS_WHOLE_PART        DELIMITED BY SIZE
 743  *               WS_DECIMAL_PART      DELIMITED BY SIZE
 744  *          INTO WS_PR_S_FE_LEDGER_BALANCE
 745  *        IF S_FE_DEBIT_CREDIT = 1 THEN
 746  *           MULTIPLY -1 BY WS_PR_S_FE_LEDGER_BALANCE
 747  *        END-IF
 748          MOVE PR_SL_CURRENT_BALANCE TO WS_PR_S_FE_LEDGER_BALANCE
 749          IF WS_PR_S_FE_LEDGER_BALANCE NOT = ZERO THEN
 750             display 'WS_PR_S_FE_LEDGER_BALANCE ' at line 24 column 1 WS_PR_S_FE_LEDGER_BALANCE WITH CONVERSION
 751                     ' not zero for ' S_PE_ACCOUNT_NUMBER NO ADVANCING
 752  *!          ACCEPT ANS FROM COLUMN 76
 753          END-IF
 754          ADD WS_PR_S_FE_LEDGER_BALANCE TO WS_S_FE_LEDGER_BALANCE
 755       END-IF.
 756  
 757       MOVE ZERO TO S_FE_DEBIT_CREDIT.
 758       IF WS_S_FE_LEDGER_BALANCE < 0 THEN
 759          MULTIPLY -1 BY WS_S_FE_LEDGER_BALANCE
 760          MOVE 1 TO S_FE_DEBIT_CREDIT 
 761       END-IF.
 762       MOVE WS_S_FE_LEDGER_BALANCE TO S_FE_LEDGER_BALANCE.
 763  
 764  C2909_LEDGER_BALANCE_EXIT.
 765       EXIT.
 766  /
 767  C3000_NET_AMOUNT_DUE SECTION.
 768  
 769  ********************************************************************************
 770  * FUNCTION: COMPUTE NET AMOUNT DUE
 771  ********************************************************************************
 772  
 773  C3001_NET_AMOUNT_DUE.
 774  
 775       COMPUTE S_FE_NET_FEES_PAYABLE_TOT = S_FE_TUITION_FEE_TOT
 776                                         + S_FE_RESIDENCE_FEE_TOT
 777                                         + S_FE_ROOM_DEPOSIT
 778                                         - S_FE_TUITION_DISC_TOT
 779                                         - S_FE_RESIDENCE_DISC_TOT
 780                                         + S_FE_OTHER_FEES_TOT.
 781  
 782  C3009_NET_AMOUNT_DUE_EXIT.
 783       EXIT.
 784  /
 785  D1100_GET_STANDARD_CPTS SECTION.
 786  
 787  *******************************************************************************
 788  * FUNCTION: MOVE STANDARD CREDIT POINTS TO WORKING STORAGE
 789  *******************************************************************************
 790  
 791  D1101_GET_STANDARD_CPTS.
 792  
 793  * +--------------------------------------------------------------------------------------+
 794  * |Standard Credit Points                                                                |
 795  * |  D=Diploma/Degree                                                                    |
 796  * |  W=Wahroonga                                                                         |
 797  * |  C=Certificate                                                                       |
 798  * |--------------------------------------------------------------------------------------|
 799  * |Level(n)              |  1  |  1  | 1 |  1  |  1  | 1 |  2  |  2  | 2 |  2  |  2  | 2 |
 800  * |Requested Semester    |  1  |  1  | 1 |  2  |  2  | 2 |  1  |  1  | 1 |  2  |  2  | 2 |
 801  * |Course Type           |not C|not C| C |not C|not C| C |not C|not C| C |not C|not C| C |
 802  * |Campus(n)             |  C  |  W  | - |  C  |  W  | - |  C  |  W  | - |  C  |  W  | - |
 803  * |======================================================================================|
 804  * |C_CM_CREDITS_LEV1_SEM1|  D  |  W  | C |     |     |   |     |     |   |     |     |   |
 805  * |C_CM_CREDITS_LEV1_SEM2|     |     |   |  D  |  W  | C |     |     |   |     |     |   |
 806  * |C_CM_CREDITS_LEV2_SEM1|     |     |   |     |     |   |  D  |  W  | C |     |     |   |
 807  * |C_CM_CREDITS_LEV2_SEM1|     |     |   |     |     |   |     |     |   |  D  |  W  | C |
 808  * +--------------------------------------------------------------------------------------+
 809  
 810       EVALUATE  S_CO_LEVEL(REQUESTED_SEMESTER)  REQUESTED_SEMESTER  C_CM_COURSE_TYPE               S_PE_CAMPUS(REQUESTED_SEMESTER)
 811          WHEN   1                                 1                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_COORANBONG
 812                                                   IF WS_STARTING_SEMESTER = 1 THEN
 813                                                      MOVE C_CM_CREDITS_LEV1_SEM1 TO S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 814                                                      PERFORM D1200_GET_HOUSE_REQ
 815                                                   END-IF
 816          WHEN   1                                 1                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_WAHROONGA
 817                                                   IF WS_STARTING_SEMESTER = 1 THEN
 818                                                      MOVE C_CM_CREDITS_LEV1_SEM1 TO S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 819                                                      PERFORM D1200_GET_HOUSE_REQ
 820                                                   END-IF 
 821          WHEN   1                                 1                   CRS_TYPE_CERTIFICATE_DEET      ANY
 822                                                   IF WS_STARTING_SEMESTER = 1 THEN
 823                                                      MOVE C_CM_CREDITS_LEV1_SEM1 TO S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 824                                                      PERFORM D1200_GET_HOUSE_REQ
 825                                                   END-IF
 826          WHEN   1                                 2                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_COORANBONG
 827                                                   MOVE C_CM_CREDITS_LEV1_SEM2 TO S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 828                                                   PERFORM D1200_GET_HOUSE_REQ
 829          WHEN   1                                 2                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_WAHROONGA
 830                                                   MOVE C_CM_CREDITS_LEV1_SEM2 TO S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 831                                                   PERFORM D1200_GET_HOUSE_REQ
 832          WHEN   1                                 2                   CRS_TYPE_CERTIFICATE_DEET      ANY
 833                                                   MOVE C_CM_CREDITS_LEV1_SEM2 TO S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 834                                                   PERFORM D1200_GET_HOUSE_REQ
 835          WHEN   2                                 1                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_COORANBONG
 836                                                   MOVE C_CM_CREDITS_LEV2_SEM1 TO S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 837                                                   PERFORM D1200_GET_HOUSE_REQ
 838          WHEN   2                                 1                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_WAHROONGA
 839                                                   MOVE C_CM_CREDITS_LEV2_SEM1 TO S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 840                                                   PERFORM D1200_GET_HOUSE_REQ
 841          WHEN   2                                 1                   CRS_TYPE_CERTIFICATE_DEET      ANY
 842                                                   MOVE C_CM_CREDITS_LEV2_SEM1 TO S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 843                                                   PERFORM D1200_GET_HOUSE_REQ
 844          WHEN   2                                 2                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_COORANBONG
 845                                                   MOVE C_CM_CREDITS_LEV2_SEM2 TO S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 846                                                   PERFORM D1200_GET_HOUSE_REQ
 847          WHEN   2                                 2                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_WAHROONGA
 848                                                   MOVE C_CM_CREDITS_LEV2_SEM2 TO S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 849                                                   PERFORM D1200_GET_HOUSE_REQ
 850          WHEN   2                                 2                   CRS_TYPE_CERTIFICATE_DEET      ANY
 851                                                   MOVE C_CM_CREDITS_LEV2_SEM2 TO S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 852                                                   PERFORM D1200_GET_HOUSE_REQ
 853          WHEN   3                                 1                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_COORANBONG
 854                                                   MOVE C_CM_CREDITS_LEV3_SEM1 TO S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 855                                                   PERFORM D1200_GET_HOUSE_REQ
 856          WHEN   3                                 1                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_WAHROONGA
 857                                                   MOVE C_CM_CREDITS_LEV3_SEM1 TO S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 858                                                   PERFORM D1200_GET_HOUSE_REQ
 859          WHEN   3                                 1                   CRS_TYPE_CERTIFICATE_DEET      ANY
 860                                                   MOVE C_CM_CREDITS_LEV3_SEM1 TO S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 861                                                   PERFORM D1200_GET_HOUSE_REQ
 862          WHEN   3                                 2                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_COORANBONG
 863                                                   MOVE C_CM_CREDITS_LEV3_SEM2 TO S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 864                                                   PERFORM D1200_GET_HOUSE_REQ
 865          WHEN   3                                 2                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_WAHROONGA
 866                                                   MOVE C_CM_CREDITS_LEV3_SEM2 TO S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 867                                                   PERFORM D1200_GET_HOUSE_REQ
 868          WHEN   3                                 2                   CRS_TYPE_CERTIFICATE_DEET      ANY
 869                                                   MOVE C_CM_CREDITS_LEV3_SEM2 TO S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 870                                                   PERFORM D1200_GET_HOUSE_REQ
 871          WHEN   4                                 1                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_COORANBONG
 872                                                   MOVE C_CM_CREDITS_LEV4_SEM1 TO S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 873                                                   PERFORM D1200_GET_HOUSE_REQ
 874          WHEN   4                                 1                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_WAHROONGA
 875                                                   MOVE C_CM_CREDITS_LEV4_SEM1 TO S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 876                                                   PERFORM D1200_GET_HOUSE_REQ
 877          WHEN   4                                 1                   CRS_TYPE_CERTIFICATE_DEET      ANY
 878                                                   MOVE C_CM_CREDITS_LEV4_SEM1 TO S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 879                                                   PERFORM D1200_GET_HOUSE_REQ
 880          WHEN   4                                 2                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_COORANBONG
 881                                                   MOVE C_CM_CREDITS_LEV4_SEM2 TO S_PE_DIP_COOR_CREDIT(REQUESTED_SEMESTER)
 882                                                   PERFORM D1200_GET_HOUSE_REQ
 883          WHEN   4                                 2                   NOT CRS_TYPE_CERTIFICATE_DEET  CAMPUS_WAHROONGA
 884                                                   MOVE C_CM_CREDITS_LEV4_SEM2 TO S_PE_DIP_WAH_CREDIT(REQUESTED_SEMESTER)
 885                                                   PERFORM D1200_GET_HOUSE_REQ
 886          WHEN   4                                 2                   CRS_TYPE_CERTIFICATE_DEET      ANY
 887                                                   MOVE C_CM_CREDITS_LEV4_SEM2 TO S_PE_CERT_CREDIT(REQUESTED_SEMESTER)
 888                                                   PERFORM D1200_GET_HOUSE_REQ
 889       END-EVALUATE.
 890  
 891  D1109_GET_STANDARD_CPTS_EXIT.
 892       EXIT.
 893  /
 894  D1200_GET_HOUSE_REQ SECTION.
 895  
 896  ********************************************************************************
 897  * FUNCTION: Move house requirement credit points to working storage
 898  *           . student in 1st semester of course
 899  *           . 
 900  ********************************************************************************
 901  
 902  D1201_GET_HOUSE_REQ.
 903  
 904  * +------------------------------+
 905  * |Standard Credit Points        |
 906  * |  H=House Requirement         |
 907  * |------------------------------|
 908  * |Current Semester(n)   | 1 | - |
 909  * |AOU                   |NUR|EDU|
 910  * |Old Nurse Course      | N | - |
 911  * |==============================|
 912  * |3 credit points       | X | X |
 913  * +------------------------------+
 914  
 915       IF (S_CO_CURRENT_SEMESTER(REQUESTED_SEMESTER) = 1     AND
 916           C_CM_AOU = AOU_NURSING)                                   OR
 917          C_CM_AOU = AOU_EDUCATION                                   THEN
 918          MOVE 3 TO S_PE_HOUSE_CREDIT(REQUESTED_SEMESTER)
 919       END-IF.
 920  
 921  D1209_GET_HOUSE_REQ_EXIT.
 922       EXIT.
 923  /
 924  D1210_LATE_ACAD_REGO_FEE SECTION.
 925  
 926  *******************************************************************************
 927  * FUNCTION: Get S_FE_LATE_ACAD_REGO_FEE
 928  *******************************************************************************
 929  
 930  D1211_LATE_ACAD_REGO_FEE.
 931  
 932       IF WS_TOTAL_CREDIT_POINTS NOT = ZERO                                       AND
 933          (S_PE_LATE_REGISTRATION(REQUESTED_SEMESTER) = LATE_REGO_ACADEMIC OR
 934                                                       = LATE_REGO_BOTH)          THEN
 935          MOVE P_FE_LATE_ACAD_REGO_FEE    TO S_FE_LATE_ACAD_REGO_FEE
 936       ELSE
 937          MOVE ZERO                       TO S_FE_LATE_ACAD_REGO_FEE
 938       END-IF.
 939  
 940  D1219_LATE_ACAD_REGO_FEE_EXIT.
 941       EXIT.
 942  /
 943  D1220_PROCESSING_DEPOSIT SECTION.
 944  
 945  *******************************************************************************
 946  * FUNCTION: Get S_FE_PROCESSING_DEPOSIT
 947  *******************************************************************************
 948  
 949  D1221_PROCESSING_DEPOSIT.
 950  
 951       MOVE P_FE_PROCESSING_DEPOSIT TO S_FE_PROCESSING_DEPOSIT.
 952  
 953  D1229_PROCESSING_DEPOSIT_EXIT.
 954       EXIT.
 955  /
 956  D1230_TUITION_FEE SECTION.
 957  
 958  *******************************************************************************
 959  * FUNCTION: Get S_FE_TUITION_FEE
 960  *******************************************************************************
 961  
 962  D1231_TUITION_FEE.
 963  
 964       IF C_CM_AOU = 'EDU'                               AND
 965          S_PE_FEE_STUDENT NOT = FEE_FULL_FEE_PAYING_OS THEN
 966          MOVE ZERO TO S_FE_TUITION_FEE
 967       ELSE
 968  *       Tuition fee depends on whether a student/applicant is a continuing student from before 1997 or not:
 969          IF S_PE_CONTINUING_PRE_1997 = YN_YES THEN
 970             COMPUTE S_FE_TUITION_FEE ROUNDED = WS_TOTAL_CREDIT_POINTS * P_FE_TUITION_FEE_PRE_1997 / 10
 971          ELSE
 972             COMPUTE S_FE_TUITION_FEE ROUNDED = WS_TOTAL_CREDIT_POINTS * P_FE_TUITION_FEE_POST_1997 / 10
 973          END-IF
 974          MULTIPLY 10 BY S_FE_TUITION_FEE
 975       END-IF.
 976  
 977  D1239_TUITION_FEE_EXIT.
 978       EXIT.
 979  /
 980  D1240_BRIDGING_TUITION_FEE SECTION.
 981  
 982  *******************************************************************************
 983  * FUNCTION: Get S_FE_BRIDGING_TUITION_FEE
 984  *******************************************************************************
 985  
 986  D1241_BRIDGING_TUITION_FEE.
 987  
 988       IF WS_STARTING_SEMESTER = 1        OR
 989          (WS_STARTING_SEMESTER = 2  AND
 990           REQUESTED_SEMESTER = 2)           THEN
 991          IF S_PE_BRIDGING_COURSE(REQUESTED_SEMESTER) = BRIDGING_YES THEN
 992             MOVE P_FE_BRIDGING_TUITION_FEE TO S_FE_BRIDGING_TUITION_FEE
 993          ELSE
 994             MOVE ZERO TO S_FE_BRIDGING_TUITION_FEE
 995          END-IF
 996       ELSE
 997          MOVE ZERO TO S_FE_BRIDGING_TUITION_FEE
 998       END-IF.
 999  
1000  D1249_BRIDGING_TUITION_FEE_EXIT.
1001       EXIT.
1002  /
1003  D1250_MUSIC_LESSONS_FEE SECTION.
1004  
1005  *******************************************************************************
1006  * FUNCTION: Get S_FE_MUSIC_LESSONS_FEE
1007  *******************************************************************************
1008  
1009  D1251_MUSIC_LESSONS_FEE.
1010  
1011       IF S_PE_MUSIC_LESSONS(REQUESTED_SEMESTER) = MUSIC_LESSONS_NO THEN
1012          MOVE 0 TO S_FE_MUSIC_LESSONS_FEE
1013       ELSE
1014          IF S_PE_MUSIC_LESSONS(REQUESTED_SEMESTER) IS NUMERIC THEN
1015             MOVE S_PE_MUSIC_LESSONS(REQUESTED_SEMESTER) TO WS_NUM_UNITS
1016             MULTIPLY P_FE_MUSIC_HALF_HR_FEE BY WS_NUM_UNITS GIVING S_FE_MUSIC_LESSONS_FEE
1017          ELSE
1018             DISPLAY 'Invalid MUSIC LESSONS number of units ' COLUMN 1 LINE 24 NO ADVANCING
1019             ACCEPT ANS FROM COLUMN 76
1020          END-IF
1021       END-IF.
1022  
1023  D1259_MUSIC_LESSONS_FEE_EXIT.
1024       EXIT.
1025  /
1026  D1260_MUSIC_PRACTICE_FEE SECTION.
1027  
1028  *******************************************************************************
1029  * FUNCTION: Get S_FE_MUSIC_PRACTICE_FEE
1030  *******************************************************************************
1031  
1032  D1261_MUSIC_PRACTICE_FEE.
1033  
1034       IF S_PE_MUSIC_PRACTICE(REQUESTED_SEMESTER) = YN_YES THEN
1035          MOVE P_FE_MUSIC_PRACTICE_FEE TO S_FE_MUSIC_PRACTICE_FEE
1036       ELSE
1037          MOVE 0 TO S_FE_MUSIC_PRACTICE_FEE
1038       END-IF.
1039  
1040  D1269_MUSIC_PRACTICE_FEE_EXIT.
1041       EXIT.
1042  /
1043  D1270_FACILITY_FEE SECTION.
1044  
1045  *******************************************************************************
1046  * FUNCTION: Get S_FE_FACILITY_FEE
1047  *******************************************************************************
1048  
1049  D1271_FACILITY_FEE.
1050  
1051       IF S_PE_CAMPUS(REQUESTED_SEMESTER) = CAMPUS_COORANBONG THEN
1052  *        IF REQUESTED_SEMESTER = 1                        AND
1053  *           S_CO_COURSE_CODE = B_ED_PRIMARY_END-ON        AND
1054  *           S_CO_CURRENT_SEMESTER(REQUESTED_SEMESTER) = 7 THEN
1055  ** These students are doing 10 credit points as PP3501 & PP3511 away from College
1056  ** No facility fee will be charged for those credit points
1057  *           COMPUTE S_FE_FACILITY_FEE ROUNDED = P_FE_FACILITY_FEE_COOR * (WS_TOTAL_CREDIT_POINTS - 10) / 10
1058  *        ELSE
1059             COMPUTE S_FE_FACILITY_FEE ROUNDED = P_FE_FACILITY_FEE_COOR * WS_TOTAL_CREDIT_POINTS / 10
1060  *        END-IF
1061       ELSE
1062          COMPUTE S_FE_FACILITY_FEE ROUNDED = P_FE_FACILITY_FEE_WAH * WS_TOTAL_CREDIT_POINTS / 10
1063       END-IF.
1064       MULTIPLY 10 BY S_FE_FACILITY_FEE.
1065  
1066  D1279_FACILITY_FEE_EXIT.
1067       EXIT.
1068  /
1069  D1310_RESIDENCE_FEES SECTION.
1070  
1071  *******************************************************************************
1072  * FUNCTION: Get S_FE_RESIDENCE_FEE, S_FE_SINGLE_ROOM_FEE, S_FE_ROOM_DEPOSIT
1073  *******************************************************************************
1074  
1075  D1311_RESIDENCE_FEES.
1076  
1077       MOVE ZERO TO S_FE_RESIDENCE_FEE
1078                    S_FE_SINGLE_ROOM_FEE
1079                    S_FE_ROOM_DEPOSIT.
1080       IF S_PE_RESIDENCE_TYPE(REQUESTED_SEMESTER) = RES_INDOOR AND
1081          S_PE_CAMPUS(REQUESTED_SEMESTER) = CAMPUS_COORANBONG  THEN
1082  *4        MOVE P_FE_RESIDENCE_FEE TO S_FE_RESIDENCE_FEE
1083          EVALUATE S_PE_RESIDENCE_OPTION(REQUESTED_SEMESTER)
1084             WHEN 16     MOVE 2650               TO S_FE_RESIDENCE_FEE
1085             WHEN 18     MOVE 2695               TO S_FE_RESIDENCE_FEE
1086             WHEN 21     MOVE 2756               TO S_FE_RESIDENCE_FEE
1087             WHEN OTHER  MOVE P_FE_RESIDENCE_FEE TO S_FE_RESIDENCE_FEE
1088          END-EVALUATE
1089  *        IF REQUESTED_SEMESTER = 1                        AND
1090  *           S_CO_COURSE_CODE = B_ED_PRIMARY_END-ON        AND
1091  *           S_CO_CURRENT_SEMESTER(REQUESTED_SEMESTER) = 7 THEN
1092  ** These students are at College for only 39 days in 1st semester
1093  ** 39 days * $26.85 = $1047.15
1094  *           MOVE 1047.15 TO S_FE_RESIDENCE_FEE
1095  *        END-IF
1096  *----------
1097          IF S_PE_SINGLE_ROOM_REQUEST(REQUESTED_SEMESTER) = SINGLE_ROOM_YES THEN
1098  *           IF REQUESTED_SEMESTER = 1                     AND
1099  *           S_CO_COURSE_CODE = B_ED_PRIMARY_END-ON        AND
1100  *           S_CO_CURRENT_SEMESTER(REQUESTED_SEMESTER) = 7 THEN
1101  ** These students are at College for only 39 days in 1st semester
1102  ** Do not charge for single room
1103  *              MOVE 0 TO S_FE_SINGLE_ROOM_FEE
1104  *           ELSE
1105                MOVE P_FE_RESIDENCE_SINGLE_FEE TO S_FE_SINGLE_ROOM_FEE
1106  *           END-IF
1107          END-IF
1108  *----------
1109          IF REQUESTED_SEMESTER = WS_STARTING_SEMESTER THEN
1110             MOVE P_FE_ROOM_DEPOSIT TO S_FE_ROOM_DEPOSIT
1111          END-IF
1112       END-IF.
1113  
1114  D1319_RESIDENCE_FEES_EXIT.
1115       EXIT.
1116  /
1117  D1320_BRIDGING_RESID_FEE SECTION.
1118  
1119  *******************************************************************************
1120  * FUNCTION: Get S_FE_BRIDGING_RESID_FEE
1121  *******************************************************************************
1122  
1123  D1321_BRIDGING_RESID_FEE.
1124  
1125       IF WS_STARTING_SEMESTER = 1        OR
1126          (WS_STARTING_SEMESTER = 2  AND
1127           REQUESTED_SEMESTER = 2)           THEN
1128          IF S_PE_RESIDENCE_TYPE(REQUESTED_SEMESTER) = RES_INDOOR AND
1129             S_PE_CAMPUS(REQUESTED_SEMESTER) = CAMPUS_COORANBONG  AND
1130             S_PE_BRIDGING_COURSE(REQUESTED_SEMESTER) = YN_YES    THEN
1131             MOVE P_FE_BRIDGING_RESID_FEE TO S_FE_BRIDGING_RESID_FEE
1132          ELSE
1133             MOVE ZERO                    TO S_FE_BRIDGING_RESID_FEE
1134          END-IF
1135      ELSE
1136          MOVE ZERO TO S_FE_BRIDGING_RESID_FEE
1137      END-IF.
1138  
1139  D1329_BRIDGING_RESID_FEE_EXIT.
1140       EXIT.
1141  /
1142  D1330_ORIENT_RESID_FEE SECTION.
1143  
1144  *******************************************************************************
1145  * FUNCTION: Get S_FE_ORIENT_RESID_FEE
1146  *******************************************************************************
1147  
1148  D1331_ORIENT_RESID_FEE.
1149  
1150       IF WS_STARTING_SEMESTER = 1        OR
1151          (WS_STARTING_SEMESTER = 2  AND
1152           REQUESTED_SEMESTER = 2)           THEN
1153          IF S_PE_ORIENTATION(REQUESTED_SEMESTER) = YN_YES        AND
1154             S_PE_RESIDENCE_TYPE(REQUESTED_SEMESTER) = RES_INDOOR AND
1155             S_PE_CAMPUS(REQUESTED_SEMESTER) = CAMPUS_COORANBONG  THEN
1156             MOVE P_FE_ORIENT_RESID_FEE    TO S_FE_ORIENT_RESID_FEE
1157          ELSE
1158             MOVE ZERO TO S_FE_ORIENT_RESID_FEE
1159          END-IF
1160       END-IF.
1161  
1162  D1339_ORIENT_RESID_FEE_EXIT.
1163       EXIT.
1164  /
1165  D2810_DEP_DISCOUNT SECTION.
1166  
1167  ********************************************************************************
1168  * FUNCTION: Compute Dependents Discount, rounded to nearest 10 cents
1169  ********************************************************************************
1170  
1171  D2811_DEP_DISCOUNT.
1172  
1173  * +-----------------------------------------------+
1174  * |Dependents Discount for requested semester     |
1175  * |DEPNT_DISC_PCENT                               |
1176  * |-----------------------------------------------|
1177  * |Wahroonga Campus               | Y | N | N | N |
1178  * |Indoor Dependent               | - | Y | N | - |
1179  * |Outdoor Dependent              | - | N | Y | - |
1180  * |Missionary Dependent           | - | N | N | Y |
1181  * |===============================================+
1182  * |P_FE_DEPNT_DISC_I_PCENT        | X | X | - | - |
1183  * |P_FE_DEPNT_DISC_O_PCENT        | - | - | X | - |
1184  * |P_FE_DEPNT_DISC_MISNRY_PCENT   | - | - | - | X |
1185  * +-----------------------------------------------+
1186  
1187       MOVE I_PE_DATE_OF_BIRTH TO WS_DATE_OF_BIRTH.
1188       PERFORM E1010_AGE_AT_SEM_COMM.
1189       IF S_PE_DEPENDENT_DISC_FLAG(REQUESTED_SEMESTER) = YN_YES OR
1190          AGE NOT > 25 THEN
1191          MOVE S_CO_DATE_COMMENCED TO WS_CRS_DATE_COMMENCED
1192          PERFORM E1020_AGE_AT_CRS_COMM
1193          IF S_PE_DEPENDENT_DISC_FLAG(REQUESTED_SEMESTER) = YN_YES OR
1194             AGE NOT > 21 THEN
1195  
1196             IF S_PE_DENOM_EMP_FATHER(REQUESTED_SEMESTER) NOT = DENOM_NOT_EMPLOYED OR
1197                S_PE_DENOM_EMP_MOTHER(REQUESTED_SEMESTER) NOT = DENOM_NOT_EMPLOYED THEN
1198                IF S_PE_MARITAL_STATUS(REQUESTED_SEMESTER) = MARITAL_SINGLE THEN
1199  
1200                   IF S_PE_CAMPUS(REQUESTED_SEMESTER) =CAMPUS_WAHROONGA THEN
1201                      MOVE P_FE_DEPNT_DISC_I_PCENT TO WS_DEPNT_DISC_PCENT
1202                   ELSE
1203                      IF S_PE_MISSIONARY_DISCOUNT(REQUESTED_SEMESTER) = MISSIONARY_DISC_YES THEN
1204                         MOVE P_FE_DEPNT_DISC_MISNRY_PCENT TO WS_DEPNT_DISC_PCENT
1205                      ELSE
1206                         IF S_PE_RESIDENCE_TYPE(REQUESTED_SEMESTER) = RES_INDOOR THEN
1207                            MOVE P_FE_DEPNT_DISC_I_PCENT TO WS_DEPNT_DISC_PCENT
1208                         ELSE
1209                            MOVE P_FE_DEPNT_DISC_O_PCENT TO WS_DEPNT_DISC_PCENT
1210                         END-IF
1211                      END-IF
1212                   END-IF
1213                ELSE
1214                   MOVE 0 TO WS_DEPNT_DISC_PCENT
1215             ELSE
1216                MOVE 0 TO WS_DEPNT_DISC_PCENT
1217             END-IF
1218  
1219  *5 *          For Education (HECS-paying) students, base the discount on the Up-front HECS liability
1220  *5 *          instead of the tuition fee.
1221  *5 *          For all others, use tuition fee.
1222  *5 *          Note:  Up-front fee here is calculated the way the Avondale College Student Finance Officer
1223  *5 *          calculates it, which is:
1224  *5 *                 75% of full liability, truncated upwards to the next dollar
1225  *5            IF C_CM_AOU = 'EDU'                               AND
1226  *5               S_PE_FEE_STUDENT NOT = FEE_FULL_FEE_PAYING_OS THEN
1227  *5 *             Up-front HECS liability for this semester (no cents)
1228  *5               IF S_PE_HECS_PREXMT_TOT(REQUESTED_SEMESTER) < 1 THEN
1229  *5                  MOVE ZERO TO WS_WHATEVER_FEE
1230  *5               ELSE
1231  *5 *                Up-front HECS fee = 75% of total liability
1232  *5                  COMPUTE WS_WHATEVER_FEE = S_PE_HECS_PREXMT_TOT(REQUESTED_SEMESTER) * 0.75
1233  *5 *                If cents would have arisen from the above calculation, go up to next whole dollar:
1234  *5 *                NOTE: If 75% figure changes, the 4 in the MOD function must be changed (or decide a different way)
1235  *5                  IF FUNCTION MOD (S_PE_HECS_PREXMT_TOT(REQUESTED_SEMESTER) 4) NOT = 0 THEN
1236  *5                     COMPUTE WS_WHATEVER_FEE = (WS_WHATEVER_FEE + 1) / 100
1237  *5                     MULTIPLY 100 BY WS_WHATEVER_FEE
1238  *5                  END-IF
1239  *5               END-IF
1240  *5            ELSE
1241  *5               MOVE S_FE_TUITION_FEE TO WS_WHATEVER_FEE
1242  *5            END-IF
1243  
1244             COMPUTE WS_DISC_AMT_TUITION = S_FE_TUITION_FEE
1245  *5                                       WS_WHATEVER_FEE {instead of S_FE_TUITION_FEE}
1246                                         + S_FE_BRIDGING_TUITION_FEE
1247                                         + S_FE_MUSIC_LESSONS_FEE
1248                                         + S_FE_MUSIC_PRACTICE_FEE
1249                                         + S_FE_FACILITY_FEE
1250                                         - S_FE_COL_SSHIP  
1251             COMPUTE S_FE_DEPNT_DISC_TUITION ROUNDED = WS_DISC_AMT_TUITION
1252                                                     * WS_DEPNT_DISC_PCENT / 1000
1253  * This is for rounding to 10 cents
1254             MULTIPLY 10 BY S_FE_DEPNT_DISC_TUITION
1255  
1256             COMPUTE WS_DISC_AMT_RES ROUNDED = S_FE_RESIDENCE_FEE
1257                                             + S_FE_SINGLE_ROOM_FEE
1258                                             + S_FE_BRIDGING_RESID_FEE
1259                                             + S_FE_ORIENT_RESID_FEE
1260             IF S_PE_MISSIONARY_DISCOUNT(REQUESTED_SEMESTER) = MISSIONARY_DISC_YES THEN
1261                COMPUTE S_FE_DEPNT_DISC_RES  ROUNDED = WS_DISC_AMT_RES
1262                                                     * WS_DEPNT_DISC_PCENT / 1000
1263  * This is for rounding to 10 cents
1264                MULTIPLY 10 BY S_FE_DEPNT_DISC_RES
1265             ELSE
1266                MOVE ZERO TO S_FE_DEPNT_DISC_RES
1267             END-IF
1268          END-IF
1269       END-IF.
1270  
1271       IF WS_TOTAL_CREDIT_POINTS = ZERO THEN
1272          MOVE ZERO TO S_FE_DEPNT_DISC_TUITION
1273                       S_FE_DEPNT_DISC_RES
1274       END-IF.
1275  
1276  D2819_DEPEND_DISCOUNT.
1277       EXIT.
1278  /
1279  D2820_FAMILY_DISCOUNT SECTION.
1280  
1281  ********************************************************************************
1282  * FUNCTION: COMPUTE FAMILY DISCOUNT
1283  ********************************************************************************
1284  
1285  D2821_FAMILY_DISCOUNT.
1286  
1287       IF S_PE_NAME_NUMBER_SIBLING(REQUESTED_SEMESTER) NOT = ZERO AND
1288          S_PE_FEE_STUDENT = FEE_NOT_FULL_FEE_PAYING_OS      THEN
1289          IF S_PE_MARITAL_STATUS(REQUESTED_SEMESTER) = MARITAL_SINGLE THEN
1290             MOVE SPACES TO SIBLING_MESSAGE
1291             MOVE I_PE_DATE_OF_BIRTH TO WS_DATE_OF_BIRTH
1292             PERFORM E1010_AGE_AT_SEM_COMM
1293             IF AGE NOT > 25 THEN
1294                MOVE S_CO_DATE_COMMENCED TO WS_CRS_DATE_COMMENCED
1295                PERFORM E1020_AGE_AT_CRS_COMM
1296                IF AGE NOT > 21 THEN
1297                   PERFORM E1030_EXAMINE_SIBLING
1298                   IF ELIGIBLE THEN
1299                      COMPUTE S_FE_FAMILY_DISC_TUITION ROUNDED = (WS_DISC_AMT_TUITION
1300                                                               -  S_FE_DEPNT_DISC_TUITION)
1301                                                               * P_FE_FAMILY_DISCOUNT_PCENT / 1000
1302                      MULTIPLY 10 BY S_FE_FAMILY_DISC_TUITION
1303                      COMPUTE S_FE_FAMILY_DISC_RES ROUNDED = WS_DISC_AMT_RES
1304                                                           * P_FE_FAMILY_DISCOUNT_PCENT / 1000
1305                      MULTIPLY 10 BY S_FE_FAMILY_DISC_RES
1306                   ELSE
1307                      MOVE ZERO TO S_FE_FAMILY_DISC_TUITION
1308                                   S_FE_FAMILY_DISC_RES
1309                   END-IF
1310                ELSE
1311                   MOVE ZERO TO S_FE_FAMILY_DISC_TUITION
1312                                S_FE_FAMILY_DISC_RES
1313                   MOVE 'Student over 21 yrs of age' TO SIBLING_MESSAGE
1314                END-IF
1315             ELSE
1316                MOVE ZERO TO S_FE_FAMILY_DISC_TUITION
1317                             S_FE_FAMILY_DISC_RES
1318                MOVE 'Student over 25 yrs of age' TO SIBLING_MESSAGE
1319             END-IF
1320          ELSE
1321             MOVE 'Student not single' TO SIBLING_MESSAGE
1322          END-IF
1323       ELSE
1324          MOVE ZERO TO S_FE_FAMILY_DISC_TUITION
1325                       S_FE_FAMILY_DISC_RES
1326       END-IF.
1327       IF WS_TOTAL_CREDIT_POINTS = ZERO THEN
1328          MOVE ZERO TO S_FE_FAMILY_DISC_TUITION
1329                       S_FE_FAMILY_DISC_RES
1330       END-IF.
1331  
1332  
1333  D2829_FAMILY_DISCOUNT_EXIT.
1334       EXIT.
1335  /
1336  * D2840_FIN_REGO_REBATE SECTION.
1337  * 
1338  * ********************************************************************************
1339  * * FUNCTION: COMPUTE FINANCIAL REGISTRATION REBATE
1340  * ********************************************************************************
1341  * 
1342  * D2841_FIN_REGO_REBATE.
1343  * 
1344  *      MOVE 0 TO S_FE_FIN_REGO_REBATE.
1345  *      EVALUATE REQUESTED_SEMESTER
1346  *         WHEN        1          IF S_PE_PRT_REGO_REBATE(1) = YN_YES THEN
1347  *                                   MOVE P_FE_FIN_REGO_REBATE TO S_FE_FIN_REGO_REBATE
1348  *                                END-IF
1349  *         WHEN      OTHER        IF S_PE_PRT_REGO_REBATE(2) = YN_YES THEN
1350  *                                   MOVE P_FE_FIN_REGO_REBATE TO S_FE_FIN_REGO_REBATE
1351  *                                END-IF
1352  *      END-EVALUATE.
1353  * 
1354  * D2849_FIN_REGO_REBATE_EXIT.
1355  *      EXIT.
1356  * /
1357  E1010_AGE_AT_SEM_COMM SECTION.
1358  
1359  ********************************************************************************
1360  * FUNCTION: Determine age at start of semester
1361  ********************************************************************************
1362  
1363  E1011_AGE_AT_SEM_COMM.
1364  
1365       CALL "ASP$CALCULATE_AGE" USING WS_DATE_OF_BIRTH
1366                                      P_VA_1ST_DAY_SEM(REQUESTED_SEMESTER)
1367                                      AGE.
1368  
1369  E1019_AGE_AT_SEM_COMM_EXIT.
1370       EXIT.
1371  /
1372  E1020_AGE_AT_CRS_COMM SECTION.
1373  
1374  ********************************************************************************
1375  * FUNCTION: AGE AT COMMENCEMENT OF COURSE 
1376  ********************************************************************************
1377  
1378  E1021_AGE_AT_CRS_COMM.
1379  
1380       CALL "ASP$CALCULATE_AGE" USING WS_DATE_OF_BIRTH
1381                                      WS_CRS_DATE_COMMENCED
1382                                      AGE.
1383  
1384  E1029_AGE_AT_CRS_COMM_EXIT.
1385       EXIT.
1386  /
1387  E1030_EXAMINE_SIBLING SECTION.
1388  
1389  ********************************************************************************
1390  * FUNCTION: Examine sibling's eligibility for family discount
1391  ********************************************************************************
1392  
1393  E1031_EXAMINE_SIBLING.
1394  
1395       MOVE V_NOT_ELIGIBLE TO SIBLING_ELIGIBILITY_STATUS.
1396  
1397       MOVE S_PE_NAME_NUMBER_SIBLING(REQUESTED_SEMESTER) TO SB_PE_NAME_NUMBER
1398                                                            SB_CO_NAME_NUMBER.    
1399       IF FILE_TYPE_LETTER = FTL_APPLICANT THEN
1400          MOVE FTN_APPLICANT TO SIB_FILE_TYPE_NUMBER
1401          MOVE FTL_APPLICANT TO SIB_FILE_TYPE_LETTER
1402       ELSE
1403          MOVE FTN_STUDENT TO SIB_FILE_TYPE_NUMBER
1404          MOVE FTL_STUDENT TO SIB_FILE_TYPE_LETTER
1405       END-IF
1406       PERFORM W4611_OPEN_INPUT_SB_PE.
1407       PERFORM W4311_OPEN_INPUT_SB_CO.
1408       PERFORM W4651_READ_SB_PE_BY_NUMBER.
1409       IF SB_PE_NOT_FOUND THEN
1410          IF FILE_TYPE_LETTER = FTL_APPLICANT THEN
1411             MOVE FTN_STUDENT TO SIB_FILE_TYPE_NUMBER
1412             MOVE FTL_STUDENT TO SIB_FILE_TYPE_LETTER
1413          ELSE
1414             MOVE FTN_APPLICANT TO SIB_FILE_TYPE_NUMBER
1415             MOVE FTL_APPLICANT TO SIB_FILE_TYPE_LETTER
1416          END-IF
1417          PERFORM W4611_OPEN_INPUT_SB_PE
1418          PERFORM W4311_OPEN_INPUT_SB_CO
1419          MOVE S_PE_NAME_NUMBER_SIBLING(REQUESTED_SEMESTER) TO SB_PE_NAME_NUMBER
1420          PERFORM  W4651_READ_SB_PE_BY_NUMBER
1421       END-IF.
1422  
1423       IF SB_PE_FOUND THEN
1424          UNLOCK SR_SIBLING_PERSONAL RECORD
1425          PERFORM E1040_VALIDATE_SIBLING
1426       ELSE
1427          MOVE 'Sibling not on file' TO SIBLING_MESSAGE
1428       END-IF.
1429  
1430  E1039_EXAMINE_SIBLING_EXIT.
1431       EXIT.
1432  /
1433  E1040_VALIDATE_SIBLING SECTION.
1434  
1435  *******************************************************************************
1436  * FUNCTION: 
1437  *******************************************************************************
1438  
1439  E1041_VALIDATE_SIBLING.
1440  
1441       IF REQUESTED_SEMESTER = 1      AND
1442          SB_PE_STARTING_SEMESTER = 2 THEN
1443          MOVE 'Sibling not starting till 2nd semester' TO SIBLING_MESSAGE
1444       ELSE
1445  *       Read sibling name and birth date from ci_personal file:
1446          MOVE CI_PERSONAL_REC    TO WS_SAVE_BUFFER
1447          MOVE I_PE_STATUS_FLAG   TO WS_SAVE_STATUS_FLAG
1448          MOVE SPACES             TO CI_PERSONAL_REC
1449          MOVE SB_PE_NAME_NUMBER  TO I_PE_NAME_NUMBER
1450          PERFORM WI0350_READ_I_PE
1451          IF I_PE_FOUND THEN
1452             MOVE I_PE_DATE_OF_BIRTH TO WS_SIBLING_DATE_OF_BIRTH
1453          ELSE
1454             MOVE '**Not in name file**' TO I_PE_SURNAME
1455             MOVE ALL ZEROS          TO WS_SIBLING_DATE_OF_BIRTH
1456          END-IF
1457  
1458          MOVE SB_PE_COURSE_RECORD_NUMBER(REQUESTED_SEMESTER) TO SB_CO_COURSE_RECORD_NUMBER
1459          PERFORM W4351_READ_SB_CO
1460  *! handle not on file
1461          IF NOT SB_CO_FOUND THEN
1462             DISPLAY  SB_CO_COURSE_KEY AT LINE 24 COLUMN 1
1463                      ' NOT IN SR' SIB_FILE_TYPE_LETTER
1464                      ' COURSE FILE.  PLEASE EXIT.' NO ADVANCING
1465             ACCEPT ANS FROM COLUMN 76
1466          ELSE
1467             UNLOCK SIBLING_COURSE_FILE RECORD
1468          END-IF
1469          MOVE WS_SIBLING_DATE_OF_BIRTH TO WS_DATE_OF_BIRTH
1470          PERFORM E1010_AGE_AT_SEM_COMM
1471          IF AGE > 25 THEN
1472             MOVE 'Sibling over 25 yrs of age' TO SIBLING_MESSAGE
1473          ELSE
1474             MOVE SB_CO_DATE_COMMENCED TO WS_CRS_DATE_COMMENCED
1475             PERFORM E1020_AGE_AT_CRS_COMM
1476  
1477             EVALUATE TRUE
1478                WHEN  AGE > 21
1479                            MOVE 'Sibling over 21 yrs of age'    TO SIBLING_MESSAGE
1480  
1481                WHEN  SB_PE_MARITAL_STATUS(REQUESTED_SEMESTER)      =  MARITAL_MARRIED
1482                            MOVE 'Sibling not single'            TO SIBLING_MESSAGE
1483  
1484                WHEN  SB_PE_APPLICATION_STATUS(REQUESTED_SEMESTER)  =  APS_NO_APPLICATION_RECEIVED
1485                            MOVE 'Sibling has not applied'       TO SIBLING_MESSAGE
1486  
1487                WHEN  SB_PE_APPLICATION_STATUS(REQUESTED_SEMESTER)  =  APS_WITHDRAWN_APPLICANT
1488                            MOVE 'Sibling withdrew application'  TO SIBLING_MESSAGE
1489  
1490                WHEN  SB_PE_ACCEPTANCE_STATUS(REQUESTED_SEMESTER)   =  ACS_NOT_ACCEPTED
1491                            MOVE 'Sibling not accepted'          TO SIBLING_MESSAGE
1492  
1493                WHEN  SB_PE_REGISTRATION_STATUS(REQUESTED_SEMESTER) =  STS_STUDENT_ON_LEAVE
1494                            MOVE 'Sibling on leave'              TO SIBLING_MESSAGE
1495  
1496                WHEN  SB_PE_REGISTRATION_STATUS(REQUESTED_SEMESTER) =  STS_COMPLETED_COURSE
1497                            MOVE 'Sibling has completed course'  TO SIBLING_MESSAGE
1498  
1499                WHEN  SB_PE_REGISTRATION_STATUS(REQUESTED_SEMESTER) =  STS_WITHDRAWN_STUDENT
1500                            MOVE 'Sibling withdrew from College' TO SIBLING_MESSAGE
1501  
1502                WHEN  OTHER
1503                            MOVE V_ELIGIBLE TO SIBLING_ELIGIBILITY_STATUS
1504                            STRING I_PE_SURNAME  DELIMITED BY SPACE
1505                                   ' '           DELIMITED BY SIZE
1506                                   I_PE_INITIALS DELIMITED BY SIZE
1507                               INTO SIBLING_MESSAGE
1508             END-EVALUATE
1509  
1510          END-IF
1511  
1512          MOVE WS_SAVE_BUFFER      TO CI_PERSONAL_REC
1513          MOVE WS_SAVE_STATUS_FLAG TO I_PE_STATUS_FLAG     
1514  
1515       END-IF.
1516  
1517  E1049_VALIDATE_SIBLING_EXIT.
1518       EXIT.
1519  *
1520  COPY "SRS_INCLUDE:USER_MESSAGE".
1521  /
1522  W0000_FILE_IO SECTION.
1523  
1524  COPY "SRS_INCLUDE:FILE_TABLE_CODE".
1525  COPY "SRS_INCLUDE:SRCCOURS_I".
1526  COPY "SRS_INCLUDE:SIBCOURS_P".
1527  COPY "SRS_INCLUDE:SIBCOURS_I".
1528  COPY "SRS_INCLUDE:SIBPERSN_P".
1529  COPY "SRS_INCLUDE:SIBPERSN_I".
1530  COPY "SRS_INCLUDE:SRSCOURS_I".
1531  COPY "SRS_INCLUDE:SRSDENOM_I".
1532  COPY "SRS_INCLUDE:SRSPERSN_I".
1533  COPY "SRS_INCLUDE:PERSONAL_I".
1534  
1535  *SL1 COPY "SRS_INCLUDE:PR_STUDENT_LEDGER_I".
1536  COPY "SRS_INCLUDE:PRSLEDYY_I".
1537  *SL1 COPY "SRS_INCLUDE:STUDENT_LEDGER_I".
1538  COPY "SRS_INCLUDE:SLEDYY_I".
1539  
1540  
1541  END PROGRAM SRB$FEE_CALCULATION.