-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.R
42 lines (35 loc) · 1.02 KB
/
main.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Finance App
#
# This app reads transactions from multiple sources and summarizes them.
#
# Author: Viktor Szabo
# Year: 2019
# Licence: MIT
# Run all: Ctrl + Alt + R
# TODO: check monthly balance
# find error: traceback()
Sys.setlocale("LC_TIME", if (.Platform$OS.type == "unix") "C" else "English")
source("functions/read.R")
source("functions/check.R")
source("functions/summary.R")
source("functions/export.R")
year <- 2020
currency <- "USD"
verbose <- F
newRun <- T
strictMode <- T
config <- paste0("config/config_", year, ".xlsx")
reports <- paste0("reports/", year, "/")
output <- paste0("output/", year, "/")
Rdata <- "finance1.RData"
if (newRun) {
dt <- read.all(fn = config, folder = reports, year = year, verbose = verbose)
dt <- summary.all(dt)
check.all(dt, showPairs = F, strictMode = strictMode, verbose = T)
save(dt, file = Rdata)
} else {
load(Rdata)
}
# dt$all <- dt$all[1:100] # trunk data for testing
export.all(dt, folder = output, currency = currency, addTimeStamp = F,
verbose = verbose)