account total
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user