Răsfoiți Sursa

Default a journal entry to its movements

The feed drew every posting, and most of them are the mechanism that
carried the entry rather than anything that happened. One entry consumed
a whole posting of 27,827,117 so that 181,153 could go out, handed the
rest back as change, and had two accounts take on negative positions to
fund the difference. Those change and offset lines carry the largest
figures in the entry, so they are what the eye lands on, and 429,153 is
what moved.

They cannot just be dropped. A deposit consumes nothing, so its only
debit line is an offset, and removing it leaves an empty column under a
non-zero total. That is the common shape, not an edge case. So the
default reading is now the movements: one row per payer-funded posting,
debiting the payer and crediting the owner. It balances because each row
puts the same amount on both sides, rather than because conservation
says so, and it closes on what the entry moved. A deposit reads as the
two-line entry an accountant would write.

An envelope that records no payer anywhere has no movement to draw. A
reversal is the case that arises, since it rebuilds the original's
consumed postings and names no payer on any of them. Such an entry falls
back to its postings with a line saying why, so nothing renders blank
and nothing is dropped in silence.

The mode is a query parameter because the polled hx-get sits on the page
and is fixed at render, so a per-entry disclosure or anything held in
the client is wiped by the next swap three seconds later. The unbalanced
warning shows in both modes: it reports a conservation failure in the
record, which is not a property of the reading on screen.
C 3 zile în urmă
părinte
comite
0e6fc22039

+ 13 - 0
CHANGELOG.md

@@ -61,6 +61,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
   behind the hover. The demo seeder now gives every transfer a reference, which
   is also what lets two deposits of the same amount to the same account be two
   transfers rather than a replay.
+- The dashboard's feed drew every posting, and most of them are the UTXO
+  mechanism rather than anything that happened: a whole posting consumed so
+  that part of it could move, the rest handed back as change, and an account
+  taking on a negative position to fund the difference. The change and offset
+  lines carried the largest figures in the entry, so they dominated the
+  reading. An entry now defaults to its movements, one row per movement
+  debiting the payer and crediting the owner, which balances by construction
+  and totals what the entry moved. `?details=all` restores the posting view
+  with its conservation totals. The lines could not simply be dropped: a
+  deposit consumes nothing, so its only debit line is an offset, and hiding
+  that would leave an empty column under a non-zero total. An entry that
+  records no payer anywhere, a reversal being the case that arises, has no
+  movement to draw and falls back to its postings with a note saying so.
 
 ## [0.4.0] - 2026-12-02
 

+ 9 - 3
crates/kuatia-dashboard/README.md

@@ -34,13 +34,19 @@ leave on; against an already-populated database it is a no-op.
 | ---------------- | --------------------------------------------------------- |
 | `/`              | Overview: account count, transfer count, issued per asset |
 | `/accounts`      | All accounts with policy, flags, and balances             |
-| `/accounts/:id`  | One account: balances, postings, and its transfers        |
-| `/transfers`     | Recent transfers with their created postings              |
-| `/events`        | The append-only ledger event log                          |
+| `/accounts/:id`  | One account: balances, postings, and its journal entries   |
+| `/transfers`     | Recent transfers as journal entries                        |
+| `/events`        | The append-only ledger event log                           |
 
 Each page wraps its dynamic section in an htmx `hx-get`/`hx-trigger="every 3s"`
 element that polls a matching `/ui/*` route and swaps in the fresh fragment.
 
+`/transfers` and `/accounts/:id` draw each entry as its movements: one row per
+movement, debiting the payer and crediting the owner. `?details=all` draws every
+posting instead, change and offset lines included, with the per-asset
+conservation totals. The mode is in the URL because the polled `hx-get` is fixed
+at page render, so anything held client-side would be wiped by the next swap.
+
 ## REST API
 
 All amounts are minor-unit strings (the ledger's native `Cent` form). Clients

+ 331 - 15
crates/kuatia-dashboard/src/ui.rs

@@ -8,18 +8,18 @@
 
 use axum::{
     Router,
-    extract::{Path, State},
+    extract::{Path, Query, State},
     http::header,
     response::{Html, IntoResponse, Response},
     routing::get,
 };
 use kuatia_core::{AccountId, Amount};
-use serde::Serialize;
+use serde::{Deserialize, Serialize};
 use tera::{Context, Tera};
 
 use crate::data::{
-    self, AccountDto, ApiError, AppState, EntryDto, EntryLineDto, EntryLineKind, EntrySide,
-    EventDto, MetadataPairDto, MetadataValueDto, OverviewDto, PostingDto,
+    self, AccountDto, ApiError, AppState, EntryAssetDto, EntryDto, EntryLineDto, EntryLineKind,
+    EntrySide, EventDto, MetadataPairDto, MetadataValueDto, OverviewDto, PostingDto,
 };
 use crate::seed::account_label;
 
@@ -108,6 +108,82 @@ struct MoneyView {
     negative: bool,
 }
 
+/// How much of an entry to draw.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+enum Detail {
+    /// The movements alone: what the entry did, without the UTXO mechanism
+    /// that carried it.
+    Movements,
+    /// Every posting, with the per-asset conservation totals.
+    All,
+}
+
+impl Detail {
+    /// Read the mode off `?details=`. An unrecognized value falls back to the
+    /// default, so a mistyped URL still shows the feed.
+    fn from_query(params: &DetailParams) -> Self {
+        match params.details.as_deref() {
+            Some("all") => Self::All,
+            _ => Self::Movements,
+        }
+    }
+
+    /// The query suffix that carries this mode, empty for the default.
+    fn suffix(self) -> &'static str {
+        match self {
+            Self::Movements => "",
+            Self::All => "?details=all",
+        }
+    }
+
+    fn flipped(self) -> Self {
+        match self {
+            Self::Movements => Self::All,
+            Self::All => Self::Movements,
+        }
+    }
+
+    fn label(self) -> &'static str {
+        match self {
+            Self::Movements => "all details",
+            Self::All => "movements only",
+        }
+    }
+}
+
+/// `?details=all`. A `String` rather than a deserialized enum so an
+/// unrecognized value falls back to the default instead of failing the request.
+#[derive(Deserialize)]
+struct DetailParams {
+    details: Option<String>,
+}
+
+/// What a feed page needs to draw its entries and keep the mode across the
+/// htmx poll.
+#[derive(Serialize)]
+struct DetailView {
+    all: bool,
+    /// The `/ui/*` URL htmx polls, carrying the mode so a swap does not reset
+    /// it.
+    live_url: String,
+    /// The same page with the mode flipped.
+    toggle_url: String,
+    toggle_label: &'static str,
+}
+
+impl DetailView {
+    /// Build the mode's view for one page, where `page` is the full-page path
+    /// and `live` its `/ui/*` counterpart.
+    fn new(detail: Detail, page: &str, live: &str) -> Self {
+        Self {
+            all: detail == Detail::All,
+            live_url: format!("{live}{}", detail.suffix()),
+            toggle_url: format!("{page}{}", detail.flipped().suffix()),
+            toggle_label: detail.label(),
+        }
+    }
+}
+
 #[derive(Serialize)]
 struct BalanceView {
     code: String,
@@ -123,8 +199,6 @@ struct AccountView {
     display_id: String,
     /// Full-page detail link, keyed by the machine-format code (`/accounts/<code>`).
     link: String,
-    /// htmx partial link (`/ui/accounts/<code>`).
-    ui_link: String,
     name: String,
     version: u64,
     policy_kind: &'static str,
@@ -165,14 +239,32 @@ struct EntryLineView {
     mine: bool,
 }
 
+/// One movement: value from the payer to the owner of a payer-funded posting.
+/// Debits one account and credits the other by the same amount, so a movement
+/// view balances by construction rather than by appeal to conservation.
+#[derive(Serialize)]
+struct MovementRowView {
+    from: AcctRefView,
+    to: AcctRefView,
+    money: MoneyView,
+    /// True when the viewed account is on either side of the movement.
+    mine: bool,
+    posting_short: String,
+}
+
 #[derive(Serialize)]
 struct EntryAssetView {
     code: String,
+    /// What the entry did, which is the default reading. Empty for an envelope
+    /// that records no payer anywhere, such as a reversal.
+    movements: Vec<MovementRowView>,
     debits: Vec<EntryLineView>,
     credits: Vec<EntryLineView>,
     debit_total: MoneyView,
     credit_total: MoneyView,
     moved: MoneyView,
+    /// Shown in either mode: a false is a conservation bug in the record, not
+    /// a property of the reading on screen.
     balanced: bool,
 }
 
@@ -384,7 +476,6 @@ fn account_view(dto: &AccountDto) -> AccountView {
     AccountView {
         id: dto.id.id,
         sub: dto.sub,
-        ui_link: format!("/ui{link}"),
         link,
         name: dto
             .label
@@ -443,6 +534,31 @@ fn line_view(dto: &EntryLineDto, viewpoint: Option<AccountId>) -> EntryLineView
     }
 }
 
+/// The movements of one asset group, each from the payer of a payer-funded
+/// posting to its owner.
+///
+/// Filtered by kind rather than by column: a `Receive` is a credit in practice,
+/// but the sign is what places a line, and this should not depend on that
+/// holding. A `Receive` without a payer cannot be a movement and is dropped,
+/// which the resolver's contract makes unreachable.
+fn movement_rows(dto: &EntryAssetDto, viewpoint: Option<AccountId>) -> Vec<MovementRowView> {
+    dto.debits
+        .iter()
+        .chain(dto.credits.iter())
+        .filter(|l| l.kind == EntryLineKind::Receive)
+        .filter_map(|l| {
+            let payer = l.payer?;
+            Some(MovementRowView {
+                from: acct_ref(payer, l.payer_label),
+                to: acct_ref(l.owner, l.label),
+                money: fmt_magnitude(&l.amount),
+                mine: viewpoint == Some(l.owner) || viewpoint == Some(payer),
+                posting_short: short_hex(&l.posting),
+            })
+        })
+        .collect()
+}
+
 fn entry_view(dto: &EntryDto, viewpoint: Option<AccountId>) -> EntryView {
     EntryView {
         short_id: short_hex(&dto.id),
@@ -457,6 +573,7 @@ fn entry_view(dto: &EntryDto, viewpoint: Option<AccountId>) -> EntryView {
             .iter()
             .map(|a| EntryAssetView {
                 code: a.code.clone(),
+                movements: movement_rows(a, viewpoint),
                 debits: a.debits.iter().map(|l| line_view(l, viewpoint)).collect(),
                 credits: a.credits.iter().map(|l| line_view(l, viewpoint)).collect(),
                 debit_total: fmt_magnitude(&a.debit_total),
@@ -520,10 +637,15 @@ async fn accounts_ctx(state: &AppState) -> Result<Context, ApiError> {
     Ok(ctx)
 }
 
-async fn account_ctx(state: &AppState, id: AccountId) -> Result<Context, ApiError> {
+async fn account_ctx(state: &AppState, id: AccountId, detail: Detail) -> Result<Context, ApiError> {
     let dto = data::account_detail(state, id).await?;
+    let page = acct_link(id);
     let mut ctx = Context::new();
     ctx.insert("nav", "accounts");
+    ctx.insert(
+        "detail",
+        &DetailView::new(detail, &page, &format!("/ui{page}")),
+    );
     ctx.insert("account", &account_view(&dto.account));
     ctx.insert(
         "subaccounts",
@@ -543,11 +665,15 @@ async fn account_ctx(state: &AppState, id: AccountId) -> Result<Context, ApiErro
     Ok(ctx)
 }
 
-async fn transfers_ctx(state: &AppState) -> Result<Context, ApiError> {
+async fn transfers_ctx(state: &AppState, detail: Detail) -> Result<Context, ApiError> {
     let dtos = data::transfers(state, None).await?;
     let views: Vec<EntryView> = dtos.iter().map(|e| entry_view(e, None)).collect();
     let mut ctx = Context::new();
     ctx.insert("nav", "transfers");
+    ctx.insert(
+        "detail",
+        &DetailView::new(detail, "/transfers", "/ui/transfers"),
+    );
     ctx.insert("entries", &views);
     Ok(ctx)
 }
@@ -599,38 +725,50 @@ async fn accounts_partial(State(state): State<AppState>) -> Result<Html<String>,
 async fn account_page(
     State(state): State<AppState>,
     Path(uuid): Path<String>,
+    Query(params): Query<DetailParams>,
 ) -> Result<Html<String>, ApiError> {
     let account = uuid.parse().map_err(ApiError::bad_request)?;
+    let detail = Detail::from_query(&params);
     render(
         &state,
         "pages/account.html",
-        &account_ctx(&state, account).await?,
+        &account_ctx(&state, account, detail).await?,
     )
 }
 async fn account_partial(
     State(state): State<AppState>,
     Path(uuid): Path<String>,
+    Query(params): Query<DetailParams>,
 ) -> Result<Html<String>, ApiError> {
     let account = uuid.parse().map_err(ApiError::bad_request)?;
+    let detail = Detail::from_query(&params);
     render(
         &state,
         "partials/account.html",
-        &account_ctx(&state, account).await?,
+        &account_ctx(&state, account, detail).await?,
     )
 }
 
-async fn transfers_page(State(state): State<AppState>) -> Result<Html<String>, ApiError> {
+async fn transfers_page(
+    State(state): State<AppState>,
+    Query(params): Query<DetailParams>,
+) -> Result<Html<String>, ApiError> {
+    let detail = Detail::from_query(&params);
     render(
         &state,
         "pages/transfers.html",
-        &transfers_ctx(&state).await?,
+        &transfers_ctx(&state, detail).await?,
     )
 }
-async fn transfers_partial(State(state): State<AppState>) -> Result<Html<String>, ApiError> {
+async fn transfers_partial(
+    State(state): State<AppState>,
+    Query(params): Query<DetailParams>,
+) -> Result<Html<String>, ApiError> {
+    let detail = Detail::from_query(&params);
     render(
         &state,
         "partials/transfers.html",
-        &transfers_ctx(&state).await?,
+        &transfers_ctx(&state, detail).await?,
     )
 }
 
@@ -678,13 +816,85 @@ mod tests {
     }
 
     fn render_feed(entries: Vec<EntryView>) -> String {
+        render_feed_at(entries, Detail::All)
+    }
+
+    fn render_feed_at(entries: Vec<EntryView>, detail: Detail) -> String {
         let tera = build_tera().expect("templates compile");
         let mut ctx = Context::new();
+        ctx.insert(
+            "detail",
+            &DetailView::new(detail, "/transfers", "/ui/transfers"),
+        );
         ctx.insert("entries", &entries);
         tera.render("partials/transfers.html", &ctx)
             .expect("the feed renders")
     }
 
+    fn acct(id: i64, label: Option<&'static str>) -> AcctRefView {
+        acct_ref(AccountId::new(id), label)
+    }
+
+    fn money(text: &str) -> MoneyView {
+        MoneyView {
+            text: text.to_string(),
+            negative: false,
+        }
+    }
+
+    fn movement(from: &'static str, to: &'static str, amount: &str) -> MovementRowView {
+        MovementRowView {
+            from: acct(1, Some(from)),
+            to: acct(2, Some(to)),
+            money: money(amount),
+            mine: false,
+            posting_short: "9f0a\u{2026}0001".to_string(),
+        }
+    }
+
+    fn posting_line(kind: &'static str, note: &'static str, amount: &str) -> EntryLineView {
+        EntryLineView {
+            kind,
+            note,
+            posting_short: "9f0a\u{2026}0001".to_string(),
+            account: acct(3, Some("L59E")),
+            payer: None,
+            money: money(amount),
+            mine: false,
+        }
+    }
+
+    /// An asset group holding both readings of the same entry, the way
+    /// `entry_view` builds one. `mechanism` is given as a spec so each column
+    /// gets its own lines without a `Clone` on the view type.
+    fn asset(
+        movements: Vec<MovementRowView>,
+        mechanism: &[(&'static str, &'static str, &'static str)],
+    ) -> EntryAssetView {
+        let lines = || -> Vec<EntryLineView> {
+            mechanism
+                .iter()
+                .map(|(kind, note, amount)| posting_line(kind, note, amount))
+                .collect()
+        };
+        EntryAssetView {
+            code: "PYG".to_string(),
+            movements,
+            debits: lines(),
+            credits: lines(),
+            debit_total: money("\u{20b2}28,075,117"),
+            credit_total: money("\u{20b2}28,075,117"),
+            moved: money("\u{20b2}429,153"),
+            balanced: true,
+        }
+    }
+
+    fn entry_with(assets: Vec<EntryAssetView>) -> EntryView {
+        let mut view = entry(Some("sale_document:7"));
+        view.assets = assets;
+        view
+    }
+
     #[test]
     fn a_reference_heads_the_entry_and_the_hash_sits_under_it() {
         let html = render_feed(vec![entry(Some("sale_document:7"))]);
@@ -737,4 +947,110 @@ mod tests {
 
         assert_eq!(view.short.chars().count(), TEXT_DISPLAY_CHARS + 1);
     }
+
+    #[test]
+    fn the_default_view_shows_movements_and_no_mechanism() {
+        let html = render_feed_at(
+            vec![entry_with(vec![asset(
+                vec![
+                    movement("Treasury", "C2AU", "\u{20b2}225,455"),
+                    movement("VNWM", "C2AU", "\u{20b2}22,545"),
+                    movement("L59E", "IOER", "\u{20b2}181,153"),
+                ],
+                &[
+                    ("offset", "offset", "\u{20b2}225,455"),
+                    ("change", "change", "\u{20b2}27,645,964"),
+                ],
+            )])],
+            Detail::Movements,
+        );
+
+        assert!(!html.contains("note offset"));
+        assert!(!html.contains("note change"));
+        assert!(html.contains("Treasury"));
+        assert!(html.contains("IOER"));
+        // Both columns close on what moved, not on the conservation total.
+        assert_eq!(html.matches("\u{20b2}429,153").count(), 3);
+        assert!(!html.contains("\u{20b2}28,075,117"));
+    }
+
+    #[test]
+    fn all_details_shows_the_mechanism_and_the_conservation_totals() {
+        let html = render_feed_at(
+            vec![entry_with(vec![asset(
+                vec![movement("Treasury", "C2AU", "\u{20b2}225,455")],
+                &[
+                    ("offset", "offset", "\u{20b2}225,455"),
+                    ("change", "change", "\u{20b2}27,645,964"),
+                ],
+            )])],
+            Detail::All,
+        );
+
+        assert!(html.contains("note offset"));
+        assert!(html.contains("note change"));
+        assert_eq!(html.matches("\u{20b2}28,075,117").count(), 2);
+    }
+
+    #[test]
+    fn an_entry_with_no_movement_falls_back_to_its_postings() {
+        // The reversal shape: every created posting is payer-less, so there is
+        // no movement to show and the default view must not render blank.
+        let html = render_feed_at(
+            vec![entry_with(vec![asset(
+                Vec::new(),
+                &[("change", "change", "\u{20b2}100")],
+            )])],
+            Detail::Movements,
+        );
+
+        assert!(html.contains("no movement recorded"));
+        assert!(html.contains("note change"));
+    }
+
+    #[test]
+    fn a_deposit_reads_as_two_movement_rows_rather_than_an_empty_column() {
+        let html = render_feed_at(
+            vec![entry_with(vec![asset(
+                vec![movement("External", "Alice", "$1,000.00")],
+                &[("offset", "offset", "$1,000.00")],
+            )])],
+            Detail::Movements,
+        );
+
+        assert!(html.contains("External"));
+        assert!(html.contains("Alice"));
+        assert!(!html.contains("nothing consumed"));
+    }
+
+    #[test]
+    fn the_mode_is_in_the_polled_url_so_a_swap_does_not_reset_it() {
+        let movements = DetailView::new(Detail::Movements, "/transfers", "/ui/transfers");
+        assert_eq!(movements.live_url, "/ui/transfers");
+        assert_eq!(movements.toggle_url, "/transfers?details=all");
+        assert_eq!(movements.toggle_label, "all details");
+        assert!(!movements.all);
+
+        let all = DetailView::new(Detail::All, "/transfers", "/ui/transfers");
+        assert_eq!(all.live_url, "/ui/transfers?details=all");
+        assert_eq!(all.toggle_url, "/transfers");
+        assert_eq!(all.toggle_label, "movements only");
+        assert!(all.all);
+    }
+
+    #[test]
+    fn an_unrecognized_mode_falls_back_to_the_default() {
+        let nonsense = DetailParams {
+            details: Some("nonsense".to_string()),
+        };
+        assert_eq!(Detail::from_query(&nonsense), Detail::Movements);
+
+        let absent = DetailParams { details: None };
+        assert_eq!(Detail::from_query(&absent), Detail::Movements);
+
+        let all = DetailParams {
+            details: Some("all".to_string()),
+        };
+        assert_eq!(Detail::from_query(&all), Detail::All);
+    }
 }

+ 19 - 0
crates/kuatia-dashboard/static/dashboard.css

@@ -358,6 +358,25 @@ table.grid tbody tr:hover {
   font-size: 0.75rem;
 }
 
+/* The mode switch sits in a heading, so it must not read as part of it. */
+.detail-toggle {
+  font-size: 0.75rem;
+  font-weight: 400;
+  color: var(--accent);
+  text-decoration: none;
+  margin-left: 0.5rem;
+}
+
+.detail-toggle:hover,
+.detail-toggle:focus-visible {
+  text-decoration: underline;
+}
+
+.fallback {
+  font-size: 0.75rem;
+  margin-top: 0.3rem;
+}
+
 /* An account link stays quiet inside a dense row, but is a real link. */
 .acct-link {
   color: inherit;

+ 3 - 2
crates/kuatia-dashboard/templates/pages/account.html

@@ -3,8 +3,9 @@
 {% block content %}
 <p><a class="back" href="/accounts">&larr; Accounts</a></p>
 <div class="panel">
-  <h2>{{ account.name }} <span class="acct-id">{{ account.display_id }}</span></h2>
-  <div id="live" hx-get="{{ account.ui_link }}" hx-trigger="every 3s" hx-swap="innerHTML">
+  <h2>{{ account.name }} <span class="acct-id">{{ account.display_id }}</span>
+    <a class="detail-toggle" href="{{ detail.toggle_url }}">{{ detail.toggle_label }}</a></h2>
+  <div id="live" hx-get="{{ detail.live_url }}" hx-trigger="every 3s" hx-swap="innerHTML">
     {% include "partials/account.html" %}
   </div>
 </div>

+ 2 - 2
crates/kuatia-dashboard/templates/pages/transfers.html

@@ -2,8 +2,8 @@
 {% import "partials/entry.html" as entry %}
 {% block content %}
 <div class="panel">
-  <h2>Transfers</h2>
-  <div id="live" hx-get="/ui/transfers" hx-trigger="every 3s" hx-swap="innerHTML">
+  <h2>Transfers <a class="detail-toggle" href="{{ detail.toggle_url }}">{{ detail.toggle_label }}</a></h2>
+  <div id="live" hx-get="{{ detail.live_url }}" hx-trigger="every 3s" hx-swap="innerHTML">
     {% include "partials/transfers.html" %}
   </div>
 </div>

+ 1 - 1
crates/kuatia-dashboard/templates/partials/account.html

@@ -76,5 +76,5 @@
 
 <h3>Journal entries ({{ entries | length }})</h3>
 <div class="feed">
-  {% for e in entries %}{{ entry::item(e=e) }}{% endfor %}
+  {% for e in entries %}{{ entry::item(e=e, all=detail.all) }}{% endfor %}
 </div>

+ 30 - 1
crates/kuatia-dashboard/templates/partials/entry.html

@@ -1,4 +1,4 @@
-{% macro item(e) %}
+{% macro item(e, all) %}
 <div class="entry">
   <div class="entry-head">
     {% if e.reference %}
@@ -20,6 +20,7 @@
     <span class="asset-code">{{ a.code }}</span>
     {% if not a.balanced %}<span class="warn">unbalanced</span>{% endif %}
   </div>
+  {% if all or not a.movements %}
   <div class="entry-sides">
     <div class="side">
       <div class="side-head">Debit</div>
@@ -40,10 +41,38 @@
       </div>
     </div>
   </div>
+  {% if not all %}<div class="fallback muted">no movement recorded; showing postings</div>{% endif %}
+  {% else %}
+  <div class="entry-sides">
+    <div class="side">
+      <div class="side-head">Debit</div>
+      {% for m in a.movements %}{{ self::movement(m=m, side=m.from) }}{% endfor %}
+      <div class="side-total">
+        <span class="muted">&Sigma;</span>
+        <span class="money">{{ a.moved.text }}</span>
+      </div>
+    </div>
+    <div class="side">
+      <div class="side-head">Credit</div>
+      {% for m in a.movements %}{{ self::movement(m=m, side=m.to) }}{% endfor %}
+      <div class="side-total">
+        <span class="muted">&Sigma;</span>
+        <span class="money">{{ a.moved.text }}</span>
+      </div>
+    </div>
+  </div>
+  {% endif %}
   {% endfor %}
 </div>
 {% endmacro item %}
 
+{% macro movement(m, side) %}
+<div class="line{% if m.mine %} mine{% endif %}" title="posting {{ m.posting_short }}">
+  <a class="acct-link" href="{{ side.link }}" title="{{ side.title }}">{{ side.name }}</a>
+  <span class="money">{{ m.money.text }}</span>
+</div>
+{% endmacro movement %}
+
 {% macro line(l) %}
 <div class="line{% if l.mine %} mine{% endif %}" title="posting {{ l.posting_short }}">
   <a class="acct-link" href="{{ l.account.link }}" title="{{ l.account.title }}">{{ l.account.name }}</a>

+ 1 - 1
crates/kuatia-dashboard/templates/partials/transfers.html

@@ -1,4 +1,4 @@
 {% import "partials/entry.html" as entry %}
 <div class="feed">
-  {% for e in entries %}{{ entry::item(e=e) }}{% endfor %}
+  {% for e in entries %}{{ entry::item(e=e, all=detail.all) }}{% endfor %}
 </div>