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: make CustomerForm default to company currency code from CreatableCombobox as well

Rob Carringtone39a99e19b8b
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx
index 53b7333009..d8eb2a1ed9 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx
@@ -25,7 +25,7 @@ import {
Input,
Submit,
} from "~/components/Form";
-import { usePermissions } from "~/hooks";
+import { usePermissions, useUser } from "~/hooks";
import type { Customer } from "~/modules/sales";
import { customerValidator } from "~/modules/sales";
import { path } from "~/utils/path";
@@ -44,6 +44,8 @@ const CustomerForm = ({
const permissions = usePermissions();
const fetcher = useFetcher<PostgrestResponse<Customer>>();
+ const { company } = useUser();
+
useEffect(() => {
if (type !== "modal") return;
@@ -107,7 +109,11 @@ const CustomerForm = ({
<Employee name="accountManagerId" label="Account Manager" />
- <Currency name="currencyCode" label="Currency" />
+ <Currency
+ name="currencyCode"
+ label="Currency"
+ value={company.baseCurrencyCode}
+ />
<PhoneInput name="phone" label="Phone" />
<PhoneInput name="fax" label="Fax" />