1. Calendar Functions Calendar Functions Not started 1.0 Calculate field Values for Calendar Tables Purpose After the user enters vacation days, and configures start dated, PEMS calculates the number of days in a term. Trigger Recalculate anytime there is a change to any records used to make these calculations upon save Conditions Initial configuration was completed. Sequence These functions may be run anytime there is a new school term record. need some way to limit how many times this is recalculated. Step 1 For each new School Term record, calculate the number of calendar days between the start and end dates, excluding the days specified in the associated Term Label record. Enter result in School Term calendar days. Step 2 For each School Term, count the number of associated Vacation Days records with status = activated. Step 3 Calculate School Term school days by subtracting the number of vacation days found above from the school days, enter as School Term calendar days Step 4 Academic Year school days is the sum of the associated School Term school days. Step 5 Academic Year calendar days is the sum of the associated School Term calendar days. END Calendar Functions Not started 1.1 Automatically Create Academic Years Past and Future Purpose Automate creating new academic future academic records when the user-defined promotion date has been reached.  This reduces the need for users to add a year every time they complete one. Trigger Promotion Date (school configuration)   =  actual date Conditions Initial configuration was completed. Sequence This function must run before more school terms can be created. Step 1 Find the  academic year record the farthest in the future, the "last record" Step 2 Create one more academic year record Step 3 Set field values: Sequence = last record sequence + 1 Start year = last record start year + 1 End year = last record end year + 1 Academic year name - concatenate start year - end year start date = last record start date + 1 year end date = last record end date + 1 year. set status = future END Calendar Functions Not started 1.2 Automatically Update Status of Academic Years. Purpose Academic Year records have a status of current, past, or future, update the status of the records automatically when the user-defined promotion date has been reached. Trigger Managed by the Promotion WorkFlow Conditions There can be only one current year. Sequence This step is best triggered after the next future record has been made and in accordance with the PROMOTION workflow. Step 1 Set previous current academic year status to 'past' Step 2 Set next year, based on ordinate to current. END Calendar Functions Not started 1.3 Automatically Create School Term Records Purpose Automate student term records creation as new academic years are added. Trigger When a new academic year is added. Conditions Sequence This step is best triggered after the creation of a new academic year record.  Term records must be made before students can have their plans updated. Step 1 Find the first term label record with Flag = official start term. Step 2 Create a new school term record Step 3 Set Term Start Year and Start Date Academic year: start date => term: start date Academic year start year => term: start year calculate estimated dates, terms may run over an calendar year Step 4 Calculate Term End Year, Term End Date If Term Label "End in same year" = true then: Term End Year = term: start year Term End Date = Term: start year; Term label:end month: Term Label End day If Term label "End in same year" = False then: Term End Year = term: start year + 1 Term End Date = Term: end year; Term label:end month: Term Label End day Step 4 Set other term field values: Name - concatenate term label name and term: start year status = future term label => related term label record academic year => related academic year record term label flag => term flag Step 5 If term label: flag not equal to "official end term" then go to the next term label record, increase term label: sequence by one. Ste 6 Set Term Start Year and Start Date If previous term label record (sequence -1) end month