Subversion Repositories SmartDukaan

Rev

Rev 36965 | Rev 37031 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36965 Rev 37018
Line 228... Line 228...
228
            countItems = walletService.getSizeByRetailerId(fofoDetails.getFofoId(), startDateTime, endDateTime);
228
            countItems = walletService.getSizeByRetailerId(fofoDetails.getFofoId(), startDateTime, endDateTime);
229
        } catch (ProfitMandiBusinessException profitMandiBusinessException) {
229
        } catch (ProfitMandiBusinessException profitMandiBusinessException) {
230
            LOGGER.error("UserWallet not found : ", profitMandiBusinessException);
230
            LOGGER.error("UserWallet not found : ", profitMandiBusinessException);
231
        }
231
        }
232
        com.spice.profitmandi.dao.model.CreditSummary creditSummary = sdCreditService.getCreditSummary(fofoId);
232
        com.spice.profitmandi.dao.model.CreditSummary creditSummary = sdCreditService.getCreditSummary(fofoId);
-
 
233
 
-
 
234
        // Utilization comes from sd_credit_requirement.utilized_amount — the same source
-
 
235
        // the sddirect/summary API uses (GatewayController + SDCreditServiceImpl:732).
-
 
236
        // This reflects all credit consumed including limit-block (flagship) loans,
-
 
237
        // which the loan-derived CreditSummary.getUtilization() misses because
-
 
238
        // selectAllActiveLoan filters out limit_block=true rows.
-
 
239
        SDCreditRequirement sdCreditRequirement = sdCreditRequirementRepository.selectByFofoId(fofoId);
-
 
240
        java.math.BigDecimal utilizationAmount = (sdCreditRequirement != null && sdCreditRequirement.getUtilizedAmount() != null)
-
 
241
                ? sdCreditRequirement.getUtilizedAmount()
-
 
242
                : java.math.BigDecimal.ZERO;
-
 
243
 
233
        model.addAttribute("userWallet", userWallet);
244
        model.addAttribute("userWallet", userWallet);
234
        model.addAttribute("walletHistories", userWalletHistories);
245
        model.addAttribute("walletHistories", userWalletHistories);
235
        model.addAttribute("walletAttachmentMap", buildWalletHistoryAttachmentMap(userWalletHistories));
246
        model.addAttribute("walletAttachmentMap", buildWalletHistoryAttachmentMap(userWalletHistories));
236
        model.addAttribute("start", offset + 1);
247
        model.addAttribute("start", offset + 1);
237
        model.addAttribute("size", countItems);
248
        model.addAttribute("size", countItems);
238
        model.addAttribute("isAdmin", isAdmin);
249
        model.addAttribute("isAdmin", isAdmin);
239
        model.addAttribute("totalDue", creditSummary.getTotalDue());
250
        model.addAttribute("totalDue", creditSummary.getTotalDue());
240
        model.addAttribute("utilization", creditSummary.getUtilization());
251
        model.addAttribute("utilization", utilizationAmount);
241
        model.addAttribute(ProfitMandiConstants.START_TIME, startTimeString);
252
        model.addAttribute(ProfitMandiConstants.START_TIME, startTimeString);
242
        model.addAttribute(ProfitMandiConstants.END_TIME, endTimeString);
253
        model.addAttribute(ProfitMandiConstants.END_TIME, endTimeString);
243
 
254
 
244
        if (userWalletHistories.size() < limit) {
255
        if (userWalletHistories.size() < limit) {
245
            model.addAttribute("end", offset + userWalletHistories.size());
256
            model.addAttribute("end", offset + userWalletHistories.size());