Subversion Repositories SmartDukaan

Rev

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

Rev 33247 Rev 33421
Line 316... Line 316...
316
 
316
 
317
    @Override
317
    @Override
318
    public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException {
318
    public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException {
319
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
319
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
320
        if (userWallet == null) {
320
        if (userWallet == null) {
321
            return 0;
321
            userWallet = new UserWallet();
-
 
322
            userWallet.setUserId(retailerId);
-
 
323
            userWalletRepository.persist(userWallet);
322
        }
324
        }
323
        return (int) userWalletHistoryRepository.selectSumByWallet(userWallet.getId());
325
        return (int) userWalletHistoryRepository.selectSumByWallet(userWallet.getId());
324
    }
326
    }
325
 
327
 
326
    @Override
328
    @Override