feat(analytics): add net cashflow reporting
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@family-budget/frontend",
|
||||
"version": "0.8.7",
|
||||
"version": "0.9.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -34,13 +34,15 @@ export function SummaryCards({ summary }: Props) {
|
||||
</div>
|
||||
|
||||
<div className="summary__card summary__card--investments">
|
||||
<div className="summary__label">На инвестиции</div>
|
||||
<div className="summary__label">Движение ДС</div>
|
||||
<div className="summary__value">
|
||||
{formatAmount(summary.investmentOutflow)}
|
||||
{formatAmount(summary.cashNet)}
|
||||
</div>
|
||||
{summary.investmentIncomeExcluded > 0 && (
|
||||
<div className="summary__subvalue">Поступило: {formatAmount(summary.cashInflow)}</div>
|
||||
<div className="summary__subvalue">Списано: {formatAmount(summary.cashOutflow)}</div>
|
||||
{(summary.transferInflow > 0 || summary.transferOutflow > 0) && (
|
||||
<div className="summary__subvalue">
|
||||
Исключено из доходов: {formatAmount(summary.investmentIncomeExcluded)}
|
||||
Переводы: {formatAmount(summary.transferInflow)} / {formatAmount(summary.transferOutflow)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@ export function TimeseriesChart({ data }: Props) {
|
||||
period: item.periodStart,
|
||||
Расходы: Math.abs(item.expenseAmount) / 100,
|
||||
Доходы: item.incomeAmount / 100,
|
||||
Инвестиции: Math.abs(item.investmentOutflow) / 100,
|
||||
Переводы: item.transferOutflow / 100,
|
||||
}));
|
||||
|
||||
return (
|
||||
@@ -81,7 +81,7 @@ export function TimeseriesChart({ data }: Props) {
|
||||
radius={[4, 4, 0, 0]}
|
||||
/>
|
||||
<Bar
|
||||
dataKey="Инвестиции"
|
||||
dataKey="Переводы"
|
||||
fill="var(--color-warning)"
|
||||
radius={[4, 4, 0, 0]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user