# Lock or unlock an invoice

## Overview

[Video: Lock or unlock an invoice](https://www.youtube.com/watch?v=m3iC2_s3QdI)

This flow describes how to lock or unlock an [invoice](https://docs.ohc.network/concepts/billing/invoice.md) in Care. A lock limits who can open the invoice and hides its total in lists, but it does not stop changes to the invoice.

## Pre-requisites

* The invoice status is Draft, Issued or Balanced. Care does not offer these actions for a Cancelled or Entered in Error invoice.
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Manage Locked Invoice | Lock and unlock the invoice, and open it while it is locked. Facility Admin holds it. |
| Can Read Invoice | Open the invoice. Care also checks it when you lock or unlock the invoice. Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer and Pharmacist hold it. |

You hold each permission through a role in any organization of the facility. The roles named are the default roles.

Care shows **Lock Invoice** to every user who can open the invoice. If you do not have Can Manage Locked Invoice, Care shows "Locked invoice permission denied." and **Failed to lock invoice**.

## Steps

### 1. Open the invoice

Open the invoice. See [Find and open an invoice](https://docs.ohc.network/flows/billing/invoice/view-invoice.md).

![The invoice number and its Issued badge on the invoice page, above the line items and next to the Print and more-options buttons](/assets/images/lock-or-unlock-invoice-1-553f9f89c4ea3efe3d75e63ea48ae7c8.webp)

### 2. Open the menu

Open the more-options (**⋮**) menu.

![The three-dot more-options button next to Print on the issued invoice page](/assets/images/lock-or-unlock-invoice-2-2b7612686f697ab2e2bd18c017ec2b00.webp)

### 3. Lock or unlock the invoice

To lock the invoice, select **Lock Invoice**.

To unlock a locked invoice, select **Unlock Invoice**.

Care applies the change at once. Care does not ask you to confirm.

![The Locked badge beside the Issued badge in the invoice heading, with the toast Invoice locked successfully at the top](/assets/images/lock-or-unlock-invoice-3-512d9029dec26b646e417dde2b48ee0d.webp)

## Expected Outcome

* Care shows **Invoice locked successfully** or **Invoice unlocked successfully**.
* A locked invoice shows a **Locked** badge in its heading.
* In the **Invoices** tab of the account and in **Billing** > **Invoices**, the **Total** column of a locked invoice shows a **Locked** badge instead of the amount. Every user sees the badge, also a Facility Admin.
* Users without Can Manage Locked Invoice cannot open a locked invoice. For them, the invoice page shows **Invoice not found**, **Invoice may not exist** and **Back to invoices**. Care also shows the error "Locked invoice permission denied."
* The lock does not change the status of the invoice. A locked invoice can still be edited, issued, marked as balanced or cancelled.
* Care records who locked or unlocked the invoice, and when. No screen shows this record.
* Care does not print the charge items of an account while one of them is on a locked invoice. This also applies to users with Can Manage Locked Invoice. See [Print charge items](https://docs.ohc.network/flows/billing/charge-item/print-charge-items.md).

## Related

Concepts:

* [Invoice](https://docs.ohc.network/concepts/billing/invoice.md)

Flows:

* [Find and open an invoice](https://docs.ohc.network/flows/billing/invoice/view-invoice.md)
* [Print invoices](https://docs.ohc.network/flows/billing/invoice/print-invoice.md)
* [Print charge items](https://docs.ohc.network/flows/billing/charge-item/print-charge-items.md)
