Skip to content

Commit

Permalink
- Cleaning up some redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
jczaja committed Mar 8, 2023
1 parent e7563f0 commit 3f3b53a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "etradeTaxReturnHelper"
version = "0.2.7"
version = "0.2.8"
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"
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ Project that parse e-trade PDF brokerage statements and Gain and Losses document

2. How does it work?
Here is a [demo(PL)](https://www.youtube.com/watch?v=Juw3KJ1JdcA)
3. How can I help?
3. How can I report problem?
If this project does not work for you e.g. there is crash or data produced does not seem correct then please run it with diagnostic:
RUST_LOG=info RUST_BACKTRACE=full etradeTaxReturnHelper <your args e.g. PDF and XLSX files> and share it via issues or via my email (see github profile)
4. How can I help?
1. Issues and Pull Requests are welcomed!
2. If you happen to be an employee of Intel Corporation then you could support this project by
"giving me **recognition**".
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,15 @@ mod tests {
"data/Brokerage Statement - XXXX0848 - 202202.pdf",
"data/Brokerage Statement - XXXX0848 - 202203.pdf",
"data/Brokerage Statement - XXXX0848 - 202204.pdf",
"data/Brokerage Statement - XXXX0848 - 202205.pdf",
"data/G&L_Collapsed.xlsx",
])?;
let pdfnames = matches
.values_of("financial documents")
.expect_and_log("error getting brokarage statements pdfs names");
assert_eq!(
etradeTaxReturnHelper::run_taxation(&rd, pdfnames),
Ok((2930.206, 439.54138, 201.32295, 0.0))
Ok((2930.206, 439.54138, 395.45355, 91.156715))
);
Ok(())
}
Expand Down
3 changes: 0 additions & 3 deletions src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ pub fn reconstruct_sold_transactions(
// match trade date and gross with principal and trade date of trade confirmation

let (_, settlement_date, _, _, _) = sold_transactions.iter().find(|(trade_dt, _, _, _, income)|{
let incs = (inc*100.0).round();
let incomes = (income*100.0).round();
log::info!("Key tr_date: {}, inc: {}, trade_date: {}, income: {}",tr_date,incs,*trade_dt,incomes);
*trade_dt == chrono::NaiveDate::parse_from_str(&tr_date, "%m/%d/%Y").unwrap().format("%m/%d/%y").to_string()
}).expect_and_log("\n\nERROR: Sold transaction detected, but corressponding Gain&Losses document is missing. Please download Gain&Losses XLSX document at:\n
https://us.etrade.com/etx/sp/stockplan#/myAccount/gainsLosses\n\n");
Expand Down

0 comments on commit 3f3b53a

Please sign in to comment.