summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2012-07-13 20:43:38 +0200
committerSebastian Reichel <sre@ring0.de>2012-07-13 20:43:38 +0200
commit5f3405aaffc334fc55c027623aec300f82a5512c (patch)
tree097aa2d250ec346390e34dd15d81191cd6bbef28
parentc1c2c8d7021fea6aca802925d5a27d5054e96ab0 (diff)
downloadserial-barcode-scanner-5f3405aaffc334fc55c027623aec300f82a5512c.tar.bz2
fix SQL query, which fetches price information
-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])