Merge pull request 'feature/offeredArticle' (#23) from feature/offeredArticle into master

Reviewed-by: Jannik Seiler <seil0@mosad.xyz>
This commit is contained in:
Jannik 2020-05-21 20:25:53 +02:00
commit 32c6b8cb68
10 changed files with 464 additions and 356 deletions

View File

@ -1,5 +1,5 @@
INSERT INTO article_offers ("manufacturer", "article_number", "vat_percent", "should_be_advertised") INSERT INTO article_offers ("manufacturer", "article_number", "price_per_unit_net", "title", "vat_percent", "should_be_advertised")
VALUES ("McDonalds", "1", 7, 1); VALUES ("McDonalds", "1", 4242, "McPizza", 7, 1);
INSERT INTO articles ("related_id", "shop_price_per_unit_net_cent", "warehouse_units_per_slot", "should_reorder", "reorder_max_price", "title", "description", "image_id") INSERT INTO articles ("related_id", "shop_price_per_unit_net_cent", "warehouse_units_per_slot", "should_reorder", "reorder_max_price", "title", "description", "image_id")
VALUES (1, 19.99, 10, 1, 15, "Huge Hamburger", "This huge Hamburger is awesome!", NULL); VALUES (1, 19.99, 10, 1, 15, "Huge Hamburger", "This huge Hamburger is awesome!", NULL);

View File

@ -5,8 +5,10 @@ import java.util.List;
import org.hso.ecommerce.entities.shop.Article; import org.hso.ecommerce.entities.shop.Article;
import org.hso.ecommerce.entities.shop.Category; import org.hso.ecommerce.entities.shop.Category;
import org.hso.ecommerce.entities.supplier.ArticleOffer;
import org.hso.ecommerce.repos.shop.ArticleRepository; import org.hso.ecommerce.repos.shop.ArticleRepository;
import org.hso.ecommerce.repos.shop.CategoryRepository; import org.hso.ecommerce.repos.shop.CategoryRepository;
import org.hso.ecommerce.repos.shop.OffersRepository;
import org.hso.ecommerce.repos.warehouse.WarehouseBookingPositionSlotEntryRepository; import org.hso.ecommerce.repos.warehouse.WarehouseBookingPositionSlotEntryRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -26,6 +28,9 @@ public class InternArticleController {
@Autowired @Autowired
private final CategoryRepository categoryRepository = null; private final CategoryRepository categoryRepository = null;
@Autowired
private final OffersRepository offersRepository = null;
@GetMapping("/") @GetMapping("/")
public String internListedArticles(Model model) { public String internListedArticles(Model model) {
@ -57,39 +62,65 @@ public class InternArticleController {
} }
@PostMapping("/{id}/saveChanges") @PostMapping("/{id}/saveChanges")
public RedirectView saveChanges( public RedirectView saveChanges(@PathVariable(required = true) int id,
@PathVariable int id, @RequestParam(value = "title", required = true) String title,
@RequestParam("title") String title, @RequestParam(value = "description", required = true) String description,
@RequestParam("description") String description, @RequestParam(value = "units-per-slot", required = true) String warehouseUnitsPerSlot,
@RequestParam("units-per-slot") String warehouseUnitsPerSlot, @RequestParam(value = "price_netto", required = true) String pricenetto,
@RequestParam("price_netto") String pricenetto, @RequestParam(value = "reorderMaxPrice", required = true) String reorderMaxPrice,
@RequestParam("reorderMaxPrice") String reorderMaxPrice, @RequestParam(value = "autobuy", required = true) Boolean shouldReorder,
@RequestParam("autobuy") Boolean shouldReorder, @RequestParam(value = "categories", required = true) String categories) {
@RequestParam("categories") String categories) {
Article oldArticle = articleRepository.findArticleById(id); Article tmpArticle = articleRepository.findArticleById(id); // get the old article
// TODO img // TODO img
String[] separatedCategories = categories.split("\n"); String[] separatedCategories = categories.split("\n");
oldArticle.categories.clear(); tmpArticle.categories.clear();
// loop through all categories strings and create a new category if a new one; also adds the categorys to the article // loop through all categories strings and create a new category if a new one;
// also adds the categorys to the article
for (String category : separatedCategories) { for (String category : separatedCategories) {
oldArticle.categories.add(categoryRepository.findCategoryByName(category.trim()) tmpArticle.categories.add(categoryRepository.findCategoryByName(category.trim())
.orElseGet(() -> new Category(category.trim()))); .orElseGet(() -> new Category(category.trim())));
} }
oldArticle.shouldReorder = shouldReorder; tmpArticle.shouldReorder = shouldReorder;
oldArticle.reorderMaxPrice = (int) (Float.parseFloat(reorderMaxPrice) * 100); tmpArticle.reorderMaxPrice = (int) (Float.parseFloat(reorderMaxPrice) * 100);
oldArticle.shopPricePerUnitNetCent = (int) (Float.parseFloat(pricenetto) * 100); tmpArticle.shopPricePerUnitNetCent = (int) (Float.parseFloat(pricenetto) * 100);
oldArticle.warehouseUnitsPerSlot = Integer.parseInt(warehouseUnitsPerSlot); tmpArticle.warehouseUnitsPerSlot = Integer.parseInt(warehouseUnitsPerSlot);
oldArticle.title = title; tmpArticle.title = title;
oldArticle.description = description; tmpArticle.description = description;
articleRepository.save(oldArticle); // save updated article articleRepository.save(tmpArticle); // save updated article
return new RedirectView("../"); // return to overview page return new RedirectView("../"); // return to overview page
}
@PostMapping("/addArticle/{id}")
public RedirectView addArticle(@PathVariable(required = true) String id) {
// article is not already listed, create new one
int offeredArticleID = Integer.parseInt(id);
Article tmpArticle = new Article();
ArticleOffer offeredArticle = offersRepository.findOfferedArticleById(offeredArticleID);
// set default values
tmpArticle.description = "";
tmpArticle.reorderMaxPrice = 0;
tmpArticle.shopPricePerUnitNetCent = offeredArticle.pricePerUnitNet;
tmpArticle.shouldReorder = false;
tmpArticle.title = offeredArticle.title;
tmpArticle.warehouseUnitsPerSlot = 1;
tmpArticle.image = articleRepository.findAll().get(0).image; // TODO set any static default image
tmpArticle.related = offeredArticle;
articleRepository.save(tmpArticle); // save new article
// return to edit article page
return new RedirectView("../" + articleRepository.findArticleIDByRelatedID(offeredArticleID).get());
} }
public static class UImodelArticles { public static class UImodelArticles {
@ -115,13 +146,13 @@ public class InternArticleController {
this.title = article.title; this.title = article.title;
this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100));
this.price = String.format("%.2f", ((float) article.getPriceGross() / 100)); this.price = String.format("%.2f", ((float) article.getPriceGross() / 100));
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
for (Category temp : article.categories) { for (Category temp : article.categories) {
result.append(temp.name + " "); result.append(temp.name + " ");
} }
this.categorie = result.toString(); this.categorie = result.toString();
this.stock = stock; this.stock = stock;
this.offer_id = article.related.id; this.offer_id = article.related.id;
@ -143,8 +174,7 @@ public class InternArticleController {
public boolean shouldReorder; public boolean shouldReorder;
public String warehouseUnitsPerSlot; public String warehouseUnitsPerSlot;
public String description; public String description;
public String getImgPath() { public String getImgPath() {
return imgPath; return imgPath;
} }
@ -246,15 +276,15 @@ public class InternArticleController {
this.title = article.title; this.title = article.title;
this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100)); this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100));
this.price = String.format("%.2f", ((float) article.getPriceGross() / 100)); this.price = String.format("%.2f", ((float) article.getPriceGross() / 100));
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
for (Category temp : article.categories) { for (Category temp : article.categories) {
result.append(temp.name); result.append(temp.name);
result.append("\n"); result.append("\n");
} }
this.categorie = result.toString(); this.categorie = result.toString();
this.stock = stock; this.stock = stock;
this.offer_id = article.related.id; this.offer_id = article.related.id;
this.id = article.id; this.id = article.id;

View File

@ -1,5 +1,13 @@
package org.hso.ecommerce.controller.intern.suppliers; package org.hso.ecommerce.controller.intern.suppliers;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.hso.ecommerce.entities.supplier.ArticleOffer;
import org.hso.ecommerce.repos.shop.ArticleRepository;
import org.hso.ecommerce.repos.shop.OffersRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -9,18 +17,140 @@ import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping("/intern/") @RequestMapping("/intern/")
public class SupplierOfferController { public class SupplierOfferController {
@Autowired
private final OffersRepository offersRepository = null;
@Autowired
private final ArticleRepository articleRepository = null;
@GetMapping("supplierOffers") @GetMapping("supplierOffers")
public String internListedArticles(Model model) { public String internListedArticles(Model model) {
List<UImodelOfferedArticle> totals = new ArrayList<UImodelOfferedArticle>();
return "intern/offeredArticles/index";
for (ArticleOffer article : offersRepository.findAll()) {
UImodelOfferedArticle tmp = new UImodelOfferedArticle();
tmp.addData(article, "supplierName01", 4884, articleRepository.findArticleIDByRelatedID(article.id)); //TODO display supplier name with link
totals.add(tmp);
}
model.addAttribute("OfferedArticles", totals);
return "intern/offeredArticles/index";
} }
public class UImodelOfferedArticle {
long offer_id;
String title;
String manufacturer;
String articlenumber;
String supplierName;
int supplierId;
String price;
String ads;
int listedArticleId;
boolean offerIsListed; //true --> offered article is listed
public long getOffer_id() {
return offer_id;
}
public void setOffer_id(long offer_id) {
this.offer_id = offer_id;
}
public boolean isOfferIsListed() {
return offerIsListed;
}
public void setOfferIsListed(boolean offerIsListed) {
this.offerIsListed = offerIsListed;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public String getArticlenumber() {
return articlenumber;
}
public void setArticlenumber(String articlenumber) {
this.articlenumber = articlenumber;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public int getSupplierId() {
return supplierId;
}
public void setSupplierId(int supplierId) {
this.supplierId = supplierId;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getAds() {
return ads;
}
public void setAds(String ads) {
this.ads = ads;
}
public int getListedArticleId() {
return listedArticleId;
}
public void setListedArticleId(int listedArticleId) {
this.listedArticleId = listedArticleId;
}
public void addData(ArticleOffer article, String supplierName, int supplierId,
Optional<Integer> listedArticleId) {
this.offer_id = article.id;
this.title = article.title;
this.manufacturer = article.manufacturer;
this.articlenumber = article.articleNumber;
this.supplierName = supplierName;
this.supplierId = supplierId;
this.price = String.format("%.2f", ((float) article.pricePerUnitNet / 100));
this.ads = (article.shouldBeAdvertised) ? "Ja" : "Nein";
if (listedArticleId.isPresent()) {
// this offer is listed --> show link
this.listedArticleId = listedArticleId.get();
offerIsListed = true;
} else {
// this offer is not listed
offerIsListed = false;
}
}
}
} }

View File

@ -14,6 +14,12 @@ public class ArticleOffer {
@NotNull @NotNull
public String manufacturer; public String manufacturer;
@NotNull
public String title;
@NotNull
public int pricePerUnitNet;
@NotNull @NotNull
public String articleNumber; public String articleNumber;
@ -21,4 +27,6 @@ public class ArticleOffer {
public int vatPercent; public int vatPercent;
public boolean shouldBeAdvertised; public boolean shouldBeAdvertised;
} }

View File

@ -7,6 +7,7 @@ import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
import java.util.Optional;
@Repository @Repository
public interface ArticleRepository extends JpaRepository<Article, Long> { public interface ArticleRepository extends JpaRepository<Article, Long> {
@ -26,6 +27,9 @@ public interface ArticleRepository extends JpaRepository<Article, Long> {
@Query("SELECT a FROM CustomerOrderPosition cop JOIN cop.order co JOIN co.customer c JOIN cop.article a WHERE c.id = :customerId ORDER BY co.id DESC") @Query("SELECT a FROM CustomerOrderPosition cop JOIN cop.order co JOIN co.customer c JOIN cop.article a WHERE c.id = :customerId ORDER BY co.id DESC")
List<Article> getOrderedArticles(long customerId); List<Article> getOrderedArticles(long customerId);
@Query(value = "SELECT a.id FROM articles a WHERE a.related_id = :relatedId", nativeQuery = true)
Optional<Integer> findArticleIDByRelatedID(@Param("relatedId") long relatedId);
@Query(value = "Select a.* from articles as a, warehouse_booking_position_entries as wbpe where wbpe.article_id = a.id and a.title LIKE %:term% group by wbpe.slot_id having max(wbpe.id) and wbpe.new_sum_slot != 0", nativeQuery = true) @Query(value = "Select a.* from articles as a, warehouse_booking_position_entries as wbpe where wbpe.article_id = a.id and a.title LIKE %:term% group by wbpe.slot_id having max(wbpe.id) and wbpe.new_sum_slot != 0", nativeQuery = true)
List<Article> getArticlesByTerm(String term); List<Article> getArticlesByTerm(String term);

View File

@ -0,0 +1,20 @@
package org.hso.ecommerce.repos.shop;
import java.util.List;
import org.hso.ecommerce.entities.supplier.ArticleOffer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
@Repository
public interface OffersRepository extends JpaRepository<ArticleOffer, Long> {
@Query("SELECT a FROM ArticleOffer a")
List<ArticleOffer> findAll();
@Query("SELECT a FROM ArticleOffer a WHERE a.id = :offeredarticleId")
ArticleOffer findOfferedArticleById(@Param("offeredarticleId") long offeredarticleId);
}

View File

@ -15,7 +15,7 @@ public interface WarehouseBookingPositionSlotEntryRepository extends JpaReposito
List<WarehouseBookingPositionSlotEntry> getByArticle(long article); List<WarehouseBookingPositionSlotEntry> getByArticle(long article);
@Query(value = "SELECT SUM(w.new_sum_articles) FROM warehouse_booking_position_entries as w WHERE w.article_id = :articleid", nativeQuery = true) @Query(value = "SELECT SUM(w.new_sum_slot) FROM warehouse_booking_position_entries as w WHERE w.article_id = :articleid", nativeQuery = true)
Optional<Integer> getArticleStock(long articleid); Optional<Integer> getArticleStock(long articleid);
} }

View File

@ -1,118 +1,109 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org"> <html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
<head> <meta charset="utf-8">
<meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no"> <title>Bearbeiten: Artikel</title>
<script th:src="@{/js/filterTable.js}"></script>
<title>Bearbeiten: Artikel</title> <link rel="stylesheet" th:href="@{/css/ecom.css}"/>
<script th:src="@{/js/filterTable.js}"></script> </head>
<link rel="stylesheet" th:href="@{/css/ecom.css}"/> <body>
</head> <nav th:replace="fragments/header :: header">Header</nav>
<div class="sidebar-layout content-width">
<body> <nav></nav>
<nav th:replace="fragments/header :: header">Header</nav> <div>
<div class="sidebar-layout content-width"> <h1>Artikel bearbeiten</h1>
<nav></nav> <script th:src="@{/js/back.js}"></script>
<div> <div class="back" data-group="intern" data-insert="true"></div>
<h1>Artikel bearbeiten</h1> </div>
</div>
<script th:src="@{/js/back.js}"></script> <main class="sidebar-layout content-width">
<div class="back" data-group="intern" data-insert="true"></div> <nav th:replace="fragments/intern :: sidebar"></nav>
</div> <div class="content-width">
</div> <h2>Gelisteter Artikel ID <span th:text="${ArticleID.id}"></span></h2>
<main class="sidebar-layout content-width"> <form class="detailgrid" action="#" th:action="@{/intern/articles/{id}/saveChanges(id = ${ArticleID.id})}" th:object="${ArticleID}" method="POST" enctype="multipart/form-data">
<nav th:replace="fragments/intern :: sidebar"></nav> <p class="m">
<div class="content-width"> <label for="title">Titel</label>
<h2>Gelisteter Artikel ID <span th:text="${ArticleID.id}"></span></h2> <input class=" full-width" type="text" id="title" name="title" th:value="${ArticleID.title}"/>
</p>
<p class="s">
<form class="detailgrid" action="#" th:action="@{/intern/articles/{id}/saveChanges(id = ${ArticleID.id})}" th:object="${ArticleID}" method="POST" enctype="multipart/form-data"> <label for="ref-article">Refernzierter Artikel</label>
<input class="" type="text" id="ref_disabled" th:value="${ArticleID.offer_id}" disabled/>
<p class="m">
<label for="title">Titel</label> <input type="hidden" id="ref_hidden" th:value="${ArticleID.offer_id}" name="ref-article" />
<input class=" full-width" type="text" name="title" th:value="${ArticleID.title}"/>
</p> <td><a th:href="${'/intern/supplierOffers/#q=' + {ArticleID.id}}">Details</a></td>
<p class="s"> </p>
<label for="ref-article">Refernzierter Artikel</label> <div class="spacer"></div>
<input class="" type="text" name="ref-article" th:value="${ArticleID.offer_id}" disabled/> <div class="m">
<td><a th:href="@{/intern/suppliers/articles/{id}(id = ${ArticleID.offer_id})}">Details</a></td> <p>
</p> <label for="img">Bild Hochladen</label>
<div class="spacer"></div> <input class="full-width" type="file" id="image" name="img"/>
<div class="m"> </p>
<p> <p>
<label for="img">Bild Hochladen</label> <img th:src="@{/shop/articles/{id}/image.jpg(id=${ArticleID.id})}" class="m"/>
<input class="full-width" type="file" name="img"/> </p>
</p> </div>
<p> <div class="s">
<img th:src="@{/shop/articles/{id}/image.jpg(id=${ArticleID.id})}" class="m"/> <p>
</p> <label for="price">Preis (Netto)</label>
</div> <input class="" type="number" step="0.01" name="price_netto" th:value="${ArticleID.price_netto}"/>&nbsp;EUR <br/>
<div class="s"> (19% Mwst.)
<p> <!-- Info von article ref--> <br/>
<label for="price">Preis (Netto)</label> = <span th:text="${ArticleID.price}"></span>&nbsp;EUR Brutto
<input class="" type="number" step="0.01" name="price_netto" th:value="${ArticleID.price_netto}"/>&nbsp;EUR <br/> </p>
(19% Mwst.) <p>
<!-- Info von article ref--> <br/> <label for="max-price-buy">Maximaler Einkaufspreis (Netto)</label>
= <span th:text="${ArticleID.price}"></span>&nbsp;EUR Brutto <input class="" type="number" id="reorderMaxPrice" step="0.01" name="reorderMaxPrice" th:value="${ArticleID.reorderMaxPrice}"/>&nbsp;EUR
</p> </p>
<p> <div>
<label for="max-price-buy">Maximaler Einkaufspreis (Netto)</label> <fieldset>
<input class="" type="number" step="0.01" name="reorderMaxPrice" th:value="${ArticleID.reorderMaxPrice}"/>&nbsp;EUR
</p>
<div>
<fieldset>
<input type="radio" name="autobuy" value="true" id="autobuy-yes" th:checked="${ArticleID.shouldReorder}" required> <input type="radio" name="autobuy" value="true" id="autobuy-yes" th:checked="${ArticleID.shouldReorder}" required>
<label for="autobuy-yes"> Automatisch nachbestellen.</label> <br/> <label for="autobuy-yes"> Automatisch nachbestellen.</label> <br/>
<input type="radio" name="autobuy" value="false" id="autobuy-no" th:checked="${!ArticleID.shouldReorder}" required> <input type="radio" name="autobuy" value="false" id="autobuy-no" th:checked="${!ArticleID.shouldReorder}" required>
<label for="autobuy-no"> Nicht mehr nachkaufen.</label> <br/> <label for="autobuy-no"> Nicht mehr nachkaufen.</label> <br/>
</fieldset> </fieldset>
</div> </div>
</div> </div>
<div class="m">
<div class="m"> <label for="tags">Kategorien</label>
<label for="tags">Kategorien</label> <p>
<p> Bitte jede Kategorien in eine eigene Zeile
Bitte jede Kategorien in eine eigene Zeile </p>
</p> <textarea name="categories" id="categories" class="full-width" rows="6"th:inline="text">[[${ArticleID.categorie}]]
<textarea name="categories" class="full-width" rows="6"th:inline="text">[[${ArticleID.categorie}]]
</textarea> </textarea>
</div> </div>
<div class="s">
<div class="s"> <p>
<p> <label for="price">Einheiten pro Lagerplatz</label>
<label for="price">Einheiten pro Lagerplatz</label> <input class="" type="number" id="units-per-slot" name="units-per-slot" th:value="${ArticleID.warehouseUnitsPerSlot}"/>
<input class="" type="number" name="units-per-slot" th:value="${ArticleID.warehouseUnitsPerSlot}"/> </p>
</p> <p>
<p> <b>Lagerbestand: <span th:text="${ArticleID.stock}"></span></b>
<b>Lagerbestand: <span th:text="${ArticleID.stock}"></span></b> </p>
</p> <p>
<p> Der Wert wird nur für zukünftige Lagerbuchungen verwendet.
Der Wert wird nur für zukünftige Lagerbuchungen verwendet. Bei Problemen kann können Einheiten aus- und wieder eingebucht werden.
Bei Problemen kann können Einheiten aus- und wieder eingebucht werden. <!-- TODO: set link g-->
<!-- TODO: set link g--> </p>
</p> <p>
<p> <a href="/todo" class="button smaller">Lagerbuchung</a>
<a href="/todo" class="button smaller">Lagerbuchung</a> </p>
</div>
</p> <p class="l">
</div> <label for="description">Beschreibung</label>
<textarea name="description" id="description" class="full-width" rows="15" th:inline="text">[[${ArticleID.description}]]
<p class="l"> </textarea>
<label for="description">Beschreibung</label> </p>
<textarea name="description" class="full-width" rows="15" th:inline="text">[[${ArticleID.description}]] <div class="l">
</textarea> <button type="submit">Änderungen speichern</button>
</p> <button type="reset">Zurücksetzen</button>
<div class="l"> <button onclick="history.back()">Änderungen verwerfen</button>
<button type="submit">Änderungen speichern</button> </div>
<button type="reset">Zurücksetzen</button> </form>
<button onclick="history.back()">Änderungen verwerfen</button> </div>
</div> </main>
</form> <footer th:replace="fragments/footer :: footer"></footer>
</div> </body>
</main>
<footer th:replace="fragments/footer :: footer"></footer>
</body>
</html> </html>

View File

@ -1,73 +1,69 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org"> <html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
<head> <meta charset="utf-8">
<meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no"> <title>Gelistete Artikel</title>
<script th:src="@{/js/filterTable.js}"></script>
<title>Gelistete Artikel</title> <link rel="stylesheet" th:href="@{/css/ecom.css}"/>
<script th:src="@{/js/filterTable.js}"></script> </head>
<link rel="stylesheet" th:href="@{/css/ecom.css}"/> <body>
</head> <nav th:replace="fragments/header :: header">Header</nav>
<div class="sidebar-layout content-width">
<body> <nav></nav>
<nav th:replace="fragments/header :: header">Header</nav> <div>
<div class="sidebar-layout content-width"> <h1>Gelistete Artikel</h1>
<nav></nav> <script th:src="@{/js/back.js}"></script>
<div> <div class="back" data-group="intern" data-name="Zurück zu den gelisteten Artikeln." data-insert="false"></div>
<h1>Gelistete Artikel</h1> </div>
</div>
<script th:src="@{/js/back.js}"></script> <main class="sidebar-layout content-width">
<div class="back" data-group="intern" data-name="Zurück zu den gelisteten Artikeln." data-insert="false"></div> <nav th:replace="fragments/intern :: sidebar"></nav>
</div> <div class="content-width">
</div> <p>
<main class="sidebar-layout content-width"> Weitere Artikel können über Artikelübersicht der Lieferanten hinzugefügt werden.
<nav th:replace="fragments/intern :: sidebar"></nav> <a class="button smaller" th:href="@{/intern/supplierOffers}"> Jetzt Hinzufügen </a>
<div class="content-width"> </p>
<p> <p>
Weitere Artikel können über Artikelübersicht der Lieferanten hinzugefügt werden. <table id="main-table">
<a class="button smaller" th:href="@{/intern/supplierOffers}"> Jetzt Hinzufügen </a> <tr>
</p> <th colspan="9">
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
<p> data-target-id="main-table"></input>
<table id="main-table"> </th>
<tr> </tr>
<th colspan="9"> <thead>
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width" <tr>
data-target-id="main-table"></input> <th>Bild</th>
</th> <th>Name</th>
</tr> <th>Preis</th>
<thead> <th>(Netto)</th>
<tr> <th>Kategorien</th>
<th>Bild</th> <th>Lagerbestand</th>
<th>Name</th> <th>Angebots ID</th>
<th>Preis</th> <th>Artikel ID</th>
<th>(Netto)</th> <th>Aktion</th>
<th>Kategorien</th> </tr>
<th>Lagerbestand</th> </thead>
<th>Angebots ID</th> <tbody>
<th>Artikel ID</th> <tr th:each="article : ${ListedArticles}">
<th>Aktion</th> <td><img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}" class="s"/></td>
</tr> <td><span th:text="${article.title}"></span></td>
</thead> <td><span th:text="${article.price}"></span></td>
<tbody> <td><span th:text="${article.price_netto}"></span></td>
<tr th:each="article : ${ListedArticles}"> <td><span th:text="${article.categorie}"></span></td>
<td><img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}" class="s"/></td> <td><span th:text="${article.stock}"></span></td>
<td><span th:text="${article.title}"></span></td> <td><a th:href="${'/intern/supplierOffers/#q=' + {article.id}}" th:text="${article.offer_id}"></a></td>
<td><span th:text="${article.price}"></span></td> <td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td>
<td><span th:text="${article.price_netto}"></span></td> <td>
<td><span th:text="${article.categorie}"></span></td> <form th:action="@{/intern/articles/{id}(id = ${article.id})}"><input type="submit" value="Bearbeiten" /></form>
<td><span th:text="${article.stock}"></span></td> </td>
<td><a th:href="@{/intern/suppliers/articles/{id}(id = ${article.offer_id})}" th:text="${article.offer_id}"></a></td> </tr>
<td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td> </tbody>
<td><form th:action="@{/intern/articles/{id}(id = ${article.id})}"><input type="submit" value="Bearbeiten" /></form></td> </table>
</tr> <p>
</tbody> </div>
</table> </main>
<p> <footer th:replace="fragments/footer :: footer"></footer>
</div> </body>
</main> </html>
<footer th:replace="fragments/footer :: footer"></footer>
</body>
</html>

View File

@ -1,140 +1,69 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org"> <html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
<head> <meta charset="utf-8">
<meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no"> <title>Händlerangebote</title>
<script th:src="@{/js/filterTable.js}"></script>
<title>Händlerangebote</title> <link rel="stylesheet" th:href="@{/css/ecom.css}"/>
<script th:src="@{/js/filterTable.js}"></script> </head>
<link rel="stylesheet" th:href="@{/css/ecom.css}"/> <body>
</head> <nav th:replace="fragments/header :: header">Header</nav>
<div class="sidebar-layout content-width">
<body> <nav></nav>
<nav th:replace="fragments/header :: header">Header</nav> <div>
<div class="sidebar-layout content-width"> <h1>Übersicht der Angebote von Lieferanten</h1>
<nav></nav> <script th:src="@{/js/back.js}"></script>
<div> <div class="back" data-group="intern" data-name="Zurück zur Übersicht der von Lieferanten angebotenen Artikel."
<h1>Übersicht der Angebote von Lieferanten</h1> data-insert="false"></div>
</div>
<script th:src="@{/js/back.js}"></script> </div>
<div class="back" data-group="intern" data-name="Zurück zur Übersicht der von Lieferanten angebotenen Artikel." <main class="sidebar-layout content-width">
data-insert="false"></div> <nav th:replace="fragments/intern :: sidebar"></nav>
</div> <div class="content-width">
</div> <p>
<main class="sidebar-layout content-width"> <table id="main-table">
<nav th:replace="fragments/intern :: sidebar"></nav> <tr>
<div class="content-width"> <th colspan="7">
<p> <input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width" data-target-id="main-table"></input>
<table id="main-table"> </th>
<tr> </tr>
<th colspan="7"> <thead>
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width" <tr>
data-target-id="main-table"></input> <th>Name</th>
</th> <th>Hersteller</th>
</tr> <th>Artikelnummer</th>
<tr> <th>Lieferant</th>
<th>Name</th> <th>Kaufpreis (Netto)</th>
<th>Hersteller</th> <th>Werbungs-<br/>anfrage</th>
<th>Artikelnummer</th> <th>Status</th>
<th>Lieferant</th> </tr>
<th>Kaufpreis (Netto)</th> </thead>
<th>Werbungs-<br/>anfrage</th> <tbody>
<th>Status</th> <tr th:each="article : ${OfferedArticles}">
</tr> <td><span th:text="${article.title}"></span></td>
<!--**********************************************************--> <td><span th:text="${article.manufacturer}"></span></td>
<tr data-group="5420"> <td><span th:text="${article.articlenumber}"></span></td>
<td>Kamera</td> <td><a th:href="@{/intern/suppliers/{id}(id = ${article.supplierId})}" th:text="${article.supplierName}"></a></td>
<td>Sonjizu</td> <td><span th:text="${article.price}"></span></td>
<td>K48431587EX</td> <td><span th:text="${article.ads}"></span></td>
<td colspan="3"></td> <td>
<td><a th:href="@{/intern/listedArticles/48670}">Gelistet 44048</a></td> <div th:if="${article.offerIsListed}">
</tr> <a th:href="@{/intern/articles/{id}(id = ${article.listedArticleId})}">Artikel gelistet</a>
<tr data-group="5420"> </div>
<td colspan="3"></td> <!-- ELSE -->
<td><a th:href="@{/intern/suppliers/48670}">Hans Guck GmbH</a></td> <div th:unless="${article.offerIsListed}">
<td>584,50&nbsp;EUR</td> <form class="detailgrid" action="#" th:action="@{/intern/articles/addArticle/{id}(id = ${article.offer_id})}" method="POST">
<td></td> <input type="submit" value="Hinzufügen" />
<td></td> </form>
</tr> </div>
<tr data-group="5420"> </td>
<td colspan="3"></td> </tr>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td> </tbody>
<td>84,54&nbsp;EUR</td> </table>
<td>X</td> </p>
<td></td> </div>
</tr> </main>
<tr data-group="5420"> <footer th:replace="fragments/footer :: footer"></footer>
<td colspan="3"></td> </body>
<td><a th:href="@{/intern/suppliers/48670}">Not Cheap AG</a></td> </html>
<td>184,54&nbsp;EUR</td>
<td></td>
<td></td>
</tr>
<!--**********************************************************-->
<tr data-group="1233">
<td>Earbuds</td>
<td>Sonjizu</td>
<td>G447#$X</td>
<td colspan="3"></td>
<td><a th:href="@{/intern/listedArticles/48670}">Gelistet 448</a></td>
</tr>
<tr data-group="1233">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>50,54&nbsp;EUR</td>
<td>X</td>
<td></td>
</tr>
<!--**********************************************************-->
<tr data-group="42415">
<td>Mundschutz</td>
<td>Farma Corp</td>
<td>Mu-15415</td>
<td colspan="3"></td>
<td><a class="button smaller" th:href="@{/intern/listedArticles/48670}">Hinzufügen</a></td>
</tr>
<tr data-group="42415">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>150,54&nbsp;EUR</td>
<td></td>
<td></td>
</tr>
<tr data-group="42415">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Not Cheap AG</a></td>
<td>250,54&nbsp;EUR</td>
<td></td>
<td></td>
</tr>
<!--**********************************************************-->
<tr data-group="4580">
<td>Goldbaren</td>
<td>Bundesbank</td>
<td>G1KG</td>
<td colspan="3"></td>
<td><a th:href="@{/intern/listedArticles/48670}">Inaktiv 4888</a></td>
</tr>
<tr data-group="4580">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>10000,54&nbsp;EUR</td>
<td>X</td>
<td></td>
</tr>
</table>
</p>
</div>
</main>
<footer th:replace="fragments/footer :: footer"></footer>
</body>
</html>