Or is there another way without using triggers?
Google cron jobs, triggers use similar format as cron jobs and there are generator forms online.
What are you wanting to trigger?
Triggers are limited to when they will fire (won’t trigger while a ticket is open), depending on automation needs you can constraint rules to dates which is documented on the happy hour without triggers tutorial.
In US, certain holidays, Mother’s Day for example, fall on a certain day of the week of a month (2nd Sunday of May for Mother’s Day). I wanted to make a rule that updates my prices on like 12:01 AM on the second Sunday of May, I don’t have to do it manually.
Another potential approach that could have advantages over changing all of your prices pragmatically is to apply a discount through an Order Tag price rate reduction rather than really changing your core prices. I give my customers discounts via Order Tags because this means they can see the true value of the product/service and can see the special discount they have received printed on the receipt.
You could do this by creating a rule that applies an Order Tag when an Order Added To Ticket. You can then enable and disable this rule on certain days. If you wanted to take this a step further, you could add Custom Product Tags and update all your products accordingly:
This way you could apply different discounts to different products on different days. You would then just enable and disable this rule on the day itself and probably set a value in the rule to determine which discount rate will be checked against.
Had a search and cro job mask for that seems complex and not sure if samba would accept that.
It could probably be achived via the rule constrains approach with some creative constraints.
Thinking you months day example
ddd = Sun
mm = 06
Day of month > 7
Day of month <= 14
Not tried but something like that.
That is my preference as well. Customers love to see they are getting something “special”.
The more I think about this whole question, the more I am convinced the logic should be taken to JScript and the “Special Day” should be set as a Program Setting. You could get fancy with Rule or Action Constraints, but as you decide to have more “Special Days” (ie. as mentioned by @mjb2000) , that approach would become complicated and messy very quickly. JScript can handle this much more efficiently, without the “mess”, and when you want to add a new “Special Day”, you modify the JScript to contain another case. No need to go through (multiple) Rules to add Constraints for a new day.
The script should be called upon Application Started, or Workperiod Started, or User Login. Personally, I would prefer User Login over the others, especially for those who are not in the habit of Closing/Opening Workperiods, and/or not in the habit of shutting down and restarting SambaPOS on a daily basis.
Upon Ticket Created Event, a “Special Day” Ticket State is applied to coincide with the Program Setting. The Ticket State is necessary so that it does not change from day to day like the Program Setting would; instead, it is saved to the Ticket and never changes again, even if you open/display the Ticket days or weeks later.
Upon Order Added Event, the “Special Day” Ticket State is checked, and an Order Tag discount is applied using a Tag Order Action based on that State.
If the discount which is to be applied is differing for every Product, then we also need Custom Product Tags which contain the discount amount for the Product (ie. such as those mentioned by @mjb2000). If a new “Special Day” is added, we create another Product Tag for that day, and use the Product Tag Editor to update the discount for the new Day/Tag. Logic could also be put in place to use fixed amounts or rates, depending on the content of the Product Tag as to whether it contains a percent symbol (
%) or not.
One more thing to consider: what if we are talking about an Increase as opposed to a Discount? Without getting into details, there are valid reasons for this type of thing. Nobody wants to see an increase, so what then? Maybe we do not use an Order Tag for this scenario and instead just alter the Product Price on-the-fly. Logic could be added via Action Constraints to check if the Product Tag is positive or negative… if negative, we use an Order Tag, and if positive, we change the Product Price.
That would be my approach…
It’s interesting… I was recently in New Zealand and it’s a commonly known and tolerated practice for restaurants and bars to increase their prices on public holidays. Most of these establishments will display the rate that they will hike up your bill and you just see the price adjustment added to the normal cost of your item.
Not sure how business managed to make this thing the norm there - But good luck to them!
Really… As you say, how on Earth did they manage to make that the ‘norm’…
Yep, it’s the norm: https://www.nzherald.co.nz/business/news/article.cfm?c_id=3&objectid=11585409
I was surprised… For me, I would advertise that I have a 0% surcharge, still pay my staff more, but because I am the business offering 0% on a public holiday I am going to be really busy and turnover a ton more than I would on a normal day. But it seems that’s not the way they do things there.