public final class CSDiscountUtil
extends java.lang.Object
The CSDiscountUtil
class includes methods for evaluating the discount to be applied to a specified
product option obtained from a specified rack, and for getting the status of the specified discount.
CSDiscountScheme
,
CSProductOption
,
CSProductType
,
CSRack
Modifier and Type | Field and Description |
---|---|
static int |
DiscountQualifyType_NONE |
static int |
DiscountQualifyType_QUANTITY |
static int |
DiscountQualifyType_SPEND |
static int |
DiscountType_BASKET |
static int |
DiscountType_GROUP1 |
static int |
DiscountType_GROUP2 |
static int |
DiscountType_OPTION |
static int |
DiscountType_TYPE |
static int |
DiscountValueType_AMOUNT |
static int |
DiscountValueType_ITEM |
static int |
DiscountValueType_PERCENT |
Modifier and Type | Method and Description |
---|---|
static CSBasket |
evaluateBasketDiscounts(java.sql.Connection con,
CSBasket objBasket,
java.lang.String strCountryName,
int nDecimalPlaces)
Evaluates the discounts to be applied to the specified product options in the specified basket.
|
static CSBasket |
evaluateBasketDiscounts(java.lang.String strPropertyFile,
CSBasket basket,
java.lang.String strCountryName,
int nDecimalPlaces)
Evaluates the discounts to be applied to the specified product options in the specified basket.
|
static double |
evaluateDiscount(java.sql.Connection con,
CSDiscountScheme objDiscountScheme,
int nProductOptionID,
int nProductTypeID,
int nRackID,
double nQuantity,
int nDecimalPlaces)
Evaluates the discount to be applied to a specified product option obtained from a specified rack.
|
static double |
evaluateDiscount(java.lang.String strPropertyFile,
CSDiscountScheme objDiscountScheme,
int nProductOptionID,
int nProductTypeID,
int nRackID,
double nQuantity,
int nDecimalPlaces)
Evaluates the discount to be applied to a specified product option obtained from a specified rack.
|
static java.lang.String |
getEvaluatedBasketDiscountsStr(CSBasket objBasket)
Gets the status of the discount schemes that have been applied to a basket using evaluateBasketDiscounts.
|
static boolean |
getStatus(java.lang.String strPropertyFile,
CSDiscountScheme discountScheme,
int productOptionID,
int productTypeID,
int productGroupID,
int rackID)
Gets the status of the discount scheme.
|
public static final int DiscountType_OPTION
public static final int DiscountType_TYPE
public static final int DiscountType_GROUP1
public static final int DiscountType_GROUP2
public static final int DiscountType_BASKET
public static final int DiscountQualifyType_QUANTITY
public static final int DiscountQualifyType_SPEND
public static final int DiscountQualifyType_NONE
public static final int DiscountValueType_AMOUNT
public static final int DiscountValueType_PERCENT
public static final int DiscountValueType_ITEM
public static double evaluateDiscount(java.lang.String strPropertyFile, CSDiscountScheme objDiscountScheme, int nProductOptionID, int nProductTypeID, int nRackID, double nQuantity, int nDecimalPlaces) throws CSException
strPropertyFile
- the property file that contains the connection details.objDiscountScheme
- the discount scheme.nProductOptionID
- the product option ID.nProductTypeID
- the product type ID.nRackID
- the rack ID.nQuantity
- the quantity.nDecimalPlaces
- the number of decimals places to format the returned discount value with.CSException
- the base class for exceptions thrown by this method.public static double evaluateDiscount(java.sql.Connection con, CSDiscountScheme objDiscountScheme, int nProductOptionID, int nProductTypeID, int nRackID, double nQuantity, int nDecimalPlaces) throws CSException
con
- the database connection object instantiated by the framework.objDiscountScheme
- the discount scheme.nProductOptionID
- the product option ID.nProductTypeID
- the product type ID.nRackID
- the rack ID.nQuantity
- the quantity.nDecimalPlaces
- the number of decimals places to format the returned discount value with.CSException
- the base class for exceptions thrown by this method.public static boolean getStatus(java.lang.String strPropertyFile, CSDiscountScheme discountScheme, int productOptionID, int productTypeID, int productGroupID, int rackID) throws CSException
strPropertyFile
- the property file that contains the connection details.discountScheme
- the discount scheme.productOptionID
- the product option ID.productTypeID
- the product type ID.productGroupID
- the product group ID.rackID
- the rack ID.CSException
- the base class for exceptions thrown by this method.public static CSBasket evaluateBasketDiscounts(java.lang.String strPropertyFile, CSBasket basket, java.lang.String strCountryName, int nDecimalPlaces) throws CSException
strPropertyFile
- the property file that contains the connection details.basket
- the basket.strCountryName
- the official name of the country used to calculate country VAT, country net price and country gross
price.nDecimalPlaces
- the number of decimals places to format the returned discount value with.CSException
- the base class for exceptions thrown by this method.public static CSBasket evaluateBasketDiscounts(java.sql.Connection con, CSBasket objBasket, java.lang.String strCountryName, int nDecimalPlaces) throws CSException
con
- the database connection object instantiated by the framework.objBasket
- the basket.strCountryName
- the official name of the country used to calculate country VAT, country net price and country gross
price.nDecimalPlaces
- the number of decimals places to format the returned discount value with.CSException
- the base class for exceptions thrown by this method.public static java.lang.String getEvaluatedBasketDiscountsStr(CSBasket objBasket) throws CSException
objBasket
- the basket.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.