Preview:
private void setExtensionMaxExpirationDate(AccountCourseDTO dto, ExtensionInformation extensionInformation, Long userId){
        List<AccountCourseDTO> allCourses = userCourseDao.findAllUserOrders(userId);

        if(dto.getProductType()==6){
            for(AccountCourseDTO courses : allCourses) {
                if(courses.getCourseId().equals(dto.getCourseId()) && dto.getProductType()!=6) {

                    // DateTime originalPurchaseDate = formatter.parseDateTime(extensionInformation.getDatePurchase());
                    DateTime originalPurchaseDate = dto.getOrderDate();

                    for(AccountCourseDTO coursess : allCourses) {
                        if (coursess.getCourseId().equals(dto.getCourseId()) && dto.getProductType() == 6) {

                            extensionInformation.setMaxExpirationDate(originalPurchaseDate.plusDays(Integer.valueOf((dto.getMaxExpirationDays()))));

                        }
                    }}}}

        }



 setExtensionMaxExpirationDate(dto,extensionInformation,userId);

ExtensionInformation extensionInformation = userEcomDao.getExtensionInformation(dto.getOrderedItemId(), schoolId);
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter