Class CreditNote

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

public class CreditNote
extends Object
CreditNote
  • Constructor Details

    • CreditNote

      public CreditNote()
  • Method Details

    • type

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

      public CreditNote.TypeEnum getType()
      See Credit Note Types
      Returns:
      type
    • setType

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

      public CreditNote contact​(Contact contact)
    • getContact

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

      public void setContact​(Contact contact)
    • date

      public CreditNote date​(String date)
    • getDate

      public String getDate()
      The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then 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)
    • status

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

      public CreditNote.StatusEnum getStatus()
      See Credit Note Status Codes
      Returns:
      status
    • setStatus

      public void setStatus​(CreditNote.StatusEnum status)
    • lineAmountTypes

      public CreditNote lineAmountTypes​(LineAmountTypes lineAmountTypes)
    • getLineAmountTypes

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

      public void setLineAmountTypes​(LineAmountTypes lineAmountTypes)
    • lineItems

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

      public CreditNote addLineItemsItem​(LineItem lineItemsItem)
    • getLineItems

      public List<LineItem> getLineItems()
      See Invoice Line Items
      Returns:
      lineItems
    • setLineItems

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

      public CreditNote subTotal​(Double subTotal)
    • getSubTotal

      public Double getSubTotal()
      The subtotal of the credit note excluding taxes
      Returns:
      subTotal
    • setSubTotal

      public void setSubTotal​(Double subTotal)
    • totalTax

      public CreditNote totalTax​(Double totalTax)
    • getTotalTax

      public Double getTotalTax()
      The total tax on the credit note
      Returns:
      totalTax
    • setTotalTax

      public void setTotalTax​(Double totalTax)
    • total

      public CreditNote total​(Double total)
    • getTotal

      public Double getTotal()
      The total of the Credit Note(subtotal + total tax)
      Returns:
      total
    • setTotal

      public void setTotal​(Double total)
    • getUpdatedDateUTC

      public String getUpdatedDateUTC()
      UTC timestamp of last update to the credit note
      Returns:
      updatedDateUTC
    • getUpdatedDateUTCAsDate

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

      public CreditNote currencyCode​(CurrencyCode currencyCode)
    • getCurrencyCode

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

      public void setCurrencyCode​(CurrencyCode currencyCode)
    • fullyPaidOnDate

      public CreditNote fullyPaidOnDate​(String fullyPaidOnDate)
    • getFullyPaidOnDate

      public String getFullyPaidOnDate()
      Date when credit note was fully paid(UTC format)
      Returns:
      fullyPaidOnDate
    • getFullyPaidOnDateAsDate

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

      public void setFullyPaidOnDate​(String fullyPaidOnDate)
    • setFullyPaidOnDate

      public void setFullyPaidOnDate​(org.threeten.bp.LocalDate fullyPaidOnDate)
    • creditNoteID

      public CreditNote creditNoteID​(UUID creditNoteID)
    • getCreditNoteID

      public UUID getCreditNoteID()
      Xero generated unique identifier
      Returns:
      creditNoteID
    • setCreditNoteID

      public void setCreditNoteID​(UUID creditNoteID)
    • creditNoteNumber

      public CreditNote creditNoteNumber​(String creditNoteNumber)
    • getCreditNoteNumber

      public String getCreditNoteNumber()
      ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings)
      Returns:
      creditNoteNumber
    • setCreditNoteNumber

      public void setCreditNoteNumber​(String creditNoteNumber)
    • reference

      public CreditNote reference​(String reference)
    • getReference

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

      public void setReference​(String reference)
    • getSentToContact

      public Boolean getSentToContact()
      boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only)
      Returns:
      sentToContact
    • currencyRate

      public CreditNote 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
      Returns:
      currencyRate
    • setCurrencyRate

      public void setCurrencyRate​(Double currencyRate)
    • remainingCredit

      public CreditNote remainingCredit​(Double remainingCredit)
    • getRemainingCredit

      public Double getRemainingCredit()
      The remaining credit balance on the Credit Note
      Returns:
      remainingCredit
    • setRemainingCredit

      public void setRemainingCredit​(Double remainingCredit)
    • allocations

      public CreditNote allocations​(List<Allocation> allocations)
    • addAllocationsItem

      public CreditNote addAllocationsItem​(Allocation allocationsItem)
    • getAllocations

      public List<Allocation> getAllocations()
      See Allocations
      Returns:
      allocations
    • setAllocations

      public void setAllocations​(List<Allocation> allocations)
    • appliedAmount

      public CreditNote appliedAmount​(Double appliedAmount)
    • getAppliedAmount

      public Double getAppliedAmount()
      The amount of applied to an invoice
      Returns:
      appliedAmount
    • setAppliedAmount

      public void setAppliedAmount​(Double appliedAmount)
    • payments

      public CreditNote payments​(List<Payment> payments)
    • addPaymentsItem

      public CreditNote addPaymentsItem​(Payment paymentsItem)
    • getPayments

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

      public void setPayments​(List<Payment> payments)
    • brandingThemeID

      public CreditNote brandingThemeID​(UUID brandingThemeID)
    • getBrandingThemeID

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

      public void setBrandingThemeID​(UUID brandingThemeID)
    • statusAttributeString

      public CreditNote statusAttributeString​(String statusAttributeString)
    • getStatusAttributeString

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

      public void setStatusAttributeString​(String statusAttributeString)
    • hasAttachments

      public CreditNote hasAttachments​(Boolean hasAttachments)
    • getHasAttachments

      public Boolean getHasAttachments()
      boolean to indicate if a credit note has an attachment
      Returns:
      hasAttachments
    • setHasAttachments

      public void setHasAttachments​(Boolean hasAttachments)
    • hasErrors

      public CreditNote hasErrors​(Boolean hasErrors)
    • getHasErrors

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

      public void setHasErrors​(Boolean hasErrors)
    • validationErrors

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

      public CreditNote 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)
    • 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