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

PropertyReturnsDescription
accountStringThe 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.
amountBigDecimalThe 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.
descriptionStringThe text describing what is being charged for, entered by whoever created the line. This is what the customer reads on the printed document.
discountRateBigDecimalThe discount taken off this line, as a percentage of quantity times unit price, so 10 means 10 percent off. Null for no discount.
idlongThe database identifier of this line.
paymentItemListPaymentItemListThe quote, invoice or other payment item list this line belongs to. Required, and it is what ties the line to an organisation.
productSkuProductSkuThe product SKU being charged for, when the line came from the product catalogue. Null for a free text line typed straight onto the document.
quantityBigDecimalHow many units this line covers, held to three decimal places so part units are allowed. Required.
subTotalBigDecimalThe 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.
supplierBaseEntityWho 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.
taxAmountBigDecimalThe 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.
taxRateBigDecimalThe 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.
totalCostBigDecimalThe 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.
unitPriceBigDecimalThe 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.

ParameterDescription
paymentItemListthe 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.

ParameterDescription
descriptionthe 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.

ParameterDescription
quantitythe 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.

ParameterDescription
unitPricethe 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.

ParameterDescription
accountthe 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.

ParameterDescription
taxRatethe 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.

ParameterDescription
amountthe 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.

ParameterDescription
discountRatethe 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.

ParameterDescription
productSkuthe 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.

ParameterDescription
supplierthe 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.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.