Skip to content

Commit abc2fca

Browse files
Merge pull request #82 from vtex-apps/B2BTEAM-3104
fix promotions behavior and texts
2 parents 3c2e790 + f6a6a3e commit abc2fca

5 files changed

Lines changed: 34 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Promotional prices not being preserved when creating quotes
13+
- Items with promotional price of $0.00 not being included in quotes
14+
- Large currency values (>9,999.99) being truncated in Total and Quoted Price columns
15+
- Unit Multiplier column width adjusted to prevent text truncation
16+
1017
## [3.0.4] - 2026-01-06
1118

1219
### Added

react/components/OrganizationAndCostCenterFilter.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,14 @@ const OrganizationAndCostCenterFilter = ({
225225
const [orgState, setOrgState] = useState(organizationId)
226226
const [costCenterState, setCostCenterState] = useState(costCenterId)
227227

228-
const onChangeOrganization = useCallback((value: string) => {
229-
setOrgState(value)
230-
setCostCenterState('')
231-
}, [])
228+
const onChangeOrganization = useCallback(
229+
(value: string) => {
230+
setOrgState(value)
231+
setCostCenterState('')
232+
onChange({ organizationId: value, costCenterId: '' })
233+
},
234+
[onChange]
235+
)
232236

233237
const onChangeCostCenter = useCallback(
234238
(value: string) => {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* prevent overflow for large values in total column */
2+
.quoteTable :global(.vtex-format-currency-2-x-currencyContainer),
3+
.quoteTable :global([class*='currencyContainer']) {
4+
white-space: nowrap;
5+
overflow: visible;
6+
}

react/components/QuoteDetails/QuoteTable.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import { itemDiscountEligible } from '../../utils/helpers'
1616
import { quoteMessages, statusMessages } from '../../utils/messages'
1717
import { LabelByStatusMap } from '../../utils/status'
18+
import styles from './QuoteTable.css'
1819

1920
const QuoteTable = ({
2021
isNewQuote,
@@ -55,6 +56,7 @@ const QuoteTable = ({
5556
<Table
5657
totalizers={totalizers}
5758
fullWidth
59+
className={styles.quoteTable}
5860
schema={{
5961
properties: {
6062
imageUrl: {
@@ -118,7 +120,7 @@ const QuoteTable = ({
118120
sellingPrice: {
119121
title: formatMessage(quoteMessages.quotePrice),
120122
headerRight: true,
121-
width: 120,
123+
width: 150,
122124
cellRenderer: ({
123125
cellData: sellingPrice,
124126
rowData: { id: itemId, listPrice, error },
@@ -177,7 +179,7 @@ const QuoteTable = ({
177179
unitMultiplier: {
178180
title: formatMessage(quoteMessages.unitMultiplier),
179181
headerRight: true,
180-
width: 80,
182+
width: 180,
181183
cellRenderer: ({ rowData: { id } }: any) => {
182184
const hasMultipliers =
183185
unitMultipliers && Object.keys(unitMultipliers).length > 0
@@ -203,7 +205,7 @@ const QuoteTable = ({
203205
: ''
204206

205207
return (
206-
<span className="tr w-100">
208+
<div className="tr w-100">
207209
<FormattedCurrency
208210
value={
209211
rowData.sellingPrice
@@ -212,10 +214,10 @@ const QuoteTable = ({
212214
: 0
213215
}
214216
/>
215-
</span>
217+
</div>
216218
)
217219
},
218-
width: 100,
220+
width: 150,
219221
},
220222
},
221223
}}

react/utils/helpers.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ export const initQuoteFromOrderForm = (orderForm: any) => {
1414

1515
if (existingItem) {
1616
existingItem.quantity += item.quantity
17-
} else if (item.sellingPrice !== 0) {
17+
} else {
1818
quoteItems.push({
1919
...item,
20-
listPrice: item.listPrice * 100,
21-
price: item.price * 100,
22-
sellingPrice: item.price * 100,
20+
listPrice:
21+
typeof item.listPrice === 'number' ? item.listPrice * 100 : 0,
22+
price: typeof item.price === 'number' ? item.price * 100 : 0,
23+
sellingPrice:
24+
typeof item.sellingPrice === 'number' ? item.sellingPrice * 100 : 0,
2325
})
2426
}
2527
})

0 commit comments

Comments
 (0)