Changing Table Button Captions

I am confused, I type “$1{TICKET STATE MINUTES:X}” in the display format in the states.

On the screen it shows table number plus {TICKET STATE MINUTES:X}

Not table number plus actual minutes.

Sorry for being so confused.

OK. I know the reason of the confusion. (me lol).

On next V5 update you’ll be able to use {ENTITY STATE MINUTES:Status} and other entity related tags on state display formats.

We don’t have access to tickets from entity buttons but you can use reporting tags like {DISPLAY TICKET DETAILS} to display ticket related data.

Why at IN Entity Screen, i can’t display status button table?
But at OUT Entity Screen status button display remaining total table.

this out entity screen:

this in entity screen :

New Order State:

1 Like

Check if your table names are exactly 05,06, etc.

Oke, Thanks Again. it solve now. my fault because my table name 1, 2.

Hey @emre
Just trying to put this topic to bed - when you made the comment above, which part of the Tutorial were you referring to? With regards Button Captions I thought from our work the other day JScript was not supported.

Also just found this so will included it just to keep “documentation” in order:
http://forum.sambapos.com/t/entity-state-formatting-templates/6120/2?u=pauln

Your reference in above link:

Hello @pauln

This is a JScript Expression[=2+1].
This is not supported.

This is a printer template that calls JScript {CALL:utils.sum(2,1)}. **
This is supported as Printer Templates already supported on button headers.

Using inline report tag expressions for calculations is recommended as it does not instantiate (create) JScript Engine.

**Assuming you already defined utils.sum function in scripts.

Ok so I may be confused - can I use a {CALL:x} function in Entity State “Display Format:”
If this was the case I can use logic IF’s and AND’s to my contentment to return Caption Data for Caption ButtonText?

Yes you can but… whatever… Yes you can use if’s in button captions by using {CALL:X}

Therefor below we are using “Credit Limt $” which is a custom field but it only exists for Customer and Tabs Entity. So I should use a {Call:x} function to return Null if the field does not exist for Entity Assigned to Ticket as now we just get a “Credit Limit $” result - not so desirable for Entity Pager ot Entity Tables.

<bold>$1</bold><br/>Open Sales: ${REPORT TICKET DETAILS:[T.RemainingAmount.Sum]:(TEN.Customers={ENTITY NAME}) OR (TEN.Tabs={ENTITY NAME})  OR (TEN.Pagers={ENTITY NAME}) and T.RemainingAmount>0}
<br/> On Account: $ {ENTITY BALANCE}
<br/> Credit Limit $ {ENTITY DATA:Credit Limit}
{REPORT TICKET DETAILS:'<br/>Notes '+[T.Note]:(TEN.Customers={ENTITY NAME}) OR (TEN.Tabs={ENTITY NAME})  OR (TEN.Pagers={ENTITY NAME})  and T.RemainingAmount>0 and Ticket.Note != null}

This will also solve my last line above whereas I cannot omit the line if no ticket note exists. Currently I am getting for each button Caption:
Note
Note
Note Make the Coffee Hot!
Note

Parser Note FYI if you embed a “:” colon in the prefix '<br/>Notes ' like <br/>Notes: it breaks the Parser.

EDIT: PS After all is “said & done” I will probably only use this Captions for Simple Entity like Pagers, Tables, and Tabs. As there will be over 1,000+ repeat Customers I would widgets.

Here is the Sample:

Once you confirm @emre - it means here comes Samba scripting for me :sweat_smile:
I reckon the entire Caption will be returned as a String i.e "br/ … data br/ more data + br/ end data.

EDIT2:
If I change the last line to this:
{REPORT TICKET DETAILS:'<br/>Notes '+[T.Note]:(TEN.Customers={ENTITY NAME}) and (TS.Status=Unpaid) and Ticket.Note != null}

I get that:

Which is sort of OK as I only using that part of the Caption for Pagers anyway…

Calling jscript in button headers means each button will be calling jscript engine everytime screen refreshes for every button. That doesn’t sound very efficient. Maybe it won’t be issue and maybe I’m wrong but wouldn’t that be unnessisary resources for such a simple function.

Agree, but would only be using it for say 20 of TAB Entities, Table Entities and Pager Entities. The script also would only be doing what the buttons do now except use IF; CASE; OR arguments to get around the inability to use Expressions.

OK seems like I have to mention that once more. Like we’ve recently discussed with @JTRTech:

  • You want to display credit limits on buttons.
  • You implemented something working.
  • You’ve noticed it also appears for customers that does not have limits.
  • You thought you’ll solve it if you can use “IF” in your template.
  • You skipped whole case and just asked me if it is possible to use IFs, ORs, etc…
  • You received “No” answer.
  • Noticed something similar under some other topic.
  • Asked {CALL:x}
  • Finally decided to send this…

http://forum.sambapos.com/uploads/default/original/3X/4/2/42d34ac31836f4fb2bc192b86459d6b5204a100f.JPG

Until I see this I had no idea about your issue. It is like asking a doctor drug X without explaining your pain.

The cure for your issue is {REPORT ENTITY DETAIL:X} tag. I’ll check if it already contains values you need.

PS: I’m not trying to disturb you. I’m trying to improve our communication culture. My English is too limited so I don’t know how to adjust tone in my writings. I’m sorry if it sounds rude or offensive.

2 Likes

Yes well I have trying unsuccessfully to use the REPORT ENTITY DETAILTag for the last hour. I just need to have it display for 2 of the 4+ Entities I will have.

Sorry I did not see the “little talk” you had with JTRTech so happy to read any links as my eyes are very red for reading everything possible.

I am much better at IF’s, CASE’s, OR’s, AND’s and seem to struggle with your Template syntax i.e where and when to use a “[” or a “:” or a “.” or a prefix or … :dizzy_face:

1 Like

Can you explain me what does it mean?

I have 4 Entities (maybe more eventually). I have a custom field named “Credit Limit” ONLY on Customer Entity and Tab Entity and therefore only wish to display the line in the button caption if the field exists (or is non-zero) for the Entities Customer & Tabs.

Do you mean you create +4 entities for each customer?

So My name is Paul Barnes. My Customer Entity Name is 01000. How My Tab entity is named?

No, sorry I have 4 Entities Types:
ENTITY TYPE:Customers: have credit limit Custom Field
ENTITY TYPE:Tabs: have credit limit Custom Field
ENTITY TYPE:Pagers: have no custom field
ENTITY TYPE:Tables: have no custom field

The “+” only meant I may add another few Entity TYPES later.

This is my attempt:
{REPORT ENTITY DETAILS:'<br/>Credit Limit ' +[EC.Credit Limit]:(EN={ENTITY NAME}):(TCET=Customer)}
I have embedded the "<br/>" so it only throws a new line if the line is created. Unfortunately it is getting created for all Entity Types.

Not tested but you can try this.

{REPORT ENTITY DETAILS:'<br/>Credit Limit ' +[EC.Credit Limit]:(EN={ENTITY NAME}) and (ET=Customers)}

I’ll test it when I get back to home.

:scream:
Yes that worked AND I was so close! Gees I just what to get one on these myself…

Ok so I can duplicate the line for Tabs - great.

EDIT: No need as I approach “semi-guru status for 1 minute haha”
{REPORT ENTITY DETAILS:'<br/>Credit Limit ' +[EC.Credit Limit]:(EN={ENTITY NAME}) and ((ET=Customers) or (ET=Tabs))} <- Working Great!

So its 1.51am in the morning, how about a quick spot on hiding this below line for ENTITY:Tables and ENTITY:Pages if they do not have a Account OR Account Balance?

<br/> On Account: $ {ENTITY BALANCE} <- Only required for Entity:Customer & Entity:Tabs?

2.30am must sleep. As {ENTITY BALANCE{} takes no arguments the only other option is {ACCOUNT BALANCE:x} but I cannot get this work is the same optional line format as Credit Limit? Tabs & Customer may have an Account (if an account was created). Pagers & Tables will not have any account so?

Hopefully the Good Fairy :ribbon: will leave me a present when I wake up.