Skip to content

Commit

Permalink
Merge pull request #60 from jczaja/jczaja/fix
Browse files Browse the repository at this point in the history
Fix to problem and bumup version to 0.2.6
  • Loading branch information
jczaja authored Mar 4, 2023
2 parents de47ba0 + fbc0535 commit a7debea
Show file tree
Hide file tree
Showing 3 changed files with 7 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.5"
version = "0.2.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"
Expand Down
10 changes: 5 additions & 5 deletions src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn reconstruct_sold_transactions(
// to diffreences in roudings in PDF and XLSX documents

let (acquisition_date, _, cost_basis, _, _) = gains_and_losses.iter().find(|(_, tr_date, _,_, inc)|{
let tr_date = chrono::NaiveDate::parse_from_str(&tr_date, "%m/%d/%y").unwrap().format("%m/%d/%y").to_string();
let tr_date = chrono::NaiveDate::parse_from_str(&tr_date, "%m/%d/%Y").unwrap().format("%m/%d/%y").to_string();
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_date,incomes);
Expand Down Expand Up @@ -304,15 +304,15 @@ mod tests {

let parsed_gains_and_losses: Vec<(String, String, f32, f32, f32)> = vec![
(
"01/01/19".to_string(),
"06/01/21".to_string(),
"01/01/2019".to_string(),
"06/01/2021".to_string(),
10.0,
10.0,
24.8,
),
(
"01/01/21".to_string(),
"03/01/21".to_string(),
"01/01/2021".to_string(),
"03/01/2021".to_string(),
20.0,
20.0,
19.8,
Expand Down

0 comments on commit a7debea

Please sign in to comment.