Class Invoice


  • public class Invoice
    extends Object
    Invoice
    • Constructor Detail

      • Invoice

        public Invoice()
    • Method Detail

      • type

        public Invoice type​(Invoice.TypeEnum type)
        See Invoice Types
        Parameters:
        type - TypeEnum
        Returns:
        Invoice
      • setType

        public void setType​(Invoice.TypeEnum type)
        See Invoice Types
        Parameters:
        type - TypeEnum
      • contact

        public Invoice contact​(Contact contact)
        contact
        Parameters:
        contact - Contact
        Returns:
        Invoice
      • getContact

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

        public void setContact​(Contact contact)
        contact
        Parameters:
        contact - Contact
      • lineItems

        public Invoice lineItems​(List<LineItem> lineItems)
        See LineItems
        Parameters:
        lineItems - List<LineItem>
        Returns:
        Invoice
      • addLineItemsItem

        public Invoice addLineItemsItem​(LineItem lineItemsItem)
        See LineItems
        Parameters:
        lineItemsItem - LineItem
        Returns:
        Invoice
      • getLineItems

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

        public void setLineItems​(List<LineItem> lineItems)
        See LineItems
        Parameters:
        lineItems - List<LineItem>
      • date

        public Invoice date​(String date)
        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
        Parameters:
        date - String
        Returns:
        Invoice
      • 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()
        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:
        LocalDate
      • setDate

        public void setDate​(String date)
        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
        Parameters:
        date - String
      • setDate

        public void setDate​(org.threeten.bp.LocalDate date)
        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
        Parameters:
        date - LocalDateTime
      • dueDate

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

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

        public org.threeten.bp.LocalDate getDueDateAsDate()
        Date invoice is due – YYYY-MM-DD
        Returns:
        LocalDate
      • setDueDate

        public void setDueDate​(String dueDate)
        Date invoice is due – YYYY-MM-DD
        Parameters:
        dueDate - String
      • setDueDate

        public void setDueDate​(org.threeten.bp.LocalDate dueDate)
        Date invoice is due – YYYY-MM-DD
        Parameters:
        dueDate - LocalDateTime
      • lineAmountTypes

        public Invoice lineAmountTypes​(LineAmountTypes lineAmountTypes)
        lineAmountTypes
        Parameters:
        lineAmountTypes - LineAmountTypes
        Returns:
        Invoice
      • getLineAmountTypes

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

        public void setLineAmountTypes​(LineAmountTypes lineAmountTypes)
        lineAmountTypes
        Parameters:
        lineAmountTypes - LineAmountTypes
      • invoiceNumber

        public Invoice invoiceNumber​(String invoiceNumber)
        ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255)
        Parameters:
        invoiceNumber - String
        Returns:
        Invoice
      • 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)
        ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255)
        Parameters:
        invoiceNumber - String
      • reference

        public Invoice reference​(String reference)
        ACCREC only – additional reference number
        Parameters:
        reference - String
        Returns:
        Invoice
      • getReference

        public String getReference()
        ACCREC only – additional reference number
        Returns:
        reference
      • setReference

        public void setReference​(String reference)
        ACCREC only – additional reference number
        Parameters:
        reference - String
      • brandingThemeID

        public Invoice brandingThemeID​(UUID brandingThemeID)
        See BrandingThemes
        Parameters:
        brandingThemeID - UUID
        Returns:
        Invoice
      • getBrandingThemeID

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

        public void setBrandingThemeID​(UUID brandingThemeID)
        See BrandingThemes
        Parameters:
        brandingThemeID - UUID
      • url

        public Invoice url​(String url)
        URL link to a source document – shown as “Go to [appName]” in the Xero app
        Parameters:
        url - String
        Returns:
        Invoice
      • 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)
        URL link to a source document – shown as “Go to [appName]” in the Xero app
        Parameters:
        url - String
      • currencyCode

        public Invoice currencyCode​(CurrencyCode currencyCode)
        currencyCode
        Parameters:
        currencyCode - CurrencyCode
        Returns:
        Invoice
      • getCurrencyCode

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

        public void setCurrencyCode​(CurrencyCode currencyCode)
        currencyCode
        Parameters:
        currencyCode - CurrencyCode
      • currencyRate

        public Invoice currencyRate​(Double currencyRate)
        The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6])
        Parameters:
        currencyRate - Double
        Returns:
        Invoice
      • 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)
        The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6])
        Parameters:
        currencyRate - Double
      • status

        public Invoice status​(Invoice.StatusEnum status)
        See Invoice Status Codes
        Parameters:
        status - StatusEnum
        Returns:
        Invoice
      • getStatus

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

        public void setStatus​(Invoice.StatusEnum status)
        See Invoice Status Codes
        Parameters:
        status - StatusEnum
      • sentToContact

        public Invoice sentToContact​(Boolean sentToContact)
        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
        Parameters:
        sentToContact - Boolean
        Returns:
        Invoice
      • 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)
        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
        Parameters:
        sentToContact - Boolean
      • expectedPaymentDate

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

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

        public org.threeten.bp.LocalDate getExpectedPaymentDateAsDate()
        Shown on sales invoices (Accounts Receivable) when this has been set
        Returns:
        LocalDate
      • setExpectedPaymentDate

        public void setExpectedPaymentDate​(String expectedPaymentDate)
        Shown on sales invoices (Accounts Receivable) when this has been set
        Parameters:
        expectedPaymentDate - String
      • setExpectedPaymentDate

        public void setExpectedPaymentDate​(org.threeten.bp.LocalDate expectedPaymentDate)
        Shown on sales invoices (Accounts Receivable) when this has been set
        Parameters:
        expectedPaymentDate - LocalDateTime
      • plannedPaymentDate

        public Invoice plannedPaymentDate​(String plannedPaymentDate)
        Shown on bills (Accounts Payable) when this has been set
        Parameters:
        plannedPaymentDate - String
        Returns:
        Invoice
      • getPlannedPaymentDate

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

        public org.threeten.bp.LocalDate getPlannedPaymentDateAsDate()
        Shown on bills (Accounts Payable) when this has been set
        Returns:
        LocalDate
      • setPlannedPaymentDate

        public void setPlannedPaymentDate​(String plannedPaymentDate)
        Shown on bills (Accounts Payable) when this has been set
        Parameters:
        plannedPaymentDate - String
      • setPlannedPaymentDate

        public void setPlannedPaymentDate​(org.threeten.bp.LocalDate plannedPaymentDate)
        Shown on bills (Accounts Payable) when this has been set
        Parameters:
        plannedPaymentDate - LocalDateTime
      • getCiSDeduction

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

        public Double getCiSRate()
        CIS Deduction rate for the organisation
        Returns:
        ciSRate
      • 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)
        Xero generated unique identifier for invoice
        Parameters:
        invoiceID - UUID
        Returns:
        Invoice
      • getInvoiceID

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

        public void setInvoiceID​(UUID invoiceID)
        Xero generated unique identifier for invoice
        Parameters:
        invoiceID - UUID
      • repeatingInvoiceID

        public Invoice repeatingInvoiceID​(UUID repeatingInvoiceID)
        Xero generated unique identifier for repeating invoices
        Parameters:
        repeatingInvoiceID - UUID
        Returns:
        Invoice
      • getRepeatingInvoiceID

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

        public void setRepeatingInvoiceID​(UUID repeatingInvoiceID)
        Xero generated unique identifier for repeating invoices
        Parameters:
        repeatingInvoiceID - UUID
      • 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()
        The date the invoice was fully paid. Only returned on fully paid invoices
        Returns:
        LocalDate
      • 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()
        Last modified date UTC format
        Returns:
        OffsetDateTime
      • 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)
        Displays array of attachments from the API
        Parameters:
        attachments - List<Attachment>
        Returns:
        Invoice
      • addAttachmentsItem

        public Invoice addAttachmentsItem​(Attachment attachmentsItem)
        Displays array of attachments from the API
        Parameters:
        attachmentsItem - Attachment
        Returns:
        Invoice
      • getAttachments

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

        public void setAttachments​(List<Attachment> attachments)
        Displays array of attachments from the API
        Parameters:
        attachments - List<Attachment>
      • hasErrors

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

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

        public void setHasErrors​(Boolean hasErrors)
        A boolean to indicate if a invoice has an validation errors
        Parameters:
        hasErrors - Boolean
      • statusAttributeString

        public Invoice statusAttributeString​(String statusAttributeString)
        A string to indicate if a invoice status
        Parameters:
        statusAttributeString - String
        Returns:
        Invoice
      • getStatusAttributeString

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

        public void setStatusAttributeString​(String statusAttributeString)
        A string to indicate if a invoice status
        Parameters:
        statusAttributeString - String
      • validationErrors

        public Invoice validationErrors​(List<ValidationError> validationErrors)
        Displays array of validation error messages from the API
        Parameters:
        validationErrors - List<ValidationError>
        Returns:
        Invoice
      • addValidationErrorsItem

        public Invoice addValidationErrorsItem​(ValidationError validationErrorsItem)
        Displays array of validation error messages from the API
        Parameters:
        validationErrorsItem - ValidationError
        Returns:
        Invoice
      • getValidationErrors

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

        public void setValidationErrors​(List<ValidationError> validationErrors)
        Displays array of validation error messages from the API
        Parameters:
        validationErrors - List<ValidationError>
      • warnings

        public Invoice warnings​(List<ValidationError> warnings)
        Displays array of warning messages from the API
        Parameters:
        warnings - List<ValidationError>
        Returns:
        Invoice
      • addWarningsItem

        public Invoice addWarningsItem​(ValidationError warningsItem)
        Displays array of warning messages from the API
        Parameters:
        warningsItem - ValidationError
        Returns:
        Invoice
      • getWarnings

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

        public void setWarnings​(List<ValidationError> warnings)
        Displays array of warning messages from the API
        Parameters:
        warnings - List<ValidationError>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object