1
0
Fork 0

Update Formatting / Deps

This commit is contained in:
Sarah Jamie Lewis 2024-04-02 11:31:13 -07:00
parent 570cad39f4
commit 8b6439b664
Signed by: sarah
GPG Key ID: F27FD21A270837EF
6 changed files with 373 additions and 392 deletions

755
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ledger-parser = "5.1.1"
ledger-parser = {path="./rust-ledger-parser"}
rust_decimal = "1.29.0"
spreadsheet-ods = "0.15.0"
chrono = "0.4.24"

1
rust-ledger-parser Submodule

@ -0,0 +1 @@
Subproject commit 9fa32084955d111dc8d586e1dfe523b9112c5642

View File

@ -163,6 +163,9 @@ impl Books {
ExternalAccount::new(account_name.clone(), true)
} else if account_name.starts_with("Expenses") {
ExternalAccount::new(account_name.clone(), false)
} else if account_name.starts_with("Correction") {
ExternalAccount::new(account_name.clone(), true)
} else {
ExternalAccount::new(account_name.clone(), false)
};

View File

@ -14,7 +14,7 @@ pub const OPENING_DATE : &str = "2023-02-11";
fn main() {
let mut books = Books::new();
let stop_date = format!("2023-05-18");
let stop_date = format!("2024-02-10");
books.load_ledger("2023.dat", &stop_date);
export_to_spreadsheet("test.ods", &books, &format!("{}", OPENING_DATE), &stop_date);
}

View File

@ -127,7 +127,7 @@ pub fn export_to_spreadsheet(name: &str, books: &Books, opening_date: &String,
} if a.0.starts_with("Expense") && b.0.starts_with("Income") {
return Ordering::Greater
} else {
return b.1.total_nominal(&books.commodities_oracle).total_cmp(&a.1.total_nominal(&books.commodities_oracle))
return a.1.total_nominal(&books.commodities_oracle).total_cmp(&b.1.total_nominal(&books.commodities_oracle))
}
});