ModelInvoices module

Item

A model in the Invoices module, with 30 members for templates, 27 API properties and 30 members for admin templates.

Invoices\Models\Frontend\Item Invoices\Models\Api\Item Invoices\Models\Backend\Item Also in Invoices: Invoice InvoiceCustomFieldValue 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 30

Take no arguments.

# getCurrency()
Currency
Get the currency
# getUnitAmountAsMoney()
Money
Gets the amount for a single unit (quantity = 1) as a Money object. Represents the value per unit before tax and discount are applied.
# getUnitDiscountAsMoney()
Money
Gets the discount for a single unit (quantity = 1) as a Money object. Represents the discount value per unit.
# getUnitTaxAsMoney()
Money
Gets the tax for a single unit (quantity = 1) as a Money object. Represents the tax value per unit.
# getUnitTotalAsMoney()
Money
Gets the total for a single unit (quantity = 1) as a Money object. Represents the final value per unit calculated as Unit Amount - Unit Discount + Unit Tax.
# getAmountAsMoney()
Money
Gets the amount for the entire quantity as a Money object. Represents the value before applying tax and discount (Unit Amount × Quantity).
# getDiscountAsMoney()
Money
Gets the discount for the entire quantity as a Money object. Represents the total discount applied (Unit Discount × Quantity).
# getTaxAsMoney()
Money
Gets the tax for the entire quantity as a Money object. Represents the total tax calculated (Unit Tax × Quantity).
# getTotalAsMoney()
Money
Gets the total for the entire quantity as a Money object. Represents the final value calculated as Amount - Discount + Tax.
# getQuantityRefunded()
int
Get the quantity refunded
# getPendingOrSuccessfullyRefundedItems()
array
Get the pending or successfully refunded items
# isTaxableType()
bool
Could this item be taxed?
# isRefundableType()
bool
Is this item type eligible to be included in a refund? Type-level check only — independent of the parent invoice's refundability state (see {@see \Invoices\Models\Invoice::isRefundable()} for that).
# getId()
?int
# getType()
?string
# getCode()
?string
# getText()
?string
# getQuantity()
?int
# getQuantityUnit()
?string
# getAmount()
?string
Represents the value before applying tax and discount (Unit Amount × Quantity).
# getDiscount()
?string
Represents the total discount applied (Unit Discount × Quantity).
# getTax()
?string
Represents the total tax calculated (Unit Tax × Quantity).
# getTaxRate()
?string
The percentage rate used to calculate the tax (e.g., 10.0000).
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getInvoice()
?Invoice
# getRefundItems()
?Collection<RefundItem>
# 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

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 27

Read-only values on the record.

# currency
Currency
Get the currency
# unitAmountAsMoney
Money
Gets the amount for a single unit (quantity = 1) as a Money object. Represents the value per unit before tax and discount are applied.
# unitDiscountAsMoney
Money
Gets the discount for a single unit (quantity = 1) as a Money object. Represents the discount value per unit.
# unitTaxAsMoney
Money
Gets the tax for a single unit (quantity = 1) as a Money object. Represents the tax value per unit.
# unitTotalAsMoney
Money
Gets the total for a single unit (quantity = 1) as a Money object. Represents the final value per unit calculated as Unit Amount - Unit Discount + Unit Tax.
# amountAsMoney
Money
Gets the amount for the entire quantity as a Money object. Represents the value before applying tax and discount (Unit Amount × Quantity).
# discountAsMoney
Money
Gets the discount for the entire quantity as a Money object. Represents the total discount applied (Unit Discount × Quantity).
# taxAsMoney
Money
Gets the tax for the entire quantity as a Money object. Represents the total tax calculated (Unit Tax × Quantity).
# totalAsMoney
Money
Gets the total for the entire quantity as a Money object. Represents the final value calculated as Amount - Discount + Tax.
# quantityRefunded
int
Get the quantity refunded
# pendingOrSuccessfullyRefundedItems
array
Get the pending or successfully refunded items
# taxableType
bool
Could this item be taxed?
# refundableType
bool
Is this item type eligible to be included in a refund? Type-level check only — independent of the parent invoice's refundability state (see {@see \Invoices\Models\Invoice::isRefundable()} for that).
# id
?int
# type
?string
# code
?string
# text
?string
# quantity
?int
# quantityUnit
?string
# amount
?string
Represents the value before applying tax and discount (Unit Amount × Quantity).
# discount
?string
Represents the total discount applied (Unit Discount × Quantity).
# tax
?string
Represents the total tax calculated (Unit Tax × Quantity).
# taxRate
?string
The percentage rate used to calculate the tax (e.g., 10.0000).
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# invoice
?Invoice
# refundItems
?Collection<RefundItem>

Admin view

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

Properties 30

Take no arguments.

# getCurrency()
Currency
Get the currency
# getUnitAmountAsMoney()
Money
Gets the amount for a single unit (quantity = 1) as a Money object. Represents the value per unit before tax and discount are applied.
# getUnitDiscountAsMoney()
Money
Gets the discount for a single unit (quantity = 1) as a Money object. Represents the discount value per unit.
# getUnitTaxAsMoney()
Money
Gets the tax for a single unit (quantity = 1) as a Money object. Represents the tax value per unit.
# getUnitTotalAsMoney()
Money
Gets the total for a single unit (quantity = 1) as a Money object. Represents the final value per unit calculated as Unit Amount - Unit Discount + Unit Tax.
# getAmountAsMoney()
Money
Gets the amount for the entire quantity as a Money object. Represents the value before applying tax and discount (Unit Amount × Quantity).
# getDiscountAsMoney()
Money
Gets the discount for the entire quantity as a Money object. Represents the total discount applied (Unit Discount × Quantity).
# getTaxAsMoney()
Money
Gets the tax for the entire quantity as a Money object. Represents the total tax calculated (Unit Tax × Quantity).
# getTotalAsMoney()
Money
Gets the total for the entire quantity as a Money object. Represents the final value calculated as Amount - Discount + Tax.
# getQuantityRefunded()
int
Get the quantity refunded
# getPendingOrSuccessfullyRefundedItems()
array
Get the pending or successfully refunded items
# isTaxableType()
bool
Could this item be taxed?
# isRefundableType()
bool
Is this item type eligible to be included in a refund? Type-level check only — independent of the parent invoice's refundability state (see {@see \Invoices\Models\Invoice::isRefundable()} for that).
# getId()
?int
# getType()
?string
# getCode()
?string
# getText()
?string
# getQuantity()
?int
# getQuantityUnit()
?string
# getAmount()
?string
Represents the value before applying tax and discount (Unit Amount × Quantity).
# getDiscount()
?string
Represents the total discount applied (Unit Discount × Quantity).
# getTax()
?string
Represents the total tax calculated (Unit Tax × Quantity).
# getTaxRate()
?string
The percentage rate used to calculate the tax (e.g., 10.0000).
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getInvoice()
?Invoice
# getRefundItems()
?Collection<RefundItem>
# 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