summaryrefslogtreecommitdiff
path: root/src/banking
diff options
context:
space:
mode:
authorBenedict Börger <benedict@0xb8000.de>2019-04-15 22:23:48 +0200
committerBenedict Börger <benedict@0xb8000.de>2019-04-15 22:23:48 +0200
commit07a7266358c7bdaa564d35b614f8b8a84683e628 (patch)
tree6211b9eda3399302206d778f24cd4b5823f581d7 /src/banking
parent1d6b87f624fb7f48f40b6e3cd611f3b4956f330e (diff)
[banking] add grouFile paramter to asset.ini
Diffstat (limited to 'src/banking')
-rw-r--r--src/banking/account.rs7
-rw-r--r--src/banking/asset.rs10
2 files changed, 13 insertions, 4 deletions
diff --git a/src/banking/account.rs b/src/banking/account.rs
index 6994bb4..1783e63 100644
--- a/src/banking/account.rs
+++ b/src/banking/account.rs
@@ -4,11 +4,12 @@ pub struct Account {
pub name : String,
pub iban : String,
pub transactions : Vec<Transaction>,
- pub institute : String
+ pub institute : String,
+ pub groupFile : String
}
impl Account {
- pub fn new(name : String, iban : String, transactions : Vec<String>, institute : String) -> Account {
+ pub fn new(name : String, iban : String, transactions : Vec<String>, institute : String, groupFile : String) -> Account {
let mut trans = Vec::new();
if institute == "Sparkasse" {
// TODO als function/lambda übergeben die konvertierung..
@@ -22,7 +23,7 @@ impl Account {
}
}
}
- Account { name : name, iban : iban, transactions : trans, institute : institute }
+ Account { name : name, iban : iban, transactions : trans, institute : institute, groupFile : groupFile }
}
}
diff --git a/src/banking/asset.rs b/src/banking/asset.rs
index 7b7287b..1cbcbc4 100644
--- a/src/banking/asset.rs
+++ b/src/banking/asset.rs
@@ -39,7 +39,15 @@ impl Asset {
if let Some(i) = tmp.get(0) {
iban = i.to_string();
}
- accounts.push(Account::new(account_name, iban, trans_files.to_vec(), institute));
+ match config.get("GroupFile") {
+ Some(i) => tmp = i,
+ None => println!("no groupfile for account {}", account_name)
+ }
+ let mut groupFile = String::from("");
+ if let Some(i) = tmp.get(0) {
+ groupFile = i.to_string();
+ }
+ accounts.push(Account::new(account_name, iban, trans_files.to_vec(), institute, groupFile));
}