Class Expense

java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.json.GenericJson
net.amcintosh.freshbooks.models.Expense
All Implemented Interfaces:
Cloneable, Map<String,Object>, ConvertibleContent

public class Expense extends com.google.api.client.json.GenericJson implements ConvertibleContent
Expenses are used to track expenditures your business incurs.
See Also:
  • Constructor Details

    • Expense

      public Expense()
  • Method Details

    • getId

      public long getId()
      Get the unique identifier of this expense within this business.
      Returns:
      The id of the expense
    • getExpenseId

      public long getExpenseId()
      Get unique to this business id for expense. Note: This is the same as getId.
      Returns:
      The id of the expense
    • getAccountName

      public String getAccountName()
      Name of related account if applicable.
      Returns:
    • setAccountName

      public void setAccountName(String accountName)
      Name of related account if applicable.
      Parameters:
      accountName -
    • getAccountId

      public long getAccountId()
      Id of expense account if applicable.
      Returns:
    • setAccountId

      public void setAccountId(long accountId)
      Id of expense account if applicable.
      Parameters:
      accountId -
    • getAccountingSystemId

      public String getAccountingSystemId()
      Get unique identifier of business the expense exists on.
      Returns:
      Accounting System Id
    • getAmount

      public Money getAmount()
      Total amount of the expense.
      Returns:
    • setAmount

      public void setAmount(Money amount)
      Total amount of the expense.
      Parameters:
      amount -
    • getBankName

      public String getBankName()
      Name of bank expense was imported from, if applicable.
      Returns:
    • setBankName

      public void setBankName(String bankName)
      Name of bank expense was imported from, if applicable.
      Parameters:
      bankName -
    • isBillable

      public boolean isBillable()
      Can the expense be billed to a Client or Project.
      Returns:
    • setBillable

      public void setBillable(boolean billable)
      Can the expense be billed to a Client or Project.
      Parameters:
      billable -
    • getCategoryId

      public long getCategoryId()
      The id of related expense category.
      Returns:
      Id of the category
    • setCategoryId

      public void setCategoryId(long categoryId)
      Set the id of the expense category.
      Parameters:
      categoryId - Id of the category
    • getClientId

      public long getClientId()
      Id of client the expense has been assigned to if applicable.
      Returns:
      Client Id
    • setClientId

      public void setClientId(long clientId)
      Id of client to assign the expense to.
      Parameters:
      clientId - Client Id
    • getDate

      public LocalDate getDate()
      Date of the expense.
      The API returns this in YYYY-MM-DD format. It is converted to a LocalDate.
      Returns:
      converted LocalDate object
    • setDate

      public void setDate(LocalDate date)
      Date of the expense.
      This is sent to the API in YYYY-MM-DD format.
      Parameters:
      date -
    • getExtAccountId

      public String getExtAccountId()
      Get the id of related contractor account if applicable.
      Returns:
    • setExtAccountId

      public void setExtAccountId(String extAccountId)
      Set the id of related contractor account if applicable.
      Parameters:
      extAccountId -
    • getExtInvoiceId

      public long getExtInvoiceId()
      Get the id of related contractor invoice if applicable.
      Returns:
    • setExtInvoiceId

      public void setExtInvoiceId(long extInvoiceId)
      Set the id of related contractor invoice if applicable.
      Parameters:
      extInvoiceId -
    • getExtSystemId

      public long getExtSystemId()
      Get the id of related contractor system if applicable.
      Returns:
    • setExtSystemId

      public void setExtSystemId(long extSystemId)
      Set the id of related contractor system if applicable.
      Parameters:
      extSystemId -
    • isFromBulkImport

      public boolean isFromBulkImport()
      Indicates if the expense was created via a bulk import action.
      Returns:
    • isHasReceipt

      public boolean isHasReceipt()
      Indicates if the expense has an attached receipt.
      Returns:
    • setHasReceipt

      public void setHasReceipt(boolean hasReceipt)
      Indicates if the expense has an attached receipt.
      Parameters:
      hasReceipt -
    • isIncludeReceipt

      public boolean isIncludeReceipt()
    • setIncludeReceipt

      public void setIncludeReceipt(boolean includeReceipt)
    • getInvoiceId

      public long getInvoiceId()
      Get the id of related invoice if applicable.
      Returns:
    • setInvoiceId

      public void setInvoiceId(long invoiceId)
      Set the id of related invoice if applicable.
      Parameters:
      invoiceId -
    • isCogs

      public boolean isCogs()
      Get if the expense counts as "Cost of Goods Sold" and is associated with a client.
      Returns:
    • setCogs

      public void setCogs(boolean cogs)
      Set if the expense counts as "Cost of Goods Sold" and can be associated with a client.
      Parameters:
      cogs -
    • isDuplicate

      public boolean isDuplicate()
      If the expense is a duplicated expense.
      Returns:
    • setDuplicate

      public void setDuplicate(boolean duplicate)
      If the expense is a duplicated expense.
      Parameters:
      duplicate -
    • getMarkupPercent

      public String getMarkupPercent()
      Note of percent to mark expense up.
      Returns:
      String-decimal percentage
    • setMarkupPercent

      public void setMarkupPercent(String markupPercent)
      Note of percent to mark expense up.
      Parameters:
      markupPercent - String-decimal percentage
    • getModernProjectId

      public long getModernProjectId()
      Id of related new FreshBooks (not Classic) project if applicable.
      Returns:
      Project Id
    • setModernProjectId

      public void setModernProjectId(long modernProjectId)
      Set the Id of a new FreshBooks (not Classic) project to associate the expense with the project.
      Parameters:
      modernProjectId - Project Id
    • getNotes

      public String getNotes()
      Get notes about the expense.
      Returns:
    • setNotes

      public void setNotes(String notes)
      Set notes about the expense.
      Parameters:
      notes -
    • isPotentialBillPayment

      public boolean isPotentialBillPayment()
    • setPotentialBillPayment

      public void setPotentialBillPayment(boolean potentialBillPayment)
    • getProfileId

      public long getProfileId()
      Id of related recurring expense profile if applicable.
      Returns:
    • getProjectId

      public long getProjectId()
      Id of related FreshBooks Classic project if applicable.
      Returns:
      Project Id
    • setProjectId

      public void setProjectId(long projectId)
      Set the Id of a FreshBooks Classic project to associate the expense with the project.
      Parameters:
      projectId - Classic Project Id
    • getStaffId

      public long getStaffId()
      Get the id of related staff member if applicable.
      Returns:
    • setStaffId

      public void setStaffId(long staffId)
      Set the id of related staff member if applicable.
      Parameters:
      staffId -
    • getStatus

      public Expense.ExpenseStatus getStatus()
      Get the status of the expense.
      Returns:
      Enum of the expense status.
    • setStatus

      public void setStatus(Expense.ExpenseStatus status)
      Set the status of the expense. This is only writable at creation and cannot be manually set later.
      Parameters:
      status - ExpenseStatus value
    • getTaxAmount1

      public Money getTaxAmount1()
      Get the amount of the first tax making up the total amount of the expense.
      Returns:
      Object containing amount and currency code.
    • setTaxAmount1

      public void setTaxAmount1(Money taxAmount)
      Set the amount of the first tax making up the total amount of the expense.
      Parameters:
      taxAmount - Money object of required deposit
    • getTaxAmount2

      public Money getTaxAmount2()
      Get the amount of the second tax making up the total amount of the expense.
      Returns:
      Object containing amount and currency code.
    • setTaxAmount2

      public void setTaxAmount2(Money taxAmount)
      Set the amount of the second tax making up the total amount of the expense.
      Parameters:
      taxAmount - Money object of required deposit
    • getTaxName1

      public String getTaxName1()
      Get the name of first tax.
      Returns:
      Eg. "HST"
    • setTaxName1

      public void setTaxName1(String taxName)
      Set the name of first tax.
      Parameters:
      taxName - Eg. "HST"
    • getTaxName2

      public String getTaxName2()
      Get the name of second tax.
      Returns:
      Eg. "HST"
    • setTaxName2

      public void setTaxName2(String taxName)
      Set the name of second tax.
      Parameters:
      taxName - Eg. "HST"
    • getTaxPercent1

      public String getTaxPercent1()
      Get the string-decimal tax amount for first tax – indicates the maximum tax percentage for this expense.
      Returns:
    • setTaxPercent1

      public void setTaxPercent1(String taxPercent1)
      Set the string-decimal tax amount for first tax – indicates the maximum tax percentage for this expense, this does not add tax to the expense, instead use taxAmount1.
      Parameters:
      taxPercent1 -
    • getTaxPercent2

      public String getTaxPercent2()
      Get the string-decimal tax amount for second tax – indicates the maximum tax percentage for this expense.
      Returns:
    • setTaxPercent2

      public void setTaxPercent2(String taxPercent2)
      Set the string-decimal tax amount for second tax – indicates the maximum tax percentage for this expense, this does not add tax to the expense, instead use taxAmount2.
      Parameters:
      taxPercent2 -
    • getTransactionId

      public long getTransactionId()
      Get the id of related bank imported transaction if applicable.
      Returns:
    • setTransactionId

      public void setTransactionId(long transactionId)
      Set the id of related bank imported transaction if applicable.
      Parameters:
      transactionId -
    • getUpdated

      public ZonedDateTime getUpdated()
      Get the time of last modification to the invoice.

      Note: The API returns this data in "US/Eastern", but it is converted here to UTC.
      Returns:
      Updated time in UTC
    • getVendor

      public String getVendor()
      Get the name of the vendor.
      Returns:
      Eg. "Home Depot"
    • setVendor

      public void setVendor(String vendor)
      Get the name of the vendor.
      Parameters:
      vendor - Eg. "Home Depot"
    • getVisState

      public VisState getVisState()
      Get the visibility state: active, deleted, or archived

      Returns:
      Enum of the visibility state.
      See Also:
    • setVisState

      public void setVisState(VisState visState)
      Set the visibility state of the expense.

      Parameters:
      visState - VisState value
      See Also:
    • getAttachment

      public Expense.ExpenseAttachment getAttachment()
      Get the attached receipt image details.

      Note: This data is not in the default response and will only be present with the use of a corresponding "includes" filter.
      Returns:
    • setAttachment

      public void setAttachment(Expense.ExpenseAttachment attachment)
      Set the details for an attached receipt.
      Parameters:
      attachment -
    • getContent

      public Map<String,Object> getContent()
      Description copied from interface: ConvertibleContent
      Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.
      Specified by:
      getContent in interface ConvertibleContent
      Returns: