Class LineItem


  • public class LineItem
    extends Object
    LineItem
    • Constructor Detail

      • LineItem

        public LineItem()
    • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object