From: Agnibho Mondal Date: Thu, 11 Jan 2024 18:59:24 +0000 (+0530) Subject: Generic name X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=037d95d2f665cd52a43030b3aac750ee66ca1957;p=librevax.git Generic name --- diff --git a/inventory.py b/inventory.py index 1476d5e..efa7363 100644 --- a/inventory.py +++ b/inventory.py @@ -7,7 +7,7 @@ def create(cursor, data): try: - cursor.execute("INSERT INTO inventory (mid, vaccine, dose, dpv, route, batch, doe, available, data) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", (data["mid"], data["vaccine"], data["dose"], data["dpv"], data["route"], data["batch"], data["doe"], "", "")) + cursor.execute("INSERT INTO inventory (mid, vaccine, altname, dose, dpv, route, batch, doe, available, data) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", (data["mid"], data["vaccine"], data["altname"], data["dose"], data["dpv"], data["route"], data["batch"], data["doe"], "", "")) if(cursor.rowcount==0): return (False, "Failed to create record.") else: @@ -28,7 +28,7 @@ def read(cursor, iid): def update(cursor, iid, data): try: - cursor.execute("UPDATE inventory SET vaccine=?, dose=?, dpv=?, route=?, batch=?, doe=?, available=? WHERE iid=?", (data["vaccine"], data["dose"], data["dpv"], data["route"], data["batch"], data["doe"], "", iid)) + cursor.execute("UPDATE inventory SET vaccine=?, altname=?, dose=?, dpv=?, route=?, batch=?, doe=?, available=? WHERE iid=?", (data["vaccine"], data["altname"], data["dose"], data["dpv"], data["route"], data["batch"], data["doe"], "", iid)) if(cursor.rowcount==0): return (False, "Failed to update record.") else: diff --git a/templates/inventory-edit.html b/templates/inventory-edit.html index d61aae5..06c5ab2 100644 --- a/templates/inventory-edit.html +++ b/templates/inventory-edit.html @@ -21,6 +21,12 @@ You should have received a copy of the GNU General Public License along with Lib +
+ +
+ +
+
diff --git a/templates/inventory-view.html b/templates/inventory-view.html index 78c8eca..4e72d80 100644 --- a/templates/inventory-view.html +++ b/templates/inventory-view.html @@ -31,12 +31,13 @@ You should have received a copy of the GNU General Public License along with Lib - - - - - - + + + + + + +
Vaccine{{data["vaccine"]}}
Dose{{data["dose"]}}
Dose per Vial{{data["dpv"]}}
Route of Administration{{data["route"]}}
Batch Number{{data["batch"]}}
Date of Expiry{{data["doe"]}}
Vaccine{{data["vaccine"]}}
Generic{{data["altname"]}}
Dose{{data["dose"]}}
Dose per Vial{{data["dpv"]}}
Route of Administration{{data["route"]}}
Batch Number{{data["batch"]}}
Date of Expiry{{data["doe"]}}
Edit Delete