diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-09-08 14:58:30 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-09-08 14:58:30 +0700 |
| commit | 57ace93dc3090a54d65d3b84ae50e8a9249eb314 (patch) | |
| tree | 327af109c1be6b4b3fc367fac9ebea3bb952c289 | |
| parent | c4a16600cd75afea1ca56cfa38d0db4088ad203f (diff) | |
<Miqdad> Sip
| -rw-r--r-- | src/lib/transaction/components/Transaction.jsx | 24 | ||||
| -rw-r--r-- | src/lib/transaction/components/Transactions.jsx | 44 |
2 files changed, 38 insertions, 30 deletions
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> diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx index 2e3eaaa2..600518fa 100644 --- a/src/lib/transaction/components/Transactions.jsx +++ b/src/lib/transaction/components/Transactions.jsx @@ -704,6 +704,30 @@ const Transactions = ({ context = '' }) => { active={toOthers} close={() => setToOthers(null)} > + {transactions.data?.status === 'draft' && ( + <> + <button + className='text-left disabled:opacity-60' + disabled={toOthers?.status != 'draft'} + onClick={() => { + downloadQuotation(toOthers); + setToOthers(null); + }} + > + Download Quotation + </button> + <button + className='text-left disabled:opacity-60' + disabled={toOthers?.status != 'waiting'} + onClick={() => { + setToCancel(toOthers); + setToOthers(null); + }} + > + Batalkan Transaksi + </button> + </> + )} <div className='flex flex-col gap-y-4 mt-2'> <button className='text-left disabled:opacity-60' @@ -715,26 +739,6 @@ const Transactions = ({ context = '' }) => { > Download PO </button> - <button - className='text-left disabled:opacity-60' - disabled={toOthers?.status != 'draft'} - onClick={() => { - downloadQuotation(toOthers); - setToOthers(null); - }} - > - Download Quotation - </button> - <button - className='text-left disabled:opacity-60' - disabled={toOthers?.status != 'waiting'} - onClick={() => { - setToCancel(toOthers); - setToOthers(null); - }} - > - Batalkan Transaksi - </button> </div> </BottomPopup> |
