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: use company id to get currency exchange rate

Brad Barbina51e3ab113f7
diff --git a/packages/database/supabase/functions/convert/index.ts b/packages/database/supabase/functions/convert/index.ts
index cbfb599b9a..344bbecd41 100644
--- a/packages/database/supabase/functions/convert/index.ts
+++ b/packages/database/supabase/functions/convert/index.ts
@@ -368,6 +368,7 @@ serve(async (req: Request) => {
.from("currency")
.select("*")
.eq("code", currencyCode)
+ .eq("companyId", companyId)
.single();
const exchangeRate = currency.data?.exchangeRate ?? 1;