Fieldpine Logo Documentation Home  
POS Commands Home

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 addrule(Area, Area Commands) where the general area being controlled is specified and then the sub commands for that area are supplied.


AddRule(priceoption, COMMANDS)

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:

KeywordDescriptionExamples
Pid(N)Specifies a single product this option applies toopid(188)
depid(N)Specifies a single deparment this option applies too. This option is valid for all products in this departmentdepid(3)
cid(N)Specifies a customer this option applies toocid(2351)
location(N)Specifies that this option should only apply to a single location. The default is all locationslocation(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 Salestartdate(tomorrow)
startdate(12-dec-2016)
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.
  • baseprice The price supplied is to be set as a base price for the product
  • basepercent The percentage is applied to the current price determined for a sale.
  • discpercent The percentage is applied as a disount to the current price.

The differences between base price and discount largely influence reporting, the net result to the customer is generally the same

option(baseprice)
flags(N)Sets any additional rules to apply
  • delete nodelete Mark this priceoption as deleted and no longer valid. Rarely used.
  • obeynodiscount ignorenodiscount If a product is marked NoDiscount, should the priception apply or not? The default operation is obeynodiscount
  • once many Is the pricing option a single use, or multiple use?
  • prompt noprompt Should the teller be prompted to optionally apply this priceoption or not
flags(once,prompt)
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. dow(monday,tuesday,wednesday)
dow(mon-fri)
dow(fri-mon)
dow(NNYYYNN)

Examples

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