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.

feat: default the currency dropdown in the customer form when creating from combobox

Rob Carrington7dd7e15cc691
diff --git a/apps/carbon/app/components/Form/Customer.tsx b/apps/carbon/app/components/Form/Customer.tsx
index 6f6d6855ff..48b36ab0d3 100644
--- a/apps/carbon/app/components/Form/Customer.tsx
+++ b/apps/carbon/app/components/Form/Customer.tsx
@@ -2,6 +2,7 @@ import type { ComboboxProps } from "@carbon/form";
import { CreatableCombobox } from "@carbon/form";
import { useDisclosure } from "@carbon/react";
import { useMemo, useRef, useState } from "react";
+import { useUser } from "~/hooks";
import { CustomerForm } from "~/modules/sales";
import { useCustomers } from "~/stores";
@@ -22,6 +23,8 @@ const Customer = (props: CustomerSelectProps) => {
[customers]
);
+ const { company } = useUser();
+
return (
<>
<CreatableCombobox
@@ -44,6 +47,7 @@ const Customer = (props: CustomerSelectProps) => {
}}
initialValues={{
name: created,
+ currencyCode: company.baseCurrencyCode,
}}
/>
)}