diff --git a/Cargo.lock b/Cargo.lock index 453716d..63e7449 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -571,7 +571,7 @@ checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" [[package]] name = "etradeTaxReturnHelper" -version = "0.4.5" +version = "0.4.6" dependencies = [ "calamine", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 75b8c90..80b56f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "etradeTaxReturnHelper" -version = "0.4.5" +version = "0.4.6" edition = "2021" description = "Parses etrade financial documents for transaction details (income, tax paid, cost basis) and compute total income and total tax paid according to chosen tax residency (currency)" license = "BSD-3-Clause" diff --git a/src/lib.rs b/src/lib.rs index c45c7b9..4ffe52d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,14 +69,14 @@ impl Transaction { let msg = match (&self.gross,&self.tax_paid) { (Currency::PLN(gross),Currency::PLN(tax_paid)) => { - format!("{prefix} TRANSACTION date: {}, gross: {gross} PLN, tax paid: {tax_paid} PLN", + format!("{prefix} TRANSACTION date: {}, gross: {gross:.2} PLN, tax paid: {tax_paid:.2} PLN", chrono::NaiveDate::parse_from_str(&self.transaction_date, "%m/%d/%y").map_err(|_| "Error: unable to format date")?.format("%Y-%m-%d") ) .to_owned() }, (Currency::USD(gross),Currency::USD(tax_paid)) => { - format!("{prefix} TRANSACTION date: {}, gross: ${gross}, tax paid: ${tax_paid}, exchange_rate: {} , exchange_rate_date: {}", + format!("{prefix} TRANSACTION date: {}, gross: ${gross:.2}, tax paid: ${tax_paid:.2}, exchange_rate: {} , exchange_rate_date: {}", chrono::NaiveDate::parse_from_str(&self.transaction_date, "%m/%d/%y").map_err(|_| "Error: unable to format date")?.format("%Y-%m-%d"), &self.exchange_rate,&self.exchange_rate_date ) .to_owned() @@ -84,7 +84,7 @@ impl Transaction { (Currency::EUR(gross),Currency::EUR(tax_paid)) => { - format!("{prefix} TRANSACTION date: {}, gross: €{gross}, tax paid: €{tax_paid}, exchange_rate: {} , exchange_rate_date: {}", + format!("{prefix} TRANSACTION date: {}, gross: €{gross:.2}, tax paid: €{tax_paid:.2}, exchange_rate: {} , exchange_rate_date: {}", chrono::NaiveDate::parse_from_str(&self.transaction_date, "%m/%d/%y").map_err(|_| "Error: unable to format date")?.format("%Y-%m-%d"), &self.exchange_rate,&self.exchange_rate_date ) .to_owned() diff --git a/src/main.rs b/src/main.rs index bb90283..6410fd1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,6 @@ use logging::ResultExt; // TODO: When there is no proxy (on intel account) there are problems (UT do not work // getting_Exchange_rate) // TODO: Make a parsing of incomplete date -// TODO: Dividends of revolut should combined with dividends not sold // TODO: When I sold on Dec there was EST cost (0.04). Make sure it is included in your results // TODO: async to get currency // TODO: parse_gain_and_losses expect -> ?