# Change Price - Create your own button to control permissions

**URL:** <https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346>\
**Category:** V4 Tutorial\
**Created:** [May 22, 2014, 6:34pm UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346 "2014-05-22T18:34:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [May 22, 2014, 6:34pm UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346/1 "2014-05-22T18:34:22Z")

</div>

I’ve noticed that the `Change Price` button is only available to Administrators, but I would like to be able to give that permission to a Manager as well. @emre, can you add this permission selection to the `User Roles`?

Further, I’ve tried to capture a price change on an item, in order to update the Pole display, but can’t seem to get it to work. I guess I don’t know which Event to use in the Rule (I’ve tried `Ticket Total Changed`).

I’ve been successful in updating the Pole when the `Portion` is changed, or when an item is `Gifted/UnGifted`, but I need help with the `Change Price` event.

EDIT: see the post later in the thread for a tutorial on the setup…

> [@QMcKay](#):
>
> One great thing about creating your own Change Price command is that you can control User Permissions on the button (Automation Command).

---

<div class="post-metadata">

**Author:** ![JohnS](https://forum.sambapos.com/user_avatar/forum.sambapos.com/johns/32/24916_2.png) [@JohnS](https://forum.sambapos.com/u/JohnS)\
**Post date:** [May 22, 2014, 10:44pm UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346/2 "2014-05-22T22:44:40Z")

</div>

You can use an Automation Command button for Change Price, capturing the NumberPad value and using update order action to change the price.

There is a topic here that covers this, but I can’t find at the moment.

Using Automation Commands you can map to a Role and have Admin Pin override if needed.

---

<div class="post-metadata">

**Author:** ![JohnS](https://forum.sambapos.com/user_avatar/forum.sambapos.com/johns/32/24916_2.png) [@JohnS](https://forum.sambapos.com/u/JohnS)\
**Post date:** [May 22, 2014, 10:57pm UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346/3 "2014-05-22T22:57:22Z")

</div>

Found it [Discount Authorization](http://forum.sambapos.com/t/discount-authorization/793)

@Emre, I think the problem with `Ticket Total Changed` event is that it is not triggered for all changes in ticket total. I did notice that it wasn’t triggering for Order Tags a while ago. I’m about to setup a pole display again, so I can give feedback if something is missing.

---

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [May 23, 2014, 6:48am UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346/4 "2014-05-23T06:48:45Z")

</div>

@JohnS I think we should completely get rid of that button on future updates. I’m also planning to remove all hard coded V2 buttons such as move, merge tickets and republish these functions as actions.

I know it makes using SambaPOS a little harder to configure for new users but after people understands how SambaPOS works they want to change them 🙂

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [May 23, 2014, 4:03pm UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346/5 "2014-05-23T16:03:46Z")

</div>

@JohnS, thanks for the link, I’ll give it a go and see if this helps with updating the Pole Display (my Discount buttons work correctly this way, and when clicked, they update the Pole Display successfully)… then I will need to look forward to the removal of the current hard-coded button in a future update.

@emre, I agree - remove all hard-coded buttons that can be implemented using Automation, so long as the configuration of the Rules/Actions are not overly complicated to restore them.

And of course, on a new installation, the current/default Automation (such as Change Price) should be installed as a starting point, but still allows the user to tweak them for their needs.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [July 23, 2014, 9:45pm UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346/6 "2014-07-23T21:45:00Z")

</div>

One great thing about creating your own `Change Price` command is that you can control User Permissions on the button (Automation Command).

**Automation Command:**

 ![](https://forum.sambapos.com/uploads/default/original/3X/7/a/7a069c5351e24662fd0cf5d4353b8b3aa815a0a4.png)

As shown above in the Mapping for this Automation Command, only users belonging to the Admin or Manager role can see this button.

* * *

**Action:**

![](https://forum.sambapos.com/uploads/default/original/3X/e/2/e20a5f94bc1432eae6507a643bad6e74753691a4.png)

**Action Type:** `Update Order`  
**Price:** `[:Price]`  
**Calculate Price:** `True`

* * *

**Rule:** (create a default mapping for this rule)

![](https://forum.sambapos.com/uploads/default/original/3X/4/a/4a0257783bf5e83ed914ccc0ef1efdc0292910b1.png)

**Price Field:** `[?Price:\d+\.?\d{0,2};;ON]`

In this Rule, the `?` notation will cause SambaPOS to prompt the user for a value. The mask portion `[\d+\.?\d{0,2}]` is a regular expression that allows for only numbers to be entered, and limited to 2 decimals.

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [September 28, 2014, 1:00am UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346/7 "2014-09-28T01:00:16Z")

</div>

@QMcKay ive used the expression that @Jesse gave me for my discount rule and if you apply this same rule to price change it has the same effect, i added the note (4 digits) in the keypad to remind cashiers that if they need to change the price to 9.99 or less they need to enter a leading zero so the decimal point is in the correct place eg 0999 gives 09.99

[?Enter New Price (4 digits);\d{1}.\d(2)|\d{1}\d{1}?.\d{2}|[0];;N]

 ![](https://forum.sambapos.com/uploads/default/original/3X/3/f/3f7fae2e665245acbf27feb8b0eea51427423e2e.png)  
 ![](https://forum.sambapos.com/uploads/default/original/3X/9/c/9c24c6e3adcdbc20ae5f97ce3007cf586fabc6ec.png)  
 ![](https://forum.sambapos.com/uploads/default/original/3X/d/e/de733265ad2bb024f32859dff49e0818d5e39a93.png) 

thanks to @Jesse for helping me out again!

---

<div class="post-metadata">

**Author:** ![sukasem](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@sukasem](https://forum.sambapos.com/u/sukasem)\
**Post date:** [September 29, 2014, 8:22pm UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346/8 "2014-09-29T20:22:46Z")

</div>

> [@QMcKay](#):
>
> @emre, I agree - remove all hard-coded buttons that can be implemented using Automation, so long as the configuration of the Rules/Actions are not overly complicated to restore them.
> 
> And of course, on a new installation, the current/default Automation (such as Change Price) should be installed as a starting point, but still allows the user to tweak them for their needs.

+1 on hard Change Price button. I also try to use small numberpad in menu screen but it doesn’t work with change price. We can create our own change price but can’t disable hardcord one ☹

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [September 29, 2014, 8:29pm UTC](https://forum.sambapos.com/t/change-price-create-your-own-button-to-control-permissions/1346/9 "2014-09-29T20:29:54Z")

</div>

@emre do you have an update as to whether you will removing the hard coded buttons and replacing with automations that we can configure?
