Subversion Repositories SmartDukaan

Rev

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

Rev 34440 Rev 34441
Line 613... Line 613...
613
    }
613
    }
614
 
614
 
615
    @RequestMapping(value = "/wallet/statement", method = RequestMethod.GET)
615
    @RequestMapping(value = "/wallet/statement", method = RequestMethod.GET)
616
    public String getWalletStatement(HttpServletRequest request, @RequestParam LocalDateTime startDate, @RequestParam LocalDateTime endDate, Model model, @RequestParam(defaultValue = "0") int fofoId) throws Exception {
616
    public String getWalletStatement(HttpServletRequest request, @RequestParam LocalDateTime startDate, @RequestParam LocalDateTime endDate, Model model, @RequestParam(defaultValue = "0") int fofoId) throws Exception {
617
        boolean isAdmin = roleManager.isAdmin(cookiesProcessor.getCookiesObject(request).getRoleIds());
617
        boolean isAdmin = roleManager.isAdmin(cookiesProcessor.getCookiesObject(request).getRoleIds());
618
//        if (fofoId > 0) {
-
 
619
//            if (!isAdmin) {
618
        if (!isAdmin) {
620
//                throw new ProfitMandiBusinessException("Unauthorised access", "PartnerId", "Permission Denied");
-
 
621
//            }
-
 
622
//        } else {
-
 
623
//            fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
619
            fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
624
//        }
620
        }
625
        fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
-
 
626
        float openingBalance = walletService.getOpeningTill(fofoId, startDate);
621
        float openingBalance = walletService.getOpeningTill(fofoId, startDate);
627
        float closingBalance = walletService.getOpeningTill(fofoId, endDate);
622
        float closingBalance = walletService.getOpeningTill(fofoId, endDate);
628
        List<UserWalletHistory> uwhList = walletService.getPaginatedUserWalletHistoryByRetailerId(fofoId, startDate, endDate, 0, 0);
623
        List<UserWalletHistory> uwhList = walletService.getPaginatedUserWalletHistoryByRetailerId(fofoId, startDate, endDate, 0, 0);
629
        Collections.reverse(uwhList);
624
        Collections.reverse(uwhList);
630
        model.addAttribute("opening", openingBalance);
625
        model.addAttribute("opening", openingBalance);
Line 735... Line 730...
735
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
730
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
736
        boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
731
        boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
737
        if (!isAdmin) {
732
        if (!isAdmin) {
738
            fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
733
            fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
739
        }
734
        }
740
        //fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
-
 
741
        float openingBalance = walletService.getOpeningTill(fofoId, startDate);
735
        float openingBalance = walletService.getOpeningTill(fofoId, startDate);
742
        float closingBalance = walletService.getOpeningTill(fofoId, endDate);
736
        float closingBalance = walletService.getOpeningTill(fofoId, endDate);
743
        UserWallet uw = walletService.getUserWallet(fofoId);
737
        UserWallet uw = walletService.getUserWallet(fofoId);
744
        LOGGER.info("Start date - {}, end Date - {}", startDate, endDate);
738
        LOGGER.info("Start date - {}, end Date - {}", startDate, endDate);
745
        List<UserWalletHistory> history = userWalletHistoryRepository.selectPaginatedByWalletId(uw.getId(), startDate, endDate, 0, 0);
739
        List<UserWalletHistory> history = userWalletHistoryRepository.selectPaginatedByWalletId(uw.getId(), startDate, endDate, 0, 0);