Financial reports: P&L and Balance Sheet #2

Open
opened 2026-08-07 14:22:34 +00:00 by hum3 · 0 comments
Owner

Overview

Generate financial reports from go-luca ledger data, returning structured data with optional HTML rendering.

P&L (Profit & Loss)

For a given period (from/to dates), compute:

  • Income: Loan interest income, BoE interest income
  • Expenses: Deposit interest expense, operational costs
  • Net Interest Margin: income minus expenses
  • Net Profit: NIM minus operational costs

Return as a ProfitAndLoss struct. Also provide HTML rendering for demo/testing.

Balance Sheet

At a given point in time, compute:

  • Assets: Loans to customers, government securities (gilts), cash & reserves
  • Liabilities: Customer deposits
  • Equity: Retained earnings (CET1 capital)
  • Regulatory Capital: CET1 ratio, risk-weighted assets, Basel III compliance

Return as a BalanceSheet struct. Also provide HTML rendering.

Acceptance Criteria

  • ProfitAndLoss struct computed from ledger movements within a period
  • BalanceSheet struct computed from ledger balances at a point in time
  • Both take a luca.Ledger + ChartOfAccounts as input
  • HTML rendering methods on both structs
  • Tests with realistic banking ledger data

Migrated from Codeberg: originally #2, opened 2026-03-25.

## Overview Generate financial reports from go-luca ledger data, returning structured data with optional HTML rendering. ## P&L (Profit & Loss) For a given period (from/to dates), compute: - **Income**: Loan interest income, BoE interest income - **Expenses**: Deposit interest expense, operational costs - **Net Interest Margin**: income minus expenses - **Net Profit**: NIM minus operational costs Return as a `ProfitAndLoss` struct. Also provide HTML rendering for demo/testing. ## Balance Sheet At a given point in time, compute: - **Assets**: Loans to customers, government securities (gilts), cash & reserves - **Liabilities**: Customer deposits - **Equity**: Retained earnings (CET1 capital) - **Regulatory Capital**: CET1 ratio, risk-weighted assets, Basel III compliance Return as a `BalanceSheet` struct. Also provide HTML rendering. ## Acceptance Criteria - `ProfitAndLoss` struct computed from ledger movements within a period - `BalanceSheet` struct computed from ledger balances at a point in time - Both take a `luca.Ledger` + `ChartOfAccounts` as input - HTML rendering methods on both structs - Tests with realistic banking ledger data --- *Migrated from Codeberg: originally [#2](https://codeberg.org/hum3/gobank-accounts/issues/2), opened 2026-03-25.*
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hum3/gobank-accounts#2
No description provided.