Skip to content

Commit b4eceb9

Browse files
committed
Adjust CSV output to match turbotax expectations
1 parent b1538d2 commit b4eceb9

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

src/main.rs

+7-24
Original file line numberDiff line numberDiff line change
@@ -2869,50 +2869,33 @@ async fn process_account_csv(
28692869
})
28702870
}
28712871
wtr.write_record([
2872-
"Token",
2872+
"Transaction Type",
2873+
"Asset Name",
28732874
"Amount",
2874-
"Income (USD)",
2875-
"Cap Gain (USD)",
2876-
"Acq. Date",
2877-
"Acq. Cost (USD)",
2878-
"Sale Date",
2879-
"Sale Proceedings (USD)",
2880-
"Acquisition Description",
2881-
"Sale Description",
2875+
"Date Acquired",
2876+
"Cost basis (USD)",
2877+
"Date of Disposition",
2878+
"Proceeds (USD)",
28822879
])?;
28832880

28842881
for disposed_lot in disposed_lots {
2885-
let mut income = disposed_lot.lot.income(disposed_lot.token);
2886-
if let Some(year) = filter_by_year {
2887-
if disposed_lot.lot.acquisition.when.year() != year {
2888-
income = 0. // Exclude income from other years
2889-
}
2890-
}
28912882
let cost = Decimal::from_u64(disposed_lot.lot.amount).unwrap()
28922883
* disposed_lot.lot.acquisition.price()
28932884
/ Decimal::from_f64(1e9).unwrap();
28942885
let proceedings = Decimal::from_u64(disposed_lot.lot.amount).unwrap()
28952886
* disposed_lot.price()
28962887
/ Decimal::from_f64(1e9).unwrap();
28972888
wtr.write_record(&[
2889+
format!("Sell"),
28982890
disposed_lot.token.to_string(),
28992891
format!(
29002892
"{:.9}",
29012893
disposed_lot.token.ui_amount(disposed_lot.lot.amount)
29022894
),
2903-
format!("{:.9}", income),
2904-
format!(
2905-
"{:.9}",
2906-
disposed_lot
2907-
.lot
2908-
.cap_gain(disposed_lot.token, disposed_lot.price())
2909-
),
29102895
disposed_lot.lot.acquisition.when.to_string(),
29112896
format!("{:.9}", cost),
29122897
disposed_lot.when.to_string(),
29132898
format!("{:.9}", proceedings),
2914-
disposed_lot.lot.acquisition.kind.to_string(),
2915-
disposed_lot.kind.to_string(),
29162899
])?;
29172900
}
29182901

0 commit comments

Comments
 (0)