Reporting Periods

Reporting periods corresponds to the financial years of the entity’s operations. They are used to identify reports generated by the package.

A financial year is labelled by the calendar year it starts in. For an entity with a year_start of 7, the reporting period with a calendar_year of 2025 runs from 1 July 2025 to 30 June 2026, and methods that take a $year, such as $account->openingBalance($year), expect that same label. (See Entities).

Attributes

  • period_count: The period count is an integer that indicates the number of periods the entity has been in operation. It serves as an index to transaction numbers for easy identification and tracing.
  • calendar_year: The calendar year the reporting period starts in.
  • status: The status of the period. Defaults to ReportingPeriod::OPEN.
  • entity: The Entity associated with the reporting period. Defaults to the entity of the logged in user.
  • closingRates: The closing exchange rates for currencies used in transactions during the period.
  • closingTransactions: The translation transactions for foreign currency accounts for the period.

Methods

  • $reportingPeriod->toString(): The string representation of the Reporting Period object instance.
  • ReportingPeriod::getPeriod($date): Retrieves the reporting period of the date given, and if none is given of the current date.
  • ReportingPeriod::year($date): Retrieves the calendar_year of the reporting period of the date given, and if none is given of the current date.
  • ReportingPeriod::yearStart($year): Retrieves the first date of the reporting period with the given calendar_year.
  • ReportingPeriod::periodStart($date): Retrieves the first date of the reporting period for the date given, and if none is given of the current date.
  • ReportingPeriod::periodEnd($date): Retrieves the last date of the reporting period for the date given, and if none is given of the current date.
  • $reportingPeriod->attributes(): Presents the reporting period’s attributes as an object. Useful for debugging.
  • $reportingPeriod->transactionCurrencies(): Retrieves all foreign currencies used in the entity’s transactions within the period.
  • $reportingPeriod->prepareBalancesTranslation() Create the foreign currency translation transactions for the period.
  • $reportingPeriod->getTranslations(): Retrieves all foreign currency translation transactions for the period.
  • $reportingPeriod->postTranslations(): Commits all foreign currency translation transactions for the period to the ledger.

Constants

  • ReportingPeriod::OPEN: An open reporting period is one that is currently having transactions posted in it.
  • ReportingPeriod::CLOSED: A closed reporting period is one which has been audited and therefore does not allow any more transactions to be posted.
  • ReportingPeriod::ADJUSTING: During the adjusting status of a period only transactions that adjust the figures in the reports for audit purposes may be posted.

Constraints

  • MissingReportingPeriod: The Entity does not have a reporting period for the date given.
  • EntityMismatch: A reporting period was requested for an entity other than that of the logged in user.
  • InvalidAccountType: The account specified for posting forex translations must be of type Account::EQUITY (Other Comprehensive Income).
  • InvalidPeriodStatus: Forex translations can only be performed for a reporting period that is in the adjusting stage.
  • MissingClosingRate: The currency does not have a closing rate.
  • DuplicateClosingRate: A currency can only have one closing rate for a reporting period.