diff options
Diffstat (limited to 'src/banking')
| -rw-r--r-- | src/banking/account.rs | 7 | ||||
| -rw-r--r-- | src/banking/asset.rs | 10 |
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)); } |
