account total

This commit is contained in:
thatscringebro
2025-12-10 12:58:45 -05:00
parent d512dedd21
commit e8b3eae889
4 changed files with 28 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
mod data_layer;
mod entities;
use chrono::DateTime;
use chrono::{Local, TimeZone};
use sqlite::Connection;
use std::io;
@@ -38,7 +38,12 @@ fn main() {
"1" => {
let accounts = data_layer::get_accounts(&connection);
for ac in accounts.iter() {
println!("Name: {}", ac.get_name());
println!(
"Id: {}, Name: {}, Total: {}",
ac.get_id(),
ac.get_name(),
ac.get_total(&connection)
);
}
}
"2" => {
@@ -83,7 +88,7 @@ fn main() {
for t in trx.iter() {
println!(
"Date: {}, Type: {}, Description: {}, Amount: {}$",
t.get_date(),
Local.from_utc_datetime(&t.get_date().naive_local()),
t.get_type().get_description(),
t.get_desc(),
t.get_amount()