Facility billing lets facility staff create and manage medical invoices from the facility panel. Invoices are stored by 0r-ambulancejob first, so the feature can work even when you do not use a separate billing/payment resource.
Custom external billing calls are isolated in modules/billing/server.lua. By default, the bridge detects:
okokBillingqb-phonefor QBCore/Qbox servers
If no supported billing resource is started, invoices stay manual and staff can mark them paid from the facility panel after role-play payment.
Configuration#
Billing settings are inside config/facility.lua:
Config.facility.runtime.billing = {
enabled = true,
depositPaidInvoicesToFacilityAccount = true,
presets = {
{ key = "revive", label = "facility_billing_preset_revive", amount = 750 },
{ key = "treatment", label = "facility_billing_preset_treatment", amount = 500 },
{ key = "surgery", label = "facility_billing_preset_surgery", amount = 2500 },
{ key = "scan", label = "facility_billing_preset_scan", amount = 900 },
{ key = "blood_test", label = "facility_billing_preset_blood_test", amount = 350 },
},
}
enabled: enables or disables facility invoice creation.depositPaidInvoicesToFacilityAccount: whentrue, paid invoices are deposited into the facility account.presets: quick invoice options shown in the facility billing UI.
Database#
Billing uses the 0resmon_ambulance_facility_invoices table.
Custom Payment Sync#
When a custom billing resource confirms payment, call this from server-side code:
TriggerEvent("0r_ambulancejob:server:billingPaid", {
invoice_id = 12,
-- or external_invoice_id = "custom-bridge-id"
})
Client-triggered calls to this event are ignored.
Server Exports#
exports["0r-ambulancejob"]:CreateFacilityInvoice(payload)
exports["0r-ambulancejob"]:MarkFacilityInvoicePaid(invoiceId, options)
exports["0r-ambulancejob"]:CancelFacilityInvoice(invoiceId, reason)
exports["0r-ambulancejob"]:GetFacilityInvoices(facilityId, filters)
exports["0r-ambulancejob"]:GetPlayerUnpaidFacilityInvoices(identifier)
CreateFacilityInvoice accepts:
{
facility_id = 1,
patient_source = 23,
amount = 750,
preset_key = "revive",
reason = "Revive"
}
You can also pass patient_identifier and patient_name instead of patient_source when the patient is not online.