com.konakart.app
Class OrderProduct

java.lang.Object
  extended by com.konakart.app.OrderProduct
All Implemented Interfaces:
OrderProductIf

public class OrderProduct
extends java.lang.Object
implements OrderProductIf

OrderProduct class


Constructor Summary
OrderProduct()
          Constructor
OrderProduct(com.workingdogs.village.Record vr, org.apache.torque.util.Criteria c)
          Instantiates the attributes of the OrderProduct object from a Record object
 
Method Summary
 void calculateTotals(int scale, int taxQuantityRule)
          We calculate finalPriceIncTax, finalPriceExTax and tax starting from price which is the price of one product without options and without tax.
 java.lang.String getCustom1()
           
 java.lang.String getCustom2()
           
 java.lang.String getCustom3()
           
 java.lang.String getCustom4()
           
 java.lang.String getCustom5()
           
 java.math.BigDecimal getDiscountPercent()
          Used mainly with percentage tiered pricing discounts to store the percentage discount.
 java.math.BigDecimal getFinalPriceExTax()
           
 java.math.BigDecimal getFinalPriceIncTax()
           
 int getId()
           
 java.lang.String getModel()
          The product model.
 java.lang.String getName()
          The product name.
 OptionIf[] getOpts()
          An array of Option objects defining how the details of the product.
 OrderIf getOrder()
           
 int getOrderId()
           
 java.math.BigDecimal getPrice()
          The price of a single product without tax or options.
 java.math.BigDecimal getPrice0()
           
 java.math.BigDecimal getPrice1()
           
 java.math.BigDecimal getPrice2()
           
 java.math.BigDecimal getPrice3()
           
 ProductIf getProduct()
           
 int getProductId()
           
 int getQuantity()
           
 java.lang.String getSku()
          The SKU of the product
 int getState()
          The state of the product when added to the order.
 java.math.BigDecimal getTax()
          The amount of tax added.
 java.lang.String getTaxCode()
          tax code used when looking up tax from an external service
 java.math.BigDecimal getTaxRate()
          The tax rate applied.
 int getType()
          product type.
 java.math.BigDecimal getWeight()
          The weight of the product
 int getWishListId()
          Set to the id of the wish list (gift registry) to keep track that it has been added from a gift registry.
 int getWishListItemId()
          Set to the id of the wish list item (gift registry item) to keep track that it has been added from a gift registry and which item it corresponds to.
 void setCustom1(java.lang.String custom1)
           
 void setCustom2(java.lang.String custom2)
           
 void setCustom3(java.lang.String custom3)
           
 void setCustom4(java.lang.String custom4)
           
 void setCustom5(java.lang.String custom5)
           
 void setDiscountPercent(java.math.BigDecimal discountPercent)
          Used mainly with percentage tiered pricing discounts to store the percentage discount.
 void setFinalPriceExTax(java.math.BigDecimal finalPriceExTax)
           
 void setFinalPriceIncTax(java.math.BigDecimal finalPriceIncTax)
           
 void setId(int id)
           
 void setModel(java.lang.String model)
          The product model.
 void setName(java.lang.String name)
          The product name.
 void setOpts(OptionIf[] opts)
          An array of Option objects defining how the details of the product.
 void setOrder(OrderIf order)
           
 void setOrderId(int orderId)
           
 void setPrice(java.math.BigDecimal price)
          The price of a single product without tax or options.
 void setPrice0(java.math.BigDecimal price0)
           
 void setPrice1(java.math.BigDecimal price1)
           
 void setPrice2(java.math.BigDecimal price2)
           
 void setPrice3(java.math.BigDecimal price3)
           
 void setProduct(ProductIf product)
           
 void setProductId(int productId)
           
 void setQuantity(int quantity)
           
 void setSku(java.lang.String sku)
          The SKU of the product
 void setState(int state)
          The state of the product when added to the order.
 void setTax(java.math.BigDecimal tax)
          The amount of tax added.
 void setTaxCode(java.lang.String taxCode)
          tax code used when looking up tax from an external service
 void setTaxRate(java.math.BigDecimal taxRate)
          The tax rate applied.
 void setType(int type)
          product type.
 void setWeight(java.math.BigDecimal weight)
          The weight of the product
 void setWishListId(int wishListId)
          Set to the id of the wish list (gift registry) to keep track that it has been added from a gift registry.
 void setWishListItemId(int wishListItemId)
          Set to the id of the wish list item (gift registry item) to keep track that it has been added from a gift registry and which item it corresponds to.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrderProduct

public OrderProduct()
Constructor


OrderProduct

public OrderProduct(com.workingdogs.village.Record vr,
                    org.apache.torque.util.Criteria c)
             throws com.workingdogs.village.DataSetException
Instantiates the attributes of the OrderProduct object from a Record object

Parameters:
vr - Record containing data
c - Criteria containing column names
Throws:
com.workingdogs.village.DataSetException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Returns a string containing the attributes of the OrderProduct object.

calculateTotals

public void calculateTotals(int scale,
                            int taxQuantityRule)
We calculate finalPriceIncTax, finalPriceExTax and tax starting from price which is the price of one product without options and without tax. If discountPercent is not null, we apply a discount to the finalPriceExTax once we've calculated the final price by adding option values.

Parameters:
scale - The scale used in the calculations
taxQuantityRule - The tax calculation rule to use

getId

public int getId()
Specified by:
getId in interface OrderProductIf
Returns:
Returns the id.

setId

public void setId(int id)
Specified by:
setId in interface OrderProductIf
Parameters:
id - The id to set.

getModel

public java.lang.String getModel()
Description copied from interface: OrderProductIf
The product model.

Specified by:
getModel in interface OrderProductIf
Returns:
Returns the model.

setModel

public void setModel(java.lang.String model)
Description copied from interface: OrderProductIf
The product model.

Specified by:
setModel in interface OrderProductIf
Parameters:
model - The model to set.

getName

public java.lang.String getName()
Description copied from interface: OrderProductIf
The product name.

Specified by:
getName in interface OrderProductIf
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Description copied from interface: OrderProductIf
The product name.

Specified by:
setName in interface OrderProductIf
Parameters:
name - The name to set.

getOpts

public OptionIf[] getOpts()
Description copied from interface: OrderProductIf
An array of Option objects defining how the details of the product. e.g. color, size, amount of memory etc.

Specified by:
getOpts in interface OrderProductIf
Returns:
Returns the opts.

setOpts

public void setOpts(OptionIf[] opts)
Description copied from interface: OrderProductIf
An array of Option objects defining how the details of the product. e.g. color, size, amount of memory etc.

Specified by:
setOpts in interface OrderProductIf
Parameters:
opts - The opts to set.

getOrder

public OrderIf getOrder()
Specified by:
getOrder in interface OrderProductIf
Returns:
Returns the order.

setOrder

public void setOrder(OrderIf order)
Specified by:
setOrder in interface OrderProductIf
Parameters:
order - The order to set.

getOrderId

public int getOrderId()
Specified by:
getOrderId in interface OrderProductIf
Returns:
Returns the orderId.

setOrderId

public void setOrderId(int orderId)
Specified by:
setOrderId in interface OrderProductIf
Parameters:
orderId - The orderId to set.

getPrice

public java.math.BigDecimal getPrice()
Description copied from interface: OrderProductIf
The price of a single product without tax or options.

Specified by:
getPrice in interface OrderProductIf
Returns:
Returns the price.

setPrice

public void setPrice(java.math.BigDecimal price)
Description copied from interface: OrderProductIf
The price of a single product without tax or options.

Specified by:
setPrice in interface OrderProductIf
Parameters:
price - The price to set.

getProduct

public ProductIf getProduct()
Specified by:
getProduct in interface OrderProductIf
Returns:
Returns the product.

setProduct

public void setProduct(ProductIf product)
Specified by:
setProduct in interface OrderProductIf
Parameters:
product - The product to set.

getProductId

public int getProductId()
Specified by:
getProductId in interface OrderProductIf
Returns:
Returns the productId.

setProductId

public void setProductId(int productId)
Specified by:
setProductId in interface OrderProductIf
Parameters:
productId - The productId to set.

getQuantity

public int getQuantity()
Specified by:
getQuantity in interface OrderProductIf
Returns:
Returns the quantity.

setQuantity

public void setQuantity(int quantity)
Specified by:
setQuantity in interface OrderProductIf
Parameters:
quantity - The quantity to set.

getFinalPriceExTax

public java.math.BigDecimal getFinalPriceExTax()
Specified by:
getFinalPriceExTax in interface OrderProductIf
Returns:
Returns the finalPriceExTax.

setFinalPriceExTax

public void setFinalPriceExTax(java.math.BigDecimal finalPriceExTax)
Specified by:
setFinalPriceExTax in interface OrderProductIf
Parameters:
finalPriceExTax - The finalPriceExTax to set.

getFinalPriceIncTax

public java.math.BigDecimal getFinalPriceIncTax()
Specified by:
getFinalPriceIncTax in interface OrderProductIf
Returns:
Returns the finalPriceIncTax.

setFinalPriceIncTax

public void setFinalPriceIncTax(java.math.BigDecimal finalPriceIncTax)
Specified by:
setFinalPriceIncTax in interface OrderProductIf
Parameters:
finalPriceIncTax - The finalPriceIncTax to set.

getTaxRate

public java.math.BigDecimal getTaxRate()
Description copied from interface: OrderProductIf
The tax rate applied.

Specified by:
getTaxRate in interface OrderProductIf
Returns:
Returns the taxRate.

setTaxRate

public void setTaxRate(java.math.BigDecimal taxRate)
Description copied from interface: OrderProductIf
The tax rate applied.

Specified by:
setTaxRate in interface OrderProductIf
Parameters:
taxRate - The taxRate to set.

getTax

public java.math.BigDecimal getTax()
Description copied from interface: OrderProductIf
The amount of tax added.

Specified by:
getTax in interface OrderProductIf
Returns:
Returns the tax.

setTax

public void setTax(java.math.BigDecimal tax)
Description copied from interface: OrderProductIf
The amount of tax added.

Specified by:
setTax in interface OrderProductIf
Parameters:
tax - The tax to set.

getType

public int getType()
Description copied from interface: OrderProductIf
product type.

Specified by:
getType in interface OrderProductIf
Returns:
Returns the type.

setType

public void setType(int type)
Description copied from interface: OrderProductIf
product type.

Specified by:
setType in interface OrderProductIf
Parameters:
type - The type to set.

getCustom1

public java.lang.String getCustom1()
Specified by:
getCustom1 in interface OrderProductIf
Returns:
Returns the custom1.

setCustom1

public void setCustom1(java.lang.String custom1)
Specified by:
setCustom1 in interface OrderProductIf
Parameters:
custom1 - The custom1 to set.

getCustom2

public java.lang.String getCustom2()
Specified by:
getCustom2 in interface OrderProductIf
Returns:
Returns the custom2.

setCustom2

public void setCustom2(java.lang.String custom2)
Specified by:
setCustom2 in interface OrderProductIf
Parameters:
custom2 - The custom2 to set.

getCustom3

public java.lang.String getCustom3()
Specified by:
getCustom3 in interface OrderProductIf
Returns:
Returns the custom3.

setCustom3

public void setCustom3(java.lang.String custom3)
Specified by:
setCustom3 in interface OrderProductIf
Parameters:
custom3 - The custom3 to set.

getCustom4

public java.lang.String getCustom4()
Specified by:
getCustom4 in interface OrderProductIf
Returns:
Returns the custom4.

setCustom4

public void setCustom4(java.lang.String custom4)
Specified by:
setCustom4 in interface OrderProductIf
Parameters:
custom4 - The custom4 to set.

getCustom5

public java.lang.String getCustom5()
Specified by:
getCustom5 in interface OrderProductIf
Returns:
Returns the custom5.

setCustom5

public void setCustom5(java.lang.String custom5)
Specified by:
setCustom5 in interface OrderProductIf
Parameters:
custom5 - The custom5 to set.

getPrice0

public java.math.BigDecimal getPrice0()
Specified by:
getPrice0 in interface OrderProductIf
Returns:
Returns the price0.

setPrice0

public void setPrice0(java.math.BigDecimal price0)
Specified by:
setPrice0 in interface OrderProductIf
Parameters:
price0 - The price0 to set.

getPrice1

public java.math.BigDecimal getPrice1()
Specified by:
getPrice1 in interface OrderProductIf
Returns:
Returns the price1.

setPrice1

public void setPrice1(java.math.BigDecimal price1)
Specified by:
setPrice1 in interface OrderProductIf
Parameters:
price1 - The price1 to set.

getPrice2

public java.math.BigDecimal getPrice2()
Specified by:
getPrice2 in interface OrderProductIf
Returns:
Returns the price2.

setPrice2

public void setPrice2(java.math.BigDecimal price2)
Specified by:
setPrice2 in interface OrderProductIf
Parameters:
price2 - The price2 to set.

getPrice3

public java.math.BigDecimal getPrice3()
Specified by:
getPrice3 in interface OrderProductIf
Returns:
Returns the price3.

setPrice3

public void setPrice3(java.math.BigDecimal price3)
Specified by:
setPrice3 in interface OrderProductIf
Parameters:
price3 - The price3 to set.

getSku

public java.lang.String getSku()
Description copied from interface: OrderProductIf
The SKU of the product

Specified by:
getSku in interface OrderProductIf
Returns:
the sku

setSku

public void setSku(java.lang.String sku)
Description copied from interface: OrderProductIf
The SKU of the product

Specified by:
setSku in interface OrderProductIf
Parameters:
sku - the sku to set

getState

public int getState()
Description copied from interface: OrderProductIf
The state of the product when added to the order. It can be user defined and can indicate for example if a product isn't in stock. When the order is created using the CreateOrder API call it is set to the following values: The value can be changed before saving the order.

Specified by:
getState in interface OrderProductIf
Returns:
the state

setState

public void setState(int state)
Description copied from interface: OrderProductIf
The state of the product when added to the order. It can be user defined and can indicate for example if a product isn't in stock. When the order is created using the CreateOrder API call it is set to the following values: The value can be changed before saving the order.

Specified by:
setState in interface OrderProductIf
Parameters:
state - the state to set

getWishListId

public int getWishListId()
Description copied from interface: OrderProductIf
Set to the id of the wish list (gift registry) to keep track that it has been added from a gift registry.

Specified by:
getWishListId in interface OrderProductIf
Returns:
the wishListId

setWishListId

public void setWishListId(int wishListId)
Description copied from interface: OrderProductIf
Set to the id of the wish list (gift registry) to keep track that it has been added from a gift registry.

Specified by:
setWishListId in interface OrderProductIf
Parameters:
wishListId - the wishListId to set

getWishListItemId

public int getWishListItemId()
Description copied from interface: OrderProductIf
Set to the id of the wish list item (gift registry item) to keep track that it has been added from a gift registry and which item it corresponds to.

Specified by:
getWishListItemId in interface OrderProductIf
Returns:
the wishListItemId

setWishListItemId

public void setWishListItemId(int wishListItemId)
Description copied from interface: OrderProductIf
Set to the id of the wish list item (gift registry item) to keep track that it has been added from a gift registry and which item it corresponds to.

Specified by:
setWishListItemId in interface OrderProductIf
Parameters:
wishListItemId - the wishListItemId to set

getDiscountPercent

public java.math.BigDecimal getDiscountPercent()
Description copied from interface: OrderProductIf
Used mainly with percentage tiered pricing discounts to store the percentage discount.

Specified by:
getDiscountPercent in interface OrderProductIf
Returns:
the discountPercent

setDiscountPercent

public void setDiscountPercent(java.math.BigDecimal discountPercent)
Description copied from interface: OrderProductIf
Used mainly with percentage tiered pricing discounts to store the percentage discount.

Specified by:
setDiscountPercent in interface OrderProductIf
Parameters:
discountPercent - the discountPercent to set

getWeight

public java.math.BigDecimal getWeight()
Description copied from interface: OrderProductIf
The weight of the product

Specified by:
getWeight in interface OrderProductIf
Returns:
the weight

setWeight

public void setWeight(java.math.BigDecimal weight)
Description copied from interface: OrderProductIf
The weight of the product

Specified by:
setWeight in interface OrderProductIf
Parameters:
weight - the weight to set

getTaxCode

public java.lang.String getTaxCode()
Description copied from interface: OrderProductIf
tax code used when looking up tax from an external service

Specified by:
getTaxCode in interface OrderProductIf
Returns:
the taxCode

setTaxCode

public void setTaxCode(java.lang.String taxCode)
Description copied from interface: OrderProductIf
tax code used when looking up tax from an external service

Specified by:
setTaxCode in interface OrderProductIf
Parameters:
taxCode - the taxCode to set


Copyright © 2011 DS Data Systems UK Ltd.