feature/supplier_page #52
3
prototype/scripts/addsupplierorders.sql
Normal file
3
prototype/scripts/addsupplierorders.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
INSERT INTO supplier_orders ("created", "delivered", "number_of_units", "price_per_unit_net_cent", "total_price_net", "ordered_id", "supplier_id")
|
||||||
|
VALUES ('0', '0', '42', '42', '42', '1', '1');
|
@ -0,0 +1,7 @@
|
|||||||
|
package org.hso.ecommerce.action.warehouse;
|
||||||
|
|
||||||
|
public class StoreSupplierOrderAction {
|
||||||
|
|
||||||
|
//TODO add delivery date and warehouse booking
|
||||||
|
|
||||||
|
}
|
@ -100,35 +100,6 @@ public class RequestController {
|
|||||||
return "intern/customerOrders/id";
|
return "intern/customerOrders/id";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/intern/suppliers/")
|
|
||||||
public String internSuppliers() {
|
|
||||||
return "intern/suppliers/index";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/intern/suppliers/{id}")
|
|
||||||
public String internSuppliersId() {
|
|
||||||
return "intern/suppliers/id";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/intern/supplierOrders/")
|
|
||||||
public String internSupplierOrders() {
|
|
||||||
return "intern/supplierOrders/index";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/intern/supplierOrders/{id}")
|
|
||||||
public String internSupplierOrdersId() {
|
|
||||||
return "intern/supplierOrders/id";
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
@GetMapping("/intern/suppliersOffers")
|
|
||||||
public String internSuppliersOffers() {
|
|
||||||
return "intern/offeredArticles/index";
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/intern/accounting/")
|
@GetMapping("/intern/accounting/")
|
||||||
public String accounting() {
|
public String accounting() {
|
||||||
return "intern/accounting/index";
|
return "intern/accounting/index";
|
||||||
|
@ -62,16 +62,12 @@ public class InternArticleController {
|
|||||||
|
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public String internListedArticlesId(Model model, @PathVariable String id) {
|
public String internListedArticlesId(Model model, @PathVariable String id) {
|
||||||
|
|
||||||
int articleid = Integer.parseInt(id);
|
int articleid = Integer.parseInt(id);
|
||||||
|
|
||||||
UImodelArticle total = new UImodelArticle();
|
UImodelArticle total = new UImodelArticle();
|
||||||
|
|
||||||
total.addArticle(articleRepository.findArticleById(articleid),
|
total.addArticle(articleRepository.findArticleById(articleid),
|
||||||
warehouseEntryRepository.getArticleStock(articleid).orElse(0));
|
warehouseEntryRepository.getArticleStock(articleid).orElse(0));
|
||||||
|
|
||||||
model.addAttribute("ArticleID", total);
|
model.addAttribute("ArticleID", total);
|
||||||
|
|
||||||
return "intern/listedArticles/id";
|
return "intern/listedArticles/id";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +76,7 @@ public class InternArticleController {
|
|||||||
@RequestParam(value = "title", required = true) String title,
|
@RequestParam(value = "title", required = true) String title,
|
||||||
@RequestParam(value = "description", required = true) String description,
|
@RequestParam(value = "description", required = true) String description,
|
||||||
@RequestParam(value = "units-per-slot", required = true) String warehouseUnitsPerSlot,
|
@RequestParam(value = "units-per-slot", required = true) String warehouseUnitsPerSlot,
|
||||||
@RequestParam(value = "price_netto", required = true) String pricenetto,
|
@RequestParam(value = "priceNet", required = true) String pricenetto,
|
||||||
@RequestParam(value = "reorderMaxPrice", required = true) String reorderMaxPrice,
|
@RequestParam(value = "reorderMaxPrice", required = true) String reorderMaxPrice,
|
||||||
@RequestParam(value = "autobuy", required = true) Boolean shouldReorder,
|
@RequestParam(value = "autobuy", required = true) Boolean shouldReorder,
|
||||||
@RequestParam(value = "categorie", required = true) String categories,
|
@RequestParam(value = "categorie", required = true) String categories,
|
||||||
@ -192,19 +188,12 @@ public class InternArticleController {
|
|||||||
public static class UImodelArticles {
|
public static class UImodelArticles {
|
||||||
|
|
||||||
public String imgPath;
|
public String imgPath;
|
||||||
|
|
||||||
public String title;
|
public String title;
|
||||||
|
|
||||||
public String price;
|
public String price;
|
||||||
|
public String priceNet;
|
||||||
public String price_netto;
|
|
||||||
|
|
||||||
public String categorie;
|
public String categorie;
|
||||||
|
|
||||||
public int stock;
|
public int stock;
|
||||||
|
public long offerID;
|
||||||
public long offer_id;
|
|
||||||
|
|
||||||
public long id;
|
public long id;
|
||||||
|
|
||||||
void addListedArticle(Article article, int stock) {
|
void addListedArticle(Article article, int stock) {
|
||||||
@ -213,7 +202,7 @@ public class InternArticleController {
|
|||||||
this.imgPath = article.image.path;
|
this.imgPath = article.image.path;
|
||||||
}
|
}
|
||||||
this.title = article.title;
|
this.title = article.title;
|
||||||
this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100));
|
this.priceNet = 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();
|
||||||
@ -224,7 +213,7 @@ public class InternArticleController {
|
|||||||
this.categorie = result.toString();
|
this.categorie = result.toString();
|
||||||
|
|
||||||
this.stock = stock;
|
this.stock = stock;
|
||||||
this.offer_id = article.related.id;
|
this.offerID = article.related.id;
|
||||||
this.id = article.id;
|
this.id = article.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,123 +223,31 @@ public class InternArticleController {
|
|||||||
public String imgPath;
|
public String imgPath;
|
||||||
public String title;
|
public String title;
|
||||||
public String price;
|
public String price;
|
||||||
public String price_netto;
|
public String priceNet;
|
||||||
public String reorderMaxPrice;
|
public String reorderMaxPrice;
|
||||||
public String categorie;
|
public String categorie;
|
||||||
public int stock;
|
public int stock;
|
||||||
public long offer_id;
|
public long offerID;
|
||||||
public long id;
|
public long id;
|
||||||
public boolean shouldReorder;
|
public boolean shouldReorder;
|
||||||
public String warehouseUnitsPerSlot;
|
public String warehouseUnitsPerSlot;
|
||||||
public String description;
|
public String description;
|
||||||
public int vatPercent;
|
public int vatPercent;
|
||||||
|
|
||||||
public String getImgPath() {
|
|
||||||
return imgPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImgPath(String imgPath) {
|
|
||||||
this.imgPath = imgPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTitle() {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTitle(String title) {
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPrice() {
|
|
||||||
return price;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrice(String price) {
|
|
||||||
this.price = price;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getVatPercent() {
|
|
||||||
return vatPercent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPrice_netto() {
|
|
||||||
return price_netto;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrice_netto(String price_netto) {
|
|
||||||
this.price_netto = price_netto;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReorderMaxPrice() {
|
|
||||||
return reorderMaxPrice;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReorderMaxPrice(String reorderMaxPrice) {
|
|
||||||
this.reorderMaxPrice = reorderMaxPrice;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCategorie() {
|
public String getCategorie() {
|
||||||
return categorie;
|
return categorie;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCategorie(String categorie) {
|
|
||||||
this.categorie = categorie;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStock() {
|
|
||||||
return stock;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStock(int stock) {
|
|
||||||
this.stock = stock;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getOffer_id() {
|
|
||||||
return offer_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOffer_id(long offer_id) {
|
|
||||||
this.offer_id = offer_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShouldReorder() {
|
|
||||||
return shouldReorder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShouldReorder(boolean shouldReorder) {
|
|
||||||
this.shouldReorder = shouldReorder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getWarehouseUnitsPerSlot() {
|
|
||||||
return warehouseUnitsPerSlot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWarehouseUnitsPerSlot(String warehouseUnitsPerSlot) {
|
|
||||||
this.warehouseUnitsPerSlot = warehouseUnitsPerSlot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
void addArticle(Article article, int stock) {
|
void addArticle(Article article, int stock) {
|
||||||
if (article.image != null) {
|
if (article.image != null) {
|
||||||
this.imgPath = article.image.path;
|
this.imgPath = article.image.path;
|
||||||
}
|
}
|
||||||
this.title = article.title;
|
this.title = article.title;
|
||||||
this.price_netto = String.format("%.2f", ((float) article.shopPricePerUnitNetCent / 100));
|
this.priceNet = 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();
|
||||||
@ -362,7 +259,7 @@ public class InternArticleController {
|
|||||||
this.categorie = result.toString();
|
this.categorie = result.toString();
|
||||||
|
|
||||||
this.stock = stock;
|
this.stock = stock;
|
||||||
this.offer_id = article.related.id;
|
this.offerID = article.related.id;
|
||||||
this.id = article.id;
|
this.id = article.id;
|
||||||
this.reorderMaxPrice = String.format("%.2f", ((float) article.reorderMaxPrice / 100));
|
this.reorderMaxPrice = String.format("%.2f", ((float) article.reorderMaxPrice / 100));
|
||||||
this.shouldReorder = article.shouldReorder;
|
this.shouldReorder = article.shouldReorder;
|
||||||
|
@ -1,8 +1,165 @@
|
|||||||
package org.hso.ecommerce.controller.intern.suppliers;
|
package org.hso.ecommerce.controller.intern.suppliers;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.hso.ecommerce.entities.booking.Booking;
|
||||||
|
import org.hso.ecommerce.entities.booking.BookingAccountEntry;
|
||||||
|
import org.hso.ecommerce.entities.supplier.Supplier;
|
||||||
|
import org.hso.ecommerce.entities.supplier.SupplierOrder;
|
||||||
|
import org.hso.ecommerce.repos.booking.BookingAccountEntryRepository;
|
||||||
|
import org.hso.ecommerce.repos.booking.BookingRepository;
|
||||||
|
import org.hso.ecommerce.repos.supplier.SupplierOrderRepository;
|
||||||
|
import org.hso.ecommerce.repos.supplier.SupplierRepository;
|
||||||
|
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.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
//@RequestMapping("...")
|
@RequestMapping("/intern/")
|
||||||
public class SupplierIndexController {
|
public class SupplierIndexController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private final SupplierRepository supplierRepository = null;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private final SupplierOrderRepository supplierOrderRepository = null;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private final BookingAccountEntryRepository bookingAccountEntryRepository = null;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private final BookingRepository bookingRepository = null;
|
||||||
|
|
||||||
|
@GetMapping("suppliers")
|
||||||
|
public String listSuppliers(Model model) {
|
||||||
|
|
||||||
|
List<UImodelSuppliers> totals = new ArrayList<UImodelSuppliers>();
|
||||||
|
|
||||||
|
for (Supplier supplier : supplierRepository.findAll()) {
|
||||||
|
UImodelSuppliers tmp = new UImodelSuppliers(supplier.id, supplier.name);
|
||||||
|
totals.add(tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("suppliers", totals);
|
||||||
|
return "intern/suppliers/index";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/suppliers/{id}")
|
||||||
|
public String supplierDetail(Model model, @PathVariable String id) {
|
||||||
|
|
||||||
|
long supplierId = Long.parseLong(id);
|
||||||
|
|
||||||
|
// add orders from supplier to UImodel
|
||||||
|
List<UImodelSupplierDetailOrders> orders = new ArrayList<UImodelSupplierDetailOrders>();
|
||||||
|
for (SupplierOrder supplierOrder : supplierOrderRepository.findOrderBySupplierID(supplierId)) {
|
||||||
|
orders.add(new UImodelSupplierDetailOrders(supplierOrder));
|
||||||
|
}
|
||||||
|
|
||||||
|
// get latest supplier booking
|
||||||
|
Optional<BookingAccountEntry> supplierBooking = bookingAccountEntryRepository.getBySupplier(supplierId);
|
||||||
|
|
||||||
|
// get account balance
|
||||||
|
String supplierBalance = ((supplierBooking.isPresent())
|
||||||
|
? String.format("%.2f", ((float) supplierBooking.get().newSumCent / 100))
|
||||||
|
: "0,00");
|
||||||
|
|
||||||
|
// add bookings from supplier to UImodel
|
||||||
|
List<UImodelSupplierDetailBookings> bookings = new ArrayList<UImodelSupplierDetailBookings>();
|
||||||
|
for (Booking booking : bookingRepository.getBySupplier(supplierId)) {
|
||||||
|
bookings.add(new UImodelSupplierDetailBookings(booking));
|
||||||
|
}
|
||||||
|
|
||||||
|
UImodelSupplierDetail total = new UImodelSupplierDetail(supplierRepository.findSupplierById(supplierId).name,
|
||||||
|
supplierBalance, orders, bookings);
|
||||||
|
|
||||||
|
model.addAttribute("SupplierDetail", total);
|
||||||
|
|
||||||
|
return "intern/suppliers/id";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UImodelSuppliers {
|
||||||
|
public long id;
|
||||||
|
public String name;
|
||||||
|
|
||||||
|
public UImodelSuppliers(long id, String name) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UImodelSupplierDetail {
|
||||||
|
|
||||||
|
public String name;
|
||||||
|
public String balance;
|
||||||
|
public List<UImodelSupplierDetailOrders> orders;
|
||||||
|
public List<UImodelSupplierDetailBookings> bookings;
|
||||||
|
|
||||||
|
public UImodelSupplierDetail(String name, String balance, List<UImodelSupplierDetailOrders> orders,
|
||||||
|
List<UImodelSupplierDetailBookings> bookings) {
|
||||||
|
this.name = name;
|
||||||
|
this.balance = balance;
|
||||||
|
this.orders = orders;
|
||||||
|
this.bookings = bookings;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UImodelSupplierDetailOrders {
|
||||||
|
public long id;
|
||||||
|
public String dateOrder;
|
||||||
|
public String articleName;
|
||||||
|
public long articleId;
|
||||||
|
public String priceNet;
|
||||||
|
public String quantity;
|
||||||
|
public String priceTotal;
|
||||||
|
public boolean arrived;
|
||||||
|
|
||||||
|
public UImodelSupplierDetailOrders(SupplierOrder order) {
|
||||||
|
this.id = order.id;
|
||||||
|
this.articleName = order.ordered.title;
|
||||||
|
this.articleId = order.ordered.id;
|
||||||
|
this.priceNet = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100));
|
||||||
|
this.quantity = String.valueOf(order.numberOfUnits);
|
||||||
|
this.priceTotal = String.format("%.2f", ((float) order.totalPriceNet / 100));
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
date.setTime(order.created.getTime());
|
||||||
|
this.dateOrder = new SimpleDateFormat("dd.MM.yyyy").format(date);
|
||||||
|
|
||||||
|
if (order.delivered != null) {
|
||||||
|
arrived = true;
|
||||||
|
} else {
|
||||||
|
arrived = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UImodelSupplierDetailBookings {
|
||||||
|
|
||||||
|
public String dateBooking;
|
||||||
|
public String price;
|
||||||
|
public String srcName;
|
||||||
|
public String balance;
|
||||||
|
public String reason;
|
||||||
|
public long orderID;
|
||||||
|
|
||||||
|
public UImodelSupplierDetailBookings(Booking booking) {
|
||||||
|
Date date = new Date();
|
||||||
|
date.setTime(booking.reason.supplierOrder.created.getTime());
|
||||||
|
this.dateBooking = new SimpleDateFormat("dd.MM.yyyy").format(date);
|
||||||
|
this.price = String.format("%.2f", ((float) booking.amountCent / 100));
|
||||||
|
this.srcName = ((booking.source.isMainAccount) ? "Hauptkonto" : booking.source.supplierAccount.name);
|
||||||
|
this.balance = String.format("%.2f", ((float) booking.destination.newSumCent / 100));
|
||||||
|
this.reason = booking.reason.comment;
|
||||||
|
this.orderID = booking.reason.supplierOrder.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,94 +40,22 @@ public class SupplierOfferController {
|
|||||||
|
|
||||||
public class UImodelOfferedArticle {
|
public class UImodelOfferedArticle {
|
||||||
|
|
||||||
long offer_id;
|
public long offerId;
|
||||||
String title;
|
public String title;
|
||||||
String manufacturer;
|
public String manufacturer;
|
||||||
String articlenumber;
|
public String articleNumber;
|
||||||
String supplierName;
|
public String supplierName;
|
||||||
String price;
|
public String price;
|
||||||
String ads;
|
public String ads;
|
||||||
int listedArticleId;
|
public int listedArticleId;
|
||||||
boolean offerIsListed; // true --> offered article is listed
|
public 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 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, Optional<Integer> listedArticleId) {
|
public void addData(ArticleOffer article, Optional<Integer> listedArticleId) {
|
||||||
|
|
||||||
this.offer_id = 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;
|
this.supplierName = article.cheapestSupplier.name;
|
||||||
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";
|
||||||
|
@ -1,8 +1,89 @@
|
|||||||
package org.hso.ecommerce.controller.intern.suppliers;
|
package org.hso.ecommerce.controller.intern.suppliers;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.hso.ecommerce.entities.supplier.SupplierOrder;
|
||||||
|
import org.hso.ecommerce.repos.supplier.SupplierOrderRepository;
|
||||||
|
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.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.servlet.view.RedirectView;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
//@RequestMapping("...")
|
@RequestMapping("/intern/")
|
||||||
public class SupplierOrderController {
|
public class SupplierOrderController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private final SupplierOrderRepository supplierOrderRepository = null;
|
||||||
|
|
||||||
|
@GetMapping("supplierOrders")
|
||||||
|
public String listSuppliers(Model model) {
|
||||||
|
|
||||||
|
List<UImodelSupplierOrder> totals = new ArrayList<UImodelSupplierOrder>();
|
||||||
|
|
||||||
|
for (SupplierOrder orders : supplierOrderRepository.findAll()) {
|
||||||
|
totals.add(new UImodelSupplierOrder(orders));
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("orders", totals);
|
||||||
|
|
||||||
|
return "intern/supplierOrders/index";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/supplierOrders/store/{id}")
|
||||||
|
public RedirectView storeOrder(@PathVariable(required = true) String id) {
|
||||||
|
|
||||||
|
long supplierOrderID = Long.parseLong(id);
|
||||||
|
|
||||||
|
Optional<SupplierOrder> order = supplierOrderRepository.findById(supplierOrderID);
|
||||||
|
|
||||||
|
if (order.isPresent()) {
|
||||||
|
// TODO call action
|
||||||
|
|
||||||
|
System.out.println("Order is present\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return new RedirectView("../../supplierOrders/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UImodelSupplierOrder {
|
||||||
|
public long id;
|
||||||
|
public String dateOrder;
|
||||||
|
public String supplierName;
|
||||||
|
public String articleName;
|
||||||
|
public long articleId;
|
||||||
|
public String priceNet;
|
||||||
|
public String quantity;
|
||||||
|
public String priceTotal;
|
||||||
|
public boolean arrived;
|
||||||
|
|
||||||
|
public UImodelSupplierOrder(SupplierOrder order) {
|
||||||
|
this.id = order.id;
|
||||||
|
this.supplierName = order.supplier.name;
|
||||||
|
this.articleName = order.ordered.title;
|
||||||
|
this.articleId = order.ordered.id;
|
||||||
|
this.priceNet = String.format("%.2f", ((float) order.pricePerUnitNetCent / 100));
|
||||||
|
this.quantity = String.valueOf(order.numberOfUnits);
|
||||||
|
this.priceTotal = String.format("%.2f", ((float) order.totalPriceNet / 100));
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
date.setTime(order.created.getTime());
|
||||||
|
this.dateOrder = new SimpleDateFormat("dd.MM.yyyy").format(date);
|
||||||
|
|
||||||
|
if (order.delivered != null) {
|
||||||
|
arrived = true;
|
||||||
|
} else {
|
||||||
|
arrived = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
package org.hso.ecommerce.repos.booking;
|
package org.hso.ecommerce.repos.booking;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.hso.ecommerce.entities.booking.Booking;
|
import org.hso.ecommerce.entities.booking.Booking;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface BookingRepository extends JpaRepository<Booking, Long> {
|
public interface BookingRepository extends JpaRepository<Booking, Long> {
|
||||||
|
|
||||||
|
// Return a list with all bookings entries, sorted by id
|
||||||
|
@Query(value = "SELECT * FROM bookings as b INNER JOIN booking_account_entries ON b.destination_id=booking_account_entries.id OR b.source_id=booking_account_entries.id WHERE booking_account_entries.supplier_account_id = :supplier ORDER BY b.id DESC", nativeQuery = true)
|
||||||
|
List<Booking> getBySupplier(Long supplier);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
package org.hso.ecommerce.repos.supplier;
|
package org.hso.ecommerce.repos.supplier;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.hso.ecommerce.entities.supplier.SupplierOrder;
|
import org.hso.ecommerce.entities.supplier.SupplierOrder;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
@ -11,4 +14,9 @@ public interface SupplierOrderRepository extends JpaRepository<SupplierOrder, Lo
|
|||||||
@Query("SELECT SUM(so.numberOfUnits) FROM SupplierOrder so JOIN so.ordered ao WHERE ao.articleNumber = :articleNumber AND so.delivered IS NULL")
|
@Query("SELECT SUM(so.numberOfUnits) FROM SupplierOrder so JOIN so.ordered ao WHERE ao.articleNumber = :articleNumber AND so.delivered IS NULL")
|
||||||
Integer countUndeliveredReorders(String articleNumber);
|
Integer countUndeliveredReorders(String articleNumber);
|
||||||
|
|
||||||
|
@Query(value = "SELECT * FROM supplier_orders as a WHERE a.supplier_id = :supplierId", nativeQuery = true)
|
||||||
|
|||||||
|
List<SupplierOrder> findOrderBySupplierID(@Param("supplierId") long supplierId);
|
||||||
|
|
||||||
|
@Query("SELECT a FROM SupplierOrder a")
|
||||||
|
List<SupplierOrder> findAll();
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
package org.hso.ecommerce.repos.supplier;
|
package org.hso.ecommerce.repos.supplier;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.hso.ecommerce.entities.supplier.Supplier;
|
import org.hso.ecommerce.entities.supplier.Supplier;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
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;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface SupplierRepository extends JpaRepository<Supplier, Long> {
|
public interface SupplierRepository extends JpaRepository<Supplier, Long> {
|
||||||
|
|
||||||
}
|
@Query("SELECT a FROM Supplier a")
|
||||||
|
List<Supplier> findAll();
|
||||||
|
|
||||||
|
@Query("SELECT a FROM Supplier a WHERE a.id = :supplierId")
|
||||||
|
Supplier findSupplierById(@Param("supplierId") long supplierId);
|
||||||
|
}
|
@ -29,9 +29,9 @@
|
|||||||
</p>
|
</p>
|
||||||
<p class="s">
|
<p class="s">
|
||||||
<label for="ref_disabled">Refernzierter Artikel</label>
|
<label for="ref_disabled">Refernzierter Artikel</label>
|
||||||
<input class="" type="text" id="ref_disabled" th:value="${ArticleID.offer_id}" disabled/>
|
<input class="" type="text" id="ref_disabled" th:value="${ArticleID.offerID}" disabled/>
|
||||||
|
|
||||||
<input type="hidden" id="ref_hidden" th:value="${ArticleID.offer_id}" name="ref-article" />
|
<input type="hidden" id="ref_hidden" th:value="${ArticleID.offerID}" name="ref-article" />
|
||||||
|
|
||||||
<a th:href="${'/intern/supplierOffers/#q=' + ArticleID.id}">Details</a>
|
<a th:href="${'/intern/supplierOffers/#q=' + ArticleID.id}">Details</a>
|
||||||
</p>
|
</p>
|
||||||
@ -48,10 +48,11 @@
|
|||||||
<div class="s">
|
<div class="s">
|
||||||
<p>
|
<p>
|
||||||
<label for="price">Preis (Netto)</label>
|
<label for="price">Preis (Netto)</label>
|
||||||
<input class="" type="number" id="price" step="0.01" name="price_netto" required
|
<input class="" type="number" id="price" step="0.01" name="priceNet" required
|
||||||
th:value="${ArticleID.price_netto}"/> EUR <br/>
|
th:value="${ArticleID.priceNet}"/> EUR <br/>
|
||||||
(<span th:text="${ArticleID.vatPercent}"></span>% Mwst.)
|
(<span th:text="${ArticleID.vatPercent}"></span>% Mwst.)
|
||||||
<input type="hidden" id="vatPercent" name="vatPercent" th:value="${ArticleID.vatPercent}"/>
|
<input type="hidden" id="vatPercent" name="vatPercent" th:value="${ArticleID.vatPercent}"/>
|
||||||
|
|
||||||
<!-- Info von article ref--> <br/>
|
<!-- Info von article ref--> <br/>
|
||||||
= <span id="priceGross" th:text="${ArticleID.price}"></span> EUR Brutto
|
= <span id="priceGross" th:text="${ArticleID.price}"></span> EUR Brutto
|
||||||
</p>
|
</p>
|
||||||
@ -109,4 +110,4 @@
|
|||||||
</main>
|
</main>
|
||||||
<footer th:replace="fragments/footer :: footer"></footer>
|
<footer th:replace="fragments/footer :: footer"></footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -50,10 +50,10 @@
|
|||||||
<td><img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}" class="s"/></td>
|
<td><img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}" class="s"/></td>
|
||||||
<td><span th:text="${article.title}"></span></td>
|
<td><span th:text="${article.title}"></span></td>
|
||||||
<td><span th:text="${article.price}"></span> €</td>
|
<td><span th:text="${article.price}"></span> €</td>
|
||||||
<td><span th:text="${article.price_netto}"></span> €</td>
|
<td><span th:text="${article.priceNet}"></span> €</td>
|
||||||
<td><span th:text="${article.categorie}"></span></td>
|
<td><span th:text="${article.categorie}"></span></td>
|
||||||
<td><span th:text="${article.stock}"></span></td>
|
<td><span th:text="${article.stock}"></span></td>
|
||||||
<td><a th:href="${'/intern/supplierOffers/#q=' + article.title}" th:text="${article.offer_id}"></a></td>
|
<td><a th:href="${'/intern/supplierOffers/#q=' + article.title}" th:text="${article.offerID}"></a></td>
|
||||||
<td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td>
|
<td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td>
|
||||||
<td>
|
<td>
|
||||||
<form th:action="@{/intern/articles/{id}(id = ${article.id})}"><input class="button smaller" type="submit" value="Bearbeiten" /></form>
|
<form th:action="@{/intern/articles/{id}(id = ${article.id})}"><input class="button smaller" type="submit" value="Bearbeiten" /></form>
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
<tr th:each="article : ${OfferedArticles}">
|
<tr th:each="article : ${OfferedArticles}">
|
||||||
<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><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>
|
||||||
@ -53,7 +53,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<div th:unless="${article.offerIsListed}">
|
<div th:unless="${article.offerIsListed}">
|
||||||
<form class="detailgrid" action="#" th:action="@{/intern/articles/addArticle/{id}(id = ${article.offer_id})}" method="POST">
|
<form class="detailgrid" action="#" th:action="@{/intern/articles/addArticle/{id}(id = ${article.offerId})}" method="POST">
|
||||||
<input class="button smaller" type="submit" value="Hinzufügen" />
|
<input class="button smaller" type="submit" value="Hinzufügen" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,103 +1,74 @@
|
|||||||
<!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>Lieferanten Bestellungen</title>
|
||||||
|
<script th:src="@{/js/filterTable.js}"></script>
|
||||||
<title>Lieferanten Bestellungen</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>Lieferanten Bestellungen</h1>
|
||||||
<nav></nav>
|
<script th:src="@{/js/back.js}"></script>
|
||||||
<div>
|
<div class="back" data-group="intern" data-name="Zurück zu den Bestellungen bei Lieferanten."
|
||||||
<h1>Lieferanten Bestellungen</h1>
|
data-insert="false"></div>
|
||||||
|
</div>
|
||||||
<script th:src="@{/js/back.js}"></script>
|
</div>
|
||||||
<div class="back" data-group="intern" data-name="Zurück zu den Bestellungen bei Lieferanten."
|
<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="9">
|
||||||
<p>
|
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
|
||||||
<table id="main-table">
|
data-target-id="main-table">
|
||||||
<tr>
|
</th>
|
||||||
<th colspan="9">
|
</tr>
|
||||||
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
|
<thead>
|
||||||
data-target-id="main-table"></input>
|
<tr>
|
||||||
</th>
|
<th>Bestellnummer</th>
|
||||||
</tr>
|
<th>Datum</th>
|
||||||
<tr>
|
<th>Leiferant</th>
|
||||||
<th>Bestellnummer</th>
|
<th>Artikel</th>
|
||||||
<th>Datum</th>
|
<th>Preis/Stk (Netto)</th>
|
||||||
<th>Leiferant</th>
|
<th>Menge</th>
|
||||||
<th>Artikel</th>
|
<th>Gesamtpreis (Netto)</th>
|
||||||
<th>Preis/Stk (Netto)</th>
|
<th>Status</th>
|
||||||
<th>Menge</th>
|
</tr>
|
||||||
<th>Gesamtpreis (Netto)</th>
|
</thead>
|
||||||
<th>Status</th>
|
<tbody>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<tr th:each="order : ${orders}">
|
||||||
<td>4545</td>
|
<td><span th:text="${order.id}"></span></td>
|
||||||
<td>2019-18-10</td>
|
<td><span th:text="${order.dateOrder}"></span></td>
|
||||||
<td><a th:href="@{/intern/suppliers/45015}">Cheap AG</a></td>
|
<td><span th:text="${order.supplierName}"></span></td>
|
||||||
<td><a th:href="@{/intern/listedArticles/45015}">Kamera</a></td>
|
<td><a th:href="@{/intern/articles/{id}(id = ${order.articleId})}" class="button smaller" th:text="${order.articleName}"></a></td>
|
||||||
<td>20,00 EUR</td>
|
<td><span th:text="${order.priceNet}"></span> €</td>
|
||||||
<td>10</td>
|
<td><span th:text="${order.quantity}"></span></td>
|
||||||
<td>200,00 EUR</td>
|
<td><span th:text="${order.priceTotal}"></span> €</td>
|
||||||
<td>Unterwegs <br/><a th:href="@{/intern/warehouse/todo}" class="button smaller">Angekommen</a></td>
|
<td>
|
||||||
</tr>
|
<div th:if="${order.arrived}">
|
||||||
<tr>
|
Angekommen
|
||||||
<td>2455</td>
|
</div>
|
||||||
<td>2019-18-10</td>
|
<!-- ELSE -->
|
||||||
<td><a th:href="@{/intern/suppliers/45015}">Cheap AG</a></td>
|
<div th:unless="${order.arrived}">
|
||||||
<td><a th:href="@{/intern/listedArticles/45015}">Kamera</a></td>
|
Unterwegs <br>
|
||||||
<td>20,00 EUR</td>
|
<form class="detailgrid" action="#" th:action="@{/intern/supplierOrders/store/{id}(id = ${order.id})}" method="POST">
|
||||||
<td>11</td>
|
<input class="button smaller" type="submit" value="Eingang verbuchen" />
|
||||||
<td>220,00 EUR</td>
|
</form>
|
||||||
<td>Unterwegs <br/><a th:href="@{/intern/warehouse/todo}" class="button smaller">Angekommen</a></td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td>1224</td>
|
</tbody>
|
||||||
<td>2019-18-10</td>
|
</table>
|
||||||
<td><a th:href="@{/intern/suppliers/45015}">Cheap AG</a></td>
|
</p>
|
||||||
<td><a th:href="@{/intern/listedArticles/45015}">Kamera</a></td>
|
</div>
|
||||||
<td>20,00 EUR</td>
|
</main>
|
||||||
<td>11</td>
|
<footer th:replace="fragments/footer :: footer"></footer>
|
||||||
<td>220,00 EUR</td>
|
</body>
|
||||||
<td>Angekommen</td>
|
</html>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>4520</td>
|
|
||||||
<td>2019-18-10</td>
|
|
||||||
<td><a th:href="@{/intern/suppliers/45015}">Cheap AG</a></td>
|
|
||||||
<td><a th:href="@{/intern/listedArticles/45015}">Kamera</a></td>
|
|
||||||
<td>20,00 EUR</td>
|
|
||||||
<td>11</td>
|
|
||||||
<td>220,00 EUR</td>
|
|
||||||
<td>Angekommen</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>4521</td>
|
|
||||||
<td>2019-18-10</td>
|
|
||||||
<td><a th:href="@{/intern/suppliers/45015}">Cheap AG</a></td>
|
|
||||||
<td><a th:href="@{/intern/listedArticles/45015}">Kamera</a></td>
|
|
||||||
<td>20,00 EUR</td>
|
|
||||||
<td>11</td>
|
|
||||||
<td>220,00 EUR</td>
|
|
||||||
<td>Angekommen</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
<footer th:replace="fragments/footer :: footer"></footer>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@ -1,86 +1,101 @@
|
|||||||
<!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>Lieferanten Details</title>
|
||||||
|
<script th:src="@{/js/filterTable.js}"></script>
|
||||||
<title>Lieferanten Details</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>Lieferant <span th:text="${SupplierDetail.name}"></span></h1>
|
||||||
<nav></nav>
|
<script th:src="@{/js/back.js}"></script>
|
||||||
<div>
|
<div class="back" data-group="intern" data-insert="true"></div>
|
||||||
<h1>Lierfant Cheap AG</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>Bestellungen</h2>
|
||||||
<main class="sidebar-layout content-width">
|
<p>
|
||||||
<nav th:replace="fragments/intern :: sidebar"></nav>
|
<table id="order-table">
|
||||||
<div class="content-width">
|
<tr>
|
||||||
<h2>Bestellungen</h2>
|
<th colspan="9">
|
||||||
<p>
|
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
|
||||||
<table id="main-table">
|
data-target-id="main-table">
|
||||||
<tr>
|
</th>
|
||||||
<th colspan="9">
|
</tr>
|
||||||
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
|
<thead>
|
||||||
data-target-id="main-table"></input>
|
<tr>
|
||||||
</th>
|
<th>Bestellnummer</th>
|
||||||
</tr>
|
<th>Datum</th>
|
||||||
<tr>
|
<th>Artikel</th>
|
||||||
<th>Bestellnummer</th>
|
<th>Preis/Stk (Netto)</th>
|
||||||
<th>Datum</th>
|
<th>Menge</th>
|
||||||
<th>Artikel</th>
|
<th>Gesamtpreis (Netto)</th>
|
||||||
<th>Preis/Stk (Netto)</th>
|
<th>Status</th>
|
||||||
<th>Menge</th>
|
</tr>
|
||||||
<th>Gesamtpreis (Netto)</th>
|
</thead>
|
||||||
<th>Status</th>
|
<tbody>
|
||||||
</tr>
|
<tr th:each="order : ${SupplierDetail.orders}">
|
||||||
<tr>
|
<td><span th:text="${order.id}"></span></td>
|
||||||
<td>4545</td>
|
<td><span th:text="${order.dateOrder}"></span></td>
|
||||||
<td>2019-18-10</td>
|
<td><a th:href="@{/intern/articles/{id}(id = ${order.articleId})}" class="button smaller" th:text="${order.articleName}"></a></td>
|
||||||
<td><a th:href="@{/intern/listedArticles/45015}">Kamera</a></td>
|
<td><span th:text="${order.priceNet}"></span> €</td>
|
||||||
<td>20,00 EUR</td>
|
<td><span th:text="${order.quantity}"></span></td>
|
||||||
<td>10</td>
|
<td><span th:text="${order.priceTotal}"></span> €</td>
|
||||||
<td>200,00 EUR</td>
|
<td>
|
||||||
<td>Unterwegs <br/><a th:href="@{/intern/warehouse/todo}" class="button smaller">Angekommen</a></td>
|
<div th:if="${order.arrived}">
|
||||||
</tr>
|
Angekommen
|
||||||
</table>
|
</div>
|
||||||
</p>
|
<!-- ELSE -->
|
||||||
<h2>Buchungen</h2>
|
<div th:unless="${order.arrived}">
|
||||||
<div>
|
Unterwegs <br>
|
||||||
<h4> Kontostand </h4>
|
<form class="detailgrid" action="#" th:action="@{/intern/supplierOrders/store/{id}(id = ${order.id})}" method="POST">
|
||||||
<h3> -100,00 EUR </h3>
|
<input class="button smaller" type="submit" value="Eingang verbuchen" />
|
||||||
</div>
|
</form>
|
||||||
<p>
|
</div>
|
||||||
<table id="main-table">
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<th>Zeitpunkt</th>
|
</tbody>
|
||||||
<th>Betrag</th>
|
</table>
|
||||||
<th>Von</th>
|
</p>
|
||||||
<th>Kontostand</th>
|
<h2>Buchungen</h2>
|
||||||
<th>Grund</th>
|
<div>
|
||||||
<th>Referenz</th>
|
<h4> Kontostand </h4>
|
||||||
</tr>
|
<h3><span th:text="${SupplierDetail.balance}"></span> €</h3>
|
||||||
<tr>
|
</div>
|
||||||
<td>10.09.2019 13:45</td>
|
<p>
|
||||||
<td>100,00 EUR</td>
|
<table id="booking-table">
|
||||||
<td><a th:href="@{/intern/accounting/main}">Hauptkonto</a></td>
|
<thead>
|
||||||
<td>-100,00 EUR</td>
|
<tr>
|
||||||
<td>Lieferanten-Bestellung</td>
|
<th>Zeitpunkt</th>
|
||||||
<td><a th:href="@{/intern/supplierOrders/#q=4520}">2504</a></td>
|
<th>Betrag</th>
|
||||||
</tr>
|
<th>Von</th>
|
||||||
</table>
|
<th>Kontostand</th>
|
||||||
</p>
|
<th>Grund</th>
|
||||||
</div>
|
<th>Referenz</th>
|
||||||
</main>
|
</tr>
|
||||||
<footer th:replace="fragments/footer :: footer"></footer>
|
</thead>
|
||||||
</body>
|
<tbody>
|
||||||
|
<tr>
|
||||||
</html>
|
<tr th:each="booking : ${SupplierDetail.bookings}">
|
||||||
|
<td><span th:text="${booking.dateBooking}"></span></td>
|
||||||
|
<td><span th:text="${booking.price}"></span> €</td>
|
||||||
|
<td><a th:href="@{/intern/accounting/main}" th:text="${booking.srcName}" ></a></td>
|
||||||
|
<td><span th:text="${booking.balance}"></span> €</td>
|
||||||
|
<td><span th:text="${booking.reason}"></span></td>
|
||||||
|
<td><a th:href="${'/intern/supplierOrders/#q=' + booking.orderID}" th:text="${booking.orderID}" class="button smaller"></a></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer th:replace="fragments/footer :: footer"></footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,63 +1,52 @@
|
|||||||
<!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>Lieferanten</title>
|
||||||
|
<script th:src="@{/js/filterTable.js}"></script>
|
||||||
<title>Lieferanten</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>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 Lieferanten."
|
||||||
<h1>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 Lieferanten."
|
<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"
|
||||||
<table id="main-table">
|
data-target-id="main-table">
|
||||||
<tr>
|
</th>
|
||||||
<th colspan="7">
|
</tr>
|
||||||
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
|
<thead>
|
||||||
data-target-id="main-table"></input>
|
<tr>
|
||||||
</th>
|
<th>Nr</th>
|
||||||
</tr>
|
<th>Name</th>
|
||||||
<tr>
|
<th></th>
|
||||||
<th>Nr</th>
|
</tr>
|
||||||
<th>Name</th>
|
</thead>
|
||||||
<th></th>
|
<tbody>
|
||||||
</tr>
|
<tr th:each="supplier : ${suppliers}">
|
||||||
<tr>
|
<td><span th:text="${supplier.id}"></span></td>
|
||||||
<td>0015</td>
|
<td><span th:text="${supplier.name}"></span></td>
|
||||||
<td>Cheap AG</td>
|
<td><a th:href="@{/intern/suppliers/{id}(id = ${supplier.id})}" class="button smaller">Details</a></td>
|
||||||
<td><a th:href="@{/intern/suppliers/4884}" class="button smaller">Details</a></td>
|
</tr>
|
||||||
</tr>
|
</tbody>
|
||||||
<tr>
|
</table>
|
||||||
<td>5012</td>
|
</p>
|
||||||
<td>Not Cheap GmbH & Co. KG</td>
|
</div>
|
||||||
<td><a th:href="@{/intern/suppliers/4884}" class="button smaller">Details</a></td>
|
</main>
|
||||||
</tr>
|
<footer th:replace="fragments/footer :: footer"></footer>
|
||||||
<tr>
|
</body>
|
||||||
<td>7400</td>
|
</html>
|
||||||
<td>Hans MÜller GmbH</td>
|
|
||||||
<td><a th:href="@{/intern/suppliers/4884}" class="button smaller">Details</a></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
<footer th:replace="fragments/footer :: footer"></footer>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
Reference in New Issue
Block a user
Eine Leerzeile zu viel.