Subversion Repositories SmartDukaan

Rev

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

Rev 34435 Rev 34440
Line 730... Line 730...
730
 
730
 
731
    }
731
    }
732
 
732
 
733
    @RequestMapping(value = "/account/statement", method = RequestMethod.GET)
733
    @RequestMapping(value = "/account/statement", method = RequestMethod.GET)
734
    public ResponseEntity<?> getAccountStatement(HttpServletRequest request, @RequestParam LocalDateTime startDate, @RequestParam LocalDateTime endDate, Model model, @RequestParam(defaultValue = "0") int fofoId) throws Exception {
734
    public ResponseEntity<?> getAccountStatement(HttpServletRequest request, @RequestParam LocalDateTime startDate, @RequestParam LocalDateTime endDate, Model model, @RequestParam(defaultValue = "0") int fofoId) throws Exception {
735
        boolean isAdmin = roleManager.isAdmin(cookiesProcessor.getCookiesObject(request).getRoleIds());
735
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
736
//        if (fofoId > 0) {
736
        boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
737
//            if (!isAdmin) {
737
        if (!isAdmin) {
738
//                throw new ProfitMandiBusinessException("Unauthorised access", "PartnerId", "Permission Denied");
-
 
739
//            }
-
 
740
//        } else {
-
 
741
//            fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
738
            fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
742
//        }
739
        }
743
        fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
740
        //fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
744
        float openingBalance = walletService.getOpeningTill(fofoId, startDate);
741
        float openingBalance = walletService.getOpeningTill(fofoId, startDate);
745
        float closingBalance = walletService.getOpeningTill(fofoId, endDate);
742
        float closingBalance = walletService.getOpeningTill(fofoId, endDate);
746
        UserWallet uw = walletService.getUserWallet(fofoId);
743
        UserWallet uw = walletService.getUserWallet(fofoId);
747
        LOGGER.info("Start date - {}, end Date - {}", startDate, endDate);
744
        LOGGER.info("Start date - {}, end Date - {}", startDate, endDate);
748
        List<UserWalletHistory> history = userWalletHistoryRepository.selectPaginatedByWalletId(uw.getId(), startDate, endDate, 0, 0);
745
        List<UserWalletHistory> history = userWalletHistoryRepository.selectPaginatedByWalletId(uw.getId(), startDate, endDate, 0, 0);