Subversion Repositories SmartDukaan

Rev

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

Rev 25268 Rev 25503
Line 514... Line 514...
514
 
514
 
515
	private Scheme getScheme() {
515
	private Scheme getScheme() {
516
		Scheme s = new Scheme();
516
		Scheme s = new Scheme();
517
		s.setName("List Price Margin");
517
		s.setName("List Price Margin");
518
		s.setDescription("List Price Margin");
518
		s.setDescription("List Price Margin");
519
		s.setRetailerAll(true);
-
 
520
		s.setActiveTimestamp(null);
519
		s.setActiveTimestamp(null);
521
		s.setStartDateTime(LocalDate.of(2019, 6, 1).atStartOfDay());
520
		s.setStartDateTime(LocalDate.of(2019, 6, 1).atStartOfDay());
522
		s.setEndDateTime(LocalDate.of(2019, 7, 1).atStartOfDay());
521
		s.setEndDateTime(LocalDate.of(2019, 7, 1).atStartOfDay());
523
		s.setAmountType(AmountType.PERCENTAGE);
522
		s.setAmountType(AmountType.PERCENTAGE);
524
		s.setCreateTimestamp(LocalDateTime.now());
523
		s.setCreateTimestamp(LocalDateTime.now());
Line 607... Line 606...
607
		// throw new Exception();
606
		// throw new Exception();
608
	}
607
	}
609
 
608
 
610
	public void fixSchemePayouts() throws Exception {
609
	public void fixSchemePayouts() throws Exception {
611
 
610
 
612
		LocalDateTime startDate = LocalDate.of(2019, 07, 01).atStartOfDay();
611
		LocalDateTime startDate = LocalDate.of(2019, 04, 01).atStartOfDay();
613
		List<SchemeInOut> sios = schemeInOutRepository.selectAllByCreateDate(startDate, startDate.plusDays(15));
612
		List<SchemeInOut> sios = schemeInOutRepository.selectAllByCreateDate(startDate, LocalDateTime.now());
614
 
613
 
615
		for (SchemeInOut sio : sios) {
614
		for (SchemeInOut sio : sios) {
616
			genericRepository.delete(sio);
615
			genericRepository.delete(sio);
617
			InventoryItem ii = inventoryItemRepository.selectById(sio.getInventoryItemId());
616
			InventoryItem ii = inventoryItemRepository.selectById(sio.getInventoryItemId());
618
			UserWallet userWallet = userWalletRepository.selectByRetailerId(ii.getFofoId());
617
			UserWallet userWallet = userWalletRepository.selectByRetailerId(ii.getFofoId());