Syntax breakdown for {braces}, [brackets], (brackets), :colons:, etc

{something} is a printer template tag.
{something:something2} is a printer template tag, drilled-down to a more specific level.
Printer Template tags can be read or referenced in many areas of SambaPOS, such as in Rules. For example, {TICKET TOTAL}, {ENTITY NAME:Customer}, or {ENTITY DATA:Customer:Address} can be read in Rules.

{:something} is a reference to a value held in a Program Setting (variable) called something … you can create and modify your own variables using Action Update Program Setting by placing the variable name something in the Setting Name field, and [:something] (or an actual value) in the Setting Value field.

{?something} is a notation to prompt for input, which is then passed to some other variable

[:something] can be a few things…

[:something] is a reference to a value held in a built-in Program Variable (read-only?), such as [:RemainingAmount] or [:NumberpadValue] (which is also held in {:NUMBERPAD}, though the value in {:NUMBERPAD} can be modified using Action Update Program Setting, if you put NUMBERPAD in the Setting Name field, and [:whichnumber] or a value in the Setting Value field).
There are many of these that can be read in different ways, for example… [:EntityName] for a Customer Entity Type is the same as {ENTITY NAME:Customer} (printer template tag), and within a Rule relating to an Entity, you’ll see in the Left side of Custom Constraints you can select Entity Name, which I believe is simply a friendly representation of [:EntityName].

[:something] notation can also be used as input to a variable in an Action (like [:whichnumber] mentioned above), such as the Price field in the Action Update Order; if you place [:something] in this Price field, then in the Rule that calls the Action, you’ll see the Action showing an Input Box requiring a value for something, which actually sets the value for the Price field within the Action.

Then we have expressions, such as [=something1+something2] or [=TN('{TICKET TOTAL}')] which is an expression containing a Function() that is operating on a {PrinterTag}.

I look forward to any additions, corrections or clarifications from the Gurus @emre and @JohnS!

4 Likes

Some Screenshots…

2 Likes

Thanks for the information!
Can you tell me how can I get Ticket total in a “Create Account Transaction” action?
I tried these, but none of them working…
{TICKET TOTAL}
{TICKETTOTAL}
{:TICKET TOTAL}
{:TICKETTOTAL}
TN(’{:TICKET TOTAL}’)
TN(’{:TICKETTOTAL}’)
TN(’{TICKET TOTAL}’)
TN(’{TICKETTOTAL}’)

It really depends on the event that you capture in Rules. For example, the event Ticket Total Changed, or Payment Processed are 2 such events that will give you {TICKET TOTAL}.

… in other words if rule event relates with a ticket such as Ticket Closing, Ticket Total Changed etc… You can access ticket data with printer template tags. If event does not relates with a ticket (eg. user logged in) you can use Load Ticket action to load a ticket by ID, access ticket data and close it with Close Ticket action.

1 Like