summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinvoice/generate-invoice.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/invoice/generate-invoice.py b/invoice/generate-invoice.py
index 176ac4b..7460817 100755
--- a/invoice/generate-invoice.py
+++ b/invoice/generate-invoice.py
@@ -38,7 +38,7 @@ def get_price_info(product, timestamp, member = True):
if not member:
field = "guestprice"
- c.execute("SELECT "+ field +" FROM prices WHERE product = ? AND valid_from <= ? ORDER BY valid_from ASC LIMIT 1;", (product,timestamp,))
+ c.execute("SELECT "+ field +" FROM prices WHERE product = ? AND valid_from <= ? ORDER BY valid_from DESC LIMIT 1;", (product,timestamp,))
for row in c:
result = int(row[0])