summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/db.vala14
-rw-r--r--src/web.vala4
2 files changed, 6 insertions, 12 deletions
diff --git a/src/db.vala b/src/db.vala
index dc1c834..f938cc8 100644
--- a/src/db.vala
+++ b/src/db.vala
@@ -19,8 +19,8 @@ public struct StockEntry {
public string id;
public string name;
public int amount;
- public string memberprice;
- public string guestprice;
+ public Price memberprice;
+ public Price guestprice;
}
public struct PriceEntry {
@@ -350,16 +350,10 @@ public class Database {
statements["stock_status"].column_text(0),
statements["stock_status"].column_text(1),
statements["stock_status"].column_int(2),
- null,
- null
+ statements["stock_status"].column_int(3),
+ statements["stock_status"].column_int(4)
};
- Price mprice = statements["stock_status"].column_int(3);
- Price gprice = statements["stock_status"].column_int(4);
-
- entry.memberprice = @"$mprice";
- entry.guestprice = @"$gprice";
-
result.add(entry);
}
diff --git a/src/web.vala b/src/web.vala
index 7140c22..c61c8b9 100644
--- a/src/web.vala
+++ b/src/web.vala
@@ -440,8 +440,8 @@ public class WebServer {
string table = "";
foreach(var e in db.get_stock()) {
- table += "<tr><td><a href=\"/products/%s\">%s</a></td><td><a href=\"/products/%s\">%s</a></td><td>%d</td><td>%s€</td><td>%s€</td></tr>".printf(
- e.id, e.id, e.id, e.name, e.amount, e.memberprice, e.guestprice
+ table += "<tr><td><a href=\"/products/%s\">%s</a></td><td><a href=\"/products/%s\">%s</a></td><td>%d</td><td>f%€</td><td>%f€</td></tr>".printf(
+ e.id, e.id, e.id, e.name, e.amount, e.memberprice / 100, e.guestprice / 100
);
}