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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LineItemaccountCode(String accountCode)See AccountsLineItemaccountID(UUID accountID)The associated account ID related to this line itemLineItemaddTrackingItem(LineItemTracking trackingItem)Optional Tracking Category – see Tracking.LineItemdescription(String description)Description needs to be at least 1 char long.LineItemdiscountAmount(Double discountAmount)Discount amount being applied to a line item.LineItemdiscountRate(Double discountRate)Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discountsbooleanequals(Object o)StringgetAccountCode()See AccountsUUIDgetAccountID()The associated account ID related to this line itemStringgetDescription()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)See ItemsLineItemlineAmount(Double lineAmount)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.LineItemlineItemID(UUID lineItemID)LineItem unique IDLineItemquantity(Double quantity)LineItem QuantityLineItemrepeatingInvoiceID(UUID repeatingInvoiceID)The Xero identifier for a Repeating InvoicevoidsetAccountCode(String accountCode)See AccountsvoidsetAccountID(UUID accountID)The associated account ID related to this line itemvoidsetDescription(String description)Description needs to be at least 1 char long.voidsetDiscountAmount(Double discountAmount)Discount amount being applied to a line item.voidsetDiscountRate(Double discountRate)Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discountsvoidsetItemCode(String itemCode)See ItemsvoidsetLineAmount(Double lineAmount)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.voidsetLineItemID(UUID lineItemID)LineItem unique IDvoidsetQuantity(Double quantity)LineItem QuantityvoidsetRepeatingInvoiceID(UUID repeatingInvoiceID)The Xero identifier for a Repeating InvoicevoidsetTaxAmount(Double taxAmount)The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate.voidsetTaxType(String taxType)The tax type from TaxRatesvoidsetTracking(List<LineItemTracking> tracking)Optional Tracking Category – see Tracking.voidsetUnitAmount(Double unitAmount)LineItem Unit AmountLineItemtaxAmount(Double taxAmount)The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate.LineItemtaxType(String taxType)The tax type from TaxRatesStringtoString()LineItemtracking(List<LineItemTracking> tracking)Optional Tracking Category – see Tracking.LineItemunitAmount(Double unitAmount)LineItem Unit Amount
-
-
-
Method Detail
-
lineItemID
public LineItem lineItemID(UUID lineItemID)
LineItem unique ID- Parameters:
lineItemID- UUID- Returns:
- LineItem
-
getLineItemID
public UUID getLineItemID()
LineItem unique ID- Returns:
- lineItemID
-
setLineItemID
public void setLineItemID(UUID lineItemID)
LineItem unique ID- Parameters:
lineItemID- UUID
-
description
public LineItem description(String description)
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- Parameters:
description- String- Returns:
- LineItem
-
getDescription
public String 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
public void setDescription(String description)
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- Parameters:
description- String
-
quantity
public LineItem quantity(Double quantity)
LineItem Quantity- Parameters:
quantity- Double- Returns:
- LineItem
-
getQuantity
public Double getQuantity()
LineItem Quantity- Returns:
- quantity
-
setQuantity
public void setQuantity(Double quantity)
LineItem Quantity- Parameters:
quantity- Double
-
unitAmount
public LineItem unitAmount(Double unitAmount)
LineItem Unit Amount- Parameters:
unitAmount- Double- Returns:
- LineItem
-
getUnitAmount
public Double getUnitAmount()
LineItem Unit Amount- Returns:
- unitAmount
-
setUnitAmount
public void setUnitAmount(Double unitAmount)
LineItem Unit Amount- Parameters:
unitAmount- Double
-
itemCode
public LineItem itemCode(String itemCode)
See Items- Parameters:
itemCode- String- Returns:
- LineItem
-
getItemCode
public String getItemCode()
See Items- Returns:
- itemCode
-
setItemCode
public void setItemCode(String itemCode)
See Items- Parameters:
itemCode- String
-
accountCode
public LineItem accountCode(String accountCode)
See Accounts- Parameters:
accountCode- String- Returns:
- LineItem
-
getAccountCode
public String getAccountCode()
See Accounts- Returns:
- accountCode
-
setAccountCode
public void setAccountCode(String accountCode)
See Accounts- Parameters:
accountCode- String
-
accountID
public LineItem accountID(UUID accountID)
The associated account ID related to this line item- Parameters:
accountID- UUID- Returns:
- LineItem
-
getAccountID
public UUID getAccountID()
The associated account ID related to this line item- Returns:
- accountID
-
setAccountID
public void setAccountID(UUID accountID)
The associated account ID related to this line item- Parameters:
accountID- UUID
-
taxType
public LineItem taxType(String taxType)
The tax type from TaxRates- Parameters:
taxType- String- Returns:
- LineItem
-
getTaxType
public String getTaxType()
The tax type from TaxRates- Returns:
- taxType
-
setTaxType
public void setTaxType(String taxType)
The tax type from TaxRates- Parameters:
taxType- String
-
taxAmount
public LineItem taxAmount(Double taxAmount)
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.- Parameters:
taxAmount- Double- Returns:
- LineItem
-
getTaxAmount
public Double 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
public void setTaxAmount(Double taxAmount)
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.- Parameters:
taxAmount- Double
-
lineAmount
public LineItem lineAmount(Double lineAmount)
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)- Parameters:
lineAmount- Double- Returns:
- LineItem
-
getLineAmount
public Double 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
public void setLineAmount(Double lineAmount)
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)- Parameters:
lineAmount- Double
-
tracking
public LineItem tracking(List<LineItemTracking> tracking)
Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements.- Parameters:
tracking- List<LineItemTracking>- Returns:
- LineItem
-
addTrackingItem
public LineItem addTrackingItem(LineItemTracking trackingItem)
Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements.- Parameters:
trackingItem- LineItemTracking- Returns:
- LineItem
-
getTracking
public List<LineItemTracking> getTracking()
Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements.- Returns:
- tracking
-
setTracking
public void setTracking(List<LineItemTracking> tracking)
Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements.- Parameters:
tracking- List<LineItemTracking>
-
discountRate
public LineItem discountRate(Double discountRate)
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- Parameters:
discountRate- Double- Returns:
- LineItem
-
getDiscountRate
public Double 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
public void setDiscountRate(Double discountRate)
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- Parameters:
discountRate- Double
-
discountAmount
public LineItem discountAmount(Double discountAmount)
Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts.- Parameters:
discountAmount- Double- Returns:
- LineItem
-
getDiscountAmount
public Double 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
public void setDiscountAmount(Double discountAmount)
Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts.- Parameters:
discountAmount- Double
-
repeatingInvoiceID
public LineItem repeatingInvoiceID(UUID repeatingInvoiceID)
The Xero identifier for a Repeating Invoice- Parameters:
repeatingInvoiceID- UUID- Returns:
- LineItem
-
getRepeatingInvoiceID
public UUID getRepeatingInvoiceID()
The Xero identifier for a Repeating Invoice- Returns:
- repeatingInvoiceID
-
setRepeatingInvoiceID
public void setRepeatingInvoiceID(UUID repeatingInvoiceID)
The Xero identifier for a Repeating Invoice- Parameters:
repeatingInvoiceID- UUID
-
-