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