Help with entities in a report

Hey there,
I’m loving Samba and currently setting up my first restaurant. Everything is going really smoothly and this forum is to thank for that. So thank you.

I’m having a problem reporting my entities in various reports. I don’t have my entities set up with under Tables entity type. Instead created 4 different Entity Types; Let’s call them ONE,TWO,THREE & FOUR.

In my reports I’m am having trouble getting all four kinds of Entity Types to show up on the report where I am using {REPORT ORDER DETAILS}. I can get individual entity types by using EN.ONE. Is there a way to have all four entities appear in the same table box?

Thanks in advance for any help.

Havent done huge amount of work in custom reports but if I understand what your asking I believe you would define your entity types with an @ like this;

@{ENTITY TYPE LIST CODE/TAG HERE}
>&1
{REPORT TAG WITH (ENTITY TYPE=$1)}

Am basing this on the Payment details from WP report;

[Payment Details:2, 1, 2]
@{TICKET TYPE LIST}
@{TAX TYPE LIST}
>$1
{REPORT PAYMENT DETAILS:P.Name,P.Amount.Percent,P.Amount.Sum:(TY=$1)}
{REPORT CALCULATION DETAILS:C.Name,C.X,C.CalculationAmount.Sum:(TY=$1)}
$2||{REPORT TICKET DETAILS:TX.$2.Sum:(TY=$1)}

Not sure if there is an entity type list tag so much need to use a script with some SQL and call with @@

Very good try JTR your close but in fact you can use other Report Syntax as a variable. I will show example.

This is not your report you want but look at how I used this syntax it might give an idea.

@{REPORT PAYMENT DETAILS:P.User,P.Amount.Sum::{0}:,} 
[Settled by $1:1, 1, 1] 
{REPORT PAYMENT DETAILS:P.Name,P.Amount.Percent,P.Amount.Sum:(PU=$1)} 
>Total Income|{REPORT PAYMENT DETAILS:P.Amount.Sum:(PU=$1)}

2 Likes

@bc3 It would help if you can show us visually what you are trying to do.

Thanks for the quick response,

I’m doing reports for voids, refunds and discounts. The reports work great but I can’t get the all the entity names to appear in the same box. Here’s my void report:

[Voids Detail:2,2,1,1,1,1, 2]

User|Table|Time|Item|Quantity|Total|Reason
{REPORT ORDER DETAILS:O.User,EN.Tables,O.Time,O.MenuItemName,O.Quantity,O.TotalPrice,OSV.GStatus:(OS.GStatus=Void)}

I am having trouble where it says “EN.Tables”. I would like to get the Entity Name for all four Entity Types, ONE TWO THREE FOUR, to appear in that space.

You might struggle on that as entities are not in the Order field list as far as I can see.
You might have to rework the report a little…
If you used the above you could in theory break down the orders into groups for each table… not exactly the same I know.

So why are you assigning 4 entities to same ticket? Might help us understand.

I’m not. I have over 200 entities in four different rooms so I broke them up according to entity type just so it was easier to organize instead of having all the entities under “Tables.” Each room has its own Department, Entity Type and Ticket Type. I want the name of the entity to appear on the table, regardless of what Entity Type it is.

There is a better way to do that without making multiple entity types but you still have not explained much about your workflow. Screenshots really help. Your not asking to show multiple entities in one table. Your asking how to tell it to show what entity it is despite of type etc. right?

Exactly! I want it to show the name of the entity despite it’s Entity Type.

I really didn’t know that there was a better way. It made sense to me to break everything down to organize it better. When I couldn’t figure out how to get the Entity Name in the reports, I tried to list all of my entities under one type of Entity Type name Tables (so I could just use EN.Tables on the reports) but then I ran into a lot of problems with opening,closing, and adding tickets. So I really don’t want to have to delete all of my work up to this point and remake the custom entity screens with the widgets again.

I’m not at my POS station right now so I cannot do screen shots. But my workflow goes as follows.
Restaurant with 3 different dining rooms and a kitchen/take out department. Each room has its own Department, Ticket Type and Entity Type.
So if I want to see why a waiter voided some pasta in Dining Room #1 and why a bartender voided some beers in Dining Room #3, I can view them under the same report and ask them the specifics of the order.

I’m still stuck on this. Is there a way to string together the different Entity Types with AND or OR under {REPORT ORDER DETAILS}?

Example:
(EN.One) OR (EN.Two) OR (EN.Three) OR (EN.Four)

Yes AND or OR :stuck_out_tongue: well AND at least I know works.
Here is one of mine using AND;

{TICKET ORDER QUANTITY TOTAL EXP:(OS.Package=Package) AND (OS.Kitchen Course=Starters)}

If or doesnt try || (double pipe)

1 Like

He needs to use OR for his case.

1 Like

|| means OR. Both should work fine.

However this is not an expression. If you give more concrete examples we can better help.

I’m not really sure what else I can say about it as I am a beginner. Where it says ‘EN.Tables’ in the chart below, I need to know how to get the name of whichever entity was used regardless of which of the four entity types was used to display in that box of the table. I’ve played around with countless types of brackets and ORs and ANDs and I’m still lost.

[Voids Detail:2,2,1,1,1,1, 2]

User|Table|Time|Item|Quantity|Total|Reason
{REPORT ORDER DETAILS:O.User,EN.Tables,O.Time,O.MenuItemName,O.Quantity,O.TotalPrice,OSV.GStatus:(OS.GStatus=Void)}

I’m not on my dev machine so I can’t test that but try this one instead of EN.Tables.

=[EN.One]+[EN.Two]+[EN.Three] 

like

...O.User,=[EN.One]+[EN.Two]+[EN.Three],O.Time...

If you always choose one of them that will display selected entity’s name. Please let me know if it works or not.

Works great! Thank you so much.

I never thought to put = and +