From 596c019af400cc21d2890f875a7570f044866210 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 3 Apr 2023 10:52:08 +0700 Subject: fix price display in checkout --- src/lib/transaction/components/Transaction.jsx | 35 +++++++++++++++++--------- 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'src/lib/transaction/components/Transaction.jsx') diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index 51c89b28..e992580a 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -103,14 +103,14 @@ const Transaction = ({ id }) => {

Total Diskon

{currencyFormat(-totalDiscountAmount)}

+
+

PPN 11%

+

{currencyFormat(transaction.data?.amountTax)}

+

Total Belanja

{currencyFormat(transaction.data?.amountTotal)}

-
-

PPN 11% (Incl.)

-

{currencyFormat(totalAmount * 0.11)}

-
), [transaction.data, totalAmount, totalDiscountAmount] @@ -144,7 +144,11 @@ const Transaction = ({ id }) => { > Ya, Batalkan - @@ -392,35 +396,42 @@ const Transaction = ({ id }) => { {product.quantity} - {currencyFormat(product.price.price)} + + {product.price.discountPercentage > 0 && ( +
+ {currencyFormat(product.price.price)} +
+ )} +
{currencyFormat(product.price.priceDiscount)}
+ {product.price.discountPercentage > 0 ? `${product.price.discountPercentage}%` : ''} - {currencyFormat(product.price.priceDiscount * product.quantity)} + {currencyFormat(product.price.subtotal)} ))}
-
+
Subtotal
{currencyFormat(totalAmount)}
Total Diskon
-
+
{currencyFormat(-totalDiscountAmount)}
+
PPN 11%
+
{currencyFormat(transaction.data?.amountTax)}
+
Grand Total
{currencyFormat(transaction.data?.amountTotal)}
- -
PPN 11% (Incl.)
-
{currencyFormat(totalAmount * 0.11)}
-- cgit v1.2.3