Hibiscus Transfer eingerichtet

This commit is contained in:
2026-05-13 09:59:01 +02:00
parent e27ee5fd0b
commit e28c8b6a9c
4 changed files with 68 additions and 17 deletions
+30 -16
View File
@@ -329,7 +329,7 @@ if(ok){
## * Umsatz-Tabelle ----
if(F){
if(ok){
exec_sql("CREATE TABLE hibiscus_transactions (
id INTEGER PRIMARY KEY,
konto_id INTEGER,
@@ -347,20 +347,35 @@ if(F){
art TEXT,
customerref TEXT,
kommentar TEXT,
checksum REAL,
umsatztyp_id INTEGER,
flags REAL,
gvcode INTEGER,
addkey INTEGER,
txid TEXT,
purposecode TEXT,
endtoendid TEXT,
mandateid TEXT,
empfaenger_name2 TEXT,
creditorid TEXT
empfaenger_name2 TEXT
);")
ok <- NA
daten_hibiscus <- sync_hibiscus() %>%
transmute(
id = as.integer(ID),
konto_id = as.integer(KONTO_ID),
empfaenger_konto = EMPFAENGER_KONTO,
empfaenger_blz = EMPFAENGER_BLZ,
empfaenger_name = EMPFAENGER_NAME,
betrag = as.numeric(BETRAG),
zweck =ZWECK,
zweck2 =ZWECK2,
zweck3 =ZWECK3,
datum =as.character(DATUM),
valuta = as.character(VALUTA),
saldo = SALDO,
primanota = PRIMANOTA,
art =ART,
customerref =CUSTOMERREF,
kommentar = KOMMENTAR,
endtoendid = ENDTOENDID,
mandateid = MANDATEID,
empfaenger_name2 =EMPFAENGER_NAME2
)
dbWriteTable(con_s, "hibiscus_transactions", daten_hibiscus, append = T)
anz <- dbxSelect(con_s, "select count(id) FROM hibiscus_transactions") %>% pull
ok <- nrow(daten_hibiscus) == anz
error_f <- fehler_add("Die Tabelle der Umsätze (Hibiscus) wurde erstellt", ok, error_f)
} ## ------------------------------------------------------- 2026-05-12 17:05
@@ -405,7 +420,7 @@ if(ok){
} ## ------------------------------------------------------- 2026-05-12 17:07
## * Projekct - Tabelle ----
## * Projekt - Tabelle ----
if(ok){
exec_sql("CREATE TABLE projects (
id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -444,14 +459,14 @@ if(ok){
mutate(
ext = file_ext(original_name),
zielname = paste0(zielpfad, id, ".", ext)
)
)
anz <- nrow(eintraege)
for(ind in 1:nrow(eintraege)){
herkunft <- paste0(pfad, eintraege$original_name[ind])
zielname <- eintraege$zielname[ind]
if( file.exists(herkunft) ){
cat(ind, " von ", anz, "\n")
# cat(ind, " von ", anz, "\n")
file.copy(
from = herkunft,
to = zielname,
@@ -461,7 +476,6 @@ if(ok){
# Check
neue_dateien <- list.files("~/Documents/workspace/gemfin-shiny/www/documents/")
length(neue_dateien)
length(eintraege)
nv <- att[-which(eintraege %in% neue_dateien),]
error_f <- fehler_add("Alle Dateien übertragen", nrow(nv) == 0, error_f)