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
fix(purchasing): page the purchase order lookup behind the attachment filter
Raul29f6a8c5a568
diff --git a/apps/erp/app/modules/purchasing/purchasing.service.ts b/apps/erp/app/modules/purchasing/purchasing.service.tsindex 0e998eb021..ee0baa8683 100644--- a/apps/erp/app/modules/purchasing/purchasing.service.ts+++ b/apps/erp/app/modules/purchasing/purchasing.service.ts@@ -6028,11 +6028,16 @@ export async function withoutStoredPurchaseOrderPdfs<docs: T[]): Promise<T[]> {if (docs.length === 0) return docs;- const orders = await client- .from("purchaseOrder")- .select("purchaseOrderId")- .eq("companyId", companyId)- .eq("supplierInteractionId", interactionId);+ // Paged: a page missing would let that order's PDF through.+ const orders = await fetchAllFromTable<{+ id: string;+ purchaseOrderId: string;+ }>(client, "purchaseOrder", "id, purchaseOrderId", (query) =>+ query+ .eq("companyId", companyId)+ .eq("supplierInteractionId", interactionId)+ .order("id")+ );if (orders.error) {logger.error("Failed to read the supplier interaction's purchase orders", {companyId,