What are examples of Groovy scripts in Student Financial Aid?
Customers can configure Groovy scripts to make automation decisions based on their desired business practices and outcomes.
The full set of updated configuration workbooks, including the Groovy scripts, is delivered with every product release as a part of Baseline Configuration. The latest baseline configuration can be found in the release notes posted on Cloud Customer Connect. You can search for a specific release using the "Release Notes" tag.
Here's a list of Groovy script examples for how various areas of the application can be configured.
- awardOverridingCriteria
- awardYearSelectionCriteria
- coaCostValue
- configurableDisbursementCriteria
- directLoanCrossOverLpAwySelection
- disbursementDates
- documentMetadataAdditionalResolutionAction
- enrollmentStatusOverride
- globalEnrollmentStatusCriteria
- gradeLevelProgression
- isirAssumptionAutoCodeClearingLogic / isirCCodeAutoCodeClearingLogic / isirHighlightAutoCodeClearingLogic / isirRejectCodeAutoCodeClearingLogic / isirVerificationClearanceRules
- isirAssumptionDocumentsRequired / isirCCodeDocumentsRequired / isirHighlightsDocumentsRequired / isirRejectCodeDocumentsRequired / isirVerificationDocumentsRequired
- isirDiscrepancyEvaluation
- isirUseSubsequentIsir
- isirUsedInPackaging
- letterCodeCriteria
- nfrDisbursementDates
- nfrEligibility
- nfrMaximumProjectedAwardAmount
- nfrPeriods
- nonTermAcyMonths
- pellEnrollmentIntensity
- plusCreditDecisionMatchingCriteria
- summerTermType
- termPaymentPeriodMonths
awardOverridingCriteria
Workbook: FAS_FUND_CONFIG.csv
Column: Award_Overriding_Criteria
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.AwardOverridingCriteriaScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
import org.joda.time.LocalDate
/* Baseline - Award Overriding Criteria for DSUB DUNSUB - combined Term and Non-Term */
static <T> Closure<T> lazy(Closure<T> init) {
T value
boolean isInitDue = true
return {
if (isInitDue) {
isInitDue = false
value = init()
}
value
}
}
def disbursementsInThisPp = lazy {
disbursements.getInScope(scope)
}
def nonCancelledDisbursementsInThisPp = lazy {
disbursementsInThisPp()
.getCancelled(false)
.filterStatuses { status -> status != "DISBURSEMENT_CANCELED" }
}
def disbursedDisbursementsInThisPp = lazy {
nonCancelledDisbursementsInThisPp().getWithStatus("DISBURSED")
}
def thisPpIsDisbursed = lazy {
log.debug(!disbursedDisbursementsInThisPp().empty, "DISBURSED PP")
}
def thisPpFundOutput = lazy {
partialFundOutput.getInLoanPeriod(lpNo).getInPaymentPeriod(ppNo)
}
def thisPpIsProrated = lazy {
log.debug(thisPpFundOutput().eligible && thisPpFundOutput().prorated, "PRORATED PP")
}
def isInNASuffix = term && term.standard && acy.terms.findAll { t -> t.startDate >= term.startDate && t.standard }
.every { t -> t.notAttending }
def disbursedAmount = thisPpIsDisbursed()
? disbursedDisbursementsInThisPp().totalDisbursementAmount
: (BigDecimal) null
def acceptedAmount = fundAcceptance.getInScope(scope)
.filterStatuses {it != "PENDING_ACCEPTANCE" }
.let {it.empty ? null : it.validatedAcceptedAmount }
def effectiveAcceptedAmount = thisPpIsDisbursed() ? disbursedAmount : acceptedAmount
def now = LocalDate.now()
def activeSummerTerms = acy.terms.filter {
it.summer && program.courses.getAssociatedTo(it)
.any {
it.schedulingStatus != "PROJECTED"
}
}
def activeSummerTrailers = activeSummerTerms.filter {
it.summerTrailer
}
def summerTrailerHasCourses = !activeSummerTrailers.empty
def summerTrailerStart = summerTrailerHasCourses ? activeSummerTrailers.startDate : null
def isActiveSummerTerm = activeSummerTerms.contains(term)
def isBeyondSummerTrailerThreshold = summerTrailerStart && now >= summerTrailerStart.minusDays(60)
def summerDocExists = lazy {
def summerDocsInAwy = receivedDocuments.forAwardYear(awy)
.getDocumentsForDocCode("SummerApplication", "Student")
log.debug(summerDocsInAwy != null && !summerDocsInAwy.empty, "SUMMER DOC EXISTS")
}
def isSummerTrailerState = log.debug(summerTrailerHasCourses && isBeyondSummerTrailerThreshold && summerDocExists(), "SUMMER TRAILER STATE")
def isActiveSummerHeader = log.debug(term?.summerHeader && isActiveSummerTerm, "ACTIVE SUMMER HEADER")
def isLessThanHalfTime = enrollmentStatus == "LESS_THAN_HALF_TIME"
def standardOrSummerHeader = (term?.isStandard() || isActiveSummerHeader)
optimizer
.setCumulativeGradeLevelLimitApplicable(
(!term || standardOrSummerHeader)
&& (!isLastAcy || program.undergraduate)
&& (!isLastAcy || !isInNASuffix)
&& !thisPpIsProrated())
.setFundingForPeriodFilter { fundCode, fundType -> fundCode != "DISCOUNT" }
.setCompensationValue(0)
.addPhase(thisPpIsDisbursed(), 1) {
it.withGiven(disbursedAmount)
}
if (!isLessThanHalfTime) {
optimizer
.addPhase(!term, 2)
.addPhase(term && standardOrSummerHeader && (!isSummerTrailerState || effectiveAcceptedAmount), 2) {
it.withPpMaximum(isSummerTrailerState ? effectiveAcceptedAmount : null)
}
.addPhase(isSummerTrailerState && (isActiveSummerTerm || standardOrSummerHeader && effectiveAcceptedAmount == null), 3)
}
if (program.enrollmentStatus == "X" || pp.status == "CANCELED")
{
return awardInfo.withMaxAmount(0.0).withRetainedAmount(0.0)
}
if (program.term)
{
def overlappingTerms = primaryProgram.terms.getOverlappingWith(term)
/* Methods returning collection, as well as filters, will be plural; otherwise singular */
if (overlappingTerms.studentsTermStatuses.contains("WITHDRAWN"))
{
log.debug("STUDENT TERM IS WITHDRAWN")
def r2t4OverlappingTerms = r2t4.getOverlappingWith(term)
.getWithProcessStatuses(["NOT_REQUIRED", "COMPLETED"])
.getWithOldas(overlappingTerms.oldas)
if (!r2t4OverlappingTerms.empty)
{
log.debug("R2T4 Overlapping Terms is not empty, FREEZING!")
def sum = nonCancelledDisbursementsInThisPp().ppMaxDisbursementAmount
return awardInfo.withMaxAmount(sum).withRetainedAmount(sum)
}
else
{
log.debug("R2T4 PROCESS NOT YET IN A FREEZING STATE")
}
}
if (enrollmentStatus == "NOT_ATTENDING")
{
log.debug("ZEROING - enrollmentStatus={} ", enrollmentStatus)
return awardInfo.withMaxAmount(0.0).withRetainedAmount(0.0)
}
}
if (log.debug(lp.endDate <= now, "LOAN PERIOD IN THE PAST")
|| (thisPpIsProrated() && thisPpIsDisbursed()))
{
def frozenAmount = disbursedAmount == null ? 0.0 : disbursedAmount
log.debug("FREEZING TO {}", frozenAmount)
return awardInfo.withMaxAmount(frozenAmount).withRetainedAmount(frozenAmount)
}
return awardInfo
awardYearSelectionCriteria
Workbook: FAS_FUND_CONFIG.csv
Column: Award_Year_Selection_Criteria
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.AwardYearSelectionCriteriaScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
/* Pell Award Year Selection Criteria - combined Term and Non-Term*/
//variables for earlier and later year ISIRs
def earlierYearISIRExists = isirRecords.getCurrentIsirForAwardYear(crossoverHelper.getCurrentAwardYear()) != null
def laterYearISIRExists = isirRecords.getCurrentIsirForAwardYear(crossoverHelper.getUpcomingAwardYear()) != null
//variables for earlier and later year Pell disbursements that are in "Disbursed" status
def earlierYearPellDisbursementExists = crossoverHelper.hasDisbursedDisbursementsInCurrentAwardYear()
def laterYearPellDisbursementExists = crossoverHelper.hasDisbursedDisbursementsInUpcomingAwardYear()
//if an ISIR and disbursements exist in the earlier year, then select the earlier year
if (earlierYearISIRExists && earlierYearPellDisbursementExists) {
return crossoverHelper.useCurrentAlternative()
}
//if an ISIR and disbursements exist the later year, then select the later year
if (laterYearISIRExists && laterYearPellDisbursementExists) {
return crossoverHelper.useUpcomingAlternative()
}
//if an ISIR exists in the earlier year and remaining eligibility > $0 for pell in the earlier year, then select the earlier year
if (earlierYearISIRExists && currentFunds.getFund("PELL").getOverlappingWith(pp).maxAmount > 0) {
return crossoverHelper.useCurrentAlternative()
}
//if an ISIR exists in the later year and no ISIRs exist in the earlier year, then select the later year
if (laterYearISIRExists && !earlierYearISIRExists) {
return crossoverHelper.useUpcomingAlternative()
}
//if none of the above criteria are met, then use default pell crossover logic
return crossoverHelper.useDefaultAlternative()
coaCostValue
Workbook: COA.csv
Column: Cost_Value
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.CoaCostValueScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
if (receivedDocuments.forAwardYear(awy).hasDoc("Housing")) {
def housingDoc = receivedDocuments.forAwardYear(awy).get("Housing")
def housingStatus = housingDoc.getDocumentField("AC1116")
if (housingStatus == "On Campus" || housingStatus == null || housingStatus.isAllWhitespace()) {
return 3700
}
if (housingStatus == "Off Campus" || housingStatus == "With Parent") {
return 0
}
}
else if (isirRecords.getCurrentIsirForAwardYear(2024) != null) {
def housingCode = isirRecords.getCurrentIsirForAwardYear(2024).getIsirFieldValue("FEDERALSCHOOLCODE1HOUSINGPLANS")
if (housingCode == "1") {
return 3600
}
}
return 3600
configurableDisbursementCriteria
Workbook: DISBURSEMENT.csv
Column: Disbursement_Criteria
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.ConfigurableDisbursementCriteriaScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
if (program.isTerm()) {
def termEnrollmentStatus = term.getStatus();
if (["HALF_TIME", "THREE_QUARTER_TIME", "FULL_TIME"].contains(termEnrollmentStatus)) {
return true;
}
return false;
}
return null;
directLoanCrossOverLpAwySelection
Workbook: PKGSCHEDATTRIB.csv
Column: Direct_Loan_Crossover_LP_AwY_Selection
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.DirectLoanCrossOverLpAwySelectionScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
import org.joda.time.LocalDate
//If the Loan Period start date is prior to to 07/01/24, return null
if (lp.startDate < new LocalDate(2024, 07, 01)) {
return null
}
//If there are disbursed TIV DL disbursements for the Loan Period return the earliest award year found for those disbursements
def tivDisbursementsInLP = disbursements
.getTitleIv()
.getLoans()
.getInLoanPeriod(lp)
def firstDisbursedAwardYear = candidateAwys.find{tivDisbursementsInLP
.getInAwardYear(it)
.getStatuses()
.contains("DISBURSED")}
if (firstDisbursedAwardYear != null) {
return firstDisbursedAwardYear
}
//If not a term program, return the current AwY
if (!program.isTerm()) {
return candidateAwys[0]
}
//If a summer trailer term is the loan period, return the upcoming AwY
def LPIsSummerTrailer = acys
.terms
.getOverlappingWith(lp)
.every{it.summerTrailer}
if (LPIsSummerTrailer) {
return candidateAwys[1]
}
//If the academic year contains a summer header, return the upcoming AwY
def LPContainsSummerHeader = acys
.terms
.getOverlappingWith(lp)
.any{it.summerHeader}
if (LPContainsSummerHeader) {
return candidateAwys[1]
}
//If first term is a cross-over, return the upcoming AwY
def firstTermIsCrossover = helper.awardYear.isCrossover(acys.terms[0])
if (firstTermIsCrossover) {
return candidateAwys[1]
}
//No other conditions met, return the current AwY
return candidateAwys[0]
disbursementDates
Workbook: FAS_FUND_CONFIG.csv
Column: Disbursement_Dates
return [period.startDate.plusDays(30)];
documentMetadataAdditionalResolutionAction
Workbook: DOCMETADATA.csv
Column: Additional_Resolution_Action
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.DocumentMetadataAdditionalResolutionActionScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
import org.joda.time.LocalDate
//if no ISIR, then exit the script
if (isirRecord == null) {
return
}
//Student ISIR variables
def isirSTUDENT_MARITALSTATUS = isirRecord.getField(IsirField.STUDENT_MARITALSTATUS).getOrNull()
def isirSTUDENT_DATEOFBIRTH = isirRecord.getField(IsirField.STUDENT_DATEOFBIRTH).getOrNull()
def isirSTUDENTFTIM_FILINGSTATUSCODE_FTI = isirRecord.getField(IsirField.STUDENTFTIM_FILINGSTATUSCODE_FTI).getOrNull()
//if FTI value is blank, then get non-FTI value instead
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == null) {
isirSTUDENTFTIM_FILINGSTATUSCODE_FTI = isirRecord.getField(IsirField.STUDENT_TAXRETURNFILINGSTATUS).getOrNull()
}
//Parent ISIR variables
def isirPARENT_DATEOFBIRTH = isirRecord.getField(IsirField.PARENT_DATEOFBIRTH).getOrNull()
def isirPARENTSPOUSE_DATEOFBIRTH = isirRecord.getField(IsirField.PARENTSPOUSE_DATEOFBIRTH).getOrNull()
def isirPARENTFTIM_FILINGSTATUSCODE_FTI = isirRecord.getField(IsirField.PARENTFTIM_FILINGSTATUSCODE_FTI).getOrNull()
//if FTI value is blank, then get non-FTI value instead
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == null) {
isirPARENTFTIM_FILINGSTATUSCODE_FTI = isirRecord.getField(IsirField.PARENT_TAXRETURNFILINGSTATUS).getOrNull()
}
//Document owner variable
def docOwner = currentDocument.getDocumentOwnerTypes().get(0)
if (isirRecord == null)
{
return
}
if (docOwner == "Student")
{
boolean hasVerificationWorksheetIndStudent = false
if (receivedDocuments.hasDoc("VW-Ind", "Student") && receivedDocuments.get("VW-Ind", "Student").isAcceptable())
{
hasVerificationWorksheetIndStudent = true
}
boolean hasSelfEmploymentStatementStudent = false
if (receivedDocuments.hasDoc("SelfEmploymentStatement", "Student") && receivedDocuments.get("SelfEmploymentStatement", "Student").isAcceptable())
{
hasSelfEmploymentStatementStudent = true
}
int selfEmploymentStudent = 0
if (hasSelfEmploymentStatementStudent)
{
if (receivedDocuments.get("SelfEmploymentStatement", "Student").getDocumentField("AC1015") != null && !receivedDocuments.get("SelfEmploymentStatement", "Student").getDocumentField("AC1015").isAllWhitespace())
{
selfEmploymentStudent = receivedDocuments.get("SelfEmploymentStatement", "Student").getDocumentField("AC1015").toFloat().round()
}
}
boolean hasSelfEmploymentStatementStudentSpouse = false
if (receivedDocuments.hasDoc("SelfEmploymentStatement", "Student Spouse") && receivedDocuments.get("SelfEmploymentStatement", "Student Spouse").isAcceptable())
{
hasSelfEmploymentStatementStudentSpouse = true
}
int selfEmploymentStudentSpouse = 0
if (hasSelfEmploymentStatementStudentSpouse)
{
if (receivedDocuments.get("SelfEmploymentStatement", "Student Spouse").getDocumentField("AC1015") != null && !receivedDocuments.get("SelfEmploymentStatement", "Student Spouse").getDocumentField("AC1015").isAllWhitespace())
{
selfEmploymentStudentSpouse = receivedDocuments.get("SelfEmploymentStatement", "Student Spouse").getDocumentField("AC1015").toFloat().round()
}
}
float w2SumStudentFloat = 0.0
def w2DocsStudent = receivedDocuments.getDocumentsForDocCode("W2", "Student")
for (doc in w2DocsStudent)
{
String ac1010 = doc.getDocumentField("AC1010")
float ac1010Value = 0.0
if (ac1010 != null && !ac1010.isAllWhitespace())
{
ac1010Value = ac1010.toFloat()
}
w2SumStudentFloat += ac1010Value
}
if (docOwner == "Student")
{
String currentAC1010 = currentDocument.getDocumentFieldValue("AC1010")
if (currentAC1010 != null && !currentAC1010.isAllWhitespace())
{
w2SumStudentFloat += currentAC1010.toFloat()
}
}
int w2SumStudent = w2SumStudentFloat.round()
float w2SumStudentSpouseFloat = 0.0
def w2DocsStudentSpouse = receivedDocuments.getDocumentsForDocCode("W2", "Student Spouse")
for (doc in w2DocsStudentSpouse)
{
String ac1010 = doc.getDocumentField("AC1010")
float ac1010Value = 0.0
if (ac1010 != null && !ac1010.isAllWhitespace())
{
ac1010Value = ac1010.toFloat()
}
w2SumStudentSpouseFloat += ac1010Value
}
if (docOwner == "Student Spouse")
{
String currentAC1010 = currentDocument.getDocumentFieldValue("AC1010")
if (currentAC1010 != null && !currentAC1010.isAllWhitespace())
{
w2SumStudentSpouseFloat += currentAC1010.toFloat()
}
}
int w2SumStudentSpouse = w2SumStudentSpouseFloat.round()
float doc1099StudentFloat = 0.0
def doc1099GDocsStudent = receivedDocuments.getDocumentsForDocCode("1099G", "Student")
for (doc in doc1099GDocsStudent)
{
String ac1013 = doc.getDocumentField("AC1013")
float ac1013Value = 0.0
if (ac1013 != null && !ac1013.isAllWhitespace())
{
ac1013Value = ac1013.toFloat()
}
doc1099StudentFloat += ac1013Value
}
int doc1099SumStudent = doc1099StudentFloat.round()
float doc1099StudentSpouseFloat = 0.0
def doc1099GDocsStudentSpouse = receivedDocuments.getDocumentsForDocCode("1099G", "Student Spouse")
for (doc in doc1099GDocsStudentSpouse)
{
String ac1013 = doc.getDocumentField("AC1013")
float ac1013Value = 0.0
if (ac1013 != null && !ac1013.isAllWhitespace())
{
ac1013Value = ac1013.toFloat()
}
doc1099StudentSpouseFloat += ac1013Value
}
int doc1099SumStudentSpouse = doc1099StudentSpouseFloat.round()
int totalIncome = 0
int StudentSpouseAge = -1
if (hasVerificationWorksheetIndStudent)
{
if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1044") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1034")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
else if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1045") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1035")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
else if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1046") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1036")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
else if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1047") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1037")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
else if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1048") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1038")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
else if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1049") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1039")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
else if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1050") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1040")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
else if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1051") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1041")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
else if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1052") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1042")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
else if (receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1053") == "Student Spouse")
{
String StudentSpouseAgeString = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1043")
if (StudentSpouseAgeString != null && !StudentSpouseAgeString.isAllWhitespace())
{
StudentSpouseAge = StudentSpouseAgeString.toInteger()
}
}
}
boolean studentAgeUnder65 = true
LocalDate age65Threshold = new LocalDate(1957, 12, 31)
LocalDate studentBirthday = new LocalDate(2022, 01, 01)
if (isirSTUDENT_DATEOFBIRTH != null)
{
studentBirthday = isirSTUDENT_DATEOFBIRTH.secureValue()
}
if (studentBirthday <= age65Threshold)
{
studentAgeUnder65 = false
}
int filingThreshold = 999999
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "1" && studentAgeUnder65)
{
filingThreshold = 12950
}
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "1" && !studentAgeUnder65)
{
filingThreshold = 14700
}
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "2" && studentAgeUnder65 && StudentSpouseAge)
{
filingThreshold = 25900
}
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "2" && (studentAgeUnder65 || StudentSpouseAge))
{
filingThreshold = 27300
}
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "2" && !studentAgeUnder65 && StudentSpouseAge)
{
filingThreshold = 28700
}
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "3")
{
filingThreshold = 5
}
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "4" && studentAgeUnder65)
{
filingThreshold = 19400
}
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "4" && !studentAgeUnder65)
{
filingThreshold = 21150
}
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "5" && studentAgeUnder65)
{
filingThreshold = 25900
}
if (isirSTUDENTFTIM_FILINGSTATUSCODE_FTI == "5" && !studentAgeUnder65)
{
filingThreshold = 27300
}
if (isirSTUDENT_MARITALSTATUS == "1" || isirSTUDENT_MARITALSTATUS == "2" || isirSTUDENT_MARITALSTATUS == "4" || isirSTUDENT_MARITALSTATUS == null)
{
totalIncome = w2SumStudent + doc1099SumStudent + selfEmploymentStudent
if (totalIncome >= filingThreshold)
{
/* supportingDoc.addDocument("IRSForm4868", "Student") */
supportingDoc.addAnyDocuments(["IRSForm4868", "Student"], ["IRSExtensionApproval", "Student"], ["TaxReturnTranscript", "Student"],["1040x", "Student"],["ForeignTaxTranscript", "Student"])
}
}
else if (isirSTUDENT_MARITALSTATUS == "3")
{
totalIncome = w2SumStudent + doc1099SumStudent + w2SumStudentSpouse + doc1099SumStudentSpouse + selfEmploymentStudent + selfEmploymentStudentSpouse
if (totalIncome >= filingThreshold)
{
/* supportingDoc.addAnyDocument("IRSForm4868", "Student") */
supportingDoc.addAnyDocuments(["IRSForm4868", "Student"], ["IRSExtensionApproval", "Student"], ["TaxReturnTranscript", "Student"],["1040x", "Student"],["ForeignTaxTranscript", "Student"],["TaxReturnTranscript", "Student Spouse"],["1040x", "Student Spouse"],["ForeignTaxTranscript", "Student Spouse"])
}
}
}
else if (docOwner == "Parent" || docOwner == "Parent Spouse")
{
boolean ParentUnder65 = true
boolean ParentSpouseUnder65 = true
LocalDate age65Threshold = new LocalDate(1957, 12, 31)
LocalDate ParentBirthday = new LocalDate(2022, 01, 01)
LocalDate ParentSpouseBirthday = new LocalDate(2022, 01, 01)
if (isirPARENT_DATEOFBIRTH != null)
{
ParentBirthday = isirPARENT_DATEOFBIRTH.secureValue()
}
if (isirPARENTSPOUSE_DATEOFBIRTH != null)
{
ParentSpouseBirthday = isirPARENTSPOUSE_DATEOFBIRTH.secureValue()
}
if (ParentBirthday <= age65Threshold)
{
ParentUnder65 = false
}
if (ParentSpouseBirthday <= age65Threshold)
{
ParentSpouseUnder65 = false
}
int filingThreshold = 999999
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "1" && ParentUnder65)
{
filingThreshold = 12950
}
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "1" && !ParentUnder65)
{
filingThreshold = 14700
}
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "2" && ParentUnder65 && ParentSpouseUnder65)
{
filingThreshold = 25900
}
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "2" && (ParentUnder65 || ParentSpouseUnder65))
{
filingThreshold = 27300
}
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "2" && !ParentUnder65 && ParentSpouseUnder65)
{
filingThreshold = 28700
}
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "3")
{
filingThreshold = 5
}
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "4" && ParentUnder65)
{
filingThreshold = 19400
}
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "4" && !ParentUnder65)
{
filingThreshold = 21150
}
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "5" && ParentUnder65)
{
filingThreshold = 25900
}
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "5" && !ParentUnder65)
{
filingThreshold = 27300
}
int selfEmploymentParent = 0
if (receivedDocuments.hasDoc("SelfEmploymentStatement", "Parent") && receivedDocuments.get("SelfEmploymentStatement", "Parent").isAcceptable() && receivedDocuments.get("SelfEmploymentStatement", "Parent").getDocumentField("AC1015") != null && !receivedDocuments.get("SelfEmploymentStatement", "Parent").getDocumentField("AC1015").isAllWhitespace())
{
selfEmploymentParent = receivedDocuments.get("SelfEmploymentStatement", "Parent").getDocumentField("AC1015").toFloat().round()
}
int selfEmploymentParentSpouse = 0
if (receivedDocuments.hasDoc("SelfEmploymentStatement", "Parent Spouse") && receivedDocuments.get("SelfEmploymentStatement", "Parent Spouse").isAcceptable() && receivedDocuments.get("SelfEmploymentStatement", "Parent Spouse").getDocumentField("AC1015") != null && !receivedDocuments.get("SelfEmploymentStatement", "Parent Spouse").getDocumentField("AC1015").isAllWhitespace())
{
selfEmploymentParentSpouse = receivedDocuments.get("SelfEmploymentStatement", "Parent Spouse").getDocumentField("AC1015").toFloat().round()
}
float w2SumParentFloat = 0.0
def w2DocsParent = receivedDocuments.getDocumentsForDocCode("W2", "Parent")
for (doc in w2DocsParent)
{
String ac1010 = doc.getDocumentField("AC1010")
float ac1010Value = 0.0
if (ac1010 != null && !ac1010.isAllWhitespace())
{
ac1010Value = ac1010.toFloat()
}
w2SumParentFloat += ac1010Value
}
if (docOwner == "Parent")
{
String currentAC1010 = currentDocument.getDocumentFieldValue("AC1010")
if (currentAC1010 != null && !currentAC1010.isAllWhitespace())
{
w2SumParentFloat += currentAC1010.toFloat()
}
}
int w2SumParent = w2SumParentFloat.round()
float w2SumParentSpouseFloat = 0.0
def w2DocsParentSpouse = receivedDocuments.getDocumentsForDocCode("W2", "Parent Spouse")
for (doc in w2DocsParentSpouse)
{
String ac1010 = doc.getDocumentField("AC1010")
float ac1010Value = 0.0
if (ac1010 != null && !ac1010.isAllWhitespace())
{
ac1010Value = ac1010.toFloat()
}
w2SumParentSpouseFloat += ac1010Value
}
if (docOwner == "Parent Spouse")
{
String currentAC1010 = currentDocument.getDocumentFieldValue("AC1010")
if (currentAC1010 != null && !currentAC1010.isAllWhitespace())
{
w2SumParentSpouseFloat += currentAC1010.toFloat()
}
}
int w2SumParentSpouse = w2SumParentSpouseFloat.round()
float doc1099ParentFloat = 0.0
def doc1099GDocsParent = receivedDocuments.getDocumentsForDocCode("1099G", "Parent")
for (doc in doc1099GDocsParent)
{
String ac1013 = doc.getDocumentField("AC1013")
float ac1013Value = 0.0
if (ac1013 != null && !ac1013.isAllWhitespace())
{
ac1013Value = ac1013.toFloat()
}
doc1099ParentFloat += ac1013Value
}
int doc1099SumParent = doc1099ParentFloat.round()
float doc1099ParentSpouseFloat = 0.0
def doc1099GDocsParentSpouse = receivedDocuments.getDocumentsForDocCode("1099G", "Parent Spouse")
for (doc in doc1099GDocsParentSpouse)
{
String ac1013 = doc.getDocumentField("AC1013")
float ac1013Value = 0.0
if (ac1013 != null && !ac1013.isAllWhitespace())
{
ac1013Value = ac1013.toFloat()
}
doc1099ParentSpouseFloat += ac1013Value
}
int doc1099SumParentSpouse = doc1099ParentSpouseFloat.round()
int totalIncome = 0
if (isirPARENTFTIM_FILINGSTATUSCODE_FTI == "3")
{
totalIncome = selfEmploymentParent + selfEmploymentParentSpouse + w2SumParent + w2SumParentSpouse + doc1099SumParent + doc1099SumParentSpouse
if (totalIncome >= filingThreshold)
{
supportingDoc.addAnyDocuments(["IRSForm4868", "Parent"], ["IRSExtensionApproval", "Parent"], ["TaxReturnTranscript", "Parent"],["1040x", "Parent"],["1040", "Parent"],["ForeignTaxTranscript", "Parent"],["IRSForm4868", "Parent Spouse"],["IRSExtensionApproval", "Parent Spouse"],["TaxReturnTranscript", "Parent Spouse"],["1040x", "Parent Spouse"],["1040", "Parent Spouse"],["ForeignTaxTranscript", "Parent Spouse"])
}
}
else
{
supportingDoc.addAnyDocuments(["IRSForm4868", "Parent"], ["IRSExtensionApproval", "Parent"], ["TaxReturnTranscript", "Parent"],["1040x", "Parent"],["1040", "Parent"],["ForeignTaxTranscript", "Parent"])
}
}
enrollmentStatusOverride
Workbook: FAS_FUND_CONFIG.csv
Column: Enrollment_Status_Override_Census_Dates
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.EnrollmentStatusOverrideScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
/* Pell Enrollment Status Override with Census Date - combined Term and Non-Term*/
import org.joda.time.LocalDate;
if (program.isTerm())
{
LocalDate termStartDate = term.getStartDate();
LocalDate termEndDate = term.getEndDate();
LocalDate censusDate;
LocalDate today = LocalDate.now();
String programType = primaryProgram.getProgramType();
censusDate = term.getStartDate().plusDays(10);
log.debug("CONFIG LOGGING STARTS HERE");
log.debug("censusDate = {}", censusDate);
log.debug("today = {}", today);
log.debug("termStartDate = {}", termStartDate);
def safiTerm = program.getTerms().getOverlappingWith(term).get(0);
if (censusDate != null && today > censusDate && (program.getEnrollmentStatus() == "W" || safiTerm.getStudentsTermStatus() == "WITHDRAWN"))
{
return enrollmentStatus;
/*
def countedUnits = 0.0;
for (def course: program.getCourses().getAssociatedTo(period))
{
if (["WITHDRAWN"].contains(course.getSchedulingStatus()))
{
if (course.getLastDateOfAttendance() != null && ((program.getOfficialLastDateOfAttendance() != null && course.getLastDateOfAttendance() == program.getOfficialLastDateOfAttendance()) || (safiTerm.getOlda() != null && course.getLastDateOfAttendance() == safiTerm.getOlda())))
{
log.debug("GLOBAL ENROLLMENT SCRIPT - WITHDRAWN: courseLDA = {}, courseSchedulingStatus = {}, programOLDA = {}, courseUnitsToAdd = {}", course.getLastDateOfAttendance(), course.getSchedulingStatus(), program.getOfficialLastDateOfAttendance(), course.getUnits());
countedUnits = countedUnits + course.getUnits();
}
}
else if (["SCHEDULED", "PASSED", "FAILED"].contains(course.getSchedulingStatus()))
{
log.debug("GLOBAL ENROLLMENT SCRIPT - SCHEDULED PASSED FAILED: courseSchedulingStatus = {}, courseUnitsToAdd = {}", course.getSchedulingStatus(), course.getUnits());
countedUnits = countedUnits + course.getUnits();
}
}
def NA = 0.0;
def LTHT = 6.0;
def HT = 9.0;
def TQT = 12.0;
return helper.mapRanges()
.le(NA, "NOT_ATTENDING")
.lt(LTHT, "LESS_THAN_HALF_TIME")
.lt(HT, "HALF_TIME")
.lt(TQT, "THREE_QUARTER_TIME")
.defaultValue("FULL_TIME")
.apply(countedUnits);
*/
}
else if (censusDate != null && today > censusDate)
{
log.debug("FIRST IF PASSED");
def previousFpo;
if (previousFinancialPlan.effectiveAt(censusDate) != null)
{
log.debug("USING CENSUS DATE PREVIOUS FPO");
previousFpo = previousFinancialPlan.effectiveAt(censusDate);
}
else if (financialPlan.getVersion() > 1)
{
log.debug("USING FPO VERSION - 1 PREVIOUS FPO");
previousFpo = previousFinancialPlan.withVersion(financialPlan.getVersion() - 1);
}
if (previousFpo != null)
{
def pellFundStatuses = previousFpo.getFund("PELL").getInAwardYear(awy).getFundStatuses();
if (!pellFundStatuses.contains("AWARDED") && !pellFundStatuses.contains("ESTIMATED"))
{
return enrollmentStatus;
}
log.debug("PREVIOUS FPO IS NOT NULL");
def previousPell = previousFpo.getFund("PELL").getInAcademicYear(acyNo).getInPaymentPeriod(ppNo);
if (previousPell.isEligible())
{
log.debug("PREVIOUS PELL IS ELIGIBLE");
if (!previousPell.getEnrollmentStatuses().isEmpty())
{
log.debug("PREVIOUS PELL HAS NON NULL ENROLLMENT STATUS");
log.debug("PREVIOUS PELL ENROLLMENT STATUS = {}", previousPell.getEnrollmentStatuses().get());
return previousPell.getEnrollmentStatuses().get();
}
}
}
}
return enrollmentStatus;
}
return enrollmentStatus;
9. globalEnrollmentStatusCriteria
Workbook: SCHOOL.csv
Column: Enrollment_Status_Determination
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.GlobalEnrollmentStatusCriteriaScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
/* Global Enrollment Status - SFP Baseline - Combined Term and Non-Term */
/*
def actualCourses = helper.filterCourses(program)
.period(term)
.safiCreatedDate(safiCreatedDate)
.go();
*/
import org.joda.time.LocalDate;
if (program.isTerm())
{
// If the student decides to cancel their enrollment and the Program Enrollment Status is X, then return NOT_ATTENDING
if (primaryProgram.getEnrollmentStatus() != null && primaryProgram.getEnrollmentStatus() == "X")
{
return "NOT_ATTENDING";
}
def countedUnits = 0.0;
def safiTerm = program.getTerms().getOverlappingWith(term).get(0);
// Institutions should define their own add drop policy
def addDropPolicy = term.getStartDate().plusDays(10);
log.debug ("Term start date = {}, term start date + 10 = {}", term.getStartDate(), addDropPolicy);
for (def course: program.getCourses().getAssociatedTo(period))
{
log.debug("GLOBAL ENROLLMENT SCRIPT, COURSE IN LOOP: courseEndDate = {}, courseAraIndicator = {}, courseSchedulingStatus = {}, courseUnitsToAdd = {}", course.getEndDate(), course.getFirstAraIndicator(), course.getSchedulingStatus(), course.getUnits());
// If the course is withdrawn, only count the credits if the course was withdrawn after the add/drop period. If the course is not withdrawn, count the course credits.
if ((["WITHDRAWN"].contains(course.getSchedulingStatus()) && course.getLastDateOfAttendance() != null && course.getLastDateOfAttendance() > addDropPolicy) || course.getSchedulingStatus() != "WITHDRAWN")
{
countedUnits = countedUnits + course.getUnits();
}
}
def NA = 0.0;
def LTHT = 6.0;
def HT = 9.0;
def TQT = 12.0;
return helper.mapRanges()
.le(NA, "NOT_ATTENDING")
.lt(LTHT, "LESS_THAN_HALF_TIME")
.lt(HT, "HALF_TIME")
.lt(TQT, "THREE_QUARTER_TIME")
.defaultValue("FULL_TIME")
.apply(countedUnits);
}
return "FULL_TIME";
globalEnrollmentStatusCriteria
Workbook: SCHOOL.csv
Column: Enrollment_Status_Determination
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.GlobalEnrollmentStatusCriteriaScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
/* Global Enrollment Status - SFP Baseline - Combined Term and Non-Term */
/*
def actualCourses = helper.filterCourses(program)
.period(term)
.safiCreatedDate(safiCreatedDate)
.go();
*/
import org.joda.time.LocalDate;
if (program.isTerm())
{
// If the student decides to cancel their enrollment and the Program Enrollment Status is X, then return NOT_ATTENDING
if (primaryProgram.getEnrollmentStatus() != null && primaryProgram.getEnrollmentStatus() == "X")
{
return "NOT_ATTENDING";
}
def countedUnits = 0.0;
def safiTerm = program.getTerms().getOverlappingWith(term).get(0);
// Institutions should define their own add drop policy
def addDropPolicy = term.getStartDate().plusDays(10);
log.debug ("Term start date = {}, term start date + 10 = {}", term.getStartDate(), addDropPolicy);
for (def course: program.getCourses().getAssociatedTo(period))
{
log.debug("GLOBAL ENROLLMENT SCRIPT, COURSE IN LOOP: courseEndDate = {}, courseAraIndicator = {}, courseSchedulingStatus = {}, courseUnitsToAdd = {}", course.getEndDate(), course.getFirstAraIndicator(), course.getSchedulingStatus(), course.getUnits());
// If the course is withdrawn, only count the credits if the course was withdrawn after the add/drop period. If the course is not withdrawn, count the course credits.
if ((["WITHDRAWN"].contains(course.getSchedulingStatus()) && course.getLastDateOfAttendance() != null && course.getLastDateOfAttendance() > addDropPolicy) || course.getSchedulingStatus() != "WITHDRAWN")
{
countedUnits = countedUnits + course.getUnits();
}
}
def NA = 0.0;
def LTHT = 6.0;
def HT = 9.0;
def TQT = 12.0;
return helper.mapRanges()
.le(NA, "NOT_ATTENDING")
.lt(LTHT, "LESS_THAN_HALF_TIME")
.lt(HT, "HALF_TIME")
.lt(TQT, "THREE_QUARTER_TIME")
.defaultValue("FULL_TIME")
.apply(countedUnits);
}
return "FULL_TIME";
gradeLevelProgression
Workbook: PKGSCHEDATTRIB.csv
Column: Grade_Level_Progression
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.GradeLevelProgressionScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
def referenceDate = program.isTerm() ? term.getStartDate() : acy.getStartDate();
def totalPrevAcyUnits = acys
.findAll { it.getNumber() < acyNo }
.collect { it.getStatus() == "ACTUAL" ? it.getCompletedUnits() : it.getUnits() }
.sum(0.0);
def totalCurAcyUnits = acy.getLoanPaymentPeriods()
.findAll { it.getStatus() != "CANCELED" && it.getStartDate() < referenceDate }
.collect { it.getUnits() }
.sum(0.0);
def totalCreditsCompletedBeforeProgramStartDate = program.getCourses()
.findAll {
it.getSchedulingStatus() == "PASSED" &&
it.getEndDate() < actualStartDate &&
(it.getIncompleteResolutionDate() == null || it.getIncompleteResolutionDate() < actualStartDate)
}
.collect { it.getUnits() }
.sum(0.0);
def totalCreditUnits = (program.getTotalAcceptedTransferUnits() +
program.getAssessedUnits() +
totalPrevAcyUnits +
totalCurAcyUnits +
totalCreditsCompletedBeforeProgramStartDate);
def creditPerAydUnit = totalCreditUnits / program.getAydUnits();
def baseGradeLevel = (program.isGraduate()
? 6
: program.getProgramType() == "CERTIFICATE_POST_BACCALAUREATE"
? 5
: 1);
def unboundedGradeLevel = baseGradeLevel + creditPerAydUnit.intValue();
def isAssociate = program.getProgramType() == "ASSOCIATE";
def gradeLevelUb = (isAssociate
? 2
: program.isUndergraduate()
? 5
: 7);
def gradeLevel = [unboundedGradeLevel, gradeLevelUb].min();
log.debug("actualStartDate={}, referenceDate={}, totalPrevAcyUnits={}, totalCurAcyUnits={}, totalCreditsCompletedBeforeProgramStartDate={}, totalCreditUnits={}, creditPerAydUnit={}, baseGradeLevel={}, isAssociate={}, gradeLevelUb={}, gradeLevel={}",
actualStartDate,
referenceDate,
totalPrevAcyUnits,
totalCurAcyUnits,
totalCreditsCompletedBeforeProgramStartDate,
totalCreditUnits,
creditPerAydUnit,
baseGradeLevel,
isAssociate,
gradeLevelUb,
gradeLevel
);
return gradeLevel;
isirAssumptionAutoCodeClearingLogic / isirCCodeAutoCodeClearingLogic / isirHighlightAutoCodeClearingLogic / isirRejectCodeAutoCodeClearingLogic / isirVerificationClearanceRules
Workbook: ISIR_ASSUMPT.csv / ISIR_C_CODES.csv / ISIR_HIGHLIGHT.csv / ISIR_REJECT_CODES.csv / ISIR_VERIFICATION_CODES.csv
Column: Auto_Code_Clearing_Logic
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.IsirVerificationClearanceRulesScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
/*
Due to the changes to ISIR Verification for 24/25 we are no longer automatically triggering ISIR corrections within our
baseline configuration. An ISIR Verification task will be created once all acceptable documentation is received for a
Financial Aid Administrator to review. If Oracle determines that there is additional logic that can be added to increase
ISIR Verification Automation we will enhance our baseline configuration in future releases.
*/
//Note: if script returns true then auto code clear, if it returns false then create a task
//Student ISIR variables
def isirFPS_INCARCERATEDAPPLICANTFLAG = isirRecord.getField(IsirField.FPS_INCARCERATEDAPPLICANTFLAG).getOrNull()
def isirSTUDENT_FILED1040OR1040NR = isirRecord.getField(IsirField.STUDENT_FILED1040OR1040NR).getOrNull()
def isirSTUDENT_FILEDNONUSTAXRETURN = isirRecord.getField(IsirField.STUDENT_FILEDNONUSTAXRETURN).getOrNull()
def isirSTUDENTFTIM_IRSRESPONSECODE_FTI = isirRecord.getField(IsirField.STUDENTFTIM_IRSRESPONSECODE_FTI).getOrNull()
def isirSTUDENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI = isirRecord.getField(IsirField.STUDENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI).getOrNull()
def isirSTUDENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI = isirRecord.getField(IsirField.STUDENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI).getOrNull()
def isirSTUDENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS = isirRecord.getField(IsirField.STUDENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS).getOrNull()
def isirSTUDENT_IRAROLLOVER = isirRecord.getField(IsirField.STUDENT_IRAROLLOVER).getOrNull()
def isirSTUDENT_FOREIGNEARNEDINCOMEEXCLUSION = isirRecord.getField(IsirField.STUDENT_FOREIGNEARNEDINCOMEEXCLUSION).getOrNull()
//Parent ISIR variables
def isirPARENT_FILED1040OR1040NR = isirRecord.getField(IsirField.PARENT_FILED1040OR1040NR).getOrNull()
def isirPARENTFTIM_IRSRESPONSECODE_FTI = isirRecord.getField(IsirField.PARENTFTIM_IRSRESPONSECODE_FTI).getOrNull()
def isirPARENT_FILEDNONUSTAXRETURN = isirRecord.getField(IsirField.PARENT_FILEDNONUSTAXRETURN).getOrNull()
def isirPARENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI = isirRecord.getField(IsirField.PARENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI).getOrNull()
def isirPARENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI = isirRecord.getField(IsirField.PARENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI).getOrNull()
def isirPARENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS = isirRecord.getField(IsirField.PARENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS).getOrNull()
def isirPARENT_IRAROLLOVER = isirRecord.getField(IsirField.PARENT_IRAROLLOVER).getOrNull()
def isirPARENT_UPDATEDFAMILYSIZE = isirRecord.getField(IsirField.PARENT_UPDATEDFAMILYSIZE).getOrNull()
def isirFPS_ASSUMEDPARENTFAMILYSIZE = isirRecord.getField(IsirField.FPS_ASSUMEDPARENTFAMILYSIZE).getOrNull()
def isirPARENT_FOREIGNEARNEDINCOMEEXCLUSION = isirRecord.getField(IsirField.PARENT_FOREIGNEARNEDINCOMEEXCLUSION).getOrNull()
//Parent Spouse ISIR variables
def isirPARENTSPOUSE_IRAROLLOVER = isirRecord.getField(IsirField.PARENTSPOUSE_IRAROLLOVER).getOrNull()
def isirPARENTSPOUSE_UNTAXEDPORTIONSOFIRADISTRIBUTIONS = isirRecord.getField(IsirField.PARENTSPOUSE_UNTAXEDPORTIONSOFIRADISTRIBUTIONS).getOrNull()
def isirPARENTSPOUSEFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI = isirRecord.getField(IsirField.PARENTSPOUSEFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI).getOrNull()
def isirPARENTSPOUSEFTIM_UNTAXEDIRADISTRIBUTIONS_FTI = isirRecord.getField(IsirField.PARENTSPOUSEFTIM_UNTAXEDIRADISTRIBUTIONS_FTI).getOrNull()
def isirPARENTSPOUSE_FILED1040OR1040NR = isirRecord.getField(IsirField.PARENTSPOUSE_FILED1040OR1040NR).getOrNull()
def isirPARENTSPOUSEFTIM_IRSRESPONSECODE_FTI = isirRecord.getField(IsirField.PARENTSPOUSEFTIM_IRSRESPONSECODE_FTI).getOrNull()
def isirPARENTSPOUSE_FILEDNONUSTAXRETURN = isirRecord.getField(IsirField.PARENTSPOUSE_FILEDNONUSTAXRETURN).getOrNull()
def isirPARENTSPOUSE_TAXRETURNFILINGSTATUS = isirRecord.getField(IsirField.PARENTSPOUSE_TAXRETURNFILINGSTATUS).getOrNull()
def isirPARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION = isirRecord.getField(IsirField.PARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION).getOrNull()
//Custom documents received variables
boolean IdentificationDocsReceived = false
boolean SOEPDocsReceived = false
//Custom documents received check
if ((receivedDocuments.hasDoc("DriversLicense", "Student") && receivedDocuments.get("DriversLicense", "Student").isAcceptable()) || (receivedDocuments.hasDoc("NonDriversLicenseID", "Student") && receivedDocuments.get("NonDriversLicenseID", "Student").isAcceptable()) || (receivedDocuments.hasDoc("StateIssuedID", "Student") && receivedDocuments.get("StateIssuedID", "Student").isAcceptable()) || (receivedDocuments.hasDoc("Passport", "Student") && receivedDocuments.get("Passport", "Student").isAcceptable())) {
IdentificationDocsReceived = true
}
if ((receivedDocuments.hasDoc("SOEP-Campus", "Student") && receivedDocuments.get("SOEP-Campus", "Student").isAcceptable()) || (receivedDocuments.hasDoc("SOEP-Notary", "Student") && receivedDocuments.get("SOEP-Notary", "Student").isAcceptable())) {
SOEPDocsReceived = true
}
//If student is incarcerated and has custom documents then exit the script
if ((isirFPS_INCARCERATEDAPPLICANTFLAG == "1" || isirFPS_INCARCERATEDAPPLICANTFLAG == "2" || isirFPS_INCARCERATEDAPPLICANTFLAG == "3") && IdentificationDocsReceived && SOEPDocsReceived) {
return true
}
//Student auto code clearing logic
if ((isirSTUDENT_FILED1040OR1040NR == "1" || isirSTUDENT_FILED1040OR1040NR == null) && [null, "203", "206", "212", "214"].contains(isirSTUDENTFTIM_IRSRESPONSECODE_FTI)) {
if ((receivedDocuments.hasDoc("1040", "Student") && receivedDocuments.get("1040", "Student").isAcceptable()) || (receivedDocuments.hasDoc("1040x", "Student") && receivedDocuments.get("1040x", "Student").isAcceptable()) || (receivedDocuments.hasDoc("TaxReturnTranscript", "Student") && receivedDocuments.get("TaxReturnTranscript", "Student").isAcceptable())) {
return false
}
}
if (isirSTUDENT_FILED1040OR1040NR == "2" && isirSTUDENT_FILEDNONUSTAXRETURN == "1") {
if (receivedDocuments.hasDoc("ForeignTaxTranscript", "Student") && receivedDocuments.get("ForeignTaxTranscript", "Student").isAcceptable()) {
return false
}
}
if (isirSTUDENT_FILED1040OR1040NR == "2" && (isirSTUDENT_FILEDNONUSTAXRETURN == "2" || isirSTUDENT_FILEDNONUSTAXRETURN == null)) {
if ((receivedDocuments.hasDoc("NonFilingStatement", "Student") && receivedDocuments.get("NonFilingStatement", "Student").isAcceptable()) || (receivedDocuments.hasDoc("W2", "Student") && receivedDocuments.get("W2", "Student").isAcceptable()) || (receivedDocuments.hasDoc("1099G", "Student") && receivedDocuments.get("1099G", "Student").isAcceptable()) || (receivedDocuments.hasDoc("SelfEmploymentStatement", "Student") && receivedDocuments.get("SelfEmploymentStatement", "Student").isAcceptable())) {
return false
}
}
//Parent auto code clearing logic
if ((isirPARENT_FILED1040OR1040NR == "1" || isirPARENT_FILED1040OR1040NR == null) && [null, "203", "206", "212", "214"].contains(isirPARENTFTIM_IRSRESPONSECODE_FTI)) {
if ((receivedDocuments.hasDoc("1040", "Parent") && receivedDocuments.get("1040", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("1040x", "Parent") && receivedDocuments.get("1040x", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("TaxReturnTranscript", "Parent") && receivedDocuments.get("TaxReturnTranscript", "Parent").isAcceptable())) {
return false
}
}
if ((isirPARENT_FILED1040OR1040NR == "1" || isirPARENT_FILED1040OR1040NR == null) && isirPARENT_FILEDNONUSTAXRETURN == "1") {
if ((receivedDocuments.hasDoc("1040", "Parent") && receivedDocuments.get("1040", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("1040x", "Parent") && receivedDocuments.get("1040x", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("TaxReturnTranscript", "Parent") && receivedDocuments.get("TaxReturnTranscript", "Parent").isAcceptable())) {
return false
}
}
if (isirPARENT_FILED1040OR1040NR == "2" && isirPARENT_FILEDNONUSTAXRETURN == "2") {
if (receivedDocuments.hasDoc("ForeignTaxTranscript", "Parent") && receivedDocuments.get("ForeignTaxTranscript", "Parent").isAcceptable()) {
return false
}
}
if (isirPARENT_FILED1040OR1040NR == "2" && isirPARENT_FILEDNONUSTAXRETURN == "3") {
if ((receivedDocuments.hasDoc("NonFilingStatement", "Parent") && receivedDocuments.get("NonFilingStatement", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("ForeignTaxTranscript", "Parent") && receivedDocuments.get("ForeignTaxTranscript", "Parent").isAcceptable())) {
return false
}
}
if (isirPARENT_FILED1040OR1040NR == "2" && ["4", "5", "6"].contains(isirPARENT_FILEDNONUSTAXRETURN)) {
if ((receivedDocuments.hasDoc("NonFilingStatement", "Parent") && receivedDocuments.get("NonFilingStatement", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("W2", "Parent") && receivedDocuments.get("W2", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("1099G", "Parent") && receivedDocuments.get("1099G", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("SelfEmploymentStatement", "Parent") && receivedDocuments.get("SelfEmploymentStatement", "Parent").isAcceptable())) {
return false
}
}
//Parent Spouse auto code clearing logic
if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && (isirPARENTSPOUSE_FILED1040OR1040NR == "1" || isirPARENTSPOUSE_FILED1040OR1040NR == null) && [null, "203", "206", "212", "214"].contains(isirPARENTSPOUSEFTIM_IRSRESPONSECODE_FTI)) {
if ((receivedDocuments.hasDoc("1040", "Parent Spouse") && receivedDocuments.get("1040", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("1040x", "Parent Spouse") && receivedDocuments.get("1040x", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("TaxReturnTranscript", "Parent Spouse") && receivedDocuments.get("TaxReturnTranscript", "Parent Spouse").isAcceptable())) {
return false
}
}
if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && (isirPARENTSPOUSE_FILED1040OR1040NR == "1" || isirPARENTSPOUSE_FILED1040OR1040NR == null) && isirPARENTSPOUSE_FILEDNONUSTAXRETURN == "1") {
if ((receivedDocuments.hasDoc("1040", "Parent Spouse") && receivedDocuments.get("1040", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("1040x", "Parent Spouse") && receivedDocuments.get("1040x", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("TaxReturnTranscript", "Parent Spouse") && receivedDocuments.get("TaxReturnTranscript", "Parent Spouse").isAcceptable())) {
return false
}
}
if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && isirPARENTSPOUSE_FILED1040OR1040NR == "2" && isirPARENTSPOUSE_FILEDNONUSTAXRETURN == "2") {
if (receivedDocuments.hasDoc("ForeignTaxTranscript", "Parent Spouse") && receivedDocuments.get("ForeignTaxTranscript", "Parent Spouse").isAcceptable()) {
return false
}
}
if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && isirPARENTSPOUSE_FILED1040OR1040NR == "2" && isirPARENTSPOUSE_FILEDNONUSTAXRETURN == "3") {
if ((receivedDocuments.hasDoc("NonFilingStatement", "Parent Spouse") && receivedDocuments.get("NonFilingStatement", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("ForeignTaxTranscript", "Parent Spouse") && receivedDocuments.get("ForeignTaxTranscript", "Parent Spouse").isAcceptable())) {
return false
}
}
if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && isirPARENTSPOUSE_FILED1040OR1040NR == "2" && ["4", "5", "6"].contains(isirPARENTSPOUSE_FILEDNONUSTAXRETURN)) {
if ((receivedDocuments.hasDoc("NonFilingStatement", "Parent Spouse") && receivedDocuments.get("NonFilingStatement", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("W2", "Parent Spouse") && receivedDocuments.get("W2", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("1099G", "Parent Spouse") && receivedDocuments.get("1099G", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("SelfEmploymentStatement", "Parent Spouse") && receivedDocuments.get("SelfEmploymentStatement", "Parent Spouse").isAcceptable())) {
return false
}
}
//Student rollover information auto code clearing logic
if (isirSTUDENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI > 0 || isirSTUDENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI > 0 || isirSTUDENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS > 0 || isirSTUDENT_IRAROLLOVER > 0) {
if (receivedDocuments.hasDoc("RolloverStatement", "Student") && receivedDocuments.get("RolloverStatement", "Student").isAcceptable()) {
return false
}
}
//Parent rollover information auto code clearing logic
if (isirPARENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI > 0 || isirPARENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI > 0 || isirPARENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS > 0 || isirPARENT_IRAROLLOVER > 0) {
if (receivedDocuments.hasDoc("RolloverStatement", "Parent") && receivedDocuments.get("RolloverStatement", "Parent").isAcceptable()) {
return false
}
}
//Parent Spouse rollover information auto code clearing logic
if (isirPARENTSPOUSEFTIM_UNTAXEDIRADISTRIBUTIONS_FTI > 0 || isirPARENTSPOUSEFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI > 0 || isirPARENTSPOUSE_UNTAXEDPORTIONSOFIRADISTRIBUTIONS > 0 || isirPARENTSPOUSE_IRAROLLOVER > 0) {
if (receivedDocuments.hasDoc("RolloverStatement", "Parent Spouse") && receivedDocuments.get("RolloverStatement", "Parent Spouse").isAcceptable()) {
return false
}
}
//Student Foreign Income Exclusion auto code clearing logic
if (isirSTUDENT_FOREIGNEARNEDINCOMEEXCLUSION != null && (isirSTUDENT_FOREIGNEARNEDINCOMEEXCLUSION > 0 || isirSTUDENT_FOREIGNEARNEDINCOMEEXCLUSION < 0)) {
if ((receivedDocuments.hasDoc("1040", "Student") && receivedDocuments.get("1040", "Student").isAcceptable()) || (receivedDocuments.hasDoc("1040x", "Student") && receivedDocuments.get("1040x", "Student").isAcceptable()) || (receivedDocuments.hasDoc("TaxReturnTranscript", "Student") && receivedDocuments.get("TaxReturnTranscript", "Student").isAcceptable()) || (receivedDocuments.hasDoc("ForeignTaxTranscript", "Student") && receivedDocuments.get("ForeignTaxTranscript", "Student").isAcceptable())) {
return false
}
}
//Parent Foreign Income Exclusion auto code clearing logic
if (isirPARENT_FOREIGNEARNEDINCOMEEXCLUSION != null && (isirPARENT_FOREIGNEARNEDINCOMEEXCLUSION > 0 || isirPARENT_FOREIGNEARNEDINCOMEEXCLUSION < 0)) {
if ((receivedDocuments.hasDoc("1040", "Parent") && receivedDocuments.get("1040", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("1040x", "Parent") && receivedDocuments.get("1040x", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("TaxReturnTranscript", "Parent") && receivedDocuments.get("TaxReturnTranscript", "Parent").isAcceptable()) || (receivedDocuments.hasDoc("ForeignTaxTranscript", "Parent") && receivedDocuments.get("ForeignTaxTranscript", "Parent").isAcceptable())) {
return false
}
}
//Parent Spouse Foreign Income Exclusion auto code clearing logic
if (isirPARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION != null && (isirPARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION > 0 || isirPARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION < 0)) {
if ((receivedDocuments.hasDoc("1040", "Parent Spouse") && receivedDocuments.get("1040", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("1040x", "Parent Spouse") && receivedDocuments.get("1040x", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("TaxReturnTranscript", "Parent Spouse") && receivedDocuments.get("TaxReturnTranscript", "Parent Spouse").isAcceptable()) || (receivedDocuments.hasDoc("ForeignTaxTranscript", "Parent Spouse") && receivedDocuments.get("ForeignTaxTranscript", "Parent Spouse").isAcceptable())) {
return false
}
}
//Family size auto code clearing logic
if (isirPARENT_UPDATEDFAMILYSIZE != null || isirFPS_ASSUMEDPARENTFAMILYSIZE != null) {
if (receivedDocuments.hasDoc("VW-Dep", "Student") && receivedDocuments.get("VW-Dep", "Student").isAcceptable()) {
return false
}
}
return true
isirAssumptionDocumentsRequired / isirCCodeDocumentsRequired / isirHighlightsDocumentsRequired / isirRejectCodeDocumentsRequired / isirVerificationDocumentsRequired
Workbook: ISIR_ASSUMPT.csv / ISIR_C_CODES.csv / ISIR_HIGHLIGHT.csv / ISIR_REJECT_CODES.csv / ISIR_VERIFICATION_CODES.csv
Column: Documents_Required
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.IsirVerificationDocumentsRequiredScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
//Student ISIR variables
def isirFPS_INCARCERATEDAPPLICANTFLAG = isirRecord.getField(IsirField.FPS_INCARCERATEDAPPLICANTFLAG).getOrNull()
def isirSTUDENT_FILED1040OR1040NR = isirRecord.getField(IsirField.STUDENT_FILED1040OR1040NR).getOrNull()
def isirSTUDENT_FILEDNONUSTAXRETURN = isirRecord.getField(IsirField.STUDENT_FILEDNONUSTAXRETURN).getOrNull()
def isirSTUDENTFTIM_IRSRESPONSECODE_FTI = isirRecord.getField(IsirField.STUDENTFTIM_IRSRESPONSECODE_FTI).getOrNull()
def isirSTUDENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI = isirRecord.getField(IsirField.STUDENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI).getOrNull()
def isirSTUDENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI = isirRecord.getField(IsirField.STUDENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI).getOrNull()
def isirSTUDENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS = isirRecord.getField(IsirField.STUDENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS).getOrNull()
def isirSTUDENT_IRAROLLOVER = isirRecord.getField(IsirField.STUDENT_IRAROLLOVER).getOrNull()
def isirSTUDENT_FOREIGNEARNEDINCOMEEXCLUSION = isirRecord.getField(IsirField.STUDENT_FOREIGNEARNEDINCOMEEXCLUSION).getOrNull()
//Parent ISIR variables
def isirPARENT_FILED1040OR1040NR = isirRecord.getField(IsirField.PARENT_FILED1040OR1040NR).getOrNull()
def isirPARENTFTIM_IRSRESPONSECODE_FTI = isirRecord.getField(IsirField.PARENTFTIM_IRSRESPONSECODE_FTI).getOrNull()
def isirPARENT_FILEDNONUSTAXRETURN = isirRecord.getField(IsirField.PARENT_FILEDNONUSTAXRETURN).getOrNull()
def isirPARENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI = isirRecord.getField(IsirField.PARENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI).getOrNull()
def isirPARENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI = isirRecord.getField(IsirField.PARENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI).getOrNull()
def isirPARENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS = isirRecord.getField(IsirField.PARENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS).getOrNull()
def isirPARENT_IRAROLLOVER = isirRecord.getField(IsirField.PARENT_IRAROLLOVER).getOrNull()
def isirPARENT_UPDATEDFAMILYSIZE = isirRecord.getField(IsirField.PARENT_UPDATEDFAMILYSIZE).getOrNull()
def isirFPS_ASSUMEDPARENTFAMILYSIZE = isirRecord.getField(IsirField.FPS_ASSUMEDPARENTFAMILYSIZE).getOrNull()
def isirPARENT_FOREIGNEARNEDINCOMEEXCLUSION = isirRecord.getField(IsirField.PARENT_FOREIGNEARNEDINCOMEEXCLUSION).getOrNull()
//Parent Spouse ISIR variables
def isirPARENTSPOUSE_IRAROLLOVER = isirRecord.getField(IsirField.PARENTSPOUSE_IRAROLLOVER).getOrNull()
def isirPARENTSPOUSE_UNTAXEDPORTIONSOFIRADISTRIBUTIONS = isirRecord.getField(IsirField.PARENTSPOUSE_UNTAXEDPORTIONSOFIRADISTRIBUTIONS).getOrNull()
def isirPARENTSPOUSEFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI = isirRecord.getField(IsirField.PARENTSPOUSEFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI).getOrNull()
def isirPARENTSPOUSEFTIM_UNTAXEDIRADISTRIBUTIONS_FTI = isirRecord.getField(IsirField.PARENTSPOUSEFTIM_UNTAXEDIRADISTRIBUTIONS_FTI).getOrNull()
def isirPARENTSPOUSE_FILED1040OR1040NR = isirRecord.getField(IsirField.PARENTSPOUSE_FILED1040OR1040NR).getOrNull()
def isirPARENTSPOUSEFTIM_IRSRESPONSECODE_FTI = isirRecord.getField(IsirField.PARENTSPOUSEFTIM_IRSRESPONSECODE_FTI).getOrNull()
def isirPARENTSPOUSE_FILEDNONUSTAXRETURN = isirRecord.getField(IsirField.PARENTSPOUSE_FILEDNONUSTAXRETURN).getOrNull()
def isirPARENTSPOUSE_TAXRETURNFILINGSTATUS = isirRecord.getField(IsirField.PARENTSPOUSE_TAXRETURNFILINGSTATUS).getOrNull()
def isirPARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION = isirRecord.getField(IsirField.PARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION).getOrNull()
//Custom documents request logic
//documentRequest.addAnyDocuments(["HSDiploma", "Student"],["HSTranscript", "Student"],["GEDCert", "Student"],["GEDTranscript", "Student"],["StateHSEquivalencyCert", "Student"],["SecondarySchoolLeavingCert", "Student"],["HomeSchoolCert", "Student"])
documentRequest.addAnyDocuments(["DriversLicense", "Student"],["NonDriversLicenseID", "Student"],["StateIssuedID", "Student"],["Passport", "Student"])
documentRequest.addAnyDocuments(["SOEP-Campus", "Student"],["SOEP-Notary", "Student"])
//If student is incarcerated then exit the script
if (isirFPS_INCARCERATEDAPPLICANTFLAG == "1" || isirFPS_INCARCERATEDAPPLICANTFLAG == "2" || isirFPS_INCARCERATEDAPPLICANTFLAG == "3") {
return
}
//Student document request logic
if ((isirSTUDENT_FILED1040OR1040NR == "1" || isirSTUDENT_FILED1040OR1040NR == null) && [null, "203", "206", "212", "214"].contains(isirSTUDENTFTIM_IRSRESPONSECODE_FTI)) {
documentRequest.addAnyDocuments(["1040", "Student"], ["1040x", "Student"], ["TaxReturnTranscript", "Student"])
}
else if (isirSTUDENT_FILED1040OR1040NR == "2" && isirSTUDENT_FILEDNONUSTAXRETURN == "1") {
documentRequest.addDocument("ForeignTaxTranscript", "Student")
}
else if (isirSTUDENT_FILED1040OR1040NR == "2" && (isirSTUDENT_FILEDNONUSTAXRETURN == "2" || isirSTUDENT_FILEDNONUSTAXRETURN == null)) {
documentRequest.addAnyDocuments(["NonFilingStatement", "Student"], ["W2", "Student"], ["1099G", "Student"], ["SelfEmploymentStatement", "Student"])
}
//Parent document request logic
if ((isirPARENT_FILED1040OR1040NR == "1" || isirPARENT_FILED1040OR1040NR == null) && [null, "203", "206", "212", "214"].contains(isirPARENTFTIM_IRSRESPONSECODE_FTI)) {
documentRequest.addAnyDocuments(["1040", "Parent"], ["1040x", "Parent"], ["TaxReturnTranscript", "Parent"])
}
else if ((isirPARENT_FILED1040OR1040NR == "1" || isirPARENT_FILED1040OR1040NR == null) && isirPARENT_FILEDNONUSTAXRETURN == "1") {
documentRequest.addAnyDocuments(["1040", "Parent"], ["1040x", "Parent"], ["TaxReturnTranscript", "Parent"])
}
else if (isirPARENT_FILED1040OR1040NR == "2" && isirPARENT_FILEDNONUSTAXRETURN == "2") {
documentRequest.addDocument("ForeignTaxTranscript", "Parent")
}
else if (isirPARENT_FILED1040OR1040NR == "2" && isirPARENT_FILEDNONUSTAXRETURN == "3") {
documentRequest.addAnyDocuments(["NonFilingStatement", "Parent"], ["ForeignTaxTranscript", "Parent"])
}
else if (isirPARENT_FILED1040OR1040NR == "2" && ["4", "5", "6"].contains(isirPARENT_FILEDNONUSTAXRETURN)) {
documentRequest.addAnyDocuments(["NonFilingStatement", "Parent"], ["W2", "Parent"], ["1099G", "Parent"], ["SelfEmploymentStatement", "Parent"])
}
//Parent Spouse document request logic
if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && (isirPARENTSPOUSE_FILED1040OR1040NR == "1" || isirPARENTSPOUSE_FILED1040OR1040NR == null) && [null, "203", "206", "212", "214"].contains(isirPARENTSPOUSEFTIM_IRSRESPONSECODE_FTI)) {
documentRequest.addAnyDocuments(["1040", "Parent Spouse"], ["1040x", "Parent Spouse"], ["TaxReturnTranscript", "Parent Spouse"])
}
else if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && (isirPARENTSPOUSE_FILED1040OR1040NR == "1" || isirPARENTSPOUSE_FILED1040OR1040NR == null) && isirPARENTSPOUSE_FILEDNONUSTAXRETURN == "1") {
documentRequest.addAnyDocuments(["1040", "Parent Spouse"], ["1040x", "Parent Spouse"], ["TaxReturnTranscript", "Parent Spouse"])
}
else if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && isirPARENTSPOUSE_FILED1040OR1040NR == "2" && isirPARENTSPOUSE_FILEDNONUSTAXRETURN == "2") {
documentRequest.addDocument("ForeignTaxTranscript", "Parent Spouse")
}
else if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && isirPARENTSPOUSE_FILED1040OR1040NR == "2" && isirPARENTSPOUSE_FILEDNONUSTAXRETURN == "3") {
documentRequest.addAnyDocuments(["NonFilingStatement", "Parent Spouse"], ["ForeignTaxTranscript", "Parent Spouse"])
}
else if (isirPARENTSPOUSE_TAXRETURNFILINGSTATUS == "3" && isirPARENTSPOUSE_FILED1040OR1040NR == "2" && ["4", "5", "6"].contains(isirPARENTSPOUSE_FILEDNONUSTAXRETURN)) {
documentRequest.addAnyDocuments(["NonFilingStatement", "Parent Spouse"], ["W2", "Parent Spouse"], ["1099G", "Parent Spouse"], ["SelfEmploymentStatement", "Parent Spouse"])
}
//Student rollover information document request logic
if (isirSTUDENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI > 0 || isirSTUDENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI > 0 || isirSTUDENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS > 0 || isirSTUDENT_IRAROLLOVER > 0) {
documentRequest.addDocument("RolloverStatement", "Student")
}
//Parent rollover information document request logic
if (isirPARENTFTIM_UNTAXEDIRADISTRIBUTIONS_FTI > 0 || isirPARENTFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI > 0 || isirPARENT_UNTAXEDPORTIONSOFIRADISTRIBUTIONS > 0 || isirPARENT_IRAROLLOVER > 0) {
documentRequest.addDocument("RolloverStatement", "Parent")
}
//Parent Spouse rollover information document request logic
if (isirPARENTSPOUSEFTIM_UNTAXEDIRADISTRIBUTIONS_FTI > 0 || isirPARENTSPOUSEFTIM_IRADEDUCTIBLEANDPAYMENTS_FTI > 0 || isirPARENTSPOUSE_UNTAXEDPORTIONSOFIRADISTRIBUTIONS > 0 || isirPARENTSPOUSE_IRAROLLOVER > 0) {
documentRequest.addDocument("RolloverStatement", "Parent Spouse")
}
//Student Foreign Income Exclusion document request logic
if (isirSTUDENT_FOREIGNEARNEDINCOMEEXCLUSION != null && (isirSTUDENT_FOREIGNEARNEDINCOMEEXCLUSION > 0 || isirSTUDENT_FOREIGNEARNEDINCOMEEXCLUSION < 0)) {
documentRequest.addAnyDocuments(["1040", "Student"], ["1040x", "Student"], ["TaxReturnTranscript", "Student"], ["ForeignTaxTranscript", "Student"])
}
//Parent Foreign Income Exclusion document request logic
if (isirPARENT_FOREIGNEARNEDINCOMEEXCLUSION != null && (isirPARENT_FOREIGNEARNEDINCOMEEXCLUSION > 0 || isirPARENT_FOREIGNEARNEDINCOMEEXCLUSION < 0)) {
documentRequest.addAnyDocuments(["1040", "Parent"], ["1040x", "Parent"], ["TaxReturnTranscript", "Parent"], ["ForeignTaxTranscript", "Parent"])
}
//Parent Spouse Foreign Income Exclusion document request logic
if (isirPARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION != null && (isirPARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION > 0 || isirPARENTSPOUSE_FOREIGNEARNEDINCOMEEXCLUSION < 0)) {
documentRequest.addAnyDocuments(["1040", "Parent Spouse"], ["1040x", "Parent Spouse"], ["TaxReturnTranscript", "Parent Spouse"], ["ForeignTaxTranscript", "Parent Spouse"])
}
//Family size document request logic
if (isirPARENT_UPDATEDFAMILYSIZE != null || isirFPS_ASSUMEDPARENTFAMILYSIZE != null) {
documentRequest.addDocument("VW-Dep", "Student")
}
return
isirDiscrepancyEvaluation
Workbook: ISIR_DISCREP.csv
Column: Discrepancy_Evaluation_Script
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.IsirDiscrepancyEvaluationScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
//Variable definitions
def isirSTUDENT_MARITALSTATUS = isirRecord.getField(IsirField.STUDENT_MARITALSTATUS).getOrNull()
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1117") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1117").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1117")
if (documentValue == "Single (Never married)" && isirSTUDENT_MARITALSTATUS != "1")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "1"
return
}
if (documentValue == "Married (Not separated)" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
if (documentValue == "Remarried" && isirSTUDENT_MARITALSTATUS != "3")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "3"
return
}
if (documentValue == "Divorced" && isirSTUDENT_MARITALSTATUS != "4")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "4"
return
}
if (documentValue == "Separated" && isirSTUDENT_MARITALSTATUS != "5")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "5"
return
}
if (documentValue == "Widowed" && isirSTUDENT_MARITALSTATUS != "6")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "6"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1044") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1044").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1044")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1045") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1045").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1045")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1046") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1046").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1046")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1047") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1047").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1047")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1048") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1048").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1048")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1049") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1049").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1049")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1050") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1050").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1050")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1051") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1051").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1051")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1052") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1052").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1052")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
if (receivedDocuments.hasDoc("VW-Ind","Student") && receivedDocuments.get("VW-Ind","Student").isAcceptable() && receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1053") != null && !receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1053").isAllWhitespace())
{
def documentValue = receivedDocuments.get("VW-Ind", "Student").getDocumentField("AC1053")
if (documentValue == "Spouse" && isirSTUDENT_MARITALSTATUS != "2")
{
discrepancyEvaluationResult.hasDiscrepancy = true
discrepancyEvaluationResult.correctedValue = "2"
return
}
}
isirUseSubsequentIsir
Workbook: ISIR_MGMT.csv
Column: Use_Subsequent_ISIR
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.IsirUseSubsequentIsirScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
def isirTXID_TRANSACTIONSOURCE = latestIsirRecord.getField(IsirField.TXID_TRANSACTIONSOURCE).getOrNull()
if (isirTXID_TRANSACTIONSOURCE != null) {
return true
}
isirUsedInPackaging
Workbook: ISIR_MGMT.csv
Column: ISIR_Used_in_Packaging
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.IsirUsedInPackagingScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
//get all compatible ISIRs for the Award Year where no reject codes exist and a SAI exists
def awardYearISIRs = allAwardYearIsirs.forAwardYear(awy).getCompatibleWithPackaging().findAll{it.getRejectCodes().isEmpty() && it.getField(IsirField.TXID_SAI).getOrNull() != null}
//if a Valid or Unverified ISIR exists, then return it
def validOrUnverifiedISIR = awardYearISIRs.find{["Valid", "Unverified"].contains(it.isirStatus)}
if (validOrUnverifiedISIR != null) {
return validOrUnverifiedISIR
}
//if a Corrected ISIR exists, then return it if the ISIR had been previously Valid or Unverified
def previouslyValidOrUnverifiedCorrectedISIR = awardYearISIRs.find{it.isirStatus == "Corrected" && ["Valid", "Unverified"].contains(it.getIsirStatusBeforeCorrection())}
if (previouslyValidOrUnverifiedCorrectedISIR != null) {
return previouslyValidOrUnverifiedCorrectedISIR
}
//if a Corrected ISIR exists, then return it
def correctedISIR = awardYearISIRs.find{it.isirStatus == "Corrected"}
if (correctedISIR != null) {
return correctedISIR
}
//if a Pending ISIR exists, then return it
def pendingISIR = awardYearISIRs.find{it.isirStatus == "Pending"}
if (pendingISIR != null) {
return pendingISIR
}
//if no ISIRs exist in the Award Year that fit the criteria above, then no ISIR will be returned
return null
letterCodeCriteria
Workbook: LETTER.csv
Column: Letter_Code_Criteria
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.LetterCodeCriteriaScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
log.info("ProvisionalAidOfferLetter params={}", letterCode.params)
def letterCodeToReturn = "PO1"
//The letter event should only trigger for academic years where the ISIR award year is open
def academicYearNumber = letterCode.params.academicYearNumber.toInteger()
def academicYear = acys.getWithNumber(academicYearNumber)
def isAwardYearOpen = helper.awardYear.forPeriod(academicYear).find{awy->
fafsaAwardYearInfoList.find{info->
awy==info.getAwardYear()}?.isOpen()} != null
if (!isAwardYearOpen){
log.info("ProvisionalAidOfferLetter return #1, isAwardYearOpen=false: null")
return null
}
else{
log.info("ProvisionalAidOfferLetter isAwardYearOpen=true")
}
//The letter event should be triggered for a student when they only have one FPO and it contains at least 1 Projected or Estimated fund status in their academic year
def fundStatuses = financialPlan.getInAcademicYear(academicYearNumber).getFundStatuses()
log.info("ProvisionalAidOfferLetter fundStatuses={}", fundStatuses)
if ((fundStatuses.contains("ESTIMATED") || fundStatuses.contains("PROJECTED")) && financialPlan.getVersion() == 1){
log.info("ProvisionalAidOfferLetter return #2: {}", letterCodeToReturn)
return letterCodeToReturn
}
//Once all funds are in an Awarded status the letter event should no longer trigger for that academic year
def financialPlanInAcademicYear = financialPlan.getInAcademicYear(academicYearNumber)
if (financialPlanInAcademicYear.getFundStatuses().find{it != "AWARDED"}==null){
log.info("ProvisionalAidOfferLetter fundStatuses, all funds awarded={}", financialPlanInAcademicYear.getFundStatuses())
log.info("ProvisionalAidOfferLetter return #3: null")
return null
}
//The letter event should be generated when there are updates from the prior version of the FPO V2
if (financialPlan.getVersion() > 1){
def prevFinancialPlanInAcy = previousFinancialPlan.withVersion(financialPlan.getVersion() - 1).getInAcademicYear(academicYearNumber)
//The letter should generate if Cost of Attendance is updated from the prior version of the FPO V2
if (prevFinancialPlanInAcy.getAcyCoa() != financialPlanInAcademicYear.getAcyCoa()){
log.info("ProvisionalAidOfferLetter preAcyCoa={}, currentAcyCoa={}", prevFinancialPlanInAcy.getAcyCoa(), financialPlanInAcademicYear.getAcyCoa())
log.info("ProvisionalAidOfferLetter return #4: {}", letterCodeToReturn)
return letterCodeToReturn
}
//If current FPO has different funds in it than prior FPO, then generate letter
def funds = financialPlanInAcademicYear.getFundCodes()
def previousFunds = prevFinancialPlanInAcy.getFundCodes()
log.info("ProvisionalAidOfferLetter previousFunds={}", previousFunds)
log.info("ProvisionalAidOfferLetter funds={}", funds)
if (funds != previousFunds) {
log.info("ProvisionalAidOfferLetter return #5: {}", letterCodeToReturn)
return letterCodeToReturn
}
//The letter should generate if a fund's status or award amount changes
def differentFund = funds.find { fc ->
def fund = financialPlanInAcademicYear.getFund(fc)
def prevFund = prevFinancialPlanInAcy.getFund(fc)
fund.getFundStatuses() != prevFund.getFundStatuses() || fund.getMaxAmount() != prevFund.getMaxAmount()
}
if (differentFund) {
log.info("ProvisionalAidOfferLetter return #6: {}", letterCodeToReturn)
return letterCodeToReturn
}
}
log.info("ProvisionalAidOfferLetter return #7: null")
return null
nfrDisbursementDates
Workbook: NFR_ATTRIB.csv
Column: NFR_Fund_Disbursement_Dates
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.NfrDisbursementDatesScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
// Schedule disbursement 6 days after the period started.
return period.startDate.plusDays(6)
nfrEligibility
Workbook: NFR_ATTRIB.csv
Column: Fund_Eligibility
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.NfrEligibilityScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
return [new NfrEligibilityField("Is eligible", !nfrConfig.evalPeriods().empty)]
nfrMaximumProjectedAwardAmount
Workbook: NFR_ATTRIB.csv
Column: Fund_Maximum_Projected_Award_Amount
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.NfrMaximumProjectedAwardAmountScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
import org.joda.time.LocalDate
static BigDecimal nthIntPart(BigDecimal dividend, int divisor, int partIdx) {
int truncatedDividend = dividend.intValue();
BigDecimal fraction = dividend - truncatedDividend;
int roundedAmount = (dividend / divisor).intValue()
return partIdx < truncatedDividend % divisor
? roundedAmount + 1
: partIdx == divisor - 1
? roundedAmount + fraction
: roundedAmount
}
def now = LocalDate.now()
def condDebug = { NfrPeriod p, String msg ->
if (p == period) {
log.debug(msg)
}
}
def loan = period.commonLineLoan
def periodsAssociatedToLoan = nfrConfig.evalPeriods().filter { p -> p.commonLineLoan.equals(loan) }
.indexed(1)
int nbPeriods = periodsAssociatedToLoan.size()
def getLoanPeriodNumber = { NfrPeriod p ->
periodsAssociatedToLoan.find { it.value == p }.key
}
def isAlreadyPackaged = { NfrPeriod p ->
p.pairedTerm.acyNo < acyNo
}
def alreadyPackaged = financialPlan.filterAcademicYears { curAcyNo -> curAcyNo < acyNo }
.getWithCommonLineUniqueId(loan.commonLineUniqueId)
.reach();
def thisInfo = "for fund $fundCode for acy $acy.number in period $period.number using CLUID $loan.commonLineUniqueId"
def isDecrease = loan.requestedLoanAmount < loan.ppAmountTotal
def frozenValue = { NfrPeriod p ->
int clPpNo = getLoanPeriodNumber(p)
int periodIndex = clPpNo - 1
if (periodIndex == -1) {
condDebug(p, "Period index can't be found $thisInfo, periodsAssociatedToLoan=$periodsAssociatedToLoan")
return 0.0
}
if (loan.recordStatus == "LOAN_TERMINATED") {
condDebug(p, "Setting zero amount for terminated loan $thisInfo, periodIndex=$periodIndex, nbPeriods=$nbPeriods")
return 0.0
}
def thisTerm = p.pairedTerm
if (thisTerm == null) {
condDebug(p, "Setting zero amount for not found current term $thisInfo, periodIndex=$periodIndex, nbPeriods=$nbPeriods")
return 0.0
}
if (thisTerm.isNotAttending()) {
condDebug(p, "Setting zero amount for not attending term $thisInfo, periodIndex=$periodIndex, nbPeriods=$nbPeriods")
return 0.0
}
if (isAlreadyPackaged(p)) {
condDebug(p, "Using value calculated in previous acy $thisInfo")
return alreadyPackaged.getOverlappingWith(p).maxAmount
}
if (!isDecrease && loan.isDisbursed(clPpNo) && loan.endDate < now) {
condDebug(p, "Using disbursed amount $thisInfo")
return loan.getPpAmount(clPpNo)
}
return null;
}.memoize()
def isFrozen = { NfrPeriod p -> frozenValue(p) != null }
if (isFrozen(period)) {
return frozenValue(period)
}
def allFrozen = periodsAssociatedToLoan.findAll { isFrozen(it.value) }
def frozenTotal = allFrozen.collect { frozenValue(it.value) }
.inject(0.0, { a, b -> a + b })
def amountLeft = loan.requestedLoanAmount - frozenTotal;
def periodsLeft = periodsAssociatedToLoan - allFrozen
if (periodsLeft.isEmpty()) {
log.debug("No periods left for $thisInfo")
return 0
}
def acyScopedFundCodes = ["DISCOUNT"].toSet()
def acyScopedTotal = { int curAcyNo ->
financialPlan.getInAcademicYear(curAcyNo).getFunds(acyScopedFundCodes).maxAmount
}.memoize();
def higherPriorityLoans = nfrConfig.evalPeriods()
.takeWhile { p -> p.commonLineLoan != loan }
.collect { p -> p.commonLineLoan }
.unique()
def higherPriorityPeriods = nfrConfig.evalPeriods().filter { p -> higherPriorityLoans.contains(p.commonLineLoan) }
def orderedByNeed = periodsLeft.collectEntries([:] as LinkedHashMap<NfrPeriod, BigDecimal>, { clPpNo, p ->
def curAcy = acys.getWithNumber(p.pairedTerm.acyNo)
def curAcyNo = curAcy.number
def termFundingSoFar = financialPlan.filterFunds { code -> !acyScopedFundCodes.contains(code) }
.getOverlappingWith(p)
.maxAmount
def higherPriorityPeriodTotalInThisTerm = higherPriorityPeriods
.getOverlappingWith(p)
.collect(nfrConfig.&evalMaximumProjectedAwardAmount)
.inject(0.0, { a, b -> a + b })
def nbTerms = curAcy.terms.size()
def pairedTermIdx = curAcy.terms.indexOf(p.pairedTerm)
def acyScopedInThisTerm = nthIntPart(acyScopedTotal(curAcyNo), nbTerms, pairedTermIdx);
def termCoa = coa.in(p.pairedTerm).activeCoa
def termRemainingNeed = [termCoa - termFundingSoFar - higherPriorityPeriodTotalInThisTerm - acyScopedInThisTerm, 0].max()
[(p): termRemainingNeed]
}).toSorted { it.value }
def computedFirst = orderedByNeed.takeWhile { it.key != period }
.keySet();
def computedFirstTotal = computedFirst
.collect(nfrConfig.&evalMaximumProjectedAwardAmount)
.inject(0.0, { a, b -> a + b })
def noPeriodsLeftToCompute = orderedByNeed.size() - computedFirst.size();
def curMaxAmount = nthIntPart(amountLeft - computedFirstTotal, noPeriodsLeftToCompute, 0)
def amount = [curMaxAmount, orderedByNeed[period]].min();
log.debug("Setting amount for fund {} for acy {} period {} using CLUID {}, amount={}, nbPeriods={}",
fundCode, acy.number, period.number, loan.commonLineUniqueId, amount, nbPeriods)
return amount
nfrPeriods
Workbook: NFR_ATTRIB.csv
Column: NFR_Periods
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.NfrPeriodsScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
// Replace this code with your code
def alternativeLoanProgramTypeCodes = ["091"]
static <T> Closure<T> lazy(Closure<T> init) {
T value
boolean isInitDue = true
return {
if (isInitDue) {
isInitDue = false
value = init()
}
value
}
}
def cluidsDisbursedInOtherFunds = lazy {
Set<ICommonLineUniqueId> otherFundsDisbursedCLUIDs = [];
if (financialPlan.version > 1) {
otherFundsDisbursedCLUIDs = previousFinancialPlan
.withVersion(financialPlan.version - 1)
.nfr
.filterCommonLineUniqueIds { cluid -> cluid != null }
.filterFunds { f -> f != fundCode && isDisbursed(f) }
.commonLineUniqueIds
}
otherFundsDisbursedCLUIDs
}
/**
* Indicate if the fund has already been disbursed across all academic years
*/
def isDisbursed(String fundCode) {
disbursements
.getWithFundCode(fundCode)
.getWithStatus("DISBURSED")
.getTotalDisbursementAmount() > 0
}
/**
* Get the list of terms that can be associated with the given loan.
* All loan / term matching logic should happen here.
*/
IAcademicTermPeriodsAPI getLoanTerms(IAcademicTermPeriodsAPI terms, ICommonLineLoanAPI loan) {
terms.getOverlappingWith(loan)
}
/**
* Get the list of terms that can be associated to the given loan across all academic years of the current package.
*/
IAcademicTermPeriodsAPI getAllLoanTermsAcrossPackage(ICommonLineLoanAPI loan) {
getLoanTerms(acys.getTerms(), loan)
}
/**
* Indicate if the loan can be associated with the current academic year.
*/
boolean hasTermsInCurrentAcademicYear(ICommonLineLoanAPI loan) {
!getLoanTerms(acy.terms, loan).isEmpty()
}
return commonLineLoans
.filter { loan ->
alternativeLoanProgramTypeCodes.contains(loan.alternativeLoanProgramTypeCode) &&
loan.getRequestedLoanAmount() > 0 &&
loan.processingStatus != "COMMON_LINE_UNIQUE_ID_CHANGED" &&
hasTermsInCurrentAcademicYear(loan) &&
!cluidsDisbursedInOtherFunds().contains(loan.commonLineUniqueId)
}
.orderedBy(new OrderBy([{ it.startDate }, { it.commonLineUniqueId }]))
.withIndex()
.collectMany { loan, loanIndex ->
def loanTerms = getAllLoanTermsAcrossPackage(loan)
loanTerms.withIndex(1).collect { period, periodIndex ->
int periodNumber = loanIndex * 10 + period.number;
// should be:
// periodNumber = loanIndex * 10 + periodIndex;
log.debug("Associating fund {} for period {} starting on {} with CLUID {}",
fundCode, periodNumber, period.startDate, loan.commonLineUniqueId)
new NfrPeriod(periodNumber, period)
.withCommonLineLoan(loan)
.withPairedPeriod(period)
}
}
nonTermAcyMonths
Workbook: PKGSCHEDATTRIB.csv
Column: Non_Term_ACY_Months
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.NonTermAcyMonthsScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
/* Non-Term Baseline ACY Months Calculation, return type int */
if (acy.getUnits() == null || program.getAydUnits() == null)
{
log.debug("ACY MONTHS CALCULATION CONFIG: ERROR, null values passed from APIs");
return 0;
}
log.debug("ACY MONTHS CALCULATION CONFIG: Academic Year Schedule Units = {}, Program AYD Units = {}", acy.getUnits(), program.getAydUnits());
if ((acy.getUnits() / program.getAydUnits()) >= 1)
{
return 9;
}
else
{
int returnValue = Math.round(((acy.getUnits()/program.getAydUnits()) * 9));
return returnValue;
}
pellEnrollmentIntensity
Workbook: FAS_FUND_CONFIG.csv
Column: Pell_Enrollment_Intensity
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.PellEnrollmentIntensityScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
import org.joda.time.LocalDate
def countedUnits = 0.0
def enrollmentIntensity = 0.0
def creditsRequiredForFullTimeEnrollment = 12
LocalDate today = LocalDate.now()
LocalDate censusDate
// if enrollment status is X return 0 (0%)
if (primaryProgram.getEnrollmentStatus() != null && primaryProgram.getEnrollmentStatus() == "X") {
return 0
}
// if not term, return 1 (100%)
if (!program.isTerm()) {
return 1
}
//term program logic
censusDate = term.getStartDate().plusDays(10)
//count credits and calculate enrollmentIntensity
for (def course: program.getCourses().getAssociatedTo(term)) {
log.debug("PellEnrollmentIntensity script, COURSE IN LOOP: courseEndDate = {}, courseAraIndicator = {}, courseSchedulingStatus = {}, courseUnitsToAdd = {}", course.getEndDate(), course.getFirstAraIndicator(), course.getSchedulingStatus(), course.getUnits())
// If the course is withdrawn, only count the credits if the course was withdrawn after the census date. If the course is not withdrawn, count the course credits.
if ((["WITHDRAWN"].contains(course.getSchedulingStatus()) && course.getLastDateOfAttendance() != null && course.getLastDateOfAttendance() > censusDate) || course.getSchedulingStatus() != "WITHDRAWN") {
countedUnits = countedUnits + course.getUnits()
}
enrollmentIntensity = countedUnits / creditsRequiredForFullTimeEnrollment
}
//census date logic
if (censusDate != null && today <= censusDate) {
log.debug("PellEnrollmentIntensity script if statement final values: enrollmentIntensity = {}, countedUnits = {}, creditsRequiredForFullTimeEnrollment = {}", enrollmentIntensity, countedUnits, creditsRequiredForFullTimeEnrollment)
return enrollmentIntensity
}
else {
//define previousFpo
log.debug("PellEnrollmentIntensity script else statement begin")
def previousFpo
if (previousFinancialPlan.effectiveAt(censusDate) != null) {
log.debug("PellEnrollmentIntensity script using census date previous FPO")
previousFpo = previousFinancialPlan.effectiveAt(censusDate)
} else if (financialPlan.getVersion() > 1) {
log.debug("PellEnrollmentIntensity script using (FPO version - 1) previous FPO")
previousFpo = previousFinancialPlan.withVersion(financialPlan.getVersion() - 1)
}
//previousFpo is not null logic
if (previousFpo != null) {
log.debug("PellEnrollmentIntensity script previousFpo is not null")
def prevEnrollmentIntensities = previousFpo.getInAwardYear(awy).getOverlappingWith(term).getEnrollmentIntensities()
if (prevEnrollmentIntensities.isEmpty()) {
log.debug("PellEnrollmentIntensity script, prevEnrollmentIntensities is empty, final values: enrollmentIntensity = {}, countedUnits = {}, creditsRequiredForFullTimeEnrollment = {}", enrollmentIntensity, countedUnits, creditsRequiredForFullTimeEnrollment)
return enrollmentIntensity
}
enrollmentIntensity = prevEnrollmentIntensities.get()
log.debug("PellEnrollmentIntensity script, prevEnrollmentIntensities is NOT empty, final values: enrollmentIntensity = {}, countedUnits = {}, creditsRequiredForFullTimeEnrollment = {}", enrollmentIntensity, countedUnits, creditsRequiredForFullTimeEnrollment)
}
else {
//previousFpo is null message
log.debug("PellEnrollmentIntensity script previousFpo is null")
}
}
return enrollmentIntensity
plusCreditDecisionMatchingCriteria
Workbook: FAS_FUND_CONFIG.csv
Column: Plus_Credit_Decision_Matching_Criteria
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.PlusCreditDecisionMatchingCriteriaScript)
package CHANGE_ME // this should be updated to your actual package name
// Define utility methods
static BigDecimal nthIntPart(BigDecimal dividend, int divisor, int partIdx) {
int truncatedDividend = dividend.intValue()
BigDecimal fraction = dividend - truncatedDividend
int roundedAmount = (dividend / divisor).intValue()
return partIdx < truncatedDividend % divisor
? roundedAmount + 1
: partIdx == divisor - 1
? roundedAmount + fraction
: roundedAmount
}
// Actual script
boolean applicableLoansExist
if (program.isTerm()) {
// Acy-scoped fund codes the client may need. Setting it as empty works too but in this case
// the script can be significantly simplified. As this script only applies to (G)PLUS adding
// fund codes with lower priority than (G)PLUS will make no difference.
def acyScopedFundCodes = ["DISCOUNT"] as Set<String>
def acyScopedTotal = financialPlan.getInAcademicYear(acyNo).filterFunds(acyScopedFundCodes.&contains).maxAmount
def termsInNeed = acy.terms.indexed().findAll { tidx, t ->
def termFundingSoFar = financialPlan.filterFunds { code -> !acyScopedFundCodes.contains(code) }
.getOverlappingWith(t)
.maxAmount
def acyScopedInThisTerm = nthIntPart(acyScopedTotal, acy.terms.size(), tidx)
def termCoa = coa.in(t).activeCoa
def termRemainingNeed = [termCoa - termFundingSoFar - acyScopedInThisTerm, 0].max()
termRemainingNeed > 0
}.values()
applicableLoansExist = termsInNeed.any { t ->
!plusLoans.getOverlappingWith(t).isEmpty()
}
} else {
applicableLoansExist = acy.loanPaymentPeriods.any { pp ->
pp.status != "CANCELED" && !plusLoans.getOverlappingWith(pp).isEmpty()
}
}
if (!applicableLoansExist && plusOverrides.isEmpty() && deniedPlusLoans.isEmpty()) {
return [projectedPlusLoan]
} else {
return plusLoans.getOverlappingWith(pp).collect { loan ->
loan.withNoPriority() // removing default priority queue here and rebuilding it below:
.addReversedPriority(disbursements.getInScope(scope).isDisbursed())
.addPriority(loan.getLatestPackagePriority(acyNo))
.addPriority(loan.getProcessDate())
.addReversedPriority(loan.getAcceptedLoanAmount())
}
}
summerTermType
Workbook: PKGSCHEDATTRIB.csv
Column: Summer_Term_Script
return "header";
termPaymentPeriodMonths
Workbook: PKGSCHEDATTRIB.csv
Column: Term_PP_Months
//file:noinspection UnnecessaryQualifiedReference
@groovy.transform.BaseScript(com.oracle.sfp.scripting.api.sdk.autocomplete.TermPaymentPeriodMonthsScript)
package CHANGE_ME // this should be updated to your actual package name
import com.oracle.sfp.scripting.api.*
import com.oracle.sfp.scripting.api.util.*
/* Term Baseline PP Months Calculation, return type BigDecimal */
import org.joda.time.LocalDate;
def returnValue = 1.0;
def programTermType = program.getTermType();
log.debug("PP MONTHS CALCULATION CONFIG: Program Term Type = {}", program.getTermType());
def safiTerm = program.getTerms().getOverlappingWith(term).get(0);
if (program.getTermType() == null)
{
log.debug("PP MONTHS CALCULATION CONFIG: ERROR, null value passed from API");
returnValue = 1.0;
}
else if (safiTerm.isSummer())
{
returnValue = 2.0;
}
// Standard from this point on
else if (programTermType == "Semester")
{
returnValue = 4.5;
}
else if (programTermType == "Trimester")
{
returnValue = 3.0;
}
else if (programTermType == "Quarter")
{
returnValue = 3.0;
}
return returnValue;