diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js index 678e525..354c524 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js @@ -1,7 +1,8 @@ import { faTimes } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { weight } from "fontawesome"; -const InvoiceItem = ({ invoice, onCancel }) => { +const InvoiceItem = ({ invoice, onCancel, paymentInfos }) => { const productTotal = (p) => { return (p.quantity * (p.product.status == 3 || p.product.status == 4 ? p.product.promoPrice : p.product.price)) @@ -81,9 +82,8 @@ const InvoiceItem = ({ invoice, onCancel }) => { ) } } - + console.log(invoice); return ( -
{invoice.status != null ? @@ -94,12 +94,21 @@ const InvoiceItem = ({ invoice, onCancel }) => { null }
- Adresse d'expédition:
+ Adresse d'expédition :
{invoice.firstName} {invoice.lastName}
{invoice.shippingAddress.civicNumber} {invoice.shippingAddress.street}
{invoice.shippingAddress.appartment != null ? <>App: {invoice.shippingAddress.appartment}
: null} {invoice.shippingAddress.city}, {invoice.shippingAddress.province} {invoice.shippingAddress.postalCode}
- {invoice.shippingAddress.country}
+ {invoice.shippingAddress.country}

+ {paymentInfos == true && invoice.payment != null ? <> +
+ Nom : {invoice.payment.name}
+ Email : {invoice.payment.email}
+ Téléphone : {invoice.payment.phone}
+ Numéro de carte : **** **** **** {invoice.payment.lastFourDigits}
+ + : null } +
diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js index d2de763..d51b87d 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js @@ -1,6 +1,6 @@ import InvoiceItem from "./InvoiceItem"; -const InvoiceList = ({ invoices, onCancel }) => { +const InvoiceList = ({ invoices, onCancel, paymentInfos }) => { return (
{invoices.map((invoice) => ( @@ -8,6 +8,7 @@ const InvoiceList = ({ invoices, onCancel }) => { key={invoice.id} invoice={invoice} onCancel={onCancel} + paymentInfos={paymentInfos} /> ))}
diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/Invoices.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/Invoices.js index 4b11d8a..68039bf 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/Invoices.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/Invoices.js @@ -86,6 +86,7 @@ const Invoices = () => { ); diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js index 6ba10f8..6b74f81 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js @@ -69,12 +69,12 @@ const MyInvoices = () => { }; - return ( <> );