> For the complete documentation index, see [llms.txt](https://docs.sourcedev.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sourcedev.pro/advanced-billing-system/admin-guide.md).

# Admin Guide

This guide is intended for server administrators and organization bosses who manage the Billing System.

## Dashboard Overview

The **Admin App** provides advanced management tools for your organization. To access it, you must have the required boss rank (or be a server admin).

### Key Metrics

The dashboard displays real-time statistics for your job:

* **Total Revenue:** Total money collected through invoices.
* **Pending Invoices:** Total amount of money currently owed to your job.
* **Paid vs Unpaid:** A visual breakdown of payment success.
* **Top Employees:** Who is issuing the most invoices.

***

## 🏦 Cashbox Management

Each organization has its own **Cashbox** (if enabled in `config.lua`). This is where the money from paid invoices is deposited.

### Accessing the Cashbox

1. Open the **Admin App**.
2. Navigate to the **Cashbox** tab.

### Deposit & Withdraw

* **Deposit:** Add money from your personal account to the organization's cashbox.
* **Withdraw:** Take money from the cashbox to your personal account (requires permissions).
* **History:** View all transactions related to the cashbox.

{% hint style="info" %}
In `config.lua`, you can choose whether the cashbox is unique to each job or shared between certain jobs.
{% endhint %}

***

## 📋 Billing Menus

One of the most powerful features is the customizable **Billing Menu**. This allows you to create predefined templates for common invoices.

### Managing Categories

1. In the Admin App, go to **Menu Settings**.
2. Click **Add Category** (e.g., "Traffic Violations", "Criminal Offenses").
3. You can enable or disable categories instantly.

### Adding Item Templates

1. Select a category.
2. Click **Add Item**.
3. Set a **Template Name** (e.g., "Speeding 10+ over").
4. Set a **Predefined Price**.
5. Set a **Default Quantity**.
6. Now, when members of your job create an invoice, they can simply select this item from the list.

***

## 📊 Analytics & Reports

The analytics section provides deep insights into your organization's financial health.

### Exporting Data

You can filter invoices by:

* Date Range
* Employee
* Status (Paid / Unpaid / Cancelled)
* Minimum/Maximum Amount

Use this data to monitor performance or conduct audits.

### Invoice Management

Admins can use the **History** tab to:

* Review any invoice issued by a member of their organization.
* **Cancel Invoice:** If an invoice was issued in error, an admin can cancel it, removing the debt from the player.
* **Mark as Paid:** Manually mark an invoice as paid (e.g., if the player paid via an external method).

***

## ⚙️ Global Admin Settings

The following settings are managed by server administrators via the database (`billing_menus` table) or through the in-game admin menu:

* **Manual Entry:** Allow/Disallow players to type in custom prices.
* **Vehicle Selection:** Enable/Disable the ability to pick a nearby vehicle for an invoice.
* **Recipient Limits:** Set how many people can be billed at once.

***

{% hint style="warning" %}
**Permission Note:** Access to the Admin App is restricted to those with appropriate ranks in the framework (e.g., "boss" in ESX or "god" in QBox). Ensure your framework ranks are correctly configured.
{% endhint %}
