Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: don't use 4 digits for currency

Brad Barbin89205e642125
diff --git a/apps/carbon/app/components/SortableList.tsx b/apps/carbon/app/components/SortableList.tsx
index 82a6ade673..7269cb747b 100644
--- a/apps/carbon/app/components/SortableList.tsx
+++ b/apps/carbon/app/components/SortableList.tsx
@@ -68,7 +68,7 @@ function SortableListItem<T>({
className={cn(
"relative z-auto grow",
"h-full rounded-md bg-card",
- "border border-border shadow-md",
+ "border border-border shadow-sm",
"dark:border-0 dark:shadow-[0px_1px_0px_0px_hsla(0,0%,100%,.03)_inset,0px_0px_0px_1px_hsla(0,0%,100%,.03)_inset,0px_0px_0px_1px_rgba(0,0,0,.1),0px_2px_2px_0px_rgba(0,0,0,.1),0px_4px_4px_0px_rgba(0,0,0,.1),0px_8px_8px_0px_rgba(0,0,0,.1)]",
item.checked ? "cursor-not-allowed" : "cursor-grab",
item.checked && !isDragging ? "w-7/10" : "w-full"
diff --git a/apps/carbon/app/hooks/useCurrencyFormatter.tsx b/apps/carbon/app/hooks/useCurrencyFormatter.tsx
index 2773031830..4a00584fe5 100644
--- a/apps/carbon/app/hooks/useCurrencyFormatter.tsx
+++ b/apps/carbon/app/hooks/useCurrencyFormatter.tsx
@@ -12,7 +12,6 @@ export function useCurrencyFormatter(currencyCode?: string) {
new Intl.NumberFormat(locale, {
style: "currency",
currency: currency,
- maximumFractionDigits: 4,
}),
[locale, currency]
);
diff --git a/apps/carbon/app/modules/items/ui/Item/BuyMethodForm.tsx b/apps/carbon/app/modules/items/ui/Item/BuyMethodForm.tsx
index 0ddf14494a..2666e0cb20 100644
--- a/apps/carbon/app/modules/items/ui/Item/BuyMethodForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/BuyMethodForm.tsx
@@ -91,7 +91,6 @@ const BuyMethodForm = ({ initialValues, type }: BuyMethodFormProps) => {
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
/>
<UnitOfMeasure
diff --git a/apps/carbon/app/modules/items/ui/Item/ItemCostingForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemCostingForm.tsx
index 32ccd2175d..6a4ee8ab21 100644
--- a/apps/carbon/app/modules/items/ui/Item/ItemCostingForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemCostingForm.tsx
@@ -59,7 +59,7 @@ const ItemCostingForm = ({ initialValues }: ItemCostingFormProps) => {
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
+
}}
isReadOnly={partCostingMethod !== "Standard"}
/> */}
@@ -70,7 +70,6 @@ const ItemCostingForm = ({ initialValues }: ItemCostingFormProps) => {
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
/>
@@ -80,7 +79,7 @@ const ItemCostingForm = ({ initialValues }: ItemCostingFormProps) => {
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
+
}}
isReadOnly
/>
diff --git a/apps/carbon/app/modules/items/ui/Item/ItemSalePriceForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemSalePriceForm.tsx
index b56ae1406a..2ca6cb0cc8 100644
--- a/apps/carbon/app/modules/items/ui/Item/ItemSalePriceForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemSalePriceForm.tsx
@@ -48,7 +48,6 @@ const ItemSalePriceForm = ({ initialValues }: ItemSalePriceFormProps) => {
formatOptions={{
style: "currency",
currency,
- maximumFractionDigits: 4,
}}
/>
<Currency
diff --git a/apps/carbon/app/modules/items/ui/Materials/MaterialForm.tsx b/apps/carbon/app/modules/items/ui/Materials/MaterialForm.tsx
index 9bed3461f3..996aff0371 100644
--- a/apps/carbon/app/modules/items/ui/Materials/MaterialForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Materials/MaterialForm.tsx
@@ -179,7 +179,6 @@ const MaterialForm = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
minValue={0}
/>
diff --git a/apps/carbon/app/modules/items/ui/Parts/PartForm.tsx b/apps/carbon/app/modules/items/ui/Parts/PartForm.tsx
index f519deb880..5dd6303b81 100644
--- a/apps/carbon/app/modules/items/ui/Parts/PartForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Parts/PartForm.tsx
@@ -179,7 +179,6 @@ const PartForm = ({ initialValues, type = "card", onClose }: PartFormProps) => {
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
minValue={0}
/>
diff --git a/apps/carbon/app/modules/items/ui/Tools/ToolForm.tsx b/apps/carbon/app/modules/items/ui/Tools/ToolForm.tsx
index 8377d4d7ff..ef2b0e5eb7 100644
--- a/apps/carbon/app/modules/items/ui/Tools/ToolForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Tools/ToolForm.tsx
@@ -179,7 +179,6 @@ const ToolForm = ({ initialValues, type = "card", onClose }: ToolFormProps) => {
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
minValue={0}
/>
diff --git a/apps/carbon/app/modules/production/ui/Jobs/JobBillOfMaterial.tsx b/apps/carbon/app/modules/production/ui/Jobs/JobBillOfMaterial.tsx
index 4a5782357a..0dd9478f4e 100644
--- a/apps/carbon/app/modules/production/ui/Jobs/JobBillOfMaterial.tsx
+++ b/apps/carbon/app/modules/production/ui/Jobs/JobBillOfMaterial.tsx
@@ -600,7 +600,6 @@ function MaterialForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
/>
)}
diff --git a/apps/carbon/app/modules/production/ui/Jobs/JobBillOfProcess.tsx b/apps/carbon/app/modules/production/ui/Jobs/JobBillOfProcess.tsx
index 313446a3c1..8d18bb794a 100644
--- a/apps/carbon/app/modules/production/ui/Jobs/JobBillOfProcess.tsx
+++ b/apps/carbon/app/modules/production/ui/Jobs/JobBillOfProcess.tsx
@@ -985,7 +985,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
@@ -1002,7 +1001,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
@@ -1281,7 +1279,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
@@ -1298,7 +1295,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
@@ -1315,7 +1311,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcessForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcessForm.tsx
index 066c4eb23b..86fbfa260c 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcessForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcessForm.tsx
@@ -119,7 +119,6 @@ const SupplierProcessForm = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
minValue={0}
/>
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcesses.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcesses.tsx
index 694c98765d..cddf5e755d 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcesses.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcesses.tsx
@@ -135,7 +135,6 @@ const SupplierProccesses = ({ processes }: SupplierProccessesProps) => {
formatOptions: {
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
},
}),
leadTime: EditableNumber(onCellEdit),
diff --git a/apps/carbon/app/modules/resources/ui/WorkCenters/WorkCenterForm.tsx b/apps/carbon/app/modules/resources/ui/WorkCenters/WorkCenterForm.tsx
index 7c11ca6976..6da5e455c2 100644
--- a/apps/carbon/app/modules/resources/ui/WorkCenters/WorkCenterForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/WorkCenters/WorkCenterForm.tsx
@@ -114,7 +114,6 @@ const WorkCenterForm = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
/>
<Number
@@ -123,7 +122,6 @@ const WorkCenterForm = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
/>
<Number
@@ -132,7 +130,6 @@ const WorkCenterForm = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
/>
diff --git a/apps/carbon/app/modules/sales/ui/Quotes/QuoteBillOfMaterial.tsx b/apps/carbon/app/modules/sales/ui/Quotes/QuoteBillOfMaterial.tsx
index 0a54912ea7..d58dc57e39 100644
--- a/apps/carbon/app/modules/sales/ui/Quotes/QuoteBillOfMaterial.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotes/QuoteBillOfMaterial.tsx
@@ -601,7 +601,6 @@ function MaterialForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
/>
)}
diff --git a/apps/carbon/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx b/apps/carbon/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx
index 40157cd043..2b6eeed110 100644
--- a/apps/carbon/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx
@@ -852,7 +852,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
@@ -869,7 +868,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
@@ -1147,7 +1145,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
@@ -1164,7 +1161,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
@@ -1181,7 +1177,6 @@ function OperationForm({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(newValue) =>
setProcessData((d) => ({
diff --git a/apps/carbon/app/modules/sales/ui/Quotes/QuoteLinePricing.tsx b/apps/carbon/app/modules/sales/ui/Quotes/QuoteLinePricing.tsx
index f3c508e90b..15f090c77c 100644
--- a/apps/carbon/app/modules/sales/ui/Quotes/QuoteLinePricing.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotes/QuoteLinePricing.tsx
@@ -394,7 +394,6 @@ const QuoteLinePricing = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
minValue={0}
onChange={(value) => {
@@ -478,7 +477,6 @@ const QuoteLinePricing = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
minValue={0}
onChange={(value) => {
@@ -623,7 +621,6 @@ const QuoteLinePricing = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
minValue={0}
onChange={(value) => {
@@ -714,7 +711,6 @@ const QuoteLinePricing = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(value) => {
if (
diff --git a/apps/carbon/app/modules/sales/ui/Quotes/QuoteToOrderModal.tsx b/apps/carbon/app/modules/sales/ui/Quotes/QuoteToOrderModal.tsx
index 77ae331ead..b0189f7901 100644
--- a/apps/carbon/app/modules/sales/ui/Quotes/QuoteToOrderModal.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotes/QuoteToOrderModal.tsx
@@ -655,7 +655,6 @@ const LinePricingOptions = ({
formatOptions={{
style: "currency",
currency: quoteCurrency,
- maximumFractionDigits: 4,
}}
onChange={(netUnitPrice) =>
setOverridePricing((v) => ({
@@ -686,7 +685,6 @@ const LinePricingOptions = ({
formatOptions={{
style: "currency",
currency: quoteCurrency,
- maximumFractionDigits: 4,
}}
onChange={(shippingCost) =>
setOverridePricing((v) => ({
@@ -717,7 +715,6 @@ const LinePricingOptions = ({
formatOptions={{
style: "currency",
currency: quoteCurrency,
- maximumFractionDigits: 4,
}}
onChange={(addOn) =>
setOverridePricing((v) => ({
diff --git a/apps/carbon/app/modules/sales/ui/SalesOrder/SalesOrderLineForm.tsx b/apps/carbon/app/modules/sales/ui/SalesOrder/SalesOrderLineForm.tsx
index 35c4da4f08..660aa5923a 100644
--- a/apps/carbon/app/modules/sales/ui/SalesOrder/SalesOrderLineForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/SalesOrder/SalesOrderLineForm.tsx
@@ -318,7 +318,6 @@ const SalesOrderLineForm = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
onChange={(value) =>
setItemData((d) => ({
@@ -333,7 +332,6 @@ const SalesOrderLineForm = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
/>
<Number
@@ -342,7 +340,6 @@ const SalesOrderLineForm = ({
formatOptions={{
style: "currency",
currency: baseCurrency,
- maximumFractionDigits: 4,
}}
/>
diff --git a/apps/carbon/app/routes/share+/quote.$id.tsx b/apps/carbon/app/routes/share+/quote.$id.tsx
index d75b4047a8..5b3b891e45 100644
--- a/apps/carbon/app/routes/share+/quote.$id.tsx
+++ b/apps/carbon/app/routes/share+/quote.$id.tsx
@@ -900,7 +900,6 @@ const Quote = ({
new Intl.NumberFormat(locale, {
style: "currency",
currency: quote.currencyCode ?? "USD",
- maximumFractionDigits: 4,
}),
[locale, quote.currencyCode]
);
diff --git a/packages/documents/src/utils/shared.ts b/packages/documents/src/utils/shared.ts
index 2f2ce99245..a74df188b5 100644
--- a/packages/documents/src/utils/shared.ts
+++ b/packages/documents/src/utils/shared.ts
@@ -5,6 +5,5 @@ export const getCurrencyFormatter = (
return new Intl.NumberFormat(locale, {
style: "currency",
currency: baseCurrencyCode,
- maximumFractionDigits: 4,
});
};