diff --git a/internal/lkgateway/lkapi.go b/internal/lkgateway/lkapi.go index 747eb12..d898e57 100644 --- a/internal/lkgateway/lkapi.go +++ b/internal/lkgateway/lkapi.go @@ -116,8 +116,8 @@ func registerLKAPI(mux *http.ServeMux, rc *RuntimeConfig, svc *Service) { } lkJSON(w, http.StatusOK, map[string]any{ "session": tok, - "full_name": u.FullName, - "contract": u.Contract, + "full_name": lkClientName(*u), + "contract": lkContractNumber(u.Contract), "is_admin": u.IsAdmin, "ttl_sec": int(lkSessionTTL.Seconds()), }) @@ -199,8 +199,8 @@ func registerLKAPI(mux *http.ServeMux, rc *RuntimeConfig, svc *Service) { } total, priced := lkApplyPrices(r.Context(), rc, pos) lkJSON(w, http.StatusOK, map[string]any{ - "contract": u.Contract, - "full_name": u.FullName, + "contract": lkContractNumber(u.Contract), + "full_name": lkClientName(u), "positions": pos, "source": source, "read_only": readOnly, @@ -310,7 +310,7 @@ func registerLKAPI(mux *http.ServeMux, rc *RuntimeConfig, svc *Service) { return } pf.Note = strings.TrimSpace(pf.Note) - resp := map[string]any{"portfolio": pf, "contract": u.Contract, "full_name": u.FullName} + resp := map[string]any{"portfolio": pf, "contract": lkContractNumber(u.Contract), "full_name": lkClientName(u)} if q.Get("view") != "archive" { resp["upcoming"] = lkUpcoming(r.Context(), fancy, pf.Positions, 90) // ближайшие выплаты за 90 дней } @@ -529,7 +529,7 @@ func registerLKAPI(mux *http.ServeMux, rc *RuntimeConfig, svc *Service) { lkAuditImpersonate(r.Context(), rc, u.Login, "depo:"+full, full, lkClientAddr(r)) lkJSON(w, http.StatusOK, map[string]any{ "session": tok, "full_name": name, - "contract": full, "as_client": full, "by_admin": u.Login, + "contract": full, "as_client": lkContractNumber(full), "by_admin": u.Login, }) return } diff --git a/internal/lkgateway/lkclient.go b/internal/lkgateway/lkclient.go index b6d8622..8193600 100644 --- a/internal/lkgateway/lkclient.go +++ b/internal/lkgateway/lkclient.go @@ -100,3 +100,16 @@ func spectreContractFor(ctx context.Context, s FancyMSSQLSettings, contract stri spectreContractCache.mu.Unlock() return c, err == nil && c.DOC != 0 } + +// lkClientName — ФИО клиента для показа: из учётной записи, иначе из номера договора, +// где учётная система хранит номер вместе с ФИО («БР-719 Аминов Вячеслав Маркович»). +func lkClientName(u LKUser) string { + if n := strings.TrimSpace(u.FullName); n != "" { + return n + } + c := strings.TrimSpace(u.Contract) + if i := strings.IndexByte(c, ' '); i > 0 { + return strings.TrimSpace(c[i:]) + } + return "" +} diff --git a/modules/lk/templates.go b/modules/lk/templates.go index 023ec0e..d29a139 100644 --- a/modules/lk/templates.go +++ b/modules/lk/templates.go @@ -57,6 +57,10 @@ a{color:var(--acc)}a:hover{color:#1e3395} .stats{display:flex;gap:14px 46px;flex-wrap:wrap} .stat{display:flex;flex-direction:column;gap:3px} .stat .v{font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:22px} +.meta{display:flex;gap:6px 30px;flex-wrap:wrap;margin-top:12px} +.meta .m{display:flex;flex-direction:column;gap:1px} +.meta .k{font-family:var(--mono);font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:#8e8879} +.meta .v{font-size:13px;color:#d9d3c6} .imp{background:var(--board);color:#f3f0e7;padding:10px 20px;font-size:13px;display:flex;gap:10px;align-items:center;flex-wrap:wrap} main{max-width:1180px;margin:0 auto;padding:22px 20px 34px} h1{font-size:23px;margin:0 0 6px;letter-spacing:-.01em}h2{font-size:15px;margin:0 0 12px;letter-spacing:-.005em} @@ -159,7 +163,11 @@ input[type=checkbox]{width:20px;min-height:20px;height:20px}
Стоимость портфеля{{if eq .View "archive"}} на {{$p.AsOf}}{{end}}
{{fmtmoney $p.Total}} ₽
-
{{with .FullName}}{{.}} · {{end}}договор {{.Contract}}{{if and (ne .View "archive") $p.AsOf}} · данные на {{$p.AsOf}}{{end}}
+
+ {{with .FullName}}Клиент{{.}}{{end}} + {{with .Contract}}Договор{{.}}{{end}} + {{with $p.AsOf}}{{if eq $.View "archive"}}На дату{{else}}Данные на{{end}}{{.}}{{end}} +
Бумаги{{fmtmoney $p.Securities}} ₽