P&L: Cost lines with tax categories (advertising, player rewards, software, other), outside-wallet source, duplicate-tx guard; Tax summary (income vs advertising/promotion, own sales excluded, CSV)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-04 07:22:21 -05:00
parent ca7a579990
commit eb3cfebf1f
4 changed files with 210 additions and 118 deletions
+11 -3
View File
@@ -453,8 +453,9 @@
<div class="tablewrap"><table class="adm-table" id="pnlLedger"></table></div>
<div class="grid" style="grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px;margin-top:12px">
<select id="ldDir"><option value="in">Money in</option><option value="out">Money out</option></select>
<select id="ldKind"><option value="revenue">Revenue</option><option value="draw">Draw</option><option value="transfer">Transfer</option></select>
<select id="ldWallet"><option value="feeA">Receiver A</option><option value="feeB">Receiver B</option><option value="engine">Engine</option><option value="hunt">PolHunter</option></select>
<select id="ldKind"><option value="revenue">Revenue</option><option value="cost">Cost</option><option value="draw">Draw</option><option value="transfer">Transfer</option></select>
<select id="ldCat" hidden><option value="advertising">Advertising</option><option value="rewards">Player rewards</option><option value="software">Software and hosting</option><option value="other">Other cost</option></select>
<select id="ldWallet"><option value="feeA">Receiver A</option><option value="feeB">Receiver B</option><option value="engine">Engine</option><option value="hunt">PolHunter</option><option value="outside">Outside wallet</option></select>
<input type="number" id="ldAmount" min="0" step="0.0001" placeholder="Amount in POL">
<input type="number" id="ldUsd" min="0" step="0.01" placeholder="USD (optional)">
<input type="date" id="ldDate">
@@ -464,6 +465,13 @@
<button class="btn small" type="button" id="ldAdd">Add line</button>
</div>
</div>
<div class="card">
<div class="card-head"><h3>Tax summary</h3><span class="sub">income versus advertising and other costs, for one year</span></div>
<p class="small muted" style="margin:0 0 10px">Income is the platform's share of every package sale, valued at that sale's own dollar price, plus outside revenue. Sales to your own positions are left out. Costs are the ledger's Cost lines; game wallet top-ups are recorded there automatically as Player rewards. Draws and transfers are your money, not expenses, so they are listed apart.</p>
<p><select id="taxYear"></select> <button class="btn small" type="button" id="taxRun">Show</button> <button class="btn small sec" type="button" id="taxCsv" hidden>Copy CSV for your accountant</button></p>
<div id="taxOut" class="small"></div>
<textarea id="taxCsvText" hidden rows="6" style="width:100%;margin-top:8px" readonly></textarea>
</div>
<div class="card">
<div class="card-head"><h3>Automatic credit burner</h3><span class="sub">settles pending campaign spend on-chain from the engine wallet</span></div>
<p class="small" id="burnerLine">…</p>
@@ -512,6 +520,6 @@
</div>
<script src="/assets/common.js?v=20261003fr2"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/admin.js?v=20261002sd"></script>
<script src="/assets/admin.js?v=20261004tax"></script>
</body>
</html>