Subversion Repositories SmartDukaan

Rev

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

Rev 22925 Rev 22955
Line 438... Line 438...
438
			}
438
			}
439
			notAllFofoOrderItemSchemesMap.put(fofoOrderItemSchemesEntry.getKey(), notAllSchemes);
439
			notAllFofoOrderItemSchemesMap.put(fofoOrderItemSchemesEntry.getKey(), notAllSchemes);
440
			allFofoOrderItemSchemesMap.put(fofoOrderItemSchemesEntry.getKey(), allSchemes);
440
			allFofoOrderItemSchemesMap.put(fofoOrderItemSchemesEntry.getKey(), allSchemes);
441
		}
441
		}
442
		
442
		
443
		//Map<Integer, Set<FofoLineItem>> allFofoOrderItemIdFofoLineItemsMap = this.toFofoOrderItemIdFofoLineItems(allFofoOrderItemSchemesMap.keySet());
-
 
444
		
-
 
445
		for(Map.Entry<FofoOrderItem, Set<Scheme>> allFofoOrderItemSchemesEntry : allFofoOrderItemSchemesMap.entrySet()){
443
		for(Map.Entry<FofoOrderItem, Set<Scheme>> allFofoOrderItemSchemesEntry : allFofoOrderItemSchemesMap.entrySet()){
446
			for(FofoLineItem fofoLineItem : allFofoOrderItemSchemesEntry.getKey().getFofoLineItems()){
444
			for(FofoLineItem fofoLineItem : allFofoOrderItemSchemesEntry.getKey().getFofoLineItems()){
447
				for(Scheme scheme : allFofoOrderItemSchemesEntry.getValue()){
445
				for(Scheme scheme : allFofoOrderItemSchemesEntry.getValue()){
448
					float cashback = this.createSchemeInOut(scheme, inventoryItemIdInventoryItemMap.get(fofoLineItem.getInventoryItemId()));
446
					float cashback = this.createSchemeInOut(scheme, inventoryItemIdInventoryItemMap.get(fofoLineItem.getInventoryItemId()));
449
					totalCashback = totalCashback + cashback;
447
					totalCashback = totalCashback + cashback;
Line 454... Line 452...
454
		Set<Integer> schemeIds = this.fofoLineItemSchemesMapToSchemeIds(notAllFofoOrderItemSchemesMap);
452
		Set<Integer> schemeIds = this.fofoLineItemSchemesMapToSchemeIds(notAllFofoOrderItemSchemesMap);
455
		
453
		
456
		if(!schemeIds.isEmpty()){
454
		if(!schemeIds.isEmpty()){
457
			List<Integer> foundSchemeIds = retailerSchemeRepository.selectSchemeIds(schemeIds, retailerId);
455
			List<Integer> foundSchemeIds = retailerSchemeRepository.selectSchemeIds(schemeIds, retailerId);
458
			
456
			
459
			//Map<Integer, Set<FofoLineItem>> notAllFofoOrderItemIdFofoLineItemsMap = this.toFofoOrderItemIdFofoLineItems(allFofoOrderItemSchemesMap.keySet());
-
 
460
			
-
 
461
			for(Map.Entry<FofoOrderItem, Set<Scheme>> notAllFofoOrderItemSchemesEntry : notAllFofoOrderItemSchemesMap.entrySet()){
457
			for(Map.Entry<FofoOrderItem, Set<Scheme>> notAllFofoOrderItemSchemesEntry : notAllFofoOrderItemSchemesMap.entrySet()){
462
				for(FofoLineItem fofoLineItem : notAllFofoOrderItemSchemesEntry.getKey().getFofoLineItems()){
458
				for(FofoLineItem fofoLineItem : notAllFofoOrderItemSchemesEntry.getKey().getFofoLineItems()){
463
					for(Scheme scheme : notAllFofoOrderItemSchemesEntry.getValue()){
459
					for(Scheme scheme : notAllFofoOrderItemSchemesEntry.getValue()){
464
						if(foundSchemeIds.contains(scheme.getId())){
460
						if(foundSchemeIds.contains(scheme.getId())){
465
							float cashback = this.createSchemeInOut(scheme, inventoryItemIdInventoryItemMap.get(fofoLineItem.getInventoryItemId()));
461
							float cashback = this.createSchemeInOut(scheme, inventoryItemIdInventoryItemMap.get(fofoLineItem.getInventoryItemId()));