Multiple use Entity Button Caption using States

So starting to extend here (oh no I hear…). I going to implement multiple Entities to apply multiple accounts and accounting. below is the Entities so far:

I have implemented the basic Entity screens and applied the bits to get Entity Button Captions like below:

The setup is using the Work Flow State = New Orders as shown below with some comments and wishs:

Direction Required:

Question 1. I would like to only use the original state “New Orders” but have the Display Format apply to all Entities OR a nominated list i.e Customers; Pagers; Tables; Tabs - which currently is all!? Do I need to implement *some sort of script and call it with passing the Entity Name?

Question 2. I would like to also use a Custom Data field say “Credit Limit” on some of the Entities. Can the syntax be expanded to contain references to:
ENTITY DATA:Tabs:Credit Limit - T.RemainingAmount

Note above: Entity Type = Tabs but Name is Tab
Of course this may also need to go to script as well because the Caption State will be used for all Entities?
Also if the Entity does not have the Custom Field - why SambaPOS break or ignore like in many cases?

Any guidance, examples or comments is greatly appreciated - thanks.

Oh better supply my references:

Well that was easy enough - needs better formatting but works.

Syntax:
<bold>$1</bold><br/>$ {REPORT TICKET DETAILS:T.RemainingAmount.Sum:(TEN.Tab=$1) and T.RemainingAmount>0}<br/>Limit $ {ENTITY DATA:CreditLimit}

Now how do I get a universal state “New Orders” to work for all Entities? Credit Limit will work as it will be the same NAME for all Entities if used.
Could I use an IF Operator? If Entity is this Or that… Something to do with (TEN.Tab=$1) needs to change.

Look at how Status is shared across Ticket State, Order State, and Entity State. Then study how the rules are using that to update multiple things like Tickets, Entities, etc. That might give idea.

Yes saw some rules updating program settings etc but I am trying to do all my feature implementation just using the bare essentials. So if I can do it here without creating or duplicating States or creating new rules and actions I think it would be cool.

I think your looking at it the wrong way. I understand you wanting to keep it simple and thats a great goal. But the way your going about it might limit what you can actually do.

So you explained kind of what you setup but you have not explained how you want it to work in practice that might give us better idea. Can you give us a good idea of how you envision it to work when finished be detailed.

Sure I sort half expected that reply which is ok.
I doing this way as if I am successful here with SambaPOS I may ship to 100+ licensed venues with say up to 500 terminals. Keeping stuff minimal will survive over Samba versions and make implementation faster. But we all have our approaches I know what has worked well for me so always best to stick to what you know.

Saying all that I will not hesitate to build complexity when required and soon it will get complex with expected API creations. Hope that helps explain my position :smile:

Now what I am trying to achieve?
From the standard Entity Screens I have shown I wish to implement Captions that include:

  • Ticket Balance
  • Credit Limit
  • Customer Name
  • Account Balance
    So when a staff member is using the POSn they very quickly can give or assess the account or tickets status before ringing up sales or maybe just to inform the customer how much they have remaining on their Tab limit. Pagers are almost the same but I guess they are for single orders that bear a name maybe assigned to a known customer or maybe just a walkin.

Most of this stuff is doable but the syntax sits on the “New Orders” State right? So I will need to change the syntax on the fly if I press Tabs Entity or press Pagers Entity. To this it all comes down to TEN.Tab=$1 to going to TEN,Pager=$1 etc etc.

Does that help?

That explains more but I am still kind of confused with what your trying to accomplish. When customer A walks in what determines how an Entity Type is setup for that Customer… are all the Entity Types used for every customer?

Each Entity Type has its own account? Can you show an example of a few customers coming in and how you envision this system would look like in working practice?

OK remember you can also use OR in your tag… example.

<bold>$1</bold><br/>$ {REPORT TICKET 
DETAILS:T.RemainingAmount.Sum:(TEN.Tab=$1) OR (TEN.Customer=$1) OR (TEN.Pager=$1) and 
T.RemainingAmount>0}<br/>Limit $ {ENTITY DATA:CreditLimit}
2 Likes

Yes sorry trying to explode too much information if I can solve the minor issue but:

Clubs I deal with have 1,000+ known members
Each have Accounts for:
Bar [Customer Account]
Membership Fees [Fees Account]
Other ongoing Accounts [Other Account]

The Clubs also have unknown walk ins off the street that they will also set up a TAB that will either be paid off on the Day of carry over for a week or so. The Tabs will also be used for Corporate functions or Corporate Sponsors.
Tab Account

The Clubs also have kitchens which serve food and assign pager buzzers to them so Customers which can be Member or Walk in know the food is ready.

For any of the Entity screens I would just like to use Captions to describe the current State of the Entity. So colours are all good, but now I would like to include Ticket Balance, Account Balance, Custom Entity Data etc. I am trying to use the post I referenced above which uses Button Caption from Order Display Format field from the Entity States.

I need nothing else at this stage other than to provide tis information on the caption so operators can read. I would like to have the Display Format universal so it works for all Entities.

By using OR it will try to match one of them if it does then it uses that. This lets you define multiple Expressions for it to try and match.

AND Means it must match also. Its kind of like Matches and Matches All in rule constraints not really same thing but similar effect.

1 Like

Yep that will just about do it! Its a syntax thing. Now I am just having trouble sorting out this one:

Remaing $[=F(TN('{ENTITY DATA:CreditLimit}') - TN('{REPORT TICKET DETAILS:T.RemainingAmount.Sum:(TEN.Tab=$1) and T.RemainingAmount>0}'))]

I know its wrong as it not converting the numbers and doing the calculation as I am getting:

Last line should be Remaining $ 494.51

Ok that syntax is heading in the right direction but it now sums all Pager Accounts and all Tab Accounts. So it need to work just for the Entity its shows i.e. Tab1 or Pager1 or… which it did before but only worked for each individual Tab. Obviously when I brought up the Pager Entity Screen I got nothing.

Syntax need to probably have an IF operator using ENITITY NAME =

It shouldnt be showing all of them… show your syntax?

EDIT: Lol nevermind I get it. Its because there are multiple entities sharing that State. That is a State level display. You should probably use separate states.

Or maybe we can filter by Entity Name.

Actually I have not used this setup so I may be wrong… to me it looks like that syntax should work.

TEN.Table=$1 isnt the $1 pulling the Entity name?

Yep trying to avoid that if possible. I did have an error but “::” double colon! ahh. So took it back to your syntax corrected but does not work for Pagers so not summing all just summing correctly for Tabs but giving nothing for Pagers.
I will check it uses the same States…

Ok it was a Cache thing - now I have automatic Totals for both Entities using 1 State - Yah!.
Could you possibility give me the syntax to have Credit Limit - Ticket Balance? The one I have sown above just aint doing it for me… Has to be the TN( format but using 2 values in the formulae.

Need help with this:

<br/>Remaing $ TN('{ENTITY DATA:CreditLimit}') - {REPORT TICKET DETAILS:T.RemainingAmount.Sum:(TEN.Tab=$1)  OR (TEN.Customer=$1) OR (TEN.Pager=$1) and T.RemainingAmount>0}

Nup just can’t get this to work as have no understanding of correct syntax to use :sob:

<bold>$1</bold><br/>${REPORT TICKET DETAILS:T.RemainingAmount.Sum:(TEN.Tab=$1)  OR (TEN.Customer=$1) OR (TEN.Pager=$1) and T.RemainingAmount>0}
<br/>Remaing ${REPORT TICKET DETAILS:T.RemainingAmount.Sum:(TEN.Tab=$1)  OR (TEN.Customer=$1) OR (TEN.Pager=$1) and T.RemainingAmount>0} - {ENTITY DATA:CreditLimit}

Just cannot get the last line to sum together.

Need bed 1.37am, hate leaving unfinished work…

Hey guys I am still struggling with the above syntax trying to include REPORT TICKET DETAILS: Tag minus ENTITY DATA:CreditLimit.

Can someone please chime in and help with where to place the brackets, braces as I have no idea after lots of guessing. The last syntax used was just under the sobbing face…

<br/>Remaing $[=TN('{REPORT TICKET DETAILS:T.RemainingAmount.Sum:(TEN.Tab=$1)  OR (TEN.Customer=$1) OR (TEN.Pager=$1) and T.RemainingAmount>0}') - TN('{ENTITY DATA:CreditLimit}')]
1 Like

Lol is it button header? hmm…

I was so excited someone had came back I almost passed out but:

Custom Data field is ‘Number’
Please don’t give that ‘hmm’ - eyes hurting way too much.

The expression is not evaluating but the tags are working :slight_smile: likely something is messed up.

I know my head is messed up after 3 hours sleep…
PS: Syntax does not apply in the Report Writer either…