Report

Profit & Loss

The Profit & Loss report.

Revenues and expenses between two dates, with the net income. It is the same report as the Income Statement under its other name, and takes the same options. In GnuCash: Reports ▸ Income & Expense ▸ Profit & Loss.

Examples

Example: with a copy of the reports/test-data example book open as book.gnucash, at 2024-03-15T12:00:00Z.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"report.run","params":{"report":"Profit & Loss","options":{"General":{"Start Date":{"absolute":"1978-01-01"},"End Date":{"absolute":"1978-12-31"}}}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "title": " Profit & Loss For Period Covering 01/01/78 to 12/31/78",
    "sections": [
      {
        "blocks": [
          {
            "kind": "table",
            "rows": [
              "…",
              "…",
              "…",
              "…",
              "…",
              "…",
              "…",
              "…",
              "…",
              {
                "role": "grandTotal",
                "cells": [
                  {
                    "text": "Net income for Period",
                    "…": "…"
                  },
                  {
                    "display": "$3,136.80",
                    "…": "…"
                  }
                ],
                "…": "…"
              },
              "…"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash report.run '{"report":"Profit & Loss","options":{"General":{"Start Date":{"absolute":"1978-01-01"},"End Date":{"absolute":"1978-12-31"}}}}'

It prints:

{
  "title": " Profit & Loss For Period Covering 01/01/78 to 12/31/78",
  "sections": [
    {
      "blocks": [
        {
          "kind": "table",
          "rows": [
            "…",
            "…",
            "…",
            "…",
            "…",
            "…",
            "…",
            "…",
            "…",
            {
              "role": "grandTotal",
              "cells": [
                {
                  "text": "Net income for Period",
                  "…": "…"
                },
                {
                  "display": "$3,136.80",
                  "…": "…"
                }
              ],
              "…": "…"
            },
            "…"
          ],
          "…": "…"
        },
        "…"
      ],
      "…": "…"
    },
    "…"
  ],
  "…": "…"
}

MCP tool call

Tool call:

{"name":"report.run","arguments":{"report":"Profit & Loss","options":{"General":{"Start Date":{"absolute":"1978-01-01"},"End Date":{"absolute":"1978-12-31"}}}}}

Result:

{
  "structuredContent": {
    "title": " Profit & Loss For Period Covering 01/01/78 to 12/31/78",
    "sections": [
      {
        "blocks": [
          {
            "kind": "table",
            "rows": [
              "…",
              "…",
              "…",
              "…",
              "…",
              "…",
              "…",
              "…",
              "…",
              {
                "role": "grandTotal",
                "cells": [
                  {
                    "text": "Net income for Period",
                    "…": "…"
                  },
                  {
                    "display": "$3,136.80",
                    "…": "…"
                  }
                ],
                "…": "…"
              },
              "…"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Template GUID: 8758ba23984c40dea5527f5f0ca2779e · Script: standard/income-statement.rhai

Options

Accounts

  • Accounts (accountList, default []): Report on these accounts, if display depth allows.
  • Levels of Subaccounts (multichoice, default 3): Maximum number of levels in the account tree displayed.
  • Flatten list to depth limit (boolean, default false): Displays accounts which exceed the depth limit at the depth limit.

Commodities

  • Report's currency (currency, default "CURRENCY::USD"): Select the currency to display the values of this report in.
  • Price Source (multichoice, default "pricedb-nearest"): The source of price information.
  • Show Foreign Currencies (boolean, default true): Display any foreign currency amount in an account.
  • Show Exchange Rates (boolean, default false): Show the exchange rates used.

Display

  • Include accounts with zero total balances (boolean, default true): Include accounts with zero total (recursive) balances in this report.
  • Omit zero balance figures (boolean, default false): Show blank space in place of any zero balances which would be shown.
  • Parent account balances (multichoice, default "immediate-bal"): How to show the balances of parent accounts. * Account Balance in the parent account, excluding any subaccounts. * Do not show any balances of parent accounts.
  • Parent account subtotals (multichoice, default "f"): How to show account subtotals for parent accounts. * Show subtotals for selected parent accounts which have subaccounts. * Do not show any subtotals for parent accounts.
  • Display accounts as hyperlinks (boolean, default true): Shows each account in the table as a hyperlink to its register window.
  • Show accounting-style rules (boolean, default false): Use rules beneath columns of added numbers like accountants do.
  • Label the revenue section (boolean, default true): Whether or not to include a label for the revenue section.
  • Include revenue total (boolean, default true): Whether or not to include a line indicating total revenue.
  • Label the trading accounts section (boolean, default true): Whether or not to include a label for the trading accounts section.
  • Include trading accounts total (boolean, default true): Whether or not to include a line indicating total trading accounts balance.
  • Label the expense section (boolean, default true): Whether or not to include a label for the expense section.
  • Include expense total (boolean, default true): Whether or not to include a line indicating total expense.
  • Display as a two column report (boolean, default false): Divides the report into an income column and an expense column.
  • Display in standard, income first, order (boolean, default true): Causes the report to display in the standard order, placing income before expenses.

Entries

  • Closing Entries pattern (string, default "Closing Entries"): Any text in the Description column which identifies closing entries.
  • Closing Entries pattern is case-sensitive (boolean, default false): Causes the Closing Entries Pattern match to be case-sensitive.
  • Closing Entries Pattern is regular expression (boolean, default false): Causes the Closing Entries Pattern to be treated as a regular expression.

General

  • Report name (string, default "Profit & Loss"): Enter a descriptive name for this report.
  • Stylesheet (multichoice, default "Default"): Select a stylesheet for the report.
  • Add options summary (multichoice, default "never"): Add summary of options.
  • Report Title (string, default "Profit & Loss"): Title for this report.
  • Start Date (date, default {"relative":"start-accounting-period"}): Start of reporting period.
  • End Date (date, default {"relative":"end-accounting-period"}): End of reporting period.