accounting

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

View Source
const DefaultPageSize = 20

DefaultPageSize is used when no valid per_page query param is supplied.

Variables

View Source
var PageSizes = []int{20, 50, 100}

PageSizes are the selectable "items per page" options for the journal-entries list.

Functions

func Accounts

func Accounts(data layout.AppLayoutData, accounts []model.Account) templ.Component

func BalanceSheet

func BalanceSheet(props BalanceSheetProps) templ.Component

func JournalEntries

func JournalEntries(props JournalEntriesProps) templ.Component

func TrialBalance

func TrialBalance(props TrialBalanceProps) templ.Component

Types

type BalanceSheetData

type BalanceSheetData struct {
	Assets                    BalanceSheetSection
	Liabilities               BalanceSheetSection
	Equity                    BalanceSheetSection
	TotalAssets               int64
	TotalLiabilitiesAndEquity int64
	Balanced                  bool
}

BalanceSheetData is a rolled-up view of a TrialBalanceAsOf result, grouped by account type. The Equity section's last row is a synthetic "Current Earnings (Unclosed)" line (AccountCode == "") — this ledger has no period-closing step, so revenue/expense accounts carry their lifetime balance forever; without folding their net into equity, TotalAssets would never equal TotalLiabilitiesAndEquity.

func RollUp

func RollUp(balances []model.AccountBalance) BalanceSheetData

RollUp groups balances into a BalanceSheetData. See BalanceSheetData's doc comment for the synthetic Current Earnings line.

type BalanceSheetProps

type BalanceSheetProps struct {
	Data     layout.AppLayoutData
	Sheet    BalanceSheetData
	AsOf     string
	BranchID uuid.UUID
	Branches []model.Branch
}

BalanceSheetProps holds the data needed to render the balance sheet page.

type BalanceSheetSection

type BalanceSheetSection struct {
	Accounts []model.AccountBalance
	Total    int64
}

BalanceSheetSection is one Assets/Liabilities/Equity section of a rolled-up balance sheet.

type JournalEntriesProps

type JournalEntriesProps struct {
	Data       layout.AppLayoutData
	Entries    []model.JournalEntry
	Page       int
	PerPage    int
	TotalItems int
	DateFrom   string
	DateTo     string
	BranchID   uuid.UUID
	EventName  string
	Branches   []model.Branch
}

JournalEntriesProps holds the data needed to render the journal-entries list page.

type TrialBalanceProps

type TrialBalanceProps struct {
	Data        layout.AppLayoutData
	Balances    []model.AccountBalance
	AsOf        string
	BranchID    uuid.UUID
	Branches    []model.Branch
	TotalDebit  int64
	TotalCredit int64
}

TrialBalanceProps holds the data needed to render the trial balance page.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL