Skip to content

Open-source personal finance manager. Self-hosted, privacy-first.

feat(transactions): add report exclusion (#675)

Esteban De la Rosa520dd0f16888
diff --git a/backend/alembic/versions/085_transaction_exclude_from_pnl.py b/backend/alembic/versions/085_transaction_exclude_from_pnl.py
new file mode 100644
index 00000000..ff99015e
--- /dev/null
+++ b/backend/alembic/versions/085_transaction_exclude_from_pnl.py
@@ -0,0 +1,32 @@
+"""keep selected transactions in balances but out of P/L calculations
+
+Revision ID: 085
+Revises: 084
+Create Date: 2026-08-24
+"""
+
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from alembic import op
+
+revision: str = "085"
+down_revision: Union[str, None] = "084"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ op.add_column(
+ "transactions",
+ sa.Column(
+ "exclude_from_pnl",
+ sa.Boolean(),
+ nullable=False,
+ server_default=sa.text("false"),
+ ),
+ )
+
+
+def downgrade() -> None:
+ op.drop_column("transactions", "exclude_from_pnl")
diff --git a/backend/app/models/transaction.py b/backend/app/models/transaction.py
index d66a85aa..2b4c6a25 100644
--- a/backend/app/models/transaction.py
+++ b/backend/app/models/transaction.py
@@ -94,9 +94,17 @@ class Transaction(Base):
nullable=True,
index=True,
)
- # Flag to exclude this transaction from reports and dashboard aggregations.
- # When set to True, the transaction is ignored for income/expense calculations.
+ # Ignore the row everywhere monetary totals are calculated, including the
+ # account balance. The row remains stored and can still be shown in ledger
+ # views unless the caller explicitly hides ignored transactions.
is_ignored: Mapped[bool] = mapped_column(Boolean, default=False, server_default="false")
+ # Keep the row in the ledger and current balance, but leave it out of P&L
+ # reports. This differs from is_ignored, which also removes the row from
+ # balance calculations. Balance adjustments use this distinction so the
+ # reconciled balance stays exact without looking like income or spending.
+ exclude_from_pnl: Mapped[bool] = mapped_column(
+ Boolean, default=False, server_default="false"
+ )
# Link to the recurring bill this transaction fulfills (issue #116). Set when
# a synced/imported/manual charge is matched to a recurring bill, or stamped
# onto the placeholder generate_pending materializes. ON DELETE SET NULL: if
diff --git a/backend/app/schemas/transaction.py b/backend/app/schemas/transaction.py
index 6f6a68b7..fa4745e4 100644
--- a/backend/app/schemas/transaction.py
+++ b/backend/app/schemas/transaction.py
@@ -100,6 +100,7 @@ class TransactionUpdate(BaseModel):
amount_primary: Optional[Decimal] = None
fx_rate_used: Optional[Decimal] = None
is_ignored: Optional[bool] = None
+ exclude_from_pnl: Optional[bool] = None
# Manual status override (posted=settled, pending=not yet settled). Lets the
# user mark a manually-entered transaction as settled once it clears,
# or flip a synced row back to pending before the next sync.
@@ -199,6 +200,7 @@ class TransactionRead(TransactionBase):
# instead of a generic "shared" badge.
parent_owner_name: Optional[str] = None
is_ignored: bool = False
+ exclude_from_pnl: bool = False
@model_validator(mode="after")
def reflect_ignored_category(self):
diff --git a/backend/app/schemas/transaction_calendar.py b/backend/app/schemas/transaction_calendar.py
index 784081e3..11baee22 100644
--- a/backend/app/schemas/transaction_calendar.py
+++ b/backend/app/schemas/transaction_calendar.py
@@ -26,6 +26,10 @@ class TransactionCalendarItem(BaseModel):
transfer_pair_id: Optional[uuid.UUID] = None
is_transfer: bool = False
is_ignored: bool = False
+ #: Kept out of the day's income/expense totals but still moving the
+ #: balance, so the row needs its own marker: without one the day card
+ #: shows 0/0 while its ending balance jumps, and nothing explains why.
+ exclude_from_pnl: bool = False
class TransactionCalendarDay(BaseModel):
diff --git a/backend/app/services/_query_filters.py b/backend/app/services/_query_filters.py
index 96047ec0..9abbb079 100644
--- a/backend/app/services/_query_filters.py
+++ b/backend/app/services/_query_filters.py
@@ -127,6 +127,8 @@ def counts_as_pnl():
movements like investment applications where the counterpart is
an Asset/Holding, not another Account),
- transactions flagged `is_ignored=True` (user-marked as not to be reported),
+ - transactions flagged `exclude_from_pnl=True` (kept in balance,
+ omitted from income and expense calculations),
- transactions in categories flagged `is_ignored=True` (user-marked as not to be reported).
Does NOT exclude `source='opening_balance'` — callers that already
@@ -136,6 +138,7 @@ def counts_as_pnl():
return and_(
Transaction.transfer_pair_id.is_(None),
Transaction.is_ignored.is_(False),
+ Transaction.exclude_from_pnl.is_(False),
# Settlement *debits* are repayments of debts that were already
# booked as an expense via the share. Counting them would
# double-count. Settlement *credits*, however, represent the
@@ -178,6 +181,12 @@ def counts_on_bill():
- `treat_as_transfer` categories. Buying an investment with the
card still lands on the statement; the category says how to
report the purchase, not whether the bank billed for it.
+ - rows flagged `exclude_from_pnl`. Its canonical use is a work
+ expense paid on a personal card and reimbursed later — and the
+ bank bills the whole card either way.
+
+ The rule both share: a bill honors "make this disappear" and
+ ignores "report this differently".
Deliberately spelled out rather than defined as "`counts_as_pnl`
minus a clause": a filter for what a *report* excludes will keep
diff --git a/backend/app/services/dashboard_service.py b/backend/app/services/dashboard_service.py
index 6026fafd..0fec491c 100644
--- a/backend/app/services/dashboard_service.py
+++ b/backend/app/services/dashboard_service.py
@@ -201,6 +201,7 @@ def _counts_as_user_pnl_row(tx: Transaction) -> bool:
return not (
tx.transfer_pair_id
or tx.is_ignored
+ or tx.exclude_from_pnl
or tx.source == "settlement"
or (category and (category.treat_as_transfer or category.is_ignored))
)
diff --git a/backend/app/services/report_service.py b/backend/app/services/report_service.py
index 9d2e958b..22d09942 100644
--- a/backend/app/services/report_service.py
+++ b/backend/app/services/report_service.py
@@ -793,6 +793,7 @@ async def get_income_expenses_report(
Transaction.status == "posted",
Transaction.transfer_pair_id.is_(None),
Transaction.is_ignored.is_(False),
+ Transaction.exclude_from_pnl.is_(False),
Category.treat_as_transfer.is_(True),
Category.is_ignored.is_(False),
*acct_filter,
diff --git a/backend/app/services/transaction_calendar_service.py b/backend/app/services/transaction_calendar_service.py
index 6bf0f346..959515eb 100644
--- a/backend/app/services/transaction_calendar_service.py
+++ b/backend/app/services/transaction_calendar_service.py
@@ -123,7 +123,7 @@ async def get_transaction_calendar(
tx.category and tx.category.treat_as_transfer
)
ignored = bool(tx.is_ignored or (tx.category and tx.category.is_ignored))
- if not ignored:
+ if not ignored and not tx.exclude_from_pnl:
if is_transfer or tx.source == "transfer":
transfer_delta = await _signed_balance_delta_primary(session, tx, primary_currency)
day.transfer_net += transfer_delta
@@ -157,7 +157,7 @@ async def get_transaction_calendar(
tx.category and tx.category.treat_as_transfer
)
ignored = bool(tx.is_ignored or (tx.category and tx.category.is_ignored))
- if not ignored:
+ if not ignored and not tx.exclude_from_pnl:
if is_transfer or tx.source == "transfer":
delta = await _signed_balance_delta_primary(session, tx, primary_currency)
day.transfer_net += delta
@@ -370,6 +370,7 @@ def _actual_item(
transfer_pair_id=tx.transfer_pair_id,
is_transfer=is_transfer,
is_ignored=ignored,
+ exclude_from_pnl=bool(tx.exclude_from_pnl),
)
@@ -398,6 +399,7 @@ def _forecast_item(
transfer_pair_id=tx.transfer_pair_id,
is_transfer=is_transfer,
is_ignored=ignored,
+ exclude_from_pnl=bool(tx.exclude_from_pnl),
)
diff --git a/backend/tests/test_credit_card_accounting_mode.py b/backend/tests/test_credit_card_accounting_mode.py
index c9220160..179f57d9 100644
--- a/backend/tests/test_credit_card_accounting_mode.py
+++ b/backend/tests/test_credit_card_accounting_mode.py
@@ -1996,3 +1996,30 @@ class TestBillTotalIgnoresReportingExclusions:
assert summary is not None
assert summary["monthly_expenses"] == 100.0
+
+ @pytest.mark.asyncio
+ async def test_exclude_from_pnl_purchase_stays_on_the_bill(
+ self, session, test_user, test_workspace, cc_account
+ ):
+ """`exclude_from_pnl` says "do not report this as spending", not
+ "the bank did not bill me". Its canonical use — a work expense on a
+ personal card, reimbursed later — is a card case, so the bill total
+ has to stay whole or the card's own numbers split apart."""
+ await _make_tx(
+ session, test_user.id, cc_account.id,
+ date(2026, 4, 3), Decimal("100"), tx_type="debit",
+ )
+ reimbursed = await _make_tx(
+ session, test_user.id, cc_account.id,
+ date(2026, 4, 8), Decimal("200"), tx_type="debit",
+ )
+ reimbursed.exclude_from_pnl = True
+ await session.commit()
+
+ summary = await account_service.get_account_summary(
+ session, cc_account.id, test_workspace.id,
+ date_from=date(2026, 4, 1), date_to=date(2026, 4, 30),
+ )
+
+ assert summary is not None
+ assert summary["monthly_expenses"] == 300.0
diff --git a/backend/tests/test_transactions_api.py b/backend/tests/test_transactions_api.py
index 0bfadfc0..c25f3c18 100644
--- a/backend/tests/test_transactions_api.py
+++ b/backend/tests/test_transactions_api.py
@@ -654,6 +654,91 @@ async def test_list_transactions_user_pnl_only(
assert [item["description"] for item in data["items"]] == ["SALARY"]
+async def test_exclude_from_pnl_keeps_ledger_and_balance_but_not_report_totals(
+ client: AsyncClient, auth_headers,
+):
+ account_response = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={
+ "name": "Report exclusion account",
+ "type": "checking",
+ "balance": 0,
+ "currency": "BRL",
+ },
+ )
+ assert account_response.status_code == 201, account_response.text
+ account_id = account_response.json()["id"]
+
+ transaction_response = await client.post(
+ "/api/transactions",
+ headers=auth_headers,
+ json={
+ "account_id": account_id,
+ "description": "Ledger-only income",
+ "amount": "100.00",
+ "date": date.today().isoformat(),
+ "type": "credit",
+ },
+ )
+ assert transaction_response.status_code == 201, transaction_response.text
+ transaction_id = transaction_response.json()["id"]
+
+ excluded = await client.patch(
+ f"/api/transactions/{transaction_id}",
+ headers=auth_headers,
+ json={"exclude_from_pnl": True},
+ )
+ assert excluded.status_code == 200, excluded.text
+ assert excluded.json()["exclude_from_pnl"] is True
+
+ ledger = await client.get(
+ f"/api/transactions?account_id={account_id}", headers=auth_headers
+ )
+ assert ledger.status_code == 200
+ assert ledger.json()["total"] == 1
+ assert ledger.json()["summary"]["income"] == pytest.approx(0)
+
+ accounts = await client.get("/api/accounts", headers=auth_headers)
+ assert accounts.status_code == 200
+ balance = next(row for row in accounts.json() if row["id"] == account_id)
+ assert balance["current_balance"] == pytest.approx(100)
+
+ pnl_only = await client.get(
+ f"/api/transactions?account_id={account_id}&user_pnl_only=true",
+ headers=auth_headers,
+ )
+ assert pnl_only.status_code == 200
+ assert pnl_only.json()["total"] == 0
+
+ cash_flow = await client.get(
+ "/api/reports/cash-flow",
+ headers=auth_headers,
+ params={"months": 1, "interval": "daily", "account_ids": account_id},
+ )
+ assert cash_flow.status_code == 200, cash_flow.text
+ today_flow = next(
+ row
+ for row in cash_flow.json()["trend"]
+ if row["date"] == date.today().isoformat()
+ )
+ assert today_flow["breakdowns"] == {"inflow": 0.0, "outflow": 0.0}
+
+ ignored = await client.patch(
+ f"/api/transactions/{transaction_id}",
+ headers=auth_headers,
+ json={"is_ignored": True},
+ )
+ assert ignored.status_code == 200, ignored.text
+ ignored_accounts = await client.get("/api/accounts", headers=auth_headers)
+ assert ignored_accounts.status_code == 200
+ ignored_balance = next(
+ row for row in ignored_accounts.json() if row["id"] == account_id
+ )
+ assert ignored_balance["current_balance"] == pytest.approx(0)
+
+
@pytest.mark.asyncio
async def test_exclude_transfers_false_includes_all(
client: AsyncClient, auth_headers, test_transactions_with_transfers,
diff --git a/frontend/src/components/mobile-transaction-row.tsx b/frontend/src/components/mobile-transaction-row.tsx
index 1deb6045..05cee746 100644
--- a/frontend/src/components/mobile-transaction-row.tsx
+++ b/frontend/src/components/mobile-transaction-row.tsx
@@ -2,7 +2,7 @@ import { getAccountName } from '@/lib/account-utils'
import { AccountIcon } from '@/components/account-icon'
import { CategoryIcon } from '@/components/category-icon'
import type { Transaction, Account } from '@/types'
-import { AlertTriangle, ArrowLeftRight, CalendarClock, Clock, EyeClosed, Paperclip } from 'lucide-react'
+import { AlertTriangle, ArrowLeftRight, CalendarClock, ChartNoAxesColumn, Clock, EyeClosed, Paperclip } from 'lucide-react'
import { usePrivacyMode } from '@/hooks/use-privacy-mode'
import { useTranslation } from 'react-i18next'
import { formatCurrency } from '@/lib/format'
@@ -119,6 +119,12 @@ export function MobileTransactionRow({
{tx.is_ignored && (
<EyeClosed className="h-3 w-3 text-gray-500 shrink-0" />
)}
+ {tx.exclude_from_pnl && !tx.is_ignored && (
+ <ChartNoAxesColumn
+ className="h-3 w-3 text-slate-500 shrink-0"
+ aria-label={t('transactions.excludedFromReports')}
+ />
+ )}
{tx.recurring_transaction_id != null && !virtual && (
<span className="text-[9px] font-semibold uppercase tracking-wide text-primary bg-primary/5 border border-primary/10 px-1 py-0.5 rounded-full shrink-0">
R
diff --git a/frontend/src/components/transaction-calendar-view.tsx b/frontend/src/components/transaction-calendar-view.tsx
index 46c1215c..4ec98091 100644
--- a/frontend/src/components/transaction-calendar-view.tsx
+++ b/frontend/src/components/transaction-calendar-view.tsx
@@ -1,7 +1,7 @@
import { useEffect, useMemo, useState } from 'react'
import type { ReactNode } from 'react'
import { useTranslation } from 'react-i18next'
-import { ArrowLeftRight, CalendarDays, CircleDot, Clock, EyeClosed, Minus } from 'lucide-react'
+import { ArrowLeftRight, CalendarDays, ChartNoAxesColumn, CircleDot, Clock, EyeClosed, Minus } from 'lucide-react'
import type { Account, TransactionCalendarDay, TransactionCalendarItem, TransactionCalendarResponse } from '@/types'
import { Skeleton } from '@/components/ui/skeleton'
import { AccountIcon } from '@/components/account-icon'
@@ -1246,6 +1246,12 @@ function CalendarItemRow({
{item.is_ignored && (
<EyeClosed className="h-3 w-3 text-gray-500 shrink-0" />
)}
+ {item.exclude_from_pnl && !item.is_ignored && (
+ <ChartNoAxesColumn
+ className="h-3 w-3 text-slate-500 shrink-0"
+ aria-label={t('transactions.excludedFromReports')}
+ />
+ )}
{shouldShowPendingBadge(item) && (
<span
title={t('transactions.pending')}
diff --git a/frontend/src/components/transaction-dialog.tsx b/frontend/src/components/transaction-dialog.tsx
index 49f453fa..6a47dc60 100644
--- a/frontend/src/components/transaction-dialog.tsx
+++ b/frontend/src/components/transaction-dialog.tsx
@@ -507,6 +507,9 @@ function TransactionForm({
el.style.height = `${el.scrollHeight + border}px`
}, [description, isSynced])
const [isIgnored, setIsIgnored] = useState(seed?.is_ignored ?? false)
+ const [excludeFromReports, setExcludeFromReports] = useState(
+ seed?.exclude_from_pnl ?? false,
+ )
const [togglingIgnore, setTogglingIgnore] = useState(false)
const [recurringLinked, setRecurringLinked] = useState(seed?.recurring_transaction_id != null)
const [unlinkingRecurring, setUnlinkingRecurring] = useState(false)
@@ -729,12 +732,16 @@ function TransactionForm({
: hadInitialSplits
? { splits: { share_type: 'equal', splits: [] } }
: {}
+ const pnlExclusionPayload = transaction
+ ? { exclude_from_pnl: excludeFromReports }
+ : {}
const txData = isSynced
? {
category_id: categoryId || null,
payee_id: payeeId || null,
notes: notes.trim() || null,
is_ignored: isIgnored,
+ ...pnlExclusionPayload,
...overridePayload,
...splitsPayload,
} as TransactionEditPayload
@@ -749,6 +756,7 @@ function TransactionForm({
account_id: accountId || undefined,
notes: notes.trim() || null,
is_ignored: isIgnored,
+ ...pnlExclusionPayload,
// Creation defaults to "posted" server-side; the user can
// override to "pending" right in the form (date & status row).
status,
@@ -1089,6 +1097,25 @@ function TransactionForm({
/>
</div>
+ {transaction && (
+ <label className="flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3">
+ <input
+ type="checkbox"
+ className="mt-0.5 h-4 w-4 rounded border-border accent-primary"
+ checked={excludeFromReports}
+ onChange={(event) => setExcludeFromReports(event.target.checked)}
+ />
+ <span>
+ <span className="block text-sm font-medium">
+ {t('transactions.excludeFromReports')}
+ </span>
+ <span className="block text-xs text-muted-foreground">
+ {t('transactions.excludeFromReportsHint')}
+ </span>
+ </span>
+ </label>
+ )}
+
{/* Manual bill-cycle override (issue #92). CC accounts only. Empty
input = use auto bucketing (Pluggy bill_id when available, cycle
math otherwise). Setting the date forces this tx into the bill
diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json
index 0596db32..14706ca9 100644
--- a/frontend/src/locales/de.json
+++ b/frontend/src/locales/de.json
@@ -735,6 +735,9 @@
"confirmTransferCategoryBoth": "Beide aktualisieren",
"ignoreTransfer": "Diese Transaktion ignorieren",
"ignoreTransferHint": "Ignorierte Transaktionen werden in Berichten und im Saldo nicht angezeigt",
+ "excludeFromReports": "Aus Berichten ausschließen",
+ "excludeFromReportsHint": "Diese Transaktion wird nicht als Einnahme oder Ausgabe gezählt, wirkt sich aber weiterhin auf den Kontostand aus und bleibt im Transaktionsverlauf sichtbar.",
+ "excludedFromReports": "Nicht in Berichten",
"ignored": "Ignoriert",
"ignoreAction": "Ignorieren",
"unignoreAction": "Wiederherstellen",
diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json
index d7521e55..03f70a64 100644
--- a/frontend/src/locales/en.json
+++ b/frontend/src/locales/en.json
@@ -735,6 +735,9 @@
"confirmTransferCategoryBoth": "Update both",
"ignoreTransfer": "Ignore this transaction",
"ignoreTransferHint": "Ignored transactions will not show on reports and balance",
+ "excludeFromReports": "Exclude from reports",
+ "excludeFromReportsHint": "This transaction will not count as income or expense, but it will still affect the account balance and remain in the transaction history.",
+ "excludedFromReports": "Not in reports",
"ignored": "Ignored",
"ignoreAction": "Ignore",
"unignoreAction": "Restore",
diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json
index 9c62f98e..64734a6d 100644
--- a/frontend/src/locales/es.json
+++ b/frontend/src/locales/es.json
@@ -731,6 +731,9 @@
"confirmTransferCategoryBoth": "Actualizar ambas",
"ignoreTransfer": "Ignorar esta transacción",
"ignoreTransferHint": "Las transacciones ignoradas no aparecerán en informes ni en el saldo",
+ "excludeFromReports": "Excluir de los informes",
+ "excludeFromReportsHint": "Esta transacción no contará como ingreso ni gasto, pero seguirá afectando el saldo de la cuenta y permanecerá en el historial de transacciones.",
+ "excludedFromReports": "Fuera de los informes",
"ignored": "Ignorada",
"ignoreAction": "Ignorar",
"unignoreAction": "Restaurar",
diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json
index 22d31b9d..410632fe 100644
--- a/frontend/src/locales/fr.json
+++ b/frontend/src/locales/fr.json
@@ -735,6 +735,9 @@
"confirmTransferCategoryBoth": "Mettre à jour les deux",
"ignoreTransfer": "Ignorer cette transaction",
"ignoreTransferHint": "Les transactions ignorées n'apparaîtront pas dans les rapports ni le solde",
+ "excludeFromReports": "Exclure des rapports",
+ "excludeFromReportsHint": "Cette transaction ne sera pas comptabilisée comme un revenu ou une dépense, mais elle affectera toujours le solde du compte et restera dans l'historique des transactions.",
+ "excludedFromReports": "Hors des rapports",
"ignored": "Ignorée",
"ignoreAction": "Ignorer",
"unignoreAction": "Restaurer",
diff --git a/frontend/src/locales/it.json b/frontend/src/locales/it.json
index 2290f712..71602a13 100644
--- a/frontend/src/locales/it.json
+++ b/frontend/src/locales/it.json
@@ -731,6 +731,9 @@
"confirmTransferCategoryBoth": "Aggiorna entrambe",
"ignoreTransfer": "Ignora questa transazione",
"ignoreTransferHint": "Le transazioni ignorate non appariranno nei report né nel saldo",
+ "excludeFromReports": "Escludi dai report",
+ "excludeFromReportsHint": "Questa transazione non verrà conteggiata come entrata o uscita, ma continuerà a influire sul saldo del conto e resterà nella cronologia delle transazioni.",
+ "excludedFromReports": "Fuori dai report",
"ignored": "Ignorata",
"ignoreAction": "Ignora",
"unignoreAction": "Ripristina",
diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json
index b0ace2c6..d0126231 100644
--- a/frontend/src/locales/nl.json
+++ b/frontend/src/locales/nl.json
@@ -735,6 +735,9 @@
"confirmTransferCategoryBoth": "Beide bijwerken",
"ignoreTransfer": "Negeer deze transactie",
"ignoreTransferHint": "Genegeerde transacties worden niet weergegeven in rapporten en saldo",
+ "excludeFromReports": "Uitsluiten van rapporten",
+ "excludeFromReportsHint": "Deze transactie wordt niet als inkomen of uitgave meegerekend, maar heeft nog steeds invloed op het rekeningsaldo en blijft zichtbaar in de transactiegeschiedenis.",
+ "excludedFromReports": "Niet in rapporten",
"ignored": "Genegeerd",
"ignoreAction": "Negeer",
"unignoreAction": "Herstellen",
diff --git a/frontend/src/locales/pl.json b/frontend/src/locales/pl.json
index fb3a7d34..b268637d 100644
--- a/frontend/src/locales/pl.json
+++ b/frontend/src/locales/pl.json
@@ -761,6 +761,9 @@
"confirmTransferCategoryBoth": "Zaktualizuj obie",
"ignoreTransfer": "Ignoruj tę transakcję",
"ignoreTransferHint": "Ignorowane transakcje nie pojawią się w raportach ani saldzie",
+ "excludeFromReports": "Wyklucz z raportów",
+ "excludeFromReportsHint": "Ta transakcja nie będzie liczona jako przychód ani wydatek, ale nadal wpłynie na saldo konta i pozostanie w historii transakcji.",
+ "excludedFromReports": "Poza raportami",
"ignored": "Ignorowana",
"ignoreAction": "Ignoruj",
"unignoreAction": "Przywróć",
diff --git a/frontend/src/locales/pt-BR.json b/frontend/src/locales/pt-BR.json
index f5241c70..b7f99987 100644
--- a/frontend/src/locales/pt-BR.json
+++ b/frontend/src/locales/pt-BR.json
@@ -731,6 +731,9 @@
"confirmTransferCategoryBoth": "Atualizar ambas",
"ignoreTransfer": "Ignorar esta transação",
"ignoreTransferHint": "Transações ignoradas não entram nos relatórios",
+ "excludeFromReports": "Excluir dos relatórios",
+ "excludeFromReportsHint": "Esta transação não será contabilizada como receita ou despesa, mas continuará afetando o saldo da conta e permanecerá no histórico de transações.",
+ "excludedFromReports": "Fora dos relatórios",
"ignored": "Ignorado",
"ignoreAction": "Ignorar",
"unignoreAction": "Não ignorar",
diff --git a/frontend/src/locales/pt-PT.json b/frontend/src/locales/pt-PT.json
index d48b9b71..c82672cf 100644
--- a/frontend/src/locales/pt-PT.json
+++ b/frontend/src/locales/pt-PT.json
@@ -731,6 +731,9 @@
"confirmTransferCategoryBoth": "Atualizar ambas",
"ignoreTransfer": "Ignorar esta transação",
"ignoreTransferHint": "Transações ignoradas não entram nos relatórios",
+ "excludeFromReports": "Excluir dos relatórios",
+ "excludeFromReportsHint": "Esta transação não será contabilizada como rendimento ou despesa, mas continuará a afetar o saldo da conta e permanecerá no histórico de transações.",
+ "excludedFromReports": "Fora dos relatórios",
"ignored": "Ignorado",
"ignoreAction": "Ignorar",
"unignoreAction": "Não ignorar",
diff --git a/frontend/src/locales/ru.json b/frontend/src/locales/ru.json
index 9fc8e91a..ed79db3d 100644
--- a/frontend/src/locales/ru.json
+++ b/frontend/src/locales/ru.json
@@ -741,6 +741,9 @@
"confirmTransferCategoryBoth": "Обновить обе",
"ignoreTransfer": "Игнорировать эту транзакцию",
"ignoreTransferHint": "Игнорируемые транзакции не будут отображаться в отчётах и балансе",
+ "excludeFromReports": "Исключить из отчётов",
+ "excludeFromReportsHint": "Эта транзакция не будет учитываться как доход или расход, но продолжит влиять на баланс счёта и останется в истории транзакций.",
+ "excludedFromReports": "Не в отчётах",
"ignored": "Игнорируется",
"ignoreAction": "Игнорировать",
"unignoreAction": "Восстановить",
diff --git a/frontend/src/locales/sk.json b/frontend/src/locales/sk.json
index 9e010efa..1c185943 100644
--- a/frontend/src/locales/sk.json
+++ b/frontend/src/locales/sk.json
@@ -775,6 +775,9 @@
"confirmTransferCategoryBoth": "Upraviť obe",
"ignoreTransfer": "Ignorovať túto transakciu",
"ignoreTransferHint": "Ignorované transakcie sa nezobrazia v reportoch ani v zostatku",
+ "excludeFromReports": "Vylúčiť z reportov",
+ "excludeFromReportsHint": "Táto transakcia sa nebude započítavať ako príjem ani výdavok, ale naďalej ovplyvní zostatok účtu a zostane v histórii transakcií.",
+ "excludedFromReports": "Mimo výkazov",
"ignored": "Ignorovaná",
"ignoreAction": "Ignorovať",
"unignoreAction": "Obnoviť",
diff --git a/frontend/src/locales/uk.json b/frontend/src/locales/uk.json
index dd71c4c5..187c1cdc 100644
--- a/frontend/src/locales/uk.json
+++ b/frontend/src/locales/uk.json
@@ -741,6 +741,9 @@
"confirmTransferCategoryBoth": "Оновити обидві",
"ignoreTransfer": "Ігнорувати цю транзакцію",
"ignoreTransferHint": "Ігноровані транзакції не відображатимуться у звітах та балансі",
+ "excludeFromReports": "Виключити зі звітів",
+ "excludeFromReportsHint": "Ця транзакція не враховуватиметься як дохід або витрата, але й надалі впливатиме на баланс рахунку та залишиться в історії транзакцій.",
+ "excludedFromReports": "Не у звітах",
"ignored": "Ігнорується",
"ignoreAction": "Ігнорувати",
"unignoreAction": "Відновити",
diff --git a/frontend/src/pages/transactions.tsx b/frontend/src/pages/transactions.tsx
index fbcb2dc6..6872781a 100644
--- a/frontend/src/pages/transactions.tsx
+++ b/frontend/src/pages/transactions.tsx
@@ -35,7 +35,7 @@ import {
TableRow,
} from '@/components/ui/table'
import { Skeleton } from '@/components/ui/skeleton'
-import { AlertTriangle, ArrowLeftRight, ArrowUp, ArrowDown, Check, Clock, HelpCircle, Info, Paperclip, Trash2, Users, X, EyeClosed, SlidersHorizontal, Receipt } from 'lucide-react'
+import { AlertTriangle, ArrowLeftRight, ArrowUp, ArrowDown, Check, Clock, HelpCircle, Info, Paperclip, Trash2, Users, X, EyeClosed, ChartNoAxesColumn, SlidersHorizontal, Receipt } from 'lucide-react'
import type { Transaction, Rule, InstallmentSeriesInput, TransactionApplyScope, TransactionEditPayload } from '@/types'
import { RuleDialog, type RuleDialogInitialData } from '@/components/rule-dialog'
import { PageHeader } from '@/components/page-header'
@@ -1140,7 +1140,7 @@ export default function TransactionsPage() {
<span title={t('transactions.transferTooltip')}><HelpCircle className="h-3 w-3 text-blue-400" /></span>
</span>
)}
- {tx.is_ignored &&
+ {tx.is_ignored &&
(
<span className="ml-2 inline-flex items-center gap-1 text-xs text-gray-600 font-normal bg-gray-100 border border-gray-200 rounded px-1.5 py-0.5">
<EyeClosed className="h-3 w-3" />
@@ -1149,6 +1149,16 @@ export default function TransactionsPage() {
</span>
)
}
+ {/* Distinct from Ignored on purpose: this row still moves the
+ balance, so its amount keeps its colour and sign and only
+ the badge marks it. Ignored greys the amount out instead. */}
+ {tx.exclude_from_pnl && !tx.is_ignored && (
+ <span className="ml-2 inline-flex items-center gap-1 text-xs text-slate-600 font-normal bg-slate-100 border border-slate-200 rounded px-1.5 py-0.5 dark:text-slate-300 dark:bg-slate-500/15 dark:border-slate-500/30">
+ <ChartNoAxesColumn className="h-3 w-3" />
+ {t('transactions.excludedFromReports')}
+ <span title={t('transactions.excludeFromReportsHint')}><HelpCircle className="h-3 w-3 text-blue-400" /></span>
+ </span>
+ )}
{tx.recurring_transaction_id != null && (
<span
className="text-[10px] font-semibold uppercase tracking-wide text-primary bg-primary/5 border border-primary/10 px-1.5 py-0.5 rounded-full"
diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts
index 54614832..df2260fe 100644
--- a/frontend/src/types/index.ts
+++ b/frontend/src/types/index.ts
@@ -282,6 +282,8 @@ export interface Transaction {
parent_owner_name?: string | null
// Flag to exclude this transaction from reports and dashboard aggregations
is_ignored: boolean
+ // Keeps the transaction in the ledger/balance while excluding it from P&L.
+ exclude_from_pnl?: boolean
virtual?: boolean
}
@@ -636,6 +638,7 @@ export interface TransactionCalendarItem {
transfer_pair_id: string | null
is_transfer: boolean
is_ignored: boolean
+ exclude_from_pnl: boolean
}
export interface TransactionCalendarDay {