Fix in stock calculation. closes #118
This commit is contained in:
		@ -52,7 +52,11 @@ public class ShopArticleController {
 | 
			
		||||
        }
 | 
			
		||||
        model.addAttribute("article", article);
 | 
			
		||||
 | 
			
		||||
        if (warehouseBookingPositionSlotEntryRepository.getByArticle(id).get(0).newSumSlot > 0) {   //check if in Stock
 | 
			
		||||
        if (warehouseBookingPositionSlotEntryRepository
 | 
			
		||||
                .getByArticle(id)
 | 
			
		||||
                .stream()
 | 
			
		||||
                .mapToInt(e -> e.newSumSlot)
 | 
			
		||||
                .sum() > 0) {   //check if in Stock
 | 
			
		||||
            model.addAttribute("inStock", true);
 | 
			
		||||
        } else {
 | 
			
		||||
            model.addAttribute("inStock", false);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user