Menu Item button display format

How do I run this script?

Use SSMS or create a DB Task…


Create a file that contains the script, and save it as [CBL]Update Menu Button Prices.sql in:

[Docmuents]\SambaPOS5\Database Tasks\

:bulb: NOTE: FYI, the [CBL] prefix on the file name is optional, but they are “flags” that indicate what is supposed to happen when the Task is executed:

  • C = Prompt for Confirm before execution
  • B = Backup DB before execution
  • L = Logout (and since you are altering the DB, a logout is required to refresh the Cache)


Run the Task in Manage > Settings > Database Tools > Database Tasks


Or use the Execute Database Task action and attach it to an Automation Command …

3 Likes

Thanks for that :D.

One other quick question, would it be better to use execute task action so I could use it in a config task? Or is there another method which I could use the script in a config task?

I am not very familiar with Config Tasks myself, but I think executing the DB Task via the Action is probably the way to go.

What does the Arguments section in the execute database task do? What is it used for?

I don’t think the Arguments field applies to SQL tasks. It probably applies to BAT and/or VBS tasks.

The tasks can be SQL, BAT, or VBS …

Someone else asked about the Arguments parameter, and there was no definitive answer given to indicate the Arguments parameter worked with SQL tasks, so …

1 Like

Thanks for the clarification :slight_smile:

For next .61 I added comma separated arguments support. However parameter handling for database tasks is different.

In the script text parameters can be referenced by index as {0}, {1}, etc…

For example when SELECT {0} from {1} script called with *,Tickets argument first parameter (*) will replace {0} and second (Tickets) will replace {1}.

1 Like

I understand the terminology but how does that work in an actual scenario?
Could you give an example of how that argument section could be used?

If you’re asking me I don’t know how it can be used :slight_smile:

1 Like

btw one should be mindful of the security implications of have any Database Task action activated during normal day to day operations. Regular users should be denied write access to that Database Task folder, otherwise they could change the SQL file to do whatever they wanted on the database.

1 Like

They could also just execute SQL via cmd or mssms, or script… your #1 defense in security is discipline and knowing what your workers are doing.

1 Like

To update via ssms or script I thought they would need the db password, and i was planning on locking the staff out of the settings files also. One of the main reasons for installing SambaPOS is to control the fraud, ;-}

You do not need DB password to do anything via SambaPOS. It already is logged into the db.

so please explain how a user without admin rights can run their own script for own db updates. If i can’t secure the system, there isn’t much point in the whole affair in my case. Maybe we should make this a new topic here?

POS systems are not designed as security systems. They are for convenience and efficiency and speed. If your main concern is security you may need to find something more specialized.

@QMcKay need help on How to remove the price from buttons as I tried but since am using pos my prices changed few times and its still showing old prices, so I wanted to remove the prices any script

What buttons? What do you mean remove price from buttons?

I think it is portion buttons.

I think it need to call script (seem expression [=…] can’t take \d)
function portion(name) { return name.replace(/ \d{1,9}(\.)?\d{0,2}/g,""); }
But I think price always have .xx at the end so, this should be more specific.
function portion(name) { return name.replace(/ \d{1,9}\.\d{2}/g,""); }

Hmm how the heck does portion buttons relate to this thread?

1 Like