From 59c2624fa9b7e0ed2ba36b1de713f12fa391542a Mon Sep 17 00:00:00 2001 From: jubnl Date: Mon, 13 Jul 2026 22:33:34 +0200 Subject: [PATCH] docs(wiki): explain the three currencies and how they relate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Trip currency, expense currency and display currency answer three different questions, and nothing said so: the trip currency wasn't documented at all (it had no picker until now), and Budget-Tracking conflated the other two while still claiming 47 currencies and a display currency that always came from Settings. Add a Currencies page as the one place they're defined together — the trip currency as the accounting base, the expense currency as the receipt with its rate frozen at entry, the display currency as presentation-only — plus what happens when a trip's currency changes, which currency a public share renders in, and what belongs to the Costs addon versus the trip itself. Rewrite Budget-Tracking's currency section against it, document the currency field in Creating-a-Trip and the display currency in Display-Settings (which never mentioned it), and note the sharer-or-trip fallback in Public-Share-Links. --- wiki/Budget-Tracking.md | 17 +++++- wiki/Creating-a-Trip.md | 8 +++ wiki/Currencies.md | 109 +++++++++++++++++++++++++++++++++++++ wiki/Display-Settings.md | 16 ++++++ wiki/Home.md | 2 +- wiki/Public-Share-Links.md | 6 +- wiki/_Sidebar.md | 1 + 7 files changed, 154 insertions(+), 5 deletions(-) create mode 100644 wiki/Currencies.md diff --git a/wiki/Budget-Tracking.md b/wiki/Budget-Tracking.md index ca936d9f8..c89f6d339 100644 --- a/wiki/Budget-Tracking.md +++ b/wiki/Budget-Tracking.md @@ -18,9 +18,15 @@ Open the **Budget** tab inside the trip planner. The tab is only visible when th ## Currency -Costs is **multi-currency** (#551). Each expense (line item) is entered in **its own currency** — pick it from the currency picker in the expense modal — and everything is converted to a single **display currency** for totals, charts and settlement. The display currency is your own preferred currency (**Settings → default currency**), falling back to the trip's currency when you haven't set one. 47 currencies are supported. +Costs is **multi-currency** (#551). Three settings are involved, and they do different jobs: -When an item's currency differs from the display currency, the modal shows the converted amount alongside the rate (`1 {from} in {to}`). The exchange rate is **frozen at entry time**, so a settled position keeps the rate it was booked at and doesn't drift as live rates move. +- The **trip currency** (Trip → Edit trip) is the trip's accounting base. Every balance and settle-up is calculated in it. +- Each **expense** carries **its own currency** — pick it in the expense modal and enter what the receipt says (a $100 dinner on a rouble trip is `100 USD`). It is converted into the trip currency at a rate **frozen when you save it**, so a settled debt doesn't reopen when the market moves. +- Your **display currency** (Settings → Display) converts what you *read* — totals, chart, balances — into one currency. It changes nothing that is stored. Left on **Trip currency** (the default), each trip is shown in its own currency. + +165 currencies are supported, with rates from [Frankfurter](https://frankfurter.dev) (no API key needed). When an item's currency differs from the display currency, the modal shows the converted amount alongside the rate (`1 {from} in {to}`), and the ledger row shows both (`$100.00 → 7 668,71 ₽`). + +> **Read [Currencies](Currencies) for the full picture** — how the three interact, what happens when you change a trip's currency, and which currency a public share link is shown in. ## Categories @@ -74,6 +80,10 @@ When multiple members are assigned to expenses and there are outstanding debts b - Transfer flows: who pays whom and how much. - Net balances: each member's overall surplus or deficit. +Balances are always netted in the **trip currency** and converted to your display currency once, at the end — so they stay stable even when the trip mixes currencies. + +A recorded payment carries **its own currency** too: settling a rouble debt with a euro transfer is normal, so the payment modal has a currency picker, and its rate is frozen when you record it. A payment made in another currency shows both amounts in the ledger (`$30.00 → 27,00 €`). + ![Final Settlement](assets/BudgetFinalSettlement.gif) ## Budget summary @@ -89,10 +99,11 @@ Click **Export CSV** in the toolbar to download all expenses as a spreadsheet (r ## Permissions -All write operations (adding/editing/deleting items and categories, changing currency) require the `budget_edit` permission. +All write operations (adding/editing/deleting items and categories, and an expense's currency) require the `budget_edit` permission. The **trip** currency lives on the trip itself, so changing that requires `trip_edit` instead. ## See also +- [Currencies](Currencies) - [Admin-Addons](Admin-Addons) - [Reservations-and-Bookings](Reservations-and-Bookings) - [Trip-Planner-Overview](Trip-Planner-Overview) diff --git a/wiki/Creating-a-Trip.md b/wiki/Creating-a-Trip.md index 731b7caf9..6011e20e3 100644 --- a/wiki/Creating-a-Trip.md +++ b/wiki/Creating-a-Trip.md @@ -28,6 +28,14 @@ If you leave **both** dates empty, a separate **Day count** field appears. Enter You cannot set only one date and leave the other blank via normal interaction — setting a start date auto-fills or adjusts the end date to preserve the previous duration. +### Currency + +The trip's currency — its **accounting base**. Every expense in the Costs tab is converted into it, and every balance and settle-up suggestion is calculated in it. Defaults to **EUR**; 165 currencies are available. + +Pick the currency you will actually settle up in. It is not a cosmetic label, but it is not a one-way door either: you can change it later from the same dialog (with the `trip_edit` permission), and TREK re-bases the existing expenses so no money moves — see [Currencies → Changing the trip currency](Currencies#changing-the-trip-currency). + +> This is **not** the same as the display currency in Settings → Display, which only changes what *you* read. See [Currencies](Currencies). + ### Cover Image The cover image is displayed on the trip card and as the background of the Spotlight card. You can add one in three ways: diff --git a/wiki/Currencies.md b/wiki/Currencies.md new file mode 100644 index 000000000..6e9ced9f9 --- /dev/null +++ b/wiki/Currencies.md @@ -0,0 +1,109 @@ +# Currencies + +TREK has **three** currency settings, and they answer three different questions. Most confusion about the Costs tab comes from mixing them up, so this page is the one place they are defined together. + +| Setting | Where | Question it answers | Affects | +|---|---|---|---| +| **Trip currency** | Trip → Edit trip | *What is this trip's money?* | Stored data — the base every balance is calculated in | +| **Expense currency** | Costs → expense modal | *What currency did I actually pay in?* | Stored data — that one expense | +| **Display currency** | Settings → Display | *What currency do I want to read?* | Presentation only — never the stored data | + +The short version: **the trip currency is the accounting base, the expense currency is the receipt, and the display currency is your reading glasses.** + +## Trip currency + +Every trip has exactly one currency. It is set when you create the trip and can be changed later in the trip edit dialog (requires the `trip_edit` permission). It defaults to **EUR**. + +This is the trip's **accounting base**. It is not a cosmetic label: + +- Every balance, debt and settle-up suggestion is calculated in it. +- Every expense in another currency is converted **into it** and stored with the rate it was converted at. +- It is what the Costs tab falls back to when nobody has expressed a display preference. + +Pick the currency of the place you are travelling to (or the one you will actually settle up in), and you will rarely think about currencies again. + +### Changing the trip currency + +Changing it is **not** a relabelling — it is a re-basing, and TREK does the work for you so that no money moves: + +- Expenses that had no currency of their own (they simply inherited the trip's) are **pinned to the old currency** first. A 9 000 ₽ expense on a trip switching from RUB to EUR stays *9 000 ₽*; it does not silently become 9 000 €. +- Every frozen exchange rate is **re-anchored** to the new base, because a frozen rate is stored relative to the trip currency (see below). + +The numbers you typed are never rewritten. Each expense keeps its original amount, in its original currency, and its real-world value survives the switch — only the base the balances are expressed in changes. + +## Expense currency + +Each expense in the Costs tab carries **its own currency**, chosen in the expense modal. Enter what the receipt says: a $100 dinner on a rouble trip is entered as **100 USD**, not as its rouble equivalent. + +When an expense's currency differs from the trip currency, TREK looks up the live rate **once, at the moment you save it**, and freezes it on the expense. That frozen rate is what converts the expense into the trip currency forever after. + +> **Why freeze it?** Because a debt settled today shouldn't reopen tomorrow. If balances were recomputed at live rates, a settled-up trip would drift back into a few cents of debt every time the FX market moved. The rate you booked at is the rate you owe at. + +Rates come from [Frankfurter](https://frankfurter.dev) (European Central Bank data, no API key needed). **165 currencies** are supported. If the rate lookup fails (the instance is offline, or the upstream is down), the expense is stored without a frozen rate and falls back to live conversion when it is next read — TREK never invents a rate. + +### Settle-up payments + +A payment recorded in **Settle Up** also carries its own currency, for the same reason: settling a rouble debt with a euro transfer is perfectly normal. Its rate is frozen at the moment you record it, exactly like an expense's, so the payment keeps cancelling the debt it was meant to cancel. + +## Display currency + +**Settings → Display → Currency** is a **per-user, presentation-only** preference. It converts what you *read* in the Costs tab — totals, the category chart, balances, the settle-up amounts — into a single currency, so a trip with dollars, yen and roubles in it still adds up to one number you understand. + +It never changes what is stored. Two people looking at the same trip can read it in different currencies and both see correct, consistent balances. + +It has two modes: + +| Value | Behaviour | +|---|---| +| **Trip currency** (the default) | Each trip is shown in **its own** currency. A Tokyo trip reads in yen, a Moscow trip in roubles. | +| A specific currency (e.g. `USD`) | **Every** trip is converted into that currency for you, whatever its own currency is. | + +Leave it on **Trip currency** unless you specifically want everything in your home currency regardless of where you are going. An administrator can set an instance-wide default for new users (Admin → Default User Settings); choosing **Trip currency** yourself overrides it, because it is a deliberate choice rather than an absence of one. + +> Display conversion uses **live** rates, not the frozen ones — it is a view, and a view should reflect today. This is why a converted total can shift slightly day to day while the underlying balances stay rock steady. + +## How they fit together + +An expense flows through all three: + +``` + 100 USD ≈ 7 668 ₽ ≈ 87 € + ┌───────────┐ frozen ┌───────────────┐ live ┌───────────────┐ + │ expense │ ─────────► │ trip │ ─────────► │ display │ + │ currency │ rate │ currency │ rate │ currency │ + └───────────┘ (at entry)└───────────────┘ (at read) └───────────────┘ + what you what the trip is what you read, + actually paid settled in ← balances if you asked for + live here a display currency +``` + +Balances are always netted in the **trip currency** and converted to your display currency **once, at the end** — never per-expense. That ordering is deliberate: netting in a moving display currency would let rounding drift shuffle a settled trip into phantom one-cent debts. + +## The public share link + +A public share page has no logged-in viewer, so it cannot use "your" display currency. It uses **the sharer's display currency, falling back to the trip's own currency** — i.e. a guest sees the trip the way the person who shared it sees it. If the sharer left their display currency on **Trip currency**, guests read the trip in the trip's currency. + +## Relationship with the Costs addon + +The **trip currency lives on the trip itself**, not in the Costs addon — it is set in the trip dialog and remains set even if Costs is disabled. Expense currencies, frozen rates and settle-up all belong to **Costs** (addon id `budget`), which an admin can toggle in [Admin-Addons](Admin-Addons). Turning Costs off hides the money features; it does not clear the trip's currency. + +Changing the trip currency requires `trip_edit`. Adding or editing expenses (and their currencies) requires `budget_edit`. See [Admin-Permissions](Admin-Permissions). + +## Troubleshooting + +**"My balances are huge / nonsense on a trip with a foreign expense."** +Fixed in v3.4.0 (#1543). The settlement was reading the trip currency incorrectly and treating every trip as EUR, which inflated balances on any non-EUR trip that had a foreign-currency expense. Upgrade; no data was damaged and nothing needs fixing by hand. + +**"The totals move slightly from day to day."** +Expected, if your display currency differs from the trip currency: the *display* conversion uses live rates. The underlying balances and debts do not move. + +**"An expense shows an odd converted value."** +Its rate was frozen when it was entered, and the market has moved since. That is by design — see the note above. + +## See also + +- [Budget-Tracking](Budget-Tracking) — the Costs tab +- [Creating-a-Trip](Creating-a-Trip) — where the trip currency is set +- [Display-Settings](Display-Settings) — where the display currency is set +- [Public-Share-Links](Public-Share-Links) +- [Admin-Addons](Admin-Addons) diff --git a/wiki/Display-Settings.md b/wiki/Display-Settings.md index b35df3646..5d992722a 100644 --- a/wiki/Display-Settings.md +++ b/wiki/Display-Settings.md @@ -16,6 +16,21 @@ Choose between three options: | Dark | Always uses the dark theme | | Auto | Follows your operating system / browser preference | +## Currency + +Your **display currency** — the currency you want to *read* amounts in on the Costs tab (totals, the category chart, balances, settle-up). It is presentation only: it never changes what is stored, and two members of the same trip can read it in different currencies and both see correct balances. + +| Option | Behaviour | +|--------|-----------| +| **Trip currency** (default) | Each trip is shown in **its own** currency — a Tokyo trip in yen, a Moscow trip in roubles. | +| A specific currency (e.g. `USD`) | **Every** trip is converted into that currency for you, whatever its own currency is. | + +165 currencies are available. Conversion uses live rates, so a converted total can shift slightly from day to day while the trip's actual balances stay fixed. + +> This is **not** the trip's currency, which is set on the trip itself and is the base its balances are calculated in. The distinction matters — see [Currencies](Currencies). + +An administrator can set the instance-wide default for new users in Admin → Default User Settings. Choosing **Trip currency** yourself overrides it. + ## Language Select your preferred language from the button grid (desktop) or dropdown (mobile). The change takes effect immediately without a page reload. See [Languages](Languages) for the full list of supported languages. @@ -52,5 +67,6 @@ When enabled, confirmation codes and reference numbers are blurred until you hov ## See also +- [Currencies](Currencies) - [Languages](Languages) - [User-Settings](User-Settings) diff --git a/wiki/Home.md b/wiki/Home.md index 81f8ff682..a934fb7c4 100644 --- a/wiki/Home.md +++ b/wiki/Home.md @@ -16,7 +16,7 @@ TREK is a self-hosted, real-time collaborative travel planner licensed under AGP ### Travel Management - **Reservations & Bookings** — track flights, accommodations, restaurants with confirmation numbers and file attachments -- **Budget Tracking** — category-based expenses with pie chart, per-person/per-day splitting, multi-currency support +- **Budget Tracking** — category-based expenses with pie chart, per-person/per-day splitting, multi-currency support (see [Currencies](Currencies)) - **Packing Lists** — category-based checklists with user assignment, templates, and progress tracking - **Document Manager** — attach documents, tickets, and PDFs to trips, places, or reservations (up to 50 MB per file) - **PDF Export** — export complete trip plans as PDF with cover page, images, and notes diff --git a/wiki/Public-Share-Links.md b/wiki/Public-Share-Links.md index 6a8954ece..a28a5070a 100644 --- a/wiki/Public-Share-Links.md +++ b/wiki/Public-Share-Links.md @@ -34,6 +34,10 @@ When creating or updating a share link you choose what the recipient can see. Th Disabled toggles hide the corresponding tab from the public viewer entirely. Permission changes take effect immediately — you do not need to recreate the link. +### Which currency guests see + +A public viewer has no account, so there is no "their" display currency to use. The Budget tab is rendered in **the sharer's display currency, falling back to the trip's own currency** — in other words, a guest sees the money the way the person who shared the trip sees it. If the sharer leaves their display currency on **Trip currency** (the default), guests read the trip in the trip's own currency. See [Currencies](Currencies). + ## What the public viewer shows The shared trip page renders a branded read-only interface with a dark hero header showing the trip title, description, and date range. A tab bar at the top provides access to the sections you enabled. The viewer can switch the display language using a language picker in the top-right corner. @@ -52,4 +56,4 @@ The Travel Journal (Journey addon) has a separate share mechanism with its own t ## Related pages -[Trip-Members-and-Sharing](Trip-Members-and-Sharing) · [Journey-Journal](Journey-Journal) · [Real-Time-Collaboration](Real-Time-Collaboration) +[Trip-Members-and-Sharing](Trip-Members-and-Sharing) · [Currencies](Currencies) · [Journey-Journal](Journey-Journal) · [Real-Time-Collaboration](Real-Time-Collaboration) diff --git a/wiki/_Sidebar.md b/wiki/_Sidebar.md index f19759693..b26950a91 100644 --- a/wiki/_Sidebar.md +++ b/wiki/_Sidebar.md @@ -40,6 +40,7 @@ - [[Transport: Flights, Trains, Cars|Transport-Flights-Trains-Cars]] - [[Accommodations]] - [[Budget Tracking|Budget-Tracking]] +- [[Currencies]] - [[Packing Lists|Packing-Lists]] - [[Packing Templates|Packing-Templates]] - [[Todos and Tasks|Todos-and-Tasks]]