> ## 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.

# PM Schedules

> Manage preventive maintenance schedules — compliance stats, status and overdue filters, completion history, and pause/resume controls.

This screen lists preventive maintenance schedules and is available at `/fm/pm-schedules`.

## Overview

The PM Schedules page loads schedules via `usePMScheduleList` and compliance statistics via `usePMComplianceStats`. Four quick stat cards display: **Total Schedules**, **Active** (highlighted in accent color), **Overdue** (highlighted in destructive color with alert icon when non-zero), and **Completion Rate** (percentage). Filter dropdowns allow filtering by Status (active, paused, completed) and Due Status (overdue only / on track). An **Add Schedule** button opens `PMScheduleFormDialog`.

## Who it's for

Requires permission `fm.dashboard.view`. Creating or editing schedules may require `fm.pm-schedules.admin` — confirm with SME.

## Before you start

* PM templates must be created before schedules can be defined.
* Sites must be configured for site-based scheduling (if applicable).

## Finding a schedule

1. Navigate to `/fm/pm-schedules` via the FM sidebar or Preventive Maintenance section.
2. Check the four stat cards for a quick compliance overview, paying attention to the Overdue count.
3. Use the Status and Due Status dropdowns to narrow the list.
4. Click **Add Schedule** to open `PMScheduleFormDialog`; link it to a PM template and configure the schedule settings.
5. Click any schedule row to navigate to `/fm/pm-schedules/:id`.

* **PM schedule** — an instance of a PM template assigned to a specific site or asset on a recurring basis.
* **Overdue** — a schedule where `next_due_date` has passed without completion.
* **Completion rate** — percentage of schedules completed on time (confirm calculation with SME).

## Viewing a schedule

The PM Schedule Detail page (`/fm/pm-schedules/:id`) loads a schedule by ID via `usePMScheduleDetail`, including completion history. The header shows the template name (from `schedule.pm_template.template_name`), status badge, site name, and an overdue badge displaying days overdue when applicable. Three stat cards show **Next Due Date** (in destructive color if overdue), **Last Completed**, and **Start Date**. A **Template Details** card shows the linked template name (linked to `/fm/pm-templates/:id`), asset type, frequency, and estimated duration. A **Configuration** card shows `auto_generate_work_orders`, `lookahead_days`, and status. A `PMCompletionHistory` component renders completion records. Pause and Resume buttons control schedule status via `usePMScheduleMutations`.

Requires `fm.dashboard.view`. Pause/Resume actions may require `fm.pm-schedules.admin` — confirm with SME.

Before you start: the schedule must exist and be linked to a valid PM template.

1. From the PM Schedules list, click any row to navigate to `/fm/pm-schedules/:id`.
2. Review the Next Due Date card; a destructive color indicates the schedule is overdue.
3. Check the linked template name, asset type, frequency, and estimated duration.
4. Check whether auto work order generation is enabled and what the lookahead period is.
5. Click **Pause** to set status to `paused` — the schedule will not generate work orders while paused.
6. Click **Resume** to set status back to `active`.
7. Scroll to the PMCompletionHistory component to audit past completions.
8. Click **Edit** to open `PMScheduleFormDialog` and modify schedule settings.

* **auto\_generate\_work\_orders** — when true, the system creates work orders automatically as due dates approach within `lookahead_days`.
* **lookahead\_days** — number of days ahead of the due date that auto-generated work orders are created.
* **days\_overdue** — `schedule.days_overdue` field indicating how many days past due the schedule is.

## 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/PMSchedulesPage.tsx
  * src/cores/fm/pages/PMScheduleDetailPage.tsx
</Accordion>
