diff --git a/src/csv_export.rs b/src/csv_export.rs index 35aecd8..1369393 100644 --- a/src/csv_export.rs +++ b/src/csv_export.rs @@ -504,6 +504,7 @@ pub fn _6_transaction_mvmt_detail_to_csv_w_orig( let mut rows: Vec> = [].to_vec(); let mut header: Vec = Vec::with_capacity(16); + header.extend_from_slice(&[ "Date".to_string(), "Txn#".to_string(), @@ -548,7 +549,7 @@ pub fn _6_transaction_mvmt_detail_to_csv_w_orig( let tx_number = txn.tx_number.to_string(); let tx_type = txn.transaction_type(&ars, &raw_acct_map, &acct_map)?; let user_memo = txn.user_memo.to_string(); - let auto_memo = txn.get_auto_memo(ars, raw_acct_map,acct_map)?; + let auto_memo = txn.get_auto_memo(ars, raw_acct_map,acct_map, &settings.home_currency)?; let mut amount = d128!(0); amount += mvmt.amount; // To prevent printing -5E+1 instead of 50, for example let ticker = raw_acct.ticker.to_string(); diff --git a/src/transaction.rs b/src/transaction.rs index 5285362..0a672d0 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -217,7 +217,8 @@ impl Transaction { &self, ars: &HashMap, raw_accts: &HashMap, - acct_map: &HashMap + acct_map: &HashMap, + home_currency: &String, ) -> Result> { let auto_memo = if self.action_record_idx_vec.len() == 2 { @@ -238,11 +239,12 @@ impl Transaction { let ic_raw_acct = raw_accts.get(&ic_acct.raw_key).unwrap(); let ic_ticker = &ic_raw_acct.ticker; - format!("Paid {} {} for {} {}", og_amt, og_ticker, ic_amt, ic_ticker) + format!("Paid {} {} for {} {}, valued at {} {}.", + og_amt, og_ticker, ic_amt, ic_ticker, self.proceeds, home_currency) } else { - format!("Margin profit or loss") + format!("Margin profit or loss valued at {} {}.", self.proceeds, home_currency) } } else { @@ -255,11 +257,11 @@ impl Transaction { if amt > d128!(0.0) { - format!("Received {} {}", amt, ticker) + format!("Received {} {} valued at {} {}.", amt, ticker, self.proceeds, home_currency) } else { - format!("Spent {} {}", amt, ticker) + format!("Spent {} {} valued at {} {}.", amt, ticker, self.proceeds, home_currency) } };