Subversion Repositories SmartDukaan

Rev

Rev 35877 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35877 Rev 35915
Line 4111... Line 4111...
4111
            double interest = defaultLoan.getInterestAccrued().doubleValue() - defaultLoan.getInterestPaid().doubleValue();
4111
            double interest = defaultLoan.getInterestAccrued().doubleValue() - defaultLoan.getInterestPaid().doubleValue();
4112
            double total = principal + interest;
4112
            double total = principal + interest;
4113
 
4113
 
4114
            String title = "Credit Default Alert!";
4114
            String title = "Credit Default Alert!";
4115
            String url = "http://app.smartdukaan.com/pages/home/credit";
4115
            String url = "http://app.smartdukaan.com/pages/home/credit";
4116
            String message = "Your credit payment (due " + defaultLoan.getDueDate().toLocalDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy")) + ") is now in default. A penalty interest of " + ProfitMandiConstants.NEW_DELAYED_INTEREST_RATE + "% per day is being charged. Total outstanding: Rs." + FormattingUtils.formatDecimal(total) + " (Principal: Rs." + FormattingUtils.formatDecimal(principal) + " + Interest: Rs." + FormattingUtils.formatDecimal(interest) + "). Pay immediately to avoid further penalties.";
4116
            String message = "Your credit payment (due " + defaultLoan.getDueDate().toLocalDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy")) + ") is now in default. A penalty interest of " + (defaultLoan.getPenaltyRate() != null ? defaultLoan.getPenaltyRate() : ProfitMandiConstants.NEW_DELAYED_INTEREST_RATE) + "% per day is being charged. Total outstanding: Rs." + FormattingUtils.formatDecimal(total) + " (Principal: Rs." + FormattingUtils.formatDecimal(principal) + " + Interest: Rs." + FormattingUtils.formatDecimal(interest) + "). Pay immediately to avoid further penalties.";
4117
            notificationService.sendNotification(defaultLoan.getFofoId(), title, MessageType.notification, title, message, url);
4117
            notificationService.sendNotification(defaultLoan.getFofoId(), title, MessageType.notification, title, message, url);
4118
 
4118
 
4119
        }
4119
        }
4120
    }
4120
    }
4121
 
4121
 
Line 4309... Line 4309...
4309
                double total = principal + interest;
4309
                double total = principal + interest;
4310
 
4310
 
4311
                String url = "http://app.smartdukaan.com/pages/home/credit";
4311
                String url = "http://app.smartdukaan.com/pages/home/credit";
4312
 
4312
 
4313
                String title = "Credit Payment Overdue!";
4313
                String title = "Credit Payment Overdue!";
4314
                String message = "Your credit payment (due " + loan.getDueDate().toLocalDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy")) + ") is overdue. An interest of " + ProfitMandiConstants.TIER2_INTEREST_RATE + "% per day is now being charged. Total outstanding: Rs." + FormattingUtils.formatDecimal(total) + " (Principal: Rs." + FormattingUtils.formatDecimal(principal) + " + Interest: Rs." + FormattingUtils.formatDecimal(interest) + "). Pay now to avoid higher penalties.";
4314
                String message = "Your credit payment (due " + loan.getDueDate().toLocalDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy")) + ") is overdue. An interest of " + (loan.getOverdueRate() != null ? loan.getOverdueRate() : ProfitMandiConstants.TIER2_INTEREST_RATE) + "% per day is now being charged. Total outstanding: Rs." + FormattingUtils.formatDecimal(total) + " (Principal: Rs." + FormattingUtils.formatDecimal(principal) + " + Interest: Rs." + FormattingUtils.formatDecimal(interest) + "). Pay now to avoid higher penalties.";
4315
 
4315
 
4316
                notificationService.sendNotification(loan.getFofoId(), title, MessageType.notification, title, message, url);
4316
                notificationService.sendNotification(loan.getFofoId(), title, MessageType.notification, title, message, url);
4317
 
4317
 
4318
            }
4318
            }
4319
        }
4319
        }
Line 5092... Line 5092...
5092
        StringBuilder sb = new StringBuilder();
5092
        StringBuilder sb = new StringBuilder();
5093
        sb.append("<html><body>");
5093
        sb.append("<html><body>");
5094
        sb.append("<p><b>Credit Default Alert!</b></p><br/>");
5094
        sb.append("<p><b>Credit Default Alert!</b></p><br/>");
5095
        sb.append("<p>Dear " + name + ",</p>");
5095
        sb.append("<p>Dear " + name + ",</p>");
5096
        sb.append("<p>Your credit payment has been in default for " + daysInDefault + " days. " +
5096
        sb.append("<p>Your credit payment has been in default for " + daysInDefault + " days. " +
5097
                "A penalty interest of " + ProfitMandiConstants.NEW_DELAYED_INTEREST_RATE + "% per day is being charged.</p>");
5097
                "A penalty interest of " + (loan.getPenaltyRate() != null ? loan.getPenaltyRate() : ProfitMandiConstants.NEW_DELAYED_INTEREST_RATE) + "% per day is being charged.</p>");
5098
        sb.append("<p><b>Total Outstanding: Rs. " + formattedTotal + "</b><br/>");
5098
        sb.append("<p><b>Total Outstanding: Rs. " + formattedTotal + "</b><br/>");
5099
        sb.append("Principal: Rs. " + formattedPrincipal + "<br/>");
5099
        sb.append("Principal: Rs. " + formattedPrincipal + "<br/>");
5100
        sb.append("Interest: Rs. " + formattedInterest + "</p>");
5100
        sb.append("Interest: Rs. " + formattedInterest + "</p>");
5101
        sb.append("<p>Continued default will impact your Credit score and may result in legal action. " +
5101
        sb.append("<p>Continued default will impact your Credit score and may result in legal action. " +
5102
                "Please settle the outstanding amount immediately.</p>");
5102
                "Please settle the outstanding amount immediately.</p>");
Line 5112... Line 5112...
5112
 
5112
 
5113
        return String.format(
5113
        return String.format(
5114
                "Dear %s, Your credit payment has been in default for %d days. " +
5114
                "Dear %s, Your credit payment has been in default for %d days. " +
5115
                "A penalty interest of %s%% per day is being charged on your outstanding amount of Rs. %s. " +
5115
                "A penalty interest of %s%% per day is being charged on your outstanding amount of Rs. %s. " +
5116
                "Please settle immediately to avoid legal action.\n\nTeam SmartDukaan",
5116
                "Please settle immediately to avoid legal action.\n\nTeam SmartDukaan",
5117
                name, daysInDefault, ProfitMandiConstants.NEW_DELAYED_INTEREST_RATE, formattedAmount);
5117
                name, daysInDefault, loan.getPenaltyRate() != null ? loan.getPenaltyRate() : ProfitMandiConstants.NEW_DELAYED_INTEREST_RATE, formattedAmount);
5118
    }
5118
    }
5119
 
5119
 
5120
    @Autowired
5120
    @Autowired
5121
    private FofoOpeningStockRepository fofoOpeningStockRepository;
5121
    private FofoOpeningStockRepository fofoOpeningStockRepository;
5122
    @Autowired
5122
    @Autowired