> For the complete documentation index, see [llms.txt](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-banking-v1/features/billing-invoices.md).

# billing invoices

The billing system handles all player-to-player, job-to-player, and society-to-player invoice workflows.

## Opening Invoices

Players can view their invoices in two ways:

* The **Invoices** tab inside the bank UI
* The standalone billing UI via `/invoices` or the keybind set in `Config.Keybinds.Invoices`

{% hint style="info" %}
`Config.Billing.StandaloneUI = true` means `/invoices` opens a dedicated billing interface. Players do not need to be near a bank.
{% endhint %}

## Creating an Invoice

Any player (or job/society boss) can create an invoice from the **Invoices** page → **New Invoice**.

* Select a recipient from the **online player dropdown**, or type a citizen ID for offline billing
* Choose a quick template (if configured for your job) or enter a title and amount manually
* Optionally bill on behalf of a society account you have boss access to

```lua
Config.Billing.AllowPlayerInvoices   = true
Config.Billing.AllowJobInvoices      = true
Config.Billing.AllowSocietyInvoices  = true
Config.Billing.AllowOfflineInvoices  = true
```

## Job Templates

Configure quick-fill templates per job so officers don't have to type amounts manually:

```lua
Config.Billing.Templates = {
    police = {
        { title = 'Speeding Fine',    amount = 250 },
        { title = 'Reckless Driving', amount = 500 },
        { title = 'Court Fine',       amount = 1000 },
    },
    ambulance = {
        { title = 'Ambulance Callout', amount = 750 },
        { title = 'Treatment Fee',     amount = 1500 },
    },
}
```

## Paying an Invoice

* **Pay** — pays the full remaining amount from checking
* **Part** — opens a partial payment dialog (if `Config.Billing.AllowPartialPayments = true`)
* **Pay All** — pays every unpaid invoice at once (if `Config.Billing.AllowPayAll = true`)

{% hint style="warning" %}
If the player's account is **frozen**, they cannot pay invoices. The UI will display a freeze notice instead.
{% endhint %}

## Disputing & Voiding

| Action      | Who       | Condition                          |
| ----------- | --------- | ---------------------------------- |
| **Dispute** | Recipient | Invoice not yet paid/void/disputed |
| **Void**    | Sender    | Invoice unpaid or partially paid   |

Disputed invoices are visible to admins in the Admin Panel for review.

## Due Dates & Late Fees

```lua
Config.Billing.DefaultDueDays      = 7      -- days until overdue
Config.Billing.OverdueCheckMinutes = 30     -- how often to scan for overdue invoices
Config.Billing.LateFeePercent      = 0.0    -- % late fee applied on overdue scan (0 = disabled)
```

## Job Restrictions

Optionally restrict which jobs can create invoices:

```lua
Config.Billing.AllowedJobs = {
    ['police']    = true,
    ['ambulance'] = true,
}

Config.Billing.JobGradeMin = {
    ['police'] = 2,   -- minimum grade 2 to issue invoices
}
```

Leave both tables empty to allow all jobs.
