feat: every page follows the one-currency mode
Totals, info boxes, section headers, group subtotals, shares and the per-currency charts on the dashboard, transactions, search, accounts, merchants, statement, budgets, categories, tags, groups, piggy banks, reports and the category, tag, budget and merchant pages sum into one converted amount when the mode is on; charts split by currency merge into one lane. Inputs, reconciliation and the Foreign column stay exact. Money moved to or from a debt, loan or mortgage no longer counts as income or spending in the transaction list boxes; it shows as From debts and To debts. The running balance of an incoming foreign-currency transfer shows in the account's currency.
This commit is contained in:
1 parent
94466d9be9
commit
617a4700e2
61 files changed
+1427
-798
No files matched your search
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import Amount from "#lib/components/Amount.svelte";
|
||||
import Money from "#lib/components/Money.svelte";
|
||||
import { formatMoney } from "#lib/format.js";
|
||||
import { display } from "#lib/money/display.svelte.js";
|
||||
import type { Total } from "./object-groups.js";
|
||||
|
||||
let {
|
||||
@@ -12,24 +13,20 @@
|
||||
tone?: "income" | "expense" | "plain";
|
||||
empty?: string;
|
||||
} = $props();
|
||||
|
||||
const merged = $derived(display.total(totals) !== null);
|
||||
</script>
|
||||
|
||||
{#each totals as total (total.code)}
|
||||
<div>
|
||||
{#if tone === "plain"}
|
||||
<span class="num">{formatMoney(total)}</span>
|
||||
{:else}
|
||||
<Amount
|
||||
amount={total.amount}
|
||||
code={total.code}
|
||||
decimals={total.decimals}
|
||||
symbol={total.symbol}
|
||||
{tone}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
{#if totals.length === 0}
|
||||
{#if empty}
|
||||
<span class="text-cladd-fg-softer">{empty}</span>
|
||||
{/if}
|
||||
{/each}
|
||||
{:else if tone !== "plain"}
|
||||
<Money parts={totals} {tone} />
|
||||
{:else if merged}
|
||||
<div><span class="num">{display.text(totals)}</span></div>
|
||||
{:else}
|
||||
{#each totals as total (total.code)}
|
||||
<div><span class="num">{formatMoney(total)}</span></div>
|
||||
{/each}
|
||||
{/if}
|
||||
Reference in new issue
Block a user