Show a hyphen in supplier column if an article is not offered by anyone #56
@ -29,8 +29,8 @@ public class SupplierOfferController {
 | 
				
			|||||||
		List<UImodelOfferedArticle> totals = new ArrayList<>();
 | 
							List<UImodelOfferedArticle> totals = new ArrayList<>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (ArticleOffer article : offersRepository.findAll()) {
 | 
							for (ArticleOffer article : offersRepository.findAll()) {
 | 
				
			||||||
			UImodelOfferedArticle tmp = new UImodelOfferedArticle();
 | 
								UImodelOfferedArticle tmp = new UImodelOfferedArticle(article,
 | 
				
			||||||
			tmp.addData(article, articleRepository.findArticleIDByRelatedID(article.id));
 | 
										articleRepository.findArticleIDByRelatedID(article.id));
 | 
				
			||||||
			totals.add(tmp);
 | 
								totals.add(tmp);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -50,13 +50,17 @@ public class SupplierOfferController {
 | 
				
			|||||||
		public int listedArticleId;
 | 
							public int listedArticleId;
 | 
				
			||||||
		public boolean offerIsListed; // true --> offered article is listed
 | 
							public boolean offerIsListed; // true --> offered article is listed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public void addData(ArticleOffer article, Optional<Integer> listedArticleId) {
 | 
							public UImodelOfferedArticle(ArticleOffer article, Optional<Integer> listedArticleId) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			this.offerId = article.id;
 | 
								this.offerId = article.id;
 | 
				
			||||||
			this.title = article.title;
 | 
								this.title = article.title;
 | 
				
			||||||
			this.manufacturer = article.manufacturer;
 | 
								this.manufacturer = article.manufacturer;
 | 
				
			||||||
			this.articleNumber = article.articleNumber;
 | 
								this.articleNumber = article.articleNumber;
 | 
				
			||||||
			this.supplierName = article.cheapestSupplier.name;
 | 
								if (article.cheapestSupplier != null) {
 | 
				
			||||||
 | 
									this.supplierName = article.cheapestSupplier.name;
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
									this.supplierName = "-";
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			this.price = String.format("%.2f", ((float) article.pricePerUnitNet / 100));
 | 
								this.price = String.format("%.2f", ((float) article.pricePerUnitNet / 100));
 | 
				
			||||||
			this.ads = (article.shouldBeAdvertised) ? "Ja" : "Nein";
 | 
								this.ads = (article.shouldBeAdvertised) ? "Ja" : "Nein";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -44,7 +44,8 @@
 | 
				
			|||||||
                     <td><span th:text="${article.title}"></span></td>
 | 
					                     <td><span th:text="${article.title}"></span></td>
 | 
				
			||||||
                     <td><span th:text="${article.manufacturer}"></span></td>
 | 
					                     <td><span th:text="${article.manufacturer}"></span></td>
 | 
				
			||||||
                     <td><span th:text="${article.articleNumber}"></span></td>
 | 
					                     <td><span th:text="${article.articleNumber}"></span></td>
 | 
				
			||||||
                     <td><a th:href="${'/intern/suppliers/#q=' + article.supplierName}" th:text="${article.supplierName}"></a></td>
 | 
					                     <td th:if="${article.supplierName} == '-'">-</td>
 | 
				
			||||||
 | 
					                     <td th:unless="${article.supplierName} == '-'"><a th:href="${'/intern/suppliers/#q=' + article.supplierName}" th:text="${article.supplierName}"></a></td>
 | 
				
			||||||
                     <td><span th:text="${article.price}"></span> €</td>
 | 
					                     <td><span th:text="${article.price}"></span> €</td>
 | 
				
			||||||
                     <td><span th:text="${article.ads}"></span></td>
 | 
					                     <td><span th:text="${article.ads}"></span></td>
 | 
				
			||||||
                     <td>
 | 
					                     <td>
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user