diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-08-06 14:17:51 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-08-06 14:17:51 +0700 |
| commit | 48db7565a82c8785a29cb3eee14306d65d61255c (patch) | |
| tree | 873191eaa4360a694e86d6cba2f9adf29b0d1948 /src | |
| parent | 04961a55929017f77ee6801d2b7ada4c05689821 (diff) | |
<hafid> button cancel & download in quotation
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/transaction/components/Transaction.jsx | 146 |
1 files changed, 29 insertions, 117 deletions
diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index 2c1a6208..842567f8 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -819,64 +819,23 @@ const Transaction = ({ id }) => { {/* <Divider /> */} - {/* <div className='p-4 pt-0'> - {transaction.data?.status == 'draft' && - auth?.feature.soApproval && ( - <div className='flex gap-x-2'> - <button - className='btn-yellow w-full' - onClick={checkout} - disabled={ - transaction.data?.status === 'cancel' - ? true - : false || auth?.webRole === statusApprovalWeb - ? true - : false - } - > - Approve - </button> - <button - className='btn-solid-red px-7 w-full' - onClick={checkout} - disabled={ - transaction.data?.status === 'cancel' - ? true - : false || auth?.webRole === statusApprovalWeb - ? true - : false - } - > - Reject - </button> - </div> - )} - {transaction.data?.status == 'draft' && - !auth?.feature?.soApproval && ( - <button - className='btn-yellow w-full mt-4' - onClick={openContinueTransaction} - > - Lanjutkan Transaksi - </button> - )} - <button - className='btn-light w-full mt-4' - disabled={transaction.data?.status != 'draft'} - onClick={() => downloadQuotation(transaction.data)} - > - Download Quotation - </button> - {transaction.data?.status != 'draft' && ( + {transaction.data?.status === 'draft' && ( + <div className='p-4 pt-0'> <button - className='btn-light w-full mt-4' - disabled={transaction.data?.status != 'waiting'} + className='btn-yellow w-full mt-4' + disabled={transaction.data?.status != 'draft'} + onClick={() => downloadQuotation(transaction.data)} + > + Download Quotation + </button> + <button + className='btn-solid-red w-full mt-4' onClick={openCancelTransaction} > Batalkan Transaksi </button> - )} - </div> */} + </div> + )} </MobileView> <DesktopView> @@ -918,70 +877,23 @@ const Transaction = ({ id }) => { </span> <TransactionStatusBadge status={transaction?.data?.status} /> </div> - {/* <div className='flex gap-x-4'> - <button - type='button' - className='btn-solid-red px-3 py-2 mr-auto' - onClick={() => downloadQuotation(transaction.data)} - > - Download - </button> - {transaction.data?.status == 'draft' && - auth?.feature?.soApproval && - auth?.webRole && ( - <div className='flex gap-x-2'> - <button - className='btn-yellow' - onClick={handleApproval} - disabled={ - transaction.data?.status === 'cancel' - ? true - : false || auth?.webRole === statusApprovalWeb - ? true - : false || statusApprovalWeb < 1 - ? true - : false - } - > - Approve - </button> - <button - className='btn-solid-red px-7' - onClick={openRejectTransaction} - disabled={ - transaction.data?.status === 'cancel' - ? true - : false || auth?.webRole === statusApprovalWeb - ? true - : false || statusApprovalWeb < 1 - ? true - : false - } - > - Reject - </button> - </div> - )} - {transaction.data?.status == 'draft' && - !auth?.feature.soApproval && ( - <button - className='btn-yellow' - onClick={openContinueTransaction} - > - Lanjutkan Transaksi - </button> - )} - {transaction.data?.status != 'draft' && - !auth?.feature.soApproval && ( - <button - className='btn-light' - disabled={transaction.data?.status != 'waiting'} - onClick={openCancelTransaction} - > - Batalkan Transaksi - </button> - )} - </div> */} + {transaction.data?.status === 'draft' && ( + <div className='flex gap-x-4'> + <button + type='button' + className='btn-yellow px-3 py-2 mr-auto' + onClick={() => downloadQuotation(transaction.data)} + > + Download + </button> + <button + className='btn-solid-red' + onClick={openCancelTransaction} + > + Batalkan Transaksi + </button> + </div> + )} <div className='grid grid-cols-2 gap-x-6 mt-4'> <div className='grid grid-cols-[35%_65%] gap-y-4'> |
