Help with SQL to create a price check button

Using a script and {CALL:xxx} you only need one rule and one action;

Script;

function checkPrice(inputBarcode) {
	qry =  "SELECT p.[Price] FROM [MenuItemPrices] p LEFT JOIN [MenuItemPortions] s ON s.[Id] = p.[MenuItemPortionId] LEFT JOIN [MenuItems] m ON m.[Id] = s.[MenuItemId] WHERE m.[Barcode]="+inputBarcode+"AND s.[Name]='Normal'";
	var salesTicketCount = sql.Query(qry).First;
	return salesTicketCount;
}

Rule;

CALL expression;
{CALL:toolScripts.checkPrice('[?Scan Barcode;;;OCN]')}

No Settings.
One script,
One rule,
One action.

2 Likes