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
Limit pending approvals query to most recent
Sidwebworks6cdb39affd62
diff --git a/apps/erp/app/modules/shared/shared.service.ts b/apps/erp/app/modules/shared/shared.service.tsindex 495523937a..6c9c06b1f7 100644--- a/apps/erp/app/modules/shared/shared.service.ts+++ b/apps/erp/app/modules/shared/shared.service.ts@@ -617,6 +617,7 @@ export async function getLatestApprovalRequestForDocument(.select("*").eq("documentType", documentType).eq("documentId", documentId)+ .eq("status", "Pending").order("requestedAt", { ascending: false }).limit(1).maybeSingle();