Custom Report Tags in detail

These are the supported DETAILS tags.

{REPORT TICKET DETAILS:<fields>:<expression>}
{REPORT ORDER DETAILS:<fields>:<expression>}
{REPORT PAYMENT DETAILS:<fields>:<expression>}
{REPORT CALCULATION DETAILS:<fields>:<expression>}
{REPORT ENTITY STATE DETAILS:<fields>:<expression>}

These tags are useful to create table reports. In this post I’ll explain how <fields> section works.

This sample tag lists all tickets created by user named Emre

{REPORT TICKET DETAILS:<fields>:(TU=Emre)}

By using fields section we can configure what data our report displays. There are three types of fields.

1- Predefined fields that requires a parameter. For example EC.Customer.Phone field requires 2 parameters and returns ticket’s customer phone.
2- Predefined with no parameter. These starts with T. identifier. For example T.Department returns department name.
3- Database Fields. These also starts with T. identifier. They are directly mapped to database fields. If you see a TicketNumber field in Tickets table you can read that value with T.TicketNumber. That means if a database value not listed here you can read it by using it’s field name.

Hint: T.DepartmentId field returns DepartmentId field value of Tickets table. For some Id fields there is a predefined field named as T.Department. That’s why we have both predefined and database fields.

Now I’ll configure some fields for the sample tag.

{REPORT TICKET DETAILS:T.TicketNumber,T.Time,TN.TotalAmount:(TU=Emre)}

This report will display Ticket Number, Time and TotalAmount values.

Hint. You’ll notice Total Amount value uses TN instead of T. Adding N next to identifier will format it as a number. That means T.TotalAmount field will display it without formatting.

###List of all predefined fields.

TICKET DETAILS

EN.<entity type>                    Entity Name
EC.<entity type>.<field name>       Entity Custom Field Value
TS.<state name>                     Ticket State
TT.<tag group name>                 Ticket Tag Value
CA.<calculation type name>          Calculation Amount
PA.<payment type name>              Payment Amount 
T.Department                        Department Name
T.TicketType                        Ticket Type Name
T.User                              User Name
T.Date                              Ticket Date  
T.Time                              Ticket Time
T.Terminal                          Terminal Name
T.Tax                               Total Tax Amount
T.TotalAmount                       Total Amount
T.RemainingAmount                   Remaining Amount

ORDER DETAILS

OS.<state name>                     Order State
OSD.<state name>                    Order State Date
OST.<state name>                    Order State Time
OSV.<state name>                    Order State Value
OSU.<state name>                    Order State User 
OT<tag name>                        Order Tag
OTN.<tag name>                      Order Tag Note
OTU.<tag name>                      Order Tag User 
OTP.<tag name>                      Order Tag Price
MT.<tag name>                       Menu Item Custom Tag Value
O.Department                        Department Name
O.Date                              Order Date
O.Time                              Order Time
O.User                              User Name 
O.Terminal                          Terminal Name
O.Tax                               Tax Amount
O.ItemGroup                         Menu Item Group Name
O.ItemTag                           Menu Item Tag
O.Price                             Price
O.Quantity                          Quantity
O.OrderNumber                       Order Number
O.Total                             Order Total
O.TotalPrice                        Order Price * Order Quantity

PAYMENT DETAILS

P.Department                        Department Name
P.Date                              Payment Date
P.Time                              Payment Time
P.User                              User Name 
P.Terminal                          Terminal Name
P.Type                              Payment Type      
P.Amount                            Payment Amount 
P.TenderedAmount                    Tendered Amount 

CALCULATION DETAILS

C.Date                              Calculation Date
C.Time                              Calculation Time
C.User                              User Name 
C.Type                              Calculation Type      
C.Amount                            Amount
C.CalculationAmount                 Calculation Amount

ENTITY STATE DETAILS

EN                                  Entity Name
EC.<field name>                     Entity Custom Field Value
CD.<field name>                     Custom Data Value
L.StartDate                         State Start Date
L.StartTime                         State Start Time
L.EndDate                           State End Date
L.EndTime                           State End Time
L.Seconds                           Total Seconds
L.Minutes                           Total Minutes
L.Hours                             Total Hours
L.Days                              Total Days
L.Second                            Duration Second
L.Minute                            Duration Minute
L.Hour                              Duration Hour
L.Day                               Duration Day

Hint: Log custom data syntax is <field1>=<value1>;<field2>=<value2>;...

###Field Calculations

This great feature allows you to make calculations by using field values.

Syntax: =<calculation>

Examples

{REPORT TICKET DETAILS:T.TicketNumber,T.Time,TN.TotalAmount,=2+2}

This tag displays the result of 2+2 on all lines.

{REPORT TICKET DETAILS:T.TicketNumber,T.Time,=[T.TotalAmount]*2}

This tag displays Ticket’s Total Amount multiplied by 2.

When you use fields in calculations you need to enclose them in square brackets. For example:

{REPORT TICKET DETAILS:T.TicketNumber,=[T.TotalAmount]*[EC.Employee.Comission]}
4 Likes