Subversion Repositories SmartDukaan

Rev

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

Rev 28518 Rev 28596
Line 191... Line 191...
191
		for (UserWallet userWallet : userWallets) {
191
		for (UserWallet userWallet : userWallets) {
192
			retailerIdUserWalletMap.put(userWallet.getUserId(), userWallet);
192
			retailerIdUserWalletMap.put(userWallet.getUserId(), userWallet);
193
		}
193
		}
194
		return retailerIdUserWalletMap;
194
		return retailerIdUserWalletMap;
195
	}
195
	}
-
 
196
	
-
 
197
	@Override
-
 
198
	public Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> walletIds) {
-
 
199
		List<UserWallet> userWallets = userWalletRepository.selectAllById(walletIds);
-
 
200
		Map<Integer, Integer> walletRetailerMap = new HashMap<>();
-
 
201
		for (UserWallet userWallet : userWallets) {
-
 
202
			walletRetailerMap.put(userWallet.getId(), userWallet.getUserId());
-
 
203
		}
-
 
204
		return walletRetailerMap;
-
 
205
	}
196
 
206
 
197
	@Override
207
	@Override
198
	public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType)
208
	public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType)
199
			throws ProfitMandiBusinessException {
209
			throws ProfitMandiBusinessException {
200
		if (underMaintainance || !isActive(retailerId)) {
210
		if (underMaintainance || !isActive(retailerId)) {
Line 230... Line 240...
230
	@Override
240
	@Override
231
	public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException {
241
	public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException {
232
		UserWallet wallet = userWalletRepository.selectByRetailerId(fofoId);
242
		UserWallet wallet = userWalletRepository.selectByRetailerId(fofoId);
233
		return userWalletHistoryRepository.getSumTillDate(wallet.getId(), date) -userWalletHistoryRepository.getSumTillDate(wallet.getId(), date, WalletReferenceType.PURCHASE);
243
		return userWalletHistoryRepository.getSumTillDate(wallet.getId(), date) -userWalletHistoryRepository.getSumTillDate(wallet.getId(), date, WalletReferenceType.PURCHASE);
234
	}
244
	}
235
 
245
	
236
	@Override
246
	@Override
237
	public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
247
	public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
238
			WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException {
248
			WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException {
239
 
249
 
240
		List<UserWalletHistory> all_entries = userWalletHistoryRepository
250
		List<UserWalletHistory> all_entries = userWalletHistoryRepository
Line 289... Line 299...
289
			return new ArrayList<UserWalletHistory>();
299
			return new ArrayList<UserWalletHistory>();
290
		}
300
		}
291
		return userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(userWallet.getId(), reference,
301
		return userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(userWallet.getId(), reference,
292
				walletReferenceType);
302
				walletReferenceType);
293
	}
303
	}
294
 
-
 
295
}
304
}