class Ledger extends Model implements Segregatable

Class Ledger

Traits

Properties

protected array $fillable

The attributes that are mass assignable.

Entity $entity
Transaction $transaction
Vat $vat
Account $postAccount
Account $folioAccount
LineItem $lineItem
Currency $currency
Carbon $postingDate
string $entryType
float $amount
Carbon $destroyed_at
Carbon $deleted_at

Methods

static void
bootSegregating()

Register EntityScope for Model.

BelongsTo
entity()

Model's Parent Entity.

getTable()

Determine the model table name

static void
post(Transaction $transaction)

Create Ledger entries for the Transaction.

bool
save(array $options = [])

Add Ledger hash.

string
hashed()

Hash Ledger contents

static void
postForex(Assignment $assignment, float $transactionRate, float $clearedRate)

Create Ledger entries for the Assignments' Forex differences.

static float
contribution(Account $account, int $transactionId, int|null $currencyId = null)

Get Account's contribution to the Transaction total amount.

static array
balance(Account $account, Carbon $startDate, Carbon $endDate, int|null $currencyId = null)

Get Account's balance as at the given date.

object
attributes()

Ledger attributes.

BelongsTo
transaction()

Transaction

HasOne
postAccount()

Ledger Post Account.

HasOne
folioAccount()

Ledger Folio Account.

HasOne
currency()

Ledger Folio Account.

BelongsTo
lineItem()

Ledger LineItem.

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 ModelTablePrefix at line 22
getTable()

Determine the model table name

at line 259
static void post(Transaction $transaction)

Create Ledger entries for the Transaction.

Parameters

Transaction $transaction

Return Value

void

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

Add Ledger hash.

Parameters

array $options

Return Value

bool

at line 288
string hashed()

Hash Ledger contents

Return Value

string

at line 318
static void postForex(Assignment $assignment, float $transactionRate, float $clearedRate)

Create Ledger entries for the Assignments' Forex differences.

Parameters

Assignment $assignment
float $transactionRate
float $clearedRate

Return Value

void

at line 363
static float contribution(Account $account, int $transactionId, int|null $currencyId = null)

Get Account's contribution to the Transaction total amount.

Parameters

Account $account
int $transactionId
int|null $currencyId

Return Value

float

at line 393
static array balance(Account $account, Carbon $startDate, Carbon $endDate, int|null $currencyId = null)

Get Account's balance as at the given date.

Parameters

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

Return Value

array

at line 429
object attributes()

Ledger attributes.

Return Value

object

at line 439
BelongsTo transaction()

Transaction

Return Value

BelongsTo

at line 449
HasOne postAccount()

Ledger Post Account.

Return Value

HasOne

at line 459
HasOne folioAccount()

Ledger Folio Account.

Return Value

HasOne

at line 469
HasOne currency()

Ledger Folio Account.

Return Value

HasOne

at line 479
BelongsTo lineItem()

Ledger LineItem.

Return Value

BelongsTo