com.avalara.avatax.services.tax
Class Line

java.lang.Object
  extended by com.avalara.avatax.services.tax.Line
All Implemented Interfaces:
java.io.Serializable

public class Line
extends java.lang.Object
implements java.io.Serializable

A single line within a document containing data used for calculating tax.

See Also:
GetTaxRequest, ArrayOfLine, Serialized Form

Constructor Summary
Line()
          Creates a new line object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.math.BigDecimal getAmount()
          The total amount for this line item (getQty() * UnitPrice).
 java.lang.String getCustomerUsageType()
          Allows to fetch the customer or usage type at the line level.
 java.lang.String getDescription()
          Gets the description which defines the description for the product or item.
static org.apache.axis.encoding.Deserializer getDeserializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType)
          Get Axis Custom Deserializer; this method is used internally by the adapter and not intended to be used by external implementation code.
 java.lang.String getDestinationCode()
          Used internally by the adapter to reference the getDestinationAddress().
 java.lang.String getExemptionNo()
          Exemption number for this line.
 java.lang.String getItemCode()
          Item Code (SKU)
 java.lang.String getNo()
          Line Number.
 java.lang.String getOriginCode()
          Used internally by the adapter to reference the getOriginAddress().
 java.math.BigDecimal getQty()
          The quantity represented by this line.
 java.lang.String getRef1()
          Client specific reference field.
 java.lang.String getRef2()
          Client specific reference field.
 java.lang.String getRevAcct()
          Revenue Account.
static org.apache.axis.encoding.Serializer getSerializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType)
          Get Axis Custom Serializer; this method is used internally by the adapter and not intended to be used by external implementation code.
 java.lang.String getTaxCode()
          System or Custom Tax Code.
 TaxOverride getTaxOverride()
          Gets the taxOverride value for this Line.
static org.apache.axis.description.TypeDesc getTypeDesc()
          Return Axis type metadata object; this method is used internally by the adapter and not intended to be used by external implementation code.
 int hashCode()
          Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
 boolean isDiscounted()
          True if the document discount should be applied to this line.
 boolean isTaxIncluded()
          True if tax is included in the line.
 void setAmount(java.math.BigDecimal amount)
          The total amount for this line item (getQty() * UnitPrice).
 void setCustomerUsageType(java.lang.String customerUsageType)
          Allows specifying the customer or usage type at the line level.
 void setDescription(java.lang.String description)
          Sets the description which defines the description for the product or item.
 void setDestinationCode(java.lang.String destinationCode)
          Used internally by the adapter to reference the getDestinationAddress().
 void setDiscounted(boolean discounted)
          True if the document discount should be applied to this line.
 void setExemptionNo(java.lang.String exemptionNo)
          Exemption number for this line.
 void setItemCode(java.lang.String itemCode)
          Item Code (SKU)
 void setNo(java.lang.String no)
          Line Number.
 void setOriginCode(java.lang.String originCode)
          Used internally by the adapter to reference the getOriginAddress().
 void setQty(java.math.BigDecimal qty)
          The quantity represented by this line.
 void setRef1(java.lang.String ref1)
          Client specific reference field.
 void setRef2(java.lang.String ref2)
          Client specific reference field.
 void setRevAcct(java.lang.String revAcct)
          Revenue Account.
 void setTaxCode(java.lang.String taxCode)
          System or Custom Tax Code.
 void setTaxIncluded(boolean taxIncluded)
          True if tax is included in the line.
 void setTaxOverride(TaxOverride taxOverride)
          Sets the taxOverride value for this Line.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Line

public Line()
Creates a new line object.
Example:
 [Java]
 Line line = new Line();
 

Method Detail

getNo

public java.lang.String getNo()
Line Number.

Lines are added to a GetTaxRequest object when preparing a document for tax calculation. The line No unqiuely identifies a particular line item for the client.

 [Java]
  GetTaxRequest request = new GetTaxRequest();
  Line line = new Line(request);
  line.setNo("01");
  line = new Line(request);
  line.setNo("02");

  System.out.println("No Lines: " + request.getLines().getLine().length); // 2 Lines

  System.out.println("1st Line's Number: " + request.getLines().getLine(0).getNo()); // "01"

  System.out.println("1st Line's Number: " + request.getLines().getLine(1).getNo());  // "02"
  

Returns:
no

setNo

public void setNo(java.lang.String no)
Line Number.

Lines are added to a GetTaxRequest object when preparing a document for tax calculation. The line No unqiuely identifies a particular line item for the client.

 [Java]
  GetTaxRequest request = new GetTaxRequest();
  Line line = new Line(request);
  line.setNo("01");
  line = new Line(request);
  line.setNo("02");

  System.out.println("No Lines: " + request.getLines().getLine().length); // 2 Lines

  System.out.println("1st Line's Number: " + request.getLines().getLine(0).getNo()); // "01"

  System.out.println("1st Line's Number: " + request.getLines().getLine(1).getNo());  // "02"
  

Parameters:
no -

getOriginCode

public java.lang.String getOriginCode()
Used internally by the adapter to reference the getOriginAddress(). Same as the OriginAddress's BaseAddress.getAddressCode().

Returns:
An internally maintained value representing the OriginAddress
See Also:
originCode

setOriginCode

public void setOriginCode(java.lang.String originCode)
Used internally by the adapter to reference the getOriginAddress(). Same as the OriginAddress's BaseAddress.getAddressCode(). Made private to avoid data corruption.

Parameters:
originCode -

getDestinationCode

public java.lang.String getDestinationCode()
Used internally by the adapter to reference the getDestinationAddress(). Same as the DestinationAddress's BaseAddress.getAddressCode().

Returns:
An internally maintained value representing the DestinationAddress

setDestinationCode

public void setDestinationCode(java.lang.String destinationCode)
Used internally by the adapter to reference the getDestinationAddress(). Same as the DestinationAddress's BaseAddress.getAddressCode(). Made private to avoid data corruption.

Parameters:
destinationCode -

getItemCode

public java.lang.String getItemCode()
Item Code (SKU)

Returns:
itemCode

setItemCode

public void setItemCode(java.lang.String itemCode)
Item Code (SKU)

Parameters:
itemCode -

getTaxCode

public java.lang.String getTaxCode()
System or Custom Tax Code.

This is used only by sellers who are managing their own tax code mapping.

Returns:
taxCode

setTaxCode

public void setTaxCode(java.lang.String taxCode)
System or Custom Tax Code.

This is used only by sellers who are managing their own tax code mapping.

Parameters:
taxCode -

getQty

public java.math.BigDecimal getQty()
The quantity represented by this line.

Qty is not used in conjunction with getAmount() when calculating tax. Amount should already be a product of Qty * UnitPrice. For example, if a line represents 2 items, each sold at $10 then,

 [Java]
 BigDecimal qty = line.getQty();
 BigDecimal amount = line.getAmount();
 

Returns:
qty
See Also:
setAmount(java.math.BigDecimal)

setQty

public void setQty(java.math.BigDecimal qty)
The quantity represented by this line.

Qty is not used in conjunction with getAmount() when calculating tax. Amount should already be a product of Qty * UnitPrice. For example, if a line represents 2 items, each sold at $10 then,

 [Java]
 line.setQty(new BigDecimal("2"))
 line.setAmount(new BigDecimal("20"))
 

Parameters:
qty -
See Also:
getAmount()

getAmount

public java.math.BigDecimal getAmount()
The total amount for this line item (getQty() * UnitPrice).

Returns:
amount

setAmount

public void setAmount(java.math.BigDecimal amount)
The total amount for this line item (getQty() * UnitPrice).

Parameters:
amount -

isDiscounted

public boolean isDiscounted()
True if the document discount should be applied to this line.

Returns:
discounted

setDiscounted

public void setDiscounted(boolean discounted)
True if the document discount should be applied to this line.

Parameters:
discounted -

getRevAcct

public java.lang.String getRevAcct()
Revenue Account.

Returns:
revAcct

setRevAcct

public void setRevAcct(java.lang.String revAcct)
Revenue Account.

Parameters:
revAcct -

getRef1

public java.lang.String getRef1()
Client specific reference field.

Returns:
ref1

setRef1

public void setRef1(java.lang.String ref1)
Client specific reference field.

Parameters:
ref1 -

getRef2

public java.lang.String getRef2()
Client specific reference field.

Returns:
ref2

setRef2

public void setRef2(java.lang.String ref2)
Client specific reference field.

Parameters:
ref2 -

getExemptionNo

public java.lang.String getExemptionNo()
Exemption number for this line.

Returns:
exemptionNo

setExemptionNo

public void setExemptionNo(java.lang.String exemptionNo)
Exemption number for this line.

Parameters:
exemptionNo -

getCustomerUsageType

public java.lang.String getCustomerUsageType()
Allows to fetch the customer or usage type at the line level.

This overrides CustomerUsageType GetTaxRequest.getCustomerUsageType() at the GetTaxRequest level.

Returns:
customerUsageType

setCustomerUsageType

public void setCustomerUsageType(java.lang.String customerUsageType)
Allows specifying the customer or usage type at the line level.

This overrides CustomerUsageType GetTaxRequest.getCustomerUsageType() at the GetTaxRequest level.

Parameters:
customerUsageType -

getDescription

public java.lang.String getDescription()
Gets the description which defines the description for the product or item.

Returns:
description

setDescription

public void setDescription(java.lang.String description)
Sets the description which defines the description for the product or item.

Parameters:
description -

getTaxOverride

public TaxOverride getTaxOverride()
Gets the taxOverride value for this Line.

Returns:
taxOverride

setTaxOverride

public void setTaxOverride(TaxOverride taxOverride)
Sets the taxOverride value for this Line.

Parameters:
taxOverride -

isTaxIncluded

public boolean isTaxIncluded()
True if tax is included in the line.

Returns:
taxIncluded

setTaxIncluded

public void setTaxIncluded(boolean taxIncluded)
True if tax is included in the line.

Parameters:
taxIncluded -

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

Overrides:
hashCode in class java.lang.Object
Returns:
hash code for this GetTaxRequest object
See Also:
Object.hashCode()

getTypeDesc

public static org.apache.axis.description.TypeDesc getTypeDesc()
Return Axis type metadata object; this method is used internally by the adapter and not intended to be used by external implementation code.

Returns:
TypeDesc

getSerializer

public static org.apache.axis.encoding.Serializer getSerializer(java.lang.String mechType,
                                                                java.lang.Class _javaType,
                                                                javax.xml.namespace.QName _xmlType)
Get Axis Custom Serializer; this method is used internally by the adapter and not intended to be used by external implementation code.

Parameters:
mechType -
_javaType -
_xmlType -
Returns:
Serializer

getDeserializer

public static org.apache.axis.encoding.Deserializer getDeserializer(java.lang.String mechType,
                                                                    java.lang.Class _javaType,
                                                                    javax.xml.namespace.QName _xmlType)
Get Axis Custom Deserializer; this method is used internally by the adapter and not intended to be used by external implementation code.

Parameters:
mechType -
_javaType -
_xmlType -
Returns:
Deserializer