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.

feat: add initiated by to issue report

Brad Barbina4b12c900963
diff --git a/apps/erp/app/routes/file+/issue+/$id[.]pdf.tsx b/apps/erp/app/routes/file+/issue+/$id[.]pdf.tsx
index 73e5f668c7..0c774ff698 100644
--- a/apps/erp/app/routes/file+/issue+/$id[.]pdf.tsx
+++ b/apps/erp/app/routes/file+/issue+/$id[.]pdf.tsx
@@ -82,6 +82,12 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
// Build assignee and record creator lookup map
const uniqueUsers = new Set<string>();
+
+ // Add non-conformance creator
+ if (nonConformance.data?.createdBy) {
+ uniqueUsers.add(nonConformance.data.createdBy);
+ }
+
actionTasks.data?.forEach((task) => {
if (task.assignee) uniqueUsers.add(task.assignee);
});
diff --git a/packages/documents/src/pdf/IssuePDF.tsx b/packages/documents/src/pdf/IssuePDF.tsx
index 3a5071b379..449dbd05dd 100644
--- a/packages/documents/src/pdf/IssuePDF.tsx
+++ b/packages/documents/src/pdf/IssuePDF.tsx
@@ -120,6 +120,10 @@ const IssuePDF = ({
label: "Status",
value: nonConformance.status,
},
+ {
+ label: "Initiated By",
+ value: assignees[nonConformance.createdBy] || "Unknown",
+ },
{
label: "Started",
value: nonConformance.openDate,
@@ -367,19 +371,23 @@ const IssuePDF = ({
width: 12,
height: 12,
border: "1px solid #000",
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
marginTop: 2,
+ position: "relative",
}}
>
- {record.booleanValue && (
- <Text
- style={{ fontSize: 10, fontWeight: "bold" }}
- >
- ✓
- </Text>
- )}
+ <Text
+ style={{
+ position: "absolute",
+ fontSize: 12,
+ fontWeight: "bold",
+ lineHeight: 1,
+ textAlign: "center",
+ top: -3,
+ left: -2,
+ }}
+ >
+ {record.booleanValue ? "✓" : ""}
+ </Text>
</View>
<View style={tw("flex flex-col")}>
<Text style={tw("font-medium")}>
@@ -412,7 +420,7 @@ const IssuePDF = ({
{reviewers.length > 0 && (
<View style={tw("mb-5")}>
<Text style={[tw("font-bold mb-2"), { letterSpacing: -0.5 }]}>
- Reviewers
+ MRB
</Text>
{reviewers.map((reviewer) => (
<View key={reviewer.id} style={tw("flex flex-col gap-2 py-2")}>