]> Softwares of Agnibho - librevax.git/blob - templates/transaction-view.html
Link to inventory
[librevax.git] / templates / transaction-view.html
1 <!--
2 LibreVax
3 Copyright (C) 2024 Dr. Agnibho Mondal
4 This file is part of LibreVax.
5 LibreVax is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6 LibreVax is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 You should have received a copy of the GNU General Public License along with LibreVax. If not, see <https://www.gnu.org/licenses/>.
8 -->
9
10 {% set title="Transaction Record" %}
11 {% extends "base.html" %}
12
13 {% block content %}
14
15 <div class="content">
16 {% if action=="list" %}
17
18 <!-- LIST -->
19
20 <div class="row">
21 <div class="col-sm-10"><h2><a href="/inventory/view/{{item["iid"]}}">{{item["vaccine"]}} ({{item["batch"]}})</a></h2></div>
22 <div class="col-sm-2 d-grid"><a href="/transaction/new/{{item["iid"]}}" class="btn btn-outline-primary">Add Transaction</a></div>
23 </div>
24 <hr>
25 <table class="table">
26 <tr><th>Date</th><th>Type</th><th>Amount</th></tr>
27 {% for rec in data %}
28 <tr><td><a href="/transaction/view/{{rec["tid"]}}">{{rec["date"]|format_date}}</a></td><td><a href="/transaction/view/{{rec["tid"]}}">{{rec["action"]}}</a></td><td><a href="/transaction/view/{{rec["tid"]}}">{{rec["target"]}}</a></td></tr>
29 {% endfor %}
30 <tr><th>Administered</th><td></td><td>{{usage}}</td></tr>
31 <tr><th>Balance</th><td></td><td>{{balance}}</td></tr>
32 </table>
33 <hr>
34 <h3>Vaccination Record</h3>
35 <table class="table">
36 <tr><th>Date</th><th>Patient</th><th>Dosage</th></tr>
37 {% for rec in administered %}
38 <tr><td>{{rec["date"]|format_date}}</td><td><a href="/patient/view/{{rec["pid"]}}">{{rec["name"]}}</a></td><td>{{rec["dosage"]}}</tr>
39 {% endfor %}
40 </table>
41
42
43 {% endif %}
44
45 {% if action=="view" %}
46
47 <!-- VIEW -->
48 <table class="table">
49 <tr><th>Item</th><td><a href="/inventory/view/{{item["iid"]}}">{{item["vaccine"]}} ({{item["batch"]}})</a></td></tr>
50 <tr><th>Type</th><td>{{data["action"]}}</td></tr>
51 <tr><th>Date</th><td>{{data["date"]|format_date}}</td></tr>
52 <tr><th>Amount</th><td>{{data["target"]}}</td></tr>
53 <tr><th>Memo</th><td>{{data["memo"]}}</td></tr>
54 </table>
55 <a href="/transaction/edit/{{data["tid"]}}" class="btn btn-primary">Edit</a>
56 <a href="/delete/transaction/{{data["tid"]}}" class="btn btn-danger delete-link">Delete</a>
57 </table>
58
59 {% endif %}
60 </div>
61
62 {% endblock %}