diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js
index 3b940da..fed4e44 100644
--- a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js
+++ b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js
@@ -1,10 +1,45 @@
-const InvoiceItem = (invoice) => {
+const InvoiceItem = ({ invoice }) => {
+
+ const productTotal = (p) => {
+ return (p.quantity * (p.product.status == 3 || p.product.status == 4 ? p.product.promoPrice : p.product.price)).toFixed(2)
+ }
+
+ const totals = () => {
+ var price = 0;
+ var tax = 0;
+
+ invoice.products.map((p)=>{
+ price += productTotal(p)
+ })
+ }
+
return (
- <>
-
+
+
+
+
+ #{invoice.id}
+
+
+ Adresse d'expédition:
+ {invoice.firstName} {invoice.lastName}
+ {invoice.shippingAddress.civicNumber} {invoice.shippingAddress.street}
+ {invoice.shippingAddress.city}, {invoice.shippingAddress.province} {invoice.shippingAddress.postalCode}
+ {invoice.shippingAddress.country}
+
- >
+
+
+ {invoice.products.map((p) => (
+ - {p.quantity} x {p.product.title} -{'>'} {productTotal(p)}
+ ))}
+
+
+ {totals()}
+
+
+
);
}
diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js
index f4e2ec8..636d947 100644
--- a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js
+++ b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js
@@ -2,13 +2,14 @@ import InvoiceItem from "./InvoiceItem";
const InvoiceList = ({ invoices }) => {
return (
- <>
- {invoices.map((invoice) => {
+
+ {invoices.map((invoice) => (
- })}
- >
+ ))}
+
);
}
diff --git a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css
index 551e596..0e96b11 100644
--- a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css
+++ b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css
@@ -726,6 +726,15 @@ a {
}
+.invoice-list-container{
+ border: beige 2px double;
+}
+
+.invoice-item-container{
+ border: black 1px solid;
+}
+
+
/* -------------------------------------------------------- */
/* specification pour les moyennes écrans
/* -------------------------------------------------------- */