summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2013-02-04 22:42:07 +0100
committerSebastian Reichel <sre@ring0.de>2013-02-04 22:42:07 +0100
commitbb966b14b5ccfc0f2a1508d4065a1294f7e46020 (patch)
treed5b40fc22e181523b0ba57ea8251fa1c804fa592
parentf89a9e9ef3113e21743e8896a06a0e21e7516616 (diff)
downloadserial-barcode-scanner-bb966b14b5ccfc0f2a1508d4065a1294f7e46020.tar.bz2
invoice month is now calendar month
-rw-r--r--src/db.vala5
-rw-r--r--src/web.vala4
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);
}