From bb966b14b5ccfc0f2a1508d4065a1294f7e46020 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Mon, 4 Feb 2013 22:42:07 +0100 Subject: invoice month is now calendar month --- src/db.vala | 5 +++-- src/web.vala | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/db.vala b/src/db.vala index 677fa56..344aa85 100644 --- a/src/db.vala +++ b/src/db.vala @@ -470,7 +470,8 @@ public class Database { switch(rc) { case Sqlite.ROW: pid = uint64.parse(statements["last_purchase"].column_text(0)); - write_to_log("Remove purchase of %llu", pid); + string pname = get_product_name(pid); + write_to_log("Remove purchase of %s", pname); break; case Sqlite.DONE: write_to_log("Error: undo not possible without purchases"); @@ -693,7 +694,7 @@ public class Database { DateTime now = new DateTime.now_local(); DateTime today = new DateTime.local(now.get_year(), now.get_month(), now.get_hour() < 8 ? now.get_day_of_month()-1 : now.get_day_of_month(), 8, 0, 0); - DateTime month = new DateTime.local(now.get_year(), now.get_day_of_month() < 16 ? now.get_month()-1 : now.get_month(), 16, 8, 0, 0); + DateTime month = new DateTime.local(now.get_year(), now.get_month(), 1, 0, 0, 0); DateTime last4weeks = now.add_days(-28); DateTime last4months = now.add_months(-4); diff --git a/src/web.vala b/src/web.vala index 14c9604..ea2e594 100644 --- a/src/web.vala +++ b/src/web.vala @@ -329,10 +329,10 @@ public class WebServer { start = new DateTime.local(selectedyear, selectedmonth, selectedday, 8, 0, 0); stop = start.add_days(1); } else if(selectedmonth != 0) { - start = new DateTime.local(selectedyear, selectedmonth, 16, 8, 0, 0); + start = new DateTime.local(selectedyear, selectedmonth, 1, 0, 0, 0); stop = start.add_months(1); } else { - start = new DateTime.local(selectedyear, 1, 16, 8, 0, 0); + start = new DateTime.local(selectedyear, 1, 1, 0, 0, 0); stop = start.add_years(1); } -- cgit v1.2.3