# Installation

Installation — moh-billing

### 1. Download & place the resource

Copy the `moh-billing` folder into your server's `resources`\
directory (or any sub-folder you use, e.g. `resources/[billing]/`).

### 2. Import the database

Run `install.sql` against your MySQL / MariaDB database.\
It creates two tables if they do not already exist:

* `moh_billing` — stores all invoices
* `management_funds` — stores society fund balances\
  (compatible with the QBCore boss-menu table of the same name)

```
-- Run in your SQL client or import via phpMyAdmin / HeidiSQL
SOURCE /path/to/moh-billing/install.sql;
```

> **Note:** If you already use `management_funds` from\
> qb-management or another resource, skip the second `CREATE TABLE`\
> statement — the table is already present and compatible.

### 3. Add to server.cfg

```
ensure moh-billing
```

Make sure `oxmysql` and your framework resource start *before* moh-billing:

```
ensure oxmysql
ensure qb-core       # or es_extended for ESX
ensure moh-billing
```

### 4. Configure

Open `config.lua` and set `Config.Framework` to match your\
server (`'qbcore'` or `'esx'`), then adjust the remaining\
options to your liking. See the Configuration\
page for a full reference.

### 5. Restart / start

```
restart moh-billing
```

Or do a full server restart. The resource is now live. Players can open the\
billing UI with the command defined in `Config.InvoicesCommand`\
(default: `/billing`).


---

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