class ReportingPeriod extends Model implements Segregatable, Recyclable

Class ReportingPeriod

Traits

Constants

OPEN

Reporting Period Status

CLOSED

ADJUSTING

Properties

protected array $fillable

The attributes that are mass assignable.

Entity $entity
int $year
int $period_count
string $status
Carbon $destroyed_at
Carbon $deleted_at

Methods

static void
bootSegregating()

Register EntityScope for Model.

BelongsTo
entity()

Model's Parent Entity.

static void
bootRecycling()

Model recycling events.

MorphMany
recycled()

Recycled Model records.

getTable()

Determine the model table name

__construct($attributes = [])

Construct new Reporting Period.

static ReportingPeriod
getPeriod(string|Carbon $date = null, Entity|null $entity = null)

Fetch reporting period for the date

static int
year(string|Carbon $date = null, Entity|null $entity = null)

ReportingPeriod year

static Carbon
yearStart(int $year, Entity|null $entity = null)

First day of the financial year that the calendar year labels. A financial year is labelled by the calendar year it starts in.

string
toString($type = false)

Instance Identifier.

HasMany
closingRates()

Closing Rates.

HasMany
closingTransactions()

Closing Transactions.

object
attributes()

ReportingPeriod attributes.

array
getTranslations()

Get the auto generated translation transactions for the period.

void
postTranslations()

Commit the auto generated translation transactions for the period to the ledger.

array
prepareBalancesTranslation(int $forexAccountId, int|null $accountId = null)

Prepare Forex Account Balances translations.

collection
transactionCurrencies(int $accountId = null)

Retrieve the currencies used in trasactions for the period.

static Carbon
periodEnd($date = null, Entity|null $entity = null)

ReportingPeriod end date

static Carbon
periodStart($date = null, Entity|null $entity = null)

ReportingPeriod start date

Details

in Segregating at line 28
static void bootSegregating()

Register EntityScope for Model.

Return Value

void

in Segregating at line 46
BelongsTo entity()

Model's Parent Entity.

Return Value

BelongsTo

in Recycling at line 28
static void bootRecycling()

Model recycling events.

Return Value

void

in Recycling at line 73
MorphMany recycled()

Recycled Model records.

Return Value

MorphMany

in ModelTablePrefix at line 22
getTable()

Determine the model table name

at line 79
__construct($attributes = [])

Construct new Reporting Period.

Parameters

$attributes

at line 93
static ReportingPeriod getPeriod(string|Carbon $date = null, Entity|null $entity = null)

Fetch reporting period for the date

Parameters

string|Carbon $date
Entity|null $entity

Return Value

ReportingPeriod

at line 118
static int year(string|Carbon $date = null, Entity|null $entity = null)

ReportingPeriod year

Parameters

string|Carbon $date
Entity|null $entity

Return Value

int

at line 145
static Carbon yearStart(int $year, Entity|null $entity = null)

First day of the financial year that the calendar year labels. A financial year is labelled by the calendar year it starts in.

Parameters

int $year
Entity|null $entity

Return Value

Carbon

at line 159
string toString($type = false)

Instance Identifier.

Parameters

$type

Return Value

string

at line 170
HasMany closingRates()

Closing Rates.

Return Value

HasMany

at line 180
HasMany closingTransactions()

Closing Transactions.

Return Value

HasMany

at line 190
object attributes()

ReportingPeriod attributes.

Return Value

object

at line 200
array getTranslations()

Get the auto generated translation transactions for the period.

Return Value

array

at line 236
void postTranslations()

Commit the auto generated translation transactions for the period to the ledger.

Return Value

void

at line 255
array prepareBalancesTranslation(int $forexAccountId, int|null $accountId = null)

Prepare Forex Account Balances translations.

Parameters

int $forexAccountId
int|null $accountId

Return Value

array $transactions

at line 320
collection transactionCurrencies(int $accountId = null)

Retrieve the currencies used in trasactions for the period.

Parameters

int $accountId

Return Value

collection

at line 348
static Carbon periodEnd($date = null, Entity|null $entity = null)

ReportingPeriod end date

Parameters

$date
Entity|null $entity

Return Value

Carbon

at line 360
static Carbon periodStart($date = null, Entity|null $entity = null)

ReportingPeriod start date

Parameters

$date
Entity|null $entity

Return Value

Carbon $date