Subversion Repositories SmartDukaan

Rev

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

Rev 24776 Rev 24777
Line 315... Line 315...
315
			throws Exception {
315
			throws Exception {
316
		Map<Integer, Integer> transactionsOnThatDate = history.stream()
316
		Map<Integer, Integer> transactionsOnThatDate = history.stream()
317
				.filter(x -> x.getReferenceType().equals(WalletReferenceType.PURCHASE))
317
				.filter(x -> x.getReferenceType().equals(WalletReferenceType.PURCHASE))
318
				.collect(Collectors.groupingBy(x -> x.getReference(), Collectors.summingInt(x -> x.getAmount())));
318
				.collect(Collectors.groupingBy(x -> x.getReference(), Collectors.summingInt(x -> x.getAmount())));
319
 
319
 
320
		int totalWallet = 0;
320
		int totalWalletConsumed = 0;
321
		float cancelledAmount = 0;
321
		float cancelledAmount = 0;
322
		float returnedAmount = 0;
322
		float returnedAmount = 0;
323
		float totalDeductedAmount = 0;
323
		float totalDeductedAmount = 0;
324
		for (int transactionId : transactionsOnThatDate.keySet()) {
324
		for (int transactionId : transactionsOnThatDate.keySet()) {
325
			List<Order> orders = orderRepository.selectAllByTransactionId(transactionId);
325
			List<Order> orders = orderRepository.selectAllByTransactionId(transactionId);
Line 337... Line 337...
337
							returnedAmount += returnedOrder.getTotalPrice();
337
							returnedAmount += returnedOrder.getTotalPrice();
338
						}
338
						}
339
				}
339
				}
340
				totalDeductedAmount += o.getWalletAmount();
340
				totalDeductedAmount += o.getWalletAmount();
341
			}
341
			}
342
			totalWallet += transactionsOnThatDate.get(transactionId);
342
			totalWalletConsumed -= transactionsOnThatDate.get(transactionId);
343
		}
343
		}
344
 
344
 
345
		return Arrays.asList(localDate, totalWallet, cancelledAmount, returnedAmount, totalDeductedAmount);
345
		return Arrays.asList(localDate, totalWalletConsumed, totalDeductedAmount, cancelledAmount, returnedAmount);
346
 
346
 
347
	}
347
	}
348
 
348
 
349
	private void reconcileDailySchemeIn() {
349
	private void reconcileDailySchemeIn() {
350
 
350