Studios
Business Tablethouse-3.jpg

Installation

Business TabletQBCore · Qbox · ESX
PAGE 02 OF 08  ·  OVERVIEW → INSTALLATION → CONFIGURATIONdocs.glitchstudios.dev
Browse docs
cfgQuick start · server.cfg order
# start your framework after its own dependencies
ensure oxmysql
ensure ox_lib
ensure glitch-abstraction
ensure glitch-businesstablet

Requirements#

Framework qbx_core (Qbox), QBCore or ESX Legacy. Config.Framework = 'auto' picks whichever is installed.
Resources ox_lib, oxmysql, glitch-abstraction (the Glitch Studios bridge for framework and inventory calls)
Database MariaDB or MySQL. No SQL import is needed.
Optional ox_inventory, sd-tablet, sd-phone, LB Tablet, LB Phone, a banking resource

Optional resources are detected at run time.

Resource What it adds
sd-tablet (with sd-phone) The tablet opens as an app on sd-tablet.
LB Tablet The tablet opens as an app on LB Tablet.
ox_inventory Menu items and their images, and the job_application item.
sd-phone The customer phone app for each business, invoices for billed sales and memberships, paycheck texts and bank app rows.
LB Phone Paycheck texts and bank app rows.
A banking resource The business (society) account that sales, wages and memberships go through: omes_banking, Renewed-Banking, qb-banking, qb-management, okokBanking or esx_addonaccount.

Without sd-tablet or LB Tablet the tablet uses its own screen.

Installation steps#

  1. Put glitch-businesstablet and glitch-abstraction in your resources folder. The folder name glitch-businesstablet is case-sensitive and must not be renamed.

  2. Add the job application item to ox_inventory/data/items.lua:

    ['job_application'] = {
        label = 'Job Application', weight = 20, stack = true, close = true, consume = 0,
        description = 'A job application form. Use it to fill it in and send it.',
        server = { export = 'glitch-businesstablet.UseApplication' },
    },
    
  3. For the standalone screen, you can also give staff a tablet item. The item name is up to you:

    ['business_tablet'] = {
        label = 'Business Tablet', weight = 500, stack = false, close = true,
        client = { export = 'glitch-businesstablet.OpenTablet' },
    },
    
  4. Set Config.UI.Mode, Config.Integrations and Config.Payroll in shared/config.lua.

  5. Add the resource to server.cfg after its dependencies, and before the scripts that register businesses:

    ensure ox_lib
    ensure oxmysql
    ensure qbx_core
    ensure ox_inventory
    ensure glitch-abstraction
    ensure sd-phone
    ensure sd-tablet
    ensure glitch-businesstablet
    
  6. On Qbox, turn off qbx_core's startup clean-up in server.cfg:

    set qbx:cleanPlayerGroups "false"
    

    The txAdmin Qbox recipe sets it to "true". qbx_core runs that clean-up before the tablet has put its ranks back, so anyone on a rank made on the tablet loses the job on every restart. The tablet runs the same clean-up itself once its ranks are back, and prints a warning on start while the convar is still "true".

  7. Register each business from its own resource with the RegisterBusiness export. The tablet has no list of businesses in its config. See Registering a business.

  8. Restart the server. The console prints Database OK once the tables are ready and Registered business <job> for each business.

The 13 businesstablet_* tables are created on the first start. Columns added in an update are added on the next start, and nothing is ever dropped.

[!NOTE] shared/config.lua, server/custom/ and client/custom/ stay open under escrow. The custom folders hold the calls to banking, billing, phone, logs, notifications and tablet resources, so you can point them at your own.

Updating#

Replace everything except shared/config.lua, server/custom/ and client/custom/, then merge any new keys from the new defaults into your config. Restart glitch-businesstablet. Businesses whose resources register on the tablet's onResourceStart (as in the Examples page) come back by themselves; restart any others.