Commit Graph
19 Commits
Author SHA1 Message Date
rick d6929163ec Make entire ledger row clickable for transaction detail
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
Made-with: Cursor
2026-04-09 14:01:17 +02:00
rick 4b63b085c8 Fix date column wrapping: wider (140px), whiteSpace nowrap
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
Made-with: Cursor
2026-04-09 13:58:21 +02:00
rick 89145b98d8 Widen numeric columns in both ledger tabs for large amounts
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
Debit/Credit columns: 100px → 130px
Balance column: 110px → 140px

Accommodates million-scale amounts like 1,992,983.52 without overflow.
Applied to both Account Ledger and General Journal tabs.

Made-with: Cursor
2026-04-09 13:55:42 +02:00
rick a33b11db74 Add transaction detail dialog, clickable from both ledger tabs
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
TransactionDetailDialog: shared modal showing full transaction info:
- Header: Tx#, balanced/unbalanced chip
- Date, description, currency
- Dependency link (Expense Claim #N, Invoice #N, etc.)
- Blockchain hash if present
- Documentation indicator
- Row table: account name, debit, credit, foreign currency, totals

Wired into both tabs:
- Account Ledger: Tx# column is now clickable (blue, underline on hover)
- General Journal: transaction header row is clickable (hover highlight)

Both tabs load account name map from /inspect/accounts-tree for the
dialog's account name resolution.

Also updated TransactionDetail API type to include hasDocumentation,
dependency, and foreign currency fields on rows.

Made-with: Cursor
2026-04-09 13:48:32 +02:00
rick 2ef34eadff Merge date+desc columns for account rows, fix Account Ledger balances
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
General Journal: account rows now use colSpan=2 to merge the Date and
Description columns, so the badge+account name starts under the
transaction date rather than being deeply indented under the description.
Creates a more natural visual hierarchy.

Account Ledger: fixed prior balance calculation for result accounts
(Income/Cost) — now computed from fiscal year start to period start,
matching the General Journal fix. Balance accounts (Asset/Debt) still
use all-time cumulative.

Made-with: Cursor
2026-04-09 13:39:13 +02:00
rick 599f58fa97 General Journal: inline badge+name, robust column widths
CI / build-and-test (push) Failing after 58s
CI / docker (push) Has been skipped
- Moved account type badge into the Description/Account cell, inline
  with the account name. Badge and name are now in the same column as
  the transaction description, creating natural visual alignment.
- Widened balance column to 120px, added whiteSpace: nowrap + overflow:
  hidden on all numeric columns to prevent layout breakage with large
  numbers.
- Trimmed Tx# column to 55px.

Made-with: Cursor
2026-04-09 13:34:59 +02:00
rick 88dab48cfe Fix General Journal: balance calculation, date width, badge alignment
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has been cancelled
- Fixed result account (Income/Cost) running balance: now computed from
  fiscal year start to period start, not from dawn of time. Balance
  accounts (Asset/Debt) still use all-time cumulative as before.
- Narrowed date column from 145px to 130px
- Right-aligned account type badge (pr: 4px) so it acts as a bullet
  point for the account name (pl: 4px), creating visual continuity
  between badge and account name across the column boundary

Made-with: Cursor
2026-04-09 13:26:01 +02:00
rick e5d77022c4 General Journal: per-row balance, wider date, remove collapse
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
- Added per-account running balance column: each row shows the account's
  balance after this specific row's delta is applied. Balance accounts
  (Asset/Debt) start from dawn-of-time prior balance; result accounts
  (Income/Cost) start from fiscal year start.
- Removed collapse/expand on transaction headers — they're just headers,
  not collapsible parents. Eliminates whitespace issue.
- Widened date column to 145px with whiteSpace: nowrap to prevent
  date wrapping across lines.
- Simplified component by removing all collapse state and animation code.

Made-with: Cursor
2026-04-09 13:06:14 +02:00
rick 635a1911ad Add tabbed Inspect Ledgers with General Journal (grundbok)
CI / build-and-test (push) Has been cancelled
CI / docker (push) Has been cancelled
Restructured Inspect Ledgers into three tabs:
- Account Ledger (huvudbok): existing view, moved to AccountLedgerTab
- General Journal (grundbok): new transaction-grouped view
- Search: placeholder (disabled)

General Journal features:
- Backend endpoint: /inspect/general-journal returns transactions with
  nested rows, account paths (Parent » Child), account types
- Transaction header rows: Tx#, date+time, description, doc indicator
- Expandable/collapsible per transaction with smooth animation
- Child rows: account type chip (color-coded), account path with
  parent breadcrumb, debit/credit columns
- Year/month selectors, transaction count, currency label
- Foreign currency chips on rows where applicable

Backend: queries all accounts for org, groups rows by transaction,
builds account paths from parent hierarchy, returns structured JSON.

Made-with: Cursor
2026-04-09 12:43:07 +02:00
rick b273e52778 Fix Inspect Ledgers: stable checkbox, currency code, clean state
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
- Checkbox for "own transactions only" now lives outside the
  data-dependent rendering block — visible whenever the selected
  account has children, regardless of query results
- Selected account stored as ID (number), not object reference,
  eliminating React re-render reference-equality issues
- isGroupAccount derived via useMemo from stable primitives
- ownOnly reset moved to onChange handler, not effects
- Autocomplete uses isOptionEqualToValue for stable comparison
- Currency code (SEK/EUR) shown in ledger header from org API

Made-with: Cursor
2026-04-09 11:48:34 +02:00
rick 15a0907561 Fix checkbox persistence and show currency code in Inspect Ledgers
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has been cancelled
- Checkbox "own transactions only" no longer disappears when checked:
  group state tracked from account selection, not from API response
- Reset ownOnly to false when switching accounts
- Currency code (SEK, EUR) shown instead of org name in ledger header
- Organization list and detail API endpoints now include currencyCode
  resolved from the Currencies table

Made-with: Cursor
2026-04-09 11:29:32 +02:00
rick 1bdb1fd3d5 Inspect Ledgers: group view, tree dropdown, prior/closing balance rows
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
Backend: inspect/ledger endpoint now supports group queries:
- Selecting a parent account returns merged transactions from all
  descendants, sorted chronologically
- ?ownOnly=true filters to just the selected account's own transactions
- Response includes isGroup, groupAccountCount, accountName per entry

Frontend improvements:
- Account dropdown shows tree indentation matching account hierarchy
- Prior balance row at top of ledger, closing balance at bottom
- Period totals row shows only debit/credit sums (no balance)
- Account column appears automatically for group views
- Checkbox "Show only this account's own transactions (exclude
  sub-accounts)" appears when viewing a parent account with children
- Currency label above table
- Entries sorted by date within group view

Made-with: Cursor
2026-04-09 11:19:53 +02:00
rick bb240658fb Align tree grid header/footer padding + add initialExpanded prop
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has been cancelled
- Header and footer rows now use same CELL_PX padding as data rows,
  fixing horizontal misalignment of column values
- New initialExpanded prop: 'roots' (default), 'all', 'none', or
  Set<number> for specific node IDs

Made-with: Cursor
2026-04-09 11:03:35 +02:00
rick 42544242d9 Add Inspect Ledgers page and API endpoints
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
Backend:
- GET /api/organizations/{orgId}/inspect/accounts-tree: flat account list
  grouped by type for the account selector
- GET /api/organizations/{orgId}/inspect/ledger: rich ledger entries with
  transaction comment, sequence ID, debit/credit split, running balance,
  foreign currency, dependency info — joins rows with parent transactions

Frontend:
- InspectLedgersPage: searchable Autocomplete account selector grouped
  by account type, year/month dropdowns, transaction grid with Tx#,
  date+time, description (with tooltip), debit, credit, running balance,
  foreign currency chips, period totals row, prior balance display
- Fixed column widths via tableLayout: fixed + colgroup

Also cleans up unused imports in AccountTreeGrid and removes stale
AnimatedRow function.

Made-with: Cursor
2026-04-09 11:00:05 +02:00
rick 90b9bc2425 Polish AccountTreeGrid: dual-value crossfade and smooth animations
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has been cancelled
The tree grid now matches v5 Open Ledgers behavior:

Value crossfade (v5 pattern):
- Each parent cell holds BOTH the aggregate (Σ) and own value
- Two absolutely-positioned overlapping elements at right: 0
- isCollapsed toggles opacity between them via CSS transition
- One fades out, the other fades in — pure crossfade, no value swap
- Single state change drives everything, no JavaScript animation timing

Row animation:
- AnimatedCellContent wraps each cell's content in a height-animated div
- Fixed ROW_HEIGHT (28px) for consistent layout
- overflow: hidden clips vertically without horizontal shift
- Children slide in/out simultaneously with the parent value crossfade

Column stability:
- tableLayout: fixed with colgroup for locked column widths
- All cells use identical CELL_PX padding
- DualValueCell shared between root and animated rows
- position: absolute + right: 0 ensures alignment regardless of text length

Visual polish:
- Σ prefix: 14px bold, only on collapsed non-zero aggregates
- Expanded parents with zero own-value show empty (reduce clutter)
- Chevron rotates 90° smoothly on expand
- Folder/FolderOpen icons for parents, Description for leaves

Made-with: Cursor
2026-04-09 10:51:01 +02:00
rick afde51abf2 Add AccountTreeGrid component and tree report endpoints
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
New reusable AccountTreeGrid component:
- Hierarchical tree with expand/collapse per node
- Σ prefix on aggregated parent values when collapsed
- Parent nodes show sum of all descendants when collapsed
- Own-value shown when expanded (for nodes with direct amounts)
- Column totals invariant: same regardless of expand/collapse state
- Folder/document icons matching v5 visual language
- CSS transitions on hover and state changes
- CSV download support per section

New backend endpoints:
- GET /api/organizations/{orgId}/reports/balance-sheet-tree?year=N
  Returns accounts with quarterly columns: Start, Q1, Q2, Q3, Q4, Current
- GET /api/organizations/{orgId}/reports/profit-loss-tree?year=N
  Returns accounts with: Last Year, Q1, Q2, Q3, Q4, YTD

Rebuilt pages using tree grid:
- Balance Sheet: Assets and Liabilities sections with quarterly breakdown
- Profit & Loss: Revenue and Expenses sections with quarterly breakdown,
  net result chip, CSV download

Modeled after v5 Open Ledgers treegrid functionality.

Made-with: Cursor
2026-04-09 09:38:56 +02:00
rick e25e54b98a Fix dev-mode auth: auto-authenticate on /api/auth/me
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
The auth/me endpoint was excluded from AuthMiddleware (as all /api/auth/
paths are), so dev-mode auto-auth never ran for it. Fixed by checking
DevMode config directly in the /me handler.

Also removed the aggressive window.location redirect from the API client
— the React router handles 401s via the RequireAuth wrapper instead.

Made-with: Cursor
2026-04-08 19:03:55 +02:00
rick 45f026b4f4 Add React frontend with live data pages (section 10)
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has started running
Full React + MUI + TypeScript SPA at frontend/:
- API client with typed interfaces for all endpoints
- AuthContext (session cookies, dev impersonation)
- OrgContext (org list, active org switcher)
- Money formatting (cents → display, satoshis → BCH)

App shell:
- Sidebar navigation with collapsible Ledgers and Financial sections
- Top bar with org switcher, language selector (EN/SV/DE), user chip
- Material UI theme with Inter font

Live data pages (connected to real migrated production data):
- Dashboard: YTD P&L cards, pending tasks, quick links
- Balance Sheet: date picker, assets/debts tables with totals
- Profit & Loss: year selector, income/costs breakdown, net result
- Chart of Accounts: grouped by type with status chips
- Crypto Treasury: total balance, address table with BCH amounts
- Expense Claims: list with amounts, VAT, status chips

Placeholder pages for: Inspect Ledgers, Budget vs Actual, Inbound/
Outbound Invoices, Payouts, End of Month, Org Settings, User Management

Vite dev server proxies /api to ASP.NET Core backend on port 5222.

Made-with: Cursor
2026-04-08 18:32:03 +02:00
rick 8aafe681b1 Scaffold v6 solution, frontend, CI, and Docker
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has been cancelled
Section 1 complete (tasks 1.1-1.7):
- .NET 8 solution with 8 projects (Common, Basic, Database, Logic, Api,
  Backend, Migration, Tests) and correct dependency graph
- NuGet deps: MySqlConnector, NBitcoin, Microsoft.Extensions.Hosting,
  xunit, coverlet
- Common layer: IHasIdentity, enums (Permission, FinancialAccountType,
  DocumentType, CryptoChain, ExpenseClaimStatus, InvoiceStatus,
  PayoutStatus, FinancialDependencyType)
- React + TypeScript + Vite frontend with MUI, react-router, react-i18next
- Localization: EN, SV, DE translation files
- Vite builds to src/UsingCash.Api/wwwroot for static serving
- Multi-stage Dockerfile: Node build + .NET build -> aspnet runtime
- Gitea Actions CI: build, test, lint, Docker image
- appsettings.json with read/write/admin DB credential structure

Also updates data-migration spec/design for mysqldump-based workflow.

Made-with: Cursor
2026-04-08 16:21:00 +02:00