Skip to content

Commit

Permalink
Added CSV export for Capital Gains and Report Summary
Browse files Browse the repository at this point in the history
Other changes made in the meantime:

* Use monospace font for amounts and right-align them for readability
* Improved table header consistency
* Use a custom delegate to improve Capital Gains table
* Added missing XEM icon
* Use strum to avoid missing TransactionSourceType entries in the UI
  • Loading branch information
bjorn committed Sep 22, 2023
1 parent 4f4f407 commit 5f4ab40
Show file tree
Hide file tree
Showing 12 changed files with 602 additions and 208 deletions.
163 changes: 163 additions & 0 deletions Cargo.lock

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

14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
csv = "1.2"
serde = { version = "1.0.188", features = ["derive"] }
bitcoin = "0.30.1"
chrono = { version = "0.4.31", features = ["serde"] }
chrono-tz = "0.8"
serde_json = "1.0.107"
cryptotax_ui = { path = "cryptotax_ui" }
csv = "1.2"
esplora-client = { version = "0.6", default-features = false, features = ["blocking"] }
bitcoin = "0.30.1"
slint = "1.2.1"
open = "5.0.0"
rfd = { version = "0.12", default-features = false, features = [ "xdg-portal" ] }
rust_decimal = "1.32"
rust_decimal_macros = "1.32"
cryptotax_ui = { path = "cryptotax_ui" }
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
slice-group-by = "0.3.1"
slint = "1.2.1"
strum = { version = "0.25", features = ["derive"] }
17 changes: 7 additions & 10 deletions cryptotax_ui/ui/appwindow.slint
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { Reports } from "./reports.slint";
import { Badge } from "./common.slint";
import { TestData } from "./test-data.slint";
import { UiCapitalGain, UiTaxReport, UiTransaction, UiTransactionSource } from "./structs.slint";
import { Actions } from "./global.slint";

export { UiCapitalGain }
export { UiCapitalGain, Actions }

enum Page {
sources,
Expand Down Expand Up @@ -49,10 +50,9 @@ component PageButton inherits Rectangle {
export component AppWindow inherits Window {
in property <[UiTransactionSource]> sources: TestData.sources;
in property <[string]> source_types;
in property <[UiTransaction]> transactions: TestData.transactions;
in property <[[StandardListViewItem]]> gain-entries;
in property <[StandardListViewItem]> report-years: TestData.report-years;
in property <[UiTaxReport]> reports: TestData.reports;
in property <[UiTransaction]> transactions <=> transactions-page.transactions;
in property <[StandardListViewItem]> report-years <=> reports-page.report-years;
in property <[UiTaxReport]> reports <=> reports-page.reports;

callback open-transaction(string);

Expand Down Expand Up @@ -104,16 +104,13 @@ export component AppWindow inherits Window {
sources: root.sources;
}

Transactions {
transactions-page := Transactions {
visible: active-page == Page.transactions;
transactions: root.transactions;
open-transaction(s) => { root.open-transaction(s); }
}

Reports {
reports-page := Reports {
visible: active-page == Page.reports;
report-years: root.report-years;
reports: root.reports;
}
}
}
Expand Down
Loading

0 comments on commit 5f4ab40

Please sign in to comment.