Subversion Repositories SmartDukaan

Rev

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

Rev 33845 Rev 33848
Line 76... Line 76...
76
        userWallet.setAmount(walletAmount + Math.round(amount));
76
        userWallet.setAmount(walletAmount + Math.round(amount));
77
        if (amount > 0) {
77
        if (amount > 0) {
78
            notificationService.sendNotification(retailerId, "walletcredit", MessageType.wallet, "Rs." + FormattingUtils.formatDecimal(amount) + " credited in SD Wallet", description);
78
            notificationService.sendNotification(retailerId, "walletcredit", MessageType.wallet, "Rs." + FormattingUtils.formatDecimal(amount) + " credited in SD Wallet", description);
79
        }
79
        }
80
        this.createUserWalletHistory(Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
80
        this.createUserWalletHistory(Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
81
        this.checkFullStockPayment(userWallet.getId(), retailerId);
81
//        this.checkFullStockPayment(userWallet.getId(), retailerId);
82
    }
82
    }
83
 
83
 
84
    private void checkFullStockPayment(int walletId, int retailerId) throws ProfitMandiBusinessException {
84
    private void checkFullStockPayment(int walletId, int retailerId) throws ProfitMandiBusinessException {
85
        List<UserWalletHistory> userWalletHistories = userWalletHistoryRepository.selectByWalletIdAndReferenceType(walletId, WalletReferenceType.ADVANCE_AMOUNT);
85
        List<UserWalletHistory> userWalletHistories = userWalletHistoryRepository.selectByWalletIdAndReferenceType(walletId, WalletReferenceType.ADVANCE_AMOUNT);
86
        long totalAdvanceAmount = userWalletHistories.stream().mapToLong(x -> x.getAmount()).sum();
86
        long totalAdvanceAmount = userWalletHistories.stream().mapToLong(x -> x.getAmount()).sum();