# Commands & Usage

Commands & Usage — moh-billing

moh-billing uses a single in-game command to open the billing UI. Everything else\
is handled through the interactive interface — no extra commands are needed.

### Opening the UI

| Command    | Who can use it        | Description                                                                                                                                      |
| ---------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `/billing` | Any player with a job | Opens the billing UI. All players can view and pay their own invoices. Only members of `Config.AllowedSocieties` see the **Create Invoice** tab. |

The command name can be changed in `config.lua`:

```
Config.InvoicesCommand = 'billing'   -- change to whatever you prefer
```

### Closing the UI

Press <kbd>Escape</kbd> or click the **×** button in the top-right corner of the panel.

### What each player type can do

| Player type                              | View invoices | Pay invoices | Create invoices | Management tab |
| ---------------------------------------- | ------------- | ------------ | --------------- | -------------- |
| Any player with a job                    | ✅             | ✅            | ❌               | ❌              |
| Member of an `AllowedSociety`            | ✅             | ✅            | ✅               | ❌              |
| Boss-grade member of an `AllowedSociety` | ✅             | ✅            | ✅               | ✅              |

### Sending an invoice — step by step

1. Stand within **3 metres** of the target player.
2. Type `/billing` to open the UI.
3. Click the **Create Invoice** tab.
4. Fill in the *Reason / Item* field and the *Amount*.
5. Click **Send Invoice**.
6. The target receives an in-game notification and the invoice appears in their *My Invoices* tab immediately.

> **Note:** If no player is within 3 metres, the send action is\
> cancelled and an error notification is shown. Move closer to the target and try again.

### Paying an invoice — step by step

1. Type `/billing` to open the UI.
2. Your unpaid invoices are listed in the **My Invoices** tab.
3. Click **▶ Pay** next to the invoice you want to settle.
4. The amount is deducted from your `Config.MoneyAccount` (default: bank).
5. A success notification is shown and the invoice disappears from the list.
6. The sender receives a notification that payment was made.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mohssins.gitbook.io/mohscriptsdocs/moh-billing/commands-and-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
