feat: add reconciliation and ledger views to web dashboard with test suite
All checks were successful
Deploy to K8s / deploy (push) Successful in 11s
All checks were successful
Deploy to K8s / deploy (push) Successful in 11s
This commit is contained in:
@@ -101,11 +101,66 @@
|
||||
color: #aaaaaa;
|
||||
/* Light gray for normal cells */
|
||||
}
|
||||
|
||||
.nav {
|
||||
margin-bottom: 20px;
|
||||
font-size: 12px;
|
||||
color: #555;
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.nav a {
|
||||
color: #00ff00;
|
||||
text-decoration: none;
|
||||
padding: 2px 8px;
|
||||
border: 1px solid #333;
|
||||
}
|
||||
|
||||
.nav a.active {
|
||||
color: #000;
|
||||
background-color: #00ff00;
|
||||
border-color: #00ff00;
|
||||
}
|
||||
|
||||
.nav a:hover {
|
||||
color: #fff;
|
||||
border-color: #555;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.description a {
|
||||
color: #00ff00;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.description a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="nav">
|
||||
<a href="/fees" class="active">[Attendance/Fees]</a>
|
||||
<a href="/reconcile">[Payment Reconciliation]</a>
|
||||
<a href="/payments">[Payments Ledger]</a>
|
||||
</div>
|
||||
|
||||
<h1>FUJ Fees Dashboard</h1>
|
||||
|
||||
<div class="description">
|
||||
Calculated monthly fees based on attendance markers.<br>
|
||||
Source: <a href="{{ attendance_url }}" target="_blank">Attendance Sheet</a> |
|
||||
<a href="{{ payments_url }}" target="_blank">Payments Ledger</a>
|
||||
</div>
|
||||
|
||||
<div class="table-container">
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
188
templates/payments.html
Normal file
188
templates/payments.html
Normal file
@@ -0,0 +1,188 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>FUJ Payments Ledger</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
background-color: #0c0c0c;
|
||||
color: #cccccc;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-size: 11px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #00ff00;
|
||||
font-family: inherit;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #00ff00;
|
||||
font-size: 12px;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 5px;
|
||||
text-transform: uppercase;
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
border-bottom: 1px solid #333;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.nav {
|
||||
margin-bottom: 20px;
|
||||
font-size: 12px;
|
||||
color: #555;
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.nav a {
|
||||
color: #00ff00;
|
||||
text-decoration: none;
|
||||
padding: 2px 8px;
|
||||
border: 1px solid #333;
|
||||
}
|
||||
|
||||
.nav a.active {
|
||||
color: #000;
|
||||
background-color: #00ff00;
|
||||
border-color: #00ff00;
|
||||
}
|
||||
|
||||
.nav a:hover {
|
||||
color: #fff;
|
||||
border-color: #555;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.description a {
|
||||
color: #00ff00;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.description a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.ledger-container {
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.member-block {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.txn-table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.txn-table th,
|
||||
.txn-table td {
|
||||
padding: 2px 8px;
|
||||
text-align: left;
|
||||
border-bottom: 1px dashed #222;
|
||||
}
|
||||
|
||||
.txn-table th {
|
||||
color: #555;
|
||||
text-transform: lowercase;
|
||||
font-weight: normal;
|
||||
border-bottom: 1px solid #333;
|
||||
}
|
||||
|
||||
.txn-date {
|
||||
min-width: 80px;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.txn-amount {
|
||||
min-width: 80px;
|
||||
text-align: right !important;
|
||||
color: #00ff00;
|
||||
}
|
||||
|
||||
.txn-purpose {
|
||||
min-width: 100px;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.txn-message {
|
||||
color: #666;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
tr:hover {
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="nav">
|
||||
<a href="/fees">[Attendance/Fees]</a>
|
||||
<a href="/reconcile">[Payment Reconciliation]</a>
|
||||
<a href="/payments" class="active">[Payments Ledger]</a>
|
||||
</div>
|
||||
|
||||
<h1>Payments Ledger</h1>
|
||||
|
||||
<div class="description">
|
||||
All bank transactions from the Google Sheet, grouped by member.<br>
|
||||
Source: <a href="{{ attendance_url }}" target="_blank">Attendance Sheet</a> |
|
||||
<a href="{{ payments_url }}" target="_blank">Payments Ledger</a>
|
||||
</div>
|
||||
|
||||
<div class="ledger-container">
|
||||
{% for person in sorted_people %}
|
||||
<div class="member-block">
|
||||
<h2>{{ person }}</h2>
|
||||
<table class="txn-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="txn-date">Date</th>
|
||||
<th class="txn-amount">Amount</th>
|
||||
<th class="txn-purpose">Purpose</th>
|
||||
<th class="txn-message">Bank Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for tx in grouped_payments[person] %}
|
||||
<tr>
|
||||
<td class="txn-date">{{ tx.date }}</td>
|
||||
<td class="txn-amount">{{ tx.amount }} CZK</td>
|
||||
<td class="txn-purpose">{{ tx.purpose }}</td>
|
||||
<td class="txn-message">{{ tx.message }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
280
templates/reconcile.html
Normal file
280
templates/reconcile.html
Normal file
@@ -0,0 +1,280 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>FUJ Payment Reconciliation</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
background-color: #0c0c0c;
|
||||
color: #cccccc;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-size: 11px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #00ff00;
|
||||
font-family: inherit;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #00ff00;
|
||||
font-size: 12px;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 10px;
|
||||
text-transform: uppercase;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
border-bottom: 1px solid #333;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.nav {
|
||||
margin-bottom: 20px;
|
||||
font-size: 12px;
|
||||
color: #555;
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.nav a {
|
||||
color: #00ff00;
|
||||
text-decoration: none;
|
||||
padding: 2px 8px;
|
||||
border: 1px solid #333;
|
||||
}
|
||||
|
||||
.nav a.active {
|
||||
color: #000;
|
||||
background-color: #00ff00;
|
||||
border-color: #00ff00;
|
||||
}
|
||||
|
||||
.nav a:hover {
|
||||
color: #fff;
|
||||
border-color: #555;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.description a {
|
||||
color: #00ff00;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.description a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
background-color: transparent;
|
||||
border: 1px solid #333;
|
||||
box-shadow: none;
|
||||
overflow-x: auto;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
table-layout: auto;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: 2px 8px;
|
||||
text-align: right;
|
||||
border-bottom: 1px dashed #222;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
th:first-child,
|
||||
td:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: transparent;
|
||||
color: #888888;
|
||||
font-weight: normal;
|
||||
border-bottom: 1px solid #555;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
||||
tr:hover {
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
|
||||
.balance-pos {
|
||||
color: #00ff00;
|
||||
}
|
||||
|
||||
.balance-neg {
|
||||
color: #ff3333;
|
||||
}
|
||||
|
||||
.cell-ok {
|
||||
color: #00ff00;
|
||||
}
|
||||
|
||||
.cell-unpaid {
|
||||
color: #ff3333;
|
||||
}
|
||||
|
||||
.cell-empty {
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
.list-container {
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
color: #888;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
gap: 20px;
|
||||
padding: 1px 0;
|
||||
border-bottom: 1px dashed #222;
|
||||
}
|
||||
|
||||
.list-item-name {
|
||||
color: #ccc;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.list-item-val {
|
||||
color: #00ff00;
|
||||
}
|
||||
|
||||
.unmatched-row {
|
||||
font-family: inherit;
|
||||
display: grid;
|
||||
grid-template-columns: 100px 100px 200px 1fr;
|
||||
gap: 15px;
|
||||
color: #888;
|
||||
padding: 2px 0;
|
||||
border-bottom: 1px dashed #222;
|
||||
}
|
||||
|
||||
.unmatched-header {
|
||||
color: #555;
|
||||
border-bottom: 1px solid #333;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="nav">
|
||||
<a href="/fees">[Attendance/Fees]</a>
|
||||
<a href="/reconcile" class="active">[Payment Reconciliation]</a>
|
||||
<a href="/payments">[Payments Ledger]</a>
|
||||
</div>
|
||||
|
||||
<h1>Payment Reconciliation</h1>
|
||||
|
||||
<div class="description">
|
||||
Balances calculated by matching Google Sheet payments against attendance fees.<br>
|
||||
Source: <a href="{{ attendance_url }}" target="_blank">Attendance Sheet</a> |
|
||||
<a href="{{ payments_url }}" target="_blank">Payments Ledger</a>
|
||||
</div>
|
||||
|
||||
<div class="table-container">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Member</th>
|
||||
{% for m in months %}
|
||||
<th>{{ m }}</th>
|
||||
{% endfor %}
|
||||
<th>Balance</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in results %}
|
||||
<tr>
|
||||
<td>{{ row.name }}</td>
|
||||
{% for cell in row.months %}
|
||||
<td
|
||||
class="{% if cell == '-' %}cell-empty{% elif 'UNPAID' in cell %}cell-unpaid{% elif cell == 'OK' %}cell-ok{% endif %}">
|
||||
{{ cell }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
<td class="{% if row.balance > 0 %}balance-pos{% elif row.balance < 0 %}balance-neg{% endif %}">
|
||||
{{ "%+d"|format(row.balance) if row.balance != 0 else "0" }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if credits %}
|
||||
<h2>Credits (Advance Payments / Surplus)</h2>
|
||||
<div class="list-container">
|
||||
{% for item in credits %}
|
||||
<div class="list-item">
|
||||
<span class="list-item-name">{{ item.name }}</span>
|
||||
<span class="list-item-val">{{ item.amount }} CZK</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if debts %}
|
||||
<h2>Debts (Missing Payments)</h2>
|
||||
<div class="list-container">
|
||||
{% for item in debts %}
|
||||
<div class="list-item">
|
||||
<span class="list-item-name">{{ item.name }}</span>
|
||||
<span class="list-item-val" style="color: #ff3333;">{{ item.amount }} CZK</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if unmatched %}
|
||||
<h2>Unmatched Transactions</h2>
|
||||
<div class="list-container">
|
||||
<div class="unmatched-row unmatched-header">
|
||||
<span>Date</span>
|
||||
<span>Amount</span>
|
||||
<span>Sender</span>
|
||||
<span>Message</span>
|
||||
</div>
|
||||
{% for tx in unmatched %}
|
||||
<div class="unmatched-row">
|
||||
<span>{{ tx.date }}</span>
|
||||
<span>{{ tx.amount }}</span>
|
||||
<span>{{ tx.sender }}</span>
|
||||
<span>{{ tx.message }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user