366 lines
13 KiB
HTML
366 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Donor Revenue Report (GL Only) — 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;
|
|
--amber-dim: rgba(247,144,9,.12);
|
|
--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: 640px;
|
|
width: 100%;
|
|
margin: 0 auto;
|
|
padding: 48px 24px 80px;
|
|
}
|
|
|
|
.page-title { margin-bottom: 24px; }
|
|
.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; }
|
|
|
|
.scope-note {
|
|
display: flex; gap: 10px; align-items: flex-start;
|
|
font-size: 12.5px; color: var(--w2); background: var(--amber-dim);
|
|
border: 1px solid rgba(247,144,9,.25); border-radius: 8px;
|
|
padding: 12px 14px; margin-bottom: 24px; line-height: 1.55;
|
|
}
|
|
.scope-note svg { width: 15px; height: 15px; color: var(--amber); flex-shrink: 0; margin-top: 1px; }
|
|
.scope-note strong { color: var(--w1); }
|
|
|
|
.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: pointer;
|
|
transition: all .2s;
|
|
position: relative;
|
|
}
|
|
.file-zone:hover, .file-zone.drag-over { border-color: var(--cyan); background: var(--cyan-glow); }
|
|
.file-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
|
|
.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; }
|
|
.file-chosen { font-family: var(--mono); font-size: 11.5px; color: var(--green); margin-top: 10px; }
|
|
|
|
.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: 16px;
|
|
}
|
|
.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;
|
|
background: var(--green-dim); display: flex; align-items: center; justify-content: center;
|
|
}
|
|
.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: 8px; }
|
|
.stat-box { background: var(--w5); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
|
|
.stat-value { font-family: var(--mono); font-size: 18px; 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; }
|
|
|
|
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>
|
|
Donor Report <span>(GL Only)</span>
|
|
</a>
|
|
</header>
|
|
|
|
<main>
|
|
<div class="page-title">
|
|
<div class="eyebrow">Planeterra International Foundation</div>
|
|
<h1>Donor Revenue Report — GL Only</h1>
|
|
<p>Upload just a GL Dump export — no trial balance needed — to generate one formatted financial extract sheet per donor, broken down to individual transactions (line memo, description, contingent worker, supplier, and accounting date for revenue).</p>
|
|
</div>
|
|
|
|
<div class="scope-note">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/></svg>
|
|
<div><strong>Canada entity only.</strong> A GL Dump alone has no visibility into Planeterra International Foundation Ltd's (US) activity — that supplementary detail only comes from a trial balance. If you have both a GL Dump and the trial balances, use the regular <a href="/donor-report/" style="color:var(--cyan)">Donor Revenue Report</a> tool instead for the complete picture.</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-label">GL Dump File</div>
|
|
<div class="file-zone" id="fileZone">
|
|
<input type="file" id="fileInput" accept=".xlsx,.xls">
|
|
<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="dropLabel"><strong>Drop a GL Dump export here</strong> or browse</div>
|
|
<div class="file-zone-sub">.xlsx / .xls — must have a "Journal" + "Ledger Account" header row</div>
|
|
</div>
|
|
<div class="file-chosen" id="fileChosen" style="display:none"></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">
|
|
<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">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="statDonors">—</div>
|
|
<div class="stat-label">Donor Sheets</div>
|
|
</div>
|
|
<div class="stat-box">
|
|
<div class="stat-value" id="statRevenue">—</div>
|
|
<div class="stat-label">Total Revenue (CAD)</div>
|
|
</div>
|
|
<div class="stat-box">
|
|
<div class="stat-value" id="statExpense">—</div>
|
|
<div class="stat-label">Total Expense (CAD)</div>
|
|
</div>
|
|
<div class="stat-box">
|
|
<div class="stat-value" id="statSurplus">—</div>
|
|
<div class="stat-label">Surplus / (Deficit)</div>
|
|
</div>
|
|
</div>
|
|
|
|
<button class="btn btn-primary" id="downloadBtn">Download Report</button>
|
|
</div>
|
|
</main>
|
|
|
|
<footer>
|
|
Built by <a href="https://undodesigns.com" target="_blank">Undo Designs</a> · Donor Revenue Report (GL Only) v1
|
|
</footer>
|
|
|
|
<script>
|
|
const $ = id => document.getElementById(id);
|
|
|
|
let chosenFile = null;
|
|
|
|
function setFile(file) {
|
|
if (!file) return;
|
|
if (!/\.(xlsx|xls)$/i.test(file.name)) {
|
|
$('errorNote').textContent = 'Please choose a .xlsx or .xls file.';
|
|
$('errorNote').classList.add('visible');
|
|
return;
|
|
}
|
|
chosenFile = file;
|
|
$('errorNote').classList.remove('visible');
|
|
$('fileChosen').textContent = file.name;
|
|
$('fileChosen').style.display = 'block';
|
|
$('processBtn').disabled = false;
|
|
$('resultCard').classList.remove('visible');
|
|
}
|
|
|
|
const zone = $('fileZone');
|
|
$('fileInput').addEventListener('change', () => setFile($('fileInput').files[0]));
|
|
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');
|
|
setFile(e.dataTransfer.files[0]);
|
|
});
|
|
|
|
let lastFilename = '';
|
|
|
|
function fmtMoney(n) {
|
|
const sign = n < 0 ? '-' : '';
|
|
return sign + '$' + Math.abs(n).toLocaleString('en-US', {minimumFractionDigits: 2});
|
|
}
|
|
|
|
$('processBtn').addEventListener('click', async () => {
|
|
if (!chosenFile) return;
|
|
|
|
$('processBtn').disabled = true;
|
|
$('spinner').classList.add('visible');
|
|
$('errorNote').classList.remove('visible');
|
|
$('resultCard').classList.remove('visible');
|
|
|
|
const fd = new FormData();
|
|
fd.append('gl_file', chosenFile);
|
|
|
|
try {
|
|
const r = await fetch('/donor-report-gl/api/process', { method: 'POST', body: fd });
|
|
const d = await r.json();
|
|
|
|
if (d.status === 'ok') {
|
|
lastFilename = d.filename;
|
|
$('resultSub').textContent = d.filename;
|
|
$('statDonors').textContent = d.donors;
|
|
$('statRevenue').textContent = fmtMoney(d.total_revenue);
|
|
$('statExpense').textContent = fmtMoney(d.total_expense);
|
|
const surplusEl = $('statSurplus');
|
|
surplusEl.textContent = fmtMoney(d.surplus_deficit);
|
|
surplusEl.className = 'stat-value ' + (d.surplus_deficit >= 0 ? 'positive' : 'negative');
|
|
$('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 = '/donor-report-gl/api/download/' + encodeURIComponent(lastFilename);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|