fix: столбцы сравнения с прошлым периодом убраны во всех таблицах
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useMemo } from 'react';
|
||||
import type { Dataset } from '../types';
|
||||
import { AmountCard, Panel, SectionHeader, DataTable, Change, Empty } from '../components/ui';
|
||||
import { amount, percent, quarterLabel, ratio, signedPercent } from '../lib/format';
|
||||
import { AmountCard, Panel, SectionHeader, DataTable, Empty } from '../components/ui';
|
||||
import { amount, percent, quarterLabel, signedPercent } from '../lib/format';
|
||||
import { groupSum, uniqueSorted, yearOf } from '../lib/aggregate';
|
||||
|
||||
export function Deposits({ dataset }: { dataset: Dataset }) {
|
||||
@@ -44,7 +44,6 @@ export function Deposits({ dataset }: { dataset: Dataset }) {
|
||||
|
||||
const totalInterest = visibleQuarters.reduce((total, quarter) => total + interestOf(quarter), 0);
|
||||
const lastQuarter = visibleQuarters[visibleQuarters.length - 1] ?? '';
|
||||
const previousQuarter = visibleQuarters[visibleQuarters.length - 2] ?? '';
|
||||
|
||||
// Доходность заказчик считает сам. Если её прислали по холдингу - берём как есть,
|
||||
// иначе усредняем по дивизионам; своих расчётов не изобретаем.
|
||||
@@ -159,7 +158,6 @@ export function Deposits({ dataset }: { dataset: Dataset }) {
|
||||
{ key: 'company', label: 'Юридическое лицо', align: 'left', width: '26%' },
|
||||
...quarters.map((quarter) => ({ key: quarter, label: quarterLabel(quarter) })),
|
||||
{ key: 'total', label: 'Итого за период' },
|
||||
{ key: 'change', label: 'Последний квартал к предыдущему' },
|
||||
]}
|
||||
rows={perQuarterRows.map((row) => ({
|
||||
key: row.company,
|
||||
@@ -171,13 +169,6 @@ export function Deposits({ dataset }: { dataset: Dataset }) {
|
||||
</span>
|
||||
)),
|
||||
<b key="total">{amount(row.visibleTotal)}</b>,
|
||||
<Change
|
||||
key="change"
|
||||
value={ratio(
|
||||
row.values[quarters.indexOf(lastQuarter)] ?? null,
|
||||
previousQuarter ? row.values[quarters.indexOf(previousQuarter)] ?? null : null,
|
||||
)}
|
||||
/>,
|
||||
],
|
||||
}))}
|
||||
footer={[
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useMemo, useState } from 'react';
|
||||
import type { Dataset } from '../types';
|
||||
import { AmountCard, MetricCard, Panel, SectionHeader, DataTable, Change, Empty } from '../components/ui';
|
||||
import { AmountCard, MetricCard, Panel, SectionHeader, DataTable, Empty } from '../components/ui';
|
||||
import { BarChart, LineChart } from '../components/charts';
|
||||
import { RussiaMap, shortLabel } from '../components/RussiaMap';
|
||||
import type { RegionValue } from '../components/RussiaMap';
|
||||
import { amount, monthLabel, percent, ratio, people as peopleLabel } from '../lib/format';
|
||||
import { amount, monthLabel, percent, people as peopleLabel } from '../lib/format';
|
||||
import {
|
||||
HEADCOUNT_METRICS,
|
||||
headcountByCompany,
|
||||
@@ -26,13 +26,11 @@ export function People({ dataset }: { dataset: Dataset }) {
|
||||
// раздел всегда показывает последний месяц в данных, фильтра периода нет
|
||||
const visibleMonths = months;
|
||||
const lastMonth = months[months.length - 1] ?? '';
|
||||
const previousMonth = months[months.length - 2] ?? '';
|
||||
const yearMonths = useMemo(() => monthsOfLastYear(months), [months]);
|
||||
|
||||
const regionMap = useMemo(() => regionByCompanyName(dataset), [dataset]);
|
||||
|
||||
const companiesLast = headcountByCompany(dataset.people, lastMonth);
|
||||
const companiesPrevious = headcountByCompany(dataset.people, previousMonth);
|
||||
const oprLast = peopleMetricByCompany(dataset.people, lastMonth, HEADCOUNT_METRICS[0]);
|
||||
const rppLast = peopleMetricByCompany(dataset.people, lastMonth, HEADCOUNT_METRICS[1]);
|
||||
const rssLast = peopleMetricByCompany(dataset.people, lastMonth, HEADCOUNT_METRICS[2]);
|
||||
@@ -214,7 +212,6 @@ export function People({ dataset }: { dataset: Dataset }) {
|
||||
{ key: 'disabled', label: 'Инвалиды', width: '7%' },
|
||||
{ key: 'svo', label: 'Участники СВО', width: '8%' },
|
||||
{ key: 'payroll', label: 'ФОТ', unit: 'за месяц', width: '11%' },
|
||||
{ key: 'change', label: 'К прошлому месяцу', width: '9%' },
|
||||
]}
|
||||
rows={sortedEntries(companiesLast).map(([company, total]) => ({
|
||||
key: company,
|
||||
@@ -234,7 +231,6 @@ export function People({ dataset }: { dataset: Dataset }) {
|
||||
amount(disabledLast.get(company) ?? 0),
|
||||
amount(svoLast.get(company) ?? 0),
|
||||
payrollLast.has(company) ? `${amount((payrollLast.get(company) ?? 0) * 1e6)} руб.` : 'нет данных',
|
||||
<Change key="change" value={ratio(total, companiesPrevious.get(company) ?? null)} />,
|
||||
],
|
||||
}))}
|
||||
footer={[
|
||||
|
||||
Reference in New Issue
Block a user