ePages 6.10 - DE_EPAGES/PriceList/API/Object/PriceList.pm

Package DE_EPAGES::PriceList::API::Object::PriceList

object interface for PriceList.

Base
DE_EPAGES::Object::API::Object::Object

Functions

addCustomer
addCustomerGroup
className
dbPackage
getQuantityDiscounts
getScalePrices
getValueDiscounts
hasQuantityDiscounts
hasScalePrices
hasValueDiscounts
quantityDiscounts
removeCustomer
removeCustomerGroup
scalePrices
setQuantityDiscounts
setScalePrices
setValueDiscounts
valueDiscounts

addCustomer

Assigns a customer to the price list.

Syntax
$PriceList->addCustomer( $Customer );
Input
$Customer (object)
customer

addCustomerGroup

Assigns a customer group to the price list.

Syntax
$PriceList->addCustomerGroup( $CustomerGroup );
Input
$CustomerGroup (object)
customer group

className

Returns the class name, used for DAL access.

Syntax
$ClassName = $PriceList->className;
Return
$ClassName (String)
class name

dbPackage

Returns the database package, used for DAL access.

Syntax
$DbPackage = $PriceList->dbPackage;
Return
$DbPackage (String)
database package name

getQuantityDiscounts

Returns the quantity discounts for the given product and tax model in the requested precision.

Syntax
$ahQuantityDiscounts = $Object->getQuantityDiscounts($Product);
Input
$Product (object)
product
Return
$ahQuantityDiscounts (int)
list of hashes, keys:
Discount - discount in percent,
Quantity - product quantity

getScalePrices

Returns the scale prices for the given product and tax model in the requested precision.

Syntax
$ahScalePrices = $Object->getScalePrices($Product, $TaxModel, );
$ahScalePrices = $Object->getScalePrices($Product, $TaxModel, $ExtraPrecision);
Input
$Product (object)
product
$TaxModel (int)
tax model (1=gross/including tax, 0=net/without tax)
$ExtraPrecision (boolean)
(optional, default=0) extra precision for net prices
in back-office
Return
$ahScalePrices (ref.array.hash)
list of hashes, keys:
Price, Quantity

getValueDiscounts

Returns the value discounts for the given product and tax model in the requested precision.

Syntax
$ahValueDiscounts = $Object->getValueDiscounts($Product, $TaxModel, );
$ahValueDiscounts = $Object->getValueDiscounts($Product, $TaxModel, $ExtraPrecision);
Input
$Product (object)
product
$TaxModel (int)
tax model (1=gross/including tax, 0=net/without tax)
$ExtraPrecision (boolean)
(optional, default=0) extra precision for net prices
in back-office
Return
$ahValueDiscounts (ref.array.hash)
list of hashes, keys:
Discount, Value

hasQuantityDiscounts

Returns true if the pricelist includes a quantity discount for the given product.

Syntax
$HasDiscounts = $PriceList->hasQuantityDiscounts( $Product );
Input
$Product (object)
product
Return
$HasDiscounts (boolean)
true if a discount exists

hasScalePrices

Returns true if the pricelist includes scale prices for the given product.

Syntax
$HasScalePrices = $PriceList->hasScalePrices( $Product );
Input
$Product (object)
product
Return
$HasScalePrices (boolean)
true if a scale price exists

hasValueDiscounts

Returns true if the pricelist includes a value discount for the given product.

Syntax
$HasDiscounts = $PriceList->hasValueDiscounts( $Product );
Input
$Product (object)
product
Return
$HasDiscounts (boolean)
true if a discount exists

quantityDiscounts

Returns all quantity discounts for the given product in this price list.

Syntax
$aQuantityDiscounts = $PriceList->quantityDiscounts( $Product );
Input
$Product (object)
product
Return
$aQuantityDiscounts (ref.array.object)
list of QuantityDiscount objects

removeCustomer

Removes the assignment of a customer to the price list.

Syntax
$PriceList->removeCustomer( $Customer );
Input
$Customer (object)
customer

removeCustomerGroup

Removes the assignment of a customer group to the price list.

Syntax
$PriceList->removeCustomerGroup( $CustomerGroup );
Input
$CustomerGroup (object)
customer group

scalePrices

Returns all scale prices for the given product in this price list.

Syntax
$aScalePrices = $PriceList->scalePrices( $Product );
Input
$Product (object)
product
Return
$aScalePrices (ref.array.object)
list of ScalePrice objects

setQuantityDiscounts

Sets all quantity discounts for the given product and tax model. Deletes quantity discounts that are not included in the list. Calculates net prices from gross prices if $TaxModel is TAX_MODEL_GROSS.

Syntax
$Object->setQuantityDiscounts($Product, $TaxModel, $ahQuantityDiscounts);
Input
$Product (object)
product
$TaxModel (int)
tax model (1=gross/including tax, 0=net/without tax)
$ahQuantityDiscounts (ref.array.hash)
list of hashes, keys:
Quantity, Discount

setScalePrices

Sets all scale prices for the given product and tax model. Deletes scale prices that are not included in the list. Calculates net prices from gross prices if $TaxModel is TAX_MODEL_GROSS.

Syntax
$Object->setScalePrices($Product, $TaxModel, $ahScalePrices);
Input
$Product (object)
product
$TaxModel (int)
tax model (1=gross/including tax, 0=net/without tax)
$ahScalePrices (ref.array.hash)
list of hashes, keys:
Price, Quantity

setValueDiscounts

Sets all value discounts for the given product and tax model. Deletes value discounts that are not included in the list. Calculates net prices from gross prices if $TaxModel is TAX_MODEL_GROSS.

Syntax
$Object->setValueDiscounts($Product, $TaxModel, $ahValueDiscounts);
Input
$Product (object)
product
$TaxModel (int)
tax model (1=gross/including tax, 0=net/without tax)
$ahScalePrices (ref.array.hash)
list of hashes, keys:
Value, Discount

valueDiscounts

Returns all value discounts for the given product in this price list.

Syntax
$aValueDiscounts = $PriceList->valueDiscounts( $Product );
Input
$Product (object)
product
Return
$aValueDiscounts (ref.array.object)
list of ValueDiscount objects