{% extends "base.html" %} {% from "partials/ui.html" import page_header, subtabs, subtab_help %} {% block content %} {{ page_header('Settings / Branding', 'Configure property, branding, master data, maintenance, and updates. Protected actions require unlock/super password.') }} {{ subtabs([ {'key':'general','href':'/settings?tab=general','label':'General'}, {'key':'data','href':'/settings?tab=data','label':'Seed & Data'}, {'key':'rooms','href':'/settings?tab=rooms','label':'Rooms & Plans'}, {'key':'updates','href':'/settings?tab=updates','label':'Updates & Health'} ], active_tab, 'Settings sections') }} {% if active_tab == 'updates' %}
Check/apply app updates (data preserved), run backups, and access health/rate plans/users tools.

Manage Rate Plans & Pricing Rules · Service Catalog · Discount Vouchers · Packages & Bundles · Users & Roles (RBAC groundwork) · Approvals (workflow foundation) · Ledger/Data Health Check (read-only, unlock required)

App updates (preserves your data)

Checks GitHub for newer versions and can fast-forward update installed source code. Runtime data is preserved (database, exports, invoices, configured data directory).

App version{{ (update_local.app_version or '—') }}
Installed commit{{ (update_local.commit_short or '—') }} {% if update_local.commit_subject %}— {{ update_local.commit_subject }}{% endif %} {% if update_local.commit_date %}({{ update_local.commit_date }}){% endif %}
Branch{{ update_local.branch or '—' }} {% if update_local.dirty %}(local changes present){% endif %}
Install{{ update_local.project_root or '' }}
Data (preserved){{ update_local.data_dir or '' }}
{% if update_check %}
{% if update_check.error %}
Check failed: {{ update_check.error }}
{% else %} {% if update_check.update_available %}
Update available{% if update_check.commits_behind is not none %} — {{ update_check.commits_behind }} new commit(s){% endif %}. Latest: {{ (update_check.latest.commit_short if update_check.latest else '—') }} {{ (update_check.latest.subject if update_check.latest else '') }}
{% else %}
Up to date. Latest: {{ (update_check.latest.commit_short if update_check.latest else (update_local.commit_short or '—')) }} {{ (update_check.latest.subject if update_check.latest else '') }}
{% endif %} {% if update_check.notes %} {% endif %} {% if update_check.changelog %}

What’s in this update

{% endif %} {% if update_check.compare_url %}

Compare changes on GitHub

{% endif %} {% if update_check.update_available %}
Update now

Runs a safe git pull --ff-only (requires unlock). Restart the app after updating. If local source changes exist, stash/commit/discard them first.

{% endif %} {% endif %}
{% endif %} {% if update_apply %}
{% if update_apply.ok %}
Update applied. Restart the app to load the new version. Data preserved.
{% if update_apply.local_after %}
Now at: {{ update_apply.local_after.commit_short }} {{ update_apply.local_after.commit_subject or '' }}
{% endif %} {% elif update_apply.guided %}
Manual update required for this install. {{ update_apply.error }} Download and install the latest release for your platform, then restart the app. Your database/exports/invoices/data directory are preserved.
{% if update_apply.url %}

Open latest release/download page

{% endif %} {% else %}
Update failed: {{ update_apply.error }}
{% endif %} {% if update_apply.steps %}
Update steps
{% for s in update_apply.steps %}{{ s.step }} (rc={{ s.rc }})
{{ s.stdout }}
{{ s.stderr }}

{% endfor %}
{% endif %}
{% endif %}
{% elif active_tab == 'data' %}
First-time seed/master data, guarded demo presets, and settings reset (protected operations).
How to use Seed & Data

First-time seed / master data

Seed all inventory easily with barcodes and full item data. Use CSV for bulk spreadsheet/barcode workflows, or JSON for full master-data control. Apply is allowed only before operational data exists and requires unlock + super password + APPLY SEED CONFIG.

Inventory CSV (barcode & bulk-friendly)

CSV columns: item_name, category, stock_qty, unit, unit_cost, selling_price, low_stock_threshold, overstock_threshold, active, sku, barcode, barcode_type, track_batches, shelf_life_days, default_supplier.

Full seed config JSON

Guarded demo data preset

Loads synthetic but realistic operational data to explore workflows/reports quickly. Refused when operational data already exists.

{% for p in (demo_presets or []) %}
{{p.label or p.key}}: {{p.description}}
{% endfor %}

Reset settings to defaults

Requires unlock + super password + confirmation RESET DEFAULTS. Preserves schema/language.

{% elif active_tab == 'rooms' %}
Manage rooms and access rate plans / health tools.

Manage Rate Plans (add/edit/delete) · Ledger/Data Health Check

Rooms (add / remove)

Add rooms anytime. Deleting a room is blocked if referenced by reservations.

{% for r in rooms %} {% else %} {% endfor %}
IDNumberTypeBase priceHKAction
{{r.id}}{{r.room_number}}{{r.room_type}}{{"%.2f"|format(r.base_price or 0)}}{{r.housekeeping_status}}
No rooms.
{% else %}{# general #}
Branding, barcode/label configuration, backups, network/LAN access, and the settings catalog.
How to use General settings

Branding & animation

Gift: {{ brand.gift }}

Maintenance & devices

Create backups and test label printing (configured label/default printer or saved export).

Barcode/label device settings (barcode_*, label_printer, label_format, expiry policy) are in the catalog below.

LAN / Network access (PWA & other devices)

To access SPMS from phones/tablets/other PCs on the same network, run the server on host 0.0.0.0 (launcher menu: LAN mode or --host 0.0.0.0) with a fixed port and SQLite-safe --workers 1.

{% if current_access_host %}

Current access host: {{ current_access_host }}{% if is_local_access %} (local access){% endif %}

{% endif %} {% if lan_urls %}

Detected LAN URL candidates (this server port):

If the server is running on 0.0.0.0, open one of these URLs from another device on the same network. If multiple interfaces are shown, use the one reachable on your Wi-Fi/LAN.

{% else %}

No LAN IPv4 address auto-detected. Check your network adapter settings and use your machine’s LAN IP, e.g. http://<this-machine-LAN-IP>:<port>.

{% endif %}

Settings catalog (unlock + password to save)

Edit values supported by services.save_settings. Sensitive save requires super password.

{% for k, spec in catalog.items() %} {% if spec[1] != 'internal' %} {% endif %} {% endfor %}
KeyLabelValue
{{k}}{{spec[0]}}
{{spec[4]}}
{% if spec[1] == 'bool' %} {% elif spec[1] == 'enum' %} {% elif spec[1] == 'text' %} {% else %}{% endif %}
{% endif %} {% endblock %}