class Account extends Model implements Recyclable, Segregatable

Class Account

Traits

Constants

NON_CURRENT_ASSET

Account Type.

CONTRA_ASSET

INVENTORY

BANK

CURRENT_ASSET

RECEIVABLE

NON_CURRENT_LIABILITY

CONTROL

CURRENT_LIABILITY

PAYABLE

EQUITY

OPERATING_REVENUE

OPERATING_EXPENSE

NON_OPERATING_REVENUE

DIRECT_EXPENSE

OVERHEAD_EXPENSE

OTHER_EXPENSE

RECONCILIATION

PURCHASABLES

Purchaseable Account Types

Properties

protected array $fillable

The attributes that are mass assignable.

Entity $entity
Category $category
Currency $currency
int|null $code
string $name
string $description
string $account_type
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

static array
getTypes(array $types)

Get Human Readable Account types

static string
getType(string $type)

Get Human Readable Account Type.

static array
openingBalances(int $year, Entity|null $entity = null)

Get all accounts with opening balances for the given year

static array
sectionBalances(array $accountTypes, string|Carbon $startDate = null, string|Carbon $endDate = null, bool $fullBalance = true, Entity|null $entity = null)

Chart of Account Section Balances for the Reporting Period.

string
getTypeAttribute()

Instance Type.

string
toString($type = false)

Instance Identifier.

BelongsTo
currency()

Account Currency.

BelongsTo
category()

Account Category.

HasMany
balances()

Account Balances.

object
attributes()

Account attributes.

array
closingBalance(string|null $endDate = null, int|null $currencyId = null)

Get Account's Closing Balances for the Reporting Period.

array
openingBalance(int|null $year = null, int|null $currencyId = null)

Get Account's Opening Balances for the Reporting Period.

array
currentBalance(Carbon|null $startDate = null, Carbon|null $endDate = null, int|null $currencyId = null)

Get Account's Current Balances for the Period given, both of its days included.

bool
isClosed(int|null $year = null)

Check if the account has closing transactions.

array
closingTransactions(int|null $year = null)

Get the account's has closing transactions.

array
getTransactions(string|null $startDate = null, string|null $endDate = null)

Get Account's Transactions for the Reporting Period.

Builder
transactionsQuery(Carbon $startDate, Carbon $endDate, int|null $currencyId = null)

Account Transactions Query

bool
save(array $options = [])

Validate Account.

bool
delete()

Check for Current Year Transactions.

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 117
static array getTypes(array $types)

Get Human Readable Account types

Parameters

array $types

Return Value

array

at line 134
static string getType(string $type)

Get Human Readable Account Type.

Parameters

string $type

Return Value

string

at line 147
static array openingBalances(int $year, Entity|null $entity = null)

Get all accounts with opening balances for the given year

Parameters

int $year
Entity|null $entity

Return Value

array

at line 183
static array sectionBalances(array $accountTypes, string|Carbon $startDate = null, string|Carbon $endDate = null, bool $fullBalance = true, Entity|null $entity = null)

Chart of Account Section Balances for the Reporting Period.

Parameters

array $accountTypes
string|Carbon $startDate
string|Carbon $endDate
bool $fullBalance
Entity|null $entity

Return Value

array

at line 258
string getTypeAttribute()

Instance Type.

Return Value

string

at line 268
string toString($type = false)

Instance Identifier.

Parameters

$type

Return Value

string

at line 278
BelongsTo currency()

Account Currency.

Return Value

BelongsTo

at line 288
BelongsTo category()

Account Category.

Return Value

BelongsTo

at line 298
HasMany balances()

Account Balances.

Return Value

HasMany

at line 308
object attributes()

Account attributes.

Return Value

object

at line 322
array closingBalance(string|null $endDate = null, int|null $currencyId = null)

Get Account's Closing Balances for the Reporting Period.

Parameters

string|null $endDate
int|null $currencyId

Return Value

array

at line 345
array openingBalance(int|null $year = null, int|null $currencyId = null)

Get Account's Opening Balances for the Reporting Period.

Parameters

int|null $year
int|null $currencyId

Return Value

array

at line 391
array currentBalance(Carbon|null $startDate = null, Carbon|null $endDate = null, int|null $currencyId = null)

Get Account's Current Balances for the Period given, both of its days included.

Parameters

Carbon|null $startDate
Carbon|null $endDate
int|null $currencyId

Return Value

array

at line 406
bool isClosed(int|null $year = null)

Check if the account has closing transactions.

Parameters

int|null $year

Return Value

bool

at line 443
array closingTransactions(int|null $year = null)

Get the account's has closing transactions.

Parameters

int|null $year

Return Value

array

at line 481
array getTransactions(string|null $startDate = null, string|null $endDate = null)

Get Account's Transactions for the Reporting Period.

Parameters

string|null $startDate
string|null $endDate

Return Value

array

at line 499
Builder transactionsQuery(Carbon $startDate, Carbon $endDate, int|null $currencyId = null)

Account Transactions Query

Parameters

Carbon $startDate
Carbon $endDate
int|null $currencyId

Return Value

Builder

at line 539
bool save(array $options = [])

Validate Account.

Parameters

array $options

Return Value

bool

at line 593
bool delete()

Check for Current Year Transactions.

Return Value

bool