The script has incorrect syntax for the SQL query as @sukasem has mentioned.
You are failing to 'single-quote' the inputBarcode for the SQL …
This is correct:
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;
}
The [MenuItems].[Barcode] field in the DB is datatype nvarchar(max). It will accept a raw unquoted number in a WHERE clause, but it will not accept any characters unless you 'quote' the value. So always best to quote it.
Using SQL, tax templates/mappings are likely to be tricky.
What type of taxes do you have setup.
Myself and Rick will both have tax included in prices so is not an issue as in UK retail prices are generally handled inc vat as customer sees them.
I don’t really quite understand why have to do all this. It seem this will happen in ticket anyway. why just add the item to ticket and just read the price for that item and display it on ask question, you can get product name portion tax bla blah blah. If accept, do nothing and not cancel last item.
But how could you read the item price for that item from a ticket?
Next thing when we press price check the rule for price check have to wait till barcode scanned.
We have a vat too here and thats 12.5%.
Can’t we multiply 12.5% manually in sql by group code?
I have only one group code for non vat items and rest are the vat items.
No actually I mean, popup ask Question like the way you want.
So step out of my head right now:
click price check popup to scan like you normally do.
set program setting to price check mode
in order add to ticket event check if this is check price mode then popup ask question. this is event we still in order level so, {XXX} for order level will be available
Nah nah nah actually cashier is not allowed to cancel transaction, they need admin confirmation and if i added price check this way they gonna rob the grocery
The original purpose of the prompt and ask question was to avoid creating ticket unescerserally.
But the simplest solution would be just to scan barcode as normal so it adds to ticket and cancel if not needed.
This process as you cay would be automated, add to ticket using barcode with ask question but if adding to ticket unless cancel has been removed for whatever reason and you want to allow only in price check flow.
Well offcourse I have to add cloce ticket.
But i wanted to know how could we read barcode from numpad, add item to ticket and display its total price with tax?
I don’t think you are understand what we saying and I am not sure you ask the right question.
So, this thing happen at cashier? Do you have customer Display?
BTW I never see price check (popup screen like that) at cashier so, they do have order screen (customer display to show orders). Customer already see the price when order scan.
And tax thing isn’t customer should expect to pay already. It is not like we can’t show it. but from my experience at big box grocery store in order line normally is price before tax. You know you can’t do anything about tax.