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

# Write-off Requests

> Review and process bad debt write-off requests with an approval workflow at /pm/writeoff-requests.

The Write-off Requests page at `/pm/writeoff-requests` displays a table of bad debt write-off requests for the current organization and allows users with the approve permission to review and approve or deny pending requests via a dialog.

## Overview

The Write-off Requests page is wrapped in a `PermissionGate` on `pm.writeoffs.view`; users without this permission never see the page content. It fetches records from `pm_bad_debt_writeoffs` for the current organization, ordered by creation date descending. The table columns are: Patient (first 8 chars of `patient_id`), Amount (formatted currency), Aging Days, Reason (reason code with underscores replaced by spaces), Status, and Request Date. Users holding `pm.writeoffs.approve` additionally see an "Actions" column; a "Review" button appears on each row with `pending` status and opens the `WriteoffApprovalDialog`.

## Who it's for

Requires permission `pm.writeoffs.view` (`PM_PERMISSIONS.WRITEOFFS_VIEW`) to see the page content at all. Reviewing and approving or denying pending requests additionally requires `pm.writeoffs.approve` (`PM_PERMISSIONS.WRITEOFFS_APPROVE`).

## Before you start

* You must hold the `pm.writeoffs.view` permission.
* Write-off requests must be submitted (via a separate workflow) before they appear in this queue.

## Steps

<Steps>
  <Step title="Navigate to Write-off Requests">
    Go to `/pm/writeoff-requests`. The page loads and displays all write-off records for the organization. If you lack `pm.writeoffs.view`, the `PermissionGate` prevents the table from rendering.
  </Step>

  <Step title="Review the queue">
    The table shows each request with its patient identifier, amount, aging days, reason code, status badge, and request date.
  </Step>

  <Step title="Open the approval dialog">
    Requires `pm.writeoffs.approve`. Click the "Review" button on a row with status `pending`. The `WriteoffApprovalDialog` opens with the full write-off record.
  </Step>

  <Step title="Approve or deny the request">
    Within the dialog, approve or deny the request. Approving updates the status to `approved` and records `approved_by`, `approval_date`, and optional `approval_notes`. Denying updates the status to `denied` with the same fields.
  </Step>

  <Step title="Retry on error">
    If the list fails to load, a "Retry" button calls `window.location.reload()` to refresh the page.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Write-off">
    The accounting action of removing an uncollectable balance from accounts receivable and classifying it as bad debt. Requires approval before being finalized.
  </Accordion>

  <Accordion title="Aging days">
    The number of days a balance has been outstanding. The `aging_days` field is stored on the write-off record at the time the request is submitted.
  </Accordion>

  <Accordion title="Status values">
    `pending` (outline badge), `approved` (default badge), `denied` (destructive badge). Display labels come from the `WRITEOFF_STATUS_LABELS` map imported from the types module.
  </Accordion>

  <Accordion title="Empty state">
    When no records exist, an `EmptyState` component with title "No pending write-off requests" and description "Write-off requests will appear here when submitted." is shown.
  </Accordion>

  <Accordion title="Error state">
    If the query fails, an inline destructive message "Unable to load write-off requests. Please try again." is shown with a "Retry" button.
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Practice Management" icon="briefcase" href="/pm/overview">
    Overview of the Practice Management core.
  </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/pm.tsx
  * src/cores/pm/pages/WriteoffRequestsPage.tsx
  * src/cores/pm/hooks/useWriteoffs45.ts
  * src/platform/permissions/constants.ts
</Accordion>
