[NEW!] How to use Custom Reports Module 1.0

Hi @emre can you please show me the code I need to build a report showing sales and tax by each day, over a month?

I’m trying to produce a report for my book keeper.

Thank you in advance for your help.

Hi @emre,

I was able to recreate the script for the Tips as you have here. I tried to add payment type to the script with no luck.

I was able to patch this together in the Custom Reports Property Editor.

It is showing the correct payment types if I skip the $0 transactions. Can this also show voided items? I really like the finished report Gerlando was able to create from your template.

Can you help me to correct this?
Thanks
Ray

If you want to show the Payment type with tickets then you would need to code that into the SQL not add it as a tag. Or convert the entire report to Report Tags it might look like this:

[Tips by Tickets:1,2,2,1,1,1,1]

>Ticket Number|Date|Time|Tip Amount|Net Amount|Ticket Amount|Payment Type

{REPORT TICKET DETAILS:T.TicketNumber,T.Date,T.Time,CA.Tips,=[T.TotalAmount]-[CA.Tips],T.TotalAmount,TT.Payment:(TS.Status=Paid)}

this requires a couple things:

  1. You need to make a Ticket Tag that tags the orders with [:PAYMENT TYPE NAME] on Payment Processed Rule
  2. Where it says CA.Tips be sure Tips is the name of your calculation and its case sensitive.

3 Likes

Ok I see. That makes sense. I created a Ticket Tag “Payment Type Name”, I created a “Payment Type Name” Rule and Action for that rule. Still not populating.

It seems to edit the SQL code and add the payment type may be quicker.

Here is the script I am using. What code would I need to insert?

Thanks!

You would need to use the code I showed you not the SQL.

Below is the entire report minus the Total reports you made at bottom.

[Tips by Tickets:1,2,2,1,1,1,1]

>Ticket Number|Date|Time|Tip Amount|Net Amount|Ticket Amount|Payment Type

{REPORT TICKET DETAILS:T.TicketNumber,T.Date,T.Time,CA.Tips,=[T.TotalAmount]-[CA.Tips],T.TotalAmount,TT.Payment:(TS.Status=Paid)}

Its the same report without using SQL just using report tags. Just add the rest of your report below it like you did with the SQL.

So it would look like this:

[Tips by Tickets:1,2,2,1,1,1,1]
>Ticket Number|Date|Time|Tip Amount|Net Amount|Ticket Amount|Payment Type
{REPORT TICKET DETAILS:T.TicketNumber,T.Date,T.Time,CA.Tips,=[T.TotalAmount]-[CA.Tips],T.TotalAmount,TT.Payment:(TS.Status=Paid)}
Card Total: |||${REPORT PAYMENT TOTAL:(PT=Credit Card) AND (TU={SETTING:CURRENTUSER})}
Cash Total: |||${REPORT PAYMENT TOTAL:(PT=Cash) AND (TU={SETTING:CURRENTUSER})}
Tip Total: |||${REPORT CALCULATION TOTAL:(CT=Tips) AND (TU={SETTING:CURRENTUSER})}

>TOTAL:|||${REPORT PAYMENT TOTAL:(TU={SETTING:CURRENTUSER})}
Over||Short

You would need to fix the names of your calculation and the Ticket tag name like explained before.\

Remember it will only show new tickets that have been tagged. You would have to tag all of your other tickets for this to work on them. I am not sure how to combine payment type name into REPORT TICKET DETAILS tag otherwise.

Of course you could modify the SQL of the original report to show Payment Type.

@emre is there a way to show Payment Type Name using REPORT TICKET DETAILS ?

1 Like

Bada bing! You are the man… got it to work!

Is there a way to edit the width of the Date and Time columns? I have it set at 20cm but curious if we can set the individual column widths. Thanks again!

I will try and think of a way for you to show Payment Type on past tickets… until now this can work for all new tickets.

For my purposes, the past tickets is a non-issue… but appreciate the help.

1 Like

See Formatting Tables section of this document
http://www.sambapos.com/wiki/doku.php?id=custom_report_templates#formatting_tables

awesome, will do! Thanks Emre

@emre you may have missed my question it was burried in my long post. Is there a way we can get a field tag for Payment Type within REPORT TICKET DETAILS similar to P.Name for REPORT PAYMENT DETAILS?

I know that is not part of Tickets table so if its not doable I have already demonstrated a work around.

It is doable but we have to find a solution for displaying partial payments with different payment types.

1 Like

Hmm your right I did not think about that.

Displaying them comma separated doesnt look too bad.

This looks sweet, will have to set aside time to play with it. For now, have another question.

I added a 15% gratuity that can be selected for large groups based on this tutorial: Automatically adding a service charge when guests > x

That works fine, now I am trying to get that new figure to print in the report.

I was able to apply the 15% group gratuity to this last line item, but have not been successful trying to pull in the report.

Since we were able to add the Payment Type to the report by using:
TT.Payment Type Name:(TS.Status=Paid)}

I tried: TT.15% Gratuity:(TS.Status=Paid)}

But that didn’t work. Any thoughts?

What is the name of the calculation you made?

PS. you wont need ticket tag for this.

I named it: Large Table

So it would look like this:

CA.Large Table

Might be used like this:

{REPORT TICKET DETAILS:T.TicketNumber,T.Date,T.Time,CA.Tips,CA.Large Table,=[T.TotalAmount]-[CA.Tips]-[CA.Large Table],T.TotalAmount,TT.Payment:(TS.Status=Paid)}

You would need to add another section to the table format like this:
Notice I added an extra 1 at end of top line and I added Service Amount to the table header.

[Tips by Tickets:1,2,2,1,1,1,1,1]
>Ticket Number|Date|Time|Tip Amount|Service Amount|Net Amount|Ticket Amount|Payment Type

I moved 8 posts to a new topic: How to create code sections in forum posts

1 Like

OK. so PT field will return payment type names on next release.

2 Likes