diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-08 13:55:44 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-08 13:55:44 +0700 |
| commit | 88198c83806b69ce6ab7815cee5c139536849c9f (patch) | |
| tree | 5a6da519dd9069fc9f1a8435392a0ab835a366fd | |
| parent | f80551e64e7b4fa1463ecd47d744f7f2846abfda (diff) | |
<iman> update quotation website
| -rw-r--r-- | src-migrate/types/auth.ts | 9 | ||||
| -rw-r--r-- | src/lib/transaction/components/Transaction.jsx | 26 |
2 files changed, 20 insertions, 15 deletions
diff --git a/src-migrate/types/auth.ts b/src-migrate/types/auth.ts index 593e120f..8feac2e1 100644 --- a/src-migrate/types/auth.ts +++ b/src-migrate/types/auth.ts @@ -16,10 +16,11 @@ export type AuthProps = { company: boolean; pricelist: string | null; token: string; - feature : { - onlyReadyStock : boolean, - soApproval : boolean - } + feature: { + onlyReadyStock: boolean; + soApproval: boolean; + }; + partner_tempo: boolean; }; export type AuthApiProps = OdooApiRes<AuthProps>; 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(); |
