From e07b4470ba487c01e2420a115a285e7fd4a305ce Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Wed, 4 Sep 2024 17:12:44 +0700
Subject: fixing voucher shipping

---
 src/lib/checkout/components/Checkout.jsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/lib/checkout/components/Checkout.jsx')

diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx
index 913bd273..f63ef457 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -410,7 +410,7 @@ const Checkout = () => {
       Math.round(parseInt(finalShippingAmt * 1.1) / 1000) * 1000;
     const finalGT = GT < 0 ? 0 : GT;
     setGrandTotal(finalGT);
-  }, [biayaKirim, cartCheckout?.grandTotal, activeVoucher]);
+  }, [biayaKirim, cartCheckout?.grandTotal, activeVoucher, activeVoucherShipping]);
 
   const checkout = async () => {
     const file = poFile.current.files[0];
@@ -497,7 +497,7 @@ const Checkout = () => {
       }
     }
 
-    const midtrans = async () => {
+   /* const midtrans = async () => {
       for (const product of products) deleteItemCart({ productId: product.id });
       if (grandTotal > 0) {
         const payment = await axios.post(
@@ -513,7 +513,7 @@ const Checkout = () => {
           '-'
         )}`;
       }
-    };
+    };*/
   };
 
   const handlingActivateCode = async () => {
@@ -1189,7 +1189,7 @@ const Checkout = () => {
                 <div className='text-gray_r-11'>
                   Biaya Kirim <p className='text-xs mt-1'>{etdFix}</p>
                 </div>
-                <div>{currencyFormat(biayaKirim)}</div>
+                <div>{currencyFormat(Math.round(parseInt(biayaKirim * 1.1) / 1000) * 1000)}</div>
               </div>
               {activeVoucherShipping && voucherShippingAmt && (
                 <div className='flex gap-x-2 justify-between'>
@@ -1490,7 +1490,7 @@ const Checkout = () => {
                         Biaya Kirim
                         <p className='text-xs mt-1'>{etdFix}</p>
                       </div>
-                      <div>{currencyFormat(biayaKirim)}</div>
+                      <div>{currencyFormat(Math.round(parseInt(biayaKirim * 1.1) / 1000) * 1000) }</div>
                     </div>
                     {activeVoucherShipping && voucherShippingAmt && (
                       <div className='flex gap-x-2 justify-between'>
-- 
cgit v1.2.3

