Class TaxRequestLine
java.lang.Object
com.onenetwork.platform.common.tax.TaxRequestLine
public class TaxRequestLine
extends java.lang.Object
Represents a single line of a transaction that needs the tax due determined by a TaxProvider.
The following fields are required:
- shipToAddress - Address where the item is being shipped to
- shipFromAddress - Address where the item is being shipped from
- quantity - number of the item being shipped
- unitPrice - price for each item being shipped
- unitPriceCurrency - Price currency of item being shipped
- itemCode - unique identifier for the item being shipped. Likely to be item.getItemName()
- taxCode - TaxCode for the item being shipped. This is specific to the provider the request is being made to. Can be obtained with TaxService.getTaxCode();
- hsCode - HS Code for the item being shipped.
- sysEntId - enterprise id to calculate the tax upon item being shipped.
-
Constructor Summary
Constructors Constructor Description TaxRequestLine(Address shipTo, Address shipFrom, int quantity, double unitPrice, java.lang.String itemCode, java.lang.String taxCode)
Constructs a TaxRequestLine with all the required parameters. -
Method Summary
Modifier and Type Method Description java.util.Optional<java.lang.String>
getDescription()
Description of this linejava.lang.String
getHsCode()
HS code (i.e.java.lang.String
getItemCode()
Unique String identifying the itemint
getQuantity()
number of items being sentAddress
getShipFromAddress()
Address this line is coming fromAddress
getShipToAddress()
Address this line is going tojava.lang.Long
getSysEntId()
Enterprise id for which needs tax calculation.java.lang.String
getTaxCode()
TaxCode string identifying what type of item this is.double
getUnitPrice()
Price per item being sentjava.lang.String
getUnitPriceCurrency()
Currency for unit price of an itemvoid
setDescription(java.lang.String description)
Set the description of this linevoid
setHsCode(java.lang.String hsCode)
Sets HS code (i.e.void
setItemCode(java.lang.String itemCode)
Set the unique String identifying the item Passing a null value will result in a NullPointerException Generally this should be the item name: item.getItemName()void
setQuantity(int quantity)
Set the number of items being sentvoid
setShipFromAddress(Address address)
Set Address this line is coming from Passing a null value will result in a NullPointerExceptionvoid
setShipToAddress(Address address)
Set Address this line is going to Passing a null value will result in a NullPointerExceptionvoid
setSysEntId(java.lang.Long sysEntId)
Sets the enterprise id for which needs tax calculation.void
setTaxCode(java.lang.String taxCode)
Sets the TaxCode string identifying what type of item this is.void
setUnitPrice(double unitPrice)
Set the price per item being sentvoid
setUnitPriceCurrency(java.lang.String unitPriceCurrency)
Sets currency for unit price of an item
-
Constructor Details
-
TaxRequestLine
public TaxRequestLine(Address shipTo, Address shipFrom, int quantity, double unitPrice, java.lang.String itemCode, java.lang.String taxCode)Constructs a TaxRequestLine with all the required parameters. None of the parameters may be null. Any other parameters on the TaxRequestLine may be added via the setters on this class. Attempting to pass a null value to this constructor will result in a NullPointerException.
-
-
Method Details
-
getShipToAddress
Address this line is going to -
setShipToAddress
Set Address this line is going to Passing a null value will result in a NullPointerException -
getShipFromAddress
Address this line is coming from -
setShipFromAddress
Set Address this line is coming from Passing a null value will result in a NullPointerException -
getQuantity
public int getQuantity()number of items being sent -
setQuantity
public void setQuantity(int quantity)Set the number of items being sent -
getUnitPrice
public double getUnitPrice()Price per item being sent -
setUnitPrice
public void setUnitPrice(double unitPrice)Set the price per item being sent -
getItemCode
public java.lang.String getItemCode()Unique String identifying the item -
setItemCode
public void setItemCode(java.lang.String itemCode)Set the unique String identifying the item Passing a null value will result in a NullPointerException Generally this should be the item name: item.getItemName() -
getDescription
public java.util.Optional<java.lang.String> getDescription()Description of this line -
setDescription
public void setDescription(java.lang.String description)Set the description of this line -
getTaxCode
public java.lang.String getTaxCode()TaxCode string identifying what type of item this is. This will be specific to the provider being used. This should be determined via TaxService.getTaxCode(); -
setTaxCode
public void setTaxCode(java.lang.String taxCode)Sets the TaxCode string identifying what type of item this is. Passing a null value will result in a NullPointerException -
getHsCode
public java.lang.String getHsCode()HS code (i.e. Harmonized System) of an item. -
setHsCode
public void setHsCode(java.lang.String hsCode)Sets HS code (i.e. Harmonized System) of an item. -
getSysEntId
public java.lang.Long getSysEntId()Enterprise id for which needs tax calculation. -
setSysEntId
public void setSysEntId(java.lang.Long sysEntId)Sets the enterprise id for which needs tax calculation. -
getUnitPriceCurrency
public java.lang.String getUnitPriceCurrency()Currency for unit price of an item -
setUnitPriceCurrency
public void setUnitPriceCurrency(java.lang.String unitPriceCurrency)Sets currency for unit price of an item
-