fix: standardize billing order status values and fix expiration lookup

- billing_integration.php: admin-created servers now use status='Active' (was 'installed')
- home_handling_functions.php: expiration query uses status IN ('Active','Invoiced') only
- my_account.php: renewable_statuses includes canonical 'active'/'invoiced'; legacy labels updated
- admin_orders.php: add orphaned home_id diagnostics section
- normalize_billing_order_status.sql: new migration to convert installed/paid→Active, suspended→Invoiced

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/c56f04bb-ecce-4f1b-9bbd-c5f83107da1d

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-05 15:55:39 +00:00 committed by GitHub
parent edb2f90b4a
commit 2f62bd32c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 116 additions and 14 deletions

View file

@ -5,7 +5,7 @@
* Shared helper for recording admin-created game servers in the billing tables,
* so they are treated identically to FREE website orders:
* billing_invoices (status='paid', amount=0)
* billing_orders (status='installed', price=0)
* billing_orders (status='Active', price=0)
*
* This does NOT re-provision the server the caller (add_home.php) already
* created the server via the panel DB layer. We only write the billing ledger
@ -113,7 +113,7 @@ if (!function_exists('admin_register_server_in_billing')) {
}
// ------------------------------------------------------------------ //
// 4. Insert billing_order (status='installed', already provisioned). //
// 4. Insert billing_order (status='Active', already provisioned). //
// ------------------------------------------------------------------ //
$order_fields = array(
'user_id' => intval($user_id),
@ -128,7 +128,7 @@ if (!function_exists('admin_register_server_in_billing')) {
'remote_control_password' => '',
'ftp_password' => '',
'home_id' => intval($home_id),
'status' => 'installed',
'status' => 'Active',
'order_date' => $now,
'end_date' => $end_date,
'payment_txid' => 'admin-created',