finished show orders based on supplier
This commit is contained in:
parent
2f4c45ed71
commit
bd8b07990b
@ -1,12 +1,10 @@
|
|||||||
package org.hso.ecommerce.controller.intern.suppliers;
|
package org.hso.ecommerce.controller.intern.suppliers;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hso.ecommerce.entities.supplier.ArticleOffer;
|
|
||||||
import org.hso.ecommerce.entities.supplier.Supplier;
|
import org.hso.ecommerce.entities.supplier.Supplier;
|
||||||
import org.hso.ecommerce.entities.supplier.SupplierOrder;
|
import org.hso.ecommerce.entities.supplier.SupplierOrder;
|
||||||
import org.hso.ecommerce.repos.supplier.SupplierOrderRepository;
|
import org.hso.ecommerce.repos.supplier.SupplierOrderRepository;
|
||||||
@ -53,10 +51,8 @@ public class SupplierIndexController {
|
|||||||
orders.add(new UImodelSupplierDetailOrders(supplierOrder));
|
orders.add(new UImodelSupplierDetailOrders(supplierOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
UImodelSupplierDetail total = new UImodelSupplierDetail(
|
UImodelSupplierDetail total = new UImodelSupplierDetail(supplierRepository.findSupplierById(supplierId).name,
|
||||||
supplierRepository.findSupplierById(supplierId).name,
|
"42€", orders);
|
||||||
"42€",
|
|
||||||
orders);
|
|
||||||
|
|
||||||
model.addAttribute("SupplierDetail", total);
|
model.addAttribute("SupplierDetail", total);
|
||||||
|
|
||||||
@ -136,7 +132,7 @@ public class SupplierIndexController {
|
|||||||
String priceNetto;
|
String priceNetto;
|
||||||
String quantity;
|
String quantity;
|
||||||
String price_total;
|
String price_total;
|
||||||
String dateArrival;
|
boolean arrived;
|
||||||
|
|
||||||
public long getId() {
|
public long getId() {
|
||||||
return id;
|
return id;
|
||||||
@ -186,14 +182,6 @@ public class SupplierIndexController {
|
|||||||
this.price_total = price_total;
|
this.price_total = price_total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDateArrival() {
|
|
||||||
return dateArrival;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDateArrival(String dateArrival) {
|
|
||||||
this.dateArrival = dateArrival;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getArticleId() {
|
public long getArticleId() {
|
||||||
return articleId;
|
return articleId;
|
||||||
}
|
}
|
||||||
@ -202,9 +190,15 @@ public class SupplierIndexController {
|
|||||||
this.articleId = articleId;
|
this.articleId = articleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UImodelSupplierDetailOrders(SupplierOrder order)
|
public boolean isArrived() {
|
||||||
{
|
return arrived;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrived(boolean arrived) {
|
||||||
|
this.arrived = arrived;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UImodelSupplierDetailOrders(SupplierOrder order) {
|
||||||
this.id = order.id;
|
this.id = order.id;
|
||||||
this.articleName = order.ordered.title;
|
this.articleName = order.ordered.title;
|
||||||
this.articleId = order.ordered.id;
|
this.articleId = order.ordered.id;
|
||||||
@ -215,10 +209,12 @@ public class SupplierIndexController {
|
|||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
date.setTime(order.created.getTime());
|
date.setTime(order.created.getTime());
|
||||||
this.dateOrder = new SimpleDateFormat("dd.MM.yyyy").format(date);
|
this.dateOrder = new SimpleDateFormat("dd.MM.yyyy").format(date);
|
||||||
date.setTime(order.delivered.getTime());
|
|
||||||
this.dateArrival = new SimpleDateFormat("dd.MM.yyyy").format(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (order.delivered != null) {
|
||||||
|
arrived = true;
|
||||||
|
} else {
|
||||||
|
arrived = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,15 @@
|
|||||||
<td><span th:text="${order.priceNetto}"></span> €</td>
|
<td><span th:text="${order.priceNetto}"></span> €</td>
|
||||||
<td><span th:text="${order.quantity}"></span></td>
|
<td><span th:text="${order.quantity}"></span></td>
|
||||||
<td><span th:text="${order.price_total}"></span> €</td>
|
<td><span th:text="${order.price_total}"></span> €</td>
|
||||||
<td><span th:text="${order.dateArrival}"></span></td>
|
<td>
|
||||||
<!-- <td>Unterwegs <br/><a th:href="@{/intern/warehouse/todo}" class="button smaller">Angekommen</a></td> -->
|
<div th:if="${order.arrived}">
|
||||||
|
<a th:href="@{/intern/warehouse/todo}" class="button smaller">Angekommen</a>
|
||||||
|
</div>
|
||||||
|
<!-- ELSE -->
|
||||||
|
<div th:unless="${order.arrived}">
|
||||||
|
Unterwegs
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
Reference in New Issue
Block a user