From 88198c83806b69ce6ab7815cee5c139536849c9f Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 8 Nov 2024 13:55:44 +0700
Subject: <iman> update quotation website

---
 src/lib/transaction/components/Transaction.jsx | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 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 d9edb670..6277e3e0 100644
--- a/src/lib/transaction/components/Transaction.jsx
+++ b/src/lib/transaction/components/Transaction.jsx
@@ -90,16 +90,20 @@ const Transaction = ({ id }) => {
   const [continueTransaction, setContinueTransaction] = useState(false);
   const openCancelTransaction = () => setCancelTransaction(true);
   const openContinueTransaction = () => {
-    if (!transaction.data?.purchaseOrderFile) {
-      setContinueTransaction(true);
-    } else {
+    if (auth.partnerTempo) {
       checkout();
+    } else {
+      if (!transaction.data?.purchaseOrderFile) {
+        setContinueTransaction(true);
+      } else {
+        checkoutNoPO();
+      }
     }
   };
-  const ContinueTransaction = () => {
-    setContinueNoPo(true);
-    checkoutNoPO();
-  };
+  // const ContinueTransaction = () => {
+  //   setContinueNoPo(true);
+  //   checkoutNoPO();
+  // };
   const closeCancelTransaction = () => setCancelTransaction(false);
   const closeContinueTransaction = () => setContinueTransaction(false);
 
@@ -119,10 +123,10 @@ const Transaction = ({ id }) => {
   };
   console.log('transaction', transaction);
   const checkout = async () => {
-    // if (!transaction.data?.purchaseOrderFile) {
-    //   toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan');
-    //   return;
-    // }
+    if (!transaction.data?.purchaseOrderFile) {
+      toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan');
+      return;
+    }
     await checkoutPoApi({ id, status: true });
     toast.success('Berhasil melanjutkan pesanan');
     transaction.refetch();
-- 
cgit v1.2.3

