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: disable operation tabs for outside operations

Brad Barbin3b88bc019c8f
diff --git a/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx b/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx
index e4ffeea971..f18e646f08 100644
--- a/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx
+++ b/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx
@@ -470,7 +470,7 @@ const BillOfProcess = ({
)}
</span>
),
- disabled: hasProcedure,
+ disabled: hasProcedure || item.data.operationType === "Outside",
content: (
<div className="flex flex-col">
<div>
@@ -506,7 +506,7 @@ const BillOfProcess = ({
},
{
id: 2,
- disabled: hasProcedure,
+ disabled: hasProcedure || item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
<span>Parameters</span>
@@ -544,7 +544,7 @@ const BillOfProcess = ({
},
{
id: 3,
- disabled: hasProcedure,
+ disabled: hasProcedure || item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
<span>Attributes</span>
@@ -582,6 +582,7 @@ const BillOfProcess = ({
},
{
id: 4,
+ disabled: item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
<span>Tools</span>
@@ -2605,7 +2606,10 @@ function makeItem(
{operation.description}
</h3>
{operation.operationType === "Outside" && (
- <SupplierProcessPreview processId={operation.processId} supplierProcessId={operation.operationSupplierProcessId} />
+ <SupplierProcessPreview
+ processId={operation.processId}
+ supplierProcessId={operation.operationSupplierProcessId}
+ />
)}
</VStack>
),
diff --git a/apps/erp/app/modules/production/ui/Jobs/JobBillOfProcess.tsx b/apps/erp/app/modules/production/ui/Jobs/JobBillOfProcess.tsx
index 3a4ac83395..e7ecc2b1e2 100644
--- a/apps/erp/app/modules/production/ui/Jobs/JobBillOfProcess.tsx
+++ b/apps/erp/app/modules/production/ui/Jobs/JobBillOfProcess.tsx
@@ -193,7 +193,10 @@ function makeItem(
{operation.description}
</h3>
{operation.operationType === "Outside" && (
- <SupplierProcessPreview processId={operation.processId} supplierProcessId={operation.operationSupplierProcessId} />
+ <SupplierProcessPreview
+ processId={operation.processId}
+ supplierProcessId={operation.operationSupplierProcessId}
+ />
)}
</VStack>
),
@@ -711,6 +714,7 @@ const JobBillOfProcess = ({
{
id: 1,
label: "Instructions",
+ disabled: item.data.operationType === "Outside",
content: (
<div className="flex flex-col">
<div>
@@ -746,6 +750,7 @@ const JobBillOfProcess = ({
},
{
id: 2,
+ disabled: item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
<span>Params</span>
@@ -766,6 +771,7 @@ const JobBillOfProcess = ({
},
{
id: 3,
+ disabled: item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
<span>Attributes</span>
@@ -786,6 +792,7 @@ const JobBillOfProcess = ({
},
{
id: 4,
+ disabled: item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
<span>Tools</span>
@@ -806,6 +813,7 @@ const JobBillOfProcess = ({
},
{
id: 5,
+ disabled: item.data.operationType === "Outside",
label: "Events",
content: (
<div className="flex w-full flex-col pr-2 py-6 min-h-[300px]">
@@ -831,6 +839,7 @@ const JobBillOfProcess = ({
},
{
id: 6,
+ disabled: item.data.operationType === "Outside",
label: "Chat",
content: <OperationChat jobOperationId={item.id} />,
},
diff --git a/apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx b/apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx
index f9745e95b0..f0e46749ae 100644
--- a/apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx
+++ b/apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx
@@ -163,7 +163,10 @@ function makeItem(
{operation.description}
</h3>
{operation.operationType === "Outside" && (
- <SupplierProcessPreview processId={operation.processId} supplierProcessId={operation.operationSupplierProcessId} />
+ <SupplierProcessPreview
+ processId={operation.processId}
+ supplierProcessId={operation.operationSupplierProcessId}
+ />
)}
</VStack>
),
@@ -526,7 +529,7 @@ const QuoteBillOfProcess = ({
},
{
id: 1,
- disabled: hasProcedure,
+ disabled: hasProcedure || item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
Instructions
@@ -580,7 +583,7 @@ const QuoteBillOfProcess = ({
{
id: 2,
- disabled: hasProcedure,
+ disabled: hasProcedure || item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
<span>Parameters</span>
@@ -615,7 +618,7 @@ const QuoteBillOfProcess = ({
},
{
id: 3,
- disabled: hasProcedure,
+ disabled: hasProcedure || item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
<span>Attributes</span>
@@ -650,6 +653,7 @@ const QuoteBillOfProcess = ({
},
{
id: 4,
+ disabled: item.data.operationType === "Outside",
label: (
<span className="flex items-center gap-2">
<span>Tools</span>
@@ -1628,8 +1632,7 @@ function OperationForm({
return (acc += sp.minimumCost ?? 0);
}, 0) / supplierProcesses.data.length
: p.operationMinimumCost,
- operationUnitCost:
- item.data.operationUnitCost ?? 0,
+ operationUnitCost: item.data.operationUnitCost ?? 0,
operationLeadTime:
supplierProcesses.data && supplierProcesses.data.length > 0
? supplierProcesses.data.reduce((acc, sp) => {