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 failing supplier approval

Gaurav Bhatt11e069c21b9c
diff --git a/apps/erp/app/routes/x+/purchase-order+/$orderId.finalize.tsx b/apps/erp/app/routes/x+/purchase-order+/$orderId.finalize.tsx
index a8d92eb4a4..f05fd80f52 100644
--- a/apps/erp/app/routes/x+/purchase-order+/$orderId.finalize.tsx
+++ b/apps/erp/app/routes/x+/purchase-order+/$orderId.finalize.tsx
@@ -84,8 +84,7 @@ export async function action(args: ActionFunctionArgs) {
serviceRole,
purchaseOrder.data.supplierId
);
- // @ts-expect-error TS2339 - TODO: fix type
- if (supplier.data?.supplierStatus !== "Active") {
+ if (supplier.data?.status !== "Active") {
throw redirect(
path.to.purchaseOrder(orderId),
await flash(
diff --git a/apps/erp/app/routes/x+/supplier-quote+/$id.convert.tsx b/apps/erp/app/routes/x+/supplier-quote+/$id.convert.tsx
index 2286b90de1..2cf6161610 100644
--- a/apps/erp/app/routes/x+/supplier-quote+/$id.convert.tsx
+++ b/apps/erp/app/routes/x+/supplier-quote+/$id.convert.tsx
@@ -58,8 +58,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
if (companySettingsResult.data?.supplierApproval && quote.data?.supplierId) {
const supplier = await getSupplier(serviceRole, quote.data.supplierId);
- // @ts-expect-error TS2339 - TODO: fix type
- if (supplier.data?.supplierStatus !== "Active") {
+ if (supplier.data?.status !== "Active") {
throw redirect(
path.to.supplierQuoteDetails(id),
await flash(