ModelInvoices module

Invoice

A model in the Invoices module, with 64 members for templates, 55 API properties and 70 members for admin templates.

Invoices\Models\Frontend\Invoice Invoices\Models\Api\Invoice Invoices\Models\Backend\Invoice Also in Invoices: InvoiceCustomFieldValue Item MockPayPaymentMethod PayPalDonatePaymentMethod PayPalPaymentMethod Refund RefundItem StripePaymentMethod Transaction
View
What Smarty and Twig templates receive. Properties in REST API responses and job payloads. What admin screen templates receive when you override them.

Templates view

Properties 55

Take no arguments.

# getSourceRecord()
?Model
Get the source record related to this invoice
# getInitiatingPaymentTransaction()
?Transaction
Get the initiating gateway transaction — the top-level transaction the payment was opened on. Its external id is the gateway reference (e.g. the Stripe PaymentIntent id). Preferred over the capture transaction for that reference: the capture is confirmed asynchronously by webhook as a child of this transaction, and the child carries the webhook event id, not the PaymentIntent id. Errored attempts are skipped so a failed first attempt does not shadow the live transaction.
# getAuthorizedAmountAsMoney()
Money
Gets the authorized amount as a Money object. Represents the sum of authorized amounts across all top-level transactions on the invoice, minus any amounts that were subsequently voided or captured.
# getCapturedAmountAsMoney()
Money
Gets the captured amount as a Money object. Represents the sum of captured amounts across all top-level transactions on the invoice, minus any amounts that were subsequently refunded.
# getVoidedAmountAsMoney()
Money
Gets the voided amount as a Money object. Represents the sum of voided amounts (previously authorized) across all top-level transactions on the invoice.
# getRefundedAmountAsMoney()
Money
Gets the refunded amount as a Money object. Represents the sum of refunded amounts across all top-level transactions on the invoice.
# getSettledAmountAsMoney()
Money
Gets the settled amount as a Money object. Represents the sum of authorized and captured amounts across all top-level transactions on the invoice.
# getOutstandingAmountAsMoney()
Money
Gets the outstanding amount as a Money object. Represents the grand total minus the settled amount — the balance not yet settled.
# getItemTotalAsMoney()
Money
Gets the item total as a Money object. Represents the sum of all items' Amount values.
# getShippingTotalAsMoney()
Money
Gets the shipping total as a Money object. Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# getHandlingTotalAsMoney()
Money
Gets the handling total as a Money object. Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# getInsuranceTotalAsMoney()
Money
Gets the insurance total as a Money object. Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# getDiscountTotalAsMoney()
Money
Gets the discount total as a Money object. Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTaxTotalAsMoney()
Money
Gets the tax total as a Money object. Represents the sum of tax values across all line items, including shipping, handling, etc.
# getSurchargeTotalAsMoney()
Money
Gets the surcharge total as a Money object. Represents the surcharge total.
# getTotalAsMoney()
Money
Gets the grand total as a Money object. Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# getCurrencyCode()
string
Get the currency code
# isOpen()
bool
Is the invoice open?
# isDraft()
bool
Is the invoice in draft status (amount not yet finalized)?
# isPaid()
bool
Is the invoice paid?
# isRefunded()
bool
Is the invoice refunded?
# isVoid()
bool
Is the invoice voided?
# getLineItems()
Collection
Gets all line items
# getDisplayStatus()
string
Get the display friendly status of the invoice
# isRefundable()
bool
Can the invoice be refunded?
# getId()
?int
# getStatus()
?string
# getExternalId()
?string
# getPurchaseOrderNumber()
?string
# getItemTotal()
?string
Represents the sum of all items' Amount values.
# getShippingTotal()
?string
Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# getHandlingTotal()
?string
Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# getInsuranceTotal()
?string
Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# getDiscountTotal()
?string
Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTaxTotal()
?string
Represents the sum of tax values across all line items, including shipping, handling, etc.
# getSurchargeTotal()
?string
Represents the surcharge total.
# getTotal()
?string
Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getTaxCalculated()
?DateTime
# getPaymentMethod()
?BasePaymentMethod
# getBillingAddress()
?Address
# getSourceEntity()
?string
# getSourceRecordId()
?int
# getCurrency()
?Currency
# getPerson()
?Person
# getSite()
?Site
# getItems()
?Collection<Item>
# getTaxTransactions()
?Collection<Transaction>
# getRefunds()
?Collection<Refund>
# getCustomFieldValues()
?Collection<InvoiceCustomFieldValue>
# getCustomFields()
array
Get the custom fields for this entity
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned

Methods 9

Take arguments. The API serialises only getters that need none.

# getCustomFieldValue(CustomField $customField)
?CustomFieldValue
Get the value for a custom field
# getCustomFieldValueByName(string $customFieldName)
?CustomFieldValue
Get the value for a custom field by the custom field name
# getCustomFieldContent(string $customFieldName)
?Content
Get the content for the custom field identified by the specified name
# getCustomFieldContentOrDefault(string $customFieldName)
?Content
Get the (default) content for the custom field identified by the specified name
# getCustomFieldBoolean(string $customFieldName, ?bool $default)
?bool
Get the (default) content of the custom field as boolean value
# getCustomFieldText(string $customFieldName, ?string $default)
?string
Get the (default) content of the custom field as text
# getCustomFieldImage(string $customFieldName)
?Image
Get the (default) image contained in the custom field
# getCustomFieldFile(string $customFieldName)
?File
Get the (default) file contained in the custom field
# hasCustomField(string $customFieldName)
bool
Check if the entity has a custom field with the specified name

API & Jobs view

API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.

Properties 55

Read-only values on the record.

# sourceRecord
?Model
Get the source record related to this invoice
# pendingTransaction Not in Templates
?Transaction
Does the invoice have a pending transaction?
# captureTransaction Not in Templates
?Transaction
Get the capture transaction. This is the transaction which has captured the funds.
# initiatingPaymentTransaction
?Transaction
Get the initiating gateway transaction — the top-level transaction the payment was opened on. Its external id is the gateway reference (e.g. the Stripe PaymentIntent id). Preferred over the capture transaction for that reference: the capture is confirmed asynchronously by webhook as a child of this transaction, and the child carries the webhook event id, not the PaymentIntent id. Errored attempts are skipped so a failed first attempt does not shadow the live transaction.
# authorizedAmountAsMoney
Money
Gets the authorized amount as a Money object. Represents the sum of authorized amounts across all top-level transactions on the invoice, minus any amounts that were subsequently voided or captured.
# capturedAmountAsMoney
Money
Gets the captured amount as a Money object. Represents the sum of captured amounts across all top-level transactions on the invoice, minus any amounts that were subsequently refunded.
# voidedAmountAsMoney
Money
Gets the voided amount as a Money object. Represents the sum of voided amounts (previously authorized) across all top-level transactions on the invoice.
# refundedAmountAsMoney
Money
Gets the refunded amount as a Money object. Represents the sum of refunded amounts across all top-level transactions on the invoice.
# settledAmountAsMoney
Money
Gets the settled amount as a Money object. Represents the sum of authorized and captured amounts across all top-level transactions on the invoice.
# outstandingAmountAsMoney
Money
Gets the outstanding amount as a Money object. Represents the grand total minus the settled amount — the balance not yet settled.
# itemTotalAsMoney
Money
Gets the item total as a Money object. Represents the sum of all items' Amount values.
# shippingTotalAsMoney
Money
Gets the shipping total as a Money object. Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# handlingTotalAsMoney
Money
Gets the handling total as a Money object. Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# insuranceTotalAsMoney
Money
Gets the insurance total as a Money object. Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# discountTotalAsMoney
Money
Gets the discount total as a Money object. Represents the sum of discount values across all line items, including shipping, handling, etc.
# taxTotalAsMoney
Money
Gets the tax total as a Money object. Represents the sum of tax values across all line items, including shipping, handling, etc.
# surchargeTotalAsMoney
Money
Gets the surcharge total as a Money object. Represents the surcharge total.
# totalAsMoney
Money
Gets the grand total as a Money object. Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# currencyCode
string
Get the currency code
# open
bool
Is the invoice open?
# draft
bool
Is the invoice in draft status (amount not yet finalized)?
# paid
bool
Is the invoice paid?
# refunded
bool
Is the invoice refunded?
# void
bool
Is the invoice voided?
# lineItems
Collection
Gets all line items
# displayStatus
string
Get the display friendly status of the invoice
# refundable
bool
Can the invoice be refunded?
# id
?int
# status
?string
# externalId
?string
# purchaseOrderNumber
?string
# itemTotal
?string
Represents the sum of all items' Amount values.
# shippingTotal
?string
Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# handlingTotal
?string
Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# insuranceTotal
?string
Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# discountTotal
?string
Represents the sum of discount values across all line items, including shipping, handling, etc.
# taxTotal
?string
Represents the sum of tax values across all line items, including shipping, handling, etc.
# surchargeTotal
?string
Represents the surcharge total.
# total
?string
Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# taxCalculated
?DateTime
# paymentMethod
?BasePaymentMethod
# billingAddress
?Address
# sourceEntity
?string
# sourceRecordId
?int
# currency
?Currency
# person
?Person
# site
?Site
# items
?Collection<Item>
# transactions Not in Templates
?Collection<Transaction>
# taxTransactions
?Collection<Transaction>
# refunds
?Collection<Refund>
# customFieldValues
?Collection<InvoiceCustomFieldValue>
# customFields
array
Get the custom fields for this entity

Admin view

AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.

Properties 61

Take no arguments.

# getSourceRecord()
?Model
Get the source record related to this invoice
# getPendingTransaction() Not in Templates
?Transaction
Does the invoice have a pending transaction?
# getCaptureTransaction() Not in Templates
?Transaction
Get the capture transaction. This is the transaction which has captured the funds.
# getInitiatingPaymentTransaction()
?Transaction
Get the initiating gateway transaction — the top-level transaction the payment was opened on. Its external id is the gateway reference (e.g. the Stripe PaymentIntent id). Preferred over the capture transaction for that reference: the capture is confirmed asynchronously by webhook as a child of this transaction, and the child carries the webhook event id, not the PaymentIntent id. Errored attempts are skipped so a failed first attempt does not shadow the live transaction.
# getAuthorizedAmountAsMoney()
Money
Gets the authorized amount as a Money object. Represents the sum of authorized amounts across all top-level transactions on the invoice, minus any amounts that were subsequently voided or captured.
# getCapturedAmountAsMoney()
Money
Gets the captured amount as a Money object. Represents the sum of captured amounts across all top-level transactions on the invoice, minus any amounts that were subsequently refunded.
# getVoidedAmountAsMoney()
Money
Gets the voided amount as a Money object. Represents the sum of voided amounts (previously authorized) across all top-level transactions on the invoice.
# getRefundedAmountAsMoney()
Money
Gets the refunded amount as a Money object. Represents the sum of refunded amounts across all top-level transactions on the invoice.
# getSettledAmountAsMoney()
Money
Gets the settled amount as a Money object. Represents the sum of authorized and captured amounts across all top-level transactions on the invoice.
# getOutstandingAmountAsMoney()
Money
Gets the outstanding amount as a Money object. Represents the grand total minus the settled amount — the balance not yet settled.
# getItemTotalAsMoney()
Money
Gets the item total as a Money object. Represents the sum of all items' Amount values.
# getShippingTotalAsMoney()
Money
Gets the shipping total as a Money object. Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# getHandlingTotalAsMoney()
Money
Gets the handling total as a Money object. Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# getInsuranceTotalAsMoney()
Money
Gets the insurance total as a Money object. Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# getDiscountTotalAsMoney()
Money
Gets the discount total as a Money object. Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTaxTotalAsMoney()
Money
Gets the tax total as a Money object. Represents the sum of tax values across all line items, including shipping, handling, etc.
# getSurchargeTotalAsMoney()
Money
Gets the surcharge total as a Money object. Represents the surcharge total.
# getTotalAsMoney()
Money
Gets the grand total as a Money object. Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# getCurrencyCode()
string
Get the currency code
# isOpen()
bool
Is the invoice open?
# isDraft()
bool
Is the invoice in draft status (amount not yet finalized)?
# isPaid()
bool
Is the invoice paid?
# isRefunded()
bool
Is the invoice refunded?
# isVoid()
bool
Is the invoice voided?
# getLineItems()
Collection
Gets all line items
# getDisplayStatus()
string
Get the display friendly status of the invoice
# isRefundable()
bool
Can the invoice be refunded?
# getId()
?int
# getStatus()
?string
# getExternalId()
?string
# getPurchaseOrderNumber()
?string
# getItemTotal()
?string
Represents the sum of all items' Amount values.
# getShippingTotal()
?string
Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# getHandlingTotal()
?string
Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# getInsuranceTotal()
?string
Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# getDiscountTotal()
?string
Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTaxTotal()
?string
Represents the sum of tax values across all line items, including shipping, handling, etc.
# getSurchargeTotal()
?string
Represents the surcharge total.
# getTotal()
?string
Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getTaxCalculated()
?DateTime
# getPaymentMethod()
?BasePaymentMethod
# getBillingAddress()
?Address
# getSourceEntity()
?string
# getSourceRecordId()
?int
# getCurrency()
?Currency
# getPerson()
?Person
# getSite()
?Site
# getItems()
?Collection<Item>
# getTransactions() Not in Templates
?Collection<Transaction>
# getTaxTransactions()
?Collection<Transaction>
# getRefunds()
?Collection<Refund>
# getCustomFieldValues()
?Collection<InvoiceCustomFieldValue>
# getCustomFields()
array
Get the custom fields for this entity
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned
# getManageUrl() Admin only
?string
Get the url for managing records.
# getShowUrl() Admin only
?string
Get the url for exporting a pdf for the record.

Methods 9

Take arguments. The API serialises only getters that need none.

# getCustomFieldValue(CustomField $customField)
?CustomFieldValue
Get the value for a custom field
# getCustomFieldValueByName(string $customFieldName)
?CustomFieldValue
Get the value for a custom field by the custom field name
# getCustomFieldContent(string $customFieldName)
?Content
Get the content for the custom field identified by the specified name
# getCustomFieldContentOrDefault(string $customFieldName)
?Content
Get the (default) content for the custom field identified by the specified name
# getCustomFieldBoolean(string $customFieldName, ?bool $default)
?bool
Get the (default) content of the custom field as boolean value
# getCustomFieldText(string $customFieldName, ?string $default)
?string
Get the (default) content of the custom field as text
# getCustomFieldImage(string $customFieldName)
?Image
Get the (default) image contained in the custom field
# getCustomFieldFile(string $customFieldName)
?File
Get the (default) file contained in the custom field
# hasCustomField(string $customFieldName)
bool
Check if the entity has a custom field with the specified name