Reports

The goal of any Accounting system is to summarize the Transactions that have occured for an Entity during a given period of time into information that can be used to make financial decisions. The reports provided by the Library are described below.

Account Statement

Account Statements are chronological records of transactions that have been posted to an account and their effects on its balance. Statements can be created for all accounts in the chart.

Parameters:

  • session (Session): The accounting session to which the Account belongs.

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

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

Returns A dictionary with:

  • opening_balance (Decimal): The balance of the Account at the beginning of the statement period.

  • transactions (list): Transactions posted to the Account during the period.

  • closing_balance (Decimal): The balance of the Account at the end of the statement period.

Apart from their standard attributes, the Transactions returned also include a debit and credit property which indicates the the amount added or subtracted to/from the account respectively. There’s also a balance property which keeps a running balance starting from the opening balance and adding the debits and credits of the transactions and ending with the closing balance.

Example

account = session.get(Account, account.id)

statement = account.statement(session)

print(statement)

{
    'opening_balance': Decimal('0'), 
    'transactions': [...], 
    'closing_balance': Decimal('0')
}

Account Schedule

Account Schedules are similar to statements in that the present chronological records of transactions that have been posted to an account, the difference being that only transactions with outstanding balances, i.e. those that have not been cleared completely are displayed. Schedules can only be created for Account::RECEIVABLE and Account::PAYABLE account types.

Parameters: The same as Account Statements, but with the additional boolean schedule = True.

Returns A dictionary with:

  • transactions (list): Outstanding clearable Transactions posted to the Account as at the end date.

  • total_amount (Decimal): The total amount of the Transactions in the Schdeule.

  • cleared_amount (Decimal): The amount of the Transactions in the Schdeule that has been cleared.

  • uncleared_amount (Decimal): The amount of the Transactions in the Schdeule that is still outstanding.

Apart from their standard attributes, the Transactions returned also include a cleared_amount property which indicates how much of the Transaction has been offset by assignable Transactions, an uncleared_amount property which shows the balance yet to be offset and an age property which shows in days how long the Transaction has been outstanding.

Example

account = session.get(Account, account.id)

statement = account.statement(session, None, None, True)

print(statement)

{
    'transactions': [...], 
    'total_amount': Decimal('0'), 
    'cleared_amount': Decimal('0'), 
    'uncleared_amount': Decimal('0')
}

Aging Schedule

The Aging Schedule shows amounts receivable from clients and payable to suppliers categorized by how long they have been outstanding. The time period brackets can be configured to any arbitrary number of days each.

Parameters:

  • session (Session): The accounting session.

  • account_type (Account.AccountType): The type of Account whose balances should be retrieved. Must be either Account.AccountType.RECEIVABLE or Account.AccountType.PAYABLE

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

Returns An AgingSchedule with:

  • accounts (list): Accounts which have Outstanding clearable Transactions as at the end date.

  • balances (dict): The total amount outstanding for each age bracket.

Apart from their standard attributes, the Accounts returned also include a balances property which indicates how much of the Account’s outstanding balance falls into each age bracket.

Example


schedule = AgingSchedule(session, Account.AccountType.RECEIVABLE)

print(schedule.accounts)
[...]
print(schedule.balances)
{
    'current': Decimal('0'), 
    '31 - 90 days': Decimal('0'), 
    '91 - 180 days': Decimal('0'), 
    '181 - 270 days': Decimal('0'), 
    '271 - 365 days': Decimal('0'), 
    '365+ Bad Debts': Decimal('0')
}

Income Statement

The Income Statement, also known as the Profit and Loss statement shows the performance of the entity by subtracting the combined balances of expense accounts from that of income accounts. The end result is the profit made by the Entity for the given period.

Parameters:

  • session (Session): The accounting session.

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

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

Returns An IncomeStatement with:

  • sections (StrEnum): The sections of the Income Statement.

  • results (StrEnum): The results of the Income Statement.

  • accounts (dict): The Accounts in the sections of the report, by Account category.

  • balances (dict): The total balances of the Accounts in the sections of the report, by Account category.

  • totals (dict): The Total balances of Accounts in the sections of the report.

  • result_amounts (dict): The amounts results of the report.

Example


statement = IncomeStatement(session)

print(statement)

               Example Company
               Income Statement
 For the period: 01, Jan 2024 to 23, Feb 2024

Operating Revenues
    Operating Revenue                200.0000 

Operating Expenses
    Operating Expense                100.0000 
                              _______________
Gross Profit                         100.0000


Non Operating Revenues
    Non Operating Revenue              0.0000
                              _______________
Total Revenue                        100.0000


Non Operating Expenses
                              _______________
Total Expenses                         0.0000

                              _______________
Net Profit                           100.0000
                              ===============

Balance Sheet

The Balance Sheet, also known as the Statement of Financial position shows the financial health of the entity by comparing the combined balances of asset Accounts to those of liability and equity Accounts.

Parameters:

  • session (Session): The accounting session.

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

Returns An BalanceSheet with:

  • sections (StrEnum): The sections of the Balance Sheet.

  • results (StrEnum): The results of the Balance Sheet.

  • accounts (dict): The Accounts in the sections of the report, by Account category.

  • balances (dict): The total balances of the Accounts in the sections of the report, by Account category.

  • totals (dict): The Total balances of Accounts in the sections of the report.

  • result_amounts (dict): The amounts results of the report.

Example


balance_sheet = BalanceSheet(session) 

print(balance_sheet)

               Example Company
                Balance Sheet
 For the period: 01, Jan 2024 to 23, Feb 2024

Assets
    Non Current Asset                120.0000 
    Receivables                       70.0000 
    Bank                              50.0000 
                              _______________
Total Assets                         240.0000


Liabilities
    Control                           20.0000 
    Payable                          120.0000 
                              _______________
Total Liabilities                    140.0000

                              _______________
Net Assets                           100.0000
                              ===============

Equity
    Income Statement                 100.0000
                              _______________
Total Equity                         100.0000
                              ===============

Cashflow Statement

The Cashflow Statement links the Income Statement to the Balance Sheet by reconciling the performance of the Entity with changes in the balances of assets, liabilities, equity and the balances in the cashbook.

Parameters:

  • session (Session): The accounting session.

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

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

Returns An CashFlowStatement with:

  • sections (StrEnum): The sections of the Cashflow Statement.

  • results (StrEnum): The results of the Cashflow Statement.

  • accounts (dict): The Accounts in the sections of the report, by Account category.

  • balances (dict): The total balances of the Accounts in the sections of the report, by Account category.

  • totals (dict): The Total balances of Accounts in the sections of the report.

  • result_amounts (dict): The amounts results of the report.

Example


cashflow_statememt = BalanceSheet(session) 

print(cashflow_statememt)

                 Test Entity
              Cashflow Statement
 For the period: 01, Jan 2024 to 23, Feb 2024

Operating Cash Flow
    Net Profit                       100.0000
    Receivables                      -70.0000
    Payables                         120.0000
    Taxation                          20.0000
                              _______________
 Total Operating Cash Flow           170.0000


Investment Cash Flow
    Non Current Assets              -120.0000
                              _______________
 Total Investment Cash Flow         -120.0000


Financing Cash Flow
    Equity                             0.0000
                              _______________
 Total Financing Cash Flow             0.0000


Net Cash Flow
    Beginning Cash Balance             0.0000
    Net Cash Flow                     50.0000
                              _______________
Ending Cash Balance                   50.0000
                              ===============
                              _______________
Cashbook Balance                      50.0000
                              ===============

Trial Balance

The Trial Balance, compares the closing balances of all accounts in the chart, debits against credits categorised as either Income Statement or Balance Sheet accounts. If the totals match then the books of the Entity have been recorded in accordance with the double entry principle.

Parameters:

  • session (Session): The accounting session.

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

Returns An TrialBalance with:

  • sections (StrEnum): The sections of the Balance Sheet.

  • results (StrEnum): The results of the Balance Sheet.

  • accounts (dict): The Accounts in the sections of the report, by Account category.

  • balances (dict): The total balances of the Accounts in the sections of the report, by Account category.

  • totals (dict): The Total balances of Accounts in the sections of the report.

  • result_amounts (dict): The amounts results of the report.

Example

trial_balance = TrialBalance(session)

print(trial_balance)

                 Test Entity
                Trial Balance
 For the period: 01, Jan 2024 to 24, Feb 2024

Income Statement
    Operating Revenue               -420.0000
    Non Operating Revenue            -50.0000
    Operating Expense                100.0000
    Direct Expense                    65.0000
    Overhead Expense                  40.0000
                              _______________
 Total Income Statement             -265.0000


Balance Sheet
    Non Current Asset                100.0000
    Inventory                        100.0000
    Bank                             374.5000
    Receivable                        22.0000
    Control                           -4.5000
    Current Liability               -100.0000
    Payable                         -220.0000
    Equity                           -77.0000
    Reconciliation                    70.0000
                              _______________
 Total Balance Sheet                 265.0000

                              _______________
Total Debits                         871.5000
                              ===============
                              _______________
Total Credits                        871.5000
                              ===============