Skip to content

Commit b0af232

Browse files
authored
fix(metadata): drop hard-coded "$" from money formats so amounts don't force USD (#437)
Switch all money display formats from '$0,0' to plain '0,0' across the opportunity/account/product datasets and the executive/sales/crm dashboards, so amounts render as plain grouped numbers unless a currency is actually configured (field code or workspace default) rather than a hard-coded "$". Companion to framework#2672. typecheck + validate pass.
1 parent beb23c5 commit b0af232

7 files changed

Lines changed: 18 additions & 11 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'hotcrm': patch
3+
---
4+
5+
Drop the hard-coded `$` from money display formats so amounts don't force a USD symbol.
6+
7+
Currency measures and table/axis columns used the numeral format `'$0,0'`, which bakes a literal `$` into every rendered amount regardless of the actual currency. Combined with the platform's (now removed) default currency, the Executive Overview KPI showed `US$2,528,600` even though the `amount` field declares no currency of its own. All money formats are now plain `'0,0'` (grouped number, no symbol) across the opportunity/account/product datasets and the executive/sales/crm dashboards, so amounts render as plain numbers unless a currency is actually configured (a field code or a workspace default).

src/dashboards/crm.dashboard.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const CrmOverviewDashboard: Dashboard = {
139139
showDataLabels: false,
140140
colors: ['#10B981'],
141141
xAxis: { field: 'close_date', title: 'Month', showGridLines: false, logarithmic: false },
142-
yAxis: [{ field: 'total_amount', title: 'Revenue', format: '$0,0', showGridLines: true, logarithmic: false }],
142+
yAxis: [{ field: 'total_amount', title: 'Revenue', format: '0,0', showGridLines: true, logarithmic: false }],
143143
interaction: { tooltips: true, brush: true, zoom: false },
144144
},
145145
options: { dateGranularity: 'month' },
@@ -191,7 +191,7 @@ export const CrmOverviewDashboard: Dashboard = {
191191
showDataLabels: true,
192192
colors: ['#4F46E5'],
193193
xAxis: { field: 'category', title: 'Category', showGridLines: false, logarithmic: false },
194-
yAxis: [{ field: 'list_price_sum', title: 'Revenue', format: '$0,0', showGridLines: true, logarithmic: false }],
194+
yAxis: [{ field: 'list_price_sum', title: 'Revenue', format: '0,0', showGridLines: true, logarithmic: false }],
195195
},
196196
},
197197

@@ -215,9 +215,9 @@ export const CrmOverviewDashboard: Dashboard = {
215215
options: {
216216
columns: [
217217
{ header: 'Owner', accessorKey: 'owner' },
218-
{ header: 'Pipeline', accessorKey: 'total_amount', format: '$0,0' },
218+
{ header: 'Pipeline', accessorKey: 'total_amount', format: '0,0' },
219219
{ header: 'Opportunities', accessorKey: 'opp_count' },
220-
{ header: 'Avg Deal Size', accessorKey: 'avg_amount', format: '$0,0' },
220+
{ header: 'Avg Deal Size', accessorKey: 'avg_amount', format: '0,0' },
221221
],
222222
sortBy: 'total_amount',
223223
sortOrder: 'desc',

src/dashboards/executive.dashboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const ExecutiveDashboard: Dashboard = {
151151
showDataLabels: false,
152152
colors: ['#10B981'],
153153
xAxis: { field: 'close_date', title: 'Month', showGridLines: false, logarithmic: false },
154-
yAxis: [{ field: 'total_amount', title: 'Revenue', format: '$0,0', showGridLines: true, logarithmic: false }],
154+
yAxis: [{ field: 'total_amount', title: 'Revenue', format: '0,0', showGridLines: true, logarithmic: false }],
155155
interaction: { tooltips: true, zoom: false, brush: true },
156156
},
157157
options: { dateGranularity: 'month' },
@@ -228,7 +228,7 @@ export const ExecutiveDashboard: Dashboard = {
228228
options: {
229229
columns: [
230230
{ header: 'Industry', accessorKey: 'industry' },
231-
{ header: 'Annual Revenue', accessorKey: 'annual_revenue_sum', format: '$0,0' },
231+
{ header: 'Annual Revenue', accessorKey: 'annual_revenue_sum', format: '0,0' },
232232
{ header: 'Accounts', accessorKey: 'account_count' },
233233
],
234234
sortBy: 'annual_revenue_sum',

src/dashboards/sales.dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export const SalesDashboard: Dashboard = {
227227
options: {
228228
columns: [
229229
{ header: 'Owner', accessorKey: 'owner' },
230-
{ header: 'Open Pipeline', accessorKey: 'total_amount', format: '$0,0' },
230+
{ header: 'Open Pipeline', accessorKey: 'total_amount', format: '0,0' },
231231
{ header: 'Open Deals', accessorKey: 'opp_count' },
232232
{ header: 'Avg Win Prob.', accessorKey: 'avg_probability', format: '0%' },
233233
],

src/datasets/account.dataset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export const AccountDataset = defineDataset({
1515
],
1616
measures: [
1717
{ name: 'account_count', label: 'Accounts', aggregate: 'count' },
18-
{ name: 'annual_revenue_sum', label: 'Annual Revenue', aggregate: 'sum', field: 'annual_revenue', format: '$0,0' },
18+
{ name: 'annual_revenue_sum', label: 'Annual Revenue', aggregate: 'sum', field: 'annual_revenue', format: '0,0' },
1919
],
2020
});

src/datasets/opportunity.dataset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export const OpportunityDataset = defineDataset({
3333

3434
measures: [
3535
{ name: 'opp_count', label: 'Opportunities', aggregate: 'count' },
36-
{ name: 'total_amount', label: 'Total Amount', aggregate: 'sum', field: 'amount', format: '$0,0' },
37-
{ name: 'avg_amount', label: 'Avg Deal Size', aggregate: 'avg', field: 'amount', format: '$0,0' },
36+
{ name: 'total_amount', label: 'Total Amount', aggregate: 'sum', field: 'amount', format: '0,0' },
37+
{ name: 'avg_amount', label: 'Avg Deal Size', aggregate: 'avg', field: 'amount', format: '0,0' },
3838
{ name: 'avg_probability', label: 'Avg Probability', aggregate: 'avg', field: 'probability', format: '0%' },
3939
],
4040
});

src/datasets/product.dataset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ export const ProductDataset = defineDataset({
1313
],
1414
measures: [
1515
{ name: 'product_count', label: 'Products', aggregate: 'count' },
16-
{ name: 'list_price_sum', label: 'Total List Price', aggregate: 'sum', field: 'list_price', format: '$0,0' },
16+
{ name: 'list_price_sum', label: 'Total List Price', aggregate: 'sum', field: 'list_price', format: '0,0' },
1717
],
1818
});

0 commit comments

Comments
 (0)