Need help in custom report

sorry for making this topic again but i need help to create 2 custom report (i can’t understand tags report :sweat: ) :
1- to show food , beverage and dessert separate totals in 1 report
2- item sales report for food only and another for beverage and another for dessert

how i can create report for account or entity to show all orders that ordered on this entity or this account ??

other thing i have something here called officer that mean store manger and ass. store manger can get food and beverage but don’t count as sales, it’s more like a gift but we call it here officer and we settle table to officer at end of it .
is there is anyway to do that ???

http://www.sambapos.com/wiki/doku.php?id=custom_reporting_tags

That is a very good resource it explains tags in detail and has samples. You can also look at built in default reports to get good idea of how most tags work.

Try to explain your need in more detail and try to visualize it as much as you can. Trying to explain reports with plain text might be confusing as some terms might have different meanings depending on how you use them. For example by saying food, beverage, dessert do you mean to group sales by product group or do you mean courses?

See this post as an example of how descriptions can be confusing and how samples solves it.

let me explain officer thing 1st :
i created entity type called officer and ticket type called officer cause only tables that take 12% service


and as you see in pic i created entity called mohamed with store manger name .
i also created payment type officer to close all officer tables to account called officer

i want to show all orders that ordered on this entity in report to show like

i also want to all tickets paid as c/l and complimentary to show in report

for complimentary i wanted to look like

and c/l like

as for food , beverage and dessert i want to show sales report like work period but only show food , beverage , dessert

and separete item sales for food products only and one for beverage products only and one for dessert only

sorry for long reply and requests but i realy need help with this to do on live version that working right now

So how are you defining whats food, drinks, desert etc? Are you using Courses, Product Tags, Group Tags?

What is c/l?

What is Complimentary?

@a.samy Thank you very much for your detailed explanation. This comment is important because there is more than one way to implement things in SambaPOS. Are you using product groups to define if a product is food or beverage?

1 Like

i define it with product tag

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