Subversion Repositories SmartDukaan

Rev

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

Rev 25254 Rev 25255
Line 41... Line 41...
41
	private UserWalletHistoryRepository userWalletHistoryRepository;
41
	private UserWalletHistoryRepository userWalletHistoryRepository;
42
 
42
 
43
	@Override
43
	@Override
44
	public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
44
	public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
45
			String description, float amount) throws ProfitMandiBusinessException {
45
			String description, float amount) throws ProfitMandiBusinessException {
46
		if(underMaintainance && !referenceType.equals(WalletReferenceType.SCHEME_OUT)) {
-
 
47
			throw pbse;
-
 
48
		}
-
 
49
		if (amount == 0)
46
		if (amount == 0)
50
			return;
47
			return;
51
		UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
48
		UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
52
		userWallet.setAmount(userWallet.getAmount() + Math.round(amount));
49
		userWallet.setAmount(userWallet.getAmount() + Math.round(amount));
53
		userWalletRepository.persist(userWallet);
50
		userWalletRepository.persist(userWallet);