public final class CSOrderItem extends CSItem
The CSOrderItem
class includes methods for the retrieval of a particular order item's details.
All such methods require that certain database and key information (order item ID, for example) be specified via the
set
methods provided, prior to their invocation.
All database access/connectivity is handled internally by the CSOrderItem
class.
CSOrderItemContent
,
CSOrderItemMultiple
,
CSState
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
LINE_TYPE_DISCOUNT
A valid value that can be used to set the line type for this order item.
|
static java.lang.String |
LINE_TYPE_ITEM
A valid value that can be used to set the line type for this order item.
|
static java.lang.String |
LINE_TYPE_SHIPPING
A valid value that can be used to set the line type for this order item.
|
static java.lang.String |
LINE_TYPE_TOTAL
A valid value that can be used to set the line type for this order item.
|
ACCESS_GRANTED, DOES_NOT_EXIST, EMPTY, EXISTS, SECURE_ACCESS_DENIED, SECURE_ACCESS_GRANTED, UPDATE_ACTION_INSERTED, UPDATE_ACTION_UPDATED
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSOrderItem()
Creates an empty
CSOrderItem object. |
CSOrderItem(CSOrderItem objItem)
Creates an empty
CSOrderItem object, and initialises it from the contents of the supplied CSItem
object. |
CSOrderItem(java.lang.String strPropertyFile)
Creates a new
CSOrderItem , specifying a property file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Removes the order item and associated order item dispatches from the database.
|
boolean |
exist()
Determines whether an order item exists on the database.
|
void |
get()
Retrieves the details of an order item from the database.
|
java.lang.String |
getBasketItemUserData()
Gets the basket item user data of the order item.
|
java.lang.Double |
getCountryTotal()
Gets the overall total price of the order item in the currency of the invoice country.
|
java.lang.Double |
getCountryTotalDiscount()
Gets the amount of discount on the order item in the currency of the invoice country.
|
java.lang.Double |
getCountryTotalTax()
Gets the total VAT applied to the order item in the currency of the invoice country.
|
java.lang.Double |
getCountryUnitPrice()
Gets the net unit price of the order item in the currency of the invoice country.
|
java.lang.Integer |
getDecimalPlaces()
Gets the decimal places setting to be applied to the product type's price.
|
java.lang.String |
getDescription()
Gets the description of the order item.
|
java.lang.String |
getDiscountSchemeName()
Gets the name of the discount scheme to be applied to the order item.
|
int |
getLineNumber()
Gets the line number of the order item to be used as key information.
|
java.lang.String |
getLineType()
Gets the line type of the order item.
|
int |
getOrderID()
Gets the ID of the order associated with the order item to be used as key information.
|
CSOrderItemDispatchMultiple |
getOrderItemDispatchMultiple()
Gets the
CSOrderItemDispatchMultiple object containing the CSOrderItemDispatch objects associated
with this order item. |
int |
getOrderItemID()
Gets the ID of the order item to be used as key information.
|
java.lang.String |
getProductOptionUserData()
Gets the product option user data of the order item.
|
java.lang.String |
getProductTypeUserData()
Gets the product type user data of the order item.
|
java.lang.Integer |
getQuantity()
Gets the quantity of the order item.
|
java.lang.String |
getStockCode()
Gets the stock code of the order item.
|
int |
getTaxSchemeID()
Gets the ID of the VAT scheme to be applied to the order item.
|
java.lang.String |
getTaxSchemeName()
Gets the name of the VAT scheme to be applied to the order item.
|
double |
getTotal()
Gets the overall total price of the order item.
|
java.lang.Double |
getTotalDiscount()
Gets the total discount applied to the order item.
|
java.lang.Double |
getTotalTax()
Gets the total tax applied to the order item.
|
java.lang.Double |
getUnitPrice()
Gets the unit price of the order item.
|
void |
setBasketItemUserData(java.lang.String strBasketItemUserData)
Sets the basket item user data of the order item.
|
void |
setCountryTotal(java.lang.Double nCountryTotal)
Sets the overall total price of the order item in the currency of the invoice country.
|
void |
setCountryTotalDiscount(java.lang.Double nCountryTotalDiscount)
Sets the amount of discount on the order item in the currency of the invoice country.
|
void |
setCountryTotalTax(java.lang.Double nCountryTotalTax)
Sets the total VAT applied to the order item in the currency of the invoice country.
|
void |
setCountryUnitPrice(java.lang.Double nCountryUnitPrice)
Sets the net unit price of the order item in the currency of the invoice country.
|
void |
setDecimalPlaces(java.lang.Integer nDecimalPlaces)
Sets the decimal places setting to be applied to the product type's price.
|
void |
setDescription(java.lang.String strDescription)
Sets the description of the order item.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setDiscountSchemeName(java.lang.String strDiscountSchemeName)
Sets the name of the discount scheme to be applied to the order item.
|
void |
setLineNumber(int strLineNumber)
Sets the line number of the order item to be used as key information.
|
void |
setLineType(java.lang.String strLineType)
Sets the line type of the order item.
|
void |
setOrderID(int nOrderID)
Sets the ID of the order associated with the order item to be used as key information.
|
void |
setOrderItemDispatchMultiple(CSOrderItemDispatchMultiple objOrderItemDispatchMultiple)
Sets the
CSOrderItemDispatchMultiple object containing the CSOrderItemDispatch objects associated
with this order item. |
void |
setOrderItemID(int nOrderItemID)
Sets the order item ID to be used as key information.
|
void |
setProductOptionUserData(java.lang.String strProductOptionUserData)
Sets the product option user data of the order item.
|
void |
setProductTypeUserData(java.lang.String strProductTypeUserData)
Sets the product type user data of the order item.
|
void |
setQuantity(java.lang.Integer nQuantity)
Sets the quantity of the order item.
|
void |
setStockCode(java.lang.String strStockCode)
Sets the stock code of the order item.
|
void |
setTaxSchemeID(int nTaxSchemeID)
Sets the ID of the VAT scheme to be applied to the order item.
|
void |
setTaxSchemeName(java.lang.String strTaxSchemeName)
Sets the name of the VAT scheme to be applied to the order item.
|
void |
setTotal(double nTotal)
Sets the overall total price of the order item.
|
void |
setTotalDiscount(java.lang.Double nTotalDiscount)
Sets the total discount applied to the order item.
|
void |
setTotalTax(java.lang.Double nTotalTax)
Sets the total tax applied to the order item.
|
void |
setUnitPrice(java.lang.Double nUnitPrice)
Sets the unit price of the order item.
|
void |
update()
Inserts a new order item if no order item ID has been specified and a matching order item cannot be found.
|
equals, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, toString, unset
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public static final java.lang.String LINE_TYPE_ITEM
LINE_TYPE_ITEM
indicates
that this order item is a product item.public static final java.lang.String LINE_TYPE_DISCOUNT
LINE_TYPE_DISCOUNT
indicates that this order item is a discount item.public static final java.lang.String LINE_TYPE_SHIPPING
LINE_TYPE_SHIPPING
indicates that this order item is a shipping item.public static final java.lang.String LINE_TYPE_TOTAL
LINE_TYPE_TOTAL
indicates
that this order item is a total item.public CSOrderItem()
CSOrderItem
object.
Use the various set methods provided to initialise the CSOrderItem
object prior to invoking any of
its query methods.
public CSOrderItem(CSOrderItem objItem)
CSOrderItem
object, and initialises it from the contents of the supplied CSItem
object.
objItem
- the CSOrderItem
object to be used to initialise the new onepublic CSOrderItem(java.lang.String strPropertyFile)
CSOrderItem
, specifying a property file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSOrderItem
object prior to invoking any of
its query methods.
strPropertyFile
- the property file that contains the connection details.public int getOrderItemID()
public void setOrderItemID(int nOrderItemID)
setOrderItemID
followed by a call to get
will return details of the order item with
the specified ID.
nOrderItemID
- the order item's ID to be used as key information.public java.lang.Integer getDecimalPlaces()
If set to null then the decimal places as defined in the iCM Commerce Settings will be used.
public void setDecimalPlaces(java.lang.Integer nDecimalPlaces)
If set to null then the decimal places as defined in the iCM Commerce Settings will be used.
nDecimalPlaces
- the decimal places setting.public int getOrderID()
public void setOrderID(int nOrderID)
setOrderID
followed by a call to setLineNumber
and get
will return details of the order item associated with the specified order ID and line number.
nOrderID
- the order item's associated order ID to be used as key information.public int getLineNumber()
public void setLineNumber(int strLineNumber)
setLineNumber
followed by a call to setOrderID
and get
will return details of the order item associated with the specified line number and order ID.
strLineNumber
- the order item's line number to be used as key information.public java.lang.String getLineType()
public void setLineType(java.lang.String strLineType) throws CSParameterException
The valid line types are as follows :
Item
Discount
Shipping
Total
strLineType
- the order item's line type.CSParameterException
- if an invalid line type is specified.public java.lang.String getStockCode()
public void setStockCode(java.lang.String strStockCode)
strStockCode
- the order item's stock code.public java.lang.String getDescription()
public void setDescription(java.lang.String strDescription)
strDescription
- the order item's description.public java.lang.Double getUnitPrice()
public void setUnitPrice(java.lang.Double nUnitPrice)
nUnitPrice
- the order item's unit price.public java.lang.Integer getQuantity()
public void setQuantity(java.lang.Integer nQuantity)
nQuantity
- the order item's quantity.public java.lang.String getDiscountSchemeName()
public void setDiscountSchemeName(java.lang.String strDiscountSchemeName)
strDiscountSchemeName
- the order item's discount scheme name.public java.lang.Double getTotalDiscount()
public void setTotalDiscount(java.lang.Double nTotalDiscount)
nTotalDiscount
- the order item's total discount.public int getTaxSchemeID()
public void setTaxSchemeID(int nTaxSchemeID)
nTaxSchemeID
- the order item's VAT scheme ID.public java.lang.String getTaxSchemeName()
public void setTaxSchemeName(java.lang.String strTaxSchemeName)
strTaxSchemeName
- the order item's VAT scheme name.public java.lang.Double getTotalTax()
public void setTotalTax(java.lang.Double nTotalTax)
nTotalTax
- the order item's total tax.public double getTotal()
public void setTotal(double nTotal)
nTotal
- the order item's overall total price.public java.lang.Double getCountryUnitPrice()
public void setCountryUnitPrice(java.lang.Double nCountryUnitPrice)
nCountryUnitPrice
- the order item's net unit price in the currency of the invoice country.public java.lang.Double getCountryTotalDiscount()
public void setCountryTotalDiscount(java.lang.Double nCountryTotalDiscount)
nCountryTotalDiscount
- the order item's amount of discount in the currency of the invoice country.public java.lang.Double getCountryTotalTax()
public void setCountryTotalTax(java.lang.Double nCountryTotalTax)
nCountryTotalTax
- the order item's applied VAT in the currency of the invoice country.public java.lang.Double getCountryTotal()
public void setCountryTotal(java.lang.Double nCountryTotal)
nCountryTotal
- the order item's overall total price in the currency of the invoice country.public java.lang.String getProductOptionUserData()
public void setProductOptionUserData(java.lang.String strProductOptionUserData)
strProductOptionUserData
- the order item's product option user data.public java.lang.String getProductTypeUserData()
public void setProductTypeUserData(java.lang.String strProductTypeUserData)
strProductTypeUserData
- the order item's product type user data.public java.lang.String getBasketItemUserData()
public void setBasketItemUserData(java.lang.String strBasketItemUserData)
strBasketItemUserData
- the order item's basket item user data.public CSOrderItemDispatchMultiple getOrderItemDispatchMultiple()
CSOrderItemDispatchMultiple
object containing the CSOrderItemDispatch
objects associated
with this order item.
CSOrderItemDispatchMultiple
populated with CSOrderItemDispatch
objects which represent
order item dispatches associated with this order item.public void setOrderItemDispatchMultiple(CSOrderItemDispatchMultiple objOrderItemDispatchMultiple)
CSOrderItemDispatchMultiple
object containing the CSOrderItemDispatch
objects associated
with this order item.
objOrderItemDispatchMultiple
- a CSOrderItemDispatchMultiple
object populated with CSOrderItemDispatch
objects each
of which represents an order item dispatch associated with this order item.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for an order item are :
LEVEL_ID
Retrieves the OrderItemID.LEVEL_SUMMARY
Retrieves all order item data except UserDataSet.LEVEL_ALL
Retrieves all order item data and associated order item dispatches.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public boolean exist() throws CSException
Use setOrderItemID
followed by exist
to ascertain if there is an
order item with the specified ID on the database.
Use setOrderID
in conjunction with setLineNumber
followed by
exist
to ascertain if there is an order item associated with the specified order ID and line
number on the database.
exist
in class CSItem
true
if this order item exists on the database.CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void get() throws CSException
If it is not necessary to retrieve all the details of the order item then specify the amount of detail required
using the setDetailLevel
method before calling this method.
Use setOrderItemID
followed by get
to populate this
CSOrderItem
object with the details of the order item identified by the specified ID.
Use setOrderID
in conjunction with setLineNumber
followed by
get
to populate this CSOrderItem
object with the details of the order item
associated with the specified order ID and line number.
get
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified order item cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void update() throws CSException
Use setOrderID
in conjunction with setLineNumber
followed by
update
to insert a new order item if the order item associated with the specified order ID and
line number does not already exist.
For LINE_TYPE_ITEM
the data inserted is order ID, line number, line type, product type user data,
product option user data, basket item user data, total, country unit price, country total discount, country total
tax, country total, stock code, description, unit price, quantity, tax scheme name, total tax, discount scheme
name, total discount and order item dispatches.
For LINE_TYPE_DISCOUNT
, LINE_TYPE_SHIPPING
and LINE_TYPE_TOTAL
the data insert is
order ID, line number, line type, total, country unit price, country total discount, country total tax and
country total.
update
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified order item cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
Use setOrderItemID
followed by delete
to remove the order item
identified by the specified ID from the database.
Use setOrderID
in conjunction with setLineNumber
followed by
delete
to remove the order item associated with the specified order ID and line number.
Any order item dispatches associated with the deleted order item will also be deleted.
delete
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified order item cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.