Umsatz-modul eingebaut, buchen noch nicht getestet
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# R/read_functions.R — Hilfsfunktion
|
||||
# R/read_functions.R — read_hibiscus bereinigen
|
||||
read_hibiscus <- function(conn) {
|
||||
tbl(conn, "hibiscus_transactions") %>%
|
||||
select(id, konto_id, empfaenger_name, empfaenger_konto,
|
||||
betrag, zweck, datum, valuta, saldo) %>%
|
||||
left_join(
|
||||
tbl(conn, "postings") %>%
|
||||
select(id, bank_transaction_id, entry_id) %>%
|
||||
rename(posting_id = id),
|
||||
by = c("id" = "bank_transaction_id")
|
||||
) %>%
|
||||
collect() %>%
|
||||
mutate(
|
||||
datum = as.Date(datum), # einfach as.Date reicht da Text "2023-12-25"
|
||||
valuta = as.Date(valuta),
|
||||
gebucht = !is.na(posting_id)
|
||||
)
|
||||
}
|
||||
|
||||
# R/read_functions.R — Kontakt aus bank_connections auflösen
|
||||
resolve_contact <- function(conn, empfaenger_name, empfaenger_konto) {
|
||||
bc <- tbl(conn, "bank_connections") %>%
|
||||
filter(iban == empfaenger_konto | remote_name == empfaenger_name) %>%
|
||||
select(contact_id) %>%
|
||||
collect()
|
||||
if (nrow(bc) > 0) bc$contact_id[1] else NA_integer_
|
||||
}
|
||||
Reference in New Issue
Block a user