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: job quantities on customer portal

Brad Barbin97219658df9d
diff --git a/apps/erp/app/routes/share+/customer.$id.tsx b/apps/erp/app/routes/share+/customer.$id.tsx
index 4f2b6e53ce..095e0c33c5 100644
--- a/apps/erp/app/routes/share+/customer.$id.tsx
+++ b/apps/erp/app/routes/share+/customer.$id.tsx
@@ -166,6 +166,10 @@ export default function CustomerPortal() {
jobOperationAttachments,
} = useLoaderData<typeof loader>();
+ console.log({
+ salesOrderLines,
+ });
+
const formatter = useNumberFormatter({
minimumFractionDigits: 0,
maximumFractionDigits: 2,
@@ -301,7 +305,7 @@ export default function CustomerPortal() {
id: "shipped",
header: "Shipped",
cell: ({ row }) =>
- row.original?.jobQuantityShipped
+ row.original?.jobProductionQuantity
? `${formatter.format(
row.original.jobQuantityShipped
)}/${formatter.format(row.original.jobProductionQuantity)}`
@@ -321,9 +325,13 @@ export default function CustomerPortal() {
return null;
}
+ if (!row.original.jobProductionQuantity) {
+ return null;
+ }
+
return (
<JobOperationProgress
- quantityShipped={row.original.quantitySent ?? 0}
+ quantityShipped={row.original.jobQuantityShipped ?? 0}
quantityComplete={row.original.jobQuantityComplete ?? 0}
jobOperations={jobOperations.data}
jobOperationAttachments={jobOperationAttachments}
@@ -425,6 +433,7 @@ function JobOperationProgress({
}
const isComplete = quantityShipped > 0 || quantityComplete > 0;
+
return (
<div className="flex items-center gap-0">
{jobOperations