fix(reconciliation): bank tile says 'Rörelse på banken' with the in/ut/antal split (#1858)

'Banktransaktioner i perioden (netto)' made a bookkeeper's abstraction do
the explaining; Jakob read it as gross activity. The tile now reads
'Rörelse på banken i perioden' and its sub-line shows the gross split
behind the net (in · ut · antal transaktioner), so 'netto' needs no
label. The bank status carries bank_transaction_inflow / _outflow /
_count for it; the bridge line uses the same wording.

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-08-24 16:24:26 +02:00
committed by GitHub
co-authored by Jakob Wennberg Claude Fable 5
parent 34ad1b1936
commit 4fb449a474
5 changed files with 31 additions and 5 deletions
+13
View File
@@ -110,6 +110,12 @@ export interface ReconciliationStatus {
* excluded-but-shown.
*/
bank_transaction_total: number
/** Gross inflow (sum of positive amounts) behind bank_transaction_total; informational, for the page's "in · ut · antal" line. */
bank_transaction_inflow: number
/** Gross outflow (sum of negative amounts, itself negative) behind bank_transaction_total. */
bank_transaction_outflow: number
/** Number of non-ignored bank transactions in the window. */
bank_transaction_count: number
/** Sum of ignored bank transactions in the window. NOT part of
* bank_transaction_total or difference; informational, like the IB. */
ignored_transaction_total: number
@@ -921,6 +927,10 @@ export async function getReconciliationStatus(
// matched_count + unmatched_transaction_count always equals the number of
// rows behind bank_transaction_total.
const matchedCount = reconcilableTx.filter((tx) => tx.journal_entry_id !== null).length
// The gross split behind the net: what the user actually recognises as
// "what moved on the bank", so the page never has to explain "netto".
const bankInflow = reconcilableTx.reduce((sum, tx) => sum + Math.max(Number(tx.amount) || 0, 0), 0)
const bankOutflow = reconcilableTx.reduce((sum, tx) => sum + Math.min(Number(tx.amount) || 0, 0), 0)
const unmatchedTx = reconcilableTx.filter((tx) => tx.journal_entry_id === null)
const unmatchedTransactionCount = unmatchedTx.length
@@ -976,6 +986,9 @@ export async function getReconciliationStatus(
return {
currency,
bank_transaction_total: Math.round(bankTotal * 100) / 100,
bank_transaction_inflow: roundOre(bankInflow),
bank_transaction_outflow: roundOre(bankOutflow),
bank_transaction_count: reconcilableTx.length,
ignored_transaction_total: roundOre(ignoredTotal),
ignored_transaction_count: ignoredTx.length,
gl_1930_balance: Math.round(glBalance * 100) / 100,
+2 -2
View File
@@ -88,8 +88,8 @@ function bankBridge(status: Awaited<ReturnType<typeof getBankReconciliationStatu
const lines: BridgeLine[] = [
{
key: 'bank_transactions',
label_sv: 'Banktransaktioner i perioden (netto)',
label_en: 'Bank transactions in the period (net)',
label_sv: 'Rörelse på banken i perioden',
label_en: 'Movement on the bank in the period',
amount: status.bank_transaction_total,
count: null,
items_bucket: null,