reports

Provides financial accounting reports.

Submodules

Package Contents

Classes

IncomeStatement

This class represents the Income Statement/Profit and Loss of a given Entity.

BalanceSheet

This class represents Financial Position/Balance Sheet of a given Entity.

AgingSchedule

This class displays the outstanding balances for recievables and payables categorised by how long they have been outstanding.

CashflowStatement

This class represents the movement of balances of Balance Sheet accounts during the given period.

TrialBalance

This class represents all the balances of the chart of accounts, compared against each other.

class reports.IncomeStatement(session, start_date: datetime.datetime = None, end_date: datetime.datetime = None)

Bases: python_accounting.reports.financial_statement.FinancialStatement

This class represents the Income Statement/Profit and Loss of a given Entity.

Accounts

The Account types allowed to be in included in the report.

Type:

(Account.AccountType)

config = 'income_statement'

The configuration section for the report.

Type:

(str)

__repr__() str
static net_profit(session, start_date: datetime.datetime = None, end_date: datetime.datetime = None) decimal.Decimal

Get the value of net profit for the given period.

Parameters:
  • session (Session) – The accounting session to which the report belongs.

  • start_date (datetime) – The earliest transaction date for Transaction amounts to be included in the report.

  • end_date (datetime) – The latest transaction date for Transaction amounts to be included in the report.

Returns:

The net profit or loss for the Entity for the period.

Return type:

Decimal

class reports.BalanceSheet(session, end_date: datetime.datetime = None)

Bases: python_accounting.reports.financial_statement.FinancialStatement

This class represents Financial Position/Balance Sheet of a given Entity.

Accounts

The Account types allowed to be in included in the report.

Type:

(Account.AccountType)

config = 'balance_sheet'

The configuration section for the report.

Type:

(str)

__repr__() str
class reports.AgingSchedule(session, account_type: python_accounting.models.Account.AccountType, end_date: datetime.datetime = None)

This class displays the outstanding balances for recievables and payables categorised by how long they have been outstanding.

brackets

Categories of ages in days and their labels.

{
    current (int): Days in the current bracket. Defaults to 30.
    31 - 90 days (int): Days in the quarter bracket. Defaults to 90.
    91 - 180 days (int): Days in the half year bracket. Defaults to 180.
    181 - 270 days (int): Days in the three quarters bracket. Defaults to 270.
    271 - 365 days (int): Days in the whole year bracket. Defaults to 365.
    365+ Bad Debts (int): Days in the year plus bracket. Defaults to 1000000000 (infinity).
}
Type:

(dict)

balances: dict

The total outstanding amounts per age bracket.

{
    current (Decimal): Balances not yet due.
    31 - 90 days (Decimal): Balances outstanding for up to 90 days.
    91 - 180 days (Decimal): Balances outstanding for up to 180 days.
    181 - 270 days (Decimal): Balances outstanding for up to 270 days.
    271 - 365 days (Decimal): Balances outstanding for up to 365 days.
    365+ Bad Debts (Decimal): Balances over a year old.
}
Type:

(dict)

accounts: list

The Account who’s outsanding transactions constitue the balances.

Type:

(list)

account_type

(Account.AccountType.RECEIVABLE|Account.AccountType.PAYABLE): The Account type to get aged balances for. Can only be Receivable or Payable.

end_date: datetime.datetime

The latest transaction date for Transaction amounts to be included in the balances.

Type:

(datetime)

__repr__() str

Return repr(self).

_allocate_balances(transactions: list, account: python_accounting.models.Account) None
class reports.CashflowStatement(session, start_date: datetime.datetime = None, end_date: datetime.datetime = None)

Bases: python_accounting.reports.financial_statement.FinancialStatement

This class represents the movement of balances of Balance Sheet accounts during the given period.

config = 'cashflow_statement'

The configuration section for the report.

Type:

config (str)

sub_sections: dict

The categories of the contents of the sections of the report.

Type:

sub_sections (dict)

__repr__() str
_get_sections(start_date: datetime.datetime = None, end_date: datetime.datetime = None, full_balance: bool = True) None
_print_section(section, factor=1) str
class reports.TrialBalance(session, end_date: datetime.datetime = None)

Bases: python_accounting.reports.financial_statement.FinancialStatement

This class represents all the balances of the chart of accounts, compared against each other.

config = 'trial_balance'

The configuration section for the report.

Type:

(str)