Subversion Repositories SmartDukaan

Rev

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

Rev 23508 Rev 23511
Line 647... Line 647...
647
						totalCashback += inventoryItemCashback;
647
						totalCashback += inventoryItemCashback;
648
						itemsCount++;
648
						itemsCount++;
649
					}
649
					}
650
				}
650
				}
651
			}
651
			}
-
 
652
			LOGGER.info("Items count for purchase id {} is {}", purchaseId, itemsCount);
652
			if(itemsCount > 0) {
653
			if(itemsCount > 0) {
653
				walletService.addAmountToWallet(retailerId, purchaseId, WalletReferenceType.SCHEME_IN,
654
				walletService.addAmountToWallet(retailerId, purchaseId, WalletReferenceType.SCHEME_IN,
654
						"Added for SCHEME IN against invoice " + purchase.getPurchaseReference() + " (total " + itemsCount + " pcs)", totalCashback);
655
						"Added for SCHEME IN against invoice " + purchase.getPurchaseReference() + " (total " + itemsCount + " pcs)", totalCashback);
655
				LOGGER.info("Added Rs.{} for SCHEME IN against invoice {} total pcs({}) {}", totalCashback, purchase.getPurchaseReference(), itemsCount);
656
				LOGGER.info("Added Rs.{} for SCHEME IN against invoice {} total pcs({}) {}", totalCashback, purchase.getPurchaseReference(), itemsCount);
656
				purchase.setCashback(purchase.getCashback() + totalCashback);
657
				purchase.setCashback(purchase.getCashback() + totalCashback);
Line 812... Line 813...
812
			schemeInOut.setRolled_back_timestamp(LocalDateTime.now());
813
			schemeInOut.setRolled_back_timestamp(LocalDateTime.now());
813
			schemeInOutRepository.persist(schemeInOut);
814
			schemeInOutRepository.persist(schemeInOut);
814
			amountToRollback += schemeInOut.getAmount();
815
			amountToRollback += schemeInOut.getAmount();
815
		}
816
		}
816
		walletService.rollbackAmountFromWallet(inventoryItems.get(0).getFofoId(), amountToRollback, rollbackReference, WalletReferenceType.SCHEME_IN, rollbackReason);
817
		walletService.rollbackAmountFromWallet(inventoryItems.get(0).getFofoId(), amountToRollback, rollbackReference, WalletReferenceType.SCHEME_IN, rollbackReason);
817
		
-
 
818
	}
818
	}
819
 
819
 
820
}
820
}