fix: ОСВ за 1 квартал нарастающим итогом показывается «2024 К1», как в макете [39] (#3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EAKRDNzXtRrwmWz9z6PZu3
This commit is contained in:
Andrey Epifancev 2026-10-08 03:31:27 +04:00
parent c0dfe7c6c0
commit 35e52aaa29
2 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,8 @@ describe('labels', () => {
});
it('период', () => {
expect(periodLabel(2024, 'Q1', false)).toBe('2024 К1');
// нарастающий итог за Q1 — это и есть первый квартал (как в макете [39])
expect(periodLabel(2024, 'Q1', true)).toBe('2024 К1');
expect(periodLabel(2024, 'Q3', true)).toBe('2024 · 9 мес.');
expect(periodLabel(2024, 'Q4', true)).toBe('2024 · 12 мес.');
expect(periodLabel(2024, null, null)).toBe('период не определён');

View File

@ -29,7 +29,7 @@ export function periodLabel(year: number | null, quarter: Quarter | null, isCumu
if (year === null || quarter === null) {
return 'период не определён';
}
return isCumulative ? `${year} · ${MONTHS[quarter]} мес.` : `${year} К${quarter.slice(1)}`;
return isCumulative && quarter !== 'Q1' ? `${year} · ${MONTHS[quarter]} мес.` : `${year} К${quarter.slice(1)}`;
}
export function documentStatusLabel(status: DocumentStatus): string {