> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Work Orders

> List, create, and manage maintenance work orders — with status, priority, and category filters, and a detail view with assignment, timeline, costs, and history.

This screen displays a searchable, filterable list of work orders and is available at `/fm/work-orders`.

## Overview

The Work Orders page renders a tabular list of work orders fetched via `useWorkOrderList`. Users can search by text and filter by **Status**, **Priority**, and **Category** using dropdown selects. Filter options are loaded from the `usePicklistByEnum` hook with enum fallback labels (`WORK_ORDER_STATUS_LABELS`, `WORK_ORDER_PRIORITY_LABELS`, `WORK_ORDER_CATEGORY_LABELS`). A **New Work Order** button opens `WorkOrderFormDialog`. Navigating to `/fm/work-orders?action=new` automatically opens the creation dialog on load.

Note: The route `/fm/work-orders/new` redirects to `/fm/work-orders?action=new` and is not a standalone screen.

## Who it's for

Requires permission `fm.dashboard.view` (enforced by the parent `FMViewGuard`). Creating a new work order additionally requires `fm.work-orders.create` (enforced within the form dialog).

## Before you start

* Hold the `fm.dashboard.view` permission.
* To create work orders, hold `fm.work-orders.create`.

## Finding a work order

1. Navigate to `/fm/work-orders` via the FM sidebar or the Open Work Orders stat card on the dashboard.
2. Use the search bar and the Status, Priority, and Category dropdowns to narrow the list.
3. Click any row in the work order table to navigate to its detail page at `/fm/work-orders/:id`.
4. Click **New Work Order** in the header. The creation dialog opens; fill in required fields and submit.
5. Click the **Help** button to start the guided tour for work orders.

* **Work order status** — values include `draft`, `submitted`, `assigned`, `in_progress`, `on_hold`, `completed`, `closed`, `cancelled` (from `WORK_ORDER_STATUS_LABELS`).
* **Priority** — values from `WORK_ORDER_PRIORITY_LABELS`.
* **Category** — values from `WORK_ORDER_CATEGORY_LABELS`.

## Creating a work order

Work orders are created via `WorkOrderFormDialog`. The route `/fm/work-orders/new` redirects to `/fm/work-orders?action=new`, which automatically opens the creation dialog. Requires `fm.work-orders.create`.

1. Navigate to `/fm/work-orders/new` (redirected) or click **New Work Order** from the work orders list.
2. The work order creation dialog opens; fill in required fields and submit.

## Viewing a work order

The Work Order Detail page (`/fm/work-orders/:id`) loads a work order by ID using `useWorkOrderDetail`. It displays the work order number, title, status badge, and priority badge in the header. The main grid shows a **Details** card (description, type, category, site, location), and sidebar cards for **Assignment** (requester, assignee, assigned date), **Timeline** (created, due date, completed), and **Costs** (estimated hours, actual hours, estimated cost, actual material cost). Below the grid are cards for **Materials**, **Attachments**, and **History**. Context-sensitive action buttons appear based on the current status: Assign (`draft`/`submitted`), Start Work (`assigned`), Put On Hold (`in_progress`), Complete (`in_progress`), and Cancel (all non-terminal states).

Requires `fm.dashboard.view`. Actions like Assign and Complete may require `fm.work-orders.edit` or `fm.work-orders.approve` — confirm with SME.

Before you start: the work order must exist and not have been deleted. Hold the appropriate permissions for the action you intend to take.

1. From the Work Orders list, click any row to navigate to `/fm/work-orders/:id`.
2. Examine the Details, Assignment, Timeline, and Costs cards.
3. If the work order is in `draft` or `submitted` status, click **Assign** to open the assign dialog and select an assignee.
4. When status is `assigned`, click **Start Work** to move it to `in_progress`.
5. From `in_progress`, click **Complete** to open the completion dialog, or **Put On Hold** to pause.
6. Click **Cancel** on any non-terminal work order; a confirmation dialog is required.
7. Scroll down to view associated materials, file attachments, and the audit history of actions taken on this work order.

* **Work order number** — displayed as the primary identifier (e.g., `WO-0001`).
* **Status flow** — `draft` → `submitted` → `assigned` → `in_progress` → `completed`/`on_hold`/`cancelled`.
* **History entries** — each status change records `action`, optional `notes`, `performed_by_profile`, and `performed_at`.

## Related

<Columns cols={2}>
  <Card title="Facilities & Inventory" icon="warehouse" href="/fm/overview">
    Facilities & Inventory core overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/fm.tsx
  * src/cores/fm/pages/WorkOrdersPage.tsx
  * src/cores/fm/pages/WorkOrderDetailPage.tsx
</Accordion>
