Subversion Repositories SmartDukaan

Rev

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

Rev 26423 Rev 26563
Line 233... Line 233...
233
	private ScanRecordRepository scanRecordRepository;
233
	private ScanRecordRepository scanRecordRepository;
234
 
234
 
235
	@Autowired
235
	@Autowired
236
	private JavaMailSender mailSender;
236
	private JavaMailSender mailSender;
237
 
237
 
238
	public void dropCorrection() throws Exception {
-
 
239
 
-
 
240
		walletService.rollbackAmountFromWallet(175128034, 274, 4, WalletReferenceType.PRICE_DROP,
-
 
241
				"Scheme  differential for Price Drop of Rs.712 on Samsung J6 J600GG, on 01-08-2018 for missing 1pc");
-
 
242
		walletService.rollbackAmountFromWallet(175128034, -259, 4, WalletReferenceType.PRICE_DROP,
-
 
243
				"Scheme  differential for Price Drop of Rs.712 on Samsung J6 J600GG, on 01-08-2018 for missing 1pc");
-
 
244
		List<InventoryItem> iis = inventoryItemRepository.selectByIds(new HashSet<>(Arrays.asList(3518, 3516)));
-
 
245
		schemeService.reverseSchemes(iis, 8,
-
 
246
				"Scheme  differential for Price Drop of Rs.712 on Samsung J6 J600GG, on 01-08-2018. Total 2 item(s)");
-
 
247
		List<InventoryItem> iis1 = inventoryItemRepository.selectByIds(new HashSet<>(Arrays.asList(3502, 3334, 3503)));
-
 
248
		schemeService.reverseSchemes(iis1, 13,
-
 
249
				"Scheme  differential for Price Drop of Rs.485 on Samsung Galaxy J4 J400FD, on 18-07-2018. Total 3 item(s)");
-
 
250
 
-
 
251
		List<InventoryItem> iis2 = inventoryItemRepository.selectByIds(new HashSet<>(Arrays.asList(3319)));
-
 
252
		schemeService.reverseSchemes(iis2, 13,
-
 
253
				"Scheme  differential for Price Drop of Rs.485 on Samsung Galaxy J4 J400FD, on 18-07-2018. Total 1 item(s)");
-
 
254
	}
-
 
255
 
-
 
256
	public void schemeRollback() throws Exception {
-
 
257
		Map<Integer, Float> fofoIdAmount = new HashMap<>();
-
 
258
		fofoIdAmount.put(175135218, 1942f);
-
 
259
		String description = "Price drop/differential rolled out as, they were already returned, Total 2pcs.";
-
 
260
		for (Map.Entry<Integer, Float> fofoIdAmountEntry : fofoIdAmount.entrySet()) {
-
 
261
			Integer fofoId = fofoIdAmountEntry.getKey();
-
 
262
			Float amount = fofoIdAmountEntry.getValue();
-
 
263
			walletService.rollbackAmountFromWallet(fofoId, amount, 4, WalletReferenceType.PRICE_DROP, description);
-
 
264
		}
-
 
265
		fofoIdAmount.put(175135218, 438f);
-
 
266
		for (Map.Entry<Integer, Float> fofoIdAmountEntry : fofoIdAmount.entrySet()) {
-
 
267
			Integer fofoId = fofoIdAmountEntry.getKey();
-
 
268
			Float amount = fofoIdAmountEntry.getValue();
-
 
269
			walletService.rollbackAmountFromWallet(fofoId, amount, 4, WalletReferenceType.PRICE_DROP, description);
-
 
270
		}
-
 
271
	}
-
 
272
 
238
 
273
	public void populateGrnTimestamp() {
239
	public void populateGrnTimestamp() {
274
		List<Purchase> allPurchases = purchaseRepository.selectAll();
240
		List<Purchase> allPurchases = purchaseRepository.selectAll();
275
		for (Purchase p : allPurchases) {
241
		for (Purchase p : allPurchases) {
276
			String invoiceNumber = p.getPurchaseReference();
242
			String invoiceNumber = p.getPurchaseReference();