legacy-billing
Configuration
All config.lua keys and their defaults.
Configuration
All settings live in config.lua.
| Key | Type | Default | Description |
|---|---|---|---|
Config.Version |
string | '1.0.0' |
Resource version identifier, checked against remote via legacy-lib's version checker on startup. Don't change manually. |
Config.Locale |
string | 'en' |
Locale file to load from locales/ (filename without .json). Included: en, sv. Must match an existing file. |
Config.AdminGroups |
table | { 'god', 'admin', 'superadmin' } |
Group/permission names granted access to the billing admin panel. Checked as ace permission group.<name> in addition to the framework's own admin check. Must exactly match your framework/ACE group names or admins will be silently locked out. |
Config.MaxDescriptionLength |
number | 500 |
Maximum characters allowed for a bill/template description. |
Config.DefaultDueDays |
number | 7 |
Default due date offset (days from creation) sent to the client when no explicit due date is given. |
Config.MinBillAmount |
number | 1 |
Minimum bill amount in dollars, enforced when creating bills. |
Config.MaxBillAmount |
number | 1000000 |
Maximum bill amount in dollars, enforced when creating bills. |
Config.MaxBulkTargets |
number | 10 |
Maximum number of players selectable for a single bulk billing operation. |
Config.NearbyDistance |
number | 0 |
Max distance to filter the player-targeting list. 0 disables distance filtering entirely and shows all online players — this is easy to misread as "no limit exceeded" rather than "unfiltered". Set > 0 to actually restrict to nearby players. |
Config.LateFeeInterval |
number | 60 |
Interval in minutes for the background thread that checks overdue bills and applies late fees (per-job percentage stored in legacy_billing_jobs.late_fee_pct). Set to 0 to disable the sweep entirely — bills will never auto-transition to overdue or accrue late fees. |
Config.AllowDisputes |
boolean | true |
Whether players may dispute bills. When false, the dispute callback rejects requests server-side regardless of UI state. |
Config.Statuses |
table | 6 entries: unpaid, partial, paid, overdue, disputed, cancelled |
Array of {id, label, color} status definitions shown in the UI. Do not change the id values — they're referenced internally by server logic. label/color are safe to customize. |
Config.PaymentMethods |
table | { bank, cash } |
Array of {id, label} payment methods offered in the UI. Note: the server's payBill callback only ever accepts 'cash' or 'bank' regardless of what's listed here — adding a third method requires server code changes too. |
Config.Webhooks |
table | all keys '' |
Discord webhook URLs for logging: BillCreated, BillPaid, BillOverdue, DisputeFiled, DisputeResolved, AdminAction. Leave an entry as an empty string to disable that specific log. |
Config.Debug |
boolean | false |
Enables [legacy-billing]-prefixed debug logging in the server console. |
Example: customizing statuses and payment methods
Config.Statuses = {
{ id = 'unpaid', label = 'Unpaid', color = '#F97316' },
{ id = 'partial', label = 'Partial', color = '#EAB308' },
{ id = 'paid', label = 'Paid', color = '#22C55E' },
{ id = 'overdue', label = 'Overdue', color = '#EF4444' },
{ id = 'disputed', label = 'Disputed', color = '#8B5CF6' },
{ id = 'cancelled', label = 'Cancelled', color = '#6B7280' },
}
Config.PaymentMethods = {
{ id = 'bank', label = 'Bank' },
{ id = 'cash', label = 'Cash' },
}
Managing which jobs can bill
Jobs allowed to send bills live in the legacy_billing_jobs table (seeded on install with police, ambulance, mechanic). Manage them via the admin panel (legacy-billing:addAllowedJob, updateAllowedJob, removeAllowedJob), or directly via SQL:
INSERT INTO legacy_billing_jobs (job_name, job_label, can_bill, late_fee_pct)
VALUES ('mechanic', 'Mechanic', 1, 0.00);
A job must exist in this table and have can_bill = 1 for its members to use job-biller features (createBill, createBulkBills, getJobBills, getJobStats, templates).