From 07e4d2628a1a2c5107e693e2a99d1abb4d634e58 Mon Sep 17 00:00:00 2001 From: BrianJiang2021 <80307788+BrianJiang2021@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:23:36 +0800 Subject: [PATCH] Revert "feat: quote Tax and Estimated Tax judgment and shipping display https://bigc-b2b.atlassian.net/jira/software/c/projects/BUN/issues/BUN-1812" This reverts commit 96d35fb72132e170dfb83a459b94dd14991a1200. --- .../quote/components/QuoteDetailSummary.tsx | 127 ++++++++---------- .../pages/quote/components/QuoteSummary.tsx | 24 +--- packages/lang/locales/en.json | 5 +- 3 files changed, 57 insertions(+), 99 deletions(-) diff --git a/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx b/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx index 040e1692..4372ead5 100644 --- a/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx +++ b/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx @@ -44,51 +44,6 @@ export default function QuoteDetailSummary(props: QuoteDetailSummaryProps) { const priceFormat = (price: number) => `${currencyFormat(price)}` - const getShippingAndTax = () => { - if (quoteDetail?.shippingMethod?.id) { - return { - shippingText: `${b3Lang('quoteDetail.summary.shipping')}(${ - quoteDetail?.shippingMethod?.description || '' - })`, - shippingVal: priceFormat(+shipping), - taxText: b3Lang('quoteDetail.summary.tax'), - taxVal: priceFormat(+tax), - } - } - - if ( - !quoteDetail?.salesRepEmail && - !quoteDetail?.shippingMethod?.id && - +status === 1 - ) { - return { - shippingText: b3Lang('quoteDetail.summary.shipping'), - shippingVal: b3Lang('quoteDetail.summary.tbd'), - taxText: b3Lang('quoteDetail.summary.estimatedTax'), - taxVal: priceFormat(+tax), - } - } - - if ( - quoteDetail?.salesRepEmail && - !quoteDetail?.shippingMethod?.id && - (+status === 1 || +status === 5) - ) { - return { - shippingText: `${b3Lang('quoteDetail.summary.shipping')}(${b3Lang( - 'quoteDetail.summary.quoteCheckout' - )})`, - shippingVal: b3Lang('quoteDetail.summary.tbd'), - taxText: b3Lang('quoteDetail.summary.tax'), - taxVal: b3Lang('quoteDetail.summary.tbd'), - } - } - - return null - } - - const shippingAndTax = getShippingAndTax() - return ( @@ -116,26 +71,22 @@ export default function QuoteDetailSummary(props: QuoteDetailSummaryProps) { {priceFormat(getCurrentPrice(subtotalPrice, quoteDetailTax))} - - {!quoteDetail?.salesRepEmail && +status === 1 ? null : ( - - - {b3Lang('quoteDetail.summary.discountAmount')} - - - {+discount > 0 - ? `-${priceFormat(+discount)}` - : priceFormat(+discount)} - - - )} - + + + {b3Lang('quoteDetail.summary.discountAmount')} + + + {+discount > 0 + ? `-${priceFormat(+discount)}` + : priceFormat(+discount)} + + - - {shippingAndTax && ( + {quoteDetail?.shippingMethod?.id ? ( <> - {shippingAndTax.shippingText} + {`${b3Lang('quoteDetail.summary.shipping')}(${ + quoteDetail?.shippingMethod?.description || '' + })`} - {shippingAndTax.shippingVal} + {priceFormat(+shipping)} - {shippingAndTax.taxText} - {shippingAndTax.taxVal} + {b3Lang('quoteDetail.summary.tax')} + {priceFormat(+tax)} - )} + ) : null} + {quoteDetail?.salesRepEmail && + !quoteDetail?.shippingMethod?.id && + (+status === 1 || +status === 5) ? ( + <> + + + {`${b3Lang('quoteDetail.summary.shipping')}(${b3Lang( + 'quoteDetail.summary.quoteCheckout' + )})`} + + TBD + + + {b3Lang('quoteDetail.summary.tax')} + TBD + + + ) : null} ) => { {priceFormat(quoteSummary.subtotal)} - - - {b3Lang('quoteDraft.quoteSummary.shipping')} - - {b3Lang('quoteDraft.quoteSummary.tbd')} - - - - {b3Lang('quoteDraft.quoteSummary.tax')} - {priceFormat(quoteSummary.tax)} - + {/* Remove the Shipping and Tax lines on a “draft” Quote. --BUN-1550 */}