Invoice
Constants
STATUS_DRAFT |
|
STATUS_UNPAID |
|
STATUS_PAID |
|
Properties summary
Type | Property | Description | |
---|---|---|---|
protected | $table | ||
protected | $dates | ||
protected | $columnMap | ||
$timestamps | |||
protected | $appends |
Methods summary
Return Type | Method Name | Description | |
---|---|---|---|
static | boot() | - | |
BelongsTo | client() | Each invoice belongs to one client. | |
hasMany | transactions() | Each invoice can have many transactions. | |
HasMany | items() | Each invoice can have many line items. | |
hasOne | snapshot() | Each invoice can have one set of invoice snapshot data. | |
BelongsTo | order() | An invoice can belong to a single order. | |
Builder | scopeUnpaid(Builder $query) | Where status is unpaid. | |
Builder | scopeOverdue(Builder $query) | Where status is overdue. | |
Builder | scopePaid(Builder $query) | Where status is paid. | |
Builder | scopeCancelled(Builder $query) | Where status is cancelled. | |
Builder | scopeRefunded(Builder $query) | Where status is refunded. | |
Builder | scopeCollections(Builder $query) | Where status is collections. | |
Builder | scopePaymentPending(Builder $query) | Where status is collections. | |
Builder | scopeMassPay(Builder $query, bool $isMassPay = true) | Where the invoice does not contain a line item that is of type "Invoice". | |
Builder | scopeWithLastCaptureAttempt(Builder $query, Carbon $date) | Where the last capture date is on a specific date | |
float | getBalanceAttribute() | Calculate balance remaining for the invoice. | |
string | getPaymentGatewayNameAttribute() | - | |
float | getAmountPaidAttribute() | - | |
bool | addPayment(float $amount, string $transactionId = '', float $fees = 0.0, string $gateway = '', bool $noEmail = false, Carbon $date = null) | - | |
array | getBillingValues() | - | |
bool | shouldRenewRun(integer $relatedId, string $registrationDate, string $type = 'Hosting') | Checks if the module renewal should run for a provided related id, registration date and type of item. | |
Vat | vat() | - | |
static Invoice | newInvoice(integer $clientId, string $gateway = null, float $taxRate1 = null, float $taxRate2 = null) | Create a new invoice in Draft and return the instance to be updated and saved. | |
Invoice | setStatusUnpaid() | Set invoice status to unpaid. | |
hasOne | data() | Each invoice can have one set of invoice data. | |
HasMany|History[] | transactionHistory() | - | |
BelongsTo|Model | payMethod() | - | |
string | getPayMethodRemoteToken() | - | |
setPayMethodRemoteToken($remoteToken) | - | ||
deletePayMethod() | - | ||
convertLocalCardToRemote($remoteToken) | - | ||
convertLocalBankAccountToRemote($remoteToken) | - | ||
saveRemoteCard($cardLastFour, $cardType, $expiryDate, $remoteToken) | - | ||
saveRemoteBankAccount($bankName, $remoteToken) | - |
Details
static
boot ()
BelongsTo
client ()
Each invoice belongs to one client.
hasMany
transactions ()
Each invoice can have many transactions.
HasMany
items ()
Each invoice can have many line items.
hasOne
snapshot ()
Each invoice can have one set of invoice snapshot data.
BelongsTo
order ()
An invoice can belong to a single order.
Builder
scopeUnpaid (Builder $query)
Where status is unpaid.
Builder
scopeOverdue (Builder $query)
Where status is overdue.
Builder
scopePaid (Builder $query)
Where status is paid.
Builder
scopeCancelled (Builder $query)
Where status is cancelled.
Builder
scopeRefunded (Builder $query)
Where status is refunded.
Builder
scopeCollections (Builder $query)
Where status is collections.
Builder
scopePaymentPending (Builder $query)
Where status is collections.
Builder
scopeMassPay (Builder $query, bool $isMassPay = true)
Where the invoice does not contain a line item that is of type "Invoice".
Builder
scopeWithLastCaptureAttempt (Builder $query, Carbon $date)
Where the last capture date is on a specific date
float
getBalanceAttribute ()
Calculate balance remaining for the invoice.
string
getPaymentGatewayNameAttribute ()
float
getAmountPaidAttribute ()
bool
addPayment (float $amount, string $transactionId = '', float $fees = 0.0, string $gateway = '', bool $noEmail = false, Carbon $date = null)
array
getBillingValues ()
bool
shouldRenewRun (integer $relatedId, string $registrationDate, string $type = 'Hosting')
Checks if the module renewal should run for a provided related id, registration date and type of item.
Vat
vat ()
static Invoice
newInvoice (integer $clientId, string $gateway = null, float $taxRate1 = null, float $taxRate2 = null)
Create a new invoice in Draft and return the instance to be updated and saved.
Invoice
setStatusUnpaid ()
Set invoice status to unpaid.
hasOne
data ()
Each invoice can have one set of invoice data.