Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SIM help to modify menu item price

Status
Not open for further replies.

ryroanderson

Systems Engineer
Oct 18, 2017
19
US
I am trying to write a SIM that allows me take the current menu item and do math on it dependent on the modifier rung in.
I know I can add a price to a modifier, but I want a dynamic price rather than a flat price.
Example would be if I was ringing in a Jack Daniels Manhattan.
In the system Jack is priced as a 1.5 oz pour, but a Manhattan calls for a 2 oz pour. Currently we have it set up that you ring in Jack and hit the Manhattan modifier charging a flat 2.00 up charge. But a .5 oz of Jack costs less than a .5 oz of a more expensive liquor.
What I would like would be to ring in Jack and then have the Manhattan modifier trigger a SIM where it would take the price of the Jack and multiply by 1.5 to get the 2 oz pour price.

Is this possible? If so, could someone point me in the right direction?
 
You can create a Manhattan mod that is 'hidden' for all menu items except Jack. This lets you price the item relevent to Jack. Same goes for all other liquors. It is more work but may be worth it in the end.
 
BootstrapperRI - I'm not sure I understand what you mean. How would you set something like that up?
 
You are basically taking advantage of the field for menu items called "Allowed Condiments" (not required condiments). It is a drop down box and almost always has the value "All Condiments" or something similar. If you create a group called "All Condiments + Manhattan Jack" and "All Condiments + Manhattan Well", etc. creating 3+ groups and assign the respective group to the corresponding menu item. You now have a unique set of modifiers for each menu item and can have different prices.

The programming is a bit involved and not commonly done, but you can create a unique set of allowed condiments for each menu item. That would allow you to set the price and behavior for each item in the set.

Use the help documentation to get more detail, start with the help on "allowed condiments". Don't forget your context sensitive help using the question mark icon at the top.
 
Essentially what you want:

Code:
README

What it does: Inspired by Aloha, this SIM allows you to create a double key or menu item that derives its prices as a percentage of its parent price.

Warnings: This script has been tested fairly thoroughly, but will not work if paired with any items being rung in via macro or COM.

Installation (Interface): Create a new interface with any name. Thats it. You don't need to fill out any additonal settings - the SIM does not make use of PMS communicationos.

Settings (SIM File): You must create two items. One item will be a normal modifier called 'Double' with a $0 price. The second must also be called 'Double', but it should have an open price. DO NOT link the open priced item to any touchscreen button or SLU. Instead, link the Double with a single price record. When rung in, the script will replace this item with the open priced double item, with the correct price. In the SIM file at the top, you need to replace DBL_ITEM_TRIGGER with the object number of the $0 priced double item, and DBL_ITEM_OPEN with the object number of the open priced double item. Replace the value of DBL_MULTIPLIER with the multiplier of the base price the SIM should use (eg: .75 for 75% of the base cost).


Installation (SIM File): Copy PMSX.isl (renaming the X to match the interface number) to each CAL folder (eg: D:\Micros\Res\Cal\WS5A\Files\CF\Micros\Etc)




Optional setup: The script does not require any further modification, and will instead trigger off of the ringing in of the $0 priced item; however, the script does support two additional options. BOTH options require a hardcoded touchscreen button, and cannot be trigger off of the the ringing in of the double item. Inquiry 2 will include the price of any condiments into the base price, wheras by default the script only uses the price of the base item. Inquiry 3 will actually ring in the item twice, as well as adding the double modifier for the bartender. This method should only really be used if inventory counts are being used via the database.

Code:
//set this to open priced item called 'Double'
VAR DBL_ITEM_TRIGGER : N7 = 190402
VAR DBL_ITEM_OPEN : N7 = 190405

VAR DBL_MULTIPLIER : $12 = 1

VAR VOID_ITEM : N9

EVENT MI

	IF VOID_ITEM <> 0
		VOIDDETAIL(VOID_ITEM)
		VOID_ITEM = 0
		EXITCONTINUE
	ENDIF

	VAR CUR_ITEM : N3 = @NUMDTLT
	VAR FOUND_ITEM : N1 = 0

	//this gets us the most recently added item - if it was added at the end the system clears all selections
	//but if it was inserted the newly inserted item is always highlighted
	VAR I : N3 = @NUMDTLT
	WHILE I > (@NUMDTLT - @NUMDTLR)
		IF @DTL_SELECTED[ I ] = 1
			CUR_ITEM = I
			BREAK
		ELSE
			I = I - 1
		ENDIF
	ENDWHILE

	IF @DTL_OBJECT[ CUR_ITEM ] <> DBL_ITEM_TRIGGER
		EXITCONTINUE
	ENDIF

	VOID_ITEM = CUR_ITEM

	WHILE FOUND_ITEM <> 1 AND CUR_ITEM > (@NUMDTLT - @NUMDTLR)
		IF @DTL_IS_COND[ CUR_ITEM ] = 0 AND @DTL_TYPE[ CUR_ITEM ] = "M"
			FOUND_ITEM = 1
		ELSE
			CUR_ITEM = CUR_ITEM - 1
		ENDIF
	ENDWHILE
	
	IF FOUND_ITEM = 1
		IF VOID_ITEM <> @NUMDTLT
			LOADKYBDMACRO MAKEKEYS( (@DTL_TTL[ CUR_ITEM ] * DBL_MULTIPLIER) ), KEY(3,DBL_ITEM_OPEN)
		ELSE
			VOID_ITEM = -1
			LOADKYBDMACRO KEY(1,458753), KEY(1,458753), MAKEKEYS( (@DTL_TTL[ CUR_ITEM ] * DBL_MULTIPLIER) ), KEY(3,DBL_ITEM_OPEN)
		ENDIF
	ELSE
		EXITWITHERROR "Invalid Entry"
	ENDIF


ENDEVENT

//inquiry that also doubles cost of mixers
EVENT INQ : 2
	
	VAR CUR_ITEM : N3 = @NUMDTLT
	VAR FOUND_ITEM : N1 = 0
	VAR TOTAL_TO_DBL : $12 = 0

	WHILE FOUND_ITEM <> 1 AND CUR_ITEM > (@NUMDTLT - @NUMDTLR)
		TOTAL_TO_DBL = TOTAL_TO_DBL + @DTL_TTL[ CUR_ITEM ]
		IF @DTL_IS_COND[ CUR_ITEM ] = 0 AND @DTL_TYPE[ CUR_ITEM ] = "M"
			FOUND_ITEM = 1
		ELSE
			CUR_ITEM = CUR_ITEM - 1
		ENDIF
	ENDWHILE
	
	IF FOUND_ITEM = 1
		LOADKYBDMACRO MAKEKEYS( (TOTAL_TO_DBL * DBL_MULTIPLIER) ), KEY(3, DBL_ITEM_OPEN)
	ELSE
		EXITWITHERROR "Invalid Entry"
	ENDIF

ENDIF

//inquiry that doubles by ringing the item in twice, and modifying with a doubles
EVENT INQ : 3
	
	VAR CUR_ITEM : N3 = @NUMDTLT
	VAR FOUND_ITEM : N1 = 0

	WHILE FOUND_ITEM <> 1 AND CUR_ITEM > (@NUMDTLT - @NUMDTLR)
		IF @DTL_IS_COND[ CUR_ITEM ] = 0 AND @DTL_TYPE[ CUR_ITEM ] = "M"
			FOUND_ITEM = 1
		ELSE
			CUR_ITEM = CUR_ITEM - 1
		ENDIF
	ENDWHILE
	VAR ORIGINAL_ITEM : N7 = CUR_ITEM
	IF FOUND_ITEM = 1
		//things get trickier here, becuase we have to actually ring the items in 

again and then void the existing item
		LOADKYBDMACRO MAKEKEYS(2), KEY(3, @DTL_OBJECT[ CUR_ITEM ])
		WHILE CUR_ITEM < @NUMDTLT
			CUR_ITEM = CUR_ITEM + 1
			LOADKYBDMACRO KEY(3, @DTL_OBJECT[ CUR_ITEM ])
		ENDWHILE
		LOADKYBDMACRO KEY(1,458776)
		LOADKYBDMACRO KEY(3, DBL_ITEM)
		VOIDDETAIL( ORIGINAL_ITEM )
		//LOADKYBDMACRO MAKEKEYS( TOTAL_TO_DBL ), KEY(3, DBL_ITEM_OPEN)
	ELSE
		EXITWITHERROR "Invalid Entry"
	ENDIF

ENDEVENT
 
Moregelen - this is awesome, thank you!
I have it in place and it is working pretty well, but there is one thing that I am struggling to figure out.
When I ring in the modifier from the forced mods screen I get a "Condiment Entry Required" error.
However, if I ring in the modifier outside of the forced mods screen it works correctly.
Any idea why this might be?
 
Sounds like the SIM does not satisfy the requirement. Might have to be used outside.
 
BootstrapperXx - thank you for you the clarification on the other possible solution!

For the most part the SIM is achieving the end result, but I wasn't sure if I was implementing it incorrectly since I am getting the error.
 
We never did required modifiers on alcoholic drinks. You would have to make both modifiers, the open and non-open priced items, part of the required group. The issue if you do that is that they could directly ring in the open priced item. Typically we had a modifier screen for alcoholic drinks and this was a hard coded quick button.
 
Moregelen - making it a hard button outside of the forced mods was the work around I came up with when I kept getting the error, I think this is the best way to achieve what the BM wants. I really appreciate your help on this!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top