> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_housing/configuration/billing.md).

# Billing

Edit `rcore_housing/configs/config.billing.lua` to control rent and utilities cycles, grace periods, and advance payment discounts.

## 🔌 Master Switch

```lua
Config.Billing.Enable = true
```

Set to `false` to disable rent and utilities billing entirely. Existing properties stay owned/rented but no bills are issued.

## 🧪 Test Mode

```lua
Config.Billing.TestMode = false
```

{% hint style="warning" %}
When `TestMode = true`, `Cycle`, `Grace`, and `InGameGrace` values are interpreted in **seconds** instead of **days**. Set to `false` for production or your players will be evicted within minutes.
{% endhint %}

| Option            | TestMode     | Production      |
| ----------------- | ------------ | --------------- |
| `CheckInterval`   | `5000` (5 s) | `3600000` (1 h) |
| `Cycle.Rent`      | `60` s       | `30` days       |
| `Cycle.Utilities` | `60` s       | `30` days       |
| `Grace`           | `30` s       | `1` day         |
| `InGameGrace`     | `30` s       | `2` h           |
| `InGameGraceUnit` | `'seconds'`  | `'hours'`       |

## 🕒 Cycles & Grace

```lua
Config.Billing.CheckInterval = 60 * 60 * 1000
Config.Billing.Cycle = { Rent = 30, Utilities = 30 }
Config.Billing.Grace = 1
Config.Billing.InGameGrace = 2
Config.Billing.InGameGraceUnit = 'hours'
```

`Grace` is wall-clock time after the cycle ends before penalties trigger. `InGameGrace` only counts down while the player is online - it gives players a second window to log in and pay before eviction.

## 💸 Advance Payments

```lua
Config.Billing.AdvanceOptions  = { 1, 3, 6, 12 }
Config.Billing.AdvanceDiscount = { [3] = 5, [6] = 10, [12] = 15 }
Config.Billing.MaxPrepaidDays  = 31
```

| Option            | Description                                               |
| ----------------- | --------------------------------------------------------- |
| `AdvanceOptions`  | Months a player can prepay (1, 3, 6, or 12).              |
| `AdvanceDiscount` | Discount % applied per prepay tier.                       |
| `MaxPrepaidDays`  | Hard cap on prepaid days regardless of the option chosen. |

## 🤝 Owner Share

```lua
Config.Billing.OwnerRentShare      = 90
Config.Billing.RentedUtilitiesPayer = 'tenant'
```

| Option                 | Description                                                                                |
| ---------------------- | ------------------------------------------------------------------------------------------ |
| `OwnerRentShare`       | Percentage of rent paid out to the owner (0–100). The remainder is voided as a system fee. |
| `RentedUtilitiesPayer` | `'tenant'` or `'owner'` - who pays utilities on a rented property.                         |

## 🏷️ Defaults

```lua
Config.Billing.Defaults = {
    RentPrice      = 100,
    UtilitiesPrice = 50,
}
```

Default rent and utilities prices applied to newly created properties. Owners can override per property from `/housing`.
