diff --git a/apps/web/src/routes/_auth/dashboard.tsx b/apps/web/src/routes/_auth/dashboard.tsx index a18dc97..18e04b6 100644 --- a/apps/web/src/routes/_auth/dashboard.tsx +++ b/apps/web/src/routes/_auth/dashboard.tsx @@ -35,7 +35,7 @@ import { StatusBadge } from '@/components/status-badge' import { computeInventoryHealth } from '@/lib/inventory-health' import { buildAtRiskAccounts, type AtRiskAccount } from '@/lib/account-health' -import { formatInBaseCurrency, normalizeRatesPayload, vpsStatusLabel, convertVpsMonthlyBurnToBase, formatCurrency } from '@/lib/format' +import { formatInBaseCurrency, normalizeRatesPayload, vpsStatusLabel, convertVpsMonthlyBurnToBase, convertWithProviderRate, formatCurrency } from '@/lib/format' import { providerByIdMap } from '@/lib/billmanager' import { exportActiveVpsCsv } from '@/lib/export-csv' import { @@ -245,6 +245,20 @@ function DashboardPage() { const expiringCount = stats?.expiringWithin7Days ?? 0 const issuesCount = issues.length const providerById = providerByIdMap(snap.providers) + // Each account's balance is in its own currency — sum after converting, not raw (EUR + RUB ≠ ₽). + const balanceBase = snap.providerAccounts.reduce((sum, a) => { + if (a.balanceApi == null || !Number.isFinite(Number(a.balanceApi))) return sum + return ( + sum + + convertWithProviderRate( + Number(a.balanceApi), + a.balanceCurrency || a.currency || baseCur, + providerById.get(a.providerId), + snap.settings, + ratesData, + ).value + ) + }, 0) const monthlyBurnBase = activeVps.reduce( (sum, item) => sum + @@ -295,12 +309,7 @@ function DashboardPage() { { id: 'balance', label: 'Баланс API', - value: formatInBaseCurrency( - stats?.totalBalanceApi ?? 0, - baseCur, - snap.settings, - ratesData, - ), + value: formatCurrency(balanceBase, baseCur), icon: , iconClassName: 'text-success', to: '/accounts', diff --git a/docs/screenshots/accounts.png b/docs/screenshots/accounts.png deleted file mode 100644 index bcae573..0000000 Binary files a/docs/screenshots/accounts.png and /dev/null differ diff --git a/docs/screenshots/balance.png b/docs/screenshots/balance.png deleted file mode 100644 index 0ca8d62..0000000 Binary files a/docs/screenshots/balance.png and /dev/null differ diff --git a/docs/screenshots/dashboard.png b/docs/screenshots/dashboard.png deleted file mode 100644 index 5d0f882..0000000 Binary files a/docs/screenshots/dashboard.png and /dev/null differ diff --git a/docs/screenshots/payments.png b/docs/screenshots/payments.png deleted file mode 100644 index 06c1bba..0000000 Binary files a/docs/screenshots/payments.png and /dev/null differ diff --git a/docs/screenshots/providers.png b/docs/screenshots/providers.png deleted file mode 100644 index 4078143..0000000 Binary files a/docs/screenshots/providers.png and /dev/null differ diff --git a/docs/screenshots/reports.png b/docs/screenshots/reports.png deleted file mode 100644 index 7a5e814..0000000 Binary files a/docs/screenshots/reports.png and /dev/null differ diff --git a/docs/screenshots/settings.png b/docs/screenshots/settings.png deleted file mode 100644 index edc0adc..0000000 Binary files a/docs/screenshots/settings.png and /dev/null differ diff --git a/docs/screenshots/tariffs.png b/docs/screenshots/tariffs.png deleted file mode 100644 index e067b66..0000000 Binary files a/docs/screenshots/tariffs.png and /dev/null differ diff --git a/docs/screenshots/vps.png b/docs/screenshots/vps.png deleted file mode 100644 index ed10071..0000000 Binary files a/docs/screenshots/vps.png and /dev/null differ