fix(admin): shorten the receipt letter, show the account id
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.
This commit is contained in:
Ilia Denisov
2026-07-28 16:44:44 +02:00
parent 4d4452596d
commit 69bddaeb9a
10 changed files with 105 additions and 68 deletions
+3 -3
View File
@@ -54,10 +54,10 @@ func TestRendererRendersEveryPage(t *testing.T) {
SignedIn: true, INN: "770000000000", AutoEnabled: true, TimeZone: "Europe/Moscow",
LastOK: "2026-07-28 12:00",
Backlog: MyNalogBacklogRow{Count: 2, Amount: "300.00 RUB", Oldest: "2026-06-30", Overdue: true},
Owed: []MyNalogRow{{LedgerID: "l1", AccountID: "a1", At: "2026-07-28 12:00",
Owed: []MyNalogRow{{LedgerID: "l1", AccountID: "a1", AccountShort: "a1", At: "2026-07-28 12:00",
Amount: "149.00 RUB", Name: `Внутриигровая валюта: "Фишка", 100 шт. (ID: 0198c1f2)`}},
Cancels: []MyNalogCancelRow{{LedgerID: "l2", AccountID: "a2", ReceiptUUID: "20abcdef01", Failed: true}},
Attention: []MyNalogRow{{LedgerID: "l3", AccountID: "a3", At: "2026-07-27 09:00",
Cancels: []MyNalogCancelRow{{LedgerID: "l2", AccountID: "a2", AccountShort: "a2", ReceiptUUID: "20abcdef01", Failed: true}},
Attention: []MyNalogRow{{LedgerID: "l3", AccountID: "a3", AccountShort: "a3", At: "2026-07-27 09:00",
Amount: "99.00 RUB", Name: "x (ID: 0198c1f3)", Attempts: 2, LastError: "timeout"}},
}, "Needs attention"},
{"mynalog", MyNalogView{SignedIn: true, TimeZone: "Europe/Moscow", Paused: true,
@@ -40,7 +40,7 @@ Money in: {{range .Totals.MoneyIn}}<strong>{{.}}</strong> {{else}}<span class="n
{{range .Rows}}
<tr>
<td>{{.At}}</td>
<td><a href="/_gm/users/{{.AccountID}}">card</a></td>
<td><a href="/_gm/users/{{.AccountID}}"><code>{{.AccountShort}}</code></a></td>
<td>{{.Kind}}</td>
<td>{{.Money}}</td>
<td>{{.ChipsDelta}}</td>
@@ -79,7 +79,7 @@ created; entering a receipt number means you filed it by hand.</p>
<tbody>
{{range .Cancels}}
<tr>
<td><a href="/_gm/users/{{.AccountID}}">card</a></td>
<td><a href="/_gm/users/{{.AccountID}}"><code>{{.AccountShort}}</code></a></td>
<td><code>{{.ReceiptUUID}}</code></td>
<td>{{if .Failed}}<span class="note">a previous attempt was refused</span>{{else}}awaiting{{end}}</td>
</tr>
@@ -96,7 +96,7 @@ created; entering a receipt number means you filed it by hand.</p>
{{range .Owed}}
<tr>
<td>{{.At}}</td>
<td><a href="/_gm/users/{{.AccountID}}">card</a></td>
<td><a href="/_gm/users/{{.AccountID}}"><code>{{.AccountShort}}</code></a></td>
<td class="num">{{.Amount}}</td>
<td><code>{{.Name}}</code></td>
<td class="num">{{.Attempts}}</td>
+31 -26
View File
@@ -785,18 +785,21 @@ type LedgerView struct {
// spend, an admin grant, a rewarded-video credit). Refundable marks a funded order the operator may
// still reverse, which is what puts the Refund button on that row.
type LedgerRow struct {
At string
AccountID string
Kind string
Source string
Origin string
ChipsDelta int
Money string
Title string
Order string
Provider string
Shop string
Refundable bool
At string
// AccountID is the link target; AccountShort is what the cell shows, because a ledger row has
// no room for a full uuid and the operator mostly needs to spot two rows from the same buyer.
AccountID string
AccountShort string
Kind string
Source string
Origin string
ChipsDelta int
Money string
Title string
Order string
Provider string
Shop string
Refundable bool
}
// LedgerTotalsRow is the summary above the table, over everything the filter matches. Money is
@@ -841,23 +844,25 @@ type MyNalogBacklogRow struct {
// sent, which is also what an operator must type when filing by hand — the two have to match, or a
// later automatic recovery would not recognise the receipt.
type MyNalogRow struct {
LedgerID string
AccountID string
At string
Amount string
Name string
Status string
Attempts int
LastError string
ReceiptUUID string
ReceiptURL string
LedgerID string
AccountID string
AccountShort string
At string
Amount string
Name string
Status string
Attempts int
LastError string
ReceiptUUID string
ReceiptURL string
}
// MyNalogCancelRow is one registered receipt whose income has been refunded and which is therefore
// owed an annulment.
type MyNalogCancelRow struct {
LedgerID string
AccountID string
ReceiptUUID string
Failed bool
LedgerID string
AccountID string
AccountShort string
ReceiptUUID string
Failed bool
}