accounting.report.reports package

Submodules

accounting.report.reports.balance_sheet module

The balance sheet.

class accounting.report.reports.balance_sheet.AccountCollector(currency: Currency, period: Period)

Bases: object

The balance sheet account collector.

accounts: list[ReportAccount]

The balance sheet accounts.

class accounting.report.reports.balance_sheet.BalanceSheet(currency: Currency, period: Period)

Bases: BaseReport

The balance sheet.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

class accounting.report.reports.balance_sheet.CSVHalfRow(title: str | None, amount: Decimal | None)

Bases: object

A half row in the CSV.

amount: Decimal | None

The amount.

title: str | None

The title.

class accounting.report.reports.balance_sheet.CSVRow

Bases: BaseCSVRow

A row in the CSV.

asset_amount: Decimal | None

The amount of the asset.

asset_title: str | None

The title of the asset.

liability_amount: Decimal | None

The amount of the liability.

liability_title: str | None

The title of the liability.

property values: list[str | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.balance_sheet.PageParams(currency: Currency, period: Period, has_data: bool, assets: Section, liabilities: Section, owner_s_equity: Section)

Bases: BasePageParams

The HTML page parameters.

assets: Section

The assets.

currency: Currency

The currency.

property currency_options: list[OptionLink]

Returns the currency options.

Returns:

The currency options.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

liabilities: Section

The liabilities.

owner_s_equity: Section

The owner’s equity.

period: Period

The period.

period_chooser: PeriodChooser

The period chooser.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

class accounting.report.reports.balance_sheet.ReportAccount(account: Account, amount: Decimal, url: str)

Bases: object

An account in the report.

account: Account

The account.

amount: Decimal

The amount of the account.

url: str

The URL to the ledger of the account.

class accounting.report.reports.balance_sheet.Section(title: BaseAccount)

Bases: object

A section.

subsections: list[Subsection]

The subsections in the section.

title: BaseAccount

The title account.

property total: Decimal

Returns the total of the section.

Returns:

The total of the section.

class accounting.report.reports.balance_sheet.Subsection(title: BaseAccount)

Bases: object

A subsection.

accounts: list[ReportAccount]

The accounts in the subsection.

title: BaseAccount

The title account.

property total: Decimal

Returns the total of the subsection.

Returns:

The total of the subsection.

accounting.report.reports.income_expenses module

The income and expenses log.

class accounting.report.reports.income_expenses.CSVRow(date: date | str | None, account: str | None, description: str | None, income: str | Decimal | None, expense: str | Decimal | None, balance: str | Decimal | None, note: str | None)

Bases: BaseCSVRow

A row in the CSV.

account: str | None

The account.

balance: str | Decimal | None

The balance.

date: date | str | None

The date.

description: str | None

The description.

expense: str | Decimal | None

The expense.

income: str | Decimal | None

The income.

note: str | None

The note.

property values: list[str | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.income_expenses.IncomeExpenses(currency: Currency, account: CurrentAccount, period: Period)

Bases: BaseReport

The income and expenses log.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

class accounting.report.reports.income_expenses.LineItemCollector(currency: Currency, account: CurrentAccount, period: Period)

Bases: object

The line item collector.

brought_forward: ReportLineItem | None

The brought-forward line item.

line_items: list[ReportLineItem]

The line items.

total: ReportLineItem | None

The total line item.

class accounting.report.reports.income_expenses.PageParams(currency: Currency, account: CurrentAccount, period: Period, has_data: bool, pagination: Pagination[ReportLineItem], brought_forward: ReportLineItem | None, line_items: list[ReportLineItem], total: ReportLineItem | None)

Bases: BasePageParams

The HTML page parameters.

account: CurrentAccount

The account.

property account_options: list[OptionLink]

Returns the account options.

Returns:

The account options.

brought_forward: ReportLineItem | None

The brought-forward line item.

currency: Currency

The currency.

property currency_options: list[OptionLink]

Returns the currency options.

Returns:

The currency options.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

line_items: list[ReportLineItem]

The line items.

pagination: Pagination[ReportLineItem]

The pagination.

period: Period

The period.

period_chooser: PeriodChooser

The period chooser.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

total: ReportLineItem | None

The total line item.

class accounting.report.reports.income_expenses.ReportLineItem(line_item: JournalEntryLineItem | None = None)

Bases: object

A line item in the report.

account: Account | None

The account.

balance: Decimal | None

The balance.

date: date | None

The date.

description: str | None

The description.

expense: Decimal | None

The expense amount.

income: Decimal | None

The income amount.

is_brought_forward: bool

Whether this is the brought-forward line item.

is_total: bool

Whether this is the total line item.

note: str | None

The note.

url: str | None

The URL to the journal entry line item.

accounting.report.reports.income_statement module

The income statement.

class accounting.report.reports.income_statement.AccumulatedTotal(title: str)

Bases: object

An accumulated total.

amount: Decimal

The amount of the account.

title: str

The account.

class accounting.report.reports.income_statement.CSVRow(text: str | None, amount: str | Decimal | None)

Bases: BaseCSVRow

A row in the CSV.

amount: str | Decimal | None

The amount.

text: str | None

The text.

property values: list[str | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.income_statement.IncomeStatement(currency: Currency, period: Period)

Bases: BaseReport

The income statement.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

class accounting.report.reports.income_statement.PageParams(currency: Currency, period: Period, has_data: bool, sections: list[Section])

Bases: BasePageParams

The HTML page parameters.

currency: Currency

The currency.

property currency_options: list[OptionLink]

Returns the currency options.

Returns:

The currency options.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

period: Period

The period.

period_chooser: PeriodChooser

The period chooser.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

sections: list[Section]

The sections in the income statement.

class accounting.report.reports.income_statement.ReportAccount(account: Account, amount: Decimal, url: str)

Bases: object

An account in the report.

account: Account

The account.

amount: Decimal

The amount of the account.

url: str

The URL to the ledger of the account.

class accounting.report.reports.income_statement.Section(title: BaseAccount, accumulated_title: str)

Bases: object

A section.

accumulated: AccumulatedTotal

The accumulated total.

subsections: list[Subsection]

The subsections in the section.

title: BaseAccount

The title account.

property total: Decimal

Returns the total of the section.

Returns:

The total of the section.

class accounting.report.reports.income_statement.Subsection(title: BaseAccount)

Bases: object

A subsection.

accounts: list[ReportAccount]

The accounts in the subsection.

title: BaseAccount

The title account.

property total: Decimal

Returns the total of the subsection.

Returns:

The total of the subsection.

accounting.report.reports.journal module

The journal.

class accounting.report.reports.journal.CSVRow(journal_entry_date: str | date, currency: str, account: str, description: str | None, debit: str | Decimal | None, credit: str | Decimal | None, note: str | None)

Bases: BaseCSVRow

A row in the CSV.

account: str

The account.

credit: str | Decimal | None

The credit amount.

currency: str

The currency.

date: str | date

The date.

debit: str | Decimal | None

The debit amount.

description: str | None

The description.

note: str | None

The note.

property values: list[str | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.journal.Journal(period: Period)

Bases: BaseReport

The journal.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

class accounting.report.reports.journal.PageParams(period: Period, pagination: Pagination[JournalEntryLineItem], line_items: list[JournalEntryLineItem])

Bases: BasePageParams

The HTML page parameters.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

line_items: list[JournalEntryLineItem]

The line items.

pagination: Pagination[JournalEntryLineItem]

The pagination.

period: Period

The period.

period_chooser: PeriodChooser

The period chooser.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

class accounting.report.reports.journal.ReportLineItem(line_item: JournalEntryLineItem)

Bases: object

A line item in the report.

account: Account

The account.

amount: Decimal

The amount.

credit: Decimal | None

The credit amount.

currency: Currency

The account.

debit: Decimal | None

The debit amount.

description: str | None

The description.

journal_entry: JournalEntry

The journal entry.

line_item: JournalEntryLineItem

The journal entry line item.

accounting.report.reports.journal.get_csv_rows(line_items: list[JournalEntryLineItem]) list[CSVRow]

Composes and returns the CSV rows from the line items.

Parameters:

line_items – The line items.

Returns:

The CSV rows.

accounting.report.reports.ledger module

The ledger.

class accounting.report.reports.ledger.CSVRow(date: date | str | None, description: str | None, debit: str | Decimal | None, credit: str | Decimal | None, balance: str | Decimal | None, note: str | None)

Bases: BaseCSVRow

A row in the CSV.

balance: str | Decimal | None

The balance.

credit: str | Decimal | None

The credit amount.

date: date | str | None

The date.

debit: str | Decimal | None

The debit amount.

description: str | None

The description.

note: str | None

The note.

property values: list[str | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.ledger.Ledger(currency: Currency, account: Account, period: Period)

Bases: BaseReport

The ledger.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

class accounting.report.reports.ledger.LineItemCollector(currency: Currency, account: Account, period: Period)

Bases: object

The line item collector.

brought_forward: ReportLineItem | None

The brought-forward line item.

line_items: list[ReportLineItem]

The line items.

total: ReportLineItem | None

The total line item.

class accounting.report.reports.ledger.PageParams(currency: Currency, account: Account, period: Period, has_data: bool, pagination: Pagination[ReportLineItem], brought_forward: ReportLineItem | None, line_items: list[ReportLineItem], total: ReportLineItem | None)

Bases: BasePageParams

The HTML page parameters.

account: Account

The account.

property account_options: list[OptionLink]

Returns the account options.

Returns:

The account options.

brought_forward: ReportLineItem | None

The brought-forward line item.

currency: Currency

The currency.

property currency_options: list[OptionLink]

Returns the currency options.

Returns:

The currency options.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

line_items: list[ReportLineItem]

The line items.

pagination: Pagination[ReportLineItem]

The pagination.

period: Period

The period.

period_chooser: PeriodChooser

The period chooser.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

total: ReportLineItem | None

The total line item.

class accounting.report.reports.ledger.ReportLineItem(line_item: JournalEntryLineItem | None = None)

Bases: object

A line item in the report.

balance: Decimal | None

The balance.

credit: Decimal | None

The credit amount.

date: date | None

The date.

debit: Decimal | None

The debit amount.

description: str | None

The description.

is_brought_forward: bool

Whether this is the brought-forward line item.

is_total: bool

Whether this is the total line item.

note: str | None

The note.

url: str | None

The URL to the journal entry line item.

accounting.report.reports.search module

The search.

class accounting.report.reports.search.LineItemCollector

Bases: object

The line item collector.

line_items: list[JournalEntryLineItem]

The line items.

class accounting.report.reports.search.PageParams(pagination: Pagination[JournalEntryLineItem], line_items: list[JournalEntryLineItem])

Bases: BasePageParams

The HTML page parameters.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

line_items: list[JournalEntryLineItem]

The line items.

pagination: Pagination[JournalEntryLineItem]

The pagination.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

class accounting.report.reports.search.Search

Bases: BaseReport

The search.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

accounting.report.reports.trial_balance module

The trial balance.

class accounting.report.reports.trial_balance.CSVRow(text: str | None, debit: str | Decimal | None, credit: str | Decimal | None)

Bases: BaseCSVRow

A row in the CSV.

credit: str | Decimal | None

The credit amount.

debit: str | Decimal | None

The debit amount.

text: str | None

The text.

property values: list[str | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.trial_balance.PageParams(currency: Currency, period: Period, accounts: list[ReportAccount], total: Total)

Bases: BasePageParams

The HTML page parameters.

accounts: list[ReportAccount]

The accounts in the trial balance.

currency: Currency

The currency.

property currency_options: list[OptionLink]

Returns the currency options.

Returns:

The currency options.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

period: Period

The period.

period_chooser: PeriodChooser

The period chooser.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

total: Total

The total of the trial balance.

class accounting.report.reports.trial_balance.ReportAccount(account: Account, amount: Decimal, url: str)

Bases: object

An account in the report.

account: Account

The account.

credit: Decimal | None

The credit amount.

debit: Decimal | None

The debit amount.

url: str

The URL to the ledger of the account.

class accounting.report.reports.trial_balance.Total(debit: Decimal, credit: Decimal)

Bases: object

The totals.

credit: Decimal | None

The credit amount.

debit: Decimal | None

The debit amount.

class accounting.report.reports.trial_balance.TrialBalance(currency: Currency, period: Period)

Bases: BaseReport

The trial balance.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

accounting.report.reports.unapplied module

The unapplied original line items.

class accounting.report.reports.unapplied.CSVRow(journal_entry_date: str | date, currency: str, description: str | None, amount: str | Decimal, net_balance: str | Decimal)

Bases: BaseCSVRow

A row in the CSV.

amount: str | Decimal

The amount.

currency: str

The currency.

date: str | date

The date.

description: str | None

The description.

net_balance: str | Decimal

The net balance.

property values: list[str | date | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.unapplied.PageParams(currency: Currency, account: Account, pagination: Pagination[JournalEntryLineItem], line_items: list[JournalEntryLineItem])

Bases: BasePageParams

The HTML page parameters.

account: Account

The account.

property account_options: list[OptionLink]

Returns the account options.

Returns:

The account options.

currency: Currency

The currency.

property currency_options: list[OptionLink]

Returns the currency options.

Returns:

The currency options.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

line_items: list[JournalEntryLineItem]

The line items.

pagination: Pagination[JournalEntryLineItem]

The pagination.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

class accounting.report.reports.unapplied.UnappliedOriginalLineItems(currency: Currency, account: Account)

Bases: BaseReport

The unapplied original line items.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

accounting.report.reports.unapplied.get_csv_rows(line_items: list[JournalEntryLineItem]) list[CSVRow]

Composes and returns the CSV rows from the line items.

Parameters:

line_items – The line items.

Returns:

The CSV rows.

accounting.report.reports.unapplied_accounts module

The accounts with unapplied original line items.

class accounting.report.reports.unapplied_accounts.AccountsWithUnappliedOriginalLineItems(currency: Currency)

Bases: BaseReport

The accounts with unapplied original line items.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

class accounting.report.reports.unapplied_accounts.CSVRow(account: str, count: int | str)

Bases: BaseCSVRow

A row in the CSV.

account: str

The currency.

count: int | str

The number of unapplied original line items.

property values: list[str | date | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.unapplied_accounts.PageParams(currency: Currency, accounts: list[Account])

Bases: BasePageParams

The HTML page parameters.

property account_options: list[OptionLink]

Returns the account options.

Returns:

The account options.

accounts: list[Account]

The accounts.

currency: Currency

The currency.

property currency_options: list[OptionLink]

Returns the currency options.

Returns:

The currency options.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

accounting.report.reports.unapplied_accounts.get_csv_rows(accounts: list[Account]) list[CSVRow]

Composes and returns the CSV rows from the line items.

Parameters:

accounts – The accounts.

Returns:

The CSV rows.

accounting.report.reports.unmatched module

The unmatched offsets.

class accounting.report.reports.unmatched.CSVRow(journal_entry_date: str | date, currency: str, description: str | None, debit: str | Decimal, credit: str | Decimal, balance: str | Decimal)

Bases: BaseCSVRow

A row in the CSV.

balance: str | Decimal

The balance.

credit: str | Decimal | None

The credit amount.

currency: str

The currency.

date: str | date

The date.

debit: str | Decimal | None

The debit amount.

description: str | None

The description.

property values: list[str | date | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.unmatched.PageParams(currency: Currency, account: Account, match_status: str | LazyString, matched_pairs: list[OffsetPair], pagination: Pagination[JournalEntryLineItem], line_items: list[JournalEntryLineItem])

Bases: BasePageParams

The HTML page parameters.

account: Account

The account.

property account_options: list[OptionLink]

Returns the account options.

Returns:

The account options.

currency: Currency

The currency.

property currency_options: list[OptionLink]

Returns the currency options.

Returns:

The currency options.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

line_items: list[JournalEntryLineItem]

The line items.

match_status: str | LazyString

The match status message.

matched_pairs: list[OffsetPair]

A list of matched pairs.

pagination: Pagination[JournalEntryLineItem]

The pagination.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

class accounting.report.reports.unmatched.UnmatchedOffsets(currency: Currency, account: Account)

Bases: BaseReport

The unmatched offsets.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

accounting.report.reports.unmatched.get_csv_rows(line_items: list[JournalEntryLineItem]) list[CSVRow]

Composes and returns the CSV rows from the line items.

Parameters:

line_items – The line items.

Returns:

The CSV rows.

accounting.report.reports.unmatched_accounts module

The accounts with unmatched offsets.

class accounting.report.reports.unmatched_accounts.AccountsWithUnmatchedOffsets(currency: Currency)

Bases: BaseReport

The accounts with unmatched offsets.

csv() Response

Returns the report as CSV for download.

Returns:

The response of the report for download.

html() str

Composes and returns the report as HTML.

Returns:

The report as HTML.

class accounting.report.reports.unmatched_accounts.CSVRow(account: str, count: int | str)

Bases: BaseCSVRow

A row in the CSV.

account: str

The currency.

count: int | str

The number of unapplied original line items.

property values: list[str | date | Decimal | None]

Returns the values of the row.

Returns:

The values of the row.

class accounting.report.reports.unmatched_accounts.PageParams(currency: Currency, accounts: list[Account])

Bases: BasePageParams

The HTML page parameters.

property account_options: list[OptionLink]

Returns the account options.

Returns:

The account options.

accounts: list[Account]

The accounts.

currency: Currency

The currency.

property currency_options: list[OptionLink]

Returns the currency options.

Returns:

The currency options.

property has_data: bool

Returns whether there is any data on the page.

Returns:

True if there is any data, or False otherwise.

property report_chooser: ReportChooser

Returns the report chooser.

Returns:

The report chooser.

accounting.report.reports.unmatched_accounts.get_csv_rows(accounts: list[Account]) list[CSVRow]

Composes and returns the CSV rows from the line items.

Parameters:

accounts – The accounts.

Returns:

The CSV rows.

Module contents

The reports.