From 721067120c2756554829070b3fa10de7f04ae705 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 12 Jul 2024 11:34:23 +0700 Subject: update input note --- src/lib/quotation/components/Quotation.jsx | 35 ++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/quotation/components/Quotation.jsx b/src/lib/quotation/components/Quotation.jsx index 8855c6c4..19419f61 100644 --- a/src/lib/quotation/components/Quotation.jsx +++ b/src/lib/quotation/components/Quotation.jsx @@ -67,17 +67,19 @@ const Quotation = () => { const [selectedExpedisiService, setselectedExpedisiService] = useState(null); const [etd, setEtd] = useState(null); const [etdFix, setEtdFix] = useState(null); - + const [isApproval, setIsApproval] = useState(false); - + const expedisiValidation = useRef(null); - + const [selectedAddress, setSelectedAddress] = useState({ shipping: null, invoicing: null, }); - + const [addresses, setAddresses] = useState(null); + + const [note_websiteText, setselectedNote_websiteText] = useState(null); useEffect(() => { if (!auth) return; @@ -262,6 +264,12 @@ const Quotation = () => { } if (!products || products.length == 0) return; + + if (auth?.feature?.soApproval && !note_websiteText.trim()) { + toast.error('Note harus diisi karena fitur soApproval aktif.'); + return; + } + setIsLoading(true); const productOrder = products.map((product) => ({ product_id: product.id, @@ -276,6 +284,7 @@ const Quotation = () => { carrier_id: selectedCarrierId, estimated_arrival_days: splitDuration(etd), delivery_service_type: selectedExpedisiService, + note_website : note_websiteText, }; console.log('data checkout', data); const isSuccess = await checkoutApi({ data }); @@ -291,6 +300,8 @@ const Quotation = () => { const taxTotal = (totalAmount - totalDiscountAmount) * 0.11; + console.log("note_websiteText",note_websiteText) + return ( <> @@ -576,6 +587,22 @@ const Quotation = () => { yang berlaku

+
+
+ +
+
Note
+
+