Subversion Repositories SmartDukaan

Rev

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

Rev 27293 Rev 27294
Line 1010... Line 1010...
1010
				if(fofoOrder.getCreateTimestamp().isAfter(LocalDate.of(2020, 4, 1).atStartOfDay())) {
1010
				if(fofoOrder.getCreateTimestamp().isAfter(LocalDate.of(2020, 4, 1).atStartOfDay())) {
1011
					float invoiceWalletAmount = 0;
1011
					float invoiceWalletAmount = 0;
1012
					float invoiceSchemeReversalAmount = 0;
1012
					float invoiceSchemeReversalAmount = 0;
1013
					List<UserWalletHistory> userWalletHistory = userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(fofoOrder.getId(), WalletReferenceType.SCHEME_OUT);
1013
					List<UserWalletHistory> userWalletHistory = userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(fofoOrder.getId(), WalletReferenceType.SCHEME_OUT);
1014
					totalAmount += userWalletHistory.stream().collect(Collectors.summingInt(y->y.getAmount()));
1014
					totalAmount += userWalletHistory.stream().collect(Collectors.summingInt(y->y.getAmount()));
1015
					invoiceSchemeReversalAmount += userWalletHistory.stream().collect(Collectors.summingInt(y->y.getAmount()));
1015
					invoiceWalletAmount += userWalletHistory.stream().collect(Collectors.summingInt(y->y.getAmount()));
1016
					/*walletService.rollbackAmountFromWallet(fofoOrder.getFofoId(), totalAmount, fofoOrder.getId(), WalletReferenceType.SCHEME_OUT, 
1016
					/*walletService.rollbackAmountFromWallet(fofoOrder.getFofoId(), totalAmount, fofoOrder.getId(), WalletReferenceType.SCHEME_OUT, 
1017
							"Same order for Invoice-"+ invoiceNumber + "created twice, duplicate invoice rollback", fofoOrder.getCancelledTimestamp());*/
1017
							"Same order for Invoice-"+ invoiceNumber + "created twice, duplicate invoice rollback", fofoOrder.getCancelledTimestamp());*/
1018
					List<SchemeInOut> schemeInOuts = schemeInOutRepository.selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItemId)));
1018
					List<SchemeInOut> schemeInOuts = schemeInOutRepository.selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItemId)));
1019
					Set<Integer> schemeIds = new HashSet<>();
1019
					Set<Integer> schemeIds = new HashSet<>();
1020
					for(SchemeInOut sio : schemeInOuts) {
1020
					for(SchemeInOut sio : schemeInOuts) {