diff --git a/apps/storefront/src/pages/quote/QuoteDetail.tsx b/apps/storefront/src/pages/quote/QuoteDetail.tsx index 8ffd1a28..88cf9588 100644 --- a/apps/storefront/src/pages/quote/QuoteDetail.tsx +++ b/apps/storefront/src/pages/quote/QuoteDetail.tsx @@ -525,6 +525,7 @@ function QuoteDetail() { isHandleApprove={isHandleApprove} getQuoteTableDetails={getQuoteTableDetails} getTaxRate={getTaxRate} + displayDiscount={quoteDetail.displayDiscount} /> diff --git a/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx b/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx index 1de5144f..3c46a717 100644 --- a/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx +++ b/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx @@ -110,22 +110,24 @@ export default function QuoteDetailSummary(props: QuoteDetailSummaryProps) { color: '#212121', }} > - - - {b3Lang('quoteDetail.summary.originalSubtotal')} - - - {showPrice( - priceFormat(getCurrentPrice(subtotalPrice, quoteDetailTax)) - )} - - + {quoteDetail?.displayDiscount && ( + + + {b3Lang('quoteDetail.summary.originalSubtotal')} + + + {showPrice( + priceFormat(getCurrentPrice(subtotalPrice, quoteDetailTax)) + )} + + + )} {!quoteDetail?.salesRepEmail && +status === 1 ? null : ( isHandleApprove: boolean getTaxRate: (taxClassId: number, variants: any) => number + displayDiscount: boolean } interface SearchProps { @@ -103,7 +104,13 @@ const StyledImage = styled('img')(() => ({ function QuoteDetailTable(props: ShoppingDetailTableProps, ref: Ref) { const b3Lang = useB3Lang() - const { total, getQuoteTableDetails, getTaxRate, isHandleApprove } = props + const { + total, + getQuoteTableDetails, + getTaxRate, + isHandleApprove, + displayDiscount, + } = props const { global: { @@ -240,7 +247,7 @@ function QuoteDetailTable(props: ShoppingDetailTableProps, ref: Ref) { const price = getBCPrice(+basePrice, taxPrice) const discountPrice = getBCPrice(+offeredPrice, discountTaxPrice) - const isDiscount = +basePrice - +offeredPrice > 0 + const isDiscount = +basePrice - +offeredPrice > 0 && displayDiscount return ( <> @@ -309,7 +316,7 @@ function QuoteDetailTable(props: ShoppingDetailTableProps, ref: Ref) { const price = getBCPrice(+basePrice, taxPrice) const discountPrice = getBCPrice(+offeredPrice, discountTaxPrice) - const isDiscount = +basePrice - +offeredPrice > 0 + const isDiscount = +basePrice - +offeredPrice > 0 && displayDiscount const total = price * +quantity const totalWithDiscount = discountPrice * +quantity @@ -381,6 +388,7 @@ function QuoteDetailTable(props: ShoppingDetailTableProps, ref: Ref) { item={row} showPrice={showPrice} itemIndex={index} + displayDiscount={displayDiscount} getTaxRate={getTaxRate} /> )} diff --git a/apps/storefront/src/pages/quote/components/QuoteDetailTableCard.tsx b/apps/storefront/src/pages/quote/components/QuoteDetailTableCard.tsx index a46363c0..6425b84f 100644 --- a/apps/storefront/src/pages/quote/components/QuoteDetailTableCard.tsx +++ b/apps/storefront/src/pages/quote/components/QuoteDetailTableCard.tsx @@ -12,6 +12,7 @@ interface QuoteTableCardProps { getTaxRate: (taxClassId: number, variants: any) => number itemIndex?: number showPrice: (price: string, row: CustomFieldItems) => string | number + displayDiscount: boolean } const StyledImage = styled('img')(() => ({ @@ -21,7 +22,14 @@ const StyledImage = styled('img')(() => ({ })) function QuoteDetailTableCard(props: QuoteTableCardProps) { - const { item: quoteTableItem, len, itemIndex, getTaxRate, showPrice } = props + const { + item: quoteTableItem, + len, + itemIndex, + getTaxRate, + showPrice, + displayDiscount, + } = props const b3Lang = useB3Lang() const { @@ -51,7 +59,7 @@ function QuoteDetailTableCard(props: QuoteTableCardProps) { const price = getBCPrice(+basePrice, taxPrice) const discountPrice = getBCPrice(+offeredPrice, discountTaxPrice) - const isDiscount = +basePrice - +offeredPrice > 0 + const isDiscount = +basePrice - +offeredPrice > 0 && displayDiscount const total = +price * +quantity const totalWithDiscount = discountPrice * +quantity