Umsatz-Suche funktioniert mit kommazahlen und negativ

This commit is contained in:
2026-04-28 11:10:42 +02:00
parent d0a5cebdcd
commit 85ad80add7
3 changed files with 20 additions and 6 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ sync_hibiscus <- function(conn) {
error_f <- NULL
# ── Einstellungen ────────────────────────────────────────────────────────────
SYNC_AB <- as.Date("2024-01-01")
SYNC_AB <- as.Date("2026-01-01")
if (as.character(Sys.info())[1] == "Darwin") {
h2jar <- "/Users/cosw/bin/jameica.app/lib/h2/migration-h2/disabled/h2-1.4.199.jar"
+4 -4
View File
@@ -28,7 +28,7 @@ buchungenServer <- function(id, conn, r_global) {
moduleServer(id, function(input, output, session) {
ns <- session$ns
# ── Reactive Variablen ─────────────────────────────────────────────────────
# ── Reactive Variablen ----
postings_data <- reactiveVal(read_buch_tabelle(conn))
details_data <- reactiveVal(NULL)
selected_trans_id <- reactiveVal(NULL)
@@ -41,7 +41,7 @@ buchungenServer <- function(id, conn, r_global) {
"posting_modal", conn, selected_trans_id, modal_trigger
)
# ── Filter ─────────────────────────────────────────────────────────────────
# ── Filter ----
aktiver_filter <- reactive(r_global$buchungen_filter)
gefilterte_daten <- reactive({
@@ -64,7 +64,7 @@ buchungenServer <- function(id, conn, r_global) {
details_data(NULL)
})
# ── Sprung von anderem Modul ───────────────────────────────────────────────
# ── Sprung von anderem Modul ----
observeEvent(r_global$jump_to_entry_id, ignoreInit = TRUE, {
req(r_global$jump_to_entry_id)
t_id <- r_global$jump_to_entry_id
@@ -88,7 +88,7 @@ buchungenServer <- function(id, conn, r_global) {
r_global$jump_to_entry_id <- NULL
})
# ── Haupttabelle rendern ───────────────────────────────────────────────────
# ── Haupttabelle rendern ----
output$buchungen_table <- renderReactable({
reset_trigger()
f_reactable(
+15 -1
View File
@@ -59,7 +59,21 @@ umsatzServer <- function(id, conn, r_global) {
betrag, zweck, gebucht, posting_id, entry_id),
striped = TRUE,
highlight = TRUE,
filterable = TRUE, # ← das reicht
searchable = T,
searchMethod = JS("function(rows, columnIds, filterValue) {
var filter = filterValue.toLowerCase().replace(',', '.').replace(/\\s/g, '');
return rows.filter(function(row) {
return columnIds.some(function(col) {
var val = row.values[col];
var str = val === null || val === undefined ? '' : String(val);
var strNorm = str.toLowerCase().replace(',', '.').replace(/\\s/g, '');
return strNorm.includes(filter) ||
(typeof val === 'number' &&
String(Math.abs(val)).includes(filter));
});
});
}"),
filterable = F, # ← das reicht
pagination = F,
selection = "single",
onClick = "select",