diff options
author | Sebastian Reichel <sre@ring0.de> | 2012-07-13 20:43:38 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2012-07-13 20:43:38 +0200 |
commit | 5f3405aaffc334fc55c027623aec300f82a5512c (patch) | |
tree | 097aa2d250ec346390e34dd15d81191cd6bbef28 | |
parent | c1c2c8d7021fea6aca802925d5a27d5054e96ab0 (diff) | |
download | serial-barcode-scanner-5f3405aaffc334fc55c027623aec300f82a5512c.tar.bz2 |
fix SQL query, which fetches price information
-rwxr-xr-x | invoice/generate-invoice.py | 2 |
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]) |