Example #1
0
 public bool IlrLearningDeliveryRecordMatch(LearningDeliveryInfo learningDelivery, AppsCoInvestmentRecordKey record)
 {
     return(learningDelivery.ProgType == record.LearningAimProgrammeType &&
            learningDelivery.StdCode == record.LearningAimStandardCode &&
            learningDelivery.FworkCode == record.LearningAimFrameworkCode &&
            learningDelivery.PwayCode == record.LearningAimPathwayCode &&
            learningDelivery.LearnStartDate == record.LearningStartDate &&
            learningDelivery.LearnAimRef.CaseInsensitiveEquals(record.LearningAimReference));
 }
Example #2
0
 public bool HasLdm356Or361(LearningDeliveryInfo learningDelivery)
 {
     return(learningDelivery?
            .LearningDeliveryFAMs?
            .Any(
                fam =>
                fam.LearnDelFAMType.CaseInsensitiveEquals(Generics.LearningDeliveryFAMCodeLDM) &&
                (fam.LearnDelFAMCode == Generics.LearningDeliveryFAMCode356 || fam.LearnDelFAMCode == Generics.LearningDeliveryFAMCode361))
            ?? false);
 }
Example #3
0
        public decimal CalculateCompletionEarningsThisFundingYear(LearningDeliveryInfo learningDelivery, AppsCoInvestmentRulebaseInfo rulebaseInfo)
        {
            if (learningDelivery != null)
            {
                return(rulebaseInfo?
                       .AECApprenticeshipPriceEpisodePeriodisedValues?
                       .Where(p =>
                              p.LearnRefNumber == learningDelivery.LearnRefNumber &&
                              p.AimSeqNumber == learningDelivery.AimSeqNumber &&
                              p.Periods != null)
                       .SelectMany(p => p.Periods)
                       .Sum()
                       ?? 0);
            }

            return(0);
        }
Example #4
0
        public decimal?GetTotalPMRBetweenDates(LearningDeliveryInfo learningDelivery, DateTime?startDate, DateTime?endDate)
        {
            var pmrsQuery = learningDelivery?.AppFinRecords ?? Enumerable.Empty <AppFinRecordInfo>();

            if (startDate.HasValue)
            {
                pmrsQuery = pmrsQuery.Where(r => r.AFinDate >= startDate);
            }

            if (endDate.HasValue)
            {
                pmrsQuery = pmrsQuery.Where(r => r.AFinDate < endDate);
            }

            pmrsQuery = pmrsQuery.Where(r => r.AFinType.CaseInsensitiveEquals(Generics.PMR));

            var pmrs = pmrsQuery.ToList();

            var positive = pmrs.Where(p => p.AFinCode == 1 || p.AFinCode == 2).Sum(p => p.AFinAmount);
            var negative = pmrs.Where(p => p.AFinCode == 3).Sum(p => p.AFinAmount);

            return(positive - negative);
        }
Example #5
0
        public AECLearningDeliveryInfo GetRulebaseLearningDelivery(AppsCoInvestmentRulebaseInfo rulebaseInfo, LearningDeliveryInfo learningDelivery)
        {
            if (learningDelivery == null)
            {
                return(null);
            }

            return(rulebaseInfo
                   .AECLearningDeliveries
                   .FirstOrDefault(ld => ld.LearnRefNumber.CaseInsensitiveEquals(learningDelivery.LearnRefNumber) && ld.AimSeqNumber == learningDelivery.AimSeqNumber));
        }