The addrule() command allows PosLanes to directly create and control underlying rules. This is an advanced and special purpose command.
The general format of this command is
The Priceoption area allows you to define dynamic pricing in the point of sale. This is intended for scripts to add pricing rules that apply to future sales. For example, AddRule(priceoption,) can be used to add a 10% discount for next sale of "Soap" when you spend more than "$30 on frozen food". The AddRule command adds the pricing rule, it is not deciding the conditions of when the rule should be stored.
Priceoptions added via this command are sent to all other lanes immediately so that the pricing is immediately available at any checkout.
The available directives are:
|Pid(N)||Specifies a single product this option applies too||pid(188)|
|depid(N)||Specifies a single deparment this option applies too. This option is valid for all products in this department||depid(3)|
|cid(N)||Specifies a customer this option applies too||cid(2351)|
|location(N)||Specifies that this option should only apply to a single location. The default is all locations||location(2)|
|priority(N)||Defines a processing priority. Not documented for use yet.|
|enddate(N)||Sets an ending date, after which is this option is now longer considering valid by the Point of Sale|
|startdate(N)||Sets a start date, before which this option is not considered valid by the Point of Sale||startdate(tomorrow)|
|price(N)||Sets the price to be used|
|percent(N)||Sets the percentage to be used|
|option(N)||Controls how the price and percent values are applied.
The differences between base price and discount largely influence reporting, the net result to the customer is generally the same
|flags(N)||Sets any additional rules to apply
|dow(N)||Define a Day of Week mask, which is a 7 character string with Y/N for each day. Sunday is the first day. If a DOW mask is present the priceoption is only valid on indicated days. The dow(YYYNNNY) means Sunday, Monday, Tuesday and Saturday. You may define using either YN values, or day names. A range of days can also be specified and the start and end days of the range are included.||
Define a rule so that product#678 can be purchased by Customer# 1244 for $5.60, from tomorrow. This offer can only be applied once, and after it has been used it will be disabled.
AddRule(priceoption,pid(678) cid(1244) startdate(tomorrow) flags(once) price(5.60))
Define a rule so that all products in department #6 can be purchased by Customer# 1244 for 50% discount. But, only for products that are not marked "NoDiscount" This offer can only be applied once, and after it has been used it will be disabled. The teller/customer is prompted as too whether this price applies or not, so the customer can save this special offer until they wish to use it.
AddRule(priceoption,depid(6) cid(1244) percent(50) flags(once,prompt) option(discpercent))
Links: Physical Storage Structure