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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
feat: warn or block operators who lack a process's required ability
aashud03159a09183
diff --git a/.ai/plans/2026-10-22-mes-ability-enforcement.md b/.ai/plans/2026-10-22-mes-ability-enforcement.mdnew file mode 100644index 0000000000..6b64715a46--- /dev/null+++ b/.ai/plans/2026-10-22-mes-ability-enforcement.md@@ -0,0 +1,388 @@+# MES ability enforcement — implementation plan++**Spec:** `.ai/specs/2026-10-22-mes-ability-enforcement.md`+**Branch:** `feat/mes-ability-enforcement`+**Worktree:** `/Users/aashu/work/carbon/carbon-feat-mes-ability-enforcement`++## Progress++- [x] Task 0: Set up the worktree+- [x] Task 1: Add the `processAbilityPolicy` column+- [x] Task 2: Regenerate the database types+- [x] Task 3: Add the ERP model and service input+- [x] Task 4: Add the choice to the Shop Floor card+- [x] Task 5: Return structured eligibility from `getOperationEligibility`+- [x] Task 6: Apply the policy at both Start paths+- [x] Task 7: Add the `AbilityWarning` component+- [x] Task 8: Show the banner on the three operation views+- [x] Task 9: Extract Lingui strings+- [ ] Task 10: Verify end to end++## Deviations++- After review, the mode moved from `companySettings.processAbilityPolicy` to `process.abilityPolicy` (migration `20261022063357_process-ability-policy.sql`), edited on the process form. Tasks 3–4 (the Shop Floor card) were reverted. See the spec changelog.++- Task 0: `crbn up --no-portless` could not bind Kong (port 54321 is held by another worktree's stack). Postgres started, so the migration and type generation ran. The browser test needs the portless proxy.+- Task 8: the three loaders call one helper, `getAbilityWarning` (`operations.service.ts`), instead of repeating the eligibility and policy reads.+- Task 2: `pnpm db:migrate` also regenerated `swagger-docs-schema.ts`. That diff includes drift that was already on `main` (`training.videoUrl`).++## Dependencies++- Task 2 needs Task 1. Task 1 needs Task 0.+- Tasks 3–4 need Task 2. Task 4 needs Task 3.+- Task 5 needs Task 2. Tasks 6 and 8 need Task 5. Task 8 needs Task 7.+- Task 9 needs Tasks 4, 7 and 8. Task 10 needs every other task.+- Tasks 3–4 and Tasks 5–8 are independent of each other.++Memory rule: run one heavy command at a time (install, typecheck, migrate). Check free memory first with `memory_pressure | tail -1`.++---++## Task 0: Set up the worktree++**Depends on:** none+**Files:** none in git.++**Steps:**+1. Run `pnpm install` in the worktree.+2. Symlink the main checkout's secrets: `ln -s ../carbon/.env .env`.+3. Run `pnpm exec crbn up` to start this worktree's own stack and write `.env.local`.++🛑 Step 3 starts a second Docker stack next to `carbon-feat-training-video-context`. Ask the user before you run it.++**Verify:**+```bash+test -f .env.local && echo ok+# Expected: ok+```++**Out of scope:** Never rebuild or reset the database.++---++## Task 1: Add the `processAbilityPolicy` column++**Depends on:** 0+**Files:**+- Create: `packages/database/supabase/migrations/<timestamp>_process-ability-policy.sql`+- Copy from (precedent): `packages/database/supabase/migrations/20260728120100_incomplete-picking-list-policy.sql`++**Steps:**+1. Run `pnpm db:migrate:new process-ability-policy`.+2. Put this SQL in the new file:+ ```sql+ -- What MES does when an operator starts an operation whose process requires+ -- an ability they do not hold (no employeeAbility row, or an expired one).+ -- 'warn' shows a banner and lets them start; 'block' refuses Start.+ ALTER TABLE "companySettings"+ ADD COLUMN IF NOT EXISTS "processAbilityPolicy" TEXT NOT NULL DEFAULT 'warn'+ CHECK ("processAbilityPolicy" IN ('warn', 'block'));+ ```+3. Run `pnpm db:migrate`.++**Verify:**+```bash+pnpm db:migrate+# Expected: no pending migrations, no error+```++**Out of scope:** The `ability`, `employeeAbility`, `process` and `training` tables.++---++## Task 2: Regenerate the database types++**Depends on:** 1+**Steps:**+1. Run `pnpm run generate:types`.++**Verify:**+```bash+grep -rn "processAbilityPolicy" packages/database/src/types.ts | head -3+# Expected: at least one line (Row, Insert, Update of companySettings)+```++If the generated file is not `packages/database/src/types.ts`, grep `packages/database/src` instead. Never hand-edit it.++---++## Task 3: Add the ERP model and service input++**Depends on:** 2+**Files:**+- Modify: `apps/erp/app/modules/settings/settings.models.ts` — add the policy constant and type below `incompletePickingListPolicyValidator`.+- Modify: `apps/erp/app/modules/settings/settings.server.ts` — add the field to `updateProductionSettings.input`.++**Steps:**+1. In `settings.models.ts`, add:+ ```ts+ // What MES does when an operator lacks the ability an operation's process+ // requires. 'warn' shows a banner and lets them start; 'block' refuses Start.+ export const processAbilityPolicies = ["warn", "block"] as const;+ export type ProcessAbilityPolicy = (typeof processAbilityPolicies)[number];+ ```+2. In `settings.server.ts`, import `processAbilityPolicies` from `./settings.models`.+3. Add `processAbilityPolicy: z.enum(processAbilityPolicies).optional(),` to the `updateProductionSettings` input object, after `autoSelectMaterialWithoutPickingList`.++**Verify:** typecheck runs in Task 4.++**Out of scope:** `updateInventorySettings`, `updateResourcesSettings`.++---++## Task 4: Add the choice to the Shop Floor card++**Depends on:** 3+**Files:**+- Modify: `apps/erp/app/routes/x+/settings+/production.tsx`+- Copy from (precedent): `IncompletePickingListPolicyChoice` in `apps/erp/app/routes/x+/settings+/inventory.tsx:535-565`++**Steps:**+1. Add to `productionSettingsForm`:+ ```ts+ z.object({+ intent: z.literal("processAbilityPolicy"),+ processAbilityPolicy: z.enum(processAbilityPolicies)+ }).transform(({ processAbilityPolicy }) => ({ processAbilityPolicy })),+ ```+2. In `productionSettingsMessage`, before the final return, add: if `data.processAbilityPolicy !== undefined`, return `` t`Ability enforcement updated` ``.+3. Read the current value: `const processAbilityPolicy = (companySettings.processAbilityPolicy ?? "warn") as ProcessAbilityPolicy;`.+4. Add a handler:+ ```ts+ const handleProcessAbilityPolicyChange = useCallback(+ (value: ProcessAbilityPolicy) => {+ fetcher.submit(+ { intent: "processAbilityPolicy", processAbilityPolicy: value },+ { method: "POST" }+ );+ },+ [fetcher]+ );+ ```+5. In the Shop Floor card, after the `autoSelectMaterialWithoutPickingList` row, add a `<Separator />` and this block:+ - A `VStack` with title `<Trans>Operators without the required ability</Trans>`.+ - A muted line: `<Trans>Operators get an ability by completing the training that grants it.</Trans>`+ - A `ChoiceSelect<ProcessAbilityPolicy>` with `value={processAbilityPolicy}`, `onChange={handleProcessAbilityPolicyChange}`, `disabled={isToggling}` and these options:+ - `warn`: title `` t`Warn but allow` ``, description `` t`The operator sees a warning and can still start the operation.` ``, icon `<LuTriangleAlert />`.+ - `block`: title `` t`Block until trained` ``, description `` t`The operator cannot start the operation until they complete the training.` ``, icon `<LuShield />`.+6. Import `ChoiceSelect` from `@carbon/react`, `LuShield` and `LuTriangleAlert` from `react-icons/lu`, and `processAbilityPolicies` and `type ProcessAbilityPolicy` from `~/modules/settings/settings.models`.++**Verify:**+```bash+pnpm exec turbo run typecheck --filter=erp+# Expected: Tasks: 1 successful (or all successful), no TS errors+```++**Out of scope:** The other cards on the page.++---++## Task 5: Return structured eligibility from `getOperationEligibility`++**Depends on:** 2+**Files:**+- Modify: `apps/mes/app/services/operations.service.ts:1588-1686`++**Steps:**+1. Add an exported type above the function:+ ```ts+ export type OperationEligibility =+ | { eligible: true }+ | {+ eligible: false;+ processName: string;+ // null when the operator never held the ability+ expiredOn: string | null;+ // an Active training that grants the ability, when one exists+ trainingName: string | null;+ };+ ```+2. Change the return type to `Promise<OperationEligibility>`. Replace every `{ eligible: true, reason: null }` with `{ eligible: true }`.+3. Before each of the two ineligible returns, read the training once:+ ```ts+ const training = await client+ .from("training")+ .select("name")+ .eq("grantsAbilityId", ability.data.id)+ .eq("companyId", companyId)+ .eq("status", "Active")+ .limit(1)+ .maybeSingle();+ ```+ Put this read in a small local helper so both branches share it. If `training.error` is set, use `trainingName: null`.+4. Return `{ eligible: false, processName: abilityName, expiredOn: null, trainingName }` for "no row". Return the same with `expiredOn: employeeAbility.data.expiresAt` for "expired".+5. Add an exported helper below the function:+ ```ts+ // English text for the server flash when Start is refused. MES routes have+ // no server-side translation; the page banner carries the translated text.+ export function abilityRefusalMessage(+ eligibility: Extract<OperationEligibility, { eligible: false }>+ ): string {+ const how = eligibility.trainingName+ ? `Complete the ${eligibility.trainingName} training to get it.`+ : `Ask a supervisor to add it to your profile.`;+ const expired = eligibility.expiredOn+ ? ` Your qualification expired on ${eligibility.expiredOn}.`+ : "";+ return `You need the ${eligibility.processName} ability to start this operation.${expired} ${how}`;+ }+ ```+6. Add `getProcessAbilityPolicy(client, companyId): Promise<ProcessAbilityPolicy>` in the same file. It reads `companySettings.processAbilityPolicy` by `id = companyId`. On error or a value other than `"block"`, it returns `"warn"`. Define `type ProcessAbilityPolicy = "warn" | "block"` locally in MES (MES cannot import ERP modules).++If `companySettings` is not keyed by `id = companyId`, copy the filter that `getCompanySettings` in `apps/mes/app/services/inventory.service.ts:90-99` uses.++**Verify:** typecheck runs in Task 6.++**Out of scope:** The lookup chain and the fail-open rule. `packages/planning`.++---++## Task 6: Apply the policy at both Start paths++**Depends on:** 5+**Files:**+- Modify: `apps/mes/app/routes/x+/event.tsx:93-102`+- Modify: `apps/mes/app/routes/x+/start.$operationId.tsx:165-180`++**Steps:**+1. In `event.tsx`, replace the eligibility block with:+ ```ts+ const eligibility = await getOperationEligibility(serviceRole, {+ operationId: d.jobOperationId,+ employeeId: userId,+ companyId+ });+ if (+ !eligibility.eligible &&+ (await getProcessAbilityPolicy(serviceRole, companyId)) === "block"+ ) {+ return refused(abilityRefusalMessage(eligibility));+ }+ ```+2. In `start.$operationId.tsx`, use the same condition. Keep the existing `throw redirect(path.to.operation(operationId), await flash(...))`. Pass `abilityRefusalMessage(eligibility)` as the message.+3. Update the imports in both files.++**Verify:**+```bash+pnpm exec turbo run typecheck --filter=mes+# Expected: no TS errors+```++**Out of scope:** The Outside Processing refusal and the machine permission check in `event.tsx`.++---++## Task 7: Add the `AbilityWarning` component++**Depends on:** 5+**Files:**+- Create: `apps/mes/app/components/AbilityWarning.tsx`+- Copy from (precedent): the batch `Alert` in `apps/mes/app/components/JobOperation/JobOperation.tsx:1236-1264`; `Alert variant="warning"` in `apps/mes/app/components/Inspection/DispositionModal.tsx:478`++**Steps:**+1. Start the file with the AGPL SPDX header. Copy the three header lines from `JobOperation.tsx:1-3`.+2. Export this type and component:+ ```ts+ export type AbilityWarningData = {+ policy: "warn" | "block";+ processName: string;+ expiredOn: string | null;+ trainingName: string | null;+ };+ export function AbilityWarning({ warning }: { warning: AbilityWarningData }) { ... }+ ```+3. Render `<Alert variant={warning.policy === "block" ? "destructive" : "warning"}>` with `<LuTriangleAlert />`.+4. Title (`<Trans>`, use local consts so the macro gets plain identifiers):+ - `warn`: "You don't have the {processName} ability"+ - `block`: "You can't start this operation"+5. Description lines (`<Trans>`):+ - If `expiredOn`: "Your {processName} qualification expired on {expiredDate}." Format the date with `formatDate(expiredOn, undefined, locale)` from `@carbon/utils`. Read `locale` the way other MES components do (grep `useLocale` in `apps/mes/app/components`).+ - If `trainingName`: "Complete the {trainingName} training to get the {processName} ability."+ - Else: "Ask a supervisor to add the {processName} ability to your profile."+ - If `warn`: add "You can still start this operation."++**Verify:** typecheck runs in Task 8.++**Out of scope:** Disabling any Start button.++---++## Task 8: Show the banner on the three operation views++**Depends on:** 5, 7+**Files:**+- Modify: `apps/mes/app/routes/x+/operation.$operationId.tsx` — loader + render+- Modify: `apps/mes/app/routes/x+/assembly.$operationId.tsx` — loader+- Modify: `apps/mes/app/routes/x+/inspection.$operationId.tsx` — loader+- Modify: `apps/mes/app/components/JobOperation/JobOperation.tsx` — prop + render+- Modify: `apps/mes/app/components/AssemblyView.tsx` — prop + render+- Modify: `apps/mes/app/components/Inspection/InspectionView.tsx` — prop + render++**Steps:**+1. In each loader, compute the warning once:+ ```ts+ const [eligibility, processAbilityPolicy] = await Promise.all([+ getOperationEligibility(serviceRole, { operationId, employeeId: userId, companyId }),+ getProcessAbilityPolicy(serviceRole, companyId)+ ]);+ const abilityWarning: AbilityWarningData | null = eligibility.eligible+ ? null+ : { policy: processAbilityPolicy, ...eligibility };+ ```+ Spread only `processName`, `expiredOn` and `trainingName`, not `eligible`. Put the call next to an existing `Promise.all` where one exists. Return `abilityWarning` from the loader.+2. In `operation.$operationId.tsx`, read `abilityWarning` from `useLoaderData` and pass it to `<JobOperation abilityWarning={abilityWarning} />`.+3. The assembly and inspection routes spread `data` into the view, so only the view props change.+4. Add `abilityWarning?: AbilityWarningData | null` to the props of `JobOperation`, `AssemblyView` and `InspectionView`.+5. Render positions:+ - `JobOperation.tsx`: just before `{scope === "job" && batch && (` (line 1236). Wrap it: `{abilityWarning && (<div className="px-4 pt-4 lg:px-6"><AbilityWarning warning={abilityWarning} /></div>)}`.+ - `AssemblyView.tsx`: after `{!detailsShown && renderPhoneContext()}` (line 1913). Wrapper class `shrink-0 px-4 pt-3`.+ - `InspectionView.tsx`: just before the `{/* Phones: the meta bar scrolls away with the body. */}` comment (line 763). Wrapper class `shrink-0 px-4 pt-3`.++If a wrapper breaks the view's layout (grid areas, a fixed height), STOP and report. Do not improvise a new layout.++**Verify:**+```bash+pnpm exec turbo run typecheck --filter=mes+# Expected: no TS errors+```++**Out of scope:** The batch overview, the phone context row, the Controls component.++---++## Task 9: Extract Lingui strings++**Depends on:** 4, 7, 8+**Steps:**+1. Run `pnpm lingui:extract`.+2. Run `pnpm lingui:clean`.++**Verify:**+```bash+git diff --stat -- packages/locale/locales/en/erp.po packages/locale/locales/en/mes.po+# Expected: both files changed+grep -c "Block until trained" packages/locale/locales/en/erp.po+# Expected: 1+```++**Out of scope:** `pnpm translate` (LLM translation of the other locales). Ask the user first.++---++## Task 10: Verify end to end++**Depends on:** all+**Steps:**+1. Run `pnpm exec biome check` on the changed files (`git diff --name-only`).+2. Run `pnpm exec turbo run typecheck --filter=erp`, then `--filter=mes` (one at a time).+3. Run `pnpm --filter @carbon/checks license-headers` and confirm `AbilityWarning.tsx` has the header.+4. Ask the user before a browser test. If they agree, use the `/test` skill to walk spec acceptance criteria 2–9.+5. Tick the Progress list. Set the spec status to `in-progress`. Add a spec changelog line for any divergence.++**Verify:**+```bash+pnpm exec turbo run typecheck --filter=mes+# Expected: no TS errors+```++**Out of scope:** Commit. The user commits, or asks for a commit.diff --git a/.ai/research/mes-ability-enforcement.md b/.ai/research/mes-ability-enforcement.mdnew file mode 100644index 0000000000..d03f941cd7--- /dev/null+++ b/.ai/research/mes-ability-enforcement.md@@ -0,0 +1,39 @@+# Research: MES ability enforcement++Internal/mechanical change; no external domain research needed — the codebase already+has the ability model, the training→ability bridge, and a precedent warn/error policy.++## What exists today (verified)++- **Ability requirement** comes from the operation's process: `process.requiresAbility`+ (bool, `20260720121629_capacity-planning.sql:6`) + the 1:1 `ability.processId`.+- **Qualification** = an `employeeAbility` row, subject to `expiresAt`+ (`20260812153418_simplify-employee-ability.sql`).+- **Training grants it**: trigger `grant_ability_on_training_completion` (AFTER INSERT ON+ `trainingCompletion`) upserts `employeeAbility` via `training.grantsAbilityId`+ (`20260812153418_simplify-employee-ability.sql:14-51`).+- **MES already hard-blocks** (no setting, no warn mode):+ - `getOperationEligibility` — `apps/mes/app/services/operations.service.ts:1588-1686`.+ Fails open on query errors. Reasons: "Requires X — not qualified" /+ "Requires X — qualification expired <date>". No mention of training.+ - Called from the Start action `apps/mes/app/routes/x+/event.tsx:93-102` (flash error,+ refused) and the QR/link start loader `apps/mes/app/routes/x+/start.$operationId.tsx:165-180`+ (redirect + flash error).+ - Added in 7f5f1d2145 (finite-capacity scheduling, #1151).+ - Operation page loader (`operation.$operationId.tsx`) does not compute eligibility;+ the UI cannot pre-warn.+- **Scheduler** also uses abilities to pick eligible operators+ (`packages/planning/src/scheduling/operator-eligibility.ts`) — out of scope.++## Precedent for a 2-mode company setting++- `companySettings.incompletePickingListPolicy` TEXT NOT NULL DEFAULT 'warn'+ CHECK IN ('warn','error') — `20260728120100_incomplete-picking-list-policy.sql:12-14`.+- Validator/const in `apps/erp/app/modules/settings/settings.models.ts:378-386`.+- UI: `ChoiceSelect` "Warn but allow" / "Block with an error" in+ `apps/erp/app/routes/x+/settings+/inventory.tsx:535-565`.+- MES read with ack flow: `apps/mes/app/routes/x+/picking.$pickingListId.status.tsx:68-111`.+- Natural home in ERP: production settings "Shop Floor" card,+ `apps/erp/app/routes/x+/settings+/production.tsx:315-391`, saved via+ `updateProductionSettings` (`settings.server.ts:380-420`).+- MES operation page already loads company settings (`operation.$operationId.tsx:258`).diff --git a/.ai/specs/2026-10-22-mes-ability-enforcement.md b/.ai/specs/2026-10-22-mes-ability-enforcement.mdnew file mode 100644index 0000000000..c52ee87da7--- /dev/null+++ b/.ai/specs/2026-10-22-mes-ability-enforcement.md@@ -0,0 +1,126 @@+# MES ability enforcement per process++> Status: Approved+> Date: 2026-10-22+> Research: `.ai/research/mes-ability-enforcement.md`++## TL;DR++- Each process that requires an ability now says what MES does when an operator lacks it: **Warn** (default) or **Block**.+- The choice sits on the process form, under "Requires Ability". It shows only while that toggle is on.+- The toggle's description now names the ability, which is the process's own name.+- **Warn**: MES shows a banner on the operation page. The operator can still start.+- **Block**: MES shows the banner and refuses all production work on the operation: Start, Log completed, Scrap, Rework, Mark as Done, step records and material issue. The message names the training that grants the ability.+- There is no company-wide setting. Today MES always blocks; after this change every process starts on Warn.++## Overview diagram++```mermaid+flowchart LR+ A["Operator opens operation"] --> B{"Process requires ability<br/>and operator lacks it?"}+ B -- no --> S["Start works"]+ B -- yes --> C{"process.abilityPolicy"}:::new+ C -- warn --> W["Yellow banner, Start works"]:::new+ C -- block --> X["Red banner, Start refused"]+ classDef new stroke-dasharray:4 3+```++## Problem++An operator gets an ability when they complete a training. The trigger `grant_ability_on_training_completion` writes the `employeeAbility` row.++MES checks the ability at Start with `getOperationEligibility` (`apps/mes/app/services/operations.service.ts`). That check always blocks. An admin cannot choose a softer mode, and some abilities need a block while others only need a warning. The operator also sees no warning before Start. The process form does not say which ability its toggle requires.++## Goals++1. Add a per-process mode: `Warn` or `Block`. The default is `Warn`.+2. In `Warn` mode, show a warning and let the operator start.+3. In `Block` mode, refuse all production work on the operation. Tell the operator how to get the ability.+4. Show the warning before Start, on all three MES operation views.+5. Name the ability in the "Requires Ability" description.++## Non-goals++- No company-wide setting.+- No change to the ability data model, the training trigger, or expiry rules.+- No change to the scheduler's operator eligibility (`packages/planning`).+- No other UX changes to processes, abilities or trainings.++## Design++### Data model++Migration `20261022063357_process-ability-policy.sql`:++```sql+CREATE TYPE "processAbilityPolicy" AS ENUM ('Warn', 'Block');+ALTER TABLE "process"+ ADD COLUMN IF NOT EXISTS "abilityPolicy" "processAbilityPolicy" NOT NULL DEFAULT 'Warn';+```++ERP and MES read the values and the type from the generated `processAbilityPolicy` enum.++The same migration drops and re-creates the `processes` view, so `p.*` picks up the column. The column is read only while `requiresAbility` is on.++### ERP process form++| Part | Change |+|---|---|+| `resources.models.ts` | Add `processAbilityPolicies` and `abilityPolicy: z.enum(...).optional()` to `processValidator`. |+| `ProcessForm.tsx` | The name field is controlled. The "Requires Ability" description reads "Only employees with the {name} ability can be scheduled for and run this process". |+| `ProcessForm.tsx` | `AbilityPolicy` renders a `Select` "If an operator isn't qualified": Warn / Block. It shows only while Requires Ability is on, like the batch type select. |+| `processes.$processId.tsx`, `processes.new.tsx` | Initial value `abilityPolicy` (stored value, else `Warn`). |++`insertProcess` / `updateProcess` spread the validated input, so they write the field with no change.++### MES++1. `getAbilityShortfall` returns what the operator lacks, or null. One embedded read gets the process and its ability. Then the qualification and the granting training are read in parallel. A shortfall carries `policy`, `processName`, `expiredOn` and `trainingName`.+2. `abilityBlockRefusal` is the only check the routes call. It builds the English flash text when the policy is `Block`.+3. `abilityBlockRefusal` returns the refusal text when the policy is `Block`. These routes call it before they write: `event` (Start), `start.$operationId`, `complete`, `finish`, `scrap`, `rework`, `record`, `record.$id.delete`, `issue`, `issue-tracked-entity` (single operation), `unconsume`, `entity+/…scrap`, and the inspection `sample`, `measurement`, `disposition` and `complete-passed` routes.+4. The operation view disables the same actions when the policy is `Block`. Pause, Maintenance, Quality Issue, Instructions and Chat stay enabled. Not guarded: `steps.complete-all` (a manager override), `steps.inspection` (an automatic sync) and a batch pick.+5. `x+/event.tsx` redirects a full-page POST (`Sec-Fetch-Mode: navigate`, a press before the page hydrates) back to the referring page, keeping the flash.+6. The three loaders (`operation`, `assembly`, `inspection`) pass the shortfall to the view as `abilityWarning`. The assembly and inspection views disable the same work, and skip their timer auto-start, when the policy is `Block`.+7. `AbilityWarning` renders a warning `Alert` (Warn) or a destructive `Alert` (Block). Its copy uses Lingui.++The server flash text stays English. MES routes have no server-side translation today.++## Design decisions++| Decision | Choice | Why |+|---|---|---|+| Where the mode lives | On `process` | Some abilities need a block and others a warning. User answer. |+| Company-wide setting | None | The per-process mode replaces it. User answer. |+| Column type | Enum `processAbilityPolicy`: `Warn` / `Block` | One generated type for ERP and MES, with no casts. Same pattern as `invoiceAutomation`. |+| Default | `Warn` | The original request. |+| Ability name on the form | In the toggle's description | Minimal. User answer. |+| Field visibility | Only while Requires Ability is on | Same pattern as the batch type select. |+| Warn UX | Banner on the page, no extra click | User answer. |+| Views with the banner | Operation, assembly and inspection | All three post Start to `x+/event.tsx`. |+| Which training to name | One Active training with `grantsAbilityId` = the ability | The trigger grants the ability from that link. |++## Acceptance criteria++1. An existing process has `abilityPolicy = 'Warn'` after the migration.+2. An admin opens a process and turns on Requires Ability. The description names the process. The "If an operator isn't qualified" select appears with Warn selected. Turning the toggle off hides the select.+3. The admin picks Block and saves. The value is `Block` after a reload.+4. Process "Welding" requires an ability, with policy `Warn`. Operator A has no `employeeAbility` row for it and opens a Welding operation. A yellow banner names the ability and its training. Operator A presses Start. The timer starts.+5. Same setup with policy `Block`. Operator A sees a red banner. Start, Log completed, Scrap, Rework, Mark as Done, Record and Issue Material are disabled. A direct POST to any guarded route is refused, and nothing is written.+6. Same setup with policy `Block`. Operator A scans the operation's start QR code. MES redirects to the operation page with the error toast.+7. Operator A's `employeeAbility.expiresAt` is yesterday. The banner says the qualification expired, with the date.+8. Operator B has a valid `employeeAbility` row. No banner shows. Start works in both modes.+9. The assembly and inspection views show the same banner as the operation view.++## Open questions (resolved)++- [x] Existing companies already get a hard block. What default do they get? — **Answer:** `Warn`, as the request says.+- [x] How does an operator see the warning in Warn mode? — **Answer:** A banner on the operation page. Start needs no extra click.+- [x] Company setting or per process? — **Answer:** Per process, on the process form. No company setting.++## Changelog++- 2026-10-22: First draft with a company-wide setting in Production → Shop Floor.+- 2026-10-22: Implemented with the company setting.+- 2026-10-22: Thermo-nuclear review fixes: enum column, one shared check, `getAbilityShortfall`, Block gating and no auto-start in the assembly and inspection views.+- 2026-10-22: Block covers all production work, not only Start. The event route recovers from a full-page POST.+- 2026-10-22: Moved the mode onto the process and removed the company setting. Named the ability in the toggle's description.diff --git a/.claude/rules/mes-job-operation-ui.md b/.claude/rules/mes-job-operation-ui.mdindex eb06a45279..1b91ac6af3 100644--- a/.claude/rules/mes-job-operation-ui.md+++ b/.claude/rules/mes-job-operation-ui.md@@ -68,6 +68,31 @@ redirects kinds it does not serve (no loops).can't call postings, so this is orchestrated in TS. See`.ai/specs/2026-08-04-picked-material-return-timing.md`.+## Ability gate++When the operation's process has `requiresAbility` on and the operator has no+current `employeeAbility` row, `getAbilityShortfall` (`operations.service.ts`)+returns what is missing: the process's `abilityPolicy`, the process name, the+expiry date and an Active training whose `grantsAbilityId` is the ability. It+fails open on any read error. The operation, assembly and inspection loaders+pass it to the view as `abilityWarning`, which `AbilityWarning` renders as a+banner.++- `Warn`: banner only.+- `Block`: the view disables production work (start, complete, scrap, rework,+ finish, step records, material issue, inspection verdicts) and skips timer+ auto-start; pausing a running timer stays enabled. Every write route calls+ `abilityBlockRefusal` before it writes: `event` (Start only), `start.$operationId`,+ `complete`, `finish`, `scrap`, `rework`, `record`, `record.$id.delete`, `issue`,+ `issue-tracked-entity` (single operation), `unconsume`, `entity+/…scrap`, and the+ inspection `sample`, `measurement`, `disposition` and `complete-passed` routes.+ Not gated: `steps.complete-all` (a manager override), `steps.inspection` (an+ automatic sync) and a batch pick.++`event.tsx` also redirects a full-page POST (`Sec-Fetch-Mode: navigate`, a press+before the page hydrates) back to the referrer with the flash, so the operator never+lands on the bare resource route.+## Batch mode (operation batching)**Floor gate (membership handoff), enforced server-side.** An operation isdiff --git a/apps/erp/app/modules/resources/AGENTS.md b/apps/erp/app/modules/resources/AGENTS.mdindex 4826312b0f..5e41b0b244 100644--- a/apps/erp/app/modules/resources/AGENTS.md+++ b/apps/erp/app/modules/resources/AGENTS.md@@ -6,7 +6,7 @@ Locations, work centers, processes, abilities (skills), partners, contractors, e- **Location** — physical site/facility. Every inventory record, job, and employee is scoped to a location. Has address, timezone, and GPS coordinates. Company-scoped. `requiresStaffing` (BOOLEAN, default false; `20260820151847_location-requires-staffing.sql`) is a per-location scheduling policy edited on the Production settings page (Settings → Production → Scheduling): when true the finite scheduler only places work where an operator is manned (lights-out work centers exempt) — see `.claude/rules/scheduling-data-structures.md`.- **Work Center** — production station within a location. Operations schedule onto work centers. Have rates and active/inactive status. MUST soft-delete via `active: false`. Scheduling is always finite (one operation at a time), and a work center now has **operating hours**: assign it one or more of the location's shifts via `workCenterShift` (empty = all shifts at the location), or set `alwaysOn` for genuine lights-out 24×7. The scheduler resolves hours through a ladder — `alwaysOn` → explicit `workCenterShift` rows → the location's `shift` rows → a stock Mon–Fri 8h week — so even a zero-config shop is bounded by real hours (it is no longer "always open 24×7"). An open maintenance dispatch flagged `takesWorkCenterOffline` subtracts its window(s) from the schedule until closed. The work center form edits both (an "Operating shifts" multiselect + a "Runs 24×7 (lights-out)" toggle), and work-center create/edit/deactivate/reactivate emit the `work-center` schedule input event.-- **Process** — type of work (e.g., "CNC Milling", "Welding"). Operations reference a process. Linked to work centers via `workCenterProcess`. MUST soft-delete via `active: false`. `process.requiresAbility` gates scheduling and MES start: toggling it ON auto-creates an ability linked 1:1 to the process (`ability.processId`) via `ensureProcessAbility`. The ability stores no name of its own — its name IS the process's name. The `batchable` flag marks a process where multiple jobs can run at once (laser table, furnace, plating) — job operations derive batchability from it (see the production module's Operation Batch concept). `process.batchRules` (JSONB, nullable) holds per-BOM-dimension batch compatibility levels (`{ item?, substance?, grade?, dimension?, form?, finish?: "must"|"guide"|"ignore" }`), edited on the batchable process form (a "Compatibility rules" card, visible only when Batchable is on). It is SPARSE — keys equal to their resolved default are omitted, and an all-default config writes NULL. NULL reproduces the pre-rules behavior exactly (`resolveBatchRules(null)` → substance/grade/dimension = guide, form/finish/item = ignore). "Must" is the only level that BLOCKS (server-enforced in the `batch-operations` posting); "guide" warns and splits the builder's suggestion groups; "ignore" is invisible to batching. Resolution/compaction/enforcement all go through the shared pure module `@carbon/utils` `batch-compatibility` (`resolveBatchRules`, `compactBatchRules`, `mustViolations`). `insertProcess` / `updateProcess` fold the six `batchRule*` form fields into `batchRules` (and `batchRuleInitialValues` back); `updateProcess` writes the process and replaces its `workCenterProcess` rows in one Kysely transaction, linking only the company's own work centers.+- **Process** — type of work (e.g., "CNC Milling", "Welding"). Operations reference a process. Linked to work centers via `workCenterProcess`. MUST soft-delete via `active: false`. `process.requiresAbility` gates scheduling and the MES: toggling it ON auto-creates an ability linked 1:1 to the process (`ability.processId`) via `ensureProcessAbility`. `process.abilityPolicy` (enum `processAbilityPolicy`, `Warn` default / `Block`, edited under the toggle on the process form and read only while it is on) decides what the MES does for an operator without the ability: `Warn` shows a banner, `Block` refuses production work on the operation (MES `abilityBlockRefusal`). The ability stores no name of its own — its name IS the process's name. The `batchable` flag marks a process where multiple jobs can run at once (laser table, furnace, plating) — job operations derive batchability from it (see the production module's Operation Batch concept). `process.batchRules` (JSONB, nullable) holds per-BOM-dimension batch compatibility levels (`{ item?, substance?, grade?, dimension?, form?, finish?: "must"|"guide"|"ignore" }`), edited on the batchable process form (a "Compatibility rules" card, visible only when Batchable is on). It is SPARSE — keys equal to their resolved default are omitted, and an all-default config writes NULL. NULL reproduces the pre-rules behavior exactly (`resolveBatchRules(null)` → substance/grade/dimension = guide, form/finish/item = ignore). "Must" is the only level that BLOCKS (server-enforced in the `batch-operations` posting); "guide" warns and splits the builder's suggestion groups; "ignore" is invisible to batching. Resolution/compaction/enforcement all go through the shared pure module `@carbon/utils` `batch-compatibility` (`resolveBatchRules`, `compactBatchRules`, `mustViolations`). `insertProcess` / `updateProcess` fold the six `batchRule*` form fields into `batchRules` (and `batchRuleInitialValues` back); `updateProcess` writes the process and replaces its `workCenterProcess` rows in one Kysely transaction, linking only the company's own work centers.- **Ability** — an employee qualification, **always** linked 1:1 to a process (`ability.processId`, NOT NULL, `ON DELETE CASCADE`). An ability stores **no name of its own** — the name derives from the linked process (renaming the process renames the ability), read through the `abilities` view (`ability` INNER JOIN `process`). Abilities are created **only from a process**: the New Ability modal (`x/resources/abilities` → new) is a picker of processes that don't already have an ability (`getProcessesWithoutAbility`); creating one turns that process's `requiresAbility` on and calls `ensureProcessAbility` (idempotent, so no duplicates). Legacy free-form abilities (no `processId`) were **deleted** by `20260917161742_abilities-from-process.sql` (cascading their `employeeAbility`/`contractorAbility` rows, nulling `training.grantsAbilityId`, and first detaching `workCenter.requiredAbilityId` / removing `partner` rows that referenced them). `employeeAbility` is effectively a map of the processes each person can do. Qualification is **presence-based**: an `employeeAbility` row means the person is qualified, subject only to expiry — `qualified = row exists ∧ (expiresAt IS NULL OR expiresAt ≥ today)` where `expiresAt` derives from `ability.recertifyEveryDays`. There is no `active` / `trainingCompleted` gate (dropped `20260812153418_simplify-employee-ability.sql`); "Remove Employee" is a **hard delete**. Admin UI at `x/resources/abilities`; each ability's detail page carries the roster of its qualified employees, and the person page's abilities panel is editable. Training is one path to a row: `training.grantsAbilityId` + the `grant_ability_on_training_completion` trigger upsert `employeeAbility` (sets `lastTrainingDate`, `expiresAt` from `recertifyEveryDays`) on completion — but manually adding the employee qualifies them just as well. **Every path that changes qualification notifies the scheduler** (`notifyScheduleInputsChanged(companyId, "ability", …, abilityId)`): `addEmployeeAbility` / `updateEmployeeAbility` / `removeEmployeeAbility`, `deactivateAbility` (deactivating an ability un-gates its process), and every training completion (`recordTrainingCompletion`, which both `completeTrainingAssignment` and `share/training.$id` call — scoped to `grantsAbilityId` when the training grants one).- **Partner** — external supplier location with ability mappings for outsourced work.- **Contractor** — supplier contact working as contract labor, with hours-per-week and ability assignments via `contractorAbility`.@@ -47,7 +47,7 @@ pnpm --filter erp test -- resources # vitest filters by file path| `location` | Physical sites: address, timezone, coordinates || `workCenter` / `workCenters` (view) / `workCentersWithBlockingStatus` (view) | Production stations with blocking info; `alwaysOn` = lights-out 24×7 (exposed by the `workCenters` view since the capacity-planning migration recreated it). `batchCapacity` / `minimumBatchQuantity` (NUMERIC, nullable) are ADVISORY batch load limits (pieces per run / smallest worth batching) surfaced as a fill bar in the batch builder — never a hard block; NULL = no capacity model. Both views were re-declared (DROP + CREATE, since the new `wc.*` columns land before `locationName`) to expose them || `workCenterShift` | Which shifts a work center operates (scheduling availability-ladder rung 1); empty = all shifts at the location. Unique `(workCenterId, shiftId, companyId)` |-| `process` / `processes` (view) | Work types with active flag, `requiresAbility`, `batchable`, and `batchRules` (per-dimension batch compatibility JSONB; view re-declared to expose it) |+| `process` / `processes` (view) | Work types with active flag, `requiresAbility`, `abilityPolicy`, `batchable`, and `batchRules` (per-dimension batch compatibility JSONB; view re-declared to expose it) || `workCenterProcess` | Many-to-many link between work centers and processes || `ability` / `abilities` (view) / `employeeAbility` | Skills with learning curves and per-employee tracking. `ability.processId` is NOT NULL (1:1 with `process`, `ON DELETE CASCADE`); there is no `ability.name` column — the `abilities` view exposes `name` from the linked process || `partner` / `partners` (view) | External supplier partners |diff --git a/apps/erp/app/modules/resources/resources.models.ts b/apps/erp/app/modules/resources/resources.models.tsindex 226da091a0..bc19f1d706 100644--- a/apps/erp/app/modules/resources/resources.models.ts+++ b/apps/erp/app/modules/resources/resources.models.ts@@ -2,6 +2,7 @@// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,// including ports, remain AGPLv3; serving them over a network requires releasing their source.+import { Constants } from "@carbon/database";import { isUnsafeStoragePath } from "@carbon/files";import {type BatchRules,@@ -332,6 +333,11 @@ export const partnerValidator = z.object({// abilityId: z.string().min(1, { message: "Invalid ability" }),});+// What MES does when an operator lacks the ability a process requires.+// 'Warn' shows a banner; 'Block' refuses production work on the operation.+export const processAbilityPolicies =+ Constants.public.Enums.processAbilityPolicy;+export const processValidator = z.object({id: zfd.text(z.string().optional()),@@ -354,6 +360,7 @@ export const processValidator = z.optional().default("Sequential"),requiresAbility: zfd.checkbox(),+ abilityPolicy: z.enum(processAbilityPolicies).optional(),batchRuleItem: z.enum(batchRuleLevels).optional(),batchRuleSubstance: z.enum(batchRuleLevels).optional(),batchRuleGrade: z.enum(batchRuleLevels).optional(),diff --git a/apps/erp/app/modules/resources/ui/Processes/ProcessForm.tsx b/apps/erp/app/modules/resources/ui/Processes/ProcessForm.tsxindex 488dc8b394..f95876ac29 100644--- a/apps/erp/app/modules/resources/ui/Processes/ProcessForm.tsx+++ b/apps/erp/app/modules/resources/ui/Processes/ProcessForm.tsx@@ -28,7 +28,7 @@ import {} from "@carbon/react";import { Trans, useLingui } from "@lingui/react/macro";import type { PostgrestResponse } from "@supabase/supabase-js";-import { useEffect } from "react";+import { useEffect, useState } from "react";import {LuCirclePlus,LuEllipsisVertical,@@ -42,7 +42,7 @@ import {Boolean,CustomFormFields,Hidden,- Input,+ InputControlled,Select,StandardFactor,Submit@@ -71,6 +71,9 @@ const ProcessForm = ({const { t } = useLingui();const permissions = usePermissions();const fetcher = useFetcher<PostgrestResponse<{ id: string }>>();+ // Controlled so the Requires Ability description can name the ability,+ // which is the process's own name.+ const [processName, setProcessName] = useState(initialValues.name ?? "");useEffect(() => {if (type !== "modal") return;@@ -125,7 +128,12 @@ const ProcessForm = ({<Subheading variant="heavy" className="block"><Trans>Basic Information</Trans></Subheading>- <Input name="name" label={t`Process Name`} />+ <InputControlled+ name="name"+ label={t`Process Name`}+ value={processName}+ onChange={setProcessName}+ /><Selectname="processType"label={t`Process Type`}@@ -165,9 +173,14 @@ const ProcessForm = ({<Booleanname="requiresAbility"label={t`Requires Ability`}- description={t`Only qualified employees can be scheduled for and run this process`}+ description={+ processName+ ? t`Only employees with the ${processName} ability can be scheduled for and run this process`+ : t`Only qualified employees can be scheduled for and run this process`+ }bordered/>+ <AbilityPolicy /><Booleanname="batchable"@@ -208,6 +221,34 @@ const ProcessForm = ({export default ProcessForm;+// What MES does when an operator without the ability works on this process.+// Only shown while Requires Ability is on.+function AbilityPolicy() {+ const { t } = useLingui();+ const [requiresAbility] = useControlField<boolean>("requiresAbility");++ if (!requiresAbility) return null;++ return (+ <Select+ name="abilityPolicy"+ label={t`If an operator isn't qualified`}+ options={[+ {+ value: "Warn",+ label: t`Warn`,+ helper: t`Show a warning on the shop floor, but let them work.`+ },+ {+ value: "Block",+ label: t`Block`,+ helper: t`Don't let them work on this process until they have the ability.`+ }+ ]}+ />+ );+}+// Batch settings — only shown once a process is Batchable. The batch type// selector (sequential vs simultaneous) rides the same conditional as the// per-dimension compatibility card.diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json b/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.jsonindex c5a1d90ee2..0b6d0086cd 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json@@ -1166,7 +1166,7 @@{"name":"resources_createMaintenanceEvent","classification":"WRITE","schema":"6e76bd1f09c1","response":"8e58a21e4c94","permission":"resources:update","paginates":false},{"name":"resources_createMaintenanceSchedule","classification":"WRITE","schema":"b84710917cca","response":"3797626bd17e","permission":"resources:create","paginates":false},{"name":"resources_createPartner","classification":"WRITE","schema":"376ead8bb039","response":"bcde375ebd4c","permission":"resources:create","paginates":false},- {"name":"resources_createProcess","classification":"WRITE","schema":"aee880893829","response":"3797626bd17e","permission":"resources:create","paginates":false},+ {"name":"resources_createProcess","classification":"WRITE","schema":"b8fd049d80e2","response":"3797626bd17e","permission":"resources:create","paginates":false},{"name":"resources_createTraining","classification":"WRITE","schema":"627644497b66","response":"3797626bd17e","permission":"resources:create","paginates":false},{"name":"resources_createTrainingAssignment","classification":"WRITE","schema":"70b3c1aa623e","response":"3797626bd17e","permission":"resources:create","paginates":false},{"name":"resources_createTrainingQuestion","classification":"WRITE","schema":"8ec2c941ed74","response":"3797626bd17e","permission":"resources:create","paginates":false},@@ -1210,8 +1210,8 @@{"name":"resources_getPartner","classification":"READ","schema":"fedfa0da6447","response":"690aa589fb9c","permission":"resources:view","paginates":false},{"name":"resources_getPartnerBySupplierId","classification":"READ","schema":"48d3fd6edb53","response":"690aa589fb9c","permission":"resources:view","paginates":false},{"name":"resources_getPartners","classification":"READ","schema":"cd40ae40fad5","response":"6c9a4233e834","permission":"resources:view","paginates":true},- {"name":"resources_getProcess","classification":"READ","schema":"5631e53ea64f","response":"1dcef23b2416","permission":"resources:view","paginates":false},- {"name":"resources_getProcesses","classification":"READ","schema":"cd40ae40fad5","response":"cd79fe552b97","permission":"resources:view","paginates":true},+ {"name":"resources_getProcess","classification":"READ","schema":"5631e53ea64f","response":"09110800af4d","permission":"resources:view","paginates":false},+ {"name":"resources_getProcesses","classification":"READ","schema":"cd40ae40fad5","response":"7062df92b57f","permission":"resources:view","paginates":true},{"name":"resources_getProcessesList","classification":"READ","schema":"31b84d65b2ac","response":"ce08332e0ce6","permission":"resources:view","paginates":false},{"name":"resources_getProcessesWithoutAbility","classification":"READ","schema":"31b84d65b2ac","response":"ce08332e0ce6","permission":"resources:view","paginates":false},{"name":"resources_getSuggestion","classification":"READ","schema":"7e2e609c39b4","response":"77bb66a1249a","permission":"resources:view","paginates":false},@@ -1250,7 +1250,7 @@{"name":"resources_updateMaintenanceEvent","classification":"WRITE","schema":"bf8266758b63","response":"8e58a21e4c94","permission":"resources:update","paginates":false},{"name":"resources_updateMaintenanceSchedule","classification":"WRITE","schema":"af63079aefd4","response":"3797626bd17e","permission":"resources:update","paginates":false},{"name":"resources_updatePartner","classification":"WRITE","schema":"376ead8bb039","response":"bcde375ebd4c","permission":"resources:update","paginates":false},- {"name":"resources_updateProcess","classification":"DESTRUCTIVE","schema":"d33f66716674","response":"3797626bd17e","permission":"resources:create+delete+update","paginates":false},+ {"name":"resources_updateProcess","classification":"DESTRUCTIVE","schema":"f0e77e52ebff","response":"3797626bd17e","permission":"resources:create+delete+update","paginates":false},{"name":"resources_updateSuggestionEmoji","classification":"WRITE","schema":"5f9afdcc2556","response":"bcde375ebd4c","permission":"resources:update","paginates":false},{"name":"resources_updateTraining","classification":"WRITE","schema":"6097fcf86545","response":"3797626bd17e","permission":"resources:update","paginates":false},{"name":"resources_updateTrainingAssignment","classification":"WRITE","schema":"c787b54127d0","response":"3797626bd17e","permission":"resources:update","paginates":false},diff --git a/apps/erp/app/routes/x+/resources+/processes.$processId.tsx b/apps/erp/app/routes/x+/resources+/processes.$processId.tsxindex 1ac73df3c0..5f0320d8e5 100644--- a/apps/erp/app/routes/x+/resources+/processes.$processId.tsx+++ b/apps/erp/app/routes/x+/resources+/processes.$processId.tsx@@ -77,6 +77,7 @@ export default function ProcessRoute() {batchable: process.batchable ?? false,batchType: process.batchType ?? ("Sequential" as const),requiresAbility: process.requiresAbility ?? false,+ abilityPolicy: process.abilityPolicy ?? "Warn",...batchRuleInitialValues(process.batchRules as BatchRules | null)};diff --git a/apps/erp/app/routes/x+/resources+/processes.new.tsx b/apps/erp/app/routes/x+/resources+/processes.new.tsxindex 41df0b0c5d..f5ce39e462 100644--- a/apps/erp/app/routes/x+/resources+/processes.new.tsx+++ b/apps/erp/app/routes/x+/resources+/processes.new.tsx@@ -41,6 +41,7 @@ export default function NewProcessRoute() {batchable: false,batchType: "Sequential" as const,requiresAbility: false,+ abilityPolicy: "Warn" as const,...batchRuleInitialValues(null)};diff --git a/apps/mes/app/components/AbilityWarning.tsx b/apps/mes/app/components/AbilityWarning.tsxnew file mode 100644index 0000000000..b2b7404c5d--- /dev/null+++ b/apps/mes/app/components/AbilityWarning.tsx@@ -0,0 +1,57 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,+// including ports, remain AGPLv3; serving them over a network requires releasing their source.++import { Alert, AlertDescription, AlertTitle } from "@carbon/react";+import { formatDate } from "@carbon/utils";+import { Trans } from "@lingui/react/macro";+import { LuTriangleAlert } from "react-icons/lu";+import type { AbilityShortfall } from "~/services/operations.service";++// Shown on an operation whose process requires an ability the operator does+// not hold. With policy 'Block' its production work is also refused server-side.+export function AbilityWarning({ warning }: { warning: AbilityShortfall }) {+ const { processName, trainingName } = warning;+ const isBlocked = warning.policy === "Block";+ const expiredDate = warning.expiredOn ? formatDate(warning.expiredOn) : null;++ return (+ <Alert variant={isBlocked ? "destructive" : "warning"}>+ <LuTriangleAlert className="size-4" />+ <AlertTitle>+ {isBlocked ? (+ <Trans>You can't work on this operation</Trans>+ ) : (+ <Trans>You don't have the {processName} ability</Trans>+ )}+ </AlertTitle>+ <AlertDescription>+ <span className="text-pretty">+ {expiredDate && (+ <>+ <Trans>+ Your {processName} qualification expired on {expiredDate}.+ </Trans>{" "}+ </>+ )}+ {trainingName ? (+ <Trans>+ Complete the {trainingName} training to get the {processName}{" "}+ ability.+ </Trans>+ ) : (+ <Trans>+ Ask a supervisor to add the {processName} ability to your profile.+ </Trans>+ )}+ {!isBlocked && (+ <>+ {" "}+ <Trans>You can still start this operation.</Trans>+ </>+ )}+ </span>+ </AlertDescription>+ </Alert>+ );+}diff --git a/apps/mes/app/components/AssemblyView.tsx b/apps/mes/app/components/AssemblyView.tsxindex 42e52ef93c..42312a4add 100644--- a/apps/mes/app/components/AssemblyView.tsx+++ b/apps/mes/app/components/AssemblyView.tsx@@ -92,6 +92,7 @@ import {LuX} from "react-icons/lu";import { useFetcher, useNavigate, useSearchParams } from "react-router";+import { AbilityWarning } from "~/components/AbilityWarning";import { TrackingTypeIcon } from "~/components/Icons";import { OperationChat } from "~/components/JobOperation/components/Chat";import { IssueMaterialModal } from "~/components/JobOperation/components/IssueMaterialModal";@@ -104,7 +105,10 @@ import { RecordModal } from "~/components/JobOperation/components/Step";import { MesAppBar } from "~/components/MesAppBar";import { useMesBottomBar } from "~/components/MesBottomBar";import { useRealtime, useUser } from "~/hooks";-import { isSerialEntityIncompleteForOperation } from "~/services/operations.service";+import {+ type AbilityShortfall,+ isSerialEntityIncompleteForOperation+} from "~/services/operations.service";import { ownsLooseMaterial } from "~/services/step-backflush";import type {JobMaterial,@@ -282,6 +286,7 @@ type Operation = {};type Props = {+ abilityWarning?: AbilityShortfall | null;operationId: string;job: { itemReadableIdWithRevision?: string | null } | null;operation: Operation | null;@@ -508,6 +513,7 @@ function isUnitIncompleteForOperation(}export function AssemblyView({+ abilityWarning,operationId,job,operation,@@ -1811,6 +1817,10 @@ export function AssemblyView({</div>) : null;+ // The process requires an ability this operator lacks and its policy is+ // Block: no production work here. The routes refuse it too.+ const abilityBlocked = abilityWarning?.policy === "Block";+// The header's actions; the md+ header and the phone app bar share them.const headerActions = (<>@@ -1818,8 +1828,9 @@ export function AssemblyView({{operation ? (<buttontype="button"+ disabled={abilityBlocked}onClick={completeModal.onOpen}- className="flex h-full shrink-0 items-center gap-1 border-l border-border px-2 text-sm font-medium transition-colors hover:bg-accent active:scale-[0.98] max-md:hidden md:gap-2 md:px-4"+ className="flex h-full shrink-0 items-center gap-1 border-l border-border px-2 text-sm font-medium transition-colors hover:bg-accent active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50 max-md:hidden md:gap-2 md:px-4"><LuCheck className="size-4" /><Trans>Complete</Trans>@@ -1845,6 +1856,7 @@ export function AssemblyView({workType={wt}trackedEntityId={isTracked ? currentEntity?.id : undefined}unitIndex={currentUnitIndex}+ startDisabled={abilityBlocked}/>)): null}@@ -1912,6 +1924,12 @@ export function AssemblyView({{renderStepsBar("max-md:hidden")}{!detailsShown && renderPhoneContext()}+ {abilityWarning && (+ <div className="shrink-0 px-4 pt-3">+ <AbilityWarning warning={abilityWarning} />+ </div>+ )}+{/* ── BODY ── stacks vertically (page scrolls) on phones/tablets,three columns side-by-side on lg+. ── */}<div className="flex flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden">@@ -2431,6 +2449,7 @@ export function AssemblyView({variant="ghost"size="lg"icon={<LuCirclePlus />}+ isDisabled={abilityBlocked}onClick={() => {// Clear any per-row selection so the modal opens in// "pick any item" mode → issue a part not on the BOM.@@ -2455,10 +2474,14 @@ export function AssemblyView({unitIndex={currentUnitIndex}issuedIsPerUnit={issuedIsPerUnit}issuedOverride={issuedOverride}- onIssue={() => {- setSelectedMaterial(m);- issueModal.onOpen();- }}+ onIssue={+ abilityBlocked+ ? undefined+ : () => {+ setSelectedMaterial(m);+ issueModal.onOpen();+ }+ }/>))}@@ -2579,7 +2602,7 @@ export function AssemblyView({step={step}activeIndex={activeIndex}done={isStepDone(step)}- disabled={hasPendingScans}+ disabled={hasPendingScans || abilityBlocked}actionRef={primaryStepActionRef}/></div>@@ -2613,6 +2636,7 @@ export function AssemblyView({<Buttonsize="lg"leftIcon={<LuCheck />}+ isDisabled={abilityBlocked}onClick={completeModal.onOpen}className="h-12 flex-1">@@ -2753,6 +2777,7 @@ export function AssemblyView({<ActionSheetButtonicon={<LuTrash className="size-4 shrink-0" />}label="Scrap"+ disabled={abilityBlocked}onClick={() => {actionsSheet.onClose();scrapModal.onOpen();@@ -2761,6 +2786,7 @@ export function AssemblyView({<ActionSheetButtonicon={<LuGitPullRequest className="size-4 shrink-0" />}label="Rework"+ disabled={abilityBlocked}onClick={() => {actionsSheet.onClose();reworkModal.onOpen();@@ -2769,6 +2795,7 @@ export function AssemblyView({<ActionSheetButtonicon={<LuCheck className="size-4 shrink-0" />}label="Mark as Done"+ disabled={abilityBlocked}onClick={() => {actionsSheet.onClose();finishModal.onOpen();@@ -2875,17 +2902,20 @@ export function AssemblyView({{/* Only auto-start when the operation actually has a timer to track (a configuredSetup/Labor/Machine duration). With no work types there's nothing to time, so wedon't start a stray Labor event. */}- {operation && autoStartOperationTimer && workTypes.length > 0 && (- <AutoTimer- operationId={operationId}- enabled={autoStartOperationTimer}- workType={headerWorkTypes[0]}- workCenterId={operation.workCenterId ?? undefined}- openEvent={openEventForWorkType(headerWorkTypes[0])}- trackedEntityId={isTracked ? currentEntity?.id : undefined}- unitIndex={currentUnitIndex}- />- )}+ {operation &&+ autoStartOperationTimer &&+ !abilityBlocked &&+ workTypes.length > 0 && (+ <AutoTimer+ operationId={operationId}+ enabled={autoStartOperationTimer}+ workType={headerWorkTypes[0]}+ workCenterId={operation.workCenterId ?? undefined}+ openEvent={openEventForWorkType(headerWorkTypes[0])}+ trackedEntityId={isTracked ? currentEntity?.id : undefined}+ unitIndex={currentUnitIndex}+ />+ )}</div>);}@@ -2940,16 +2970,19 @@ function AutoTimer({function ActionSheetButton({icon,label,- onClick+ onClick,+ disabled = false}: {icon: React.ReactNode;label: string;onClick: () => void;+ disabled?: boolean;}) {return (<buttontype="button"- className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 transition-transform active:scale-[0.98]"+ disabled={disabled}+ className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 transition-transform active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50"onClick={onClick}>{icon}@@ -2963,13 +2996,17 @@ function TimerControl({openEvent,workType,trackedEntityId,- unitIndex+ unitIndex,+ startDisabled = false}: {operation: Operation;openEvent: { id: string; startTime: string } | null;workType: "Setup" | "Labor" | "Machine";trackedEntityId?: string;unitIndex?: number;+ // Starting is refused (ability policy Block); a running timer can still be+ // paused.+ startDisabled?: boolean;}) {const { t } = useLingui();const fetcher = useFetcher();@@ -3025,7 +3062,7 @@ function TimerControl({<input type="hidden" name="unitIndex" value={unitIndex} />) : null}<button- disabled={fetcher.state !== "idle"}+ disabled={(startDisabled && !openEvent) || fetcher.state !== "idle"}type="submit"aria-label={active ? t`Pause timer` : t`Start timer`}className="flex h-full shrink-0 items-center gap-1 border-l border-border px-2 transition-colors hover:bg-accent active:scale-[0.98] max-md:min-w-11 max-md:justify-center md:gap-2 md:px-4"diff --git a/apps/mes/app/components/Inspection/InspectionView.tsx b/apps/mes/app/components/Inspection/InspectionView.tsxindex 8b1465c9e3..ae8caa80fa 100644--- a/apps/mes/app/components/Inspection/InspectionView.tsx+++ b/apps/mes/app/components/Inspection/InspectionView.tsx@@ -52,12 +52,14 @@ import {LuX} from "react-icons/lu";import { useFetcher } from "react-router";+import { AbilityWarning } from "~/components/AbilityWarning";import { QualityIssueModal } from "~/components/JobOperation/components/QualityIssueModal";import { QuantityModal } from "~/components/JobOperation/components/QuantityModal";import { ReworkModal } from "~/components/JobOperation/components/ReworkModal";import { MesAppBar } from "~/components/MesAppBar";import { useMesBottomBar } from "~/components/MesBottomBar";import { useUser } from "~/hooks";+import type { AbilityShortfall } from "~/services/operations.service";import type {InspectionGauge,InspectionMeasurement,@@ -115,6 +117,7 @@ type DrawingBalloonRow = {type WorkType = "Setup" | "Labor" | "Machine";type InspectionViewProps = {+ abilityWarning?: AbilityShortfall | null;operationId: string;job: Job;operation: OperationWithDetails;@@ -155,6 +158,7 @@ type InspectionViewProps = {// Accept/Reject disposition) in the MES AssemblyView shell, with the standard// shop-floor actions (timer, complete, scrap, rework, quality issue).export function InspectionView({+ abilityWarning,operationId,job,operation,@@ -372,6 +376,11 @@ export function InspectionView({inspection.status === "Failed" ||inspection.status === "Partial");+ // The process requires an ability this operator lacks and its policy is+ // Block: the lot is read-only for them, as if closed. The routes refuse too.+ const abilityBlocked = abilityWarning?.policy === "Block";+ const isLocked = lotClosed || abilityBlocked;+// Outcome bookkeeping, mirrored from the disposition route's server-side// buckets (which recompute and clamp — these drive the header affordances).const opAttrKey = `Operation ${operationId}`;@@ -434,7 +443,7 @@ export function InspectionView({Math.max(0, passes - linkedProductionQuantity),Math.max(0, opRemaining));- const showCompletePassed = !lotClosed && completablePassed > 0;+ const showCompletePassed = !isLocked && completablePassed > 0;// What Accept will complete: the open remainder, minus failed units.const acceptRemaining = isSerial@@ -470,7 +479,7 @@ export function InspectionView({// Partial is the terminal mixed close — only once every unit has a verdict.const canPartial =- !lotClosed && inspected >= inspection.lotSize && passes > 0 && fails > 0;+ !isLocked && inspected >= inspection.lotSize && passes > 0 && fails > 0;// Serial lots build their sample columns by scanning tracked entities. The// header "Add Sample" button stays primary until the plan's sample size is@@ -480,11 +489,11 @@ export function InspectionView({const hasAutoOpenedScanRef = useRef(false);useEffect(() => {if (hasAutoOpenedScanRef.current) return;- if (isSerial && samples.length === 0 && !lotClosed) {+ if (isSerial && samples.length === 0 && !isLocked) {hasAutoOpenedScanRef.current = true;scannerDisclosure.onOpen();}- }, [isSerial, samples.length, lotClosed, scannerDisclosure]);+ }, [isSerial, samples.length, isLocked, scannerDisclosure]);const maxSampleSize = hasFeatures? Math.max(1, ...liveFeatures.map((f) => f.sampleSize))@@ -510,14 +519,14 @@ export function InspectionView({const counts = featureCounts.get(feature.inspectionFeatureId);return counts != null && counts.failed >= feature.rejectionNumber;});- canAccept = !lotClosed && allFeaturesSatisfied;- canReject = !lotClosed && (anyFeatureRejectable || fails > 0);+ canAccept = !isLocked && allFeaturesSatisfied;+ canReject = !isLocked && (anyFeatureRejectable || fails > 0);} else {canAccept =- !lotClosed &&+ !isLocked &&inspected >= inspection.sampleSize &&fails <= inspection.acceptanceNumber;- canReject = !lotClosed && fails > inspection.acceptanceNumber;+ canReject = !isLocked && fails > inspection.acceptanceNumber;}const failedFeatureSummary = useMemo<FailedFeatureSummary[]>(() => {@@ -635,6 +644,7 @@ export function InspectionView({workCenterId={operation.workCenterId ?? undefined}openEvent={openEventForWorkType(wt)}workType={wt}+ startDisabled={abilityBlocked}/>))}<IconButton@@ -684,7 +694,7 @@ export function InspectionView({<div className="flex-1" />- {isSerial && !lotClosed ? (+ {isSerial && !isLocked ? (<buttontype="button"onClick={scannerDisclosure.onOpen}@@ -697,7 +707,7 @@ export function InspectionView({<Trans>Add Sample</Trans></button>) : null}- {!lotClosed && completablePassed > 0 ? (+ {!isLocked && completablePassed > 0 ? (<CompletePassedButtoninspectionId={inspection.id}operationId={operationId}@@ -755,11 +765,18 @@ export function InspectionView({workCenterId={operation.workCenterId ?? undefined}openEvent={openEventForWorkType(wt)}workType={wt}+ startDisabled={abilityBlocked}/>))}</header>)}+ {abilityWarning && (+ <div className="shrink-0 px-4 pt-3">+ <AbilityWarning warning={abilityWarning} />+ </div>+ )}+{/* Phones: the meta bar scrolls away with the body. */}<div className="contents max-md:flex max-md:min-h-0 max-md:flex-1 max-md:flex-col max-md:overflow-y-auto">{/* ── META BAR ── */}@@ -888,7 +905,7 @@ export function InspectionView({</div><InspectionMeasurementMatrixinspectionId={inspection.id}- isReadOnly={lotClosed}+ isReadOnly={isLocked}isSerial={isSerial}features={features}samples={samples}@@ -911,7 +928,7 @@ export function InspectionView({<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-lg border bg-card max-md:flex-initial"><InspectionMeasurementMatrixinspectionId={inspection.id}- isReadOnly={lotClosed}+ isReadOnly={isLocked}isSerial={isSerial}features={features}samples={samples}@@ -1112,6 +1129,7 @@ export function InspectionView({<ActionSheetButtonicon={<LuTrash className="size-4 shrink-0" />}label={t`Scrap`}+ disabled={abilityBlocked}onClick={() => {actionsSheet.onClose();scrapModal.onOpen();@@ -1120,6 +1138,7 @@ export function InspectionView({<ActionSheetButtonicon={<LuGitPullRequest className="size-4 shrink-0" />}label={t`Rework`}+ disabled={abilityBlocked}onClick={() => {actionsSheet.onClose();reworkModal.onOpen();@@ -1128,6 +1147,7 @@ export function InspectionView({<ActionSheetButtonicon={<LuCheck className="size-4 shrink-0" />}label={t`Mark as Done`}+ disabled={abilityBlocked}onClick={() => {actionsSheet.onClose();finishModal.onOpen();@@ -1141,7 +1161,7 @@ export function InspectionView({qualityModal.onOpen();}}/>- {isSerial && !lotClosed ? (+ {isSerial && !isLocked ? (<ActionSheetButtonicon={<LuScan className="size-4 shrink-0" />}label={t`Add Sample`}@@ -1160,16 +1180,18 @@ export function InspectionView({is running (any work type — the exclusive start would end it).Always on for inspections, independent of the company-levelautoStartOperationTimer setting. */}- <AutoTimer- operationId={operationId}- workType={workTypes.includes("Labor") ? "Labor" : workTypes[0]}- workCenterId={operation.workCenterId ?? undefined}- openEvent={- (events.find((e) => !e.endTime) as- | { id: string; startTime: string }- | undefined) ?? null- }- />+ {!abilityBlocked && (+ <AutoTimer+ operationId={operationId}+ workType={workTypes.includes("Labor") ? "Labor" : workTypes[0]}+ workCenterId={operation.workCenterId ?? undefined}+ openEvent={+ (events.find((e) => !e.endTime) as+ | { id: string; startTime: string }+ | undefined) ?? null+ }+ />+ )}</div>);}@@ -1361,16 +1383,19 @@ function AcceptLotModal({function ActionSheetButton({icon,label,- onClick+ onClick,+ disabled = false}: {icon: React.ReactNode;label: string;onClick: () => void;+ disabled?: boolean;}) {return (<buttontype="button"- className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 transition-transform active:scale-[0.98]"+ disabled={disabled}+ className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 transition-transform active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50"onClick={onClick}>{icon}@@ -1447,12 +1472,16 @@ function TimerControl({operationId,workCenterId,openEvent,- workType+ workType,+ startDisabled = false}: {operationId: string;workCenterId?: string;openEvent: { id: string; startTime: string } | null;workType: WorkType;+ // Starting is refused (ability policy Block); a running timer can still be+ // paused.+ startDisabled?: boolean;}) {const { t } = useLingui();const fetcher = useFetcher();@@ -1487,7 +1516,7 @@ function TimerControl({<input type="hidden" name="id" value={openEvent.id} />) : null}<button- disabled={fetcher.state !== "idle"}+ disabled={(startDisabled && !openEvent) || fetcher.state !== "idle"}type="submit"aria-label={active ? t`Pause timer` : t`Start timer`}className="flex h-full shrink-0 items-center gap-1 border-l border-border px-2 transition-colors hover:bg-accent active:scale-[0.98] max-md:border-l-0 md:gap-2 md:px-4"diff --git a/apps/mes/app/components/JobOperation/JobOperation.tsx b/apps/mes/app/components/JobOperation/JobOperation.tsxindex 2f29acf090..010d1b9d41 100644--- a/apps/mes/app/components/JobOperation/JobOperation.tsx+++ b/apps/mes/app/components/JobOperation/JobOperation.tsx@@ -117,10 +117,12 @@ import {OperationStatusIcon,PrintButton} from "~/components";+import { AbilityWarning } from "~/components/AbilityWarning";import { MethodItemTypeIcon } from "~/components/Icons";import { useDateFormatter, useUrlParams, useUser } from "~/hooks";import type { productionEventType } from "~/services/models";import type {+ AbilityShortfall,BatchMaterialTotal,BatchWorkInstructions,JobOperationBatch@@ -177,6 +179,7 @@ const DOCK_COLLAPSED_KEY = "mes:operation-dock-collapsed";const log = getLogger("mes", "job-operation");type JobOperationProps = {+ abilityWarning?: AbilityShortfall | null;// Present only when the op belongs to an Active/Completing batch; the loader// resolves it and swaps in the batch's events. In batch mode the timers and// completion act on the whole batch.@@ -225,6 +228,7 @@ type JobOperationProps = {};export const JobOperation = ({+ abilityWarning,batch,batchMaterialTotals,batchWorkInstructions,@@ -667,6 +671,10 @@ export const JobOperation = ({);const locationId = layoutData?.location;+ // The process requires an ability this operator lacks and its policy is+ // 'block': no production work here. The routes refuse it too.+ const abilityBlocked = abilityWarning?.policy === "Block";+const completeFetcher = useFetcher<Result>();useKeyboardWedge({test: (input) => {@@ -682,7 +690,7 @@ export const JobOperation = ({},// The wedge completes this single op via endOperation — never for a batched// member; the batch completes as a whole.- active: !!kanban?.id && !isBatched+ active: !!kanban?.id && !isBatched && !abilityBlocked});const item = items.find((it) => it.id === operation.itemId);@@ -1233,6 +1241,11 @@ export const JobOperation = ({</Card></div>)}+ {abilityWarning && (+ <div className="px-4 pt-4 lg:px-6">+ <AbilityWarning warning={abilityWarning} />+ </div>+ )}{scope === "job" && batch && (<div className="px-4 pt-4 lg:px-6"><Alert>@@ -1767,6 +1780,7 @@ export const JobOperation = ({onRecord={onRecordStepRecord}onDelete={onDeleteStepRecord}operationId={operationId}+ disabled={abilityBlocked}className={index === attributes.length - 1? "border-none"@@ -1829,6 +1843,7 @@ export const JobOperation = ({leftIcon={<LuGitBranchPlus />}variant="secondary"size="lg"+ isDisabled={abilityBlocked}onClick={() => openIssueModal(null)}><Trans>Issue Material</Trans>@@ -1849,6 +1864,7 @@ export const JobOperation = ({isBatched ? batchMaterialTotals : undefined}onIssue={openIssueModal}+ disabled={abilityBlocked}/>{renderIssueModal(resolvedMaterials)}</>@@ -2467,6 +2483,7 @@ export const JobOperation = ({onRecord={onRecordStepRecord}onDelete={onDeleteStepRecord}operationId={operationId}+ disabled={abilityBlocked}className={index === attributes.length - 1? "border-none"@@ -2615,6 +2632,7 @@ export const JobOperation = ({}trackedEntityId={trackedEntityId}batchId={batch?.id}+ startDisabled={abilityBlocked}/>{/* What the big button will do, or what is running — the dockonly; the rail and the phone bar stay icon-sized. */}@@ -2650,14 +2668,15 @@ export const JobOperation = ({<div className="flex flex-col items-center gap-0.5"><IconButtonWithTooltipdisabled={- !isBatched &&- parentIsSerial &&- trackedEntities.some(- (entity) =>- entity.id === trackedEntityId &&- `Operation ${operationId}` in- (entity.attributes as TrackedEntityAttributes)- )+ abilityBlocked ||+ (!isBatched &&+ parentIsSerial &&+ trackedEntities.some(+ (entity) =>+ entity.id === trackedEntityId &&+ `Operation ${operationId}` in+ (entity.attributes as TrackedEntityAttributes)+ ))}icon={isBatched ? (@@ -2691,14 +2710,15 @@ export const JobOperation = ({className="w-full"leftIcon={isBatched ? <LuPackageCheck /> : <FaPlus />}isDisabled={- !isBatched &&- parentIsSerial &&- trackedEntities.some(- (entity) =>- entity.id === trackedEntityId &&- `Operation ${operationId}` in- (entity.attributes as TrackedEntityAttributes)- )+ abilityBlocked ||+ (!isBatched &&+ parentIsSerial &&+ trackedEntities.some(+ (entity) =>+ entity.id === trackedEntityId &&+ `Operation ${operationId}` in+ (entity.attributes as TrackedEntityAttributes)+ ))}onClick={isBatched ? batchCompleteModal.onOpen : completeModal.onOpen@@ -2744,7 +2764,8 @@ export const JobOperation = ({{isBatched && (<buttontype="button"- className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 active:scale-[0.98] transition-transform"+ disabled={abilityBlocked}+ className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 active:scale-[0.98] transition-transform disabled:pointer-events-none disabled:opacity-50"onClick={() => {actionsSheet.onClose();batchCompleteModal.onOpen();@@ -2763,7 +2784,8 @@ export const JobOperation = ({<><buttontype="button"- className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 active:scale-[0.98] transition-transform"+ disabled={abilityBlocked}+ className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 active:scale-[0.98] transition-transform disabled:pointer-events-none disabled:opacity-50"onClick={() => {actionsSheet.onClose();scrapModal.onOpen();@@ -2776,7 +2798,8 @@ export const JobOperation = ({</button><buttontype="button"- className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 active:scale-[0.98] transition-transform"+ disabled={abilityBlocked}+ className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 active:scale-[0.98] transition-transform disabled:pointer-events-none disabled:opacity-50"onClick={() => {actionsSheet.onClose();reworkModal.onOpen();@@ -2789,7 +2812,8 @@ export const JobOperation = ({</button><buttontype="button"- className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 active:scale-[0.98] transition-transform"+ disabled={abilityBlocked}+ className="flex items-center gap-3 rounded-lg bg-accent px-4 py-4 text-accent-foreground ring-1 ring-black/5 active:scale-[0.98] transition-transform disabled:pointer-events-none disabled:opacity-50"onClick={() => {actionsSheet.onClose();finishModal.onOpen();diff --git a/apps/mes/app/components/JobOperation/components/Controls.tsx b/apps/mes/app/components/JobOperation/components/Controls.tsxindex d7be198e7d..1625595e4e 100644--- a/apps/mes/app/components/JobOperation/components/Controls.tsx+++ b/apps/mes/app/components/JobOperation/components/Controls.tsx@@ -268,6 +268,7 @@ export function StartStopButton({isTrackedActivity,trackedEntityId,batchId,+ startDisabled = false,...props}: ComponentProps<"button"> & {eventType: (typeof productionEventType)[number];@@ -281,6 +282,9 @@ export function StartStopButton({// When set, the start/stop event is tagged as part of this batch — sliced per// member at batch completion, and cost posting is deferred until then.batchId?: string;+ // Starting is refused (ability policy 'block'); a running timer can still+ // be paused.+ startDisabled?: boolean;}) {const fetcher = useFetcher<ProductionEvent>();@@ -379,7 +383,7 @@ export function StartStopButton({) : (<PlayButtonref={startStopRef}- disabled={fetcher.state !== "idle"}+ disabled={startDisabled || fetcher.state !== "idle"}type="submit"/>)}diff --git a/apps/mes/app/components/JobOperation/components/Materials.tsx b/apps/mes/app/components/JobOperation/components/Materials.tsxindex 8a35658d3e..2e8fadc415 100644--- a/apps/mes/app/components/JobOperation/components/Materials.tsx+++ b/apps/mes/app/components/JobOperation/components/Materials.tsx@@ -247,6 +247,8 @@ type OperationMaterialsProps = {/** Only for batched operations. */batchMaterialTotals?: Record<string, BatchMaterialTotal> | null;onIssue: (material: JobMaterial) => void;+ // The operator may not issue on this operation (ability policy 'block')+ disabled?: boolean;};/** The operation's materials: a table from md, a list on phones. */@@ -262,7 +264,12 @@ export function OperationMaterials(props: OperationMaterialsProps) {type LayoutProps = OperationMaterialsProps & { groups: MaterialGroup[] };-function MaterialsTable({ groups, parentIsSerial, onIssue }: LayoutProps) {+function MaterialsTable({+ groups,+ parentIsSerial,+ onIssue,+ disabled+}: LayoutProps) {const { t } = useLingui();const [items] = useItems();@@ -273,6 +280,7 @@ function MaterialsTable({ groups, parentIsSerial, onIssue }: LayoutProps) {variant="ghost"icon={<LuGitBranchPlus />}className="h-8 w-8"+ isDisabled={disabled}onClick={() => onIssue(row.material)}/>) : row.issue === "scan" && row.isKitChild ? (@@ -281,6 +289,7 @@ function MaterialsTable({ groups, parentIsSerial, onIssue }: LayoutProps) {variant="secondary"icon={<LuQrCode />}className="h-8 w-8"+ isDisabled={disabled}onClick={() => onIssue(row.material)}/>) : row.issue === "scan" ? (@@ -289,6 +298,7 @@ function MaterialsTable({ groups, parentIsSerial, onIssue }: LayoutProps) {size="lg"variant={row.isPrimaryIssue ? "primary" : "secondary"}leftIcon={<LuQrCode />}+ isDisabled={disabled}onClick={() => onIssue(row.material)}><Trans>Issue</Trans>@@ -463,7 +473,12 @@ function MaterialsTable({ groups, parentIsSerial, onIssue }: LayoutProps) {);}-function MaterialsList({ groups, parentIsSerial, onIssue }: LayoutProps) {+function MaterialsList({+ groups,+ parentIsSerial,+ onIssue,+ disabled+}: LayoutProps) {const { t } = useLingui();const [items] = useItems();@@ -520,6 +535,7 @@ function MaterialsList({ groups, parentIsSerial, onIssue }: LayoutProps) {variant="secondary"size="lg"icon={<LuQrCode />}+ isDisabled={disabled}onClick={() => onIssue(material)}/>) : row.issue ? (@@ -530,6 +546,7 @@ function MaterialsList({ groups, parentIsSerial, onIssue }: LayoutProps) {leftIcon={row.issue === "scan" ? <LuQrCode /> : <LuGitBranchPlus />}+ isDisabled={disabled}onClick={() => onIssue(material)}><Trans>Issue</Trans>diff --git a/apps/mes/app/components/JobOperation/components/Step.tsx b/apps/mes/app/components/JobOperation/components/Step.tsxindex 9634e095b9..c4fa264099 100644--- a/apps/mes/app/components/JobOperation/components/Step.tsx+++ b/apps/mes/app/components/JobOperation/components/Step.tsx@@ -125,7 +125,8 @@ export function StepsListItem({operationId,className,onRecord,- onDelete+ onDelete,+ disabled = false}: {activeStep: number;step: JobOperationStep;@@ -134,6 +135,8 @@ export function StepsListItem({className: string;onRecord: (step: JobOperationStep) => void;onDelete: (step: JobOperationStep) => void;+ // The operator may not record on this operation (ability policy 'block')+ disabled?: boolean;}) {const fetcher = useFetcher<{ success: boolean }>();const user = useUser();@@ -183,7 +186,7 @@ export function StepsListItem({variant="secondary"size="lg"icon={<LuCircleCheck />}- isDisabled={record?.createdBy !== user?.id}+ isDisabled={disabled || record?.createdBy !== user?.id}onClick={() => onRecord(step)}className={cn("text-emerald-500",@@ -202,6 +205,7 @@ export function StepsListItem({variant="secondary"size="lg"rightIcon={<LuCircleCheck />}+ isDisabled={disabled}onClick={() => onRecord(step)}><Trans>Update</Trans>@@ -212,7 +216,7 @@ export function StepsListItem({variant="secondary"size="lg"icon={<LuTrash />}- isDisabled={record?.createdBy !== user?.id}+ isDisabled={disabled || record?.createdBy !== user?.id}onClick={() => onDelete(step)}/></div>@@ -230,7 +234,7 @@ export function StepsListItem({icon={<LuCircleCheck />}type="submit"isLoading={fetcher.state !== "idle"}- isDisabled={fetcher.state !== "idle"}+ isDisabled={disabled || fetcher.state !== "idle"}/>) : (<Button@@ -239,7 +243,7 @@ export function StepsListItem({size="lg"rightIcon={<LuCircleCheck />}isLoading={fetcher.state !== "idle"}- isDisabled={fetcher.state !== "idle"}+ isDisabled={disabled || fetcher.state !== "idle"}><Trans>Complete</Trans></Button>@@ -251,6 +255,7 @@ export function StepsListItem({variant="secondary"size="lg"icon={<LuCircleCheck />}+ isDisabled={disabled}onClick={() => onRecord(step)}/>) : (@@ -258,6 +263,7 @@ export function StepsListItem({variant="secondary"size="lg"rightIcon={<LuCircleCheck />}+ isDisabled={disabled}onClick={() => onRecord(step)}><Trans>Record</Trans>diff --git a/apps/mes/app/routes/x+/assembly.$operationId.tsx b/apps/mes/app/routes/x+/assembly.$operationId.tsxindex 3032ca4736..e3b3ffddba 100644--- a/apps/mes/app/routes/x+/assembly.$operationId.tsx+++ b/apps/mes/app/routes/x+/assembly.$operationId.tsx@@ -15,6 +15,7 @@ import { useLoaderData, useParams } from "react-router";import { AssemblyView } from "~/components/AssemblyView";import { getCompanySettings } from "~/services/inventory.service";import {+ getAbilityShortfall,getAssemblyPlaybackByOperationId,getJobByOperationId,getJobMakeMethod,@@ -168,7 +169,14 @@ export async function loader({ request, params }: LoaderFunctionArgs) {);// Expiry policy for the issue-material modal — same source as the operation view.- const companySettings = await getCompanySettings(serviceRole, companyId);+ const [companySettings, abilityWarning] = await Promise.all([+ getCompanySettings(serviceRole, companyId),+ getAbilityShortfall(serviceRole, {+ operationId,+ employeeId: userId,+ companyId+ })+ ]);const inventoryShelfLife = (companySettings.data?.inventoryShelfLife ??null) as { expiredEntityPolicy?: ExpiredEntityPolicy } | null;const expiredEntityPolicy: ExpiredEntityPolicy =@@ -266,6 +274,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {const isFirstOperation = !priorDependency.error && !priorDependency.data;return {+ abilityWarning,job: job.data,operation: makeDurations(op) as OperationWithDetails,thumbnailPath,diff --git a/apps/mes/app/routes/x+/complete.tsx b/apps/mes/app/routes/x+/complete.tsxindex 27d423e124..942dfc41ea 100644--- a/apps/mes/app/routes/x+/complete.tsx+++ b/apps/mes/app/routes/x+/complete.tsx@@ -16,6 +16,7 @@ import { data } from "react-router";import { erpPosting } from "~/services/erp";import { nonScrapQuantityValidator } from "~/services/models";import {+ abilityBlockRefusal,finishJobOperation,insertProductionQuantity} from "~/services/operations.service";@@ -131,6 +132,18 @@ export async function action({ request }: ActionFunctionArgs) {);}+ const refusal = await abilityBlockRefusal(serviceRole, {+ operationId: jobOperation.data.id,+ employeeId: userId,+ companyId+ });+ if (refusal) {+ return data(+ {},+ await flash(request, { ...error(null, refusal), flash: "error" })+ );+ }+// The production event ids ride along into the productionQuantity row and// the issue call; RLS does not check a foreign key's tenant, so verify them.const productionEventIds = [diff --git a/apps/mes/app/routes/x+/entity+/$materialId.$trackedEntityId.scrap.tsx b/apps/mes/app/routes/x+/entity+/$materialId.$trackedEntityId.scrap.tsxindex 204a294e18..c145d686a0 100644--- a/apps/mes/app/routes/x+/entity+/$materialId.$trackedEntityId.scrap.tsx+++ b/apps/mes/app/routes/x+/entity+/$materialId.$trackedEntityId.scrap.tsx@@ -3,12 +3,16 @@// including ports, remain AGPLv3; serving them over a network requires releasing their source.import { requirePermissions } from "@carbon/auth/auth.server";+import { getCarbonServiceRole } from "@carbon/auth/client.server";import { validationError, validator } from "@carbon/form";import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { erpPosting } from "~/services/erp";import { scrapTrackedEntityValidator } from "~/services/models";-import { getTrackedEntity } from "~/services/operations.service";+import {+ abilityBlockRefusal,+ getTrackedEntity+} from "~/services/operations.service";export async function action({ request, params }: ActionFunctionArgs) {const { client, companyId, userId } = await requirePermissions(request, {});@@ -29,6 +33,24 @@ export async function action({ request, params }: ActionFunctionArgs) {return validationError(validation.error);}+ const serviceRole = await getCarbonServiceRole();+ const material = await serviceRole+ .from("jobMaterial")+ .select("jobOperationId")+ .eq("id", materialId)+ .eq("companyId", companyId)+ .maybeSingle();+ const refusal = material.data?.jobOperationId+ ? await abilityBlockRefusal(serviceRole, {+ operationId: material.data.jobOperationId,+ employeeId: userId,+ companyId+ })+ : null;+ if (refusal) {+ return data({ success: false, message: refusal }, { status: 403 });+ }+const trackedEntity = await getTrackedEntity(client, trackedEntityId);if (trackedEntity.error) {return data(diff --git a/apps/mes/app/routes/x+/event.tsx b/apps/mes/app/routes/x+/event.tsxindex 14d30255f7..146adec940 100644--- a/apps/mes/app/routes/x+/event.tsx+++ b/apps/mes/app/routes/x+/event.tsx@@ -7,22 +7,39 @@ import { requirePermissions } from "@carbon/auth/auth.server";import { getCarbonServiceRole } from "@carbon/auth/client.server";import { flash } from "@carbon/auth/session.server";import { validationError, validator } from "@carbon/form";-import { datetime } from "@carbon/utils";+import { datetime, redirect } from "@carbon/utils";import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { getDatabaseClient } from "~/services/database.server";import { productionEventValidator } from "~/services/models";import {+ abilityBlockRefusal,endMachineProductionEvent,endProductionEvent,- getOperationEligibility,postEndedProductionEvents,startMachineProductionEvent,startProductionEvent} from "~/services/operations.service";import { OUTSIDE_PROCESSING_REFUSAL } from "~/utils/operationView";+import { path, requestReferrer } from "~/utils/path";++export async function action(args: ActionFunctionArgs) {+ const result = await productionEventAction(args);+ // A press before the page hydrates submits the start/stop form as a full+ // page POST, which would leave the operator on this resource route with a+ // bare JSON body. Send them back to the page they came from, keeping the+ // flash cookie, so the outcome shows as a toast there.+ if (args.request.headers.get("Sec-Fetch-Mode") === "navigate") {+ const headers =+ result instanceof Response ? result.headers : result.init?.headers;+ throw redirect(requestReferrer(args.request) ?? path.to.operations, {+ headers+ });+ }+ return result;+}-export async function action({ request }: ActionFunctionArgs) {+async function productionEventAction({ request }: ActionFunctionArgs) {assertIsPost(request);const { client, companyId, userId } = await requirePermissions(request, {});@@ -90,16 +107,12 @@ export async function action({ request }: ActionFunctionArgs) {return refused(OUTSIDE_PROCESSING_REFUSAL);}- const eligibility = await getOperationEligibility(serviceRole, {+ const abilityRefusal = await abilityBlockRefusal(serviceRole, {operationId: d.jobOperationId,employeeId: userId,companyId});- if (!eligibility.eligible) {- return refused(- eligibility.reason ?? "Not qualified to start this operation"- );- }+ if (abilityRefusal) return refused(abilityRefusal);// Single-phase (assembly) clocking: end any other open work type for this// operator on this operation before starting, so Setup and Labor can neverdiff --git a/apps/mes/app/routes/x+/finish.tsx b/apps/mes/app/routes/x+/finish.tsxindex 156d4981d8..e87a2e96fd 100644--- a/apps/mes/app/routes/x+/finish.tsx+++ b/apps/mes/app/routes/x+/finish.tsx@@ -11,7 +11,10 @@ import { redirect } from "@carbon/utils";import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { finishValidator } from "~/services/models";-import { finishJobOperation } from "~/services/operations.service";+import {+ abilityBlockRefusal,+ finishJobOperation+} from "~/services/operations.service";import { readOrigin } from "~/utils/origin";import { path } from "~/utils/path";@@ -27,6 +30,15 @@ export async function action({ request }: ActionFunctionArgs) {return validationError(validation.error);}+ const refusal = await abilityBlockRefusal(serviceRole, {+ operationId: validation.data.jobOperationId,+ employeeId: userId,+ companyId+ });+ if (refusal) {+ return data({}, await flash(request, error(null, refusal)));+ }+const finishOperation = await finishJobOperation(serviceRole, {...validation.data,userId,diff --git a/apps/mes/app/routes/x+/inspection-lot.$id.complete-passed.tsx b/apps/mes/app/routes/x+/inspection-lot.$id.complete-passed.tsxindex f3b27ac3bc..46319ebc8a 100644--- a/apps/mes/app/routes/x+/inspection-lot.$id.complete-passed.tsx+++ b/apps/mes/app/routes/x+/inspection-lot.$id.complete-passed.tsx@@ -10,7 +10,10 @@ import { validationError, validator } from "@carbon/form";import { redirect } from "@carbon/utils";import type { ActionFunctionArgs } from "react-router";import { inspectionCompletePassedValidator } from "~/services/models";-import { returnPickedRemainders } from "~/services/operations.service";+import {+ abilityBlockRefusal,+ returnPickedRemainders+} from "~/services/operations.service";import {checkStrictBackflush,getInspectionOutcomeState,@@ -88,6 +91,14 @@ export async function action({ request, params }: ActionFunctionArgs) {if (state.jobOperationId !== operationId) {return fail(null, "Operation does not match the inspection lot");}+ const refusal = await abilityBlockRefusal(serviceRole, {+ operationId: state.jobOperationId,+ employeeId: userId,+ companyId+ });+ if (refusal) {+ return fail(null, refusal);+ }if (["Passed", "Failed", "Partial"].includes(state.inspection.status)) {return fail(null, "Inspection is closed — the disposition already ran");}diff --git a/apps/mes/app/routes/x+/inspection-lot.$id.disposition.tsx b/apps/mes/app/routes/x+/inspection-lot.$id.disposition.tsxindex fd2a3725e8..9ba34e5cc4 100644--- a/apps/mes/app/routes/x+/inspection-lot.$id.disposition.tsx+++ b/apps/mes/app/routes/x+/inspection-lot.$id.disposition.tsx@@ -14,6 +14,7 @@ import { getDatabaseClient } from "~/services/database.server";import { erpPosting } from "~/services/erp";import { inspectionDispositionValidator } from "~/services/models";import {+ abilityBlockRefusal,finishJobOperation,insertScrapQuantity} from "~/services/operations.service";@@ -101,6 +102,14 @@ export async function action({ request, params }: ActionFunctionArgs) {if (state.jobOperationId !== operationId) {return fail(null, "Operation does not match the inspection lot");}+ const refusal = await abilityBlockRefusal(serviceRole, {+ operationId: state.jobOperationId,+ employeeId: userId,+ companyId+ });+ if (refusal) {+ return fail(null, refusal);+ }const inspectedCount = state.samples.filter((s) => s.status !== "Pending"diff --git a/apps/mes/app/routes/x+/inspection-lot.$id.measurement.tsx b/apps/mes/app/routes/x+/inspection-lot.$id.measurement.tsxindex 8fdb7bfbc3..0a47f24b15 100644--- a/apps/mes/app/routes/x+/inspection-lot.$id.measurement.tsx+++ b/apps/mes/app/routes/x+/inspection-lot.$id.measurement.tsx@@ -4,6 +4,7 @@import { assertIsPost, error } 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 { upsertInspectionMeasurement } from "@carbon/database/quality";import { validationError, validator } from "@carbon/form";@@ -11,6 +12,7 @@ import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { getDatabaseClient } from "~/services/database.server";import { inspectionMeasurementValidator } from "~/services/models";+import { abilityBlockRefusal } from "~/services/operations.service";export async function action({ request, params }: ActionFunctionArgs) {assertIsPost(request);@@ -33,7 +35,32 @@ export async function action({ request, params }: ActionFunctionArgs) {);}- const result = await upsertInspectionMeasurement(getDatabaseClient(), {+ const db = getDatabaseClient();++ // A job-operation lot carries its operation as sourceDocumentLineId;+ // receipt lots have no operation to gate.+ const lot = await db+ .selectFrom("inspection")+ .select(["sourceDocument", "sourceDocumentLineId"])+ .where("id", "=", id)+ .where("companyId", "=", companyId)+ .executeTakeFirst();+ const refusal =+ lot?.sourceDocument === "Job Operation" && lot.sourceDocumentLineId+ ? await abilityBlockRefusal(await getCarbonServiceRole(), {+ operationId: lot.sourceDocumentLineId,+ employeeId: userId,+ companyId+ })+ : null;+ if (refusal) {+ return data(+ { error: { message: refusal } },+ await flash(request, error(null, refusal))+ );+ }++ const result = await upsertInspectionMeasurement(db, {...validation.data,companyId,userIddiff --git a/apps/mes/app/routes/x+/inspection-lot.$id.sample.tsx b/apps/mes/app/routes/x+/inspection-lot.$id.sample.tsxindex d767c6de1d..f329538622 100644--- a/apps/mes/app/routes/x+/inspection-lot.$id.sample.tsx+++ b/apps/mes/app/routes/x+/inspection-lot.$id.sample.tsx@@ -4,6 +4,7 @@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 { upsertInspectionSample } from "@carbon/database/quality";import { validationError, validator } from "@carbon/form";@@ -12,6 +13,7 @@ import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { getDatabaseClient } from "~/services/database.server";import { inspectionSampleValidator } from "~/services/models";+import { abilityBlockRefusal } from "~/services/operations.service";const logger = getLogger("mes", "inspection-lot-sample");@@ -42,6 +44,29 @@ export async function action({ request, params }: ActionFunctionArgs) {const db = getDatabaseClient();+ // A job-operation lot carries its operation as sourceDocumentLineId;+ // receipt lots have no operation to gate.+ const lot = await db+ .selectFrom("inspection")+ .select(["sourceDocument", "sourceDocumentLineId"])+ .where("id", "=", id)+ .where("companyId", "=", companyId)+ .executeTakeFirst();+ const refusal =+ lot?.sourceDocument === "Job Operation" && lot.sourceDocumentLineId+ ? await abilityBlockRefusal(await getCarbonServiceRole(), {+ operationId: lot.sourceDocumentLineId,+ employeeId: userId,+ companyId+ })+ : null;+ if (refusal) {+ return data(+ { error: { message: refusal } },+ await flash(request, error(null, refusal))+ );+ }+// The sample write runs as the superuser and links the tracked entity, so// the entity must belong to this company.const { trackedEntityId } = validation.data;diff --git a/apps/mes/app/routes/x+/inspection.$operationId.tsx b/apps/mes/app/routes/x+/inspection.$operationId.tsxindex 43050efb4b..aad69bab6e 100644--- a/apps/mes/app/routes/x+/inspection.$operationId.tsx+++ b/apps/mes/app/routes/x+/inspection.$operationId.tsx@@ -18,6 +18,7 @@ import { useLoaderData, useParams } from "react-router";import { InspectionView } from "~/components/Inspection/InspectionView";import { getDatabaseClient } from "~/services/database.server";import {+ getAbilityShortfall,getJobByOperationId,getJobMakeMethod,getJobOperationById,@@ -221,7 +222,14 @@ export async function loader({ request, params }: LoaderFunctionArgs) {a.id.localeCompare(b.id));+ const abilityWarning = await getAbilityShortfall(serviceRole, {+ operationId,+ employeeId: userId,+ companyId+ });+return {+ abilityWarning,job: job.data,operation: makeDurations(op) as OperationWithDetails,inspection,diff --git a/apps/mes/app/routes/x+/issue-tracked-entity.tsx b/apps/mes/app/routes/x+/issue-tracked-entity.tsxindex c8e58fd4fe..83155d5cbd 100644--- a/apps/mes/app/routes/x+/issue-tracked-entity.tsx+++ b/apps/mes/app/routes/x+/issue-tracked-entity.tsx@@ -4,11 +4,13 @@import { assertIsPost } from "@carbon/auth";import { requirePermissions } from "@carbon/auth/auth.server";+import { getCarbonServiceRole } from "@carbon/auth/client.server";import { getLogger } from "@carbon/logger";import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { erpPosting } from "~/services/erp";import { issueTrackedEntityValidator } from "~/services/models";+import { abilityBlockRefusal } from "~/services/operations.service";const log = getLogger("mes");@@ -46,6 +48,17 @@ export async function action({ request }: ActionFunctionArgs) {);}+ if (!batchId && jobOperationId) {+ const refusal = await abilityBlockRefusal(await getCarbonServiceRole(), {+ operationId: jobOperationId,+ employeeId: userId,+ companyId+ });+ if (refusal) {+ return data({ success: false, message: refusal }, { status: 403 });+ }+ }+// Batch mode: one pick for the whole operation batch. The posting splits the// picked lots pro-rata by each member's remaining requirement and records// per-member consumption, so costing and genealogy stay per job.diff --git a/apps/mes/app/routes/x+/issue.tsx b/apps/mes/app/routes/x+/issue.tsxindex eba8b68554..3eaa52e8f5 100644--- a/apps/mes/app/routes/x+/issue.tsx+++ b/apps/mes/app/routes/x+/issue.tsx@@ -13,6 +13,7 @@ import { redirect } from "@carbon/utils";import type { ActionFunctionArgs } from "react-router";import { erpPosting } from "~/services/erp";import { issueValidator } from "~/services/models";+import { abilityBlockRefusal } from "~/services/operations.service";import { path, requestReferrer } from "~/utils/path";const logger = getLogger("mes", "issue");@@ -63,6 +64,18 @@ export async function action({ request }: ActionFunctionArgs) {);}+ const refusal = await abilityBlockRefusal(serviceRole, {+ operationId: jobOperationId,+ employeeId: userId,+ companyId+ });+ if (refusal) {+ throw redirect(+ requestReferrer(request) ?? path.to.operations,+ await flash(request, error(null, refusal))+ );+ }+if (jobOpRow.workCenterId) {const ruleEval = await evaluateLinesForSurface({client: serviceRole,diff --git a/apps/mes/app/routes/x+/operation.$operationId.tsx b/apps/mes/app/routes/x+/operation.$operationId.tsxindex f641a32524..c4e935fa8d 100644--- a/apps/mes/app/routes/x+/operation.$operationId.tsx+++ b/apps/mes/app/routes/x+/operation.$operationId.tsx@@ -13,6 +13,7 @@ import { useLoaderData, useParams } from "react-router";import { JobOperation } from "~/components/JobOperation";import { getCompanySettings } from "~/services/inventory.service";import {+ getAbilityShortfall,getBatchMaterialTotals,getBatchWorkInstructions,getJobByOperationId,@@ -244,7 +245,8 @@ export async function loader({ request, params }: LoaderFunctionArgs) {jobMakeMethod,kanban,bomIdMap,- companySettings+ companySettings,+ abilityWarning] = await Promise.all([getThumbnailPathByItemId(serviceRole, operation.data?.[0].itemId),getTrackedEntitiesByMakeMethodId(@@ -255,7 +257,12 @@ export async function loader({ request, params }: LoaderFunctionArgs) {getJobMakeMethod(serviceRole, operation.data?.[0].jobMakeMethodId),getKanbanByJobId(serviceRole, job.data.id),getJobMethodBomIdMap(serviceRole, job.data.id!),- getCompanySettings(serviceRole, companyId)+ getCompanySettings(serviceRole, companyId),+ getAbilityShortfall(serviceRole, {+ operationId,+ employeeId: userId,+ companyId+ })]);const inventoryShelfLife = (companySettings.data?.inventoryShelfLife ??@@ -364,6 +371,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {companyId}),operation: makeDurations(operation.data?.[0]) as OperationWithDetails,+ abilityWarning,expiredEntityPolicy,autoSelectMaterialWithoutPickingList,procedure: getJobOperationProcedure(serviceRole, operation.data?.[0].id),@@ -388,6 +396,7 @@ export default function OperationRoute() {if (!operationId) throw new Error("Operation ID is required");const {+ abilityWarning,batch,batchMaterialTotals,batchWorkInstructions,@@ -411,6 +420,7 @@ export default function OperationRoute() {return (<JobOperationkey={`job-operation-${operationId}`}+ abilityWarning={abilityWarning}batch={batch}batchMaterialTotals={batchMaterialTotals}batchWorkInstructions={batchWorkInstructions}diff --git a/apps/mes/app/routes/x+/record.$id.delete.tsx b/apps/mes/app/routes/x+/record.$id.delete.tsxindex 2a24ffcb39..f44c989e57 100644--- a/apps/mes/app/routes/x+/record.$id.delete.tsx+++ b/apps/mes/app/routes/x+/record.$id.delete.tsx@@ -8,7 +8,10 @@ import { getCarbonServiceRole } from "@carbon/auth/client.server";import { flash } from "@carbon/auth/session.server";import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";-import { deleteAttributeRecord } from "~/services/operations.service";+import {+ abilityBlockRefusal,+ deleteAttributeRecord+} from "~/services/operations.service";export async function action({ params, request }: ActionFunctionArgs) {assertIsPost(request);@@ -21,6 +24,24 @@ export async function action({ params, request }: ActionFunctionArgs) {const serviceRole = await getCarbonServiceRole();+ const record = await serviceRole+ .from("jobOperationStepRecord")+ .select("jobOperationStep(operationId)")+ .eq("id", id)+ .eq("companyId", companyId)+ .maybeSingle();+ const operationId = record.data?.jobOperationStep?.operationId;+ const refusal = operationId+ ? await abilityBlockRefusal(serviceRole, {+ operationId,+ employeeId: userId,+ companyId+ })+ : null;+ if (refusal) {+ return data({ success: false }, await flash(request, error(null, refusal)));+ }+const attributeDelete = await deleteAttributeRecord(serviceRole, {id,companyId,diff --git a/apps/mes/app/routes/x+/record.tsx b/apps/mes/app/routes/x+/record.tsxindex 91bde9161b..4e6f697b08 100644--- a/apps/mes/app/routes/x+/record.tsx+++ b/apps/mes/app/routes/x+/record.tsx@@ -12,6 +12,7 @@ import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { stepRecordValidator } from "~/services/models";import {+ abilityBlockRefusal,backflushUntrackedMaterialsOnStepRecord,insertAttributeRecord} from "~/services/operations.service";@@ -30,6 +31,24 @@ export async function action({ request }: ActionFunctionArgs) {return validationError(validation.error);}+ // A missing step is left to insertAttributeRecord's not-found refusal.+ const step = await serviceRole+ .from("jobOperationStep")+ .select("operationId")+ .eq("id", validation.data.jobOperationStepId)+ .eq("companyId", companyId)+ .maybeSingle();+ const refusal = step.data+ ? await abilityBlockRefusal(serviceRole, {+ operationId: step.data.operationId,+ employeeId: userId,+ companyId+ })+ : null;+ if (refusal) {+ return data({}, await flash(request, error(null, refusal)));+ }+const attributeRecord = await insertAttributeRecord(serviceRole, {...validation.data,companyId,diff --git a/apps/mes/app/routes/x+/rework.tsx b/apps/mes/app/routes/x+/rework.tsxindex ac41b2de89..a8f7e68572 100644--- a/apps/mes/app/routes/x+/rework.tsx+++ b/apps/mes/app/routes/x+/rework.tsx@@ -4,12 +4,16 @@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 { validationError, validator } from "@carbon/form";import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { nonScrapQuantityValidator } from "~/services/models";-import { insertReworkQuantity } from "~/services/operations.service";+import {+ abilityBlockRefusal,+ insertReworkQuantity+} from "~/services/operations.service";export async function action({ request }: ActionFunctionArgs) {assertIsPost(request);@@ -24,6 +28,16 @@ export async function action({ request }: ActionFunctionArgs) {return validationError(validation.error);}+ const serviceRole = await getCarbonServiceRole();+ const refusal = await abilityBlockRefusal(serviceRole, {+ operationId: validation.data.jobOperationId,+ employeeId: userId,+ companyId+ });+ if (refusal) {+ return data({}, await flash(request, error(null, refusal)));+ }+const insertRework = await insertReworkQuantity(client, {...validation.data,companyId,diff --git a/apps/mes/app/routes/x+/scrap.tsx b/apps/mes/app/routes/x+/scrap.tsxindex b622d328db..25e465b096 100644--- a/apps/mes/app/routes/x+/scrap.tsx+++ b/apps/mes/app/routes/x+/scrap.tsx@@ -4,12 +4,14 @@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 { validationError, validator } from "@carbon/form";import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { erpPosting } from "~/services/erp";import { scrapQuantityValidator } from "~/services/models";+import { abilityBlockRefusal } from "~/services/operations.service";export async function action({ request }: ActionFunctionArgs) {assertIsPost(request);@@ -34,6 +36,16 @@ export async function action({ request }: ActionFunctionArgs) {machineProductionEventId} = validation.data;+ const serviceRole = await getCarbonServiceRole();+ const refusal = await abilityBlockRefusal(serviceRole, {+ operationId: jobOperationId,+ employeeId: userId,+ companyId+ });+ if (refusal) {+ return data({}, await flash(request, error(null, refusal)));+ }+// One transactional posting: Scrap productionQuantity row, BOM// backflush, tracked-entity terminal status + replacement serial spawn// (serial parents), Done-operation reopen / capacity top-up beyond thediff --git a/apps/mes/app/routes/x+/start.$operationId.tsx b/apps/mes/app/routes/x+/start.$operationId.tsxindex 3702eb4266..0997a38269 100644--- a/apps/mes/app/routes/x+/start.$operationId.tsx+++ b/apps/mes/app/routes/x+/start.$operationId.tsx@@ -15,8 +15,8 @@ import type { LoaderFunctionArgs } from "react-router";import { getDatabaseClient } from "~/services/database.server";import { getWorkCenterWithBlockingStatus } from "~/services/maintenance.service";import {+ abilityBlockRefusal,getNextIncompleteSerialEntity,- getOperationEligibility,getTrackedEntitiesByMakeMethodId,postEndedProductionEvents,startMachineProductionEvent,@@ -162,20 +162,17 @@ export async function loader({ request, params }: LoaderFunctionArgs) {}}- // Check if the operator is qualified for the operation's required abilities- const eligibility = await getOperationEligibility(serviceRole, {+ // Refuse when the process requires an ability the operator lacks and its+ // policy is Block+ const abilityRefusal = await abilityBlockRefusal(serviceRole, {operationId,employeeId: userId,companyId});-- if (!eligibility.eligible) {+ if (abilityRefusal) {throw redirect(path.to.operation(operationId),- await flash(- request,- error(null, eligibility.reason ?? "Not qualified to start operation")- )+ await flash(request, error(null, abilityRefusal)));}diff --git a/apps/mes/app/routes/x+/unconsume.tsx b/apps/mes/app/routes/x+/unconsume.tsxindex 2cb749e7be..20e5fec7ba 100644--- a/apps/mes/app/routes/x+/unconsume.tsx+++ b/apps/mes/app/routes/x+/unconsume.tsx@@ -11,6 +11,7 @@ import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { erpPosting } from "~/services/erp";import { issueTrackedEntityValidator } from "~/services/models";+import { abilityBlockRefusal } from "~/services/operations.service";const log = getLogger("mes", "unconsume");@@ -60,6 +61,15 @@ export async function action({ request }: ActionFunctionArgs) {}if (matRow.jobOperationId) {+ const refusal = await abilityBlockRefusal(serviceRole, {+ operationId: matRow.jobOperationId,+ employeeId: userId,+ companyId+ });+ if (refusal) {+ return data({ success: false, message: refusal }, { status: 403 });+ }+// `workInstructionId` is in the runtime row but absent from the generated// DB types (stale until next regen). Select only the typed column;// pick up `workInstructionId` via cast below.diff --git a/apps/mes/app/services/operations.service.ts b/apps/mes/app/services/operations.service.tsindex 52b09c6112..d413a151ac 100644--- a/apps/mes/app/services/operations.service.ts+++ b/apps/mes/app/services/operations.service.ts@@ -1585,13 +1585,27 @@ export async function getNonConformanceActions(}[];}-export async function getOperationEligibility(+export type ProcessAbilityPolicy =+ Database["public"]["Enums"]["processAbilityPolicy"];++// What an operator lacks to work on an operation whose process requires an+// ability. getAbilityShortfall returns null when nothing is missing.+export type AbilityShortfall = {+ policy: ProcessAbilityPolicy;+ processName: string;+ // the qualification's expiry date; null when the operator never held it+ expiredOn: string | null;+ // an Active training that grants the ability, when one exists+ trainingName: string | null;+};++export async function getAbilityShortfall(client: SupabaseClient<Database>,args: { operationId: string; employeeId: string; companyId: string }-): Promise<{ eligible: boolean; reason: string | null }> {+): Promise<AbilityShortfall | null> {const { operationId, employeeId, companyId } = args;- // NOTE: query failures here FAIL OPEN (eligible: true). An RLS/database+ // NOTE: query failures here FAIL OPEN (no shortfall). An RLS/database// error must not brick the shop floor — the scheduler is the primary// enforcement of ability requirements; this gate is a best-effort backstop.// The requirement comes from the operation's PROCESS: process.requiresAbility@@ -1599,90 +1613,84 @@ export async function getOperationEligibility(// what the employee must be qualified for.const operation = await client.from("jobOperation")- .select("processId")+ .select(+ "process!jobOperation_processId_fkey(name, requiresAbility, abilityPolicy, ability!ability_processId_fkey(id, active))"+ ).eq("id", operationId).eq("companyId", companyId).maybeSingle();- if (operation.error) {- return { eligible: true, reason: null };- }-- if (!operation.data?.processId) {- return { eligible: true, reason: null };- }-- const process = await client- .from("process")- .select("name, requiresAbility")- .eq("id", operation.data.processId)- .eq("companyId", companyId)- .maybeSingle();-- if (process.error) {- return { eligible: true, reason: null };- }-- if (!process.data?.requiresAbility) {- return { eligible: true, reason: null };- }-- const ability = await client- .from("ability")- .select("id")- .eq("processId", operation.data.processId)- .eq("companyId", companyId)- .eq("active", true)- .maybeSingle();-- if (ability.error) {- return { eligible: true, reason: null };- }-- if (!ability.data) {- // requiresAbility is on but no linked ability exists — data anomaly,- // don't block the floor- return { eligible: true, reason: null };- }+ const process = operation.data?.process;+ if (operation.error || !process?.requiresAbility) return null;- // The ability's name IS the process's name (abilities no longer store one).- const abilityName = process.data.name ?? "ability";+ // requiresAbility is on but no active linked ability exists — data anomaly,+ // don't block the floor+ const ability = process.ability.find((a) => a.active);+ if (!ability) return null;- const employeeAbility = await client- .from("employeeAbility")- .select("expiresAt")- .eq("employeeId", employeeId)- .eq("abilityId", ability.data.id)- .eq("companyId", companyId)- .maybeSingle();-- if (employeeAbility.error) {- return { eligible: true, reason: null };+ const [employeeAbility, training] = await Promise.all([+ client+ .from("employeeAbility")+ .select("expiresAt")+ .eq("employeeId", employeeId)+ .eq("abilityId", ability.id)+ .eq("companyId", companyId)+ .maybeSingle(),+ // Read alongside, so a refusal can name what to complete; a failed read+ // only drops the name.+ client+ .from("training")+ .select("name")+ .eq("grantsAbilityId", ability.id)+ .eq("companyId", companyId)+ .eq("status", "Active")+ .limit(1)+ .maybeSingle()+ ]);+ if (employeeAbility.error) return null;++ // Qualification is presence-based: the row existing means qualified,+ // subject only to expiry.+ const expiresAt = employeeAbility.data?.expiresAt ?? null;+ if (employeeAbility.data) {+ if (expiresAt === null) return null;+ const today = datetime+ .today(await getCompanyTimeZone(client, companyId))+ .toString();+ if (expiresAt > today) return null;}- // Qualification is presence-based: the row existing means qualified, subject- // only to expiry below.- if (!employeeAbility.data) {- return {- eligible: false,- reason: `Requires ${abilityName} — not qualified`- };- }+ return {+ policy: process.abilityPolicy,+ // The ability's name IS the process's name (abilities no longer store one).+ processName: process.name,+ expiredOn: expiresAt,+ trainingName: training.data?.name ?? null+ };+}- const todayDate = datetime- .today(await getCompanyTimeZone(client, companyId))- .toString();- if (- employeeAbility.data.expiresAt !== null &&- employeeAbility.data.expiresAt <= todayDate- ) {- return {- eligible: false,- reason: `Requires ${abilityName} — qualification expired ${employeeAbility.data.expiresAt}`- };- }+// English text for the server flash when work is refused. MES routes have no+// server-side translation; the page banner carries the translated text.+function abilityRefusalMessage(shortfall: AbilityShortfall): string {+ const how = shortfall.trainingName+ ? `Complete the ${shortfall.trainingName} training to get it.`+ : "Ask a supervisor to add it to your profile.";+ const expired = shortfall.expiredOn+ ? ` Your qualification expired on ${shortfall.expiredOn}.`+ : "";+ return `You need the ${shortfall.processName} ability to work on this operation.${expired} ${how}`;+}- return { eligible: true, reason: null };+// The refusal text when the operator may not do production work on this+// operation (the process's policy is 'Block'); null when the work may go ahead.+export async function abilityBlockRefusal(+ client: SupabaseClient<Database>,+ args: { operationId: string; employeeId: string; companyId: string }+): Promise<string | null> {+ const shortfall = await getAbilityShortfall(client, args);+ return shortfall?.policy === "Block"+ ? abilityRefusalMessage(shortfall)+ : null;}export async function getProcessesList(diff --git a/docs/content/docs/reference/mes.mdx b/docs/content/docs/reference/mes.mdxindex 9e6db71d0a..f9444619b3 100644--- a/docs/content/docs/reference/mes.mdx+++ b/docs/content/docs/reference/mes.mdx@@ -105,6 +105,15 @@ Material is consumed against an operation from the same panel. The **"Issue"** aTwo edge cases surface right in the flow rather than failing silently. Issuing expired stock is governed by a policy (`Warn`, `Block`, or `BlockWithOverride`); an overridable block asks for a **"Reason for issuing expired stock"**. And when a pick splits a batch, the station reports a **"Batch Split Occurred"** and offers to **"Convert to New Size/Revision"** or scrap the remainder.+### When you don't have the required ability++A process can require an ability (see [requiring an ability](/docs/reference/work-centers#requiring-an-ability)). When you open one of its operations without that ability, or with a qualification that has expired, a banner says so and names the training that grants it. The process decides what happens next:++- **Warn**: a yellow banner, **"You don't have the … ability"**, and you can work as usual.+- **Block**: a red banner, **"You can't work on this operation"**. Start, **"Log completed"**, Scrap, Rework, **"Mark as Done"**, recording steps, issuing material and inspection verdicts are disabled, and the timer does not start by itself. A timer that is already running can still be paused.++The same applies in the guided assembly view and the inspection view.+### Clocking in and outWhen the `timeCardEnabled` company setting is on, the sidebar carries a time card: **"Clock In"** and **"Clock Out"**, a **"My Hours"** view (a table of **Date**, **Clock In**, **Clock Out**, **Duration**), and a **"Clocked in since"** badge with the start time while a shift is open. Leave a shift open too long and Carbon nudges: after twelve hours it asks **"Forgot to Clock Out?"** with **"I'm Still Working"** or **"Set Clock Out"**. Time cards are labor time for payroll and presence; they are separate from the per-operation production events that drive job costing.@@ -163,6 +172,9 @@ The picking list is already `Completed` or `Cancelled`, which locks it — the f### Finish is blocked or warns ("Insufficient quantity" / "Steps are missing")**"Finish"** flips the operation to `Done`, but guards fire first. If reported quantity is short you'll see **"Insufficient quantity"**; if procedure steps aren't satisfied, **"Steps are missing"**. You can override with **"Finish Anyways"**. Separately, if tracked material was never issued, the operator must tick **"I understand and want to complete without issuing"** to proceed.+### "You can't work on this operation"+The operation's process requires an ability you don't hold, or your qualification expired, and the process is set to **Block**. Complete the training the banner names, or ask a supervisor to add the ability on your Abilities page. A planner can also switch the process to **Warn** under **Resources → Processes**.+### "Forgot to Clock Out?"A time card was left open for twelve hours or more. Choose **"I'm Still Working"** to keep the shift open, or **"Set Clock Out"** to close it. Time cards are labor/presence time for payroll — separate from the per-operation production events that drive job costing.diff --git a/docs/content/docs/reference/training.mdx b/docs/content/docs/reference/training.mdxindex 48516b0976..80053d9d87 100644--- a/docs/content/docs/reference/training.mdx+++ b/docs/content/docs/reference/training.mdx@@ -131,6 +131,8 @@ An **ability** is an employee's qualification for a process. A training can granTraining is one way to grant an ability; a manager can also add it by hand on the person's Abilities page. Removing a training completion does not remove the ability.+Each process that requires an ability decides whether an operator without it is only warned or blocked on the shop floor; see [requiring an ability](/docs/reference/work-centers#requiring-an-ability).+<Cards><Card title="People" href="/docs/reference/people">Employees, their abilities, and their training records.diff --git a/docs/content/docs/reference/work-centers.mdx b/docs/content/docs/reference/work-centers.mdxindex fee34564b3..d65172bcce 100644--- a/docs/content/docs/reference/work-centers.mdx+++ b/docs/content/docs/reference/work-centers.mdx@@ -25,6 +25,19 @@ A **work center** is a location-specific station, machine, or cell where <Term iA **process** is a capability a work center can perform; work centers and processes are many-to-many. A process is *Inside*, *Outside*, or both. **<Term id="outside-operation">Outside</Term>** processes are subcontracted, and suppliers attach to them for outside-processing <Term id="purchase-order">purchase orders</Term>.+### Requiring an ability++Turn on **"Requires Ability"** on a process and only qualified people can be scheduled for it and run it on the shop floor. The process has one ability of its own, with the same name; the toggle's description names it. People get it by completing a [training](/docs/reference/training#training-can-grant-an-ability) that grants it, or a manager adds it on their Abilities page.++While the toggle is on, **"If an operator isn't qualified"** decides what the shop floor does when someone without the ability opens an operation of this process:++<FieldTable>+ <Field name="Warn">The operator sees a warning on the operation and can still work. This is the default.</Field>+ <Field name="Block">The operator sees why they can't work on it, and every production action is refused: starting the timer, logging completed, scrap or rework, marking it done, recording steps, issuing material, and inspection verdicts. Pausing a timer that is already running, maintenance and quality issues stay available.</Field>+</FieldTable>++See [running an operation without the ability](/docs/reference/mes#when-you-dont-have-the-required-ability) for what the operator sees.+<Callout type="note">A work center is **not** a fixed asset. The machine you schedule production on (a work center) and the machine you depreciate (a fixed asset) are separate records in Carbon.diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.tsindex 6479906308..cd77188c03 100644--- a/packages/database/src/swagger-docs-schema.ts+++ b/packages/database/src/swagger-docs-schema.ts@@ -29808,6 +29808,9 @@ export default {{$ref: "#/parameters/rowFilter.process.batchRules"},+ {+ $ref: "#/parameters/rowFilter.process.abilityPolicy"+ },{$ref: "#/parameters/select"},@@ -29918,6 +29921,9 @@ export default {{$ref: "#/parameters/rowFilter.process.batchRules"},+ {+ $ref: "#/parameters/rowFilter.process.abilityPolicy"+ },{$ref: "#/parameters/preferReturn"}@@ -29982,6 +29988,9 @@ export default {{$ref: "#/parameters/rowFilter.process.batchRules"},+ {+ $ref: "#/parameters/rowFilter.process.abilityPolicy"+ },{$ref: "#/parameters/body.process"},@@ -78591,6 +78600,9 @@ export default {{$ref: "#/parameters/rowFilter.processes.batchRules"},+ {+ $ref: "#/parameters/rowFilter.processes.abilityPolicy"+ },{$ref: "#/parameters/rowFilter.processes.workCenters"},@@ -102393,9 +102405,6 @@ export default {{$ref: "#/parameters/rowFilter.companySettings.accountingActivatedBy"},- {- $ref: "#/parameters/rowFilter.companySettings.requireBackflushStorageUnit"- },{$ref: "#/parameters/rowFilter.companySettings.leaseIncrementalBorrowingRate"},@@ -102405,6 +102414,9 @@ export default {{$ref: "#/parameters/rowFilter.companySettings.leaseReminderDays"},+ {+ $ref: "#/parameters/rowFilter.companySettings.requireBackflushStorageUnit"+ },{$ref: "#/parameters/rowFilter.companySettings.preventNegativeBackflush"},@@ -102674,9 +102686,6 @@ export default {{$ref: "#/parameters/rowFilter.companySettings.accountingActivatedBy"},- {- $ref: "#/parameters/rowFilter.companySettings.requireBackflushStorageUnit"- },{$ref: "#/parameters/rowFilter.companySettings.leaseIncrementalBorrowingRate"},@@ -102686,6 +102695,9 @@ export default {{$ref: "#/parameters/rowFilter.companySettings.leaseReminderDays"},+ {+ $ref: "#/parameters/rowFilter.companySettings.requireBackflushStorageUnit"+ },{$ref: "#/parameters/rowFilter.companySettings.preventNegativeBackflush"},@@ -102909,9 +102921,6 @@ export default {{$ref: "#/parameters/rowFilter.companySettings.accountingActivatedBy"},- {- $ref: "#/parameters/rowFilter.companySettings.requireBackflushStorageUnit"- },{$ref: "#/parameters/rowFilter.companySettings.leaseIncrementalBorrowingRate"},@@ -102921,6 +102930,9 @@ export default {{$ref: "#/parameters/rowFilter.companySettings.leaseReminderDays"},+ {+ $ref: "#/parameters/rowFilter.companySettings.requireBackflushStorageUnit"+ },{$ref: "#/parameters/rowFilter.companySettings.preventNegativeBackflush"},@@ -132129,7 +132141,8 @@ export default {"active","requiresAbility","batchable",- "batchType"+ "batchType",+ "abilityPolicy"],properties: {id: {@@ -132232,6 +132245,12 @@ export default {description:"Per-dimension batch compatibility levels (must|guide|ignore); NULL = defaults (substance/grade/dimension guide, form/finish/item ignore).",format: "jsonb"+ },+ abilityPolicy: {+ default: "Warn",+ enum: ["Warn", "Block"],+ format: 'public."processAbilityPolicy"',+ type: "string"}},type: "object"@@ -155254,6 +155273,11 @@ export default {batchRules: {format: "jsonb"},+ abilityPolicy: {+ enum: ["Warn", "Block"],+ format: 'public."processAbilityPolicy"',+ type: "string"+ },workCenters: {format: "text[]",items: {@@ -166787,10 +166811,10 @@ export default {"leaseDefaultDiscountRate","invoiceAutomation","invoiceNotificationGroup",- "requireBackflushStorageUnit","leaseIncrementalBorrowingRate","leaseShortTermExpedient","leaseReminderDays",+ "requireBackflushStorageUnit","preventNegativeBackflush","receiptQuantitiesStartAtZero"],@@ -167166,11 +167190,6 @@ export default {format: "text",type: "string"},- requireBackflushStorageUnit: {- default: false,- format: "boolean",- type: "boolean"- },leaseIncrementalBorrowingRate: {default: 6,format: "numeric",@@ -167186,6 +167205,11 @@ export default {format: "integer",type: "integer"},+ requireBackflushStorageUnit: {+ default: false,+ format: "boolean",+ type: "boolean"+ },preventNegativeBackflush: {default: true,format: "boolean",@@ -183853,6 +183877,12 @@ export default {in: "query",type: "string"},+ "rowFilter.process.abilityPolicy": {+ name: "abilityPolicy",+ required: false,+ in: "query",+ type: "string"+ },"body.supplierShipping": {name: "supplierShipping",description: "supplierShipping",@@ -209450,6 +209480,12 @@ export default {in: "query",type: "string"},+ "rowFilter.processes.abilityPolicy": {+ name: "abilityPolicy",+ required: false,+ in: "query",+ type: "string"+ },"rowFilter.processes.workCenters": {name: "workCenters",required: false,@@ -222766,12 +222802,6 @@ export default {in: "query",type: "string"},- "rowFilter.companySettings.requireBackflushStorageUnit": {- name: "requireBackflushStorageUnit",- required: false,- in: "query",- type: "string"- },"rowFilter.companySettings.leaseIncrementalBorrowingRate": {name: "leaseIncrementalBorrowingRate",required: false,@@ -222790,6 +222820,12 @@ export default {in: "query",type: "string"},+ "rowFilter.companySettings.requireBackflushStorageUnit": {+ name: "requireBackflushStorageUnit",+ required: false,+ in: "query",+ type: "string"+ },"rowFilter.companySettings.preventNegativeBackflush": {name: "preventNegativeBackflush",required: false,diff --git a/packages/database/src/types.ts b/packages/database/src/types.tsindex 0f39a34359..f9f528e14e 100644--- a/packages/database/src/types.ts+++ b/packages/database/src/types.ts@@ -45825,6 +45825,7 @@ export type Database = {}process: {Row: {+ abilityPolicy: Database["public"]["Enums"]["processAbilityPolicy"]active: booleanbatchable: booleanbatchRules: Json | null@@ -45844,6 +45845,7 @@ export type Database = {updatedBy: string | null}Insert: {+ abilityPolicy?: Database["public"]["Enums"]["processAbilityPolicy"]active?: booleanbatchable?: booleanbatchRules?: Json | null@@ -45863,6 +45865,7 @@ export type Database = {updatedBy?: string | null}Update: {+ abilityPolicy?: Database["public"]["Enums"]["processAbilityPolicy"]active?: booleanbatchable?: booleanbatchRules?: Json | null@@ -82226,6 +82229,9 @@ export type Database = {}processes: {Row: {+ abilityPolicy:+ | Database["public"]["Enums"]["processAbilityPolicy"]+ | nullactive: boolean | nullbatchable: boolean | nullbatchRules: Json | null@@ -95498,6 +95504,7 @@ export type Database = {| "File"| "Task"| "Inspection"+ processAbilityPolicy: "Warn" | "Block"productionEventType: "Setup" | "Labor" | "Machine"productionQuantityType: "Rework" | "Scrap" | "Production"purchaseInvoiceStatus:@@ -97057,6 +97064,7 @@ export const Constants = {"Task","Inspection",],+ processAbilityPolicy: ["Warn", "Block"],productionEventType: ["Setup", "Labor", "Machine"],productionQuantityType: ["Rework", "Scrap", "Production"],purchaseInvoiceStatus: [diff --git a/packages/database/supabase/migrations/20261022063357_process-ability-policy.sql b/packages/database/supabase/migrations/20261022063357_process-ability-policy.sqlnew file mode 100644index 0000000000..8652476bc4--- /dev/null+++ b/packages/database/supabase/migrations/20261022063357_process-ability-policy.sql@@ -0,0 +1,36 @@+-- What MES does when an operator works on an operation whose process requires+-- an ability they do not hold (no employeeAbility row, or an expired one).+-- 'Warn' shows a banner and lets them work; 'Block' refuses all production+-- work on the operation. Only read while "requiresAbility" is on.+DO $$ BEGIN+ CREATE TYPE "processAbilityPolicy" AS ENUM ('Warn', 'Block');+EXCEPTION WHEN duplicate_object THEN NULL; END $$;++ALTER TABLE "process"+ ADD COLUMN IF NOT EXISTS "abilityPolicy" "processAbilityPolicy" NOT NULL DEFAULT 'Warn';++-- Re-declare the processes view so p.* picks up the new column (it lands+-- before the joined columns, so CREATE OR REPLACE cannot add it).+DROP VIEW IF EXISTS "processes";+CREATE VIEW "processes" WITH(SECURITY_INVOKER=true) AS+ SELECT+ p.*,+ wcp."workCenters",+ sp."suppliers"+ FROM "process" p+ LEFT JOIN (+ SELECT+ "processId",+ array_agg("workCenterId"::text) as "workCenters"+ FROM "workCenterProcess" wcp+ INNER JOIN "workCenter" wc ON wcp."workCenterId" = wc.id+ GROUP BY "processId"+ ) wcp ON p.id = wcp."processId"+ LEFT JOIN (+ SELECT+ "processId",+ jsonb_agg(jsonb_build_object('id', sp."id", 'name', s.name)) as "suppliers"+ FROM "supplierProcess" sp+ INNER JOIN "supplier" s ON sp."supplierId" = s.id+ GROUP BY "processId"+ ) sp ON p.id = sp."processId";diff --git a/packages/jobs/manifests/schema.json b/packages/jobs/manifests/schema.jsonindex 5fd82b1077..337a272d9f 100644--- a/packages/jobs/manifests/schema.json+++ b/packages/jobs/manifests/schema.json@@ -1,11 +1,11 @@{"kind": "carbon-company-backup","version": 1,- "schemaVersion": "20261020051356",+ "schemaVersion": "20261022063357","sourceCompanyId": "schema-baseline","sourceCompanyGroupId": null,"sourceCompanyName": null,- "exportedAt": "2026-10-20T05:29:25.062Z",+ "exportedAt": "2026-10-22T08:22:55.223Z","exportedBy": "schema-baseline","label": "schema baseline","includeStorage": "none",@@ -1861,7 +1861,8 @@"requiresAbility","batchable","batchType",- "batchRules"+ "batchRules",+ "abilityPolicy"]},{diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.poindex c1cba7fb22..b2e34897ec 100644--- a/packages/locale/locales/de/erp.po+++ b/packages/locale/locales/de/erp.po@@ -4217,6 +4217,9 @@ msgstr "Blind"msgid "Blind Count"msgstr "Blinde Inventur"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "Mit Fehler blockieren"@@ -8124,6 +8127,9 @@ msgstr "Dollarauslastung"msgid "Don't Cancel"msgstr "Nicht abbrechen"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "Keine Seriennummer vorhanden?"@@ -11334,6 +11340,9 @@ msgstr "IDs und Beschreibungen werden für Rohstoffe generiert."msgid "If"msgstr "Wenn"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "Wenn die Abschreibung bereits durchgelaufen ist, holt der nächste Durchlauf die Monate nach, in denen eine lineare Anlage zum alten Kostensatz abgeschrieben wurde."@@ -15762,6 +15771,9 @@ msgstr "Nur Verfahrensanweisungen im Entwurf sind bearbeitbar. Erstellen Sie einmsgid "Only employees can post receipts."msgstr "Nur Mitarbeiter können Wareneingänge buchen."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "Nur leere, offene Perioden können gelöscht werden."@@ -21187,6 +21199,9 @@ msgstr "Zeigen Sie eine lesbare Kundennummern-Spalte in der Kundenliste, Kundenfmsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "Zeigen Sie eine lesbare Lieferanten-ID-Spalte in der Lieferantenliste, Lieferantenformularen und Dropdowns an. Lieferanten werden intern in jedem Fall identifiziert."+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "Alles zeigen"diff --git a/packages/locale/locales/de/mes.po b/packages/locale/locales/de/mes.poindex db330a4e8c..7ec41d8831 100644--- a/packages/locale/locales/de/mes.po+++ b/packages/locale/locales/de/mes.po@@ -226,6 +226,9 @@ msgstr "Möchten Sie diese Seite wirklich verlassen?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "Möchten Sie diesen Arbeitsgang wirklich als erledigt markieren? Dies beendet alle aktiven Produktionsereignisse für diesen Arbeitsgang."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "Montageschritte"@@ -451,6 +454,9 @@ msgstr "Charge abschließen"msgid "Complete passed"msgstr "Bestandene abgeschlossen"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "Abgeschlossen"@@ -2257,9 +2263,21 @@ msgstr "Notiz schreiben…"msgid "Yes"msgstr "Ja"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "Sie sind seit {hoursElapsed} Stunden eingestempelt. Haben Sie das Ausstempeln vergessen?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "Ihr Konto ist noch nicht Teil eines Unternehmens. Schließen Sie das Onboarding in Carbon ERP ab, um fortzufahren."diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.poindex 39a2f41ebd..3d523bda5d 100644--- a/packages/locale/locales/en/erp.po+++ b/packages/locale/locales/en/erp.po@@ -4217,6 +4217,9 @@ msgstr "Blind"msgid "Blind Count"msgstr "Blind Count"+msgid "Block"+msgstr "Block"+msgid "Block with an error"msgstr "Block with an error"@@ -8124,6 +8127,9 @@ msgstr "Dollar Utilization"msgid "Don't Cancel"msgstr "Don't Cancel"+msgid "Don't let them work on this process until they have the ability."+msgstr "Don't let them work on this process until they have the ability."+msgid "Don't see a serial number?"msgstr "Don't see a serial number?"@@ -11334,6 +11340,9 @@ msgstr "IDs and descriptions are generated for raw materials."msgid "If"msgstr "If"+msgid "If an operator isn't qualified"+msgstr "If an operator isn't qualified"+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."@@ -15762,6 +15771,9 @@ msgstr "Only Draft procedures are editable. Create a new version to change an Acmsgid "Only employees can post receipts."msgstr "Only employees can post receipts."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr "Only employees with the {processName} ability can be scheduled for and run this process"+msgid "Only empty, open periods can be deleted."msgstr "Only empty, open periods can be deleted."@@ -21187,6 +21199,9 @@ msgstr "Show a readable Customer ID column on the customer list, customer forms,msgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."+msgid "Show a warning on the shop floor, but let them work."+msgstr "Show a warning on the shop floor, but let them work."+msgid "Show All"msgstr "Show All"diff --git a/packages/locale/locales/en/mes.po b/packages/locale/locales/en/mes.poindex d6bf15cf9c..7267fff458 100644--- a/packages/locale/locales/en/mes.po+++ b/packages/locale/locales/en/mes.po@@ -226,6 +226,9 @@ msgstr "Are you sure you want to leave this page?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "Are you sure you want to mark this operation as done? This will end all active production events for this operation."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr "Ask a supervisor to add the {processName} ability to your profile."+msgid "Assembly steps"msgstr "Assembly steps"@@ -451,6 +454,9 @@ msgstr "Complete Batch"msgid "Complete passed"msgstr "Complete passed"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr "Complete the {trainingName} training to get the {processName} ability."+msgid "Completed"msgstr "Completed"@@ -2257,9 +2263,21 @@ msgstr "Write a note…"msgid "Yes"msgstr "Yes"+msgid "You can still start this operation."+msgstr "You can still start this operation."++msgid "You can't work on this operation"+msgstr "You can't work on this operation"++msgid "You don't have the {processName} ability"+msgstr "You don't have the {processName} ability"+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr "Your {processName} qualification expired on {expiredDate}."+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.poindex ffb0800c61..8a79e468c4 100644--- a/packages/locale/locales/es/erp.po+++ b/packages/locale/locales/es/erp.po@@ -4217,6 +4217,9 @@ msgstr "Ciego"msgid "Blind Count"msgstr "Conteo Ciego"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "Bloquear con un error"@@ -8124,6 +8127,9 @@ msgstr "Utilización en dólares"msgid "Don't Cancel"msgstr "No Cancelar"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "¿No ve un número de serie?"@@ -11334,6 +11340,9 @@ msgstr "Los IDs y descripciones se generan para materias primas."msgid "If"msgstr "Si"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "Si la depreciación ya se ha ejecutado, la próxima ejecución compensa los meses que un activo de Línea recta registró con el costo anterior."@@ -15762,6 +15771,9 @@ msgstr "Solo se pueden editar los procedimientos en Borrador. Crear una nueva vemsgid "Only employees can post receipts."msgstr "Solo los empleados pueden contabilizar recepciones."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "Solo se pueden eliminar los períodos vacíos y abiertos."@@ -21187,6 +21199,9 @@ msgstr "Mostrar una columna de ID de cliente legible en la lista de clientes, fomsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "Mostrar una columna de ID de Proveedor legible en la lista de proveedores, formularios de proveedores y menús desplegables. Los proveedores se identifican internamente de cualquier forma."+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "Mostrar todo"diff --git a/packages/locale/locales/es/mes.po b/packages/locale/locales/es/mes.poindex 266575a2b8..f2aa556d7a 100644--- a/packages/locale/locales/es/mes.po+++ b/packages/locale/locales/es/mes.po@@ -226,6 +226,9 @@ msgstr "¿Estás seguro de que quieres salir de esta página?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "¿Está seguro de que desea marcar esta operación como hecha? Esto terminará todos los eventos de producción activos para esta operación."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "Pasos de montaje"@@ -451,6 +454,9 @@ msgstr "Completar Lote"msgid "Complete passed"msgstr "Completar superados"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "Completado"@@ -2257,9 +2263,21 @@ msgstr "Escribir una nota…"msgid "Yes"msgstr "Sí"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "Ha estado fichado durante {hoursElapsed} horas. ¿Olvidó fichar salida?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "Tu cuenta aún no forma parte de una empresa. Completa la incorporación en Carbon ERP para continuar."diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.poindex 1094c1e2c1..1ea098559e 100644--- a/packages/locale/locales/fr/erp.po+++ b/packages/locale/locales/fr/erp.po@@ -4217,6 +4217,9 @@ msgstr "Aveugle"msgid "Blind Count"msgstr "Comptage à l'aveugle"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "Bloquer avec une erreur"@@ -8124,6 +8127,9 @@ msgstr "Utilisation en dollars"msgid "Don't Cancel"msgstr "Ne pas annuler"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "Vous ne voyez pas de numéro de série ?"@@ -11334,6 +11340,9 @@ msgstr "Les IDs et descriptions sont générés pour les matières premières."msgid "If"msgstr "Si"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "Si l'amortissement a déjà été exécuté, le prochain calcul rattrape les mois qu'un actif linéaire a amortis à l'ancien coût."@@ -15762,6 +15771,9 @@ msgstr "Seules les procédures en brouillon sont modifiables. Créez une nouvellmsgid "Only employees can post receipts."msgstr "Seuls les employés peuvent comptabiliser les réceptions."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "Seules les périodes vides et ouvertes peuvent être supprimées."@@ -21187,6 +21199,9 @@ msgstr "Afficher une colonne ID client lisible sur la liste des clients, les formsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "Afficher une colonne ID Fournisseur lisible sur la liste des fournisseurs, les formulaires de fournisseur et les listes déroulantes. Les fournisseurs sont toujours identifiés en interne de toute façon."+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "Tout afficher"diff --git a/packages/locale/locales/fr/mes.po b/packages/locale/locales/fr/mes.poindex 7fc88c51a4..82e3ddbfbc 100644--- a/packages/locale/locales/fr/mes.po+++ b/packages/locale/locales/fr/mes.po@@ -226,6 +226,9 @@ msgstr "Êtes-vous sûr de vouloir quitter cette page ?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "Êtes-vous sûr de vouloir marquer cette opération comme terminée ? Cela mettra fin à tous les événements de production actifs pour cette opération."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "Étapes d'assemblage"@@ -451,6 +454,9 @@ msgstr "Terminer le lot"msgid "Complete passed"msgstr "Terminer les réussis"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "Terminé"@@ -2257,9 +2263,21 @@ msgstr "Écrire une note…"msgid "Yes"msgstr "Oui"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "Vous êtes pointé(e) depuis {hoursElapsed} heures. Avez-vous oublié le pointage fin ?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "Votre compte ne fait pas encore partie d'une société. Terminez l'onboarding dans Carbon ERP pour continuer."diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.poindex 7cedaecf9a..e5b893efbc 100644--- a/packages/locale/locales/hi/erp.po+++ b/packages/locale/locales/hi/erp.po@@ -4217,6 +4217,9 @@ msgstr "ब्लाइंड"msgid "Blind Count"msgstr "ब्लाइंड काउंट"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "त्रुटि के साथ ब्लॉक करें"@@ -8124,6 +8127,9 @@ msgstr "डॉलर उपयोग"msgid "Don't Cancel"msgstr "रद्द न करें"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "सीरियल नंबर नहीं दिख रहा?"@@ -11334,6 +11340,9 @@ msgstr "कच्चे माल के लिए ID और विवरण उmsgid "If"msgstr "यदि"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "यदि मूल्यह्रास पहले ही चला है, तो अगला रन उन महीनों को पकड़ता है जो एक सीधी रेखा परिसंपत्ति को पुरानी लागत पर ले गए।"@@ -15762,6 +15771,9 @@ msgstr "केवल ड्राफ्ट कार्यविधियाँmsgid "Only employees can post receipts."msgstr "केवल कर्मचारी प्राप्ति पोस्ट कर सकते हैं।"+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "केवल खाली, खुली अवधियों को हटाया जा सकता है।"@@ -21187,6 +21199,9 @@ msgstr "ग्राहक सूची, ग्राहक फॉर्म औmsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "आपूर्तिकर्ता सूची, आपूर्तिकर्ता फॉर्म और ड्रॉपडाउन पर एक पठनीय आपूर्तिकर्ता ID कॉलम दिखाएं। आपूर्तिकर्ता अभी भी किसी भी तरह से आंतरिक रूप से पहचाने जाते हैं।"+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "सभी दिखाएँ"diff --git a/packages/locale/locales/hi/mes.po b/packages/locale/locales/hi/mes.poindex c3cae44041..dbec9011d4 100644--- a/packages/locale/locales/hi/mes.po+++ b/packages/locale/locales/hi/mes.po@@ -226,6 +226,9 @@ msgstr "क्या आप वाकई इस पृष्ठ को छोडmsgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "क्या आप सुनिश्चित हैं कि आप इस ऑपरेशन को पूर्ण के रूप में चिह्नित करना चाहते हैं? यह इस ऑपरेशन के लिए सभी सक्रिय उत्पादन इवेंट को समाप्त कर देगा।"+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "असेंबली चरण"@@ -451,6 +454,9 @@ msgstr "बैच पूरा करें"msgid "Complete passed"msgstr "उत्तीर्ण को पूर्ण करें"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "पूर्ण"@@ -2257,9 +2263,21 @@ msgstr "एक नोट लिखें…"msgid "Yes"msgstr "हां"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "आप {hoursElapsed} घंटों से कार्य पर हैं। क्या आप कार्य समाप्त करना भूल गए?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "आपका खाता अभी तक किसी कंपनी का हिस्सा नहीं है। जारी रखने के लिए Carbon ERP में ऑनबोर्डिंग पूर्ण करें।"diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.poindex 59a618a63d..a113365676 100644--- a/packages/locale/locales/it/erp.po+++ b/packages/locale/locales/it/erp.po@@ -4217,6 +4217,9 @@ msgstr "Cieco"msgid "Blind Count"msgstr "Conteggio Cieco"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "Blocca con un errore"@@ -8124,6 +8127,9 @@ msgstr "Utilizzo in dollari"msgid "Don't Cancel"msgstr "Non annullare"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "Non vedi un numero di serie?"@@ -11334,6 +11340,9 @@ msgstr "Gli ID e le descrizioni vengono generati per le materie prime."msgid "If"msgstr "Se"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "Se l'ammortamento è già stato eseguito, la prossima esecuzione recupera i mesi che un asset con Quote costanti ha preso al vecchio costo."@@ -15762,6 +15771,9 @@ msgstr "Solo le procedure in bozza sono modificabili. Crea una nuova versione pemsgid "Only employees can post receipts."msgstr "Solo i dipendenti possono registrare entrate merci."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "Solo i periodi aperti e vuoti possono essere eliminati."@@ -21187,6 +21199,9 @@ msgstr "Mostra una colonna ID Cliente leggibile nell'elenco clienti, nei modulimsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "Mostra una colonna ID Fornitore leggibile nell'elenco dei fornitori, nei moduli fornitori e nei menu a discesa. I fornitori sono comunque identificati internamente in entrambi i casi."+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "Mostra tutto"diff --git a/packages/locale/locales/it/mes.po b/packages/locale/locales/it/mes.poindex a0442afb78..9cbb2e11fc 100644--- a/packages/locale/locales/it/mes.po+++ b/packages/locale/locales/it/mes.po@@ -226,6 +226,9 @@ msgstr "Sei sicuro di voler lasciare questa pagina?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "Sei sicuro di voler segnare questa operazione come completata? Questo terminerà tutti gli eventi di produzione attivi per questa operazione."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "Passi di assemblaggio"@@ -451,6 +454,9 @@ msgstr "Completa Lotto"msgid "Complete passed"msgstr "Completa i superati"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "Completato"@@ -2257,9 +2263,21 @@ msgstr "Scrivi una Nota…"msgid "Yes"msgstr "Sì"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "Sei timbrato da {hoursElapsed} ore. Hai dimenticato di timbra fine?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "Il tuo account non è ancora parte di un'azienda. Completa l'onboarding in Carbon ERP per continuare."diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.poindex bb7e79bc28..b3e8dcca8e 100644--- a/packages/locale/locales/ja/erp.po+++ b/packages/locale/locales/ja/erp.po@@ -4217,6 +4217,9 @@ msgstr "ブラインド"msgid "Blind Count"msgstr "ブラインドカウント"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "エラーでブロック"@@ -8124,6 +8127,9 @@ msgstr "ドル利用額"msgid "Don't Cancel"msgstr "キャンセルしない"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "シリアル番号が見つかりませんか?"@@ -11334,6 +11340,9 @@ msgstr "IDと説明は原材料に対して生成されます。"msgid "If"msgstr "条件"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "減価償却が既に実行されている場合、次回の減価償却実行時に定額法資産が旧原価で計上していた月分が埋め合わされます。"@@ -15762,6 +15771,9 @@ msgstr "下書きの手順書のみが編集可能です。有効またはアーmsgid "Only employees can post receipts."msgstr "従業員のみが入荷を転記することができます。"+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "空のオープン期間のみ削除できます。"@@ -21187,6 +21199,9 @@ msgstr "得意先リスト、得意先フォーム、ドロップダウンで読msgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "仕入先リスト、仕入先フォーム、ドロップダウンで読みやすい仕入先IDカラムを表示します。仕入先はどちらの方法でも内部的に識別されます。"+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "すべて表示"diff --git a/packages/locale/locales/ja/mes.po b/packages/locale/locales/ja/mes.poindex ee1946a7b1..75d61210c9 100644--- a/packages/locale/locales/ja/mes.po+++ b/packages/locale/locales/ja/mes.po@@ -226,6 +226,9 @@ msgstr "このページを離れてもよろしいですか?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "この工程を完了としてマークしてもよろしいですか?これにより、この工程のすべてのアクティブな生産イベントが終了します。"+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "組立ステップ"@@ -451,6 +454,9 @@ msgstr "バッチを完了"msgid "Complete passed"msgstr "合格を完了する"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "完了済み"@@ -2257,9 +2263,21 @@ msgstr "メモを書く…"msgid "Yes"msgstr "はい"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "作業開始から{hoursElapsed}時間が経過しています。作業終了を忘れていませんか?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "あなたのアカウントはまだ会社に属していません。継続するには、Carbon ERP でオンボーディングを完了してください。"diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.poindex 9618c9532d..374424a45c 100644--- a/packages/locale/locales/ko/erp.po+++ b/packages/locale/locales/ko/erp.po@@ -4217,6 +4217,9 @@ msgstr "맹검"msgid "Blind Count"msgstr "블라인드 실사"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "오류로 차단"@@ -8124,6 +8127,9 @@ msgstr "달러 활용률"msgid "Don't Cancel"msgstr "취소하지 않음"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "시리얼 번호가 보이지 않으세요?"@@ -11334,6 +11340,9 @@ msgstr "원자재에 대한 ID와 설명이 자동으로 생성됩니다."msgid "If"msgstr "만약"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "감가상각이 이미 실행된 경우, 다음 실행 시 정액법 자산이 이전 원가로 소요한 개월 수의 감가상각을 보정합니다."@@ -15762,6 +15771,9 @@ msgstr "초안 절차서만 편집 가능합니다. 활성 또는 보관됨 절msgid "Only employees can post receipts."msgstr "직원만 입고를 전기할 수 있습니다."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "비어있는 열린 기간만 삭제할 수 있습니다."@@ -21187,6 +21199,9 @@ msgstr "고객 목록, 고객 양식, 드롭다운에 읽기 쉬운 고객 IDmsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "공급업체 목록, 공급업체 양식, 드롭다운에 읽기 쉬운 공급업체 ID 열을 표시합니다. 어느 쪽이든 공급업체는 내부적으로 동일하게 식별됩니다."+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "모두 표시"diff --git a/packages/locale/locales/ko/mes.po b/packages/locale/locales/ko/mes.poindex a23b726427..2bb228c396 100644--- a/packages/locale/locales/ko/mes.po+++ b/packages/locale/locales/ko/mes.po@@ -226,6 +226,9 @@ msgstr "이 페이지를 나가시겠습니까?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "이 공정작업을 완료로 표시하시겠습니까? 이 작업은 해당 공정작업의 모든 진행 중인 생산 이벤트를 종료합니다."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "조립 단계"@@ -451,6 +454,9 @@ msgstr "배치 완료"msgid "Complete passed"msgstr "완료 처리 통과"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "완료됨"@@ -2257,9 +2263,21 @@ msgstr "메모 작성…"msgid "Yes"msgstr "예"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "{hoursElapsed}시간 동안 작업 중입니다. 작업 종료를 잊으셨나요?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "아직 회사에 속하지 않은 계정입니다. Carbon ERP에서 온보딩을 완료해 주시기 바랍니다."diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.poindex 3860592e05..4fdc35301f 100644--- a/packages/locale/locales/pl/erp.po+++ b/packages/locale/locales/pl/erp.po@@ -4217,6 +4217,9 @@ msgstr "Bez wglądu"msgid "Blind Count"msgstr "Niewidoczna inwentaryzacja"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "Zablokuj z błędem"@@ -8124,6 +8127,9 @@ msgstr "Wykorzystanie dolara"msgid "Don't Cancel"msgstr "Nie anuluj"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "Nie widzisz numeru seryjnego?"@@ -11334,6 +11340,9 @@ msgstr "Identyfikatory i opisy są generowane dla surowców."msgid "If"msgstr "Jeśli"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "Jeśli amortyzacja już się uruchomiła, następny przebieg uwzględni wyrównanie za miesiące, w których ta pozycja została amortyzowana metodą liniową przy starym koszcie."@@ -15762,6 +15771,9 @@ msgstr "Edytowalne są tylko procedury w wersji roboczej. Utwórz nową wersję,msgid "Only employees can post receipts."msgstr "Tylko pracownicy mogą zaksięgować przyjęcia."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "Usunięte mogą być tylko puste, otwarte okresy."@@ -21187,6 +21199,9 @@ msgstr "Pokaż kolumnę czytelnego identyfikatora klienta na liście klientów,msgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "Pokaż kolumnę czytelnego identyfikatora dostawcy na liście dostawców, formularzach dostawcy i listach rozwijanych. Dostawcy są nadal identyfikowani wewnętrznie w każdym przypadku."+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "Pokaż wszystko"diff --git a/packages/locale/locales/pl/mes.po b/packages/locale/locales/pl/mes.poindex 30e1d7ce69..38a8eb3313 100644--- a/packages/locale/locales/pl/mes.po+++ b/packages/locale/locales/pl/mes.po@@ -226,6 +226,9 @@ msgstr "Czy na pewno chcesz opuścić tę stronę?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "Czy na pewno chcesz oznaczyć tę operację jako gotową? Spowoduje to zakończenie wszystkich aktywnych zdarzeń produkcyjnych dla tej operacji."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "Kroki montażu"@@ -451,6 +454,9 @@ msgstr "Zakończ partię"msgid "Complete passed"msgstr "Zakończ zaliczone"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "Ukończone"@@ -2257,9 +2263,21 @@ msgstr "Napisz notatkę…"msgid "Yes"msgstr "Tak"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "Pracujesz od {hoursElapsed} godzin. Zapomniałeś o zakończeniu pracy?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "Twoje konto nie należy jeszcze do żadnej firmy. Ukończ wdrażanie w Carbon ERP, aby kontynuować."diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.poindex 811a7cc426..6e3d34e5b6 100644--- a/packages/locale/locales/pt/erp.po+++ b/packages/locale/locales/pt/erp.po@@ -4217,6 +4217,9 @@ msgstr "Às cegas"msgid "Blind Count"msgstr "Contagem Cega"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "Bloquear com um erro"@@ -8124,6 +8127,9 @@ msgstr "Utilização em dólares"msgid "Don't Cancel"msgstr "Não Cancelar"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "Não vê um número de série?"@@ -11334,6 +11340,9 @@ msgstr "IDs e descrições são gerados para matérias-primas."msgid "If"msgstr "Se"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "Se a depreciação já foi executada, a próxima execução compensa os meses em que um ativo Linear foi depreciado com o custo antigo."@@ -15762,6 +15771,9 @@ msgstr "Apenas os procedimentos em Rascunho são editáveis. Crie uma nova versmsgid "Only employees can post receipts."msgstr "Apenas funcionários podem contabilizar recebimentos."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "Apenas períodos vazios e abertos podem ser deletados."@@ -21187,6 +21199,9 @@ msgstr "Mostrar uma coluna de ID de Cliente legível na lista de clientes, formumsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "Mostrar uma coluna de ID de Fornecedor legível na lista de fornecedores, formulários de fornecedor e menus suspensos. Os fornecedores ainda são identificados internamente de qualquer forma."+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "Mostrar tudo"diff --git a/packages/locale/locales/pt/mes.po b/packages/locale/locales/pt/mes.poindex 955402a435..b6800174d2 100644--- a/packages/locale/locales/pt/mes.po+++ b/packages/locale/locales/pt/mes.po@@ -226,6 +226,9 @@ msgstr "Tem certeza que deseja sair desta página?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "Tem a certeza de que deseja marcar esta operação como concluída? Isto terminará todos os eventos de produção ativos para esta operação."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "Etapas de montagem"@@ -451,6 +454,9 @@ msgstr "Completar Lote"msgid "Complete passed"msgstr "Completar aprovados"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "Concluído"@@ -2257,9 +2263,21 @@ msgstr "Escrever uma observação…"msgid "Yes"msgstr "Sim"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "Você está apontando há {hoursElapsed} horas. Você esqueceu de apontar fim?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "Sua conta ainda não faz parte de uma empresa. Conclua o onboarding no Carbon ERP para continuar."diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.poindex 7a60c1615e..4cdfb5218e 100644--- a/packages/locale/locales/ru/erp.po+++ b/packages/locale/locales/ru/erp.po@@ -4217,6 +4217,9 @@ msgstr "Слепой"msgid "Blind Count"msgstr "Слепой подсчет"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "Заблокировать с ошибкой"@@ -8124,6 +8127,9 @@ msgstr "Использование в долларах"msgid "Don't Cancel"msgstr "Не отменять"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "Не видите серийный номер?"@@ -11334,6 +11340,9 @@ msgstr "Идентификаторы и описания генерируютсmsgid "If"msgstr "Если"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "Если амортизация уже была рассчитана, следующий расчет выровняет периоды, в течение которых актив с линейным методом амортизации учитывался по старой себестоимости."@@ -15762,6 +15771,9 @@ msgstr "Редактировать можно только процедуры вmsgid "Only employees can post receipts."msgstr "Только сотрудники могут провести поступление."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "Удалять можно только пустые открытые периоды."@@ -21187,6 +21199,9 @@ msgstr "Показывать столбец с читаемым ID Покупаmsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "Показать читаемый столбец ID поставщика в списке поставщиков, формах поставщиков и раскрывающихся списках. Поставщики по-прежнему идентифицируются внутри системы в любом случае."+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "Показать все"diff --git a/packages/locale/locales/ru/mes.po b/packages/locale/locales/ru/mes.poindex 2fbbddeb59..23a4be230b 100644--- a/packages/locale/locales/ru/mes.po+++ b/packages/locale/locales/ru/mes.po@@ -226,6 +226,9 @@ msgstr "Вы уверены, что хотите покинуть эту стрmsgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "Вы уверены, что хотите отметить эту операцию как выполненную? Это завершит все активные производственные события для этой операции."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "Шаги сборки"@@ -451,6 +454,9 @@ msgstr "Завершить партию"msgid "Complete passed"msgstr "Завершить пройденные"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "Завершено"@@ -2257,9 +2263,21 @@ msgstr "Напишите примечание…"msgid "Yes"msgstr "Да"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "Вы находились на работе {hoursElapsed} часов. Вы забыли записать окончание работы?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "Ваша учетная запись еще не входит ни в одну Организацию. Завершите подготовку к работе в Carbon ERP, чтобы продолжить."diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.poindex 856bdb257e..ab41d23e18 100644--- a/packages/locale/locales/tr/erp.po+++ b/packages/locale/locales/tr/erp.po@@ -4217,6 +4217,9 @@ msgstr "Kör"msgid "Blind Count"msgstr "Kör Sayımı"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "Hata ile engelle"@@ -8124,6 +8127,9 @@ msgstr "Dolar Kullanım Oranı"msgid "Don't Cancel"msgstr "İptal Etme"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "Seri numarası göremiyorsunuz?"@@ -11334,6 +11340,9 @@ msgstr "Kimlikler ve açıklamalar hammadde için oluşturulur."msgid "If"msgstr "Eğer"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "Amortisman zaten çalıştıysa, sonraki çalıştırma Doğrusal bir varlığın eski maliyette harcadığı ayları yakalama yapar."@@ -15762,6 +15771,9 @@ msgstr "Yalnızca Taslak prosedürler düzenlenebilir. Aktif veya Arşivlenmişmsgid "Only employees can post receipts."msgstr "Yalnızca çalışanlar mal kabul muhasebeleştirebilir."+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "Yalnızca boş, açık dönemler silinebilir."@@ -21187,6 +21199,9 @@ msgstr "Müşteri listesinde, müşteri formlarında ve açılır menülerde okumsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "Tedarikçi listesinde, tedarikçi formlarında ve açılır menülerde okunabilir bir Tedarikçi Kimliği sütunu gösterir. Tedarikçiler her iki durumda da dahili olarak tanımlanmaya devam eder."+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "Tümünü göster"diff --git a/packages/locale/locales/tr/mes.po b/packages/locale/locales/tr/mes.poindex e7f115018d..d7f38cd9ab 100644--- a/packages/locale/locales/tr/mes.po+++ b/packages/locale/locales/tr/mes.po@@ -226,6 +226,9 @@ msgstr "Bu sayfadan ayrılmak istediğinizden emin misiniz?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "Bu işlemi tamamlandı olarak işaretlemek istediğinizden emin misiniz? Bu, bu işlem için tüm aktif üretim olaylarını sonlandıracaktır."+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "Montaj adımları"@@ -451,6 +454,9 @@ msgstr "Partiyi Tamamla"msgid "Complete passed"msgstr "Tamamlanan geçti"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "Tamamlandı"@@ -2257,9 +2263,21 @@ msgstr "Bir not yazın…"msgid "Yes"msgstr "Evet"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "{hoursElapsed} saattir zaman kaydı yapıyorsunuz. İş bitişini yapmayı unuttunuz mu?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "Hesabınız henüz bir şirkete ait değildir. Devam etmek için Carbon ERP'de yerleşimi tamamlayın."diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.poindex f491609909..385eb32bd0 100644--- a/packages/locale/locales/zh/erp.po+++ b/packages/locale/locales/zh/erp.po@@ -4217,6 +4217,9 @@ msgstr "盲法"msgid "Blind Count"msgstr "盲点库存"+msgid "Block"+msgstr ""+msgid "Block with an error"msgstr "用错误阻止"@@ -8124,6 +8127,9 @@ msgstr "美元利用率"msgid "Don't Cancel"msgstr "不要取消"+msgid "Don't let them work on this process until they have the ability."+msgstr ""+msgid "Don't see a serial number?"msgstr "看不到序列号?"@@ -11334,6 +11340,9 @@ msgstr "ID 和描述是为原材料生成的。"msgid "If"msgstr "如果"+msgid "If an operator isn't qualified"+msgstr ""+msgid "If depreciation has already run, the next run catches up the months a Straight Line asset took at the old cost."msgstr "如果已执行过折旧,下次运行将补算直线法资产按原成本计提的折旧。"@@ -15762,6 +15771,9 @@ msgstr "仅草稿程序文件可编辑。创建新版本以更改启用或已归msgid "Only employees can post receipts."msgstr "只有员工才能过账收货。"+msgid "Only employees with the {processName} ability can be scheduled for and run this process"+msgstr ""+msgid "Only empty, open periods can be deleted."msgstr "仅可删除空的、未结会计期间。"@@ -21187,6 +21199,9 @@ msgstr "在客户列表、客户表单和下拉菜单上显示可读的客户IDmsgid "Show a readable Supplier ID column on the supplier list, supplier forms, and dropdowns. Suppliers are still identified internally either way."msgstr "在供应商列表、供应商表单和下拉菜单上显示可读的供应商 ID 列。无论哪种方式,供应商在内部仍然可以被识别。"+msgid "Show a warning on the shop floor, but let them work."+msgstr ""+msgid "Show All"msgstr "显示全部"diff --git a/packages/locale/locales/zh/mes.po b/packages/locale/locales/zh/mes.poindex edb79e2040..205958ad31 100644--- a/packages/locale/locales/zh/mes.po+++ b/packages/locale/locales/zh/mes.po@@ -226,6 +226,9 @@ msgstr "您确定要离开此页面吗?"msgid "Are you sure you want to mark this operation as done? This will end all active production events for this operation."msgstr "您确定要将此工序标记为完成吗?这会结束此工序的所有活跃生产事件。"+msgid "Ask a supervisor to add the {processName} ability to your profile."+msgstr ""+msgid "Assembly steps"msgstr "装配步骤"@@ -451,6 +454,9 @@ msgstr "完成批次"msgid "Complete passed"msgstr "完成已通过"+msgid "Complete the {trainingName} training to get the {processName} ability."+msgstr ""+msgid "Completed"msgstr "已完成"@@ -2257,9 +2263,21 @@ msgstr "写备注…"msgid "Yes"msgstr "是"+msgid "You can still start this operation."+msgstr ""++msgid "You can't work on this operation"+msgstr ""++msgid "You don't have the {processName} ability"+msgstr ""+msgid "You've been clocked in for {hoursElapsed} hours. Did you forget to clock out?"msgstr "您已打卡 {hoursElapsed} 小时。您是否忘记收工?"+msgid "Your {processName} qualification expired on {expiredDate}."+msgstr ""+msgid "Your account isn't part of a company yet. Complete onboarding in the Carbon ERP to continue."msgstr "您的账户尚未属于任何公司。完成 Carbon ERP 入职流程以继续。"