Dynamic Pricing : Configuration : Rule configuration : Conditions
 
Conditions
 
The following tables provide a list of conditions and functions that may be used together to configure Dynamic Pricing Rules.
 
Condition
Description
DATE(range, …)
This condition can have any number of dates or date ranges. If the date of the day being calculated matches any of the ranges, then it is TRUE. Individual dates can be used or date ranges (two dates separated by a dash). At least one argument must be supplied, but any number of dates or date ranges can be included.
 
Example:
Calculating on 3/13/2003.
DATE(3/13/2003) = TRUE
DATE(3/10/2003, 3/11/2003, 3/12/2003, 3/13/2003) = TRUE
DATE(3/1/2003-4/1/2003) = TRUE
DATE(2/1/2003-3/1/2003, 3/22/2003-6/01/2003) = FALSE
DOW(range, …)
This condition specifies days of week that are possible matches. Valid abbreviations are (MON TUE WED THU FRI SAT SUN), although more characters can be used. Ranges can be specified using a dash and any number of days-of-week or day-ranges can be specified.
 
Example:
Calculating on a Wednesday.
DOW(MON-FRI) = TRUE
DOW(MON,TUE,THU) = FALSE
DOW(WED-THU, SAT-SUN) = TRUE
ADVANCE(check)
This condition is TRUE if the number of days of the start_date minus today’s date (computer date) meet the specification of the check specified in the single argument. The check can either be just a number (indicating that it must be exactly that many days in advance) or an operator and a number such as >10 which means that it must be at least ten days in advance. Valid operators are >, >=, <, <=. Ranges can also be used, such as 2-5 which means that it must be between 2 and 5 days in advance.
 
Example:
start_date is 7/18/2013, today’s date is 7/13/2013
ADVANCE(5) = TRUE
ADVANCE(6) = FALSE
ADVANCE(3-5) = TRUE
ADVANCE(>=5) = TRUE
DCI(department, category, item)
This condition can be called with one, two or three parameters. If it matches the item sold, it returns TRUE; otherwise, FALSE. Also, if any argument is empty, that comparison is ignored (for example, you can just match on category and ignore the item level).
 
Example:
For LIFTS,JUNIOR, ALLDAY
DCI(LIFTS) = TRUE
DCI(LIFTS,JUNIOR,ALLDAY) = TRUE
DCI(LIFTS,ADULT) = FALSE
DCI(,,ALLDAY) = TRUE
TIME(time1time2)
This condition takes a time range, for example, TIME(10:00-12:00). Military time is the easiest although AM and PM work as well.
DAYCOUNT( condition, range)
This takes a condition (which can be comprised of any other conditions) and applies it to all the days for the product. The total days that satisfy the condition are compared to the range. If the day being considered doesn't satisfy the range, then this automatically returns FALSE.
 
Example:
DAYCOUNT( DATE(04/01/2003-04/30/2003), 2-3 )
A use of this that mimics the use of the DAYS function is as follows:
SETPRICE(60) IF(DAYCOUNT( DATE(04/01/2003-04/30/2003) , 2-3 ) AND DATE(04/01/2003-04/30/2003), DISCOUNT(10) )
 
This allows complex situations to be handled, such as a check to see if one day is on the weekend and one is during the week during a non-holiday period.
 
Example:
IF( DAYCOUNT( SUB(NON-HOLIDAY) AND DOW(MON-FRI) ),1) AND
DAYCOUNT( SUB(NON-HOLIDAY) AND DOW(SAT-SUN) ),1) , DISCOUNT(10) )
ADM(range)
This condition evaluates the number of admissions configured for the item.
 
Example:
When the item has exactly 2 admissions.
ADM(2) = TRUE
ADM(2-3) = TRUE
ADM(>2) = FALSE
TSPAN(range)
This condition evaluates the configured time span of the item; otherwise, it is identical to ADM.
DTSPAN(range)
This condition evaluates the time span based on the start and end date/time manually set by the operator when selling an item configured to SysManager > Activities > DCIs > New/Edit > General tab > Calculate specific end time dynamically check box. The value is in number of days.
DTSPAN2(range)
 
This condition evaluates the time span based on the start and end date/time manually set by the operator when selling an item configured to SysManager > Activities > DCIs > New/Edit > General tab > Calculate specific end time dynamically check box. The value is in number of minutes.
HASMOD(DCI,number of occurrences)
HASMOD, ISMOD, SHAREMOD and COUNTMODS all can either take a single argument of thirty characters (a fully defined DCI) or can take up to three arguments which are a department, category and item and work identically to the dci argument. A fourth argument can be added for number of occurrences.
HASMOD can take 0 arguments and returns TRUE if the item has any modifiers. Otherwise, it returns TRUE if this item has a modifier matching the dci.
A fourth argument can be added for number of occurrences.
 
Example:
HASMOD(,,ADULT,>2)
 
This rule returns TRUE if an item has more than two modifiers with an item nickname of ADULT. A range such as 2-3 is legal or just a number or >=, etc.
ISMOD(dci,number of occurrences)
HASMOD, ISMOD, SHAREMOD and COUNTMODS all can either take a single argument of thirty characters (a fully defined DCI) or can take up to three arguments which are a department, category and item and work identically to the dci argument. A fourth argument can be added for number of occurrences.
ISMOD can take 0 arguments and returns TRUE if it’s the modifier of any item. Otherwise, it returns TRUE if its parent item matches the dci specified.
SHAREMOD(dci, number of occurrences)
HASMOD, ISMOD, SHAREMOD and COUNTMODS all can either take a single argument of thirty characters (a fully defined DCI) or can take up to three arguments which are a department, category and item and work identically to the dci argument. A fourth argument can be added for number of occurrences.
SHAREMOD must have at least one argument and returns TRUE if there is any modifier matching the DCI specified.
SHAREMODSPREV(D,C,I)
Counts the number of previous modifiers matching.
COUNTMODS(dci)
 
HASMOD, ISMOD, SHAREMOD and COUNTMODS all can either take a single argument of thirty characters (a fully defined DCI), or can take up to three arguments which are a department, category and item and work identically to the dci argument.
COUNTMODS returns an integer representing the number of occurrences of the modifier.
 
Example:
COUNTMODS(,,MOD2)*3.25
COMPARE(mathematical expression,range)
COMPARE takes two arguments. The first is a mathematical expression that is evaluated using the mathematics parser; the second is a range.
 
Example:
IF(COMPARE(COUNTMODS(,,AD) + COUNTMODS(,,CH),>1),PREVENTUSE(An Adult OR a Child can be selected as a modifier))
 
This rule can be used to ensure that only one modifier or the other is allowed.
GROUP(#)
Returns TRUE if this salespoint is a member of the accounting group specified.
QTY(>)
QTY(<)
QTY(>=)
QTY(<=)
QTY(=)
QTY(X-Y)
Determines the price per item based on the quantity set on the line item.
 
Example:
IF(QTY(2-3), SETPRICE(22.00), IF(QTY(<=5),setprice(33.00),SETPRICE(44.00)))
Qty.
Price
1
33.00
2
44.00  (2*22.00)
3
66.00  (3*22.00)
4
132.00 (4*33.00)
5
165.00 (5*33.00)
6
264.00 (6*44.00)

The argument for QTY is like the ADM function.
 
Example:
QTY(>2) QTY(<=2) QTY(2-3) QTY(1)
SALESPOINT(name)
If the salespoint name matches the argument, returns TRUE.  For ww.dll, it works off the DefaultInfo setting.
WEB()
Returns TRUE if being processed by ww.dll or by Sales Host utility.
R_PRESENT(type, level
R_PRESENT(SKI, DEMO) returns TRUE if there is a demo ski in the rental history.
ISTYPE(type)
 
Returns TRUE if this particular modifier has attached rental history of the specified type.
ISLEVEL(level)
Returns TRUE if this particular modifier has attached rental history of the specified level.
R_DAYTYPE(daytype)
Returns TRUE if the rental day is the daytype specified.
R_DAYS(range)
Returns TRUE if the # of rental days matches range.
AGE(range)
 
Can accept greater than, equal to, less than or a range (just like the QTY condition) based age of the guest attached to the item.
PHYSLOCATION()
This is used for the scanner location (physical location) in a Dynamic Pricing Rule.
 
Example:
IF(PHYSLOCATION(1), MOVEREVENUE(*DEFERRED*, ACTV: CLIMBWALL, 25, 0,ACTIVITIES,ATTRACTION,CLIMBWALL))
STATUS(n)
The value “n” is the status to be checked.
 
Example :
IF(STATUS(O) AND NOT OVERDUE(),MACRO(DISPLAY2(Item Found,DateDue=<<datedue>><cr>Code=<<saleinfo->message>> FOP=<<saleinfo->fop>>)))
IF(STATUS(O) AND OVERDUE(),MACRO(DISPLAY2(Item Found - OVERDUE,Item is Overdue by <<overduetime>><cr>DateDue=<<datedue>><cr>Code=<<saleinfo->message>> FOP=<<saleinfo- >fop>>)))
IF(STATUS(I), MACRO(SELECTITEMFROMLIST("TEST TEST LOCKER ","TEST TEST M1 ")MESSAGE()RENTALCHECKOUT(<<swipe>>)))
IF(STATUS(O), MACRO(SELECTITEM("TEST TEST LOCKER ") QUANTITY(-1) RENTALCHECKIN(<<swipe>>)))
IF(STATUS(M), MACRO(DISPLAY(Item is in maintenance EquipTag=<<equip_tag>>)))
 
The only actions allowed are MACRO and MACROCLEAN which launches special commands through the Sales interface.
 
OVERDUE()
The () returns TRUE if the item's due date is in the past.
 
Example :
IF(STATUS(O) AND NOT OVERDUE(),MACRO(DISPLAY2(Item Found,DateDue=<<datedue>><cr>Code=<<saleinfo->message>> FOP=<<saleinfo->fop>>)))
IF(STATUS(O) AND OVERDUE(),MACRO(DISPLAY2(Item Found - OVERDUE,Item is Overdue by <<overduetime>><cr>DateDue=<<datedue>><cr>Code=<<saleinfo->message>> FOP=<<saleinfo- >fop>>)))
IF(STATUS(I), MACRO(SELECTITEMFROMLIST("TEST TEST LOCKER ","TEST TEST M1 ")MESSAGE()RENTALCHECKOUT(<<swipe>>)))
IF(STATUS(O), MACRO(SELECTITEM("TEST TEST LOCKER ") QUANTITY(-1) RENTALCHECKIN(<<swipe>>)))
IF(STATUS(M), MACRO(DISPLAY(Item is in maintenance EquipTag=<<equip_tag>>)))
 
The only actions allowed are MACRO and MACROCLEAN which launches special commands through the Sales interface.