Transaction
class Transaction extends Model implements Segregatable, Recyclable, Clearable, Assignable
Class Transaction
Traits
Constants
| MODELNAME |
Transaction Model Name |
| CS |
Transaction Types |
| IN |
|
| CN |
|
| RC |
|
| CP |
|
| BL |
|
| DN |
|
| PY |
|
| CE |
|
| JN |
|
Properties
| protected array | $fillable | The attributes that are mass assignable. |
|
| protected | $dates | ||
| protected array | $compoundEntries | Compound Ledger entries for the transaction |
|
| Entity | $entity | ||
| ExchangeRate | $exchangeRate | ||
| Account | $account | ||
| Currency | $currency | ||
| Carbon | $transaction_date | ||
| string | $reference | ||
| string | $transaction_no | ||
| string | $transaction_type | ||
| string | $narration | ||
| bool | $credited | ||
| bool | $compound | ||
| float | $amount | ||
| float | $main_account_amount | ||
| Carbon | $destroyed_at | ||
| Carbon | $deleted_at |
Methods
Cleared Transaction amount as at the end of the given date.
Add Compound Entry to Transaction CompoundEntries.
Construct new Transaction.
Get Transaction Class
Get Human Readable Transaction types
Get Human Readable Transaction type
Instance Identifier.
Transaction Ledgers.
Transaction Currency.
Transaction Account.
Transaction Exchange Rate.
Transaction Assignments.
Transaction Saved Line Items.
The model attached to the transaction.
Instance Type Translator.
is_posted analog for Assignment model.
is_credited analog for Assignment model.
cleared_type analog for Assignment model.
amount analog for Assignment model.
Get Transaction CompoundEntries.
Get Transaction LineItems.
Total Vat amount of the transaction.
Transaction is assignable predicate.
Transaction is clearable predicate.
Transaction date.
Transaction attributes.
Get this Transaction's assigned Transactions.
Add Transaction to this Transaction's assigned Transactions.
Create assignments for the assigned transactions being staged.
Post Transaction to the Ledger.
Relate LineItems to Transaction.
The next Transaction number for the transaction type and transaction_date.
Check Transaction Relationships.
Check Transaction Integrity.
Details
in
Segregating at line 28
static void
bootSegregating()
Register EntityScope for Model.
in
Segregating at line 46
BelongsTo
entity()
Model's Parent Entity.
in
Recycling at line 28
static void
bootRecycling()
Model recycling events.
in
Recycling at line 73
MorphMany
recycled()
Recycled Model records.
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.
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.
in
Assigning at line 18
getBalanceAttribute()
Balance Remaining on Transaction.
in
ModelTablePrefix at line 22
getTable()
Determine the model table name
at line 210
protected void
addCompoundEntry(array $compoundEntry, bool $credited)
Add Compound Entry to Transaction CompoundEntries.
at line 218
__construct($attributes = [])
Construct new Transaction.
at line 233
static string
getClass(string $type)
Get Transaction Class
at line 256
static array
getTypes(array $types)
Get Human Readable Transaction types
at line 273
static string
getType(string $type)
Get Human Readable Transaction type
at line 283
string
toString($type = false)
Instance Identifier.
at line 294
HasMany
ledgers()
Transaction Ledgers.
at line 304
BelongsTo
currency()
Transaction Currency.
at line 314
BelongsTo
account()
Transaction Account.
at line 324
BelongsTo
exchangeRate()
Transaction Exchange Rate.
at line 334
HasMany
assignments()
Transaction Assignments.
at line 344
HasMany
lineItems()
Transaction Saved Line Items.
at line 354
MorphTo
attachment()
The model attached to the transaction.
at line 364
string
getTypeAttribute()
Instance Type Translator.
at line 372
bool
getIsPostedAttribute()
is_posted analog for Assignment model.
at line 382
bool
getIsCreditedAttribute()
is_credited analog for Assignment model.
at line 392
string
getClearedTypeAttribute()
cleared_type analog for Assignment model.
at line 402
float
getAmountAttribute()
amount analog for Assignment model.
at line 440
array
getCompoundEntries()
Get Transaction CompoundEntries.
at line 464
array
getLineItems()
Get Transaction LineItems.
at line 479
array
getVatAttribute()
Total Vat amount of the transaction.
at line 498
bool
getAssignableAttribute()
Transaction is assignable predicate.
at line 508
bool
getClearableAttribute()
Transaction is clearable predicate.
at line 518
string
getDateAttribute()
Transaction date.
at line 528
object
attributes()
Transaction attributes.
at line 538
bool
addLineItem(LineItem $lineItem)
Add LineItem to Transaction LineItems.
at line 570
void
removeLineItem(LineItem $lineItem)
Remove LineItem from Transaction LineItems.
at line 604
array
getAssigned()
Get this Transaction's assigned Transactions.
at line 614
void
addAssigned(array $toBeAssigned)
Add Transaction to this Transaction's assigned Transactions.
at line 659
void
processAssigned(int|null $forexAccountId = null)
Create assignments for the assigned transactions being staged.
at line 678
void
post()
Post Transaction to the Ledger.
at line 698
bool
save(array $options = [])
Relate LineItems to Transaction.
at line 775
static string
transactionNo(string $type, Carbon|null $transaction_date = null, Entity|null $entity = null)
The next Transaction number for the transaction type and transaction_date.
at line 812
bool
delete()
Check Transaction Relationships.
at line 838
bool
getHasIntegrityAttribute()
Check Transaction Integrity.