{#snippet sums( list: Total[], label: string, head = false )} {#each columns as col, c (col.key)} {#if c === 0} {label} {#if head} {/if} {:else if col.key === "balance"} {display.text(parts(list, "balance"))} {:else if col.key === "due"} {display.text(parts(list, "due"))} {:else if col.key === "difference"} {/if} {/each} {/snippet} {#snippet actions()} Create a new {TYPE_ONE[type]} {/snippet} {#snippet tools()} {/snippet} {#if accounts.isPending}
{:else if accounts.isError}

{accounts.error.message}

{:else if (accounts.data?.length ?? 0) === 0}

{active ? `No ${TYPE_TITLE[type].toLowerCase()} yet` : "Nothing archived"}

{#if active} Create a new {TYPE_ONE[type]} {/if}
{:else} {#each columns as col (col.key)} {/each} {#each groups as group (group.title)} {#if sections} {@render sums( totals.filter((t) => t.code === group.title), group.title, true )} {:else if grouped} {/if} {#each group.items as item (item.id)} {@const a = item.attributes} {@const i = index.get(item.id) ?? -1} nav.click(i, event)} > {#each columns as col (col.key)} {/each} {/each} {/each} {#if rows.length === 0} {/if} {#if totals.length > 0 && !sections} {#if merged} {@render sums(totals, "Total")} {:else} {#each totals as t (t.code)} {@render sums([t], `Total in ${t.code}`)} {/each} {/if} {/if}
{col.label} {#if sortKey === col.key} {#if descending} {:else} {/if} {/if}
{group.title}
{#if col.key === "name"} {a.name} {:else if col.key === "role"} {ROLE_LABEL[a.account_role ?? ""] ?? ""} {:else if col.key === "liability"} {LIABILITY_LABEL[a.liability_type ?? ""] ?? ""} {:else if col.key === "direction"} {DIRECTION_LABEL[a.liability_direction ?? ""] ?? ""} {:else if col.key === "interest"} {toNumber(a.interest)}% ({PERIOD_LABEL[a.interest_period ?? ""] ?? a.interest_period}) {:else if col.key === "number"} {formatIban(a)} {:else if col.key === "balance"} {:else if col.key === "due"} {:else if col.key === "active"} {#if a.active} {:else} {/if} {:else if col.key === "trend"} {@const values = trends.get(a.name) ?? []} {:else if col.key === "activity"} {a.last_activity ? formatDate(a.last_activity.slice(0, 10)) : "never"} {:else} {/if}
Nothing matches “{filter}”. Press Escape to clear.
{#if menu} {@const target = menu} goto(showUrl(target.id))}> Show ↵ goto(editUrl(target.id))}> Edit e {#if type === "asset"} go(reconcileUrl(target.id))}> Reconcile r {/if} { if (armed) { remove(target); return; } event.preventDefault(); armed = true; }} variant="destructive" > {armed ? `Press again to delete ${target.attributes.name}` : "Delete"} openOld(showUrl(target.id))}> Open in old UI {:else} Right-click a row {/if}
{/if} {#snippet footer()} Create a new {TYPE_ONE[type]} {#if failure} {failure} {/if} {#if perCurrency && (showInactive || otherCount > 0)} {showInactive ? "Hide inactive accounts" : `Show ${otherCount} inactive ${otherCount === 1 ? "account" : "accounts"}`} i {:else if active && otherCount > 0} {otherCount} inactive {otherCount === 1 ? "account" : "accounts"} {:else if !active} Back to active {TYPE_TITLE[type].toLowerCase()} {/if} {/snippet}