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: missing case for total hours and total minutes in duration calculation

Brad Barbinc21f3ba15bbd
diff --git a/apps/carbon/app/utils/duration.ts b/apps/carbon/app/utils/duration.ts
index bed7db8142..bcf4b3011d 100644
--- a/apps/carbon/app/utils/duration.ts
+++ b/apps/carbon/app/utils/duration.ts
@@ -80,6 +80,12 @@ export function makeDurations<
// Calculate labor duration
switch (operation.laborUnit) {
+ case "Total Hours":
+ laborDuration = (operation.laborTime ?? 0) * 3600000;
+ break;
+ case "Total Minutes":
+ laborDuration = (operation.laborTime ?? 0) * 60000;
+ break;
case "Hours/Piece":
laborDuration =
(operation.laborTime ?? 0) *
@@ -132,6 +138,12 @@ export function makeDurations<
// Calculate machine duration
switch (operation.machineUnit) {
+ case "Total Hours":
+ machineDuration = (operation.machineTime ?? 0) * 3600000;
+ break;
+ case "Total Minutes":
+ machineDuration = (operation.machineTime ?? 0) * 60000;
+ break;
case "Hours/Piece":
machineDuration =
(operation.machineTime ?? 0) *