reports Package

views Module

reports.views.events_report(request, template_name='reports/events.html')[source]

Display all Events.

Parameters:template_name (str) – The template file to use to render the response.
Returns:HTTP Response with an events context variable.
Return type:HttpResponse
reports.views.profit_loss_report(request, template_name='reports/profit_loss.html')[source]

Display the Profit or Loss for a time period calculated using all Income and Expense Accounts.

The available GET parameters are start_date and stop_date. They control the date range used for the calculations.

This view is used to show the Total, Header and Account Net Changes over a specified date range. It uses the Net Changes to calculate various Profit amounts, passing them as context variables:

  • gross_profit: Income - Cost of Goods Sold
  • operating_profit: Gross Profit - Expenses
  • net_profit: Operating Profit + Other Income - Other Expenses

Also included is the headers dictionary which contains the income, cost_of_goods_sold, expenses, other_income, and other_expense keys. These keys point to the root node for the respective :attr:~accounts.models.BaseAccountModel.type`.

These nodes have additional attributes appended to them, total, accounts and descendants. total represents the total Net Change for the node. accounts and descendants are lists of child nodes(also with a total attribute).

Parameters:template_name (str) – The template file to use to render the response.
Returns:HTTP Response with the start/stop dates, headers dictionary and Profit Totals
Return type:HttpResponse
reports.views.trial_balance_report(request, template_name='reports/trial_balance.html')[source]

Display the state and change of all Accounts over a time period.

The available GET parameters are start_date and stop_date.

The view also provides the start_date, stop_date and accounts context variables.

The start_date and stop_date variables default to the first day of the year and the current date.

The accounts variable is a list of dictionaries, each representing an Account. Each dictionary contains the Account's number, name, balance at the beginning and end of the date range, total debits and credits and the net change.

Parameters:template_name (str) – The template file to use to render the response.
Returns:HTTP Response with start and stop dates and an accounts list.
Return type:HttpResponse