Subversion Repositories SmartDukaan

Rev

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

Rev 35572 Rev 35811
Line 116... Line 116...
116
    }
116
    }
117
 
117
 
118
    @Autowired
118
    @Autowired
119
    JavaMailSender mailSender;
119
    JavaMailSender mailSender;
120
    @Autowired
120
    @Autowired
-
 
121
    com.spice.profitmandi.service.transaction.SDCreditService sdCreditService;
-
 
122
    @Autowired
121
    AddWalletRequestRepository addWalletRequestRepository;
123
    AddWalletRequestRepository addWalletRequestRepository;
122
    @Autowired
124
    @Autowired
123
    TransactionService transactionService;
125
    TransactionService transactionService;
124
    @Autowired
126
    @Autowired
125
    private CookiesProcessor cookiesProcessor;
127
    private CookiesProcessor cookiesProcessor;
Line 214... Line 216...
214
            countItems = walletService.getSizeByRetailerId(fofoDetails.getFofoId(), startDateTime, endDateTime);
216
            countItems = walletService.getSizeByRetailerId(fofoDetails.getFofoId(), startDateTime, endDateTime);
215
        } catch (ProfitMandiBusinessException profitMandiBusinessException) {
217
        } catch (ProfitMandiBusinessException profitMandiBusinessException) {
216
            LOGGER.error("UserWallet not found : ", profitMandiBusinessException);
218
            LOGGER.error("UserWallet not found : ", profitMandiBusinessException);
217
        }
219
        }
218
        SDCreditRequirement sdCreditRequirement = sdCreditRequirementRepository.selectByFofoId(fofoId);
220
        SDCreditRequirement sdCreditRequirement = sdCreditRequirementRepository.selectByFofoId(fofoId);
-
 
221
        com.spice.profitmandi.dao.model.CreditSummary creditSummary = sdCreditService.getCreditSummary(fofoId);
219
        List<Loan> loans = loanRepository.selectActiveLoan(fofoId);
222
        List<Loan> loans = loanRepository.selectActiveLoan(fofoId);
220
        BigDecimal utilization = sdCreditRequirement.getUtilizedAmount();
223
        BigDecimal utilization = creditSummary.getUtilization();
221
        BigDecimal availableLimit = sdCreditRequirement.getAvailableLimit();
224
        BigDecimal availableLimit = creditSummary.getAvailableLimit();
222
        BigDecimal creditlimit = sdCreditRequirement.getLimit();
225
        BigDecimal creditlimit = sdCreditRequirement.getLimit();
223
        BigDecimal totalDue = new BigDecimal(0);
226
        BigDecimal totalDue = creditSummary.getTotalDue();
224
        for (Loan loan : loans) {
-
 
225
            BigDecimal pendingAmount = loan.getPendingAmount();
-
 
226
            BigDecimal interestAccrued = loan.getInterestAccrued();
-
 
227
            BigDecimal interestPaid = loan.getInterestPaid();
-
 
228
            totalDue = totalDue.add(interestAccrued.subtract(interestPaid).add(pendingAmount));
-
 
229
            availableLimit = creditlimit.subtract(totalDue);
-
 
230
        }
-
 
231
        model.addAttribute("userWallet", userWallet);
227
        model.addAttribute("userWallet", userWallet);
232
        model.addAttribute("walletHistories", userWalletHistories);
228
        model.addAttribute("walletHistories", userWalletHistories);
233
        model.addAttribute("start", offset + 1);
229
        model.addAttribute("start", offset + 1);
234
        model.addAttribute("size", countItems);
230
        model.addAttribute("size", countItems);
235
        model.addAttribute("isAdmin", isAdmin);
231
        model.addAttribute("isAdmin", isAdmin);