Subversion Repositories SmartDukaan

Rev

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

Rev 26035 Rev 26037
Line 222... Line 222...
222
	@Override
222
	@Override
223
	public void refundToWallet(Integer retailerId, Float amountToRefund, Integer transactionId,
223
	public void refundToWallet(Integer retailerId, Float amountToRefund, Integer transactionId,
224
			WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException {
224
			WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException {
225
 
225
 
226
		List<UserWalletHistory> all_entries = userWalletHistoryRepository
226
		List<UserWalletHistory> all_entries = userWalletHistoryRepository
227
				.selectAllByreferenceIdandreferenceType(transactionId, WalletReferenceType.PURCHASE);
227
				.selectAllByreferenceIdandreferenceType(transactionId, walletReferenceType);
228
		UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
228
		UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
229
		int walletAmount = walletService.getWalletAmount(retailerId);
229
		int walletAmount = walletService.getWalletAmount(retailerId);
230
		LOGGER.info("userWallet" + userWallet);
230
		LOGGER.info("userWallet" + userWallet);
231
		int creditable_amount_for_reference = 0;
231
		int creditable_amount_for_reference = 0;
232
 
232
 
Line 250... Line 250...
250
		LOGGER.info("userWallet" + userWallet);
250
		LOGGER.info("userWallet" + userWallet);
251
 
251
 
252
		UserWalletHistory userWalletHistory = new UserWalletHistory();
252
		UserWalletHistory userWalletHistory = new UserWalletHistory();
253
		userWalletHistory.setAmount(Math.round(amountToRefund));
253
		userWalletHistory.setAmount(Math.round(amountToRefund));
254
		userWalletHistory.setReference(transactionId);
254
		userWalletHistory.setReference(transactionId);
255
		userWalletHistory.setReferenceType(WalletReferenceType.PURCHASE);
255
		userWalletHistory.setReferenceType(walletReferenceType);
256
		userWalletHistory.setWalletId(userWallet.getId());
256
		userWalletHistory.setWalletId(userWallet.getId());
257
		userWalletHistory.setTimestamp(LocalDateTime.now());
257
		userWalletHistory.setTimestamp(LocalDateTime.now());
258
		userWalletHistory.setDescription(description);
258
		userWalletHistory.setDescription(description);
259
 
259
 
260
		LOGGER.info("all_entries" + userWalletHistory);
260
		LOGGER.info("all_entries" + userWalletHistory);