How To Seperate Cash/CC Tickets in Report?

Basically I’m trying to create a report where It shows all Cash payment tickets for the day and all Card payments for the days separately. Below is what I got so far


Template:

[Cash Sale Tickets:3,2,3,3,2]
Date:|{DATE}
Server:|{SETTING:CURRENTUSER}
Time|T.No.|Payment|Total
{REPORT PAYMENT DETAILS:P.Time,T.Id,P.Type,TN.TotalAmount:(TS.Status=Paid) AND (TY=Ticket) AND (TU={SETTING:CURRENTUSER})}

Cash:|||${REPORT PAYMENT TOTAL:(PT=Cash) AND (TU={SETTING:CURRENTUSER})} 
TOTAL:|||${REPORT PAYMENT TOTAL:(TU={SETTING:CURRENTUSER})}

How can I Filter it to show JUST Cash tickets?
I was hoping to make one for CASH and one for Card

Do I have to use an sql script to get that sort of data or can I filter payment type to cash only and card only

Something like that?

>Cash Payments
{REPORT PAYMENT DETAILS:P.Time,T.Id,P.Type,TN.TotalAmount:(TS.Status=Paid) AND (TY=Ticket) AND (PT=Cash) AND (TU={SETTING:CURRENTUSER})}
Total Cash:|||${REPORT PAYMENT TOTAL:(PT=Cash) AND (TU={SETTING:CURRENTUSER})} 
>Credit Card Payments
{REPORT PAYMENT DETAILS:P.Time,T.Id,P.Type,TN.TotalAmount:(TS.Status=Paid) AND (TY=Ticket) AND (PT=Credit Card) AND (TU={SETTING:CURRENTUSER})}
Total Credit Card:|||${REPORT PAYMENT TOTAL:(PT=Credit Card) AND (TU={SETTING:CURRENTUSER})} 

TOTAL:|||${REPORT PAYMENT TOTAL:(TU={SETTING:CURRENTUSER})}
1 Like

Yep that is exactly what I needed.
Thanks for that, but could you explain how you filtered that?
I mean looking at code, I can understand all the lines up to [quote=“emre, post:3, topic:13927”]
{REPORT PAYMENT DETAILS:P.Time,T.Id,P.Type,
[/quote]

but then

is where I got only a little confused. that entire line, is that connected to TN.TotalAmount:(TS.Status=Paid)?

I explained it in detail here https://sambapos.com/wiki/doku.php/custom_reporting_tags#expressions

Thanks abe, appreciate the explanation. Sorry for the trouble

1 Like

No trouble :slight_smile: I’m glad it helped.

Um I an issue, after creating the report, how come it won’t show previous data?
I just made that report on a backup database with data already in it and all I got was


I also just started a new work period thinking maybe it needs an update but still doesn’t give me any info.

Below is the template i used

[Card Sale Tickets:1,1,1,1]
>>Time|Ticket ID|Payment Type|Total
{REPORT PAYMENT DETAILS:P.Time,T.Id,P.Type,TN.TotalAmount:(TS.Status=Paid) AND (TY=Ticket) AND (PT=Cash) AND (TU={SETTING:CURRENTUSER})}
>Total Cash:|||${REPORT PAYMENT TOTAL:(PT=Cash) AND (TU={SETTING:CURRENTUSER})}

I even tried the one you helped me with and still just get

But when I recreated the report on another database, it only worked after i made some new transactions??


Very strange. Any ideas?

That Template is filtered to only show Cash Payment Type.

That Workperiod was only open for 7 minutes. Is it possible there were no CC Payments?

The Report Preview will only show you most recent Workperiod data.

Are you sure the Payment Type is actually named “Credit Card” and not something else?

that is what i wanted as client wanted them separately( no particular reason, just the client’s request)

That’s perfectly fine
but what about below then?


its showing totals of each which is fine but not showing the tickets like the last screen shot?

the screen shot i just took and pasted now was straight from report screen filtered to a week ago to now

yep because it is actually showing total amounts but no ticket info.

screen shot with same custom report template on both first database and second database below

They are both using latest samba version as well

You are filtering also on (TU={SETTING:CURRENTUSER}), so you need to ensure that the logged in User actually Settled Tickets in the period that you are reporting.

Maybe add the User to the Report so you can see who you are reporting for, or remove the (TU={SETTING:CURRENTUSER}) filter if you don’t care about the User.

[Ticket Payments:1,1,1, 1]
>>{SETTING:CURRENTUSER}
>>Time|Ticket ID|Payment Type|Total
>Cash Payments
{REPORT PAYMENT DETAILS:P.Time,T.Id,P.Type,TN.TotalAmount:(TS.Status=Paid) AND (TY=Ticket) AND (PT=Cash) AND (TU={SETTING:CURRENTUSER})}
Total Cash:|||${REPORT PAYMENT TOTAL:(PT=Cash) AND (TU={SETTING:CURRENTUSER})} 
>Credit Card Payments
{REPORT PAYMENT DETAILS:P.Time,T.Id,P.Type,TN.TotalAmount:(TS.Status=Paid) AND (TY=Ticket) AND (PT=Credit Card) AND (TU={SETTING:CURRENTUSER})}
Total Credit Card:|||${REPORT PAYMENT TOTAL:(PT=Credit Card) AND (TU={SETTING:CURRENTUSER})} 

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

Administrator is the only user at this stage so whether it’s there or not I think shouldn’t really matter.
however I just tested your template on the one that wasn’t showing the tickets and it still hasn’t changed.


It shows total, but not ticket. It’s acting weirdly. I thought I’d reinstall samba again and test this on a remote workstation. It works on the original system I did this on, but not on the workstation either.

Quick Question… in the template
what does (TY=Ticket) mean?

Because On both workstations I removed that and suddenly It was working?!


UPDATE: Yep I just tested it on 4 different databases and removing TY=Ticket fixed the issue.
what does TY stand for?

One more question.

Some tickets may have mixed payment method, card and cash.
What syntax could we use to filter that? to show tickets that had more than 1 payment method used.?

TY is for ticket type so that report was filtered to only show tickets with a ticket type name of Ticket

So you must be changing the ticket type name somewhere which excludes those tickets from that report

2 Likes

Ahh thanks for that clarification. Well that makes a lot of sense to why it wasn’t showing any tickets. Because I had 2 departments and ticket types. So i suppose by removing that specific filter it showed all ticket types. sweet.

1 Like