From ec961d18c1b9c6d83ea5d82568486bbc44cf144f Mon Sep 17 00:00:00 2001 From: scoobybejesus Date: Sun, 25 Aug 2019 22:52:28 -0400 Subject: [PATCH] transactions::get_outgoing_exchange_and_flow_mvmts: passing user_home_currency only rather than whole 'settings' obj --- src/csv_export.rs | 2 +- src/transaction.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/csv_export.rs b/src/csv_export.rs index e30e931..443ca08 100644 --- a/src/csv_export.rs +++ b/src/csv_export.rs @@ -253,7 +253,7 @@ pub fn _5_transaction_mvmt_summaries_to_csv( let mut expense_lt = d128!(0); let flow_or_outgoing_exchange_movements = txn.get_outgoing_exchange_and_flow_mvmts( - settings, + &settings.home_currency, ars, raw_acct_map, acct_map, diff --git a/src/transaction.rs b/src/transaction.rs index 7878cc6..da375f4 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -11,7 +11,6 @@ use decimal::d128; use chrono::NaiveDate; use serde_derive::{Serialize, Deserialize}; -use crate::core_functions::ImportProcessParameters; use crate::account::{Account, Movement, RawAccount}; #[derive(Clone, Debug, Serialize, Deserialize)] @@ -147,7 +146,7 @@ impl Transaction { pub fn get_outgoing_exchange_and_flow_mvmts( &self, - settings: &ImportProcessParameters, + user_home_currency: &String, ars: &HashMap, raw_acct_map: &HashMap, acct_map: &HashMap, @@ -162,7 +161,7 @@ impl Transaction { let acct = acct_map.get(&ar.account_key).unwrap(); let raw_acct = raw_acct_map.get(&acct.raw_key).unwrap(); - if !raw_acct.is_home_currency(&settings.home_currency) & !raw_acct.is_margin { + if !raw_acct.is_home_currency(user_home_currency) & !raw_acct.is_margin { let movements = ar.get_mvmts_in_ar(acct_map, txns_map);