From 57ace93dc3090a54d65d3b84ae50e8a9249eb314 Mon Sep 17 00:00:00 2001
From: Miqdad <ahmadmiqdad27@gmail.com>
Date: Mon, 8 Sep 2025 14:58:30 +0700
Subject: <Miqdad> Sip

---
 src/lib/transaction/components/Transaction.jsx | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 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 5ee56972..96c89aec 100644
--- a/src/lib/transaction/components/Transaction.jsx
+++ b/src/lib/transaction/components/Transaction.jsx
@@ -502,36 +502,40 @@ const Transaction = ({ id }) => {
           active={toOthers}
           close={() => setToOthers(null)}
         >
-          <div className='flex flex-col gap-y-4 mt-2'>
+          {transaction.data?.status === 'draft' && (
+            <>
             <button
               className='text-left disabled:opacity-60'
-              disabled={!toOthers?.purchaseOrderFile}
+              disabled={toOthers?.status != 'draft'}
               onClick={() => {
-                downloadPurchaseOrder(toOthers);
+                downloadQuotation(toOthers);
                 setToOthers(null);
               }}
             >
-              Download PO
+              Download Quotation
             </button>
             <button
               className='text-left disabled:opacity-60'
-              disabled={toOthers?.status != 'draft'}
+              disabled={toOthers?.status != 'waiting'}
               onClick={() => {
-                downloadQuotation(toOthers);
+                setToCancel(toOthers);
                 setToOthers(null);
               }}
             >
-              Download Quotation
+              Batalkan Transaksi
             </button>
+            </>
+          )}
+          <div className='flex flex-col gap-y-4 mt-2'>
             <button
               className='text-left disabled:opacity-60'
-              disabled={toOthers?.status != 'waiting'}
+              disabled={!toOthers?.purchaseOrderFile}
               onClick={() => {
-                setToCancel(toOthers);
+                downloadPurchaseOrder(toOthers);
                 setToOthers(null);
               }}
             >
-              Batalkan Transaksi
+              Download PO
             </button>
           </div>
         </BottomPopup>
-- 
cgit v1.2.3

