Кабинет: операции по счетам депо и доходы с удержанным налогом из учётной системы

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
zuevav
2026-09-17 23:11:34 +03:00
parent 26785ff3ba
commit 4b18579956
7 changed files with 551 additions and 2 deletions
+42
View File
@@ -0,0 +1,42 @@
//go:build live
package lkgateway
import (
"context"
"testing"
)
// Движения и доходы клиента из учётной системы.
func TestLiveHistory(t *testing.T) {
rc, err := NewRuntimeConfig("/var/lib/bj/.bj/setup.json")
if err != nil {
t.Fatal(err)
}
globalRC = rc
fs := rc.Snapshot().Fancy
for _, contract := range []string{"БР-2000", "БР-1529", "БР-859"} {
ops, err := lkOperations(context.Background(), fs, contract, "2024-01-01", "", 20)
if err != nil {
t.Fatalf("операции %s: %v", contract, err)
}
t.Logf("%s: операций %d", contract, len(ops))
for i, o := range ops {
if i > 4 {
break
}
t.Logf(" %s %s %s %s %.0f %s %s", o.Date, o.Kind, o.Account, o.Security, o.Quantity, o.State, o.Note)
}
inc, tax, err := lkIncome(context.Background(), fs, contract, "2024-01-01", "")
if err != nil {
t.Fatalf("доходы %s: %v", contract, err)
}
t.Logf("%s: выплат %d, налог по журналу %.2f", contract, len(inc), tax)
for i, p := range inc {
if i > 4 {
break
}
t.Logf(" %s %s %s начислено %.2f налог %.2f к выплате %.2f %s", p.Date, p.Kind, p.Security, p.Accrued, p.Tax, p.Paid, p.State)
}
}
}