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: create quality issue from MES (#827)

Brad Barbin4111e122e37c
diff --git a/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx b/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx
index 379e62c9f4..c0e89039db 100644
--- a/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx
+++ b/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx
@@ -230,7 +230,7 @@ const IssueProperties = () => {
</Tooltip>
</HStack>
</HStack>
- <VStack spacing={0}>
+ <VStack spacing={1}>
<span className="text-sm tracking-tight">
{routeData?.nonConformance?.nonConformanceId}
</span>
@@ -241,7 +241,7 @@ const IssueProperties = () => {
validator={z.object({
name: z.string()
})}
- className="w-full -mt-2"
+ className="w-full"
>
<span className="text-xs text-muted-foreground">
<InputControlled
diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
index 21681c4110..08bf0649d1 100644
--- a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
@@ -1,5 +1,5 @@
{
- "generated": "2026-05-27T04:25:24.545Z",
+ "generated": "2026-05-27T04:57:18.383Z",
"totalTools": 1083,
"modules": 15,
"tools": [
diff --git a/apps/mes/app/components/AppSidebar.tsx b/apps/mes/app/components/AppSidebar.tsx
index 3579bd46c4..3138f0a563 100644
--- a/apps/mes/app/components/AppSidebar.tsx
+++ b/apps/mes/app/components/AppSidebar.tsx
@@ -222,7 +222,8 @@ export function OperationsNav({
}
];
- const { pathname } = useLocation();
+ const location = useLocation();
+ const { pathname } = location;
const { isMobile, setOpenMobile } = useSidebar();
return (
diff --git a/apps/mes/app/components/JobOperation/JobOperation.tsx b/apps/mes/app/components/JobOperation/JobOperation.tsx
index 5305445555..f7193078ff 100644
--- a/apps/mes/app/components/JobOperation/JobOperation.tsx
+++ b/apps/mes/app/components/JobOperation/JobOperation.tsx
@@ -79,7 +79,8 @@ import {
LuQrCode,
LuSquareUser,
LuTimer,
- LuTriangleAlert
+ LuTriangleAlert,
+ LuWrench
} from "react-icons/lu";
import { Await, Link, useFetcher, useNavigate, useParams } from "react-router";
import {
@@ -115,6 +116,8 @@ import ItemThumbnail from "../ItemThumbnail";
import { OperationChat } from "./components/Chat";
import {
Controls,
+ type FABItem,
+ FloatingActionMenu,
IconButtonWithTooltip,
StartStopButton,
Times,
@@ -123,6 +126,7 @@ import {
import { IssueMaterialModal } from "./components/IssueMaterialModal";
import { MaintenanceDispatch } from "./components/MaintenanceDispatch";
import { ParametersListItem } from "./components/Parameter";
+import { QualityIssueModal } from "./components/QualityIssueModal";
import { QuantityModal } from "./components/QuantityModal";
import { SerialSelectorModal } from "./components/SerialSelectorModal";
import {
@@ -212,6 +216,8 @@ export const JobOperation = ({
const attributeRecordModal = useDisclosure();
const attributeRecordDeleteModal = useDisclosure();
+ const maintenanceModal = useDisclosure();
+ const qualityIssueModal = useDisclosure();
const [activeStep, setActiveStep] = useState(
parentIsSerial ? serialIndex : 0
);
@@ -462,13 +468,7 @@ export const JobOperation = ({
>
<Trans>Model</Trans>
</TabsTrigger>
- <TabsTrigger
- disabled={
- !operation.workInstruction ||
- Object.keys(operation.workInstruction).length === 0
- }
- value="procedure"
- >
+ <TabsTrigger value="procedure">
<Trans>Procedure</Trans>
</TabsTrigger>
<TabsTrigger value="chat">
@@ -1958,16 +1958,9 @@ export const JobOperation = ({
<Await resolve={workCenter}>
{(resolvedWorkCenter) =>
resolvedWorkCenter.data && (
- <VStack spacing={1}>
- <HStack className="justify-between items-start w-full">
- <Heading size="h4" className="line-clamp-1">
- {resolvedWorkCenter.data?.name}
- </Heading>
- <MaintenanceDispatch
- workCenter={resolvedWorkCenter.data}
- />
- </HStack>
- </VStack>
+ <Heading size="h4" className="line-clamp-1">
+ {resolvedWorkCenter.data?.name}
+ </Heading>
)
}
</Await>
@@ -2078,31 +2071,6 @@ export const JobOperation = ({
trackedEntityId={trackedEntityId}
/>
<div className="flex flex-row md:flex-col items-center gap-2 justify-center">
- {/* <IconButtonWithTooltip
- icon={
- <FaRedoAlt className="text-accent-foreground group-hover:text-accent-foreground/80" />
- }
- tooltip="Log Rework"
- onClick={reworkModal.onOpen}
- />
- */}
- <IconButtonWithTooltip
- disabled={
- parentIsSerial &&
- trackedEntities.some(
- (entity) =>
- entity.id === trackedEntityId &&
- `Operation ${operationId}` in
- (entity.attributes as TrackedEntityAttributes)
- )
- }
- icon={
- <FaTrash className="text-accent-foreground group-hover:text-accent-foreground/80" />
- }
- tooltip={t`Log Scrap`}
- onClick={scrapModal.onOpen}
- />
-
<IconButtonWithTooltip
disabled={
parentIsSerial &&
@@ -2119,16 +2087,63 @@ export const JobOperation = ({
tooltip={t`Log Completed`}
onClick={completeModal.onOpen}
/>
- <IconButtonWithTooltip
- icon={<FaCheck />}
- variant={
- operation.quantityComplete === operation.operationQuantity
- ? "success"
- : "default"
- }
- tooltip={t`Close Out`}
- onClick={finishModal.onOpen}
- />
+ <Suspense key={`fab-${operationId}`}>
+ <Await resolve={workCenter}>
+ {(resolvedWorkCenter) => {
+ const isEntityCompleted =
+ parentIsSerial &&
+ trackedEntities.some(
+ (entity) =>
+ entity.id === trackedEntityId &&
+ `Operation ${operationId}` in
+ (entity.attributes as TrackedEntityAttributes)
+ );
+
+ const fabItems: FABItem[] = [
+ {
+ icon: (
+ <FaTrash className="text-accent-foreground group-hover:text-accent-foreground/80" />
+ ),
+ label: t`Log Scrap`,
+ onClick: scrapModal.onOpen,
+ disabled: isEntityCompleted
+ },
+ {
+ icon: <FaCheck />,
+ label: t`Close Out`,
+ onClick: finishModal.onOpen,
+ variant:
+ operation.quantityComplete ===
+ operation.operationQuantity
+ ? "success"
+ : "default"
+ },
+ {
+ icon: (
+ <LuTriangleAlert className="text-accent-foreground group-hover:text-accent-foreground/80" />
+ ),
+ label: t`Quality Issue`,
+ onClick: qualityIssueModal.onOpen
+ }
+ ];
+
+ if (
+ resolvedWorkCenter.data &&
+ !resolvedWorkCenter.data.isBlocked
+ ) {
+ fabItems.push({
+ icon: (
+ <LuWrench className="text-accent-foreground group-hover:text-accent-foreground/80" />
+ ),
+ label: t`Maintenance`,
+ onClick: maintenanceModal.onOpen
+ });
+ }
+
+ return <FloatingActionMenu items={fabItems} />;
+ }}
+ </Await>
+ </Suspense>
</div>
</div>
</Controls>
@@ -2381,6 +2396,29 @@ export const JobOperation = ({
description={t`Are you sure you want to delete this step?`}
/>
)}
+
+ <QualityIssueModal
+ operationId={operation.id}
+ trackedEntityId={
+ parentIsSerial || parentIsBatch ? trackedEntityId : undefined
+ }
+ isOpen={qualityIssueModal.isOpen}
+ onClose={qualityIssueModal.onClose}
+ />
+
+ <Suspense key={`maintenance-modal-${operationId}`}>
+ <Await resolve={workCenter}>
+ {(resolvedWorkCenter) =>
+ resolvedWorkCenter.data && (
+ <MaintenanceDispatch
+ workCenter={resolvedWorkCenter.data}
+ isOpen={maintenanceModal.isOpen}
+ onClose={maintenanceModal.onClose}
+ />
+ )
+ }
+ </Await>
+ </Suspense>
</>
);
};
diff --git a/apps/mes/app/components/JobOperation/components/Controls.tsx b/apps/mes/app/components/JobOperation/components/Controls.tsx
index 85641ec98c..00ee6f26f4 100644
--- a/apps/mes/app/components/JobOperation/components/Controls.tsx
+++ b/apps/mes/app/components/JobOperation/components/Controls.tsx
@@ -10,10 +10,17 @@ import {
} from "@carbon/react";
import { getLocalTimeZone } from "@internationalized/date";
import { Trans, useLingui } from "@lingui/react/macro";
+import { AnimatePresence, motion } from "framer-motion";
import type { ComponentProps, ReactNode } from "react";
-import { useMemo } from "react";
+import { useCallback, useMemo, useState } from "react";
import { FaPause, FaPlay } from "react-icons/fa6";
-import { LuHammer, LuHardHat, LuTimer } from "react-icons/lu";
+import {
+ LuEllipsisVertical,
+ LuHammer,
+ LuHardHat,
+ LuTimer,
+ LuX
+} from "react-icons/lu";
import { useFetcher } from "react-router";
import type { productionEventType } from "~/services/models";
import { productionEventValidator } from "~/services/models";
@@ -34,7 +41,7 @@ export function Controls({
return (
<div
className={cn(
- "flex flex-col md:absolute p-2 top-[calc(var(--header-height)*2-2px)] right-0 w-full md:w-[var(--controls-width)] md:min-h-[180px] z-1 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 md:border-l border-y md:rounded-bl-lg",
+ "flex flex-col relative z-[60] md:absolute p-2 md:top-[calc(var(--header-height)*2-2px)] md:right-0 w-full md:w-[var(--controls-width)] md:min-h-[180px] bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 md:border-l border-y md:rounded-bl-lg",
className
)}
>
@@ -336,3 +343,96 @@ export function PlayButton({ className, ...props }: ComponentProps<"button">) {
</ButtonWithTooltip>
);
}
+
+export type FABItem = {
+ icon: ReactNode;
+ label: string;
+ onClick: () => void;
+ disabled?: boolean;
+ variant?: "default" | "success" | "destructive";
+};
+
+export function FloatingActionMenu({ items }: { items: FABItem[] }) {
+ const [isOpen, setIsOpen] = useState(false);
+
+ const toggle = useCallback(() => setIsOpen((prev) => !prev), []);
+
+ return (
+ <div className="relative flex flex-col items-center">
+ <AnimatePresence initial={false}>
+ {isOpen && (
+ <motion.div
+ className="flex flex-row md:flex-col items-center gap-2 mb-2"
+ initial="closed"
+ animate="open"
+ exit="closed"
+ variants={{
+ open: { transition: { staggerChildren: 0.06 } },
+ closed: {
+ transition: { staggerChildren: 0.03, staggerDirection: -1 }
+ }
+ }}
+ >
+ {items.map((item) => (
+ <motion.div
+ key={item.label}
+ variants={{
+ open: { opacity: 1, scale: 1, filter: "blur(0px)" },
+ closed: { opacity: 0, scale: 0.25, filter: "blur(4px)" }
+ }}
+ transition={{ type: "spring", duration: 0.3, bounce: 0 }}
+ >
+ <IconButtonWithTooltip
+ icon={item.icon}
+ tooltip={item.label}
+ disabled={item.disabled}
+ variant={item.variant}
+ onClick={() => {
+ item.onClick();
+ setIsOpen(false);
+ }}
+ />
+ </motion.div>
+ ))}
+ </motion.div>
+ )}
+ </AnimatePresence>
+ <button
+ type="button"
+ onClick={toggle}
+ className={cn(
+ "size-16 text-xl md:text-lg md:size-[8dvh] flex items-center justify-center rounded-full shadow-lg transition-[transform,background-color] duration-200 active:scale-[0.96]",
+ isOpen
+ ? "bg-muted-foreground text-background"
+ : "bg-accent text-accent-foreground hover:bg-accent/80"
+ )}
+ >
+ <AnimatePresence mode="wait" initial={false}>
+ {isOpen ? (
+ <motion.span
+ key="close"
+ initial={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
+ animate={{ opacity: 1, scale: 1, filter: "blur(0px)" }}
+ exit={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
+ transition={{ type: "spring", duration: 0.3, bounce: 0 }}
+ className="flex items-center justify-center"
+ >
+ <LuX className="size-5" />
+ </motion.span>
+ ) : (
+ <motion.span
+ key="menu"
+ initial={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
+ animate={{ opacity: 1, scale: 1, filter: "blur(0px)" }}
+ exit={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
+ transition={{ type: "spring", duration: 0.3, bounce: 0 }}
+ className="flex items-center justify-center"
+ >
+ <LuEllipsisVertical className="size-5" />
+ </motion.span>
+ )}
+ </AnimatePresence>
+ </button>
+ </div>
+ );
+}
diff --git a/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx b/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx
index f86fe02efc..ef7e0e4452 100644
--- a/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx
+++ b/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx
@@ -10,7 +10,6 @@ import type { JSONContent } from "@carbon/react";
import {
Button,
HStack,
- IconButton,
Label,
Modal,
ModalBody,
@@ -18,11 +17,7 @@ import {
ModalFooter,
ModalHeader,
ModalTitle,
- Tooltip,
- TooltipContent,
- TooltipTrigger,
toast,
- useDisclosure,
VStack
} from "@carbon/react";
import { Editor } from "@carbon/react/Editor";
@@ -30,8 +25,7 @@ import type { PostgrestResponse } from "@supabase/supabase-js";
import { nanoid } from "nanoid";
import { useEffect, useState } from "react";
import { BsExclamationSquareFill } from "react-icons/bs";
-import { LuWrench } from "react-icons/lu";
-import { Link, useFetcher } from "react-router";
+import { useFetcher } from "react-router";
import { HighPriorityIcon } from "~/assets/icons/HighPriorityIcon";
import { LowPriorityIcon } from "~/assets/icons/LowPriorityIcon";
import { MediumPriorityIcon } from "~/assets/icons/MediumPriorityIcon";
@@ -73,7 +67,9 @@ function getSeverityLabel(severity: (typeof maintenanceSeverity)[number]) {
}
export function MaintenanceDispatch({
- workCenter
+ workCenter,
+ isOpen,
+ onClose
}: {
workCenter: {
id: string;
@@ -81,10 +77,9 @@ export function MaintenanceDispatch({
isBlocked: boolean | null;
blockingDispatchId: string | null;
};
+ isOpen: boolean;
+ onClose: () => void;
}) {
- const hasActiveDispatch =
- workCenter.isBlocked && workCenter.blockingDispatchId;
- const disclosure = useDisclosure();
const fetcher = useFetcher<{ id?: string }>();
const failureModeFetcher =
useFetcher<
@@ -106,25 +101,27 @@ export function MaintenanceDispatch({
const failureModes = failureModeFetcher.data?.data ?? [];
- const onOpen = () => {
- failureModeFetcher.load(path.to.api.failureModes);
- disclosure.onOpen();
- };
+ useEffect(() => {
+ if (isOpen) {
+ failureModeFetcher.load(path.to.api.failureModes);
+ }
+ // biome-ignore lint/correctness/useExhaustiveDependencies: ignore
+ }, [isOpen]);
- const onClose = () => {
+ const handleClose = () => {
setContent({});
setSeverity("Operator Performed");
setOeeImpactValue("No Impact");
- disclosure.onClose();
+ onClose();
};
useEffect(() => {
if (fetcher.state === "idle" && fetcher.data?.id) {
toast.success("Maintenance dispatch created");
- onClose();
+ handleClose();
}
// biome-ignore lint/correctness/useExhaustiveDependencies: ignore
- }, [fetcher.state, fetcher.data, onClose]);
+ }, [fetcher.state, fetcher.data]);
const onUploadImage = async (file: File) => {
const fileType = file.name.split(".").pop();
@@ -144,172 +141,135 @@ export function MaintenanceDispatch({
return getPrivateUrl(result.data.path);
};
+ if (!isOpen) return null;
+
return (
- <>
- <Tooltip>
- <TooltipTrigger asChild>
- {hasActiveDispatch ? (
- <Link
- to={path.to.maintenanceDetail(workCenter.blockingDispatchId!)}
- >
- <IconButton
- aria-label="View Active Maintenance"
- variant="destructive"
- icon={<LuWrench />}
- />
- </Link>
- ) : (
- <IconButton
- aria-label="Maintenance"
- variant="secondary"
- icon={<LuWrench />}
- onClick={onOpen}
- />
- )}
- </TooltipTrigger>
- <TooltipContent align="end">
- <span>
- {hasActiveDispatch
- ? "View Active Maintenance"
- : "Maintenance Dispatch"}
- </span>
- </TooltipContent>
- </Tooltip>
- {disclosure.isOpen && (
- <Modal
- open={disclosure.isOpen}
- onOpenChange={(open) => {
- if (!open) {
- onClose();
- }
+ <Modal
+ open={isOpen}
+ onOpenChange={(open) => {
+ if (!open) handleClose();
+ }}
+ >
+ <ModalContent size="xlarge">
+ <ValidatedForm
+ method="post"
+ action={path.to.newMaintenanceDispatch}
+ validator={maintenanceDispatchValidator}
+ defaultValues={{
+ workCenterId: workCenter.id,
+ priority: "Medium",
+ severity: "Operator Performed",
+ oeeImpact: "No Impact",
+ suspectedFailureModeId: undefined,
+ actualStartTime: new Date().toISOString(),
+ actualEndTime: undefined
}}
+ fetcher={fetcher}
>
- <ModalContent size="xlarge">
- <ValidatedForm
- method="post"
- action={path.to.newMaintenanceDispatch}
- validator={maintenanceDispatchValidator}
- defaultValues={{
- workCenterId: workCenter.id,
- priority: "Medium",
- severity: "Operator Performed",
- oeeImpact: "No Impact",
- suspectedFailureModeId: undefined,
- actualStartTime: new Date().toISOString(),
- actualEndTime: undefined
- }}
- fetcher={fetcher}
- >
- <ModalHeader>
- <ModalTitle>Maintenance for {workCenter.name}</ModalTitle>
- </ModalHeader>
- <ModalBody>
- <Hidden name="workCenterId" value={workCenter.id} />
- <Hidden name="content" value={JSON.stringify(content)} />
- <VStack spacing={4}>
- <div className="flex flex-col gap-2 w-full">
- <Label>Description</Label>
- <Editor
- initialValue={content}
- onUpload={onUploadImage}
- onChange={(value) => {
- setContent(value);
- }}
- className="[&_.is-empty]:text-muted-foreground min-h-[120px] py-3 px-4 border rounded-md w-full"
- />
- </div>
- <div className="grid w-full gap-x-8 gap-y-4 grid-cols-1 md:grid-cols-2">
- <Select
- name="priority"
- label="Priority"
- options={maintenanceDispatchPriority.map((priority) => ({
- value: priority,
- label: (
- <div className="flex gap-1 items-center">
- {getPriorityIcon(priority)}
- <span>{priority}</span>
- </div>
- )
- }))}
- />
+ <ModalHeader>
+ <ModalTitle>Maintenance for {workCenter.name}</ModalTitle>
+ </ModalHeader>
+ <ModalBody>
+ <Hidden name="workCenterId" value={workCenter.id} />
+ <Hidden name="content" value={JSON.stringify(content)} />
+ <VStack spacing={4}>
+ <div className="flex flex-col gap-2 w-full">
+ <Label>Description</Label>
+ <Editor
+ initialValue={content}
+ onUpload={onUploadImage}
+ onChange={(value) => {
+ setContent(value);
+ }}
+ className="[&_.is-empty]:text-muted-foreground min-h-[120px] py-3 px-4 border rounded-md w-full"
+ />
+ </div>
+ <div className="grid w-full gap-x-8 gap-y-4 grid-cols-1 md:grid-cols-2">
+ <Select
+ name="priority"
+ label="Priority"
+ options={maintenanceDispatchPriority.map((priority) => ({
+ value: priority,
+ label: (
+ <div className="flex gap-1 items-center">
+ {getPriorityIcon(priority)}
+ <span>{priority}</span>
+ </div>
+ )
+ }))}
+ />
+ <Select
+ name="severity"
+ label="Severity"
+ options={maintenanceSeverity.map((s) => ({
+ value: s,
+ label: getSeverityLabel(s)
+ }))}
+ onChange={(option) => {
+ if (option?.value) {
+ setSeverity(
+ option.value as (typeof maintenanceSeverity)[number]
+ );
+ }
+ }}
+ />
+ {severity === "Operator Performed" && (
+ <>
+ <DateTimePicker name="actualStartTime" label="Start Time" />
+ <DateTimePicker name="actualEndTime" label="End Time" />
+ </>
+ )}
+ <Select
+ name="oeeImpact"
+ label="OEE Impact"
+ options={oeeImpact.map((impact) => ({
+ value: impact,
+ label: impact
+ }))}
+ onChange={(option) => {
+ if (option?.value) {
+ setOeeImpactValue(
+ option.value as (typeof oeeImpact)[number]
+ );
+ }
+ }}
+ />
+ {(oeeImpactValue === "Down" || oeeImpactValue === "Impact") &&
+ failureModes.length > 0 &&
+ (severity === "Operator Performed" ? (
<Select
- name="severity"
- label="Severity"
- options={maintenanceSeverity.map((s) => ({
- value: s,
- label: getSeverityLabel(s)
+ name="actualFailureModeId"
+ label="Actual Failure Mode"
+ options={failureModes.map((mode) => ({
+ value: mode.id,
+ label: mode.name
}))}
- onChange={(option) => {
- if (option?.value) {
- setSeverity(
- option.value as (typeof maintenanceSeverity)[number]
- );
- }
- }}
+ isClearable
/>
- {severity === "Operator Performed" && (
- <>
- <DateTimePicker
- name="actualStartTime"
- label="Start Time"
- />
- <DateTimePicker name="actualEndTime" label="End Time" />
- </>
- )}
+ ) : (
<Select
- name="oeeImpact"
- label="OEE Impact"
- options={oeeImpact.map((impact) => ({
- value: impact,
- label: impact
+ name="suspectedFailureModeId"
+ label="Suspected Failure Mode"
+ options={failureModes.map((mode) => ({
+ value: mode.id,
+ label: mode.name
}))}
- onChange={(option) => {
- if (option?.value) {
- setOeeImpactValue(
- option.value as (typeof oeeImpact)[number]
- );
- }
- }}
+ isClearable
/>
- {(oeeImpactValue === "Down" ||
- oeeImpactValue === "Impact") &&
- failureModes.length > 0 &&
- (severity === "Operator Performed" ? (
- <Select
- name="actualFailureModeId"
- label="Actual Failure Mode"
- options={failureModes.map((mode) => ({
- value: mode.id,
- label: mode.name
- }))}
- isClearable
- />
- ) : (
- <Select
- name="suspectedFailureModeId"
- label="Suspected Failure Mode"
- options={failureModes.map((mode) => ({
- value: mode.id,
- label: mode.name
- }))}
- isClearable
- />
- ))}
- </div>
- </VStack>
- </ModalBody>
- <ModalFooter>
- <HStack>
- <Button variant="secondary" onClick={onClose}>
- Cancel
- </Button>
- <Submit>Create Dispatch</Submit>
- </HStack>
- </ModalFooter>
- </ValidatedForm>
- </ModalContent>
- </Modal>
- )}
- </>
+ ))}
+ </div>
+ </VStack>
+ </ModalBody>
+ <ModalFooter>
+ <HStack>
+ <Button variant="secondary" onClick={handleClose}>
+ Cancel
+ </Button>
+ <Submit>Create Dispatch</Submit>
+ </HStack>
+ </ModalFooter>
+ </ValidatedForm>
+ </ModalContent>
+ </Modal>
);
}
diff --git a/apps/mes/app/components/JobOperation/components/QualityIssueModal.tsx b/apps/mes/app/components/JobOperation/components/QualityIssueModal.tsx
new file mode 100644
index 0000000000..d7c272b51a
--- /dev/null
+++ b/apps/mes/app/components/JobOperation/components/QualityIssueModal.tsx
@@ -0,0 +1,126 @@
+import type { Result } from "@carbon/auth";
+import { Hidden, Select, Submit, TextArea, ValidatedForm } from "@carbon/form";
+import {
+ Button,
+ HStack,
+ Modal,
+ ModalBody,
+ ModalContent,
+ ModalFooter,
+ ModalHeader,
+ ModalTitle,
+ toast,
+ VStack
+} from "@carbon/react";
+import { Trans, useLingui } from "@lingui/react/macro";
+import type { PostgrestResponse } from "@supabase/supabase-js";
+import { useEffect } from "react";
+import { useFetcher } from "react-router";
+import { qualityIssuePriority, qualityIssueValidator } from "~/services/models";
+import { path } from "~/utils/path";
+
+export function QualityIssueModal({
+ operationId,
+ trackedEntityId,
+ isOpen,
+ onClose
+}: {
+ operationId: string;
+ trackedEntityId?: string;
+ isOpen: boolean;
+ onClose: () => void;
+}) {
+ const { t } = useLingui();
+ const fetcher = useFetcher<Result>();
+ const issueTypeFetcher =
+ useFetcher<PostgrestResponse<{ id: string; name: string }>>();
+
+ const issueTypes = issueTypeFetcher.data?.data ?? [];
+
+ useEffect(() => {
+ if (isOpen) {
+ issueTypeFetcher.load(path.to.api.qualityIssueTypes);
+ }
+ // biome-ignore lint/correctness/useExhaustiveDependencies: ignore
+ }, [isOpen]);
+
+ useEffect(() => {
+ if (fetcher.state === "idle" && fetcher.data?.success) {
+ toast.success(t`Quality issue created`);
+ onClose();
+ }
+ // biome-ignore lint/correctness/useExhaustiveDependencies: ignore
+ }, [fetcher.state, fetcher.data]);
+
+ if (!isOpen) return null;
+
+ return (
+ <Modal
+ open={isOpen}
+ onOpenChange={(open) => {
+ if (!open) onClose();
+ }}
+ >
+ <ModalContent>
+ <ValidatedForm
+ method="post"
+ action={path.to.qualityIssueNew}
+ validator={qualityIssueValidator}
+ defaultValues={{
+ jobOperationId: operationId,
+ description: "",
+ nonConformanceTypeId: issueTypes[0]?.id ?? "",
+ priority: "Medium" as const,
+ trackedEntityId: trackedEntityId ?? ""
+ }}
+ fetcher={fetcher}
+ >
+ <ModalHeader>
+ <ModalTitle>
+ <Trans>Create Quality Issue</Trans>
+ </ModalTitle>
+ </ModalHeader>
+ <ModalBody>
+ <Hidden name="jobOperationId" value={operationId} />
+ {trackedEntityId && (
+ <Hidden name="trackedEntityId" value={trackedEntityId} />
+ )}
+ <VStack spacing={4}>
+ <Select
+ name="nonConformanceTypeId"
+ label={t`Issue Type`}
+ options={issueTypes.map((type) => ({
+ value: type.id,
+ label: type.name
+ }))}
+ />
+ <Select
+ name="priority"
+ label={t`Priority`}
+ options={qualityIssuePriority.map((p) => ({
+ value: p,
+ label: p
+ }))}
+ />
+ <TextArea
+ name="description"
+ label={t`Description`}
+ placeholder={t`Describe the problem...`}
+ />
+ </VStack>
+ </ModalBody>
+ <ModalFooter>
+ <HStack>
+ <Button variant="secondary" onClick={onClose}>
+ <Trans>Cancel</Trans>
+ </Button>
+ <Submit isLoading={fetcher.state !== "idle"}>
+ <Trans>Create Issue</Trans>
+ </Submit>
+ </HStack>
+ </ModalFooter>
+ </ValidatedForm>
+ </ModalContent>
+ </Modal>
+ );
+}
diff --git a/apps/mes/app/components/JobOperation/components/QuantityModal.tsx b/apps/mes/app/components/JobOperation/components/QuantityModal.tsx
index c3ac76db6e..dfd3491d42 100644
--- a/apps/mes/app/components/JobOperation/components/QuantityModal.tsx
+++ b/apps/mes/app/components/JobOperation/components/QuantityModal.tsx
@@ -230,16 +230,33 @@ export function QuantityModal({
</Alert>
)}
{type !== "finish" && (
- <>
- <NumberControlled
- name="quantity"
- label={t`Quantity`}
- value={quantity}
- onChange={setQuantity}
- isReadOnly={parentIsSerial}
- minValue={0}
- />
- </>
+ <div className="flex items-end gap-2 w-full">
+ <div className="flex-grow">
+ <NumberControlled
+ name="quantity"
+ label={t`Quantity`}
+ value={quantity}
+ onChange={setQuantity}
+ isReadOnly={parentIsSerial}
+ minValue={0}
+ />
+ </div>
+ {type === "complete" && !parentIsSerial && (
+ <Button
+ variant="secondary"
+ size="md"
+ className="h-10"
+ onClick={() =>
+ setQuantity(
+ operation.operationQuantity -
+ operation.quantityComplete
+ )
+ }
+ >
+ <Trans>Complete All</Trans>
+ </Button>
+ )}
+ </div>
)}
{type === "scrap" ? (
<>
diff --git a/apps/mes/app/components/JobOperation/components/Step.tsx b/apps/mes/app/components/JobOperation/components/Step.tsx
index dd256bcd45..c2fef0e9d8 100644
--- a/apps/mes/app/components/JobOperation/components/Step.tsx
+++ b/apps/mes/app/components/JobOperation/components/Step.tsx
@@ -364,7 +364,6 @@ export function RecordModal({
const { company } = useUser();
const [file, setFile] = useState<File | null>(null);
const [filePath, setFilePath] = useState<string | null>(null);
-
const fetcher = useFetcher<{ success: boolean }>();
const onDrop = async (acceptedFiles: File[]) => {
@@ -419,7 +418,6 @@ export function RecordModal({
method="post"
validator={stepRecordValidator}
action={path.to.record}
- onSubmit={onClose}
defaultValues={{
index: activeStep,
jobOperationStepId: attribute.id,
diff --git a/apps/mes/app/routes/api+/quality-issue-types.ts b/apps/mes/app/routes/api+/quality-issue-types.ts
new file mode 100644
index 0000000000..4a25bf8094
--- /dev/null
+++ b/apps/mes/app/routes/api+/quality-issue-types.ts
@@ -0,0 +1,9 @@
+import { requirePermissions } from "@carbon/auth/auth.server";
+import type { LoaderFunctionArgs } from "react-router";
+import { getQualityIssueTypesList } from "~/services/operations.service";
+
+export async function loader({ request }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {});
+
+ return await getQualityIssueTypesList(client, companyId);
+}
diff --git a/apps/mes/app/routes/x+/quality-issue.new.tsx b/apps/mes/app/routes/x+/quality-issue.new.tsx
new file mode 100644
index 0000000000..20c536bc19
--- /dev/null
+++ b/apps/mes/app/routes/x+/quality-issue.new.tsx
@@ -0,0 +1,429 @@
+import { assertIsPost, error, success } from "@carbon/auth";
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { getCarbonServiceRole } from "@carbon/auth/client.server";
+import { flash } from "@carbon/auth/session.server";
+import type { Database } from "@carbon/database";
+import type { ActionFunctionArgs } from "react-router";
+import { redirect } from "react-router";
+import { path, requestReferrer } from "~/utils/path";
+
+type ServiceRole = Awaited<ReturnType<typeof getCarbonServiceRole>>;
+type IssueContext =
+ | {
+ ok: true;
+ jobOperationId: string;
+ operationOrder: string | null;
+ jobId: string;
+ jobReadableId: string;
+ jobMakeMethodId: string | null;
+ itemId: string | null;
+ itemReadableId: string | null;
+ locationId: string;
+ issueTypeId: string;
+ assignee: string | null;
+ }
+ | {
+ ok: false;
+ error: unknown;
+ message: string;
+ };
+
+export async function action({ request }: ActionFunctionArgs) {
+ assertIsPost(request);
+ const { companyId, userId } = await requirePermissions(request, {
+ create: "quality"
+ });
+ const serviceRole = await getCarbonServiceRole();
+
+ const formData = await request.formData();
+ const jobOperationId = getRequiredFormValue(formData, "jobOperationId");
+ const trackedEntityId = getOptionalFormValue(formData, "trackedEntityId");
+ const userDescription = getOptionalFormValue(formData, "description");
+ const nonConformanceTypeId = getOptionalFormValue(
+ formData,
+ "nonConformanceTypeId"
+ );
+ const priority = getOptionalFormValue(formData, "priority") as
+ | "Low"
+ | "Medium"
+ | "High"
+ | "Critical"
+ | undefined;
+ const quantity = normalizeQuantity(
+ getOptionalFormValue(formData, "quantity")
+ );
+
+ if (!jobOperationId) {
+ throw redirect(
+ requestReferrer(request) ?? path.to.active,
+ await flash(request, error(null, "Job operation is required"))
+ );
+ }
+
+ const context = await getIssueContext(serviceRole, {
+ companyId,
+ userId,
+ jobOperationId
+ });
+
+ if (!context.ok) {
+ throw redirect(
+ requestReferrer(request) ?? path.to.active,
+ await flash(request, error(context.error, context.message))
+ );
+ }
+
+ const nextSequence = await serviceRole.rpc("get_next_sequence", {
+ sequence_name: "nonConformance",
+ company_id: companyId
+ });
+
+ if (nextSequence.error || !nextSequence.data) {
+ throw redirect(
+ requestReferrer(request) ?? path.to.active,
+ await flash(
+ request,
+ error(nextSequence.error, "Failed to get quality issue sequence")
+ )
+ );
+ }
+
+ const name =
+ userDescription ??
+ `MES quality issue: ${context.itemReadableId ?? context.jobReadableId}`;
+
+ const issue = await serviceRole
+ .from("nonConformance")
+ .insert({
+ nonConformanceId: nextSequence.data,
+ name,
+ description: "",
+ priority: priority ?? "Medium",
+ source: "Internal",
+ locationId: context.locationId,
+ nonConformanceTypeId: nonConformanceTypeId ?? context.issueTypeId,
+ nonConformanceWorkflowId: null,
+ openDate: new Date().toISOString().slice(0, 10),
+ quantity,
+ assignee: context.assignee,
+ requiredActionIds: [],
+ approvalRequirements: [],
+ companyId,
+ createdBy: userId
+ } satisfies Database["public"]["Tables"]["nonConformance"]["Insert"])
+ .select("id")
+ .single();
+
+ if (issue.error || !issue.data?.id) {
+ throw redirect(
+ requestReferrer(request) ?? path.to.active,
+ await flash(request, error(issue.error, "Failed to create quality issue"))
+ );
+ }
+
+ const nonConformanceId = issue.data.id;
+
+ const [jobOperationAssociation, dispositionAssociation] = await Promise.all([
+ serviceRole.from("nonConformanceJobOperation").insert({
+ nonConformanceId,
+ jobOperationId: context.jobOperationId,
+ jobId: context.jobId,
+ jobReadableId: context.jobReadableId,
+ companyId,
+ createdBy: userId
+ }),
+ linkIssueDispositionContext(serviceRole, {
+ nonConformanceId,
+ companyId,
+ userId,
+ itemId: context.itemId,
+ jobMakeMethodId: context.jobMakeMethodId,
+ trackedEntityId,
+ quantity
+ })
+ ]);
+ const associationError =
+ jobOperationAssociation.error ?? dispositionAssociation.error;
+ if (associationError) {
+ await serviceRole
+ .from("nonConformance")
+ .delete()
+ .eq("id", nonConformanceId);
+ throw redirect(
+ requestReferrer(request) ?? path.to.active,
+ await flash(
+ request,
+ error(associationError, "Failed to link quality issue to MES context")
+ )
+ );
+ }
+
+ const tasks = await serviceRole.functions.invoke("create", {
+ body: {
+ type: "nonConformanceTasks",
+ id: nonConformanceId,
+ companyId,
+ userId
+ }
+ });
+
+ if (tasks.error) {
+ await serviceRole
+ .from("nonConformance")
+ .delete()
+ .eq("id", nonConformanceId);
+ throw redirect(
+ requestReferrer(request) ?? path.to.active,
+ await flash(
+ request,
+ error(tasks.error, "Failed to create quality issue tasks")
+ )
+ );
+ }
+
+ return success("Quality issue created");
+}
+
+function getRequiredFormValue(formData: FormData, key: string) {
+ return (formData.get(key) as string | null)?.trim() ?? "";
+}
+
+function getOptionalFormValue(formData: FormData, key: string) {
+ return (formData.get(key) as string | null)?.trim() || undefined;
+}
+
+function normalizeQuantity(value: string | undefined) {
+ const quantity = Number(value ?? "1");
+ return Number.isFinite(quantity) && quantity > 0 ? quantity : 1;
+}
+
+async function getIssueContext(
+ client: ServiceRole,
+ args: {
+ companyId: string;
+ userId: string;
+ jobOperationId: string;
+ }
+): Promise<IssueContext> {
+ const operation = await client
+ .from("jobOperation")
+ .select("id, companyId, jobId, jobMakeMethodId, operationOrder")
+ .eq("id", args.jobOperationId)
+ .maybeSingle();
+
+ if (operation.error || !operation.data) {
+ return {
+ ok: false,
+ error: operation.error,
+ message: "Failed to load job operation"
+ };
+ }
+
+ if (operation.data.companyId !== args.companyId) {
+ return {
+ ok: false,
+ error: null,
+ message: "Job operation is not in this company"
+ };
+ }
+
+ const [job, defaults, issueType] = await Promise.all([
+ client
+ .from("job")
+ .select("id, jobId, itemId, locationId, assignee")
+ .eq("id", operation.data.jobId)
+ .maybeSingle(),
+ client
+ .from("userDefaults")
+ .select("locationId")
+ .eq("userId", args.userId)
+ .eq("companyId", args.companyId)
+ .maybeSingle(),
+ client
+ .from("nonConformanceType")
+ .select("id")
+ .eq("companyId", args.companyId)
+ .order("name", { ascending: true })
+ .limit(1)
+ .maybeSingle()
+ ]);
+
+ if (job.error || !job.data) {
+ return {
+ ok: false,
+ error: job.error,
+ message: "Failed to load job context"
+ };
+ }
+
+ if (issueType.error || !issueType.data?.id) {
+ return {
+ ok: false,
+ error: issueType.error,
+ message:
+ "Configure at least one quality issue type before creating MES issues"
+ };
+ }
+
+ const locationId = defaults.data?.locationId ?? job.data.locationId;
+ if (!locationId) {
+ return {
+ ok: false,
+ error: defaults.error,
+ message: "A location is required to create a quality issue"
+ };
+ }
+
+ const item = job.data.itemId
+ ? await client
+ .from("item")
+ .select("readableId, name")
+ .eq("id", job.data.itemId)
+ .maybeSingle()
+ : null;
+
+ return {
+ ok: true,
+ jobOperationId: operation.data.id,
+ operationOrder: operation.data.operationOrder,
+ jobId: job.data.id,
+ jobReadableId: job.data.jobId,
+ jobMakeMethodId: operation.data.jobMakeMethodId,
+ itemId: job.data.itemId,
+ itemReadableId:
+ item?.data?.readableId ?? item?.data?.name ?? job.data.itemId ?? null,
+ locationId,
+ issueTypeId: issueType.data.id,
+ assignee: job.data.assignee
+ };
+}
+
+async function linkIssueDispositionContext(
+ client: ServiceRole,
+ args: {
+ nonConformanceId: string;
+ companyId: string;
+ userId: string;
+ itemId: string | null;
+ jobMakeMethodId: string | null;
+ trackedEntityId?: string;
+ quantity: number;
+ }
+): Promise<{ error: unknown | null }> {
+ const {
+ nonConformanceId,
+ companyId,
+ userId,
+ itemId,
+ jobMakeMethodId,
+ trackedEntityId,
+ quantity
+ } = args;
+
+ if (!itemId) return { error: null };
+
+ const trackedEntities = await getTrackedEntitiesForIssue(client, {
+ companyId,
+ jobMakeMethodId,
+ trackedEntityId
+ });
+
+ if (trackedEntities.error) {
+ return { error: trackedEntities.error };
+ }
+
+ const itemQuantity =
+ trackedEntities.data.length > 0
+ ? trackedEntities.data.reduce(
+ (total, entity) => total + Number(entity.quantity ?? quantity),
+ 0
+ )
+ : quantity;
+
+ const item = await client
+ .from("nonConformanceItem")
+ .insert({
+ nonConformanceId,
+ itemId,
+ quantity: itemQuantity,
+ disposition: "Pending",
+ companyId,
+ createdBy: userId
+ })
+ .select("id")
+ .single();
+
+ if (item.error || !item.data?.id) {
+ return { error: item.error ?? new Error("Failed to create issue item") };
+ }
+
+ if (trackedEntities.data.length === 0) {
+ return { error: null };
+ }
+
+ const trackedEntityLinks = await client
+ .from("nonConformanceTrackedEntity")
+ .insert(
+ trackedEntities.data.map((entity) => ({
+ nonConformanceId,
+ trackedEntityId: entity.id,
+ companyId,
+ createdBy: userId
+ }))
+ );
+
+ if (trackedEntityLinks.error) {
+ return { error: trackedEntityLinks.error };
+ }
+
+ const dispositionLinks = await client
+ .from("nonConformanceItemTrackedEntity")
+ .insert(
+ trackedEntities.data.map((entity) => ({
+ nonConformanceItemId: item.data.id,
+ nonConformanceId,
+ trackedEntityId: entity.id,
+ quantity: Number(entity.quantity ?? quantity),
+ companyId,
+ createdBy: userId
+ }))
+ );
+
+ return { error: dispositionLinks.error };
+}
+
+async function getTrackedEntitiesForIssue(
+ client: ServiceRole,
+ args: {
+ companyId: string;
+ jobMakeMethodId: string | null;
+ trackedEntityId?: string;
+ }
+): Promise<{
+ data: { id: string; quantity: number | null }[];
+ error: unknown | null;
+}> {
+ if (!args.trackedEntityId) {
+ return { data: [], error: null };
+ }
+
+ const entity = await client
+ .from("trackedEntity")
+ .select("id, quantity")
+ .eq("id", args.trackedEntityId)
+ .eq("companyId", args.companyId)
+ .maybeSingle();
+
+ if (entity.error) {
+ return { data: [], error: entity.error };
+ }
+
+ if (!entity.data) {
+ return {
+ data: [],
+ error: new Error("Tracked entity is not in this company")
+ };
+ }
+
+ return { data: [entity.data], error: null };
+}
diff --git a/apps/mes/app/services/models.ts b/apps/mes/app/services/models.ts
index 8db766bc4e..1b32593f9a 100644
--- a/apps/mes/app/services/models.ts
+++ b/apps/mes/app/services/models.ts
@@ -181,6 +181,25 @@ export const maintenanceDispatchValidator = z.object({
actualEndTime: zfd.text(z.string().optional())
});
+export const qualityIssuePriority = [
+ "Low",
+ "Medium",
+ "High",
+ "Critical"
+] as const;
+
+export const qualityIssueValidator = z.object({
+ jobOperationId: z.string().min(1, { message: "Operation is required" }),
+ description: z.string().min(1, { message: "Description is required" }),
+ nonConformanceTypeId: z
+ .string()
+ .min(1, { message: "Issue type is required" }),
+ priority: z.enum(qualityIssuePriority, {
+ errorMap: () => ({ message: "Priority is required" })
+ }),
+ trackedEntityId: zfd.text(z.string().optional())
+});
+
export const maintenanceDispatchIssueValidator = z.object({
maintenanceDispatchItemId: z.string().min(1, {
message: "Maintenance Dispatch Item is required"
diff --git a/apps/mes/app/services/operations.service.ts b/apps/mes/app/services/operations.service.ts
index c0dd53952d..dfb4ce21fe 100644
--- a/apps/mes/app/services/operations.service.ts
+++ b/apps/mes/app/services/operations.service.ts
@@ -197,6 +197,17 @@ export async function getFailureModesList(
.order("name");
}
+export async function getQualityIssueTypesList(
+ client: SupabaseClient<Database>,
+ companyId: string
+) {
+ return client
+ .from("nonConformanceType")
+ .select("id, name")
+ .eq("companyId", companyId)
+ .order("name");
+}
+
export function getFileType(fileName: string): (typeof documentTypes)[number] {
const extension = fileName.split(".").pop()?.toLowerCase() ?? "";
if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
@@ -827,11 +838,17 @@ export async function insertReworkQuantity(
createdBy: string;
}
) {
+ const {
+ trackedEntityId: _trackedEntityId,
+ trackingType: _trackingType,
+ ...insert
+ } = data;
+
return client
.from("productionQuantity")
.insert(
sanitize({
- ...data,
+ ...insert,
type: "Rework"
})
)
diff --git a/apps/mes/app/utils/path.ts b/apps/mes/app/utils/path.ts
index f9d0056df6..ede3f55374 100644
--- a/apps/mes/app/utils/path.ts
+++ b/apps/mes/app/utils/path.ts
@@ -14,6 +14,7 @@ export const path = {
batchNumbers: (itemId: string) =>
generatePath(`${api}/batch-numbers?itemId=${itemId}`),
failureModes: `${api}/failure-modes`,
+ qualityIssueTypes: `${api}/quality-issue-types`,
serialNumbers: (itemId: string) =>
generatePath(`${api}/serial-numbers?itemId=${itemId}`)
},
@@ -112,6 +113,7 @@ export const path = {
jobs: `${x}/jobs`,
issue: `${x}/issue`,
issueTrackedEntity: `${x}/issue-tracked-entity`,
+ qualityIssueNew: `${x}/quality-issue/new`,
location: `${x}/location`,
login: "/login",
logout: "/logout",
diff --git a/packages/locale/locales/de/mes.po b/packages/locale/locales/de/mes.po
index 326b18acd8..0dcefd4e26 100644
--- a/packages/locale/locales/de/mes.po
+++ b/packages/locale/locales/de/mes.po
@@ -201,6 +201,9 @@ msgstr "Unternehmen"
msgid "Complete"
msgstr "Abschließen"
+msgid "Complete All"
+msgstr "Alles abschließen"
+
msgid "Completed"
msgstr "Abgeschlossen"
@@ -218,6 +221,12 @@ msgstr "Verbrauchte abgelaufen"
msgid "Create {0}"
msgstr "Erstelle {0}"
+msgid "Create Issue"
+msgstr "Problem erstellen"
+
+msgid "Create Quality Issue"
+msgstr "Qualitätsproblem erstellen"
+
msgid "Customer"
msgstr "Kunde"
@@ -243,6 +252,9 @@ msgstr "Schritt löschen"
msgid "Delete Timecard ({0})"
msgstr "Zeitkarte löschen ({0})"
+msgid "Describe the problem..."
+msgstr "Beschreiben Sie das Problem..."
+
msgid "Description"
msgstr "Beschreibung"
@@ -387,6 +399,9 @@ msgstr "Ausgeben"
msgid "Issue Material"
msgstr "Material ausgeben"
+msgid "Issue Type"
+msgstr "Problemtyp"
+
msgid "Item"
msgstr "Artikel"
@@ -665,6 +680,12 @@ msgstr "Prozesse"
msgid "Progress"
msgstr "Fortschritt"
+msgid "Quality Issue"
+msgstr "Qualitätsproblem"
+
+msgid "Quality issue created"
+msgstr "Qualitätsproblem erstellt"
+
msgid "Quantity"
msgstr "Menge"
diff --git a/packages/locale/locales/en/mes.po b/packages/locale/locales/en/mes.po
index 2c3d76da98..cbe31da1cb 100644
--- a/packages/locale/locales/en/mes.po
+++ b/packages/locale/locales/en/mes.po
@@ -201,6 +201,9 @@ msgstr "Company"
msgid "Complete"
msgstr "Complete"
+msgid "Complete All"
+msgstr "Complete All"
+
msgid "Completed"
msgstr "Completed"
@@ -218,6 +221,12 @@ msgstr "Consumed expired"
msgid "Create {0}"
msgstr "Create {0}"
+msgid "Create Issue"
+msgstr "Create Issue"
+
+msgid "Create Quality Issue"
+msgstr "Create Quality Issue"
+
msgid "Customer"
msgstr "Customer"
@@ -243,6 +252,9 @@ msgstr "Delete Step"
msgid "Delete Timecard ({0})"
msgstr "Delete Timecard ({0})"
+msgid "Describe the problem..."
+msgstr "Describe the problem..."
+
msgid "Description"
msgstr "Description"
@@ -387,6 +399,9 @@ msgstr "Issue"
msgid "Issue Material"
msgstr "Issue Material"
+msgid "Issue Type"
+msgstr "Issue Type"
+
msgid "Item"
msgstr "Item"
@@ -665,6 +680,12 @@ msgstr "Processes"
msgid "Progress"
msgstr "Progress"
+msgid "Quality Issue"
+msgstr "Quality Issue"
+
+msgid "Quality issue created"
+msgstr "Quality issue created"
+
msgid "Quantity"
msgstr "Quantity"
diff --git a/packages/locale/locales/es/mes.po b/packages/locale/locales/es/mes.po
index ccd43c550f..120feec343 100644
--- a/packages/locale/locales/es/mes.po
+++ b/packages/locale/locales/es/mes.po
@@ -201,6 +201,9 @@ msgstr "Empresa"
msgid "Complete"
msgstr "Completar"
+msgid "Complete All"
+msgstr "Completar todo"
+
msgid "Completed"
msgstr "Completado"
@@ -218,6 +221,12 @@ msgstr "Consumido vencido"
msgid "Create {0}"
msgstr "Crear {0}"
+msgid "Create Issue"
+msgstr "Crear Problema"
+
+msgid "Create Quality Issue"
+msgstr "Crear Problema de Calidad"
+
msgid "Customer"
msgstr "Cliente"
@@ -243,6 +252,9 @@ msgstr "Eliminar paso"
msgid "Delete Timecard ({0})"
msgstr "Eliminar tarjeta de tiempo ({0})"
+msgid "Describe the problem..."
+msgstr "Describe el problema..."
+
msgid "Description"
msgstr "Descripción"
@@ -387,6 +399,9 @@ msgstr "Emitir"
msgid "Issue Material"
msgstr "Emitir material"
+msgid "Issue Type"
+msgstr "Tipo de Problema"
+
msgid "Item"
msgstr "Artículo"
@@ -665,6 +680,12 @@ msgstr "Procesos"
msgid "Progress"
msgstr "Progreso"
+msgid "Quality Issue"
+msgstr "Problema de Calidad"
+
+msgid "Quality issue created"
+msgstr "Problema de calidad creado"
+
msgid "Quantity"
msgstr "Cantidad"
diff --git a/packages/locale/locales/fr/mes.po b/packages/locale/locales/fr/mes.po
index 8bf6060fd1..8c71db44f6 100644
--- a/packages/locale/locales/fr/mes.po
+++ b/packages/locale/locales/fr/mes.po
@@ -201,6 +201,9 @@ msgstr "Entreprise"
msgid "Complete"
msgstr "Terminé"
+msgid "Complete All"
+msgstr "Tout compléter"
+
msgid "Completed"
msgstr "Terminé"
@@ -218,6 +221,12 @@ msgstr "Consommé expiré"
msgid "Create {0}"
msgstr "Créer {0}"
+msgid "Create Issue"
+msgstr "Créer un problème"
+
+msgid "Create Quality Issue"
+msgstr "Créer un problème de qualité"
+
msgid "Customer"
msgstr "Client"
@@ -243,6 +252,9 @@ msgstr "Supprimer l'étape"
msgid "Delete Timecard ({0})"
msgstr "Supprimer la fiche de temps ({0})"
+msgid "Describe the problem..."
+msgstr "Décrivez le problème..."
+
msgid "Description"
msgstr "Description"
@@ -387,6 +399,9 @@ msgstr "Distribuer"
msgid "Issue Material"
msgstr "Distribuer le matériau"
+msgid "Issue Type"
+msgstr "Type de problème"
+
msgid "Item"
msgstr "Article"
@@ -665,6 +680,12 @@ msgstr "Processus"
msgid "Progress"
msgstr "Progression"
+msgid "Quality Issue"
+msgstr "Problème de qualité"
+
+msgid "Quality issue created"
+msgstr "Problème de qualité créé"
+
msgid "Quantity"
msgstr "Quantité"
diff --git a/packages/locale/locales/hi/mes.po b/packages/locale/locales/hi/mes.po
index e61212f1da..66c62d0e7d 100644
--- a/packages/locale/locales/hi/mes.po
+++ b/packages/locale/locales/hi/mes.po
@@ -201,6 +201,9 @@ msgstr "कंपनी"
msgid "Complete"
msgstr "पूर्ण करें"
+msgid "Complete All"
+msgstr "सभी को पूर्ण करें"
+
msgid "Completed"
msgstr "पूर्ण"
@@ -218,6 +221,12 @@ msgstr "खपत की गई समाप्त"
msgid "Create {0}"
msgstr "{0} बनाएं"
+msgid "Create Issue"
+msgstr "समस्या बनाएं"
+
+msgid "Create Quality Issue"
+msgstr "गुणवत्ता समस्या बनाएं"
+
msgid "Customer"
msgstr "ग्राहक"
@@ -243,6 +252,9 @@ msgstr "चरण हटाएं"
msgid "Delete Timecard ({0})"
msgstr "टाइमकार्ड हटाएं ({0})"
+msgid "Describe the problem..."
+msgstr "समस्या का वर्णन करें..."
+
msgid "Description"
msgstr "विवरण"
@@ -387,6 +399,9 @@ msgstr "जारी करें"
msgid "Issue Material"
msgstr "सामग्री जारी करें"
+msgid "Issue Type"
+msgstr "समस्या प्रकार"
+
msgid "Item"
msgstr "वस्तु"
@@ -665,6 +680,12 @@ msgstr "प्रक्रियाएं"
msgid "Progress"
msgstr "प्रगति"
+msgid "Quality Issue"
+msgstr "गुणवत्ता समस्या"
+
+msgid "Quality issue created"
+msgstr "गुणवत्ता समस्या बनाई गई"
+
msgid "Quantity"
msgstr "मात्रा"
diff --git a/packages/locale/locales/it/mes.po b/packages/locale/locales/it/mes.po
index a619fca496..1ebe469f14 100644
--- a/packages/locale/locales/it/mes.po
+++ b/packages/locale/locales/it/mes.po
@@ -201,6 +201,9 @@ msgstr "Azienda"
msgid "Complete"
msgstr "Completa"
+msgid "Complete All"
+msgstr "Completa tutto"
+
msgid "Completed"
msgstr "Completato"
@@ -218,6 +221,12 @@ msgstr "Consumato scaduto"
msgid "Create {0}"
msgstr "Crea {0}"
+msgid "Create Issue"
+msgstr "Crea Problema"
+
+msgid "Create Quality Issue"
+msgstr "Crea Problema di Qualità"
+
msgid "Customer"
msgstr "Cliente"
@@ -243,6 +252,9 @@ msgstr "Elimina Fase"
msgid "Delete Timecard ({0})"
msgstr "Elimina Cartellino ({0})"
+msgid "Describe the problem..."
+msgstr "Descrivi il problema..."
+
msgid "Description"
msgstr "Descrizione"
@@ -387,6 +399,9 @@ msgstr "Preleva"
msgid "Issue Material"
msgstr "Preleva Materiale"
+msgid "Issue Type"
+msgstr "Tipo di Problema"
+
msgid "Item"
msgstr "Articolo"
@@ -665,6 +680,12 @@ msgstr "Processi"
msgid "Progress"
msgstr "Avanzamento"
+msgid "Quality Issue"
+msgstr "Problema di qualità"
+
+msgid "Quality issue created"
+msgstr "Problema di qualità creato"
+
msgid "Quantity"
msgstr "Quantità"
diff --git a/packages/locale/locales/ja/mes.po b/packages/locale/locales/ja/mes.po
index 63e7a0bdc8..ba250c025c 100644
--- a/packages/locale/locales/ja/mes.po
+++ b/packages/locale/locales/ja/mes.po
@@ -201,6 +201,9 @@ msgstr "会社"
msgid "Complete"
msgstr "完了"
+msgid "Complete All"
+msgstr "すべて完了"
+
msgid "Completed"
msgstr "完了済み"
@@ -218,6 +221,12 @@ msgstr "消費期限切れ"
msgid "Create {0}"
msgstr "{0}を作成"
+msgid "Create Issue"
+msgstr "問題を作成"
+
+msgid "Create Quality Issue"
+msgstr "品質問題を作成"
+
msgid "Customer"
msgstr "顧客"
@@ -243,6 +252,9 @@ msgstr "ステップを削除"
msgid "Delete Timecard ({0})"
msgstr "タイムカードを削除({0})"
+msgid "Describe the problem..."
+msgstr "問題を説明してください..."
+
msgid "Description"
msgstr "説明"
@@ -387,6 +399,9 @@ msgstr "払出"
msgid "Issue Material"
msgstr "材料払出"
+msgid "Issue Type"
+msgstr "問題タイプ"
+
msgid "Item"
msgstr "品目"
@@ -665,6 +680,12 @@ msgstr "プロセス一覧"
msgid "Progress"
msgstr "進捗"
+msgid "Quality Issue"
+msgstr "品質問題"
+
+msgid "Quality issue created"
+msgstr "品質問題が作成されました"
+
msgid "Quantity"
msgstr "数量"
diff --git a/packages/locale/locales/nl/mes.po b/packages/locale/locales/nl/mes.po
index bfe1f15aab..82537a4c2b 100644
--- a/packages/locale/locales/nl/mes.po
+++ b/packages/locale/locales/nl/mes.po
@@ -218,6 +218,12 @@ msgstr ""
msgid "Create {0}"
msgstr ""
+msgid "Create a quality issue for MRB review."
+msgstr ""
+
+msgid "Create Quality Issue"
+msgstr ""
+
msgid "Customer"
msgstr ""
@@ -249,6 +255,9 @@ msgstr ""
msgid "Details"
msgstr ""
+msgid "Dismiss"
+msgstr ""
+
msgid "Dispatch not found"
msgstr ""
@@ -369,6 +378,9 @@ msgstr ""
msgid "Insufficient quantity"
msgstr ""
+msgid "Inspection Failed"
+msgstr ""
+
msgid "Inventory adjustment completed"
msgstr ""
@@ -590,6 +602,9 @@ msgstr ""
msgid "Open"
msgstr ""
+msgid "Operation evidence will be attached as context."
+msgstr ""
+
msgid "Operations"
msgstr ""
diff --git a/packages/locale/locales/pl/mes.po b/packages/locale/locales/pl/mes.po
index 3c9d59dc6c..742be90733 100644
--- a/packages/locale/locales/pl/mes.po
+++ b/packages/locale/locales/pl/mes.po
@@ -201,6 +201,9 @@ msgstr "Firma"
msgid "Complete"
msgstr "Ukończ"
+msgid "Complete All"
+msgstr "Uzupełnij wszystko"
+
msgid "Completed"
msgstr "Ukończone"
@@ -218,6 +221,12 @@ msgstr "Zużyte wygasłe"
msgid "Create {0}"
msgstr "Utwórz {0}"
+msgid "Create Issue"
+msgstr "Utwórz Problem"
+
+msgid "Create Quality Issue"
+msgstr "Utwórz Problem Jakości"
+
msgid "Customer"
msgstr "Klient"
@@ -243,6 +252,9 @@ msgstr "Usuń krok"
msgid "Delete Timecard ({0})"
msgstr "Usuń kartę czasu pracy ({0})"
+msgid "Describe the problem..."
+msgstr "Opisz problem..."
+
msgid "Description"
msgstr "Opis"
@@ -387,6 +399,9 @@ msgstr "Wydaj"
msgid "Issue Material"
msgstr "Wydaj materiał"
+msgid "Issue Type"
+msgstr "Typ problemu"
+
msgid "Item"
msgstr "Pozycja"
@@ -665,6 +680,12 @@ msgstr "Procesy"
msgid "Progress"
msgstr "Postęp"
+msgid "Quality Issue"
+msgstr "Problem z jakością"
+
+msgid "Quality issue created"
+msgstr "Problem z jakością został utworzony"
+
msgid "Quantity"
msgstr "Ilość"
diff --git a/packages/locale/locales/pt/mes.po b/packages/locale/locales/pt/mes.po
index 035434d6b5..b93541ea28 100644
--- a/packages/locale/locales/pt/mes.po
+++ b/packages/locale/locales/pt/mes.po
@@ -201,6 +201,9 @@ msgstr "Empresa"
msgid "Complete"
msgstr "Concluir"
+msgid "Complete All"
+msgstr "Completar Tudo"
+
msgid "Completed"
msgstr "Concluído"
@@ -218,6 +221,12 @@ msgstr "Consumido expirado"
msgid "Create {0}"
msgstr "Criar {0}"
+msgid "Create Issue"
+msgstr "Criar Problema"
+
+msgid "Create Quality Issue"
+msgstr "Criar Problema de Qualidade"
+
msgid "Customer"
msgstr "Cliente"
@@ -243,6 +252,9 @@ msgstr "Excluir Etapa"
msgid "Delete Timecard ({0})"
msgstr "Excluir Cartão de Ponto ({0})"
+msgid "Describe the problem..."
+msgstr "Descreva o problema..."
+
msgid "Description"
msgstr "Descrição"
@@ -387,6 +399,9 @@ msgstr "Emitir"
msgid "Issue Material"
msgstr "Emitir Material"
+msgid "Issue Type"
+msgstr "Tipo de Problema"
+
msgid "Item"
msgstr "Item"
@@ -665,6 +680,12 @@ msgstr "Processos"
msgid "Progress"
msgstr "Progresso"
+msgid "Quality Issue"
+msgstr "Problema de Qualidade"
+
+msgid "Quality issue created"
+msgstr "Problema de qualidade criado"
+
msgid "Quantity"
msgstr "Quantidade"
diff --git a/packages/locale/locales/ru/mes.po b/packages/locale/locales/ru/mes.po
index 28903894bb..cb2d151fcc 100644
--- a/packages/locale/locales/ru/mes.po
+++ b/packages/locale/locales/ru/mes.po
@@ -201,6 +201,9 @@ msgstr "Компания"
msgid "Complete"
msgstr "Завершить"
+msgid "Complete All"
+msgstr "Завершить все"
+
msgid "Completed"
msgstr "Завершено"
@@ -218,6 +221,12 @@ msgstr "Потреблено истекшее"
msgid "Create {0}"
msgstr "Создать {0}"
+msgid "Create Issue"
+msgstr "Создать проблему"
+
+msgid "Create Quality Issue"
+msgstr "Создать проблему качества"
+
msgid "Customer"
msgstr "Заказчик"
@@ -243,6 +252,9 @@ msgstr "Удалить шаг"
msgid "Delete Timecard ({0})"
msgstr "Удалить табель ({0})"
+msgid "Describe the problem..."
+msgstr "Опишите проблему..."
+
msgid "Description"
msgstr "Описание"
@@ -387,6 +399,9 @@ msgstr "Выдать"
msgid "Issue Material"
msgstr "Выдать материал"
+msgid "Issue Type"
+msgstr "Тип проблемы"
+
msgid "Item"
msgstr "Номенклатура"
@@ -665,6 +680,12 @@ msgstr "Процессы"
msgid "Progress"
msgstr "Прогресс"
+msgid "Quality Issue"
+msgstr "Проблема качества"
+
+msgid "Quality issue created"
+msgstr "Проблема качества создана"
+
msgid "Quantity"
msgstr "Количество"
diff --git a/packages/locale/locales/zh/mes.po b/packages/locale/locales/zh/mes.po
index 1b1ebed69f..b5d9b56210 100644
--- a/packages/locale/locales/zh/mes.po
+++ b/packages/locale/locales/zh/mes.po
@@ -201,6 +201,9 @@ msgstr "公司"
msgid "Complete"
msgstr "完成"
+msgid "Complete All"
+msgstr "全部完成"
+
msgid "Completed"
msgstr "已完成"
@@ -218,6 +221,12 @@ msgstr "已消耗过期"
msgid "Create {0}"
msgstr "创建 {0}"
+msgid "Create Issue"
+msgstr "创建问题"
+
+msgid "Create Quality Issue"
+msgstr "创建质量问题"
+
msgid "Customer"
msgstr "客户"
@@ -243,6 +252,9 @@ msgstr "删除步骤"
msgid "Delete Timecard ({0})"
msgstr "删除考勤记录 ({0})"
+msgid "Describe the problem..."
+msgstr "描述问题..."
+
msgid "Description"
msgstr "描述"
@@ -387,6 +399,9 @@ msgstr "发放"
msgid "Issue Material"
msgstr "发放物料"
+msgid "Issue Type"
+msgstr "问题类型"
+
msgid "Item"
msgstr "物料"
@@ -665,6 +680,12 @@ msgstr "工艺"
msgid "Progress"
msgstr "进度"
+msgid "Quality Issue"
+msgstr "质量问题"
+
+msgid "Quality issue created"
+msgstr "质量问题已创建"
+
msgid "Quantity"
msgstr "数量"