Package com.xero.models.accounting
Class LineItem
java.lang.Object
com.xero.models.accounting.LineItem
public class LineItem extends Object
LineItem
-
Constructor Summary
Constructors Constructor Description LineItem() -
Method Summary
Modifier and Type Method Description LineItemaccountCode(String accountCode)LineItemaddTrackingItem(LineItemTracking trackingItem)LineItemdescription(String description)LineItemdiscountAmount(Double discountAmount)LineItemdiscountRate(Double discountRate)booleanequals(Object o)StringgetAccountCode()See AccountsStringgetDescription()Description needs to be at least 1 char long.DoublegetDiscountAmount()Discount amount being applied to a line item.DoublegetDiscountRate()Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discountsStringgetItemCode()See ItemsDoublegetLineAmount()If you wish to omit either of the <Quantity> or <UnitAmount> you can provide a LineAmount and Xero will calculate the missing amount for you.UUIDgetLineItemID()LineItem unique IDDoublegetQuantity()LineItem QuantityUUIDgetRepeatingInvoiceID()The Xero identifier for a Repeating InvoiceDoublegetTaxAmount()The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate.StringgetTaxType()The tax type from TaxRatesList<LineItemTracking>getTracking()Optional Tracking Category – see Tracking.DoublegetUnitAmount()LineItem Unit AmountinthashCode()LineItemitemCode(String itemCode)LineItemlineAmount(Double lineAmount)LineItemlineItemID(UUID lineItemID)LineItemquantity(Double quantity)LineItemrepeatingInvoiceID(UUID repeatingInvoiceID)voidsetAccountCode(String accountCode)voidsetDescription(String description)voidsetDiscountAmount(Double discountAmount)voidsetDiscountRate(Double discountRate)voidsetItemCode(String itemCode)voidsetLineAmount(Double lineAmount)voidsetLineItemID(UUID lineItemID)voidsetQuantity(Double quantity)voidsetRepeatingInvoiceID(UUID repeatingInvoiceID)voidsetTaxAmount(Double taxAmount)voidsetTaxType(String taxType)voidsetTracking(List<LineItemTracking> tracking)voidsetUnitAmount(Double unitAmount)LineItemtaxAmount(Double taxAmount)LineItemtaxType(String taxType)StringtoString()LineItemtracking(List<LineItemTracking> tracking)LineItemunitAmount(Double unitAmount)
-
Constructor Details
-
LineItem
public LineItem()
-
-
Method Details
-
lineItemID
-
getLineItemID
LineItem unique ID- Returns:
- lineItemID
-
setLineItemID
-
description
-
getDescription
Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a <Description> element that contains at least 1 character- Returns:
- description
-
setDescription
-
quantity
-
getQuantity
LineItem Quantity- Returns:
- quantity
-
setQuantity
-
unitAmount
-
getUnitAmount
LineItem Unit Amount- Returns:
- unitAmount
-
setUnitAmount
-
itemCode
-
getItemCode
See Items- Returns:
- itemCode
-
setItemCode
-
accountCode
-
getAccountCode
See Accounts- Returns:
- accountCode
-
setAccountCode
-
taxType
-
getTaxType
The tax type from TaxRates- Returns:
- taxType
-
setTaxType
-
taxAmount
-
getTaxAmount
The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct.- Returns:
- taxAmount
-
setTaxAmount
-
lineAmount
-
getLineAmount
If you wish to omit either of the <Quantity> or <UnitAmount> you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100)- Returns:
- lineAmount
-
setLineAmount
-
tracking
-
addTrackingItem
-
getTracking
Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements.- Returns:
- tracking
-
setTracking
-
discountRate
-
getDiscountRate
Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts- Returns:
- discountRate
-
setDiscountRate
-
discountAmount
-
getDiscountAmount
Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts.- Returns:
- discountAmount
-
setDiscountAmount
-
repeatingInvoiceID
-
getRepeatingInvoiceID
The Xero identifier for a Repeating Invoice- Returns:
- repeatingInvoiceID
-
setRepeatingInvoiceID
-
equals
-
hashCode
public int hashCode() -
toString
-