Checkout line item representing a voucher redeemed against a cart, adding a negative-priced credit for the voucher's cash value. The voucher's cash value is applied as a credit rather than a cost, so getAdjustedPriceExTax and getUnitCost are negative. processCheckout marks the voucher redeemed against the order and fires a voucher change event.
Implements: CheckoutLineItem
Properties
| Property | Returns | Description |
|---|---|---|
| adjustedPriceExTax | BigDecimal | The credit this voucher applies to the cart, expressed as the negative of its cash value. |
| finalCost | BigDecimal | The final cost of this line item. |
| finalListPriceIncTax | BigDecimal | The final list price for this line, including tax, before discounts. |
| finalPriceExTax | BigDecimal | The final price for this line after discounts, excluding tax. |
| itemDescription | String | Human-readable description of this line item, taken from the voucher type's title. |
| lineItemId | String | Unique identifier of this line item, formed from the redeemed voucher's database id. |
| listUnitPriceExTax | BigDecimal | The voucher's face value, before it is applied as a credit. |
| product | Product | The product this line item is for. |
| productSku | ProductSku | The SKU associated with this voucher's type, if any. |
| quantity | BigDecimal | The quantity of this line item. |
| tax | BigDecimal | The tax amount for this line item. |
| taxRate | BigDecimal | The tax rate applied to this line item. |
| unitCost | BigDecimal | The unit cost of this line item, which is the negative credit the voucher applies to the cart. |
Inherited from CheckoutLineItem
Properties
| Property | Returns | Description |
|---|---|---|
| discountExTax | BigDecimal | The total discount applied to this line, calculated as the list price for the full quantity less the final price, both excluding tax. |
Methods
getDiscountExTax()
Returns: BigDecimal
The total discount applied to this line, calculated as the list price for the full quantity less the final price, both excluding tax.
Methods
getListUnitPriceExTax() · getAdjustedPriceExTax() · getLineItemId() · getQuantity() · getUnitCost() · getTaxRate() · getFinalCost() · finalCost(Narrative narrative) · getItemDescription() · getProductSku() · getTax() · getProduct() · getFinalListPriceIncTax() · getFinalPriceExTax()
getListUnitPriceExTax()
Returns: BigDecimal
The voucher's face value, before it is applied as a credit.
getAdjustedPriceExTax()
Returns: BigDecimal
The credit this voucher applies to the cart, expressed as the negative of its cash value.
getLineItemId()
Returns: String
Unique identifier of this line item, formed from the redeemed voucher's database id.
getQuantity()
Returns: BigDecimal
The quantity of this line item.
getUnitCost()
Returns: BigDecimal
The unit cost of this line item, which is the negative credit the voucher applies to the cart.
getTaxRate()
Returns: BigDecimal
The tax rate applied to this line item.
getFinalCost()
Returns: BigDecimal
The final cost of this line item.
finalCost(Narrative narrative)
Returns: BigDecimal
Calculates the final cost of this line item. The narrative parameter is accepted for interface compatibility but is not used since the credit is always the voucher's negated cash value.
| Parameter | Description |
|---|---|
narrative | not used |
getItemDescription()
Returns: String
Human-readable description of this line item, taken from the voucher type's title.
getProductSku()
Returns: ProductSku
The SKU associated with this voucher's type, if any.
getTax()
Returns: BigDecimal
The tax amount for this line item.
getProduct()
Returns: Product
The product this line item is for.
getFinalListPriceIncTax()
Returns: BigDecimal
The final list price for this line, including tax, before discounts.
getFinalPriceExTax()
Returns: BigDecimal
The final price for this line after discounts, excluding tax.