package net.sourceforge.fenixedu.domain.tuition; import net.sourceforge.fenixedu.dataTransferObject.finantialServices.CurricularCourseTuitionArticleData; import net.sourceforge.fenixedu.dataTransferObject.finantialServices.TuitionArticleData; import net.sourceforge.fenixedu.domain.student.StudentStatuteType; public class CurricularCourseTuitionArticle extends CurricularCourseTuitionArticle_Base { public CurricularCourseTuitionArticle() { super(); } @Override public boolean isCurricularCourseTuitionArticle() { return true; } @Override public void update(TuitionArticleData data) { update((CurricularCourseTuitionArticleData) data); } public void update(CurricularCourseTuitionArticleData data) { super.update(data); setEctsCredits(data.getEctsCredits()); setFactor(data.getFactor()); } @Override public TuitionArticleData convertToDTO() { return new CurricularCourseTuitionArticleData(getCode(), getDescription(), getValue(), getManual(), getCurricularYear(), getStudentStatuteType(), getTuitionArticleState(), getEctsCredits(), getFactor()); } @Override public String getGiafCode() { String giafCode = TuitionArticleHelper.getOptionalCurricularCourseCode(getExecutionDegree().getDegree(), getExecutionDegree().getExecutionYear(), getStudentStatuteType(), getCurricularYear(), getEctsCredits() .intValue()); if (getFactor().doubleValue() != 1d) { giafCode = giafCode + "_" + getFactor(); } return giafCode; } @Override public String getGiafDescription() { StringBuilder sb = new StringBuilder(); sb.append(getEctsCredits()); sb.append(" ECTS"); if (getStudentStatuteType() != null) { sb.append(" - "); if (StudentStatuteType.TOP_15_IBS.equals(getStudentStatuteType())) { sb.append("Top 15 IBS"); } if (StudentStatuteType.PREVIOUS_IBS_STUDENT.equals(getStudentStatuteType())) { sb.append("Licenciado IBS"); } } if (getCurricularYear() != null) { sb.append(" - "); sb.append(getCurricularYear()); sb.append(".º ano"); } if (getFactor().doubleValue() != 1d) { sb.append(" - "); sb.append(getFactor()); } return sb.toString(); } }