ePages 6.17.17 - DE_EPAGES/PriceList/API/PriceList.pm

Package DE_EPAGES::PriceList::API::PriceList

This package provides the main pricelist functions.

@EXPORT_OK
GetCustomerPriceLists
GetProductPriceList
IsTimeFrameDifferent

Functions

GetCustomerPriceLists
GetProductPriceList
IsTimeFrameDifferent

GetCustomerPriceLists

Returns the price list that is valid for the customer at the current time. The price list may be assigned to the customer group or directly to the customer. Returns empty list if no price list is valid for this customer.

Syntax
$aPriceLists = GetCustomerPriceLists( $Customer, $CurrencyID, $Shop, $User );
Input
$Customer (object)
Customer object
$CurrencyID (string)
currency id (eg. 'USD')
$Shop (object)
shop object (not used if customer is defined)
$User (object)
user object (not used if customer is defined)
Return
$aPriceLists (ref.array.object)
list of valid PriceList objects

GetProductPriceList

Returns the price list that is valid for the customer and product at the current time. The price list may be assigned to the customer group or directly to the customer. Returns undef if no price list is valid for this customer.

Syntax
$PriceList = GetProductPriceList($Product, $Customer, $CurrencyID, $Shop, $User );
Input
$Product (object)
product object
$Customer (object)
customer object
$CurrencyID (string)
currency id (eg. 'USD')
$Shop (object)
shop object (not used if customer is defined)
$User (object)
user object (not used if customer is defined)
Return
$PriceList (object)
valid PriceList objects

IsTimeFrameDifferent

Returns true if 2 time spans do not overlap.

Syntax
$NoOverlap = IsTimeFrameDifferent($hTimeSpan1, $hTimeSpan2)
Input
$hTimeSpan1 (ref.hash)
time span with hash keys ValidFrom, ValidTo
$hTimeSpan2 (ref.hash)
time span with hash keys ValidFrom, ValidTo
Return
$NoOverlap (boolean)
true if time spans do not overlap