legacy-billing
Installation
Dependencies and setup steps for legacy-billing.
Installation
Dependencies
Install and start these resources before legacy-billing:
legacy-lib— Framework/Banking abstraction, locale loading, webhook sending, version checking (listed in the resource manifest as a dependency)ox_lib— NUI callbacks (lib.callback) and notifications (lib.notify)oxmysql— all database access
Note: The resource manifest declares
legacy-libas a dependency, but the resource's own documentation and exampleserver.cfginstead referencecommunity_bridgeas the framework abstraction dependency. These are inconsistent — check your actualfxmanifest.luabefore deploying to confirm which one is truly required, and ensure whichever is used is started beforelegacy-billing.
Steps
- Place the
legacy-billingfolder in yourresourcesdirectory. - Import
sql/schema.sqlinto your database. This creates all five tables (legacy_billing_jobs,legacy_bills,legacy_bill_payments,legacy_bill_disputes,legacy_bill_templates) and seeds three default billing jobs:police(5% late fee),ambulance, andmechanic.- Warning:
schema.sqlbegins withDROP TABLE IF EXISTSfor all five tables. If you are upgrading or already have billing data, strip theDROP TABLEstatements first, or you will permanently lose existing bills, payments, disputes, templates, and job configuration.
- Warning:
- Add the following to your
server.cfg, in order:
ensure ox_lib
ensure oxmysql
ensure legacy-lib
ensure legacy-billing
(If your build actually depends on community_bridge instead of legacy-lib, ensure that resource instead, before legacy-billing.)
- Configure
config.lua— locale, admin groups, bill limits, statuses, payment methods, late fee interval, and webhooks. See Configuration for details. - Restart the server.
Frontend build (if modifying the UI)
The NUI panel is a separate React/Vite project at web/, not built automatically by FXServer:
cd web
npm install
npm run build
This outputs a production bundle to web/dist, which fxmanifest.lua's ui_page should point at. Do not attempt to run the UI directly from web/src.
Locales
Locale JSON files live in locales/ (en.json, sv.json are included). Config.Locale in config.lua selects which file loads — the value must match a filename in locales/ (without .json). To add a language, create a new locale file with the same key structure.