Ask Question - how to make different things happen depending on the answer?

This is my keyboard;

"1","2","3","Think21=Think21:",8|"4","5","6",".","/"|"7","8","9","0","<enter>"

This is my rule for displaying the minimum DOB to be 18;

Stuck on a formula to use as constraint to take numberpad value as DOB and calculate is under or over 18.

1 Like

Quick question.
Have constraints of {:NUMBERPAD} == "" and {:NUMBERPAD} != ""
{:NUMBERPAD} == "" seems to work in that that message only shows up when no value entered in numberpad

HOWEVER
{:NUMBERPAD} != "" doesnt work as expected, this message shows up in number pad is blank or has a value?

You should put {:NUMBERPAD} tag in quotes.

You can’t make date comparisons on constraints for V4.

For V5 you can write something like that.

new Date(FD(ADM('{:NUMBERPAD}',216),'MM/dd/yyyy')) > new Date(FD('{DATE}','MM/dd/yyy'))

You can also setup two rules for Think21 command and compare dates by setting up rule constraints with Before or After operators. One rule works if age is valid, other one works if not.

1 Like

Sorry, my bad, schoolboy error

That’s a fair shout, good idea.
Am working in V5 and would prefer to keep the actions in one rule if possible so will have a play with the first suggestion.
Thanks for the suggestions, will post results in a V5 tutorial when I get it working :smile:

Of course you won’t use [=] tags for expressions.

I’ll correct my sample.

@emre Thanks for your help, am just trying to work out the code you provided;

Seems like it ourputs True/False output so have constrained as == ‘True’

‘new Date(FD(ADM(’{:NUMBERPAD}‘,216),‘DD/MM/YY’)) > new Date(FD(’{DATE}‘,‘DD/MM/YY’))’ == ‘True’

But I get 'False' == 'True'

that may relate with date formatting. Try my updated sample.

Whats the new Date doing?
Cant work it out, I get an output of new Date( [18th Birthday Date] ) > new Date(27/06/15)
The FD(ADM('{:NUMBERPAD}',216),'dd/MM/yy') works as expected but new Date doesn’t seem to do anything.

Have resorted to multiple rules and used the rule constraints :smile:

This is how it works for me.

Rule Setup.

Entered this

Think21 button shows this

Entered that

Showed that

Constraint for Don't sell

new Date(FD(ADM('{:NUMBERPAD}',216),'MM/dd/yyyy')) > new Date(FD('{DATE}','MM/dd/yyyy'))

Constraint for Age Confirmed

new Date(FD(ADM('{:NUMBERPAD}',216),'MM/dd/yyyy')) <= new Date(FD('{DATE}','MM/dd/yyyy'))
1 Like

i use a simpler version for age checking before processing anything, if customer looks underage ask for ID first, check the age and press the Think 21 button. This display a screen telling you the customer should be born on or after a certain date which you verify by looking at their ID as shown below

press think 21 button for the following message

just another way of doing it without typing anything into the keypad :slight_smile:

2 Likes

I have done both :smile:
If keypad is empty message like yours, if date entered as above - Just because I can LOL

1 Like

ah cool :slight_smile: me like lol

have you seen the setup i have with age restricted sales? if age restricted item added youre prompted to confirm age, enter DOB and ticket is either created if old enough and add DOB as a ticket tag or if not old enough the ticket is aborted and a new transaction can be started, you can have a lemonade haha

i also used the new order grouping so all age restricted (alcohol) is grouped together

I did see it but as most of my setups are mainly bar it would ask for 99.9% of the sales LOL

Yea thats what mine does but the first question prompts cashier to check age (to remind them) they can press no and carry on as normal if the customer is clearly old enough and it will only ask once, when the first restricted item is added

2 Likes

Nice, like the idea, personally not to sure on the additional step in the workflow.
But a nice setup all the same :slight_smile: