From 166b0d8ab3c4ca0e426552a694cb8fa5332bd6a8 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 24 Oct 2026 23:20:30 +0200 Subject: [PATCH] Update the Costs and Currencies pages for delete confirmation, offline receipts, decimals and the trip currency location --- wiki/Budget-Tracking.md | 32 ++++++++++++++++++++++++++------ wiki/Currencies.md | 20 +++++++++++++------- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/wiki/Budget-Tracking.md b/wiki/Budget-Tracking.md index b507d44f7..b834994fe 100644 --- a/wiki/Budget-Tracking.md +++ b/wiki/Budget-Tracking.md @@ -19,7 +19,9 @@ The tab opens with the same bar as Transports, Bookings, Lists and Files. From l - The **Filter** button (funnel). Its popover holds the **All / Paid by me / I'm owed** switch, a **Category** list and a **Day** list with the days that have expenses. The button shows how many filters are on, and **Reset filters** at the foot of the popover switches them all off. - **Export CSV** (download icon), see [Exporting](#exporting). - **List** and **Table** (two icons), which switch the tab between the expense ledger and the [Table view](#table-view). The list is where Costs opens; the choice is remembered in this browser. -- For members who may edit costs: **Settle up**, **Scan receipt** (only with the AI Parsing addon, see [Scanning a receipt](#scanning-a-receipt)) and **Add expense**. +- For members who may edit costs: **Settle up**, **Scan receipt** (only with the AI Parsing addon and a model that reads images, see [Scanning a receipt](#scanning-a-receipt)) and **Add expense**. + +On a phone, the Costs tab shows the summary on top, the ledger below it, and a scan icon in the header when receipt scanning is available. Adding an expense opens a sheet, and the ticket split works there too. In a window narrower than 1024 px the tab stacks into one column: the total on a dark card with **Add expense** under it, then the summary cards, the settle-up list and the ledger with its own search and filters. @@ -27,7 +29,7 @@ In a window narrower than 1024 px the tab stacks into one column: the total on a Costs is **multi-currency** (#551). Three settings are involved, and they do different jobs: -- The **trip currency** (Trip → Edit trip) is the trip's accounting base. Every balance and settle-up is calculated in it. +- The **trip currency** (set in the trip's dialog on My Trips: the pencil on the trip card, **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 dialog 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 does not reopen when the market moves. - Your **display currency** (Settings → General → Language & region → **Display currency**) converts what you *read* (totals, balances, the ledger) into one currency. It changes nothing that is stored. Left on **Trip currency** (the default), each trip is shown in its own currency. @@ -57,7 +59,7 @@ An expense row shows: - the **note** as a pill; click it to read the whole note, click again to fold it, - the **total**, and under it a green **you lent** or red **you borrowed** chip when the split leaves you up or down on it. -Beside the row, members who may edit costs find a pencil that opens the expense and a bin that deletes it straight away, without asking. A payment row has a pencil and **Undo** instead. +Beside the row, members who may edit costs find a pencil that opens the expense and a bin that deletes it. TREK asks first (*Delete expense?*, with *"{name}" will be permanently deleted.*), on the desktop and on the phone. When the expense has receipts, the question adds *Its receipt files stay in Files.* A payment row has a pencil and **Undo** instead. The filters work together: pick a day and a banner above the list names the day in full, with the number of expenses and their total. Payments carry no name or category, so a search or a category filter hides them; **I'm owed** hides them too, and **Paid by me** keeps only the transfers you are part of. @@ -100,7 +102,9 @@ On the phone the booking, transport and place sheets carry the same block. Tap a ### Receipts and invoices -An expense can carry the receipt or invoice behind it. **Attach** in the **Receipts & Invoices** block of the expense dialog opens the file picker for images and PDFs, and several files can go on one expense. They are uploaded when the expense is saved, land in the trip's Files with a link to the expense, and are listed in the block from then on; click a name to view it. If the save fails after the upload, the uploaded files are taken back out again; any that could not be removed are reported, so you can delete them in the Files tab. +An expense can carry the receipt or invoice behind it. **Attach** in the **Receipts & Invoices** block of the expense dialog opens the file picker for images and PDFs, and several files can go on one expense. They are uploaded when the expense is saved, land in the trip's Files with a link to the expense, and are listed in the block from then on; click a name to view it. If the save fails after the upload, the uploaded files are taken back out again. Any that could not be removed are reported (*Save failed, and 1 uploaded receipt is still there. Remove it in the Files tab.*), so you can delete them there. + +Receipts need a connection. If you are offline, the dialog says *Receipts need a connection to upload. Remove the new ones to save the expense offline, or save once you are back online.* An expense without new receipts can be saved offline. A row with receipts shows a **Receipts** chip beside the name, with the count when there is more than one. Click it to open the viewer: it shows one receipt at a time, pages through them with the **arrow keys**, and offers a download for a PDF. @@ -108,7 +112,7 @@ The bin beside a receipt (**Remove receipt**) only unlinks the file from the exp ### Scanning a receipt -With the [AI Parsing](AI-Booking-Import) addon on and a model that reads images (see *Model reads images* there), **Scan receipt** sits beside **Add expense**, and on a phone the Costs header carries a scan icon. It is offered to whoever may add expenses. +With the [AI Parsing](AI-Booking-Import) addon on and a model that reads images (see *Model reads images* there), **Scan receipt** sits beside **Add expense**, and on a phone the Costs header carries a scan icon. It is offered to whoever may add expenses. The model that reads the receipt can be the AI connection shared with the AI assistant; whether it reads images is the AI Parsing addon's own *Model reads images* setting. See [AI-Booking-Import](AI-Booking-Import#which-connection-reads-your-files). 1. Click **Scan receipt**. The **Scan a receipt** dialog takes one photo of the receipt (JPG, PNG or WEBP, up to 10 MB; a photo over 40 megapixels or a WEBP over 3.5 MB is refused): drop it on the box, or click the box to pick one or, on a phone, take one. Then click **Scan**. 2. The dialog closes and the model reads the photo in the background: the **background tasks** widget shows *Reading the receipt…*, and you can keep using TREK meanwhile. On a local model running on CPU this takes from a few seconds to a couple of minutes. @@ -147,7 +151,7 @@ Costs works out the smallest number of transfers that settles every debt (a gree The final budget comes to each member's share of the paid expenses (exact in the trip's own currency; in another display currency, rounding can leave a single figure a cent off while the column still adds up), so recording a payment moves an amount from *pending* to *net reimbursements* without changing it. An expense nobody has paid yet stays out of it, as it stays out of the balances. -**Settle up** in the bar at the top of the tab records every open transfer at once, without asking. **Add payment** in the head of the Settle up card records a single transfer by hand, for a repayment that did not follow a suggested one. Recorded payments then appear in the ledger as their own rows, with the pencil and **Undo** beside them. +**Settle up** in the bar at the top of the tab records every open transfer at once, without asking. **Add payment** in the head of the Settle up card records a single transfer by hand, for a repayment that did not follow a suggested one. Recorded payments then appear in the ledger as their own rows, with the pencil and **Undo** beside them. Offline, a payment is saved in the queue (*You are offline. The payment is saved and shows up once TREK is back online.*) and sent when TREK is back online. ![The Add payment dialog with From and To, the amount, its currency and the day](assets/CostsSettleUp.png) @@ -155,6 +159,22 @@ The **Add payment** dialog has **From** and **To** (the head band reads *You → 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. An expense or payment in a foreign currency for which no exchange rate is known yet is left out of the balances and totals rather than counted 1:1; see [Currencies](Currencies#expense-currency). +## Members who left and deleted guests + +Someone who has left the trip is still named in the lists and keeps their balance, so the settlement stays correct. Deleting a guest keeps the costs adding up: their payments are not dropped from the totals. + +## Currency decimals + +Amounts follow each currency's own decimals and format. Currencies without decimals, such as the Korean won and the Japanese yen, are shown and settled in whole units, so the suggested transfers in **Settle up** add up and settling them clears the balances. A payment counts on the day it happened in your local time. See [Currencies](Currencies). + +## Offline + +Expenses and payments you save while offline wait in a queue and sync when TREK is back online. Receipts are the exception, see [Receipts and invoices](#receipts-and-invoices). + +## AI assistant + +The in-app AI assistant can propose expenses, payments and settle-ups as cards in the chat, and give cost estimates for a trip. Nothing is saved until you confirm a card. + ## Costs summary Four cards sit above the ledger: diff --git a/wiki/Currencies.md b/wiki/Currencies.md index fd503cb82..933cd7fb0 100644 --- a/wiki/Currencies.md +++ b/wiki/Currencies.md @@ -4,7 +4,7 @@ TREK has **three** currency settings, and they answer three different questions. | 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 | +| **Trip currency** | My Trips → pencil on the trip card (**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 → General → Language & region | *What currency do I want to read?* | Presentation only, never the stored data | @@ -12,7 +12,7 @@ The short version: **the trip currency is the accounting base, the expense curre ## 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). The new-trip dialog pre-fills it with **your display currency**, falling back to **EUR** when you have left that on *Trip currency*. A trip created through MCP or by a plugin without a currency gets the same value. This is the one moment the display currency touches stored data: it seeds the field, and from then on the trip's currency is its own. +Every trip has exactly one currency. It is set when you create the trip and can be changed later in the same dialog: on **My Trips**, click the pencil on the trip card (**Edit Trip**). This needs the `trip_edit` permission. The **Trip settings** pill beside the trip name in the planner does not hold the currency; it only holds People, Sharing and Journal. The new-trip dialog pre-fills it with **your display currency**, falling back to **EUR** when you have left that on *Trip currency*. A trip created through MCP or by a plugin without a currency gets the same value. This is the one moment the display currency touches stored data: it seeds the field, and from then on the trip's currency is its own. This is the trip's **accounting base**. It is not a cosmetic label: @@ -46,7 +46,11 @@ Rates come from [Frankfurter](https://frankfurter.dev) (European Central Bank da ### 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. +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. A payment counts on the local day you give it, not on the day of the server. + +## Decimals and formats + +Every currency is shown with its own number of decimals. Most use two. The Japanese yen, Korean won, Vietnamese dong, Chilean peso, Icelandic krona and Hungarian forint have none, and the Bahraini, Iraqi, Jordanian, Kuwaiti, Libyan, Omani and Tunisian currencies have three. Amounts you type follow the same rule, and the suggested transfers in **Settle up** for won and yen are whole units, so the balances add up and settling clears them. ## Display currency @@ -65,6 +69,8 @@ Leave it on **Trip currency** unless you specifically want everything in your ho An administrator can set an instance-wide default (Admin → User Defaults), and it interacts with **Trip currency**: picking **Trip currency** stores an *empty* value, and an empty value on a defaultable setting counts as "not set", so the admin's currency is applied again (#1634). While an instance-wide default currency is configured, there is no way back to per-trip currencies from the Settings page; the admin has to clear it. +> The **Currency** converter widget on the dashboard is a separate tool. It converts an amount between two currencies and has no effect on trips or stored costs. See [Dashboard-Widgets](Dashboard-Widgets). + > 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. An expense you enter in your display currency reads back exactly as you typed it on the day you enter it, on its row, in the totals and in the final budget, and paying the amount settle-up offers for it leaves both balances at zero. When the rate has moved since, the row shows the value the totals count, with what was entered and the trip-currency amount it was booked at underneath (`$801.76 → 685,26 €`). @@ -92,7 +98,7 @@ A public share page has no logged-in viewer, so it cannot use "your" display cur ## 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. +The **trip currency lives on the trip itself**, not in the Costs addon. It is set in the trip's create and edit 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). @@ -112,8 +118,8 @@ Its rate was frozen when it was entered, and the market has moved since. That is ## 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 +- [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)