buchungen in postings umbenannt

This commit is contained in:
2026-03-09 13:52:59 +01:00
parent 788a355597
commit da524d4af5
3 changed files with 380 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
read_buch_tabelle <- function(conn){
postings <- tbl(conn, "postings")
entries <- tbl(conn, "entries")
accounts <- tbl(conn, "accounts")
projects <- tbl(conn, "projects")
contacts <- tbl(conn, "contacts")
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, kontoname, projektname, display_name, amount, entry_id) |>
collect()
}
read_posting <- function(conn, id){
dbxSelect(conn, paste0("SELECT * FROM postings WHERE id =", id))
}
read_postings_by_entry <- function(conn, id){
dbxSelect(conn, paste0("SELECT * FROM postings WHERE entry_id =", id))
}
tbl(conn, "accounts") %>% collect %>% str