Billing Systems

ActivityManager supports automatic invoice synchronization with many popular billing systems.

Supported Billing Systems

esx_billing

ESX Default Billing

okokBilling

Okok Billing

qs-billing

Quasar Billing

brutal_billing

Brutal Billing

ars_billing

Arius Billing

g-billing

G-Billing (QBCore)

randol_billing

Randol Billing

codem-billing

Codem Billing v2

s1n_billing

S1N Billing

RxBilling

RX Billing

Basic Configuration

Config.Billing = {
    enabled = true,
    system = 'okokBilling', -- Change to your billing system
    tableName = 'okokbanking_transactions', -- Your billing DB table
    syncToAPI = true, -- Sync to ActivityManager Discord bot
    showNotifications = true,
    validateAmount = true,
    minAmount = 1,
    maxAmount = 999999999,
    monitorDatabase = true,
    monitorInterval = 30000, -- Check DB every 30 seconds
    debugMode = false
}

How It Works

  1. Event Interception: ActivityManager listens to billing system events.
  2. Data Extraction: Invoice amount, label, sender, and recipient are captured.
  3. API Sync: Data is sent to the ActivityManager API.
  4. Discord Update: The Discord bot updates employee invoice stats.

Intercepted Events

Each billing system uses different events. Here are some examples:

-- ESX Billing
'esx_billing:sendBill'
'esx_billing:sendBillToIdentifier'

-- Okok Billing
'okokBilling:SendBill'
'okokBilling:CreateBill'

-- Quasar Billing
'qs-billing:createBill'

-- And more... (see sv_billing.lua for full list)

Adding Custom Billing System

The sv_billing.lua file is not encrypted and can be modified to add support for additional billing systems.

-- Example: Adding a custom billing system
RegisterNetEvent('myCustomBilling:sendInvoice')
AddEventHandler('myCustomBilling:sendInvoice', function(targetId, amount, label)
    local src = source
    
    SyncToActivityManager({
        source = src,
        targetId = targetId,
        amount = tonumber(amount) or 0,
        label = label or 'Invoice',
        billingSystem = 'myCustomBilling'
    })
end)

Database Monitoring

For billing systems that don't fire events (or for external invoices), ActivityManager can monitor your database directly:

Config.Billing = {
    monitorDatabase = true,
    monitorInterval = 30000, -- Check every 30 seconds
    tableName = 'your_billing_table'
}

Troubleshooting

Invoices not syncing?

  • Enable debugMode = true in Config.Billing
  • Check server console for billing intercept messages
  • Verify your billing system name matches exactly
  • Ensure the player has an active shift in the correct zone

API Connection Failed?

  • Verify your server IP is whitelisted
  • Check that the guild is linked in activitymanager_guilds
  • Ensure the ActivityManager bot is in your Discord server