From 0d28dc8ff5fb8c5399e356ed6ecae4fce2019ca6 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 31 May 2025 08:55:43 +0700
Subject: <hafid> fix repeat-order

---
 src/lib/quotation/components/Quotationheader.jsx | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

(limited to 'src/lib/quotation/components/Quotationheader.jsx')

diff --git a/src/lib/quotation/components/Quotationheader.jsx b/src/lib/quotation/components/Quotationheader.jsx
index d94a55de..6551296a 100644
--- a/src/lib/quotation/components/Quotationheader.jsx
+++ b/src/lib/quotation/components/Quotationheader.jsx
@@ -53,7 +53,7 @@ const Quotationheader = (quotationCount) => {
   };
 
   const getCart = () => {
-    if (!productQuotation && auth) {
+    if ((productQuotation?.length === 0) && auth) {
       refreshCartf();
     }
   };
@@ -62,7 +62,7 @@ const Quotationheader = (quotationCount) => {
   const refreshCartf = useCallback(async () => {
     setIsloading(true);
     let pendingTransactions = transactions?.data?.saleOrders.filter(
-      (transaction) => transaction.status === 'draft'
+      (transaction) => transaction.status === 'waiting'
     );
     setProductQuotation(pendingTransactions);
     setCountQuotation(
@@ -107,20 +107,21 @@ const Quotationheader = (quotationCount) => {
     };
   }, []);
 
+
   const handleCheckout = async () => {
     SetButtonTerapkan(true);
     let checkoutAll = await odooApi(
       'POST',
       `/api/v1/user/${auth.id}/cart/select-all`
     );
-    router.push('/my/quotations');
+    router.push('/my/transactions');
   };
 
   return (
     <div className='relative group'>
       <div>
         <Link
-          href='/my/quotations'
+          href='/my/transactions'
           target='_blank'
           rel='noreferrer'
           className='flex items-center gap-x-2 !text-gray_r-12/80'
@@ -138,7 +139,7 @@ const Quotationheader = (quotationCount) => {
           <span>
             List
             <br />
-            Quotation
+            Transactions
           </span>
         </Link>
       </div>
@@ -168,7 +169,7 @@ const Quotationheader = (quotationCount) => {
               >
                 <div className='p-2 flex justify-between items-center'>
                   <h5 className='text-base font-semibold leading-none'>
-                    Daftar Quotation
+                    Daftar Transaksi
                   </h5>
                 </div>
                 <hr className='mt-3 mb-3 border border-gray-100' />
@@ -183,7 +184,7 @@ const Quotationheader = (quotationCount) => {
                         >
                           Login
                         </Link>{' '}
-                        Untuk Melihat Daftar Quotation Anda
+                        Untuk Melihat Daftar Transaksi Anda
                       </p>
                     </div>
                   )}
@@ -209,7 +210,7 @@ const Quotationheader = (quotationCount) => {
                   {auth && qotation.length === 0 && !isLoading && (
                     <div className='justify-center p-4'>
                       <p className='text-gray-500 text-center '>
-                        Tidak Ada Quotation
+                        Tidak Ada Transaksi
                       </p>
                     </div>
                   )}
@@ -225,7 +226,7 @@ const Quotationheader = (quotationCount) => {
                               <li className='py-1 sm:py-2'>
                                 <div className='flex justify-between border p-2 flex-col gap-y-2 hover:border-red-500'>
                                   <Link
-                                    href={`/my/quotations/${product?.id}`}
+                                    href={`/my/transactions/${product?.id}`}
                                     className='hover:border-red-500'
                                   >
                                     <div className='flex justify-between mb-2'>
@@ -241,8 +242,8 @@ const Quotationheader = (quotationCount) => {
                                         <p className='text-xs opacity-80 mr-[2px]'>
                                           Status :
                                         </p>
-                                        <p className='badge-red h-fit text-xs whitespace-nowrap'>
-                                          Pending Quotation
+                                        <p className='badge-yellow h-fit text-xs whitespace-nowrap'>
+                                          Pesanan Diterima
                                         </p>
                                       </div>
                                     </div>
-- 
cgit v1.2.3


From 04961a55929017f77ee6801d2b7ada4c05689821 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 31 Jul 2025 15:55:05 +0700
Subject: <hafid> fix repeat order

---
 src/lib/quotation/components/Quotationheader.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/quotation/components/Quotationheader.jsx')

diff --git a/src/lib/quotation/components/Quotationheader.jsx b/src/lib/quotation/components/Quotationheader.jsx
index 6551296a..a035edc7 100644
--- a/src/lib/quotation/components/Quotationheader.jsx
+++ b/src/lib/quotation/components/Quotationheader.jsx
@@ -243,7 +243,7 @@ const Quotationheader = (quotationCount) => {
                                           Status :
                                         </p>
                                         <p className='badge-yellow h-fit text-xs whitespace-nowrap'>
-                                          Pesanan Diterima
+                                          Pesanan Diproses
                                         </p>
                                       </div>
                                     </div>
-- 
cgit v1.2.3

