umsatzliste verbessert
This commit is contained in:
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+5
-3
@@ -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))
|
||||
}
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+2
-1
@@ -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
|
||||
|
||||
Regular → Executable
+28
-19
@@ -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"))
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
Regular → Executable
Regular → Executable
BIN
Binary file not shown.
Regular → Executable
@@ -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")
|
||||
|
||||
|
||||
|
||||
Regular → Executable
Reference in New Issue
Block a user