mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 13:10:29 +00:00
feat(costs): read a trip in another currency from the Costs tab (#1683)
Costs always converted to the display currency from Settings, so a trip that moves on to another country could not be read in its new local currency. A picker in the Costs bar (beside the Expenses heading on the phone) now reads one trip in any currency; the server already settles in any base. The pick is per trip and kept in this browser, nothing stored.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { useTranslation } from '../../i18n';
|
||||
import CustomSelect from '../shared/CustomSelect';
|
||||
import { Tooltip } from '../shared/Tooltip';
|
||||
|
||||
/**
|
||||
* Which currency Costs shows the trip in (#1683): a compact select with the
|
||||
* usual currency and the trip's own on top. Desktop bar, narrow window and phone
|
||||
* tab alike; the pick itself lives in useCostsCurrency.
|
||||
*/
|
||||
export function CostsCurrencyPicker({
|
||||
value,
|
||||
options,
|
||||
onChange,
|
||||
}: {
|
||||
value: string;
|
||||
options: { value: string; label: string }[];
|
||||
onChange: (currency: string) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Tooltip label={t('costs.showIn')}>
|
||||
<div className="w-[92px] flex-none">
|
||||
<CustomSelect
|
||||
ariaLabel={t('costs.showIn')}
|
||||
value={value}
|
||||
onChange={(v) => onChange(String(v))}
|
||||
options={options}
|
||||
size="sm"
|
||||
searchable
|
||||
menuFit="content"
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</div>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
@@ -741,7 +741,7 @@ describe('CostsPanel — settlements in the ledger', () => {
|
||||
await user.click(await screen.findByRole('button', { name: 'Add payment' }))
|
||||
await user.type(await screen.findByPlaceholderText('0,00'), '25')
|
||||
// Bob paid me back in dollars — the server freezes the USD rate on write.
|
||||
await user.click(screen.getByText(/^EUR/))
|
||||
await user.click(within(screen.getByRole('dialog')).getByText(/^EUR/))
|
||||
await user.click(await screen.findByText(/^USD/))
|
||||
const addButtons = screen.getAllByRole('button', { name: 'Add payment' })
|
||||
await user.click(addButtons[addButtons.length - 1])
|
||||
@@ -1451,7 +1451,7 @@ describe('CostsPanel — expense modal', () => {
|
||||
|
||||
await user.type(screen.getByPlaceholderText('e.g. Dinner, souvenirs, gas…'), 'Diner')
|
||||
await user.type(screen.getAllByPlaceholderText('0,00')[0], '100')
|
||||
await user.click(screen.getByText(/^EUR/))
|
||||
await user.click(within(screen.getByRole('dialog')).getByText(/^EUR/))
|
||||
await user.click(await screen.findByText(/^USD/))
|
||||
|
||||
expect(screen.getByText('live rate', { exact: false })).toBeInTheDocument()
|
||||
@@ -2493,7 +2493,7 @@ describe('CostsPanel: a bill entered in the display currency (#2525)', () => {
|
||||
// Seeding the display currency here would label 100 euro as 100 dollars, and a
|
||||
// plain save would then store it that way.
|
||||
expect(screen.getByText(/^EUR/)).toBeInTheDocument()
|
||||
expect(screen.queryByText(/^USD/)).toBeNull()
|
||||
expect(within(screen.getByRole('dialog')).queryByText(/^USD/)).toBeNull()
|
||||
|
||||
// Saving without touching anything keeps the 100 euro.
|
||||
await user.click(screen.getByRole('button', { name: 'Save' }))
|
||||
|
||||
@@ -32,6 +32,7 @@ import { FlowPills } from './FlowPills'
|
||||
import { CostsSplitChips } from './CostsSplitChips'
|
||||
import { CostsModeCard } from './CostsModeCard'
|
||||
import { CostsCategoryBreakdown } from './CostsCategoryBreakdown'
|
||||
import { CostsCurrencyPicker } from './CostsCurrencyPicker'
|
||||
import type { BudgetParticipantFinal, ReceiptLine } from '@trek/shared'
|
||||
import type { BudgetItem, BudgetItemReceipt } from '../../types'
|
||||
import type { TripMember } from './BudgetPanelMemberChips'
|
||||
@@ -76,7 +77,7 @@ export default function CostsPanel({ tripId, tripMembers = [] }: CostsPanelProps
|
||||
me, base, tripCurrency, ctx, settlement, settlementError, loadSettlement, knownNames, splitting,
|
||||
search, setSearch, segment: filter, setSegment: setFilter, catFilter, setCatFilter, dayFilter, setDayFilter,
|
||||
totals, filtered, filteredSettlements, catBreakdown, leftOutLabel, toggleLeftOutCat, countAllCats, exportCsv: handleExportCsv,
|
||||
deleteExpense: handleDelete, undoSettlement, settleFlow, settleAll,
|
||||
deleteExpense: handleDelete, undoSettlement, settleFlow, settleAll, setBase, baseOptions,
|
||||
} = useCostsLedger({
|
||||
tripId, trip, budgetItems, memberCount: tripMembers.length, actions: { loadBudgetItems, deleteBudgetItem }, canEdit, t, toast,
|
||||
settlementOnTripChange: true, skipUnfinishedShares: true, csvCurrencyAsStored: true,
|
||||
@@ -273,7 +274,7 @@ export default function CostsPanel({ tripId, tripMembers = [] }: CostsPanelProps
|
||||
canEdit={canEdit} canSettle={(settlement?.flows || []).length > 0}
|
||||
onSettleAll={settleAll} onAddExpense={() => { setEditing(null); setModalOpen(true) }}
|
||||
onScanReceipt={receiptScan.offered ? receiptScan.open : undefined}
|
||||
view={view} onView={setView}
|
||||
view={view} onView={setView} currency={{ value: base, options: baseOptions, onChange: setBase }}
|
||||
filters={{
|
||||
query: search, onQuery: setSearch,
|
||||
owner: filter, onOwner: setFilter,
|
||||
@@ -557,7 +558,8 @@ export default function CostsPanel({ tripId, tripMembers = [] }: CostsPanelProps
|
||||
{/* Expenses */}
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
|
||||
<div className="text-content" style={{ fontSize: 'calc(19px * var(--fs-scale-subtitle, 1))', fontWeight: 700, letterSpacing: '-0.02em' }}>{t('costs.expenses')}</div>
|
||||
<div className="text-content" style={{ fontSize: 'calc(19px * var(--fs-scale-subtitle, 1))', fontWeight: 700, letterSpacing: '-0.02em', marginInlineEnd: 'auto' }}>{t('costs.expenses')}</div>
|
||||
<CostsCurrencyPicker value={base} options={baseOptions} onChange={setBase} />
|
||||
<Tooltip label={t('budget.exportCsv')}>
|
||||
<button type="button" onClick={handleExportCsv} aria-label={t('budget.exportCsv')} disabled={!budgetItems.length}
|
||||
className="bg-surface-card border border-edge text-content-muted disabled:opacity-40"
|
||||
@@ -602,7 +604,6 @@ export default function CostsPanel({ tripId, tripMembers = [] }: CostsPanelProps
|
||||
{BalancesList({ balances: settlement?.balances || [] })}
|
||||
</div>
|
||||
|
||||
{/* Final budget */}
|
||||
<div className={cardCls} style={{ borderRadius: 18, padding: 16 }}>
|
||||
<div className={labelCls} style={{ marginBottom: 14 }}>{t('costs.finalBudget')}</div>
|
||||
{FinalBudgetList()}
|
||||
@@ -1362,7 +1363,6 @@ export function ExpenseModal({ tripId, base, people, me, editing, prefill, onClo
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Nothing to split on a trip of one (#2689). */}
|
||||
{showSplit && payerSection}
|
||||
{showSplit && splitSection}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// FE-COSTSBAR-001 to FE-COSTSBAR-014
|
||||
// FE-COSTSBAR-001 to FE-COSTSBAR-015
|
||||
import { describe, it, expect, vi } from 'vitest'
|
||||
import { render, screen, fireEvent, within } from '../../../tests/helpers/render'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
@@ -83,6 +83,17 @@ describe('CostsToolbar', () => {
|
||||
expect(screen.queryByRole('button', { name: 'Scan receipt' })).toBeNull()
|
||||
})
|
||||
|
||||
it('FE-COSTSBAR-015: shows the currency the tab reads in, and reports another one picked (#1683)', async () => {
|
||||
const user = userEvent.setup()
|
||||
const onChange = vi.fn()
|
||||
setup({ currency: { value: 'EUR', options: [{ value: 'EUR', label: 'EUR €' }, { value: 'VND', label: 'VND ₫' }], onChange } })
|
||||
const picker = screen.getByRole('button', { name: 'Show amounts in' })
|
||||
expect(picker).toHaveTextContent('EUR')
|
||||
await user.click(picker)
|
||||
await user.click(await screen.findByText(/^VND\s/))
|
||||
expect(onChange).toHaveBeenCalledWith('VND')
|
||||
})
|
||||
|
||||
describe('search and filters', () => {
|
||||
function filters(over: Partial<CostsFilterProps> = {}): CostsFilterProps {
|
||||
return {
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { TripMember } from './BudgetPanelMemberChips'
|
||||
import { Tooltip } from '../shared/Tooltip'
|
||||
import { POPOVER, POPOVER_CAPTION, POPOVER_DIVIDER, useDismissOnOutside } from '../Packing/packingPopoverStyles'
|
||||
import { PopoverItem } from '../Packing/PackingPopover'
|
||||
import { CostsCurrencyPicker } from './CostsCurrencyPicker'
|
||||
|
||||
export type OwnerFilter = 'all' | 'mine' | 'owed'
|
||||
/** The day-by-day list, or the categorized table the old budget had. */
|
||||
@@ -51,6 +52,8 @@ interface CostsToolbarProps {
|
||||
/** The switch between the list and the table; left out, the bar has none. */
|
||||
view?: CostsView
|
||||
onView?: (view: CostsView) => void
|
||||
/** Which currency the tab shows the trip in (#1683); left out, the bar has no picker. */
|
||||
currency?: Parameters<typeof CostsCurrencyPicker>[0]
|
||||
}
|
||||
|
||||
const BODY_SIZE = 'calc(13px * var(--fs-scale-body, 1))'
|
||||
@@ -62,7 +65,7 @@ const BAR_BTN = 'relative grid h-9 w-9 flex-none place-items-center rounded-[10p
|
||||
* Bookings, Lists and Files open with: the tab's name and what the numbers
|
||||
* cover, then how to narrow the ledger and the actions on the right.
|
||||
*/
|
||||
export default function CostsToolbar({ dateMeta, people, me, colorFor, canEdit, canSettle, splitting = true, onSettleAll, onAddExpense, onScanReceipt, filters, view, onView }: CostsToolbarProps) {
|
||||
export default function CostsToolbar({ dateMeta, people, me, colorFor, canEdit, canSettle, splitting = true, onSettleAll, onAddExpense, onScanReceipt, filters, view, onView, currency }: CostsToolbarProps) {
|
||||
const { t } = useTranslation()
|
||||
const searchRef = useRef<HTMLInputElement>(null)
|
||||
const chip = 'inline-flex items-center whitespace-nowrap rounded-full bg-surface-card px-3 py-1.5 font-medium text-content-muted shadow-sm'
|
||||
@@ -130,6 +133,8 @@ export default function CostsToolbar({ dateMeta, people, me, colorFor, canEdit,
|
||||
</>
|
||||
)}
|
||||
|
||||
{currency && <CostsCurrencyPicker {...currency} />}
|
||||
|
||||
{view && onView && (
|
||||
// The same switch the Bookings bar has for its views.
|
||||
<div role="group" aria-label={t('costs.view.label')} className="inline-flex flex-none rounded-[10px] bg-surface-card p-[3px]">
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
// FE-BUDGET-COSTSCUR-001 to FE-BUDGET-COSTSCUR-003
|
||||
import { act, renderHook } from '@testing-library/react';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { buildTrip } from '../../../tests/helpers/factories';
|
||||
import { resetAllStores } from '../../../tests/helpers/store';
|
||||
import { useSettingsStore } from '../../store/settingsStore';
|
||||
import { useCostsCurrency } from './useCostsCurrency';
|
||||
|
||||
const trip = buildTrip({ id: 7, currency: 'VND' });
|
||||
|
||||
function setDisplayCurrency(currency: string) {
|
||||
useSettingsStore.setState((s) => ({ settings: { ...s.settings, default_currency: currency } }));
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
resetAllStores();
|
||||
localStorage.removeItem('trek:costs-currency:7');
|
||||
localStorage.removeItem('trek:costs-currency:8');
|
||||
});
|
||||
|
||||
describe('useCostsCurrency (#1683)', () => {
|
||||
it('FE-BUDGET-COSTSCUR-001: reads in the display currency, else in the trip currency, both on top of the picker', () => {
|
||||
setDisplayCurrency('SGD');
|
||||
const { result } = renderHook(() => useCostsCurrency(7, trip));
|
||||
expect(result.current.base).toBe('SGD');
|
||||
expect(result.current.baseOptions.slice(0, 2).map((o) => o.value)).toEqual(['SGD', 'VND']);
|
||||
setDisplayCurrency('');
|
||||
expect(renderHook(() => useCostsCurrency(7, trip)).result.current.base).toBe('VND');
|
||||
});
|
||||
|
||||
it('FE-BUDGET-COSTSCUR-002: another currency is kept for this trip in this browser, and the usual one drops it', () => {
|
||||
setDisplayCurrency('SGD');
|
||||
const { result, rerender } = renderHook(({ id }) => useCostsCurrency(id, trip), { initialProps: { id: 7 } });
|
||||
act(() => result.current.setBase('vnd'));
|
||||
expect(result.current.base).toBe('VND');
|
||||
expect(localStorage.getItem('trek:costs-currency:7')).toBe('VND');
|
||||
// Opened again later, the trip still reads in it; another trip does not.
|
||||
expect(renderHook(() => useCostsCurrency(7, trip)).result.current.base).toBe('VND');
|
||||
rerender({ id: 8 });
|
||||
expect(result.current.base).toBe('SGD');
|
||||
rerender({ id: 7 });
|
||||
act(() => result.current.setBase('SGD'));
|
||||
expect(result.current.base).toBe('SGD');
|
||||
expect(localStorage.getItem('trek:costs-currency:7')).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-BUDGET-COSTSCUR-003: once the pick is dropped, a new display currency in Settings applies again', () => {
|
||||
setDisplayCurrency('SGD');
|
||||
const { result } = renderHook(() => useCostsCurrency(7, trip));
|
||||
act(() => result.current.setBase('SGD'));
|
||||
act(() => setDisplayCurrency('EUR'));
|
||||
expect(result.current.base).toBe('EUR');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,54 @@
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { useSettingsStore } from '../../store/settingsStore';
|
||||
import type { Trip } from '../../types';
|
||||
import { currencyOptions } from './costsModel';
|
||||
|
||||
const storageKey = (tripId: number) => `trek:costs-currency:${tripId}`;
|
||||
|
||||
/** The currency picked for one trip's Costs in this browser, or null for the usual one. */
|
||||
function readPicked(tripId: number): string | null {
|
||||
try {
|
||||
return localStorage.getItem(storageKey(tripId));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function writePicked(tripId: number, currency: string | null) {
|
||||
try {
|
||||
if (currency) localStorage.setItem(storageKey(tripId), currency);
|
||||
else localStorage.removeItem(storageKey(tripId));
|
||||
} catch {
|
||||
/* storage unavailable: the choice lasts until reload */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The currency Costs shows a trip in (#1683). Usually the user's display currency
|
||||
* from Settings, else the trip's own; a trip can be read in another one, say the
|
||||
* currency of the country the travellers go on to, without touching Settings or
|
||||
* anything stored. The pick is per trip and kept in this browser, like the
|
||||
* list or table view: it is how this person reads the trip, not part of it. The
|
||||
* server converts the settlement into whatever base it is asked for.
|
||||
*/
|
||||
export function useCostsCurrency(tripId: number, trip: Trip | null | undefined) {
|
||||
const displayCurrency = useSettingsStore((s) => s.settings.default_currency);
|
||||
const usual = (displayCurrency || trip?.currency || 'EUR').toUpperCase();
|
||||
const stored = useMemo(() => readPicked(tripId), [tripId]);
|
||||
const [pickedByTrip, setPickedByTrip] = useState<Record<number, string | null>>({});
|
||||
const picked = tripId in pickedByTrip ? pickedByTrip[tripId] : stored;
|
||||
const base = (picked || usual).toUpperCase();
|
||||
|
||||
// Picking the usual currency drops the pick, so a later change in Settings applies again.
|
||||
const setBase = (next: string) => {
|
||||
const currency = next.toUpperCase() === usual ? null : next.toUpperCase();
|
||||
writePicked(tripId, currency);
|
||||
setPickedByTrip((prev) => ({ ...prev, [tripId]: currency }));
|
||||
};
|
||||
|
||||
// The usual currency and the trip's own lead the list, the two most read in.
|
||||
const baseOptions = currencyOptions(base, [usual, (trip?.currency || usual).toUpperCase()]);
|
||||
|
||||
return { base, usual, setBase, baseOptions };
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import type { CostsSettlementResponse } from './costsModel';
|
||||
import { useCostsLedger } from './useCostsLedger';
|
||||
import { useFreezeMissingRates } from './useFreezeMissingRates';
|
||||
|
||||
// FE-BUDGET-LEDGER-001 to FE-BUDGET-LEDGER-016
|
||||
// FE-BUDGET-LEDGER-001 to FE-BUDGET-LEDGER-017
|
||||
|
||||
const fx = vi.hoisted(() => ({
|
||||
// One stable converter, the way useExchangeRates hands out a memoised one: USD is half a euro.
|
||||
@@ -291,6 +291,22 @@ describe('useCostsLedger: categories left out (#2819)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('useCostsLedger: another currency for this trip (#1683)', () => {
|
||||
it('FE-BUDGET-LEDGER-017: the balances are read again in the currency picked, and the settle-ups go out in it', async () => {
|
||||
localStorage.removeItem('trek:costs-currency:7');
|
||||
const { result } = setup();
|
||||
await waitFor(() => expect(result.current.settlement).toEqual(SETTLEMENT));
|
||||
act(() => result.current.setBase('USD'));
|
||||
expect(result.current.base).toBe('USD');
|
||||
await waitFor(() => expect(settlementMock()).toHaveBeenLastCalledWith(7, 'USD', expect.anything()));
|
||||
await act(async () => {
|
||||
await result.current.settleFlow(1, 2, 15);
|
||||
});
|
||||
expect(createMock()).toHaveBeenCalledWith(7, expect.objectContaining({ amount: 15, currency: 'USD' }));
|
||||
localStorage.removeItem('trek:costs-currency:7');
|
||||
});
|
||||
});
|
||||
|
||||
describe('useCostsLedger: writes', () => {
|
||||
it('FE-BUDGET-LEDGER-009: deleting an expense reads the settlement again, a failure toasts', async () => {
|
||||
const { result } = setup();
|
||||
|
||||
@@ -7,7 +7,6 @@ import { useNetworkMode } from '../../hooks/useNetworkMode';
|
||||
import { useTranslation } from '../../i18n';
|
||||
import { budgetRepo, type SettlementWriteResult } from '../../repo/budgetRepo';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
import { useSettingsStore } from '../../store/settingsStore';
|
||||
import type { TripStoreState } from '../../store/tripStore';
|
||||
import { useServerPing } from '../../sync/useServerPing';
|
||||
import type { BudgetItem, Trip } from '../../types';
|
||||
@@ -28,6 +27,7 @@ import {
|
||||
type CostsSettlementResponse,
|
||||
} from './costsModel';
|
||||
import { knownPersonNames } from './CostsPanel.helpers';
|
||||
import { useCostsCurrency } from './useCostsCurrency';
|
||||
import { useFreezeMissingRates } from './useFreezeMissingRates';
|
||||
|
||||
/** The events after which the balances are read again from the server. */
|
||||
@@ -95,11 +95,11 @@ export function useCostsLedger({
|
||||
const me = useAuthStore((s) => s.user?.id ?? -1);
|
||||
|
||||
// Display/base currency = the user's preferred currency (Settings), falling back
|
||||
// to the trip's own currency. Everything in Costs is converted to and shown in it.
|
||||
const displayCurrency = useSettingsStore((s) => s.settings.default_currency);
|
||||
const base = (displayCurrency || trip?.currency || 'EUR').toUpperCase();
|
||||
// to the trip's own currency, unless this trip is read in another one (#1683).
|
||||
// Everything in Costs is converted to and shown in it.
|
||||
const { base, usual, setBase, baseOptions } = useCostsCurrency(tripId, trip);
|
||||
// Pre-rework rows stored currency = NULL, meaning "the trip's own currency".
|
||||
const tripCurrency = (trip?.currency || base).toUpperCase();
|
||||
const tripCurrency = (trip?.currency || usual).toUpperCase();
|
||||
// Anchored on the trip currency's quote, the one the server books with (#2525).
|
||||
const { convert, displayPerTrip } = useExchangeRates(base, tripCurrency);
|
||||
const ctx: CostsCtx = useMemo(
|
||||
@@ -326,6 +326,8 @@ export function useCostsLedger({
|
||||
return {
|
||||
me,
|
||||
base,
|
||||
setBase,
|
||||
baseOptions,
|
||||
tripCurrency,
|
||||
ctx,
|
||||
settlement,
|
||||
|
||||
@@ -13,6 +13,7 @@ import { ReceiptPreviewModal } from '../../../../components/Budget/ReceiptPrevie
|
||||
import { useCostsLedger } from '../../../../components/Budget/useCostsLedger'
|
||||
import { useExpenseLinks } from '../../../../components/Budget/useExpenseLinks'
|
||||
import { useCostsMode } from '../../../../components/Budget/useCostsMode'
|
||||
import { CostsCurrencyPicker } from '../../../../components/Budget/CostsCurrencyPicker'
|
||||
import ToggleSwitch from '../../../../components/Settings/ToggleSwitch'
|
||||
import { finalBudgetFor, finalBudgetSources, formerParticipantRows, paidByUser, readUserNote } from '../../../../components/Budget/CostsPanel.helpers'
|
||||
import { catMeta, COST_CAT_META } from '../../../../components/Budget/costsCategories'
|
||||
@@ -50,7 +51,7 @@ export default function MCostsTab({ planner, shell }: MTabScreenProps) {
|
||||
me, base, tripCurrency, ctx, settlement, settlementError, loadSettlement, flows, splitting, knownNames,
|
||||
search, setSearch, segment, setSegment, catFilter, setCatFilter, dayFilter, setDayFilter,
|
||||
totals, filtered, filteredSettlements, catBreakdown, leftOutLabel, toggleLeftOutCat, countAllCats, exportCsv: handleExportCsv,
|
||||
deleteExpense, undoSettlement: handleUndoSettlement,
|
||||
deleteExpense, undoSettlement: handleUndoSettlement, setBase, baseOptions,
|
||||
} = useCostsLedger({ tripId, trip, budgetItems, memberCount: tripMembers.length, actions: planner.tripActions, canEdit, t, toast })
|
||||
|
||||
// Split between the travellers or totals only (#1714), switched at the foot of the summary.
|
||||
@@ -385,7 +386,11 @@ export default function MCostsTab({ planner, shell }: MTabScreenProps) {
|
||||
{/* Expenses — header, search, filters (spec §3.6). One block, so on a wide
|
||||
window the search field keeps to the column like the heading above it. */}
|
||||
<section aria-label={t('costs.expenses')}>
|
||||
<h2 className="mt-4 text-[1.0625rem] font-extrabold text-m-ink split:mt-0">{t('costs.expenses')}</h2>
|
||||
{/* The currency the tab reads the trip in (#1683) sits by the heading, as on the desktop. */}
|
||||
<div className="mt-4 flex items-center gap-2 split:mt-0">
|
||||
<h2 className="min-w-0 flex-1 text-[1.0625rem] font-extrabold text-m-ink">{t('costs.expenses')}</h2>
|
||||
<CostsCurrencyPicker value={base} options={baseOptions} onChange={setBase} />
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
value={search}
|
||||
|
||||
@@ -18,7 +18,7 @@ import { server } from '../../../helpers/msw/server'
|
||||
import { fireEvent, render, screen, waitFor, within } from '../../../helpers/render'
|
||||
import { setSizeClass } from '../../../helpers/sizeClass'
|
||||
|
||||
// FE-MOB-COSTT-001 to FE-MOB-COSTT-058
|
||||
// FE-MOB-COSTT-001 to FE-MOB-COSTT-059
|
||||
|
||||
// The add/edit expense sheet is the shared desktop-sized form; the panel only
|
||||
// owns when it opens and what happens on save, so it is stubbed here.
|
||||
@@ -1011,4 +1011,18 @@ describe('MCostsTab', () => {
|
||||
expect(total().textContent).toBe(before)
|
||||
expect(screen.queryByRole('button', { name: /^costs\.breakdown\.countIn:/ })).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-MOB-COSTT-059: the heading carries the currency the tab reads in, and a pick reads the balances again in it (#1683)', async () => {
|
||||
localStorage.removeItem('trek:costs-currency:7')
|
||||
try {
|
||||
await renderTab()
|
||||
const picker = screen.getByRole('button', { name: 'Show amounts in' })
|
||||
expect(picker).toHaveTextContent('USD')
|
||||
fireEvent.click(picker)
|
||||
fireEvent.click(await screen.findByText(/^GBP\s/))
|
||||
await waitFor(() => expect(settlementBases).toContain('GBP'))
|
||||
} finally {
|
||||
localStorage.removeItem('trek:costs-currency:7')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -210,6 +210,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'احتساب {category} في الإجماليات مجددًا',
|
||||
'costs.breakdown.leftOut': 'مستبعد من الإجماليات: {categories}',
|
||||
'costs.breakdown.countAll': 'احتساب الكل',
|
||||
'costs.showIn': 'عرض المبالغ بعملة',
|
||||
'costs.splitHint.ticket': 'اكتب ما ورد في الإيصال وحدّد من أخذ كل عنصر.',
|
||||
'costs.filter.allCategories': 'كل الفئات',
|
||||
'costs.filter.allDays': 'كل الأيام',
|
||||
|
||||
@@ -172,6 +172,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': '{category} yenidən yekunlara daxil edilsin',
|
||||
'costs.breakdown.leftOut': 'Yekunlardan çıxarılıb: {categories}',
|
||||
'costs.breakdown.countAll': 'Hamısını say',
|
||||
'costs.showIn': 'Məbləğlərin valyutası',
|
||||
'costs.splitHint.ticket': 'Qəbzdə olanları sadalayın və hər elementi kimin götürdüyünü işarələyin.',
|
||||
'costs.pickSomeone': 'Bölüşdürmək üçün ən azı bir nəfər seçin.',
|
||||
'costs.splitSummary': '{count} nəfər arasında bölünüb · hərəsinə {amount}',
|
||||
|
||||
@@ -182,6 +182,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Contar {category} nos totais de novo',
|
||||
'costs.breakdown.leftOut': 'Fora dos totais: {categories}',
|
||||
'costs.breakdown.countAll': 'Contar tudo',
|
||||
'costs.showIn': 'Mostrar valores em',
|
||||
'costs.splitHint.ticket': 'Liste o que estava no comprovante e marque quem consumiu cada item.',
|
||||
'costs.filter.allCategories': 'Todas as categorias',
|
||||
'costs.filter.allDays': 'Todos os dias',
|
||||
|
||||
@@ -147,6 +147,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Torna a comptar {category} als totals',
|
||||
'costs.breakdown.leftOut': 'Fora dels totals: {categories}',
|
||||
'costs.breakdown.countAll': 'Comptar-ho tot',
|
||||
'costs.showIn': 'Mostra els imports en',
|
||||
'costs.splitHint.ticket': 'Llista el que hi havia al rebut i marca qui ha pres cada article.',
|
||||
'costs.pickSomeone': 'Tria almenys una persona amb qui dividir-ho.',
|
||||
'costs.splitSummary': 'Dividit entre {count} persones · {amount} cadascú',
|
||||
|
||||
@@ -189,6 +189,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Znovu započítat {category} do součtů',
|
||||
'costs.breakdown.leftOut': 'Vynecháno ze součtů: {categories}',
|
||||
'costs.breakdown.countAll': 'Započítat vše',
|
||||
'costs.showIn': 'Zobrazit částky v',
|
||||
'costs.splitHint.ticket': 'Vypište, co bylo na účtence, a zaškrtněte, kdo měl kterou položku.',
|
||||
'costs.filter.allCategories': 'Všechny kategorie',
|
||||
'costs.filter.allDays': 'Všechny dny',
|
||||
|
||||
@@ -187,6 +187,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': '{category} wieder in die Summen aufnehmen',
|
||||
'costs.breakdown.leftOut': 'Nicht in den Summen: {categories}',
|
||||
'costs.breakdown.countAll': 'Alle zählen',
|
||||
'costs.showIn': 'Beträge anzeigen in',
|
||||
'costs.splitHint.ticket': 'Liste auf, was auf dem Beleg steht, und hak ab, wer was hatte.',
|
||||
'costs.ticketItemName': 'Artikelname',
|
||||
'costs.ticketSplitting': 'Aufteilen auf:',
|
||||
|
||||
@@ -156,6 +156,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Count {category} in the totals again',
|
||||
'costs.breakdown.leftOut': 'Left out of the totals: {categories}',
|
||||
'costs.breakdown.countAll': 'Count all',
|
||||
'costs.showIn': 'Show amounts in',
|
||||
'costs.splitHint.ticket': 'List what was on the receipt and tick who had each item.',
|
||||
'costs.pickSomeone': 'Pick at least one person to split with.',
|
||||
'costs.splitSummary': 'Split {count} ways · {amount} each',
|
||||
|
||||
@@ -183,6 +183,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Volver a contar {category} en los totales',
|
||||
'costs.breakdown.leftOut': 'Fuera de los totales: {categories}',
|
||||
'costs.breakdown.countAll': 'Contar todo',
|
||||
'costs.showIn': 'Mostrar importes en',
|
||||
'costs.splitHint.ticket': 'Enumera lo que había en el recibo y marca quién tomó cada artículo.',
|
||||
'costs.filter.allCategories': 'Todas las categorías',
|
||||
'costs.filter.allDays': 'Todos los días',
|
||||
|
||||
@@ -156,6 +156,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Arvesta {category} jälle summadesse',
|
||||
'costs.breakdown.leftOut': 'Summadest välja jäetud: {categories}',
|
||||
'costs.breakdown.countAll': 'Arvesta kõik',
|
||||
'costs.showIn': 'Summade valuuta',
|
||||
'costs.splitHint.ticket': 'Loetle, mis tšekil oli, ja märgi iga kirje juurde, kellele see kuulus.',
|
||||
'costs.pickSomeone': 'Vali jagamiseks vähemalt üks inimene.',
|
||||
'costs.splitSummary': 'Jaotatud {count} osaks · igaühele {amount}',
|
||||
|
||||
@@ -184,6 +184,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Compter de nouveau {category} dans les totaux',
|
||||
'costs.breakdown.leftOut': 'Exclu des totaux : {categories}',
|
||||
'costs.breakdown.countAll': 'Tout compter',
|
||||
'costs.showIn': 'Afficher les montants en',
|
||||
'costs.splitHint.ticket': 'Listez ce qui figurait sur le reçu et cochez qui a pris chaque article.',
|
||||
'costs.filter.allCategories': 'Toutes les catégories',
|
||||
'costs.filter.allDays': 'Tous les jours',
|
||||
|
||||
@@ -184,6 +184,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Επαναφορά του {category} στα σύνολα',
|
||||
'costs.breakdown.leftOut': 'Εκτός συνόλων: {categories}',
|
||||
'costs.breakdown.countAll': 'Μέτρηση όλων',
|
||||
'costs.showIn': 'Εμφάνιση ποσών σε',
|
||||
'costs.splitHint.ticket': 'Καταγράψτε τι είχε η απόδειξη και σημειώστε ποιος πήρε κάθε είδος.',
|
||||
'costs.filter.allCategories': 'Όλες οι κατηγορίες',
|
||||
'costs.filter.allDays': 'Όλες οι ημέρες',
|
||||
|
||||
@@ -160,6 +160,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'לכלול שוב את {category} בסכומים',
|
||||
'costs.breakdown.leftOut': 'לא נכלל בסכומים: {categories}',
|
||||
'costs.breakdown.countAll': 'לכלול הכול',
|
||||
'costs.showIn': 'הצגת הסכומים במטבע',
|
||||
'costs.splitHint.ticket': 'רשמו מה היה בקבלה וסמנו מי לקח כל פריט.',
|
||||
'costs.pickSomeone': 'בחרו לפחות אדם אחד לחלוקה.',
|
||||
'costs.splitSummary': 'חלוקה ל-{count} · {amount} לכל אחד',
|
||||
|
||||
@@ -185,6 +185,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': '{category} visszavétele az összesítésbe',
|
||||
'costs.breakdown.leftOut': 'Kimarad az összesítésből: {categories}',
|
||||
'costs.breakdown.countAll': 'Minden beszámítása',
|
||||
'costs.showIn': 'Összegek pénzneme',
|
||||
'costs.splitHint.ticket': 'Sorold fel, mi szerepelt a nyugtán, és minden tételnél jelöld be, kié volt.',
|
||||
'costs.filter.allCategories': 'Összes kategória',
|
||||
'costs.filter.allDays': 'Összes nap',
|
||||
|
||||
@@ -176,6 +176,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Hitung {category} lagi dalam total',
|
||||
'costs.breakdown.leftOut': 'Dikecualikan dari total: {categories}',
|
||||
'costs.breakdown.countAll': 'Hitung semua',
|
||||
'costs.showIn': 'Tampilkan jumlah dalam',
|
||||
'costs.splitHint.ticket': 'Tuliskan isi kuitansi dan centang siapa yang mengambil tiap item.',
|
||||
'costs.filter.allCategories': 'Semua kategori',
|
||||
'costs.filter.allDays': 'Semua hari',
|
||||
|
||||
@@ -182,6 +182,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Conta di nuovo {category} nei totali',
|
||||
'costs.breakdown.leftOut': 'Esclusi dai totali: {categories}',
|
||||
'costs.breakdown.countAll': 'Conta tutto',
|
||||
'costs.showIn': 'Mostra gli importi in',
|
||||
'costs.splitHint.ticket': "Elenca cosa c'era sulla ricevuta e spunta chi ha preso ciascun articolo.",
|
||||
'costs.filter.allCategories': 'Tutte le categorie',
|
||||
'costs.filter.allDays': 'Tutti i giorni',
|
||||
|
||||
@@ -174,6 +174,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': '{category}を合計に戻す',
|
||||
'costs.breakdown.leftOut': '合計から除外中:{categories}',
|
||||
'costs.breakdown.countAll': 'すべて含める',
|
||||
'costs.showIn': '金額の表示通貨',
|
||||
'costs.splitHint.ticket': 'レシートの品目を書き出し、それぞれ誰の分かにチェックを入れます。',
|
||||
'costs.filter.allCategories': 'すべてのカテゴリー',
|
||||
'costs.filter.allDays': 'すべての日',
|
||||
|
||||
@@ -174,6 +174,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': '{category}을(를) 다시 합계에 넣기',
|
||||
'costs.breakdown.leftOut': '합계에서 제외됨: {categories}',
|
||||
'costs.breakdown.countAll': '모두 포함',
|
||||
'costs.showIn': '금액 표시 통화',
|
||||
'costs.splitHint.ticket': '영수증에 있던 항목을 적고, 항목마다 누구 몫인지 체크하세요.',
|
||||
'costs.filter.allCategories': '모든 카테고리',
|
||||
'costs.filter.allDays': '모든 날짜',
|
||||
|
||||
@@ -184,6 +184,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': '{category} weer meetellen in de totalen',
|
||||
'costs.breakdown.leftOut': 'Buiten de totalen: {categories}',
|
||||
'costs.breakdown.countAll': 'Alles meetellen',
|
||||
'costs.showIn': 'Bedragen tonen in',
|
||||
'costs.splitHint.ticket': 'Zet op een rij wat er op de bon stond en vink aan wie welk item had.',
|
||||
'costs.filter.allCategories': 'Alle categorieën',
|
||||
'costs.filter.allDays': 'Alle dagen',
|
||||
|
||||
@@ -197,6 +197,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Uwzględnij {category} w sumach ponownie',
|
||||
'costs.breakdown.leftOut': 'Pominięte w sumach: {categories}',
|
||||
'costs.breakdown.countAll': 'Uwzględnij wszystko',
|
||||
'costs.showIn': 'Pokaż kwoty w',
|
||||
'costs.splitHint.ticket': 'Wypisz, co było na paragonie, i zaznacz, kto miał którą pozycję.',
|
||||
'costs.filter.allCategories': 'Wszystkie kategorie',
|
||||
'costs.filter.allDays': 'Wszystkie dni',
|
||||
|
||||
@@ -196,6 +196,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Снова учитывать {category} в итогах',
|
||||
'costs.breakdown.leftOut': 'Не учтено в итогах: {categories}',
|
||||
'costs.breakdown.countAll': 'Учитывать всё',
|
||||
'costs.showIn': 'Показывать суммы в',
|
||||
'costs.splitHint.ticket': 'Перечислите, что было в чеке, и отметьте, кто что брал.',
|
||||
'costs.filter.allCategories': 'Все категории',
|
||||
'costs.filter.allDays': 'Все дни',
|
||||
|
||||
@@ -161,6 +161,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Znova započítať {category} do súčtov',
|
||||
'costs.breakdown.leftOut': 'Vynechané zo súčtov: {categories}',
|
||||
'costs.breakdown.countAll': 'Započítať všetko',
|
||||
'costs.showIn': 'Zobraziť sumy v',
|
||||
'costs.splitHint.ticket': 'Vypíšte, čo bolo na účtenke, a označte, kto mal ktorú položku.',
|
||||
'costs.pickSomeone': 'Vyberte aspoň jednu osobu na rozdelenie.',
|
||||
'costs.splitSummary': 'Rozdelené na {count} dielov · {amount} na osobu',
|
||||
|
||||
@@ -182,6 +182,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Räkna med {category} i summorna igen',
|
||||
'costs.breakdown.leftOut': 'Utanför summorna: {categories}',
|
||||
'costs.breakdown.countAll': 'Räkna allt',
|
||||
'costs.showIn': 'Visa belopp i',
|
||||
'costs.splitHint.ticket': 'Lista det som stod på kvittot och bocka för vem som hade varje artikel.',
|
||||
'costs.filter.allCategories': 'Alla kategorier',
|
||||
'costs.filter.allDays': 'Alla dagar',
|
||||
|
||||
@@ -146,6 +146,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'นับ {category} ในยอดรวมอีกครั้ง',
|
||||
'costs.breakdown.leftOut': 'ไม่นับในยอดรวม: {categories}',
|
||||
'costs.breakdown.countAll': 'นับทั้งหมด',
|
||||
'costs.showIn': 'แสดงจำนวนเงินเป็น',
|
||||
'costs.splitHint.ticket': 'ใส่รายการที่อยู่ในใบเสร็จ แล้วติ๊กว่าใครสั่งรายการไหน',
|
||||
'costs.pickSomeone': 'เลือกอย่างน้อยหนึ่งคนที่จะแยกด้วย',
|
||||
'costs.splitSummary': '{count} คน · คนละ {amount}',
|
||||
|
||||
@@ -182,6 +182,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': '{category} yeniden toplamlara katılsın',
|
||||
'costs.breakdown.leftOut': 'Toplamların dışında: {categories}',
|
||||
'costs.breakdown.countAll': 'Hepsini say',
|
||||
'costs.showIn': 'Tutarları şu para biriminde göster',
|
||||
'costs.splitHint.ticket': 'Fişte neler olduğunu listeleyin ve her kalemi kimin aldığını işaretleyin.',
|
||||
'costs.filter.allCategories': 'Tüm kategoriler',
|
||||
'costs.filter.allDays': 'Tüm günler',
|
||||
|
||||
@@ -196,6 +196,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Знову враховувати {category} в підсумках',
|
||||
'costs.breakdown.leftOut': 'Не враховано в підсумках: {categories}',
|
||||
'costs.breakdown.countAll': 'Враховувати все',
|
||||
'costs.showIn': 'Показувати суми в',
|
||||
'costs.splitHint.ticket': 'Перелічіть, що було в чеку, і позначте, хто брав кожну позицію.',
|
||||
'costs.filter.allCategories': 'Усі категорії',
|
||||
'costs.filter.allDays': 'Усі дні',
|
||||
|
||||
@@ -175,6 +175,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': 'Tính lại {category} vào tổng',
|
||||
'costs.breakdown.leftOut': 'Đã loại khỏi tổng: {categories}',
|
||||
'costs.breakdown.countAll': 'Tính tất cả',
|
||||
'costs.showIn': 'Hiển thị số tiền bằng',
|
||||
'costs.splitHint.ticket': 'Liệt kê các món trên hóa đơn và đánh dấu ai đã dùng từng món.',
|
||||
'costs.filter.allCategories': 'Tất cả danh mục',
|
||||
'costs.filter.allDays': 'Tất cả các ngày',
|
||||
|
||||
@@ -173,6 +173,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': '將{category}重新計入合計',
|
||||
'costs.breakdown.leftOut': '未計入合計:{categories}',
|
||||
'costs.breakdown.countAll': '全部計入',
|
||||
'costs.showIn': '金額顯示幣別',
|
||||
'costs.splitHint.ticket': '列出收據上的項目,並勾選每一項是誰的。',
|
||||
'costs.filter.allCategories': '所有類別',
|
||||
'costs.filter.allDays': '所有日期',
|
||||
|
||||
@@ -173,6 +173,7 @@ const budget: TranslationStrings = {
|
||||
'costs.breakdown.countIn': '将{category}重新计入合计',
|
||||
'costs.breakdown.leftOut': '未计入合计:{categories}',
|
||||
'costs.breakdown.countAll': '全部计入',
|
||||
'costs.showIn': '金额显示币种',
|
||||
'costs.splitHint.ticket': '列出收据上的项目,并勾选每一项是谁的。',
|
||||
'costs.filter.allCategories': '所有类别',
|
||||
'costs.filter.allDays': '所有日期',
|
||||
|
||||
@@ -18,6 +18,7 @@ The tab opens with the same bar as Transports, Bookings, Lists and Files. From l
|
||||
- **Search expenses…**, which narrows the ledger by name as you type. Esc clears it.
|
||||
- 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).
|
||||
- The **currency** the tab shows the trip in (*Show amounts in*), see [Currency](#currency).
|
||||
- **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 and a model that reads images, see [Scanning a receipt](#scanning-a-receipt)) and **Add expense**.
|
||||
|
||||
@@ -33,6 +34,8 @@ Costs is **multi-currency** (#551). Three settings are involved, and they do dif
|
||||
- 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.
|
||||
|
||||
The tab can also read one trip in another currency than your display currency, without changing Settings: the currency picker in the bar (on the phone and in a narrow window, beside the **Expenses** heading) converts every total, balance and settle-up of this trip into the currency you pick, say the one of the country you travel on to. Your display currency and the trip's own lead the list. The pick is kept per trip in this browser and changes nothing that is stored; picking your display currency again goes back to it. Settle-ups and payments recorded from the tab are made in the picked currency, and the CSV export adds its column in it.
|
||||
|
||||
165 currencies are supported, with rates from [Frankfurter](https://frankfurter.dev) (no API key needed). When an expense's currency differs from the one you read in, the dialog shows the original beside the converted amount (`$100.00 ≈ 7 668,71 ₽`, marked *live rate* until the expense is saved and its rate frozen), 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.
|
||||
|
||||
@@ -77,6 +77,10 @@ An administrator can set an instance-wide default (Admin → User Defaults), and
|
||||
|
||||
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 €`).
|
||||
|
||||
### Reading one trip in another currency
|
||||
|
||||
The Costs tab has a currency picker of its own (*Show amounts in*, in the bar). It reads that one trip in another currency, without touching the setting: useful when a trip moves on to another country and you want its totals in the new local currency. The pick is kept per trip in this browser only; your display currency and the trip's own sit at the top of the list, and picking your display currency again goes back to it. Like the display currency, it changes nothing that is stored.
|
||||
|
||||
## How they fit together
|
||||
|
||||
An expense flows through all three:
|
||||
|
||||
Reference in New Issue
Block a user