One charge line on a quote, invoice, purchase order or other payment item list. It carries a description, a quantity and unit price, and optional discount and tax rates, and may point at the product SKU being sold and the supplier it is bought from. The stored amount is the ex-tax value as it was when the line was saved, while getSubTotal, getTaxAmount and getTotalCost recalculate from the current quantity, price and rates.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| account | String | The accounting account code this line is posted to, entered by whoever created the line. Free text, and it is included in the search index for line items. |
| amount | BigDecimal | The ex-tax value stored for this line, which the pages that create lines set to quantity times unit price less the discount. It is a stored figure rather than a live calculation, so it can fall out of step if the quantity or price is changed without recalculating; use getSubTotal for a value worked out from the current fields. |
| description | String | The text describing what is being charged for, entered by whoever created the line. This is what the customer reads on the printed document. |
| discountRate | BigDecimal | The discount taken off this line, as a percentage of quantity times unit price, so 10 means 10 percent off. Null for no discount. |
| id | long | The database identifier of this line. |
| paymentItemList | PaymentItemList | The quote, invoice or other payment item list this line belongs to. Required, and it is what ties the line to an organisation. |
| productSku | ProductSku | The product SKU being charged for, when the line came from the product catalogue. Null for a free text line typed straight onto the document. |
| quantity | BigDecimal | How many units this line covers, held to three decimal places so part units are allowed. Required. |
| subTotal | BigDecimal | The ex-tax cost worked out from the current values, being quantity times unit price with any discount rate taken off. Returns null if either the quantity or the unit price is not set. |
| supplier | BaseEntity | Who supplies what this line covers, used mainly on purchase orders. A base entity, so it may be a profile or an organisation, and it is null when no supplier is recorded. |
| taxAmount | BigDecimal | The tax worked out from the current values, being the tax rate as a percentage applied to the sub total. Returns null if there is no tax rate, or if the sub total cannot be calculated. |
| taxRate | BigDecimal | The tax rate applied to this line, as a percentage, so 15 means 15 percent. Null for a line that carries no tax, in which case getTaxAmount returns null. |
| totalCost | BigDecimal | The tax inclusive cost of this line, being the sub total plus the tax amount. Missing values are treated as zero, so unlike the other two calculations this never returns null. |
| unitPrice | BigDecimal | The ex-tax price of a single unit, held to three decimal places. Required. |
Methods
getId() · getPaymentItemList() · setPaymentItemList(PaymentItemList paymentItemList) · getDescription() · setDescription(String description) · getQuantity() · setQuantity(BigDecimal quantity) · getUnitPrice() · setUnitPrice(BigDecimal unitPrice) · getAccount() · setAccount(String account) · getTaxRate() · setTaxRate(BigDecimal taxRate) · getAmount() · setAmount(BigDecimal amount) · getDiscountRate() · setDiscountRate(BigDecimal discountRate) · getProductSku() · setProductSku(ProductSku productSku) · getSupplier() · setSupplier(BaseEntity supplier) · getSubTotal() · getTaxAmount() · getTotalCost() · duplicate()
getId()
Returns: long
The database identifier of this line.
getPaymentItemList()
Returns: PaymentItemList
The quote, invoice or other payment item list this line belongs to. Required, and it is what ties the line to an organisation.
setPaymentItemList(PaymentItemList paymentItemList)
Returns: void
Sets the quote, invoice or other payment item list this line belongs to.
| Parameter | Description |
|---|---|
paymentItemList | the payment item list this line belongs to |
getDescription()
Returns: String
The text describing what is being charged for, entered by whoever created the line. This is what the customer reads on the printed document.
setDescription(String description)
Returns: void
Sets the text describing what is being charged for.
| Parameter | Description |
|---|---|
description | the description of this line |
getQuantity()
Returns: BigDecimal
How many units this line covers, held to three decimal places so part units are allowed. Required.
setQuantity(BigDecimal quantity)
Returns: void
Sets how many units this line covers.
| Parameter | Description |
|---|---|
quantity | the quantity charged on this line |
getUnitPrice()
Returns: BigDecimal
The ex-tax price of a single unit, held to three decimal places. Required.
setUnitPrice(BigDecimal unitPrice)
Returns: void
Sets the ex-tax price of a single unit.
| Parameter | Description |
|---|---|
unitPrice | the price per unit before tax |
getAccount()
Returns: String
The accounting account code this line is posted to, entered by whoever created the line. Free text, and it is included in the search index for line items.
setAccount(String account)
Returns: void
Sets the accounting account code this line is posted to.
| Parameter | Description |
|---|---|
account | the accounting account code |
getTaxRate()
Returns: BigDecimal
The tax rate applied to this line, as a percentage, so 15 means 15 percent. Null for a line that carries no tax, in which case getTaxAmount returns null.
setTaxRate(BigDecimal taxRate)
Returns: void
Sets the tax rate applied to this line.
| Parameter | Description |
|---|---|
taxRate | the tax rate as a percentage, or null for no tax |
getAmount()
Returns: BigDecimal
The ex-tax value stored for this line, which the pages that create lines set to quantity times unit price less the discount. It is a stored figure rather than a live calculation, so it can fall out of step if the quantity or price is changed without recalculating; use getSubTotal for a value worked out from the current fields.
setAmount(BigDecimal amount)
Returns: void
Sets the ex-tax value stored for this line.
| Parameter | Description |
|---|---|
amount | the stored ex-tax amount for this line |
getDiscountRate()
Returns: BigDecimal
The discount taken off this line, as a percentage of quantity times unit price, so 10 means 10 percent off. Null for no discount.
setDiscountRate(BigDecimal discountRate)
Returns: void
Sets the discount taken off this line.
| Parameter | Description |
|---|---|
discountRate | the discount rate as a percentage, or null for no discount |
getProductSku()
Returns: ProductSku
The product SKU being charged for, when the line came from the product catalogue. Null for a free text line typed straight onto the document.
setProductSku(ProductSku productSku)
Returns: void
Sets the product SKU being charged for.
| Parameter | Description |
|---|---|
productSku | the product SKU this line sells, or null for a free text line |
getSupplier()
Returns: BaseEntity
Who supplies what this line covers, used mainly on purchase orders. A base entity, so it may be a profile or an organisation, and it is null when no supplier is recorded.
setSupplier(BaseEntity supplier)
Returns: void
Sets who supplies what this line covers.
| Parameter | Description |
|---|---|
supplier | the supplier for this line, or null for none |
getSubTotal()
Returns: BigDecimal
The ex-tax cost worked out from the current values, being quantity times unit price with any discount rate taken off. Returns null if either the quantity or the unit price is not set.
getTaxAmount()
Returns: BigDecimal
The tax worked out from the current values, being the tax rate as a percentage applied to the sub total. Returns null if there is no tax rate, or if the sub total cannot be calculated.
getTotalCost()
Returns: BigDecimal
The tax inclusive cost of this line, being the sub total plus the tax amount. Missing values are treated as zero, so unlike the other two calculations this never returns null.
duplicate()
Returns: LineItem
Copies this line's values into a new unsaved line item. The copy is not attached to any payment item list, so set that and save it yourself.