Attachments Liste wird jetzt angezeigt und attachment in iframe

This commit is contained in:
2026-03-20 17:32:13 +01:00
parent 581c6d9ecc
commit 71621ad8ac
3 changed files with 45 additions and 12 deletions
+29 -10
View File
@@ -5,18 +5,29 @@ read_buch_tabelle <- function(conn, trans_id = NULL){
} else {
postings <- tbl(conn, "postings")
}
entries <- tbl(conn, "entries")
accounts <- tbl(conn, "accounts")
projects <- tbl(conn, "projects")
contacts <- tbl(conn, "contacts")
entries <- tbl(conn, "entries")
accounts <- tbl(conn, "accounts")
projects <- tbl(conn, "projects")
contacts <- tbl(conn, "contacts")
attachments <- tbl(conn, "attachments")
# Anzahl Attachments pro entry_id vorberechnen
attachment_counts <- attachments %>%
group_by(entry_id) %>%
summarise(n_attachments = n(), .groups = "drop")
result <- postings |>
left_join(entries, by = c("entry_id" = "id")) |>
left_join(contacts, by = c("contact_id" = "id")) |> # contact_id jetzt verfügbar
left_join(accounts, by = c("account_id" = "id")) |>
left_join(projects, by = c("project_id" = "id")) |>
select(id, valuta, account_name, projektname, display_name, amount, entry_id) |>
left_join(entries, by = c("entry_id" = "id")) |>
left_join(contacts, by = c("contact_id" = "id")) |>
left_join(accounts, by = c("account_id" = "id")) |>
left_join(projects, by = c("project_id" = "id")) |>
left_join(attachment_counts, by = "entry_id") |>
select(id, valuta, account_name, projektname, display_name, amount, entry_id, n_attachments) |>
collect() %>%
mutate(saldo = 0) %>%
mutate(
saldo = 0,
n_attachments = tidyr::replace_na(n_attachments, 0L)
) %>%
arrange(valuta, entry_id)
}
@@ -39,6 +50,14 @@ coldef_entries_tabelle <-
list(color = color, fontWeight = "bold") # Gibt CSS-Styles zurück
}
),
n_attachments = colDef(
name = "Anhänge",
filterMethod = JS("function(rows, columnId, filterValue) {
const val = parseFloat(filterValue);
if (isNaN(val)) return rows; // kein gültiger Wert → alles zeigen
return rows.filter(row => row.values[columnId] > val);
}")
),
entry_id = colDef(name ="trans_id", width = 120),
saldo = colDef(
name = "Saldo",