Демо-прототип: от создания консолидации до сводной ОСВ #4

Merged
aep merged 29 commits from feat/3-demo-prototype into test 2026-10-08 09:58:39 +03:00
2 changed files with 3 additions and 1 deletions
Showing only changes of commit 35e52aaa29 - Show all commits

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 {