diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/R/_funktionen/f_airdatepicker.R b/R/_funktionen/f_airdatepicker.R old mode 100644 new mode 100755 diff --git a/R/_funktionen/f_leer_from_tabelle.R b/R/_funktionen/f_leer_from_tabelle.R old mode 100644 new mode 100755 diff --git a/R/_funktionen/f_max_id.R b/R/_funktionen/f_max_id.R old mode 100644 new mode 100755 diff --git a/R/_funktionen/f_table.R b/R/_funktionen/f_table.R old mode 100644 new mode 100755 diff --git a/R/_funktionen/scroll_to_Row.R b/R/_funktionen/scroll_to_Row.R old mode 100644 new mode 100755 diff --git a/R/_funktionen/sync_hibiscus.R b/R/_funktionen/sync_hibiscus.R old mode 100644 new mode 100755 diff --git a/R/_funktionen/tree_helpers.R b/R/_funktionen/tree_helpers.R old mode 100644 new mode 100755 diff --git a/R/accounts/accounts.R b/R/accounts/accounts.R old mode 100644 new mode 100755 diff --git a/R/accounts/accounts_tab.R b/R/accounts/accounts_tab.R old mode 100644 new mode 100755 diff --git a/R/contacts/contacts.R b/R/contacts/contacts.R old mode 100644 new mode 100755 index 63b155f..ca4e2f4 --- a/R/contacts/contacts.R +++ b/R/contacts/contacts.R @@ -1,8 +1,10 @@ get_contact_choices <- function(conn) { - tbl(conn, "contacts") |> + contacts <- tbl(conn, "contacts") |> select(id, display_name) |> collect() |> - arrange(display_name) |> - (\(df) setNames(df$id, df$display_name))() + arrange(display_name) + + choices <- setNames(as.character(contacts$id), contacts$display_name) + return(c("Kein Kontakt" = 0, choices)) } diff --git a/R/entries/entries.R b/R/entries/entries.R old mode 100644 new mode 100755 diff --git a/R/entries/entry_edit_modal.R b/R/entries/entry_edit_modal.R old mode 100644 new mode 100755 diff --git a/R/entries/todo.R b/R/entries/todo.R old mode 100644 new mode 100755 diff --git a/R/postings/buchungen.R b/R/postings/buchungen.R old mode 100644 new mode 100755 diff --git a/R/postings/buchungen_mod.R b/R/postings/buchungen_mod.R old mode 100644 new mode 100755 diff --git a/R/projects/projects.R b/R/projects/projects.R old mode 100644 new mode 100755 diff --git a/R/umsatz/bank_connections.R b/R/umsatz/bank_connections.R old mode 100644 new mode 100755 index 6ede76c..64cfd27 --- a/R/umsatz/bank_connections.R +++ b/R/umsatz/bank_connections.R @@ -15,7 +15,8 @@ read_hibiscus <- function(conn) { datum = as.Date(datum), # einfach as.Date reicht da Text "2023-12-25" valuta = as.Date(valuta), gebucht = !is.na(posting_id) - ) + ) %>% + filter(datum >= "2026-01-01") } # R/read_functions.R — Kontakt aus bank_connections auflösen diff --git a/R/umsatz/module_umsatz.R b/R/umsatz/module_umsatz.R old mode 100644 new mode 100755 index 8e38b77..e1a0091 --- a/R/umsatz/module_umsatz.R +++ b/R/umsatz/module_umsatz.R @@ -2,15 +2,20 @@ umsatzUI <- function(id) { ns <- NS(id) tagList( useShinyjs(), + # Sync-Button oben div( style = "display: flex; justify-content: flex-end; margin-bottom: 8px;", actionBttn(ns("sync"), "Sync Hibiscus", size = "xs", style = "minimal", icon = icon("rotate"), color = "primary") ), - reactableOutput(ns("umsatz_table")), - hr(), - uiOutput(ns("buchungs_panel")) + # Buchungspanel immer sichtbar unten + uiOutput(ns("buchungs_panel")), + # Tabelle mit begrenzter Höhe und Scroll + div( + style = "max-height: 70vh; overflow-y: auto;", + reactableOutput(ns("umsatz_table")) + ) ) } @@ -18,7 +23,7 @@ umsatzServer <- function(id, conn, r_global) { moduleServer(id, function(input, output, session) { ns <- session$ns - # ── Daten ────────────────────────────────────────────────────────────────── + # ── Daten ---- refresh <- reactiveVal(0) zeige_alle <- reactiveVal(FALSE) @@ -30,7 +35,7 @@ umsatzServer <- function(id, conn, r_global) { }) - # ── Filter-Buttons ───────────────────────────────────────────────────────── + # ── Filter-Buttons ---- observeEvent(input$filter_ungebucht, { zeige_alle(FALSE) }) observeEvent(input$filter_alle, { zeige_alle(TRUE) }) @@ -55,6 +60,7 @@ umsatzServer <- function(id, conn, r_global) { striped = TRUE, highlight = TRUE, filterable = TRUE, # ← das reicht + pagination = F, selection = "single", onClick = "select", defaultSorted = list(valuta = "desc"), @@ -110,34 +116,37 @@ umsatzServer <- function(id, conn, r_global) { tagList( h4("Buchen"), fluidRow( - column(6, + column(4, selectizeInput(ns("konto"), "Konto:", choices = get_account_choices(conn), selected = 0, width = "100%") ), - column(6, + column(3, selectizeInput(ns("projekt"), "Projekt:", choices = get_project_choices(conn), width = "100%") - ) - ), - fluidRow( - column(6, + ), + column(3, selectizeInput(ns("kontakt"), "Kontakt:", choices = get_contact_choices(conn), selected = resolve_contact(conn, u$empfaenger_name, u$empfaenger_konto), width = "100%") ), - column(6, - br(), - actionBttn(ns("new_contact"), "Neuer Kontakt", - size = "xs", style = "minimal", icon = icon("plus")) + column(1, + div(style = "margin-top: 25px;", # Label-Höhe ausgleichen + actionBttn(ns("new_contact"), "Neuer Kontakt", + size = "xs", style = "minimal", icon = icon("plus"), color = "warning") + ) + ), + column(1, + div(style = "margin-top: 25px;", + actionBttn(ns("buchen"), "Buchen", + size = "sm", style = "minimal", color = "success", + icon = icon("check")) + ) ) - ), - actionBttn(ns("buchen"), "Buchen", - size = "sm", style = "minimal", color = "success", - icon = icon("check")) + ) ) } }) diff --git a/db/data_transfer.R b/db/data_transfer.R old mode 100644 new mode 100755 diff --git a/db/development.sqlite b/db/development.sqlite old mode 100644 new mode 100755 index 5c93b04..3b131ee Binary files a/db/development.sqlite and b/db/development.sqlite differ diff --git a/db/development.sqlite3 b/development.sqlite similarity index 100% rename from db/development.sqlite3 rename to development.sqlite diff --git a/gemfin-shiny.Rproj b/gemfin-shiny.Rproj old mode 100644 new mode 100755 diff --git a/global.R b/global.R old mode 100644 new mode 100755 index 88aab45..cd10111 --- a/global.R +++ b/global.R @@ -5,6 +5,7 @@ library("shinyWidgets") library("DBI") library("RSQLite") library("dbx") +library("RJDBC") library("shinydashboard") library("reactable") library("conflicted") @@ -17,5 +18,6 @@ conflicts_prefer(dplyr::filter) conn <- dbConnect(RSQLite::SQLite(), "db/development.sqlite") sourceDirectory("R/") +source("~/R/rfunc/fehler_add.R") diff --git a/server.R b/server.R old mode 100644 new mode 100755 diff --git a/ui.R b/ui.R old mode 100644 new mode 100755 diff --git a/www/main.css b/www/main.css old mode 100644 new mode 100755