Files
TREK/wiki/Reservations-and-Bookings.md
T
Maurice 3c5e406229 feat(places): link an expense to a place, the way bookings already do (#1917)
* feat(places): link an expense to a place, the way bookings already do

Recording what a museum ticket or a guided tour cost meant leaving the place,
opening the Costs tab and typing it in again — while a booking has had a Costs
block in its own form all along.

The place form now carries that block. Same component, same flow: with nothing
linked it offers Create expense, which saves the place and then opens the Costs
editor for a new expense pointing at it; once linked it shows the expense with
edit and remove. budget_items gains place_id beside the reservation_id it
already had, with the same nullable FK and the same ON DELETE SET NULL. Desktop
and phone both, and the mobile editor carries the link through its own save path
rather than the desktop one.

The expense belongs to the place, not to a day assignment, so a place sitting on
five days is not five tickets. Hanging it off the assignment would have meant
adding a place to three days quietly creating three expenses and removing a day
quietly deleting one.

Deleting a place takes its expense with it in the same transaction and announces
it, on every path that deletes a place: REST, both MCP tools and the plugin RPC.

Closes #1298

* test(places): teach the RPC stubs about linkedExpenseIds

The delete paths read the linked expense before the place is gone, so the two
hand-built PlacesService stubs threw on the new method instead of reaching the
hook, the remove and the broadcast — four failures out of one missing line.
2026-08-12 21:37:12 +02:00

9.0 KiB
Raw Blame History

Reservations & Bookings

Track all your trip bookings — hotels, restaurants, events, tours, and more — in one place.

Where to find it

Open your trip in the planner and select the Reservations tab. The panel lists all bookings grouped by status, with a type filter bar at the top.

Reservations panel

Reservation types

TREK supports ten reservation types:

Type How to create
Flight Transport modal
Train Transport modal
Car Transport modal
Cruise Transport modal
Hotel Add button in Reservations panel — see Accommodations
Restaurant Add button in Reservations panel
Event Add button in Reservations panel
Tour Add button in Reservations panel
Parking Add button in Reservations panel — a fixed-location booking (e.g. airport parking)
Other Add button in Reservations panel

Transport types (Flight, Train, Car, Cruise) are created through the dedicated Transport modal, where you can enter endpoint and transit-specific fields. All other types are created directly from the Reservations panel.

Pending and Confirmed

Reservations are grouped into two collapsible sections: Pending and Confirmed. You can collapse or expand each section independently — the open/closed state is saved per trip so it persists across page reloads. Status is set when you create or edit a reservation.

On desktop, a type filter bar lets you show only specific types. Filter selections are kept for the current browser session.

Reservation card contents

Each card displays:

  • Status dot — green for Confirmed, amber for Pending
  • Type chip — icon and label for the reservation type
  • Needs review badge — an amber badge shown on reservations flagged by importers that may need your attention
  • Title — the reservation name
  • Edit and delete buttons — visible only if you have edit permission

Admin: Edit and delete buttons are gated by the reservation_edit permission. Members without this permission see read-only cards.

  • Date and time range — start date, and end date/time if set
  • From → To — origin and destination endpoints, shown for transport types
  • Confirmation code — displayed in monospace. If you have Blur booking codes enabled in Display Settings, the code is blurred by default and revealed on hover or tap
  • Type-specific metadata:
    • Flights: airline name, flight number
    • Trains: train number, platform, seat
    • Hotels: check-in window, check-out time (see Accommodations)
  • Location / address — for non-hotel, non-transport types
  • Linked accommodation — hotel name, if this reservation is linked to an accommodation record
  • Day-plan assignment — the day and place this reservation is linked to
  • Notes
  • Attached files — shown as clickable download links

Creating a reservation

Click Add (or the + button) in the Reservations panel. Fill in the form:

  1. Type — choose Hotel, Restaurant, Event, Tour, Parking, or Other
  2. Title — required
  3. Link to day-plan assignment — optional; search across all days and places, grouped by day. Not available for Hotel type
  4. Start date and time — not shown for Hotel type
  5. End date and time — not shown for Hotel type
  6. Location / address — not shown for Hotel type
  7. Confirmation code
  8. Status — Pending or Confirmed
  9. Hotel-specific fields — shown only for Hotel type, immediately after status: hotel place, check-in day, check-out day, check-in time (window start and end), and check-out time. See Accommodations
  10. Notes
  11. Files — attach from your device (PDF, Word documents, text files, images) or link an existing trip file. Files added before saving are uploaded automatically after the reservation is created
  12. Costs — shown only when the Budget addon is enabled. Instead of a price field, the form carries a Create expense button: it saves the booking and then opens the Costs editor for a new expense linked to it, so the expense gets a payer, a split and a date like any other. Once linked, the block shows that expense with edit and remove actions. See Budget-Tracking

Import from booking confirmation

TREK can parse booking confirmation emails, PDFs, and pass files and create reservations automatically using KDE Itinerary.

Supported formats

Format Extension
Booking confirmation email .eml
PDF ticket or confirmation .pdf
Apple Wallet pass .pkpass
HTML confirmation page .html, .htm
Plain-text email .txt

Up to 5 files, 10 MB each, per import.

How to import

  1. Open the Reservations tab.
  2. Click the Import (download) button in the toolbar — the button is only shown when the extractor is available on your server.
  3. Drag and drop your files onto the upload area, or click to browse.
  4. TREK parses each file and shows a preview list of the detected reservations with type, title, dates, endpoints, and confirmation number.
  5. Deselect any items you do not want to import by clicking the × on their card.
  6. Click Confirm to create the selected reservations.

All created reservations appear immediately in the panel and are broadcast to all connected trip members in real time.

What gets created automatically

  • Hotels — a reservation and a linked accommodation row in the day plan (check-in/check-out dates are read from the confirmation).
  • Hotels / Restaurants / Events — the venue is auto-created as a place with coordinates when the extractor returns location data.
  • All types — a budget entry is created if the Budget addon is enabled and a price is present.

When the button is not visible

The Import button is hidden when the kitinerary-extractor binary is not available. The binary ships inside the official TREK Docker image. If you run TREK from source, install the libkitinerary-bin package (Debian trixie / Ubuntu 25.04+) or set KITINERARY_EXTRACTOR_PATH to the binary's full path. See Environment-Variables.

Needs review flag

Items that the extractor could only partially parse are flagged Needs review — an amber badge on the card. Review these reservations after import and fill in any missing fields manually.

AI fallback for hard-to-read files

KDE Itinerary only recognises structured tickets. For confirmations it can't read — plain-text emails, unusual PDF layouts, vendors it doesn't know — TREK can optionally hand the file to an AI model instead. The optional AI Parsing addon runs only for the files Itinerary returns nothing for, parses them in the background, and flags every result for review before you save it. It works with a self-hosted local model, so booking data need not leave your server. See AI-Booking-Import.

Import from AirTrail

With the AirTrail integration addon enabled and your instance connected under Settings → Integrations, the reservations toolbar shows an AirTrail button. It lists the flights from your AirTrail account — flights inside the trip dates come pre-selected — and imports each one as a flight reservation that stays in sync with AirTrail both ways.

Connecting flights (layovers)

When selected flights form a connection — each leg departs from the airport the previous one landed at, onward within 24 hours — the picker groups them and offers to import them as one flight with a layover. The offer is on by default; untick it to keep separate bookings. A joined booking keeps each leg's own airline, flight number, times and seat, the connection airport becomes a layover stop on the route, and each leg files into its own day in the planner. Since a stop is not a destination, the layover country no longer shows up as visited in Atlas.

AirTrail itself has no multi-leg flights, so a joined booking is imported without live sync (it shows the Not synced badge). Its source flights stay recognised — the picker will not offer them for import again. The same applies when you add a stop to a synced single flight by hand: the booking detaches from AirTrail instead of syncing a shape AirTrail cannot represent.

Editing and deleting

Each card has a pencil icon to open the edit form and a trash icon to delete. Deleting requires confirmation in a dialog before the record is removed.

Real-time sync

Reservation changes (create, update, delete) are broadcast instantly to all connected trip members via WebSocket, so everyone sees the latest state without refreshing.


See also: Transport-Flights-Trains-Cars · Accommodations · Budget-Tracking · Documents-and-Files · Trip-Planner-Overview