# Money Destination

Money Destination — moh-billing

When a player pays an invoice, you control exactly where that money goes by setting`Config.MoneyDestination` in `config.lua`. There are three modes.

### Mode overview

| Value          | Where the money goes                                                                                           | Extra config needed       |
| -------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------- |
| `'management'` | 100 % added to the society fund stored in the database. Boss-rank members can withdraw via the Management tab. | None                      |
| `'player'`     | 100 % sent directly to the bank account of the player who created the invoice.                                 | None                      |
| `'split'`      | A configurable percentage goes to the invoice sender; the remainder goes to the society fund.                  | `Config.PlayerCutPercent` |

### management

All payments accumulate in the `management_funds` database table under the\
society's job name. Boss-grade members of that society can then withdraw funds directly\
to their own bank account via the Management tab in the UI.

This mode is ideal for organised factions where income should be pooled and\
distributed by leadership.

```
Config.MoneyDestination = 'management'
```

Discord log example:

```
✅ Invoice Paid → Management
Payer: John Smith
Invoice #: 12
Amount: $500
Item: Vehicle Repair
Society: Mechanic Garage
```

### player

The full payment amount is credited to the `Config.MoneyAccount` of the\
player who originally sent the invoice. If that player is offline, the money is still\
added to their account (database-backed by the framework).

This mode suits freelance or individually tracked billing.

```
Config.MoneyDestination = 'player'
```

Discord log example:

```
✅ Invoice Paid → Player
Payer: John Smith
Invoice #: 12
Amount: $500
Item: Vehicle Repair
Society: Police Department
Recipient: Officer Davis
```

### split

The payment is split between the sender and the society fund. The percentage going\
to the sender is set with `Config.PlayerCutPercent`. The remainder goes\
to the management fund.

```
Config.MoneyDestination  = 'split'
Config.PlayerCutPercent  = 20   -- sender gets 20 %, management gets 80 %
```

With a $500 invoice and a 20 % cut:

* Sender receives **$100**
* Management fund receives **$400**

Discord log example:

```
✅ Invoice Paid → Split
Payer: John Smith
Invoice #: 12
Total: $500
Item: Vehicle Repair
Society: Police Department
To Player (20%): $100
To Management: $400
```

### Notifications on payment

In all three modes, the following notifications are sent:

* **Payer** — success notification with the invoice number and amount paid.
* **Sender (if online)** — notification naming the payer, invoice number, amount (and destination breakdown for `split` mode).


---

# 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/money-destination.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.
