class Ledger extends Model implements Segragatable

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
Carbon $date
string $entry_type
float $amount
Carbon $destroyed_at
Carbon $deleted_at

Methods

static null
bootSegragating()

Register EntityScope for Model.

HasOne
entity()

Model's Parent Entity.

getTable()

Determine the model table name

static void
post(Transaction $transaction)

Create Ledger entries for the Transaction.

object
attributes()

Ledger attributes.

BelongsTo
transaction()

Transaction

HasOne
postAccount()

Ledger Post Account.

HasOne
folioAccount()

Ledger Folio Account.

BelongsTo
lineItem()

Ledger LineItem.

string
hashed()

Hash Ledger contents

bool
save(array $options = [])

Add Ledger hash.

static float
contribution(Account $account, int $transactionId)

Get Account's contribution to the Transaction total amount.

static float
balance(Account $account, Carbon $startDate, Carbon $endDate)

Get Account's balance as at the given date.

Details

in Segragating at line 29
static null bootSegragating()

Register EntityScope for Model.

Return Value

null

in Segragating at line 54
HasOne entity()

Model's Parent Entity.

Return Value

HasOne

in ModelTablePrefix at line 20
getTable()

Determine the model table name

at line 96
static void post(Transaction $transaction)

Create Ledger entries for the Transaction.

Parameters

Transaction $transaction

Return Value

void

at line 139
object attributes()

Ledger attributes.

Return Value

object

at line 149
BelongsTo transaction()

Transaction

Return Value

BelongsTo

at line 159
HasOne postAccount()

Ledger Post Account.

Return Value

HasOne

at line 169
HasOne folioAccount()

Ledger Folio Account.

Return Value

HasOne

at line 179
BelongsTo lineItem()

Ledger LineItem.

Return Value

BelongsTo

at line 189
string hashed()

Hash Ledger contents

Return Value

string

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

Add Ledger hash.

Parameters

array $options

Return Value

bool

at line 235
static float contribution(Account $account, int $transactionId)

Get Account's contribution to the Transaction total amount.

Parameters

Account $account
int $transactionId

Return Value

float

at line 262
static float balance(Account $account, Carbon $startDate, Carbon $endDate)

Get Account's balance as at the given date.

Parameters

Account $account
Carbon $startDate
Carbon $endDate

Return Value

float