69bddaeb9a
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 23s
CI / ui (pull_request) Successful in 1m16s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m49s
The receipt letter repeated what the receipt itself states. It now carries the amount, the moment of payment with its offset, and the link — the receipt is the document, and it opens without authentication, so there is nothing for the two to disagree about. Subject reworded to name what it is. The ledger and tax-export tables labelled the account link "card", meaning the user card. On pages about payments that reads as a bank card, which is exactly how it was misread. Both now show the first eight characters of the account id, so the column carries data — two rows from the same buyer are visible at a glance — while the link still holds the whole id.
65 lines
3.1 KiB
Go Template
65 lines
3.1 KiB
Go Template
{{define "content" -}}
|
|
<h1>Ledger</h1>
|
|
{{with .Data}}
|
|
<form class="form" method="get" action="/_gm/ledger">
|
|
<label>From <input type="date" name="from" value="{{.From}}"></label>
|
|
<label>To <input type="date" name="to" value="{{.To}}"></label>
|
|
<select name="kind">
|
|
<option value="">any kind</option>
|
|
{{range .Kinds}}<option value="{{.}}"{{if eq . $.Data.Kind}} selected{{end}}>{{.}}</option>{{end}}
|
|
</select>
|
|
<select name="wallet">
|
|
<option value="">any wallet</option>
|
|
{{range .Wallets}}<option value="{{.}}"{{if eq . $.Data.Wallet}} selected{{end}}>{{.}}</option>{{end}}
|
|
</select>
|
|
<select name="provider">
|
|
<option value="">any rail</option>
|
|
{{range .Providers}}<option value="{{.}}"{{if eq . $.Data.Provider}} selected{{end}}>{{.}}</option>{{end}}
|
|
</select>
|
|
<input name="user" value="{{.UserID}}" placeholder="user id" size="36">
|
|
<button type="submit">Filter</button>
|
|
<a class="export" href="/_gm/ledger.csv?{{.FilterQuery}}">Export CSV ↓</a>
|
|
</form>
|
|
<p class="note">Defaults to the last 30 days. The wallet filter matches the funded segment or the
|
|
benefit origin; the rail filter matches the settling provider, so chip spends (which have no rail)
|
|
drop out of it. <a href="/_gm/ledger">clear filters</a></p>
|
|
|
|
<section class="panel">
|
|
<h2>Totals for the filtered range</h2>
|
|
<p>
|
|
Money in: {{range .Totals.MoneyIn}}<strong>{{.}}</strong> {{else}}<span class="note">none</span>{{end}}
|
|
· Refunded: {{range .Totals.MoneyRefunded}}<strong>{{.}}</strong> {{else}}<span class="note">none</span>{{end}}
|
|
· Chips credited: <strong>{{.Totals.ChipsIn}}</strong>
|
|
· Chips spent: <strong>{{.Totals.ChipsOut}}</strong>
|
|
</p>
|
|
</section>
|
|
|
|
<table class="list">
|
|
<thead><tr><th>Time</th><th>Account</th><th>Kind</th><th>Money</th><th>Chips</th><th>What</th><th>Wallet</th><th>Rail</th><th>Shop</th><th></th></tr></thead>
|
|
<tbody>
|
|
{{range .Rows}}
|
|
<tr>
|
|
<td>{{.At}}</td>
|
|
<td><a href="/_gm/users/{{.AccountID}}"><code>{{.AccountShort}}</code></a></td>
|
|
<td>{{.Kind}}</td>
|
|
<td>{{.Money}}</td>
|
|
<td>{{.ChipsDelta}}</td>
|
|
<td>{{.Title}}{{if .Order}} <code>{{.Order}}</code>{{end}}</td>
|
|
<td>{{.Source}}{{if and .Origin (ne .Origin .Source)}} → {{.Origin}}{{end}}</td>
|
|
<td>{{.Provider}}</td>
|
|
<td>{{.Shop}}</td>
|
|
<td>{{if .Refundable}}<form class="form" method="post" action="/_gm/users/{{.AccountID}}/refund" onsubmit="return confirm('Refund this order in full? On the direct rail this moves the money back through the provider and then revokes the chips (floored at 0); on the other rails refund on the rail first.')"><input type="hidden" name="order_id" value="{{.Order}}"><input type="hidden" name="back" value="/_gm/ledger?{{$.Data.FilterQuery}}"><button type="submit">Refund</button></form>{{end}}</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr><td colspan="10"><span class="note">no operations in this range</span></td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
<nav class="pager">
|
|
{{if .Pager.HasPrev}}<a href="/_gm/ledger?{{.FilterQuery}}&page={{.Pager.PrevPage}}">« prev</a>{{end}}
|
|
<span>page {{.Pager.Page}} · {{.Pager.Total}} total</span>
|
|
{{if .Pager.HasNext}}<a href="/_gm/ledger?{{.FilterQuery}}&page={{.Pager.NextPage}}">next »</a>{{end}}
|
|
</nav>
|
|
{{end}}
|
|
{{- end}}
|