Subversion Repositories SmartDukaan

Rev

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

Rev 23444 Rev 23456
Line 38... Line 38...
38
	
38
	
39
	@Override
39
	@Override
40
	public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description,
40
	public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description,
41
			float amount) throws ProfitMandiBusinessException{
41
			float amount) throws ProfitMandiBusinessException{
42
		UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
42
		UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
43
		userWallet.setAmount(userWallet.getAmount() + Math.round(retailerId));
43
		userWallet.setAmount(userWallet.getAmount() + Math.round(amount));
44
		userWalletRepository.persist(userWallet);
44
		userWalletRepository.persist(userWallet);
45
		this.createUserWalletHistory(amount, userWallet.getId(), referenceId, referenceType, description);
45
		this.createUserWalletHistory(Math.round(amount), userWallet.getId(), referenceId, referenceType, description);
46
	}
46
	}
47
	
47
	
48
	@Override
48
	@Override
49
	public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
49
	public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
50
			String description, float amount) throws ProfitMandiBusinessException {
50
			String description, float amount) throws ProfitMandiBusinessException {