From b58c5a555e5dec52222687649ca9c3f22798895e Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 27 Jan 2023 11:33:02 +0700 Subject: Invoice dan daftar transaksi --- src/core/utils/auth.js | 5 ++++- src/pages/my/invoice/[id].js | 2 +- src/pages/my/invoices.js | 4 ++-- src/pages/my/transaction/[id].js | 42 +++++++++++++++++++++++++++++++++++++--- src/pages/my/transactions.js | 26 ++++++++++++++++++------- 5 files changed, 65 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/core/utils/auth.js b/src/core/utils/auth.js index 62eba2c0..2ae5e05f 100644 --- a/src/core/utils/auth.js +++ b/src/core/utils/auth.js @@ -10,7 +10,10 @@ const getAuth = () => { } const setAuth = (user) => { - setCookie('auth', JSON.stringify(user)); + setCookie('auth', JSON.stringify(user), { + sameSite: 'none', + secure: true + }); return true; } diff --git a/src/pages/my/invoice/[id].js b/src/pages/my/invoice/[id].js index 93eae2be..c1cacfc6 100644 --- a/src/pages/my/invoice/[id].js +++ b/src/pages/my/invoice/[id].js @@ -105,7 +105,7 @@ export default function DetailInvoice() { /> )) }
-

Total Belanja

+

Total Belanja

{ currencyFormat(invoice?.amount_total || 0) }

diff --git a/src/pages/my/invoices.js b/src/pages/my/invoices.js index e136f4fd..926b4f99 100644 --- a/src/pages/my/invoices.js +++ b/src/pages/my/invoices.js @@ -82,7 +82,7 @@ export default function Invoices() {
- No. Transaksi + No. Invoice

{ invoice.name }

@@ -106,7 +106,7 @@ export default function Invoices() {
- Nomor PO + No. Purchase Order

{ invoice.purchase_order_name || '-' }

diff --git a/src/pages/my/transaction/[id].js b/src/pages/my/transaction/[id].js index 09bf1ec7..4c33c97a 100644 --- a/src/pages/my/transaction/[id].js +++ b/src/pages/my/transaction/[id].js @@ -12,6 +12,9 @@ import Disclosure from "@/components/elements/Disclosure"; import DescriptionRow from "@/components/elements/DescriptionRow"; import { TransactionDetailAddress } from "@/components/transactions/TransactionDetail"; import { SkeletonList } from "@/components/elements/Skeleton"; +import Link from "@/components/elements/Link"; +import { ChevronRightIcon } from "@heroicons/react/24/outline"; +import Alert from "@/components/elements/Alert"; export default function DetailTransaction() { const router = useRouter(); @@ -59,9 +62,7 @@ export default function DetailTransaction() { - +

Detail Produk

{ transaction?.products?.map((product, index) => ( @@ -76,7 +77,42 @@ export default function DetailTransaction() {
+ + + + + +
+

Invoice

+
+ { transaction?.invoices?.map((invoice, index) => ( + +
+
+

{ invoice?.name }

+
+ { invoice.amount_residual > 0 ? ( +
Belum Lunas
+ ) : ( +
Lunas
+ ) } +

+ { currencyFormat(invoice.amount_total) } +

+
+
+ +
+ + )) } + { transaction?.invoices?.length === 0 && ( + + Belum ada Invoice + + ) } +
+
) : (
diff --git a/src/pages/my/transactions.js b/src/pages/my/transactions.js index aca5f081..fc2142a3 100644 --- a/src/pages/my/transactions.js +++ b/src/pages/my/transactions.js @@ -92,14 +92,26 @@ export default function Transactions() { setActivePopupId(transaction.id)} />
- -
- Sales -

{ transaction.sales }

+ +
+
+ No. Purchase Order +

{ transaction.purchase_order_name || '-' }

+
+
+ Total Invoice +

{ transaction.invoice_count }

+
-
- Total Harga -

{ currencyFormat(transaction.amount_total) }

+
+
+ Sales +

{ transaction.sales }

+
+
+ Total Harga +

{ currencyFormat(transaction.amount_total) }

+
-- cgit v1.2.3