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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
feat: custom fields for quote material form
Brad Barbinae08ba6c4ce2
diff --git a/apps/carbon/app/modules/sales/sales.service.ts b/apps/carbon/app/modules/sales/sales.service.tsindex 462961864a..f20af85f36 100644--- a/apps/carbon/app/modules/sales/sales.service.ts+++ b/apps/carbon/app/modules/sales/sales.service.ts@@ -820,6 +820,7 @@ export async function upsertQuoteMaterial(quoteLineId: string;quoteOperationId: string;createdBy: string;+ customFields?: Json;})| (Omit<z.infer<typeof quotationMaterialValidator>, "id"> & {id: string;@@ -827,6 +828,7 @@ export async function upsertQuoteMaterial(quoteLineId: string;quoteOperationId: string;updatedBy: string;+ customFields?: Json;})) {if ("id" in quotationMaterial) {diff --git a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.material.new.tsx b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.material.new.tsxindex ac1d219ae5..e594d6a3e1 100644--- a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.material.new.tsx+++ b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.material.new.tsx@@ -9,6 +9,7 @@ import {} from "~/modules/sales";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";+import { setCustomFields } from "~/utils/form";import { assertIsPost } from "~/utils/http";import { path } from "~/utils/path";import { error } from "~/utils/result";@@ -28,8 +29,9 @@ export async function action({ request, params }: ActionFunctionArgs) {if (!quoteLineId) throw new Error("Could not find quoteLineId");if (!quoteOperationId) throw new Error("Could not find operationId");+ const formData = await request.formData();const validation = await validator(quotationMaterialValidator).validate(- await request.formData()+ formData);if (validation.error) {@@ -44,6 +46,7 @@ export async function action({ request, params }: ActionFunctionArgs) {quoteOperationId,...data,createdBy: userId,+ customFields: setCustomFields(formData),});if (createQuotationMaterial.error) {