belege umbenannt

This commit is contained in:
2026-04-30 17:40:13 +02:00
parent f52d5fa3dd
commit b5d7e435c1
802 changed files with 84 additions and 19296 deletions
+17 -13
View File
@@ -19,7 +19,7 @@ buchungenUI <- function(id) {
## ** Gegenbuchungen ----
h3("Details / Gegenbuchungen"),
uiOutput(ns("details_table")) ,
),
),
## ** Eingabefelder ----
column(4,
selectizeInput(ns("contact"), label = "Kontakt", choices = get_contact_choices(conn),
@@ -60,7 +60,7 @@ buchungenServer <- function(id, conn, r_global) {
## ** Reactive Variablen ----
postings_data <- reactiveVal(read_buch_tabelle(conn))
sel_details <- reactiveVal(NULL)
selected_trans_id <- reactiveVal(NULL)
selected_entry_id <- reactiveVal(NULL)
reset_trigger <- reactiveVal(NULL)
current_main_idx <- reactiveVal(NULL)
@@ -83,7 +83,7 @@ buchungenServer <- function(id, conn, r_global) {
else d
})
## ** Haupttabelle rendern ----
## ** Haupttabelle rendern ----
output$buchungen_table <- renderReactable({
reset_trigger()
f_reactable(
@@ -94,14 +94,14 @@ buchungenServer <- function(id, conn, r_global) {
filterable = TRUE,
)
})
## ** Auswahl anzeigen ----
## ** Auswahl anzeigen ----
sel <- reactive(getReactableState("buchungen_table", "selected"))
observeEvent(sel(), ignoreInit = T, {
idwert <- gefilterte_daten()$id[sel()]
record <- read_posting(conn, idwert)
record_entry <- read_entry(conn, record$entry_id)
updateSelectizeInput(session, "contact", selected = record_entry$contact_id)
updateTextAreaInput(session, "note", value = record_entry$purpose)
updateTextAreaInput(session, "note", value = record_entry$purpose)
@@ -133,7 +133,7 @@ updateTextAreaInput(session, "note", value = record_entry$purpose)
observeEvent(input$save_trans, {
req(sel_details())
n_rows <- nrow(sel_details())
# Alle Zeilen in einer Liste sammeln
# Alle Zeilen in einer Liste sammeln
all_records <- lapply(1:n_rows, function(ind) {
data.frame(
id = as.integer(input[[paste0("id_", ind)]]),
@@ -144,9 +144,9 @@ updateTextAreaInput(session, "note", value = record_entry$purpose)
stringsAsFactors = FALSE
)
})
# Zu einem großen Dataframe zusammenfügen
# Zu einem großen Dataframe zusammenfügen
final_df <- do.call(rbind, all_records)
@@ -179,17 +179,20 @@ updateTextAreaInput(session, "note", value = record_entry$purpose)
## ** Anhänge ----
output$attachments_ui <- renderUI({
req(sel_details())
entry_id <-
dbxSelect(conn, paste0("SELECT entry_id FROM postings WHERE id=", sel_details()$id[1])) %>%
pull
att <- dbxSelect(conn, paste0("SELECT * FROM attachments WHERE entry_id = ", entry_id ))
selected_entry_id(dbxSelect(conn, paste0("SELECT entry_id FROM postings WHERE id=",
sel_details()$id[1])) %>%
pull )
print(selected_entry_id())
att <- dbxSelect(conn, paste0("SELECT * FROM attachments WHERE entry_id = ", selected_entry_id() ))
if (nrow(att) == 0) return(p("Keine Anhänge vorhanden."))
## *** Anhänge anzeigen ----
tagList(lapply(seq_len(nrow(att)), function(i) {
ext <- tools::file_ext(att$original_name[i])
filename <- paste0("attachments/", att$id[i], ".", ext)
filename <- paste0("www/documents/", att$id[i], ".", ext)
## *** Anhang öffnen ----
observeEvent(input[[paste0("open_att_", att$id[i])]], {
browser()
showModal(modalDialog(
tags$iframe(src = filename, width = "100%", height = "600px",
style = "border:none;"),
@@ -199,6 +202,7 @@ updateTextAreaInput(session, "note", value = record_entry$purpose)
footer = modalButton("Schließen")
))
}, ignoreInit = TRUE, once = FALSE)
## *** Buttons Anhänge ----
div(
actionLink(ns(paste0("open_att_", att$id[i])), att$original_name[i]),