506 lines
20 KiB
HTML
506 lines
20 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Financial Reports — Undo Designs</title>
|
|
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--navy: #0C1A3A;
|
|
--navy-2: #12244C;
|
|
--navy-3: #1a2f5e;
|
|
--navy-4: #0a1428;
|
|
--cyan: #00D4FF;
|
|
--cyan-dim: rgba(0,212,255,.12);
|
|
--cyan-glow: rgba(0,212,255,.06);
|
|
--blue: #1B8EF8;
|
|
--green: #10D98A;
|
|
--green-dim: rgba(16,217,138,.12);
|
|
--red: #F04438;
|
|
--red-dim: rgba(240,68,56,.12);
|
|
--amber: #F79009;
|
|
--w1: rgba(255,255,255,.95);
|
|
--w2: rgba(255,255,255,.65);
|
|
--w3: rgba(255,255,255,.35);
|
|
--w4: rgba(255,255,255,.10);
|
|
--w5: rgba(255,255,255,.05);
|
|
--border: rgba(255,255,255,.07);
|
|
--border-c: rgba(0,212,255,.18);
|
|
--mono: 'JetBrains Mono', monospace;
|
|
--disp: 'Space Grotesk', sans-serif;
|
|
--body: 'Inter', sans-serif;
|
|
--radius: 10px;
|
|
}
|
|
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
body {
|
|
font-family: var(--body);
|
|
background: var(--navy-4);
|
|
color: var(--w1);
|
|
min-height: 100vh;
|
|
-webkit-font-smoothing: antialiased;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
body::before {
|
|
content: '';
|
|
position: fixed; inset: 0; pointer-events: none; z-index: 0;
|
|
background-image: radial-gradient(circle, rgba(0,212,255,.07) 1px, transparent 1px);
|
|
background-size: 28px 28px;
|
|
}
|
|
|
|
header {
|
|
position: sticky; top: 0; z-index: 100;
|
|
background: rgba(12,26,58,.85);
|
|
backdrop-filter: blur(12px);
|
|
border-bottom: 1px solid var(--border);
|
|
padding: 0 32px;
|
|
height: 60px;
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
}
|
|
.logo {
|
|
display: flex; align-items: center; gap: 10px;
|
|
font-family: var(--disp); font-size: 15px; font-weight: 600;
|
|
color: var(--w1); text-decoration: none;
|
|
}
|
|
.logo-icon {
|
|
width: 30px; height: 30px;
|
|
background: linear-gradient(135deg, var(--navy-3), var(--navy-2));
|
|
border: 1px solid var(--border-c);
|
|
border-radius: 7px;
|
|
display: flex; align-items: center; justify-content: center;
|
|
}
|
|
.logo-icon svg { width: 16px; height: 16px; }
|
|
.logo span { color: var(--cyan); }
|
|
|
|
main {
|
|
position: relative; z-index: 1;
|
|
flex: 1;
|
|
max-width: 760px;
|
|
width: 100%;
|
|
margin: 0 auto;
|
|
padding: 48px 24px 80px;
|
|
}
|
|
|
|
.page-title { margin-bottom: 40px; }
|
|
.eyebrow {
|
|
font-family: var(--mono); font-size: 10px;
|
|
letter-spacing: .16em; text-transform: uppercase;
|
|
color: var(--cyan); margin-bottom: 10px;
|
|
}
|
|
.page-title h1 {
|
|
font-family: var(--disp); font-size: 28px; font-weight: 700;
|
|
color: var(--w1); line-height: 1.2; margin-bottom: 8px;
|
|
}
|
|
.page-title p { font-size: 14px; color: var(--w2); line-height: 1.6; max-width: 560px; }
|
|
|
|
.card {
|
|
background: var(--navy-2);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius);
|
|
padding: 24px;
|
|
margin-bottom: 16px;
|
|
}
|
|
.card-label {
|
|
font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em;
|
|
text-transform: uppercase; color: var(--w3); margin-bottom: 14px;
|
|
}
|
|
|
|
.file-zone {
|
|
border: 1.5px dashed var(--border);
|
|
border-radius: 8px;
|
|
padding: 28px 20px;
|
|
text-align: center;
|
|
cursor: default;
|
|
transition: all .2s;
|
|
position: relative;
|
|
}
|
|
.file-zone:hover, .file-zone.drag-over { border-color: var(--cyan); background: var(--cyan-glow); }
|
|
.file-zone-icon {
|
|
width: 36px; height: 36px; margin: 0 auto 10px;
|
|
background: var(--w5); border-radius: 8px;
|
|
display: flex; align-items: center; justify-content: center;
|
|
}
|
|
.file-zone-icon svg { width: 18px; height: 18px; color: var(--w3); }
|
|
.file-zone-label { font-size: 13px; color: var(--w2); }
|
|
.file-zone-label strong { color: var(--cyan); }
|
|
.file-zone-sub { font-size: 11px; color: var(--w3); margin-top: 4px; }
|
|
|
|
.tb-file-list { list-style: none; margin-top: 12px; }
|
|
.tb-file-list li {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 8px 12px; border: 1px solid var(--border);
|
|
border-radius: 6px; margin-bottom: 6px;
|
|
font-family: var(--mono); font-size: 11px; color: var(--w2);
|
|
background: var(--w5);
|
|
}
|
|
.tb-file-list li span { color: var(--cyan); margin-right: 8px; }
|
|
.tb-remove { background: none; border: none; cursor: pointer; color: var(--w3); font-size: 14px; padding: 0 4px; transition: color .15s; }
|
|
.tb-remove:hover { color: var(--red); }
|
|
|
|
.field-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
|
|
.field { flex: 1; min-width: 200px; }
|
|
.field label { display: block; font-size: 11px; color: var(--w3); margin-bottom: 6px; }
|
|
.field input[type="text"], .field input[type="date"] {
|
|
width: 100%; background: var(--navy-4); border: 1px solid var(--border); border-radius: 6px;
|
|
padding: 9px 12px; font-family: var(--body); font-size: 13px; color: var(--w1);
|
|
outline: none; transition: border-color .2s;
|
|
}
|
|
.field input:focus { border-color: var(--cyan); }
|
|
|
|
.check-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; cursor: pointer; user-select: none; }
|
|
.checkbox {
|
|
width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--border);
|
|
background: var(--w5); display: flex; align-items: center; justify-content: center;
|
|
flex-shrink: 0; transition: all .15s;
|
|
}
|
|
.checkbox.checked { background: var(--cyan-dim); border-color: var(--border-c); }
|
|
.checkbox svg { width: 11px; height: 11px; color: var(--cyan); display: none; }
|
|
.checkbox.checked svg { display: block; }
|
|
.check-label { font-size: 13px; color: var(--w2); }
|
|
.check-label strong { color: var(--w1); }
|
|
|
|
.btn {
|
|
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
|
|
padding: 11px 22px; border-radius: 8px; border: none;
|
|
font-family: var(--disp); font-size: 13px; font-weight: 600;
|
|
cursor: pointer; transition: all .2s; text-decoration: none;
|
|
width: 100%; margin-top: 6px;
|
|
}
|
|
.btn-primary { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: var(--navy); }
|
|
.btn-primary:hover { filter: brightness(1.08); }
|
|
.btn-primary:disabled { opacity: .4; cursor: not-allowed; filter: none; }
|
|
|
|
.spinner {
|
|
display: none;
|
|
align-items: center; gap: 8px;
|
|
font-family: var(--mono); font-size: 11px; color: var(--w3);
|
|
margin-top: 12px;
|
|
}
|
|
.spinner.visible { display: flex; }
|
|
.spinner-dot {
|
|
width: 6px; height: 6px; border-radius: 50%; background: var(--cyan);
|
|
animation: pulse 1s infinite ease-in-out;
|
|
}
|
|
@keyframes pulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
|
|
|
|
.error-note {
|
|
display: none;
|
|
font-size: 12px; color: var(--red); background: var(--red-dim);
|
|
border: 1px solid rgba(240,68,56,.2); border-radius: 8px;
|
|
padding: 12px 14px; margin-top: 12px;
|
|
}
|
|
.error-note.visible { display: block; }
|
|
|
|
.result-card { display: none; }
|
|
.result-card.visible { display: block; }
|
|
.result-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
|
|
.result-icon {
|
|
width: 32px; height: 32px; border-radius: 8px;
|
|
display: flex; align-items: center; justify-content: center;
|
|
}
|
|
.result-icon.ok { background: var(--green-dim); }
|
|
.result-icon.warn { background: var(--red-dim); }
|
|
.result-icon svg { width: 16px; height: 16px; }
|
|
.result-title { font-family: var(--disp); font-size: 15px; font-weight: 600; color: var(--w1); }
|
|
.result-sub { font-size: 12px; color: var(--w3); margin-top: 2px; }
|
|
|
|
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
|
|
.stat-box { background: var(--w5); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
|
|
.stat-value { font-family: var(--mono); font-size: 17px; font-weight: 500; color: var(--cyan); line-height: 1; }
|
|
.stat-value.positive { color: var(--green); }
|
|
.stat-value.negative { color: var(--red); }
|
|
.stat-label { font-size: 10px; color: var(--w3); margin-top: 4px; text-transform: uppercase; letter-spacing: .08em; }
|
|
|
|
.recon-row {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 8px 0; border-bottom: 1px solid var(--w5);
|
|
font-family: var(--mono); font-size: 11px; color: var(--w2);
|
|
}
|
|
.recon-row:last-child { border-bottom: none; }
|
|
.recon-badge { padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 500; }
|
|
.recon-badge.ok { background: var(--green-dim); color: var(--green); }
|
|
.recon-badge.warn { background: var(--red-dim); color: var(--red); }
|
|
|
|
footer { position: relative; z-index: 1; text-align: center; padding: 20px; font-size: 11px; color: var(--w3); border-top: 1px solid var(--border); }
|
|
footer a { color: var(--cyan); text-decoration: none; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<a class="logo" href="/">
|
|
<div class="logo-icon">
|
|
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M2 4h12M2 8h8M2 12h5" stroke="#00D4FF" stroke-width="1.5" stroke-linecap="round"/>
|
|
</svg>
|
|
</div>
|
|
Financial <span>Reports</span>
|
|
</a>
|
|
</header>
|
|
|
|
<main>
|
|
<div class="page-title">
|
|
<div class="eyebrow">Planeterra International Foundation</div>
|
|
<h1>Financial Reports</h1>
|
|
<p>Upload the revenue and expense trial balances to generate a Category Summary and Balance Sheet snapshot.</p>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-label">Trial Balance Files</div>
|
|
<div class="file-zone" id="tbZone">
|
|
<input type="file" id="tbFileInput" accept=".xlsx,.xls" multiple style="display:none">
|
|
<div class="file-zone-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
|
|
<polyline points="14,2 14,8 20,8"/>
|
|
</svg>
|
|
</div>
|
|
<div class="file-zone-label" id="tbDropLabel"><strong>Drop trial balance files here</strong> or <span style="color:var(--cyan);cursor:pointer" id="tbBrowseBtn">browse</span></div>
|
|
<div class="file-zone-sub">Revenue trial balance + expense trial balance (.xlsx)</div>
|
|
</div>
|
|
<ul class="tb-file-list" id="tbFileList"></ul>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-label">Report Options</div>
|
|
|
|
<div class="check-row" id="checkCategorySummary">
|
|
<div class="checkbox checked">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20,6 9,17 4,12"/></svg>
|
|
</div>
|
|
<div class="check-label"><strong>Category Summary</strong> — Revenue & Expense by Account/Category/Project Code</div>
|
|
</div>
|
|
<div class="check-row" id="checkBalanceSheet">
|
|
<div class="checkbox checked">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20,6 9,17 4,12"/></svg>
|
|
</div>
|
|
<div class="check-label"><strong>Balance Sheet</strong> — Assets / Liabilities / Net Assets snapshot</div>
|
|
</div>
|
|
<div class="check-row" id="checkCents" style="margin-top:14px">
|
|
<div class="checkbox">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20,6 9,17 4,12"/></svg>
|
|
</div>
|
|
<div class="check-label">Show cents (default: whole dollars)</div>
|
|
</div>
|
|
|
|
<div class="field-row" style="margin-top:16px">
|
|
<div class="field">
|
|
<label for="reportDate">Report Date</label>
|
|
<input type="date" id="reportDate">
|
|
</div>
|
|
<div class="field">
|
|
<label for="reportTitle">Report Title</label>
|
|
<input type="text" id="reportTitle" value="Planeterra International Foundation (Group Consolidated)">
|
|
</div>
|
|
</div>
|
|
|
|
<button class="btn btn-primary" id="processBtn" disabled>Generate Report</button>
|
|
<div class="spinner" id="spinner">
|
|
<div class="spinner-dot"></div>
|
|
Processing…
|
|
</div>
|
|
<div class="error-note" id="errorNote"></div>
|
|
</div>
|
|
|
|
<div class="card result-card" id="resultCard">
|
|
<div class="result-header">
|
|
<div class="result-icon" id="resultIcon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="#10D98A" stroke-width="2.5">
|
|
<polyline points="20,6 9,17 4,12"/>
|
|
</svg>
|
|
</div>
|
|
<div>
|
|
<div class="result-title" id="resultTitle">Report generated</div>
|
|
<div class="result-sub" id="resultSub"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="stats-grid">
|
|
<div class="stat-box">
|
|
<div class="stat-value" id="statRevenue">—</div>
|
|
<div class="stat-label">Total Revenue</div>
|
|
</div>
|
|
<div class="stat-box">
|
|
<div class="stat-value" id="statExpense">—</div>
|
|
<div class="stat-label">Total Expense</div>
|
|
</div>
|
|
<div class="stat-box">
|
|
<div class="stat-value" id="statSurplus">—</div>
|
|
<div class="stat-label">Surplus / (Deficit)</div>
|
|
</div>
|
|
<div class="stat-box">
|
|
<div class="stat-value" id="statBalanceCheck">—</div>
|
|
<div class="stat-label">Balance Sheet Check</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="reconSection" style="display:none">
|
|
<div class="card-label" style="margin-top:4px">Reconciliation to Uploaded Files</div>
|
|
<div id="reconRows"></div>
|
|
</div>
|
|
|
|
<button class="btn btn-primary" id="downloadBtn" style="margin-top:16px">Download Report</button>
|
|
</div>
|
|
</main>
|
|
|
|
<footer>
|
|
Built by <a href="https://undodesigns.com" target="_blank">Undo Designs</a> · Financial Reports v1
|
|
</footer>
|
|
|
|
<script>
|
|
const $ = id => document.getElementById(id);
|
|
|
|
$('reportDate').valueAsDate = new Date();
|
|
|
|
// ── Checkboxes ──────────────────────────────────────────────────────────────
|
|
function toggleCheck(rowId) {
|
|
$(rowId).querySelector('.checkbox').classList.toggle('checked');
|
|
}
|
|
$('checkCategorySummary').addEventListener('click', () => toggleCheck('checkCategorySummary'));
|
|
$('checkBalanceSheet').addEventListener('click', () => toggleCheck('checkBalanceSheet'));
|
|
$('checkCents').addEventListener('click', () => toggleCheck('checkCents'));
|
|
function isChecked(rowId) { return $(rowId).querySelector('.checkbox').classList.contains('checked'); }
|
|
|
|
// ── Multi-file upload ──────────────────────────────────────────────────────
|
|
const tbFiles = [];
|
|
|
|
function renderFileList() {
|
|
const list = $('tbFileList');
|
|
list.innerHTML = '';
|
|
tbFiles.forEach((file, idx) => {
|
|
const li = document.createElement('li');
|
|
li.innerHTML = `<span>${idx + 1}</span>${file.name}
|
|
<button class="tb-remove" data-idx="${idx}" title="Remove">✕</button>`;
|
|
list.appendChild(li);
|
|
});
|
|
list.querySelectorAll('.tb-remove').forEach(btn => {
|
|
btn.addEventListener('click', () => {
|
|
tbFiles.splice(+btn.dataset.idx, 1);
|
|
renderFileList();
|
|
$('processBtn').disabled = tbFiles.length === 0;
|
|
});
|
|
});
|
|
$('tbDropLabel').innerHTML = tbFiles.length
|
|
? `<strong>${tbFiles.length} file${tbFiles.length > 1 ? 's' : ''} selected</strong> — <span style="color:var(--cyan);cursor:pointer" id="tbBrowseBtn">add more</span>`
|
|
: `<strong>Drop trial balance files here</strong> or <span style="color:var(--cyan);cursor:pointer" id="tbBrowseBtn">browse</span>`;
|
|
document.getElementById('tbBrowseBtn')?.addEventListener('click', () => $('tbFileInput').click());
|
|
}
|
|
|
|
$('tbBrowseBtn').addEventListener('click', () => $('tbFileInput').click());
|
|
$('tbFileInput').addEventListener('change', () => {
|
|
Array.from($('tbFileInput').files).forEach(f => {
|
|
if (!tbFiles.find(x => x.name === f.name)) tbFiles.push(f);
|
|
});
|
|
$('tbFileInput').value = '';
|
|
$('processBtn').disabled = tbFiles.length === 0;
|
|
renderFileList();
|
|
});
|
|
|
|
const zone = $('tbZone');
|
|
zone.addEventListener('dragover', e => { e.preventDefault(); zone.classList.add('drag-over'); });
|
|
zone.addEventListener('dragleave', () => zone.classList.remove('drag-over'));
|
|
zone.addEventListener('drop', e => {
|
|
e.preventDefault(); zone.classList.remove('drag-over');
|
|
Array.from(e.dataTransfer.files)
|
|
.filter(f => f.name.endsWith('.xlsx') || f.name.endsWith('.xls'))
|
|
.forEach(f => { if (!tbFiles.find(x => x.name === f.name)) tbFiles.push(f); });
|
|
$('processBtn').disabled = tbFiles.length === 0;
|
|
renderFileList();
|
|
});
|
|
|
|
// ── Process ───────────────────────────────────────────────────────────────
|
|
let lastFilename = '';
|
|
|
|
function fmtMoney(n) {
|
|
const sign = n < 0 ? '-' : '';
|
|
return sign + '$' + Math.abs(n).toLocaleString('en-US', {minimumFractionDigits: 2});
|
|
}
|
|
|
|
$('processBtn').addEventListener('click', async () => {
|
|
if (tbFiles.length === 0) return;
|
|
|
|
$('processBtn').disabled = true;
|
|
$('spinner').classList.add('visible');
|
|
$('errorNote').classList.remove('visible');
|
|
$('resultCard').classList.remove('visible');
|
|
|
|
const fd = new FormData();
|
|
tbFiles.forEach((f, i) => fd.append(`trial_balance_file_${i}`, f));
|
|
fd.append('include_category_summary', isChecked('checkCategorySummary'));
|
|
fd.append('include_balance_sheet', isChecked('checkBalanceSheet'));
|
|
fd.append('use_cents', isChecked('checkCents'));
|
|
fd.append('report_date', $('reportDate').value);
|
|
fd.append('title', $('reportTitle').value);
|
|
|
|
try {
|
|
const r = await fetch('/financial-reports/api/process', { method: 'POST', body: fd });
|
|
const d = await r.json();
|
|
|
|
if (d.status === 'ok') {
|
|
lastFilename = d.filename;
|
|
$('resultSub').textContent = d.filename;
|
|
|
|
$('statRevenue').textContent = 'revenue_total' in d ? fmtMoney(d.revenue_total) : '—';
|
|
$('statExpense').textContent = 'expense_total' in d ? fmtMoney(d.expense_total) : '—';
|
|
const surplusEl = $('statSurplus');
|
|
if ('surplus_deficit' in d) {
|
|
surplusEl.textContent = fmtMoney(d.surplus_deficit);
|
|
surplusEl.className = 'stat-value ' + (d.surplus_deficit >= 0 ? 'positive' : 'negative');
|
|
} else {
|
|
surplusEl.textContent = '—'; surplusEl.className = 'stat-value';
|
|
}
|
|
const balEl = $('statBalanceCheck');
|
|
if ('balance_check' in d) {
|
|
balEl.textContent = fmtMoney(d.balance_check);
|
|
balEl.className = 'stat-value ' + (d.balance_sheet_balanced ? 'positive' : 'negative');
|
|
} else {
|
|
balEl.textContent = 'n/a'; balEl.className = 'stat-value';
|
|
}
|
|
|
|
if (d.reconciliation) {
|
|
$('reconSection').style.display = '';
|
|
const rows = [];
|
|
for (const [label, entity] of [['Canada', d.reconciliation.canada], ['US', d.reconciliation.us]]) {
|
|
const ok = Math.abs(entity.report - entity.source) < 0.01;
|
|
rows.push(`<div class="recon-row"><span>${label}: report ${fmtMoney(entity.report)} vs source ${fmtMoney(entity.source)}</span>
|
|
<span class="recon-badge ${ok ? 'ok' : 'warn'}">${ok ? 'MATCH' : 'MISMATCH'}</span></div>`);
|
|
}
|
|
$('reconRows').innerHTML = rows.join('');
|
|
} else {
|
|
$('reconSection').style.display = 'none';
|
|
}
|
|
|
|
const icon = $('resultIcon');
|
|
if (d.reconciled) {
|
|
icon.className = 'result-icon ok';
|
|
$('resultTitle').textContent = 'Report generated — reconciled';
|
|
} else {
|
|
icon.className = 'result-icon warn';
|
|
$('resultTitle').textContent = 'Report generated — check reconciliation';
|
|
}
|
|
|
|
$('resultCard').classList.add('visible');
|
|
} else {
|
|
$('errorNote').textContent = d.error || 'Unexpected error';
|
|
$('errorNote').classList.add('visible');
|
|
}
|
|
} catch (e) {
|
|
$('errorNote').textContent = 'Network error: ' + e.message;
|
|
$('errorNote').classList.add('visible');
|
|
}
|
|
|
|
$('spinner').classList.remove('visible');
|
|
$('processBtn').disabled = false;
|
|
});
|
|
|
|
$('downloadBtn').addEventListener('click', () => {
|
|
if (lastFilename) window.location.href = '/financial-reports/api/download/' + encodeURIComponent(lastFilename);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|