Help with SQL to create a price check button

Rick export db files for this price check and upload here.

Try taking out the quotes in the test, since it’s a number.

And the semi colon is back on the last line?

Can you show the product with that barcode?

Is there anyway to format the response? for example when i just had the script set to show the normal price it didnt display the work normal, just showed the price. i could then edit the show message action so the result displayed:

Price: £10.00

Now ive changed the script to show portions as well i cant do this and anything with just the portion normal now displays normal then the price, and i cant format to put a £ sign before the prices


Just to be more annoying lol, id like to turn it into more of a stock enquiry screen so could you help with the script so that i can show the product name, with portion prices below, and then the stock level below that?

I’ve never used inventory so will struggle on that front.
As for formatting, yes it not a big adjustment, I was taking short cut but proper way would be to change the delimit to special character like ~ maybe and split on that to give you seperate values for portion and price.
The for loop is looping through the ‘rows’ of the SQL result.
Curently the columns for each row are just being seperated by a space via the delimit function.
You might need to suggest the method for getting inventory levels and can help intergrate that as best I can.

Is there any way to add tax in it.
I have some products that contains tax template.

This is what the result is for my stock level check

This is the ask question settings to display that
<color black><bold><size 60>{NAME}\rStock Level: {REPORT INVENTORY:{ITEM TAG:Inventory Name}:Local Warehouse}</size></bold></color>

so got the £ sign in the right place now

Anyway to align the prices to the right?

Anyway to remove the word normal from products with no portions?

Sorry have not read the whole thing. Is the response from script?
You can just do
return data.replace('Normal ','')

JTR I tried your script on a different location with totally different database and system and its giving me the same response.

Which samba version are you using?
M using 5.1.60
Is there any problem related to version?
And my database version is 2014

Wrong type of double quote and single quote you using. That why it said invalid character. If you dont know what it is copy quote here " and '

1 Like

SQL more commonly seen using " but the script is working fine for the rest of us…

Will sort you the script later.

What is inventory item name when using portions? Do you set an inventory item name for each portion?

For this senario if you want multiple portions and their inventory count might need to use some program settings…

Have a feeling inventory will be very complex to report with SQL so might need to change so that you find product name from barcode with SQL then use report expressions to get inventory.

1 Like

Thanks!! Ill have to double check how i set inventory items for portions but getting the name from barcode as you suggest would probably be better, then use the report expressions to get inventory :grinning:

The main bit I have no idea on is how you would go from product name to portion inventory item.

The ones with portions wont really be an issue so not bothered about portion inventory

Just normal non portioned product inventory is all i need, is that easier to do?

Thats what i get using my stock level auto command but you need to add the product to a ticket first and then cancel it off, this way would be better, just scan and you get product name, price and inventory level. No need to create tickets and add products