Subversion Repositories SmartDukaan

Rev

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

Rev 34674 Rev 34752
Line 115... Line 115...
115
            LOGGER.error("Wallet Balance is insufficient!, needed - {}, wallet has - {}, for retailer - {}", Math.floor(amount), walletAmount, retailerId);
115
            LOGGER.error("Wallet Balance is insufficient!, needed - {}, wallet has - {}, for retailer - {}", Math.floor(amount), walletAmount, retailerId);
116
            User user = userRepository.selectById(retailerId);
116
            User user = userRepository.selectById(retailerId);
117
            throw new ProfitMandiBusinessException(user.getName(), walletAmount, "WLT_1000");
117
            throw new ProfitMandiBusinessException(user.getName(), walletAmount, "WLT_1000");
118
        }
118
        }
119
        userWallet.setAmount(walletAmount - Math.round(amount));
119
        userWallet.setAmount(walletAmount - Math.round(amount));
120
        userWalletRepository.persist(userWallet);
-
 
121
        this.createUserWalletHistory(-Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
120
        this.createUserWalletHistory(-Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
122
    }
121
    }
123
 
122
 
124
    @Override
123
    @Override
125
    public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
124
    public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,