Package net.amcintosh.freshbooks.models
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
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.
Note: When updating lines with a PUT request, the request payload must contain all the lines of the invoice that you wish to remain.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAmount total of a line item, calculated from unit cost, quantity and tax.Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.Description for the line item.long
Id of unbilled expense, required when invoice line type is REBILLING_EXPENSE, otherwise should be excluded.long
Unique-to-this-invoice line id.getName()
Name for the line item.Decimal quantity of the line unit, multiplied against unit_cost to get amount.First tax amount, in percentage, up to 3 decimal places.Second tax amount, in percentage, up to 3 decimal places.Name for the first tax on the line item.Name for the second tax on the line item.First tax number on the line item.Second tax number on the line item.getType()
Line item type.Unit cost of the line item.Get the time this line was last updated at.void
setDescription
(String description) Description for the line item.void
setExpenseId
(long expenseId) Id of unbilled expense, required when invoice line type is REBILLING_EXPENSE, otherwise should be excluded.void
setLineId
(long lineId) Unique-to-this-invoice line id.void
Name for the line item.void
setQuantity
(int quantity) Quantity of the line unit, multiplied against unit_cost to get amount.void
setQuantity
(String quantity) Quantity of the line unit, multiplied against unit_cost to get amount.void
setQuantity
(BigDecimal quantity) Decimal quantity of the line unit, multiplied against unit_cost to get amount.void
setTaxAmount1
(String taxAmount1) First tax amount, in percentage, up to 3 decimal places.void
setTaxAmount2
(String taxAmount2) Second tax amount, in percentage, up to 3 decimal places.void
setTaxName1
(String taxName1) Name for the first tax on the line item.void
setTaxName2
(String taxName2) Name for the second tax on the line item.void
setType
(LineItem.LineItemType type) Line item type.void
setUnitCost
(Money unitCost) Unit cost of the line item.Methods inherited from class com.google.api.client.json.GenericJson
clone, getFactory, set, setFactory, toPrettyString, toString
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
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
Amount total of a line item, calculated from unit cost, quantity and tax.- Returns:
-
getDescription
Description for the line item.- Returns:
-
setDescription
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
Name for the line item.- Returns:
-
setName
Name for the line item.- Parameters:
name
-
-
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
Quantity of the line unit, multiplied against unit_cost to get amount.- Parameters:
quantity
-
-
setQuantity
Decimal quantity of the line unit, multiplied against unit_cost to get amount.- Parameters:
quantity
-
-
getTaxAmount1
First tax amount, in percentage, up to 3 decimal places.- Returns:
-
setTaxAmount1
First tax amount, in percentage, up to 3 decimal places.- Parameters:
taxAmount1
-
-
getTaxAmount2
Second tax amount, in percentage, up to 3 decimal places.- Returns:
-
setTaxAmount2
Second tax amount, in percentage, up to 3 decimal places.- Parameters:
taxAmount2
-
-
getTaxName1
Name for the first tax on the line item.- Returns:
-
setTaxName1
Name for the first tax on the line item.- Parameters:
taxName1
-
-
getTaxName2
Name for the second tax on the line item.- Returns:
-
setTaxName2
Name for the second tax on the line item.- Parameters:
taxName2
-
-
getTaxNumber1
First tax number on the line item.- Returns:
-
getTaxNumber2
Second tax number on the line item.- Returns:
-
getType
Line item type. Either normal or a rebilling expense line.- Returns:
-
setType
Line item type. Either normal or a rebilling expense line.- Parameters:
type
-
-
getUnitCost
Unit cost of the line item.- Returns:
-
setUnitCost
Unit cost of the line item.- Parameters:
unitCost
-
-
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
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 interfaceConvertibleContent
- Returns:
-