diff --git a/api/src/main/java/ca/bc/gov/educ/grad/report/dto/impl/TranscriptCourseImpl.java b/api/src/main/java/ca/bc/gov/educ/grad/report/dto/impl/TranscriptCourseImpl.java index 91d111f6..b8b2d0af 100644 --- a/api/src/main/java/ca/bc/gov/educ/grad/report/dto/impl/TranscriptCourseImpl.java +++ b/api/src/main/java/ca/bc/gov/educ/grad/report/dto/impl/TranscriptCourseImpl.java @@ -247,7 +247,12 @@ public boolean compareCourse(final TranscriptCourse compareCourse) { // Removes duplication of courses by comparing and finding course with // highest percentage. - return percentage <= comparePercentage && comparePercentage != 0; + // GRAD2-2905 + if (this.isCompletedCourseUsedForGrad() && !compareCourse.isCompletedCourseUsedForGrad()) { + return percentage < comparePercentage && comparePercentage != 0; + } else { + return percentage <= comparePercentage && comparePercentage != 0; + } } public boolean isCompletedCourseUsedForGrad() { diff --git a/api/src/main/java/ca/bc/gov/educ/grad/report/service/impl/StudentTranscriptServiceImpl.java b/api/src/main/java/ca/bc/gov/educ/grad/report/service/impl/StudentTranscriptServiceImpl.java index 99eddd8a..bb25e813 100644 --- a/api/src/main/java/ca/bc/gov/educ/grad/report/service/impl/StudentTranscriptServiceImpl.java +++ b/api/src/main/java/ca/bc/gov/educ/grad/report/service/impl/StudentTranscriptServiceImpl.java @@ -715,6 +715,7 @@ private TranscriptCourse getInterimCourse( final List results, boolean openGradProgram) { //Check for duplicate courses for (final TranscriptCourse compareCourse : results) { + if (course.equals(compareCourse)) continue; //Check and compare two courses for duplication and if required //replace course based on requirement. if (isInterimCourse(course, compareCourse, openGradProgram)) {