Need help in custom report

comp is more like gift but go under sales total and gift don’t
C/L is pay way but for stuff member not customer and it cut from his salary at end of the month

they both are payment method

not custom tag . the other one

i don’t have custom tag at my screen

OK. Don’t do that. I’ll keep it simple and prepare a sample that Product Tag. After that you can use custom tags if you want.

First of all define it by using Custom Product Tags. Tag is used for printing purposes. Custom Tags better used for reporting. You can use Product Tag Editor to update tags.

###This report works by 5.1.51 version.

I’ve added tag support to order details report so it will work fine with 5.1.51 release. It will be released soon.

####Sales grouped by product tags.

[Sales by Product Tags:1, 1]
{REPORT ORDER DETAILS:M.Tag,O.ExactTotal.Sum}
>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum}

1 Like

###Orders by Officer

[Orders by Officer:2, 1, 1]
>Item|Quantity|Total
@Mohammed,Ali,Other Officer
>>Orders by $1
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum,O.ExactTotal.Sum:(TEN.Officer=$1)}
>$1 Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(TEN.Officer=$1)}

Type names of officers you want to include in report on the line that starts with @ character.

###Sales by Payment Type

[Tickets by Payment Type:1, 1,2]
>Ticket#|Total|Customer
{REPORT TICKET DETAILS:T.TicketNumber,T.TotalAmount,EN.Customer:(PA=Cash)}
>Total|{REPORT TICKET TOTAL:(PA=Cash)}| 

That report lists tickets paid by Cash. Change PA=Cash parts to make it work for your custom payment type.

1 Like

@a.samy I hope these samples will help you a bit to understand how custom reports work. I strongly suggest you to study these, review documents and prepare your reports. Feel free to ask anything you don’t understand. Once you get it you can prepare any report you want and update them as your business needs changes.

I would like to share a modified Orders by Officer report its optional but improves it. This report will work even for new Officer entities added without the need to edit report.

Report:

[Orders by Officer:2, 1, 1]
>Item|Quantity|Total
@{CALL:officers.getofficers()}
>>Orders by $1
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum,O.ExactTotal.Sum:(TEN.Officer=$1)}
>$1 Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(TEN.Officer=$1)}

Script:

function getofficers(){
var qry = "SELECT e.[Name] FROM [Entities] e JOIN [EntityTypes] et on et.[Id]=e.[EntityTypeId] WHERE et.[Name] = 'Officer' ORDER BY e.[Name]";
var r = sql.Query(qry).Join(',');
return r;
}

PS. @emre I see what you did with >> is that new? If not I must have missed that.

@Jesse that hack also can be used instead of SQL. We’re benefiting from grouping and formatting features here.

@{REPORT ORDER DETAILS:EN.Officer,O.Quantity.Sum::{0}:,}
1 Like

Wow good to know. I am trying to figure out what its doing. But thats a different conversation.

So a simpler version of what I just showed would be ignore the script completely and use this report.

[Orders by Officer:2, 1, 1]
>Item|Quantity|Total
@{REPORT ORDER DETAILS:EN.Officer,O.Quantity.Sum::{0}:,}
>>Orders by $1
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum,O.ExactTotal.Sum:(TEN.Officer=$1)}
>$1 Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(TEN.Officer=$1)}
1 Like

Yes > is bold >> is bolder. :slight_smile:

1 Like

That changes a lot. That feature right there really expands what you can do with Report Tags previously I thought were only available with SQL.

{REPORT ORDER DETAILS:EN.Officer,O.Quantity.Sum::{0}:,}
^--------------------^-------------------------^^---^-^

So we have 5 sections here

  1. Tag Name.
  2. Fields.
  3. Expression (left empty)
  4. Line format (as we have only {0} first field displayed. We use that feature on data export templates.)
  5. Line delimiter. (,) means all lines delimited with , char.

As it is also a reporting tag it displays only values exists in reporting rage. Good for this sample but might be a disadvantage for some cases.

2 Likes

@a.samy I think you also have a specific ticket type so you may want to include it as well. So assuming your ticket type is named as Officer Ticket, you can change expressions like…

(TEN.Officer=$1) and (TY=Officer Ticket)

WOW , u guy’s rock
i want to say thank u very much for all this work , it work perfect

but the sales by product still don’t work and the item sales by product tag

That will be available with next update. 5.1.51 there was something he added specifically for it to work.

LOL look what I said on the top of my post.

1 Like

I think you missed an arrow.

3 Likes

Too bad I don’t have @QMcKay’s big red arrow.

3 Likes

btw. you can use Custom Product Tags instead. Assuming you’ll configure a custom tag named Type you can change report like that.

[Sales by Product Tags:1, 1]
{REPORT ORDER DETAILS:MT.Type,O.ExactTotal.Sum}
>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum}

Anytime …

4 Likes