> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pandryx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Billing

**Installation**

1. Unzip **Pandryx\_Billing** and place **Pandryx\_Billing** in your server's resources folder.
2. Add **ensure Pandryx\_Billing** to your server.cfg
3. Import the database schema.sql
4. Make sure it starts **before** any resource that depends on it
5. Start / Restart your server

<Note>
  **ESX:** no extra tables needed (uses native billing/addon\_account\_data)\
  **QBCore / QBOX:** creates phone\_invoices and management\_funds.

  See `schema.sql`]\(schema.sql) for the full script.
</Note>

<CodeGroup>
  ````text QB / QBOX theme={null}
  CREATE TABLE IF NOT EXISTS phone_invoices (
      id          INT UNSIGNED    AUTO_INCREMENT PRIMARY KEY,
      citizenid   VARCHAR(64)     NOT NULL DEFAULT '',
      society     VARCHAR(64)     NOT NULL DEFAULT '',
      label       VARCHAR(255)    NOT NULL DEFAULT '',
      amount      INT UNSIGNED    NOT NULL DEFAULT 0,
      status      ENUM('unpaid','paid','overdue','void') NOT NULL DEFAULT 'unpaid',
      issued_by   VARCHAR(128)    NOT NULL DEFAULT '',
      name        VARCHAR(128)    NOT NULL DEFAULT '',
      phone       VARCHAR(64)     NOT NULL DEFAULT '',
      created_at  TIMESTAMP       NOT NULL DEFAULT CURRENT_TIMESTAMP,
      created_ts  INT UNSIGNED    NOT NULL DEFAULT 0
  );

  -- Society/management fund balances
  CREATE TABLE IF NOT EXISTS management_funds (
      job     VARCHAR(64) PRIMARY KEY,
      amount  BIGINT      NOT NULL DEFAULT 0
  );
  ```
  ````
</CodeGroup>
