class Balance extends Model implements Recyclable, Clearable, Segregatable

Class Balance

Traits

Constants

MODELNAME

Balance Model Name

DEBIT

Balance Type

CREDIT

Properties

protected array $fillable

The attributes that are mass assignable.

Entity $entity
Account $account
Currency $currency
ExchangeRate $exchangeRate
int $year
string $reference
string $transaction_no
string $transaction_type
string $balance_type
float $total_amount
float $balance
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.

getClearedAmountAttribute()

Cleared Transaction amount.

from  Clearing
float
clearedAmountAsAt(Carbon $date)

Cleared Transaction amount as at the end of the given date.

from  Clearing
HasMany
clearances()

Cleared Model records.

from  Clearing
getTable()

Determine the model table name

__construct($attributes = [])

Construct new Balance.

static string
getType(string $type)

Get Human Readable Balance Type.

static array
getTypes(array $types)

Get Human Readable Balance types

string
toString($type = false)

Instance Identifier.

string
getTypeAttribute()

Instance Type Translator.

string
getTransactionAttribute()

Instance Transaction Type Translator.

bool
getIsPostedAttribute()

is_posted analog for Assignment model.

bool
getIsCreditedAttribute()

is_credited analog for Assignment model.

string
getClearedTypeAttribute()

cleared_type analog for Assignment model.

float
getAmountAttribute()

amount analog for Assignment model.

BelongsTo
currency()

Balance Currency.

BelongsTo
account()

Balance Account.

BelongsTo
exchangeRate()

Balance Exchange Rate.

BelongsTo
reportingPeriod()

Balance Reporting Period.

object
attributes()

Balance attributes.

bool
save(array $options = [])

Balance Validation.

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 Clearing at line 26
getClearedAmountAttribute()

Cleared Transaction amount.

in Clearing at line 45
float clearedAmountAsAt(Carbon $date)

Cleared Transaction amount as at the end of the given date.

Parameters

Carbon $date

Return Value

float

in Clearing at line 62
HasMany clearances()

Cleared Model records.

Matched on cleared_type and not the class, which for a Transaction subclass such as a ClientInvoice is not the type its clearances are stored under.

Return Value

HasMany

in ModelTablePrefix at line 22
getTable()

Determine the model table name

at line 102
__construct($attributes = [])

Construct new Balance.

Parameters

$attributes

at line 122
static string getType(string $type)

Get Human Readable Balance Type.

Parameters

string $type

Return Value

string

at line 134
static array getTypes(array $types)

Get Human Readable Balance types

Parameters

array $types

Return Value

array

at line 149
string toString($type = false)

Instance Identifier.

Parameters

$type

Return Value

string

at line 161
string getTypeAttribute()

Instance Type Translator.

Return Value

string

at line 171
string getTransactionAttribute()

Instance Transaction Type Translator.

Return Value

string

at line 179
bool getIsPostedAttribute()

is_posted analog for Assignment model.

Return Value

bool

at line 189
bool getIsCreditedAttribute()

is_credited analog for Assignment model.

Return Value

bool

at line 199
string getClearedTypeAttribute()

cleared_type analog for Assignment model.

Return Value

string

at line 209
float getAmountAttribute()

amount analog for Assignment model.

Return Value

float

at line 219
BelongsTo currency()

Balance Currency.

Return Value

BelongsTo

at line 229
BelongsTo account()

Balance Account.

Return Value

BelongsTo

at line 239
BelongsTo exchangeRate()

Balance Exchange Rate.

Return Value

BelongsTo

at line 249
BelongsTo reportingPeriod()

Balance Reporting Period.

Return Value

BelongsTo

at line 259
object attributes()

Balance attributes.

Return Value

object

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

Balance Validation.

Parameters

array $options

Return Value

bool