]> Softwares of Agnibho - librevax.git/commitdiff
Bugfix: vaccination edit id
authorAgnibho Mondal <mondal@agnibho.com>
Thu, 11 Jan 2024 19:24:42 +0000 (00:54 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Thu, 11 Jan 2024 19:24:42 +0000 (00:54 +0530)
librevax.py
templates/patient-view.html
templates/vaccination-edit.html

index 8444187e10d0b6b7140a9d287d96c47e8f71f97f..ab1420fc75d8bf1c166d314e19bc948ed1f126e1 100644 (file)
@@ -460,7 +460,7 @@ def vaccination_view(action, id=None):
                 raise Exception("Invalid parameter")
         elif(action=="edit"):
             if(id is not None):
-                (ok, data)=vaccination.read(cursor, g.mid)
+                (ok, data)=vaccination.read(cursor, id)
                 if(not ok):
                     raise Exception(data)
                 (ok, inv)=inventory.list(cursor, g.mid)
index f15aa8725e2c28f4621b3e2397cf97b2d4968754..dd0f48bbbb36902dea1614cad1ffa064b23feab3 100644 (file)
@@ -37,7 +37,7 @@ You should have received a copy of the GNU General Public License along with Lib
   <table class="table">
     <tr><th>Vaccine</th><th>Dose</th><th>Route</th><th>Batch</th><th>DOE</th><th>Date</th><th>Consultant</th><th>Vaccinator</th><th></th></tr>
     {% for v in vaccination %}
-    <tr><td>{{v["vaccine"]}}</td><td>{{v["dose"]}}</td><td>{{v["route"]}}</td><td>{{v["batch"]}}</td><td>{{v["doe"]}}</td><td>{{v["date"]|format_date}}</td><td>{{v["consultant"]}}</td><td>{{v["vaccinator"]}}</td><td><a href="/vaccination/view/{{v["vid"]}}" class="btn btn-sm btn-outline-primary">View</a></td></tr>
+    <tr><td>{{v["vaccine"]}}</td><td>{{v["dose"]}}{% if v["dosage"]>1 %}&times;{{v["dosage"]}}{% endif %}</td><td>{{v["route"]}}</td><td>{{v["batch"]}}</td><td>{{v["doe"]}}</td><td>{{v["date"]|format_date}}</td><td>{{v["consultant"]}}</td><td>{{v["vaccinator"]}}</td><td><a href="/vaccination/view/{{v["vid"]}}" class="btn btn-sm btn-outline-primary">View</a></td></tr>
     {% endfor %}
   </table>
 
index e906de907fd2c79c7ea31669895bb85c486936f7..f5919124afd852c7a10afb969a2a6a4d266599d7 100644 (file)
@@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License along with Lib
     <div class="mb-2 row">
       <label class="form-label col-sm-3">Dosage</label>
       <div class="col-sm-9">
-        <input name="dosage" placeholder="Number of doses given" required class="form-control" value="{{data["dosage"]}}">
+        <input name="dosage" placeholder="Number of doses given" required class="form-control" value="{% if data["dosage"] %}{{data["dosage"]}}{% else %}1{% endif %}">
       </div>
     </div>
     <div class="mb-2 row">