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.
33 lines
830 B
Svelte
33 lines
830 B
Svelte
<script lang="ts">
|
|
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 {
|
|
totals,
|
|
tone = "plain",
|
|
empty = "",
|
|
}: {
|
|
totals: Total[];
|
|
tone?: "income" | "expense" | "plain";
|
|
empty?: string;
|
|
} = $props();
|
|
|
|
const merged = $derived(display.total(totals) !== null);
|
|
</script>
|
|
|
|
{#if totals.length === 0}
|
|
{#if empty}
|
|
<span class="text-cladd-fg-softer">{empty}</span>
|
|
{/if}
|
|
{: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}
|