Class LineItem

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

public class LineItem extends com.google.api.client.json.GenericJson implements ConvertibleContent
Invoice lines are used to determine the amount of an invoice, in addition to being able to tie the invoice to rebilled expenses. The invoice line type determines whether a line is an amount or whether it refers to an unbilled expense.

Note: When updating lines with a PUT request, the request payload must contain all the lines of the invoice that you wish to remain.
  • Constructor Details

    • LineItem

      public LineItem()
  • Method Details

    • getLineId

      public long getLineId()
      Unique-to-this-invoice line id.
      Returns:
    • setLineId

      public void setLineId(long lineId)
      Unique-to-this-invoice line id.
      Parameters:
      lineId -
    • getAmount

      public Money getAmount()
      Amount total of a line item, calculated from unit cost, quantity and tax.
      Returns:
    • getDescription

      public String getDescription()
      Description for the line item.
      Returns:
    • setDescription

      public void setDescription(String description)
      Description for the line item.
      Parameters:
      description -
    • getExpenseId

      public long getExpenseId()
      Id of unbilled expense, required when invoice line type is REBILLING_EXPENSE, otherwise should be excluded.
      Returns:
    • setExpenseId

      public void setExpenseId(long expenseId)
      Id of unbilled expense, required when invoice line type is REBILLING_EXPENSE, otherwise should be excluded.
      Parameters:
      expenseId -
    • getName

      public String getName()
      Name for the line item.
      Returns:
    • setName

      public void setName(String name)
      Name for the line item.
      Parameters:
      name -
    • getQuantity

      public BigDecimal getQuantity()
      Decimal quantity of the line unit, multiplied against unit_cost to get amount.
      Returns:
    • setQuantity

      public void setQuantity(int quantity)
      Quantity of the line unit, multiplied against unit_cost to get amount.
      Parameters:
      quantity -
    • setQuantity

      public void setQuantity(String quantity)
      Quantity of the line unit, multiplied against unit_cost to get amount.
      Parameters:
      quantity -
    • setQuantity

      public void setQuantity(BigDecimal quantity)
      Decimal quantity of the line unit, multiplied against unit_cost to get amount.
      Parameters:
      quantity -
    • getTaxAmount1

      public String getTaxAmount1()
      First tax amount, in percentage, up to 3 decimal places.
      Returns:
    • setTaxAmount1

      public void setTaxAmount1(String taxAmount1)
      First tax amount, in percentage, up to 3 decimal places.
      Parameters:
      taxAmount1 -
    • getTaxAmount2

      public String getTaxAmount2()
      Second tax amount, in percentage, up to 3 decimal places.
      Returns:
    • setTaxAmount2

      public void setTaxAmount2(String taxAmount2)
      Second tax amount, in percentage, up to 3 decimal places.
      Parameters:
      taxAmount2 -
    • getTaxName1

      public String getTaxName1()
      Name for the first tax on the line item.
      Returns:
    • setTaxName1

      public void setTaxName1(String taxName1)
      Name for the first tax on the line item.
      Parameters:
      taxName1 -
    • getTaxName2

      public String getTaxName2()
      Name for the second tax on the line item.
      Returns:
    • setTaxName2

      public void setTaxName2(String taxName2)
      Name for the second tax on the line item.
      Parameters:
      taxName2 -
    • getTaxNumber1

      public String getTaxNumber1()
      First tax number on the line item.
      Returns:
    • getTaxNumber2

      public String getTaxNumber2()
      Second tax number on the line item.
      Returns:
    • getType

      public LineItem.LineItemType getType()
      Line item type. Either normal or a rebilling expense line.
      Returns:
    • setType

      public void setType(LineItem.LineItemType type)
      Line item type. Either normal or a rebilling expense line.
      Parameters:
      type -
    • getUnitCost

      public Money getUnitCost()
      Unit cost of the line item.
      Returns:
    • setUnitCost

      public void setUnitCost(Money unitCost)
      Unit cost of the line item.
      Parameters:
      unitCost -
    • getUpdated

      public ZonedDateTime getUpdated()
      Get the time this line was last updated at.

      Note: The API returns this data in "US/Eastern", but it is converted here to UTC.
      Returns:
      Updated time in UTC
    • 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: