Стало на {dateLabel(lastDate)}
-
{amount(total)}руб.
+
{millions(total)}руб.
остаток на конец недели
{previousTotal !== null && (
= previousTotal ? 'good' : 'bad'}`}>
- {signedAmount(total - previousTotal)}
+ {signedMillions(total - previousTotal)}
)}
@@ -118,22 +118,22 @@ export function Cash({ dataset }: { dataset: Dataset }) {
key: row.company,
cells: [
row.company,
- amount(row.openBalance ?? 0),
- amount(row.inflow ?? 0),
- amount(row.outflow ?? 0),
+ millions(row.openBalance ?? 0),
+ millions(row.inflow ?? 0),
+ millions(row.outflow ?? 0),
- {signedAmount(row.saldo ?? 0)}
+ {signedMillions(row.saldo ?? 0)}
,
-
{amount(row.closeBalance ?? 0)},
+
{millions(row.closeBalance ?? 0)},
],
}))}
footer={[
'Итого',
- amount(openTotal),
- amount(inflow),
- amount(outflow),
- signedAmount(inflow - outflow),
- amount(total),
+ millions(openTotal),
+ millions(inflow),
+ millions(outflow),
+ signedMillions(inflow - outflow),
+ millions(total),
]}
/>
@@ -151,7 +151,7 @@ export function Cash({ dataset }: { dataset: Dataset }) {
({ label: bank, value }))}
- formatValue={(value) => amount(value)}
+ formatValue={(value) => millions(value)}
color="#67211d"
highlightFirst
tooltipRows={(item) => [
diff --git a/client/src/sections/Deposits.tsx b/client/src/sections/Deposits.tsx
index 7d1f6cd..cf6cd62 100644
--- a/client/src/sections/Deposits.tsx
+++ b/client/src/sections/Deposits.tsx
@@ -1,7 +1,7 @@
import { useMemo } from 'react';
import type { Dataset } from '../types';
import { AmountCard, Panel, SectionHeader, DataTable, Empty } from '../components/ui';
-import { amount, percent, quarterLabel, signedPercent } from '../lib/format';
+import { millions, percent, quarterLabel, signedPercent } from '../lib/format';
import { groupSum, uniqueSorted, yearOf } from '../lib/aggregate';
export function Deposits({ dataset }: { dataset: Dataset }) {
@@ -130,16 +130,16 @@ export function Deposits({ dataset }: { dataset: Dataset }) {
row.company,
...row.values.map((value, index) => (
- {amount(value)}
+ {millions(value)}
)),
- {amount(row.visibleTotal)},
+ {millions(row.visibleTotal)},
],
}))}
footer={[
'Итого',
- ...quarters.map((quarter) => amount(interestByQuarter.get(quarter) ?? 0)),
- amount(totalInterest),
+ ...quarters.map((quarter) => millions(interestByQuarter.get(quarter) ?? 0)),
+ millions(totalInterest),
]}
/>
diff --git a/client/src/sections/Finance.tsx b/client/src/sections/Finance.tsx
index ead17da..575f249 100644
--- a/client/src/sections/Finance.tsx
+++ b/client/src/sections/Finance.tsx
@@ -1,8 +1,8 @@
import { useMemo, useState } from 'react';
import type { Dataset } from '../types';
-import { AmountCard, Panel, SectionHeader, DataTable, Empty, Segmented } from '../components/ui';
+import { AmountCard, Panel, SectionHeader, DataTable, Empty, Segmented, isNegativeText } from '../components/ui';
import { BarChart } from '../components/charts';
-import { amount, money, monthLabel, percent } from '../lib/format';
+import { axisMoney, millions, money, monthLabel, percent } from '../lib/format';
import {
FINANCE_ORDER,
closedMonths,
@@ -202,7 +202,7 @@ export function Finance({ dataset }: { dataset: Dataset }) {