Database SQL Operation: InstructionLineItem.readLatestCoverPeriodToForCaseNomineeAndListObjective
Description: | Retrieves the latest cover period to date for a specified case nominee and list objective (list objectives are distinguished using the related reference), based on ILI records with a status of 'Processed', 'Unprocessed', 'Cancelled', 'Expired' and Transferred. |
Sterotype: | ns |
SELECT
MAX (coverPeriodTo)
INTO
:coverPeriodTo
FROM
InstructionLineItem,
CaseDecisionFinancialComp,
CaseDecisionObjective
WHERE InstructionLineItem.caseNomineeID = :caseNomineeID
AND InstructionLineItem.statusCode IN ( :statusCode, :iliStatusCodeExpired, :iliStatusCodeProcessed, :iliStatusCodeUnprocessed, :iliStatusCodeAllocated, :iliStatusCodeTransferred)
AND InstructionLineItem.financialCompID = CaseDecisionFinancialComp.financialCompID
AND CaseDecisionFinancialComp.CaseDecisionObjectiveID = CaseDecisionObjective.CaseDecisionObjectiveID
AND CaseDecisionObjective.relatedReference = :relatedReferenceOpt
AND CaseDecisionObjective.objectiveID = :rulesObjectiveID
|