Class Invoice

java.lang.Object
com.xero.models.accounting.Invoice

public class Invoice
extends Object
Invoice
  • Constructor Details

    • Invoice

      public Invoice()
  • Method Details

    • type

      public Invoice type​(Invoice.TypeEnum type)
    • getType

      public Invoice.TypeEnum getType()
      See Invoice Types
      Returns:
      type
    • setType

      public void setType​(Invoice.TypeEnum type)
    • contact

      public Invoice contact​(Contact contact)
    • getContact

      public Contact getContact()
      Get contact
      Returns:
      contact
    • setContact

      public void setContact​(Contact contact)
    • lineItems

      public Invoice lineItems​(List<LineItem> lineItems)
    • addLineItemsItem

      public Invoice addLineItemsItem​(LineItem lineItemsItem)
    • getLineItems

      public List<LineItem> getLineItems()
      See LineItems
      Returns:
      lineItems
    • setLineItems

      public void setLineItems​(List<LineItem> lineItems)
    • date

      public Invoice date​(String date)
    • getDate

      public String getDate()
      Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation
      Returns:
      date
    • getDateAsDate

      public org.threeten.bp.LocalDate getDateAsDate()
    • setDate

      public void setDate​(String date)
    • setDate

      public void setDate​(org.threeten.bp.LocalDate date)
    • dueDate

      public Invoice dueDate​(String dueDate)
    • getDueDate

      public String getDueDate()
      Date invoice is due – YYYY-MM-DD
      Returns:
      dueDate
    • getDueDateAsDate

      public org.threeten.bp.LocalDate getDueDateAsDate()
    • setDueDate

      public void setDueDate​(String dueDate)
    • setDueDate

      public void setDueDate​(org.threeten.bp.LocalDate dueDate)
    • lineAmountTypes

      public Invoice lineAmountTypes​(LineAmountTypes lineAmountTypes)
    • getLineAmountTypes

      public LineAmountTypes getLineAmountTypes()
      Get lineAmountTypes
      Returns:
      lineAmountTypes
    • setLineAmountTypes

      public void setLineAmountTypes​(LineAmountTypes lineAmountTypes)
    • invoiceNumber

      public Invoice invoiceNumber​(String invoiceNumber)
    • getInvoiceNumber

      public String getInvoiceNumber()
      ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255)
      Returns:
      invoiceNumber
    • setInvoiceNumber

      public void setInvoiceNumber​(String invoiceNumber)
    • reference

      public Invoice reference​(String reference)
    • getReference

      public String getReference()
      ACCREC only – additional reference number (max length = 255)
      Returns:
      reference
    • setReference

      public void setReference​(String reference)
    • brandingThemeID

      public Invoice brandingThemeID​(UUID brandingThemeID)
    • getBrandingThemeID

      public UUID getBrandingThemeID()
      See BrandingThemes
      Returns:
      brandingThemeID
    • setBrandingThemeID

      public void setBrandingThemeID​(UUID brandingThemeID)
    • url

      public Invoice url​(String url)
    • getUrl

      public String getUrl()
      URL link to a source document – shown as “Go to [appName]” in the Xero app
      Returns:
      url
    • setUrl

      public void setUrl​(String url)
    • currencyCode

      public Invoice currencyCode​(CurrencyCode currencyCode)
    • getCurrencyCode

      public CurrencyCode getCurrencyCode()
      Get currencyCode
      Returns:
      currencyCode
    • setCurrencyCode

      public void setCurrencyCode​(CurrencyCode currencyCode)
    • currencyRate

      public Invoice currencyRate​(Double currencyRate)
    • getCurrencyRate

      public Double getCurrencyRate()
      The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6])
      Returns:
      currencyRate
    • setCurrencyRate

      public void setCurrencyRate​(Double currencyRate)
    • status

      public Invoice status​(Invoice.StatusEnum status)
    • getStatus

      public Invoice.StatusEnum getStatus()
      See Invoice Status Codes
      Returns:
      status
    • setStatus

      public void setStatus​(Invoice.StatusEnum status)
    • sentToContact

      public Invoice sentToContact​(Boolean sentToContact)
    • getSentToContact

      public Boolean getSentToContact()
      Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved
      Returns:
      sentToContact
    • setSentToContact

      public void setSentToContact​(Boolean sentToContact)
    • expectedPaymentDate

      public Invoice expectedPaymentDate​(String expectedPaymentDate)
    • getExpectedPaymentDate

      public String getExpectedPaymentDate()
      Shown on sales invoices (Accounts Receivable) when this has been set
      Returns:
      expectedPaymentDate
    • getExpectedPaymentDateAsDate

      public org.threeten.bp.LocalDate getExpectedPaymentDateAsDate()
    • setExpectedPaymentDate

      public void setExpectedPaymentDate​(String expectedPaymentDate)
    • setExpectedPaymentDate

      public void setExpectedPaymentDate​(org.threeten.bp.LocalDate expectedPaymentDate)
    • plannedPaymentDate

      public Invoice plannedPaymentDate​(String plannedPaymentDate)
    • getPlannedPaymentDate

      public String getPlannedPaymentDate()
      Shown on bills (Accounts Payable) when this has been set
      Returns:
      plannedPaymentDate
    • getPlannedPaymentDateAsDate

      public org.threeten.bp.LocalDate getPlannedPaymentDateAsDate()
    • setPlannedPaymentDate

      public void setPlannedPaymentDate​(String plannedPaymentDate)
    • setPlannedPaymentDate

      public void setPlannedPaymentDate​(org.threeten.bp.LocalDate plannedPaymentDate)
    • getCiSDeduction

      public Double getCiSDeduction()
      CIS deduction for UK contractors
      Returns:
      ciSDeduction
    • getSubTotal

      public Double getSubTotal()
      Total of invoice excluding taxes
      Returns:
      subTotal
    • getTotalTax

      public Double getTotalTax()
      Total tax on invoice
      Returns:
      totalTax
    • getTotal

      public Double getTotal()
      Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts
      Returns:
      total
    • getTotalDiscount

      public Double getTotalDiscount()
      Total of discounts applied on the invoice line items
      Returns:
      totalDiscount
    • invoiceID

      public Invoice invoiceID​(UUID invoiceID)
    • getInvoiceID

      public UUID getInvoiceID()
      Xero generated unique identifier for invoice
      Returns:
      invoiceID
    • setInvoiceID

      public void setInvoiceID​(UUID invoiceID)
    • repeatingInvoiceID

      public Invoice repeatingInvoiceID​(UUID repeatingInvoiceID)
    • getRepeatingInvoiceID

      public UUID getRepeatingInvoiceID()
      Xero generated unique identifier for repeating invoices
      Returns:
      repeatingInvoiceID
    • setRepeatingInvoiceID

      public void setRepeatingInvoiceID​(UUID repeatingInvoiceID)
    • getHasAttachments

      public Boolean getHasAttachments()
      boolean to indicate if an invoice has an attachment
      Returns:
      hasAttachments
    • getIsDiscounted

      public Boolean getIsDiscounted()
      boolean to indicate if an invoice has a discount
      Returns:
      isDiscounted
    • getPayments

      public List<Payment> getPayments()
      See Payments
      Returns:
      payments
    • getPrepayments

      public List<Prepayment> getPrepayments()
      See Prepayments
      Returns:
      prepayments
    • getOverpayments

      public List<Overpayment> getOverpayments()
      See Overpayments
      Returns:
      overpayments
    • getAmountDue

      public Double getAmountDue()
      Amount remaining to be paid on invoice
      Returns:
      amountDue
    • getAmountPaid

      public Double getAmountPaid()
      Sum of payments received for invoice
      Returns:
      amountPaid
    • getFullyPaidOnDate

      public String getFullyPaidOnDate()
      The date the invoice was fully paid. Only returned on fully paid invoices
      Returns:
      fullyPaidOnDate
    • getFullyPaidOnDateAsDate

      public org.threeten.bp.LocalDate getFullyPaidOnDateAsDate()
    • getAmountCredited

      public Double getAmountCredited()
      Sum of all credit notes, over-payments and pre-payments applied to invoice
      Returns:
      amountCredited
    • getUpdatedDateUTC

      public String getUpdatedDateUTC()
      Last modified date UTC format
      Returns:
      updatedDateUTC
    • getUpdatedDateUTCAsDate

      public org.threeten.bp.OffsetDateTime getUpdatedDateUTCAsDate()
    • getCreditNotes

      public List<CreditNote> getCreditNotes()
      Details of credit notes that have been applied to an invoice
      Returns:
      creditNotes
    • attachments

      public Invoice attachments​(List<Attachment> attachments)
    • addAttachmentsItem

      public Invoice addAttachmentsItem​(Attachment attachmentsItem)
    • getAttachments

      public List<Attachment> getAttachments()
      Displays array of attachments from the API
      Returns:
      attachments
    • setAttachments

      public void setAttachments​(List<Attachment> attachments)
    • hasErrors

      public Invoice hasErrors​(Boolean hasErrors)
    • getHasErrors

      public Boolean getHasErrors()
      A boolean to indicate if a invoice has an validation errors
      Returns:
      hasErrors
    • setHasErrors

      public void setHasErrors​(Boolean hasErrors)
    • statusAttributeString

      public Invoice statusAttributeString​(String statusAttributeString)
    • getStatusAttributeString

      public String getStatusAttributeString()
      A string to indicate if a invoice status
      Returns:
      statusAttributeString
    • setStatusAttributeString

      public void setStatusAttributeString​(String statusAttributeString)
    • validationErrors

      public Invoice validationErrors​(List<ValidationError> validationErrors)
    • addValidationErrorsItem

      public Invoice addValidationErrorsItem​(ValidationError validationErrorsItem)
    • getValidationErrors

      public List<ValidationError> getValidationErrors()
      Displays array of validation error messages from the API
      Returns:
      validationErrors
    • setValidationErrors

      public void setValidationErrors​(List<ValidationError> validationErrors)
    • warnings

      public Invoice warnings​(List<ValidationError> warnings)
    • addWarningsItem

      public Invoice addWarningsItem​(ValidationError warningsItem)
    • getWarnings

      public List<ValidationError> getWarnings()
      Displays array of warning messages from the API
      Returns:
      warnings
    • setWarnings

      public void setWarnings​(List<ValidationError> warnings)
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object