From 0c9dd5093e72fde62dd26e537c76affb972c2fd8 Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Thu, 14 Mar 2024 23:07:38 +0530 Subject: [PATCH] Grey out unavailable vaccines --- inventory.py | 2 +- templates/inventory-view.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inventory.py b/inventory.py index 0d4b0d3..a4ce7dc 100644 --- a/inventory.py +++ b/inventory.py @@ -49,7 +49,7 @@ def delete(cursor, iid): def list(cursor, mid, all=False): try: if(all): - result=cursor.execute("SELECT * FROM inventory WHERE mid=?", (mid,)) + result=cursor.execute("SELECT * FROM inventory WHERE mid=? ORDER BY available DESC", (mid,)) else: result=cursor.execute("SELECT * FROM inventory WHERE mid=? AND available=?", (mid, True)) if(cursor.rowcount==0): diff --git a/templates/inventory-view.html b/templates/inventory-view.html index 3741dce..5192513 100644 --- a/templates/inventory-view.html +++ b/templates/inventory-view.html @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with Lib {% for rec in data %} - + {% endfor %}
VaccineBatchDate of Expiry
{{rec["vaccine"]}}{{rec["batch"]}}{{rec["doe"]}}
{{rec["vaccine"]}}{{rec["batch"]}}{{rec["doe"]}}
Add Inventory -- 2.39.5