| 1 |
<script lang="ts"> |
| 2 |
import { urlFor } from "../../helpers"; |
| 3 |
import { _ } from "../../i18n"; |
| 4 |
import QueryLinks from "../query/QueryLinks.svelte"; |
| 5 |
import QueryTable from "../query/QueryTable.svelte"; |
| 6 |
import type { HoldingsReportProps } from "."; |
| 7 |
|
| 8 |
let { |
| 9 |
aggregation_key, |
| 10 |
query_string, |
| 11 |
query_result_table, |
| 12 |
}: HoldingsReportProps = $props(); |
| 13 |
</script> |
| 14 |
|
| 15 |
<div class="headerline"> |
| 16 |
<h3> |
| 17 |
{#if aggregation_key === "all"} |
| 18 |
{_("Holdings")} |
| 19 |
{:else} |
| 20 |
<a href={$urlFor("holdings/")}>{_("Holdings")}</a> |
| 21 |
{/if} |
| 22 |
</h3> |
| 23 |
<h3> |
| 24 |
{#if aggregation_key === "by_account"} |
| 25 |
{_("Holdings by")} {_("Account")} |
| 26 |
{:else} |
| 27 |
<a href={$urlFor("holdings/by_account/")}> |
| 28 |
{_("Holdings by")} |
| 29 |
{_("Account")} |
| 30 |
</a> |
| 31 |
{/if} |
| 32 |
</h3> |
| 33 |
<h3> |
| 34 |
{#if aggregation_key === "by_currency"} |
| 35 |
{_("Holdings by")} {_("Currency")} |
| 36 |
{:else} |
| 37 |
<a href={$urlFor("holdings/by_currency/")}> |
| 38 |
{_("Holdings by")} |
| 39 |
{_("Currency")} |
| 40 |
</a> |
| 41 |
{/if} |
| 42 |
</h3> |
| 43 |
<h3> |
| 44 |
{#if aggregation_key === "by_cost_currency"} |
| 45 |
{_("Holdings by")} {_("Cost currency")} |
| 46 |
{:else} |
| 47 |
<a href={$urlFor("holdings/by_cost_currency/")}> |
| 48 |
{_("Holdings by")} |
| 49 |
{_("Cost currency")} |
| 50 |
</a> |
| 51 |
{/if} |
| 52 |
</h3> |
| 53 |
</div> |
| 54 |
|
| 55 |
<p> |
| 56 |
<a href={$urlFor("query", { query_string })}>{_("Query")}</a> |
| 57 |
<QueryLinks query={query_string} /> |
| 58 |
</p> |
| 59 |
<QueryTable table={query_result_table} filter_empty="units" /> |