Custom balance in Workperiod report

Another question:
Quick workflow description:

Customers open a ticket, registered on their name. Now most of them pay their ticket as they leave, but it happens som1 comes back to pay next day. So I made a button to move the entire ticket to pre-order, so I can close the workperiod.

Now, in the end of day report, it all shows up, included the unpaid ticket.

How can I calculate account totals so it won’t add open/unpaid tickets to the results?

[VERKOOP 21%:2,1, 1]
{ACCOUNT TRANSACTION DETAILS:Sales Hoog}
>Sales Hoog||€ [=F(TN('{ACCOUNT CREDIT TOTAL:Sales Hoog}'),(TS Status=Paid),'#,#0.00')]
>BTW Hoog||€ [=F(TN('{ACCOUNT CREDIT TOTAL:BTW Hoog}'),(TS Status=Paid),'#,#0.00')]
[VERKOOP 6%:2,1, 1]
{ACCOUNT TRANSACTION DETAILS:Sales Laag}
>Sales Laag||€ [=F(TN('{ACCOUNT CREDIT TOTAL:Sales Laag}'),(TS Status=Paid),'#,#0.00')]
>BTW Laag||€ [=F(TN('{ACCOUNT CREDIT TOTAL:BTW Laag}'),(TS Status=Paid),'#,#0.00')]

[Orders:1, 1]
{REPORT TICKET TYPES:TotalAmount >= 0}

[Refunds:1, 1]
{REPORT TICKET TYPES:TotalAmount < 0}

[Payments:2, 1, 2]
{REPORT PAYMENT DETAILS:P.Name,P.Amount.Percent,P.Amount.Sum:Payment.Amount > 0}
>Totaal|{REPORT PAYMENT DETAILS:P.Amount.Sum:Payment.Amount > 0}

[Refund Payments:2, 1, 2]
{REPORT REFUND PAYMENTS}

[Ticket Details:2, 1, 2]
>>Ticket Counts
@!{TICKET TYPE LIST}
$1|{REPORT TICKET COUNT:(TY=$1)}|{REPORT TICKET TOTAL:(TY=$1)}
Total|{REPORT TICKET COUNT}|{REPORT TICKET TOTAL}
Amount per Ticket||[=F(TN('{REPORT TICKET TOTAL}')/TN('{REPORT TICKET COUNT}'))]
>>Order Counts
@!{TICKET TYPE LIST}
$1|{REPORT ORDER COUNT:(TY=$1)}|{REPORT ORDER TOTAL:(TY=$1)}
Total|{REPORT ORDER COUNT: }|{REPORT ORDER TOTAL: }
Orders per Ticket||[=F(TN('{REPORT ORDER COUNT: }')/TN('{REPORT TICKET COUNT: }'))]
Amount per Order||[=F(TN('{REPORT ORDER TOTAL: }')/TN('{REPORT ORDER COUNT: }'))]
>>Ticket Counts per State
{REPORT TICKET STATES}
>>Order Counts per State
{REPORT ORDER STATES}

[Ticket Tags:1, 1, 1]
{REPORT TICKET TAGS}

[Payment Details:2, 1, 2]
@{TICKET TYPE LIST}
@{TAX TYPE LIST}
>$1
{REPORT PAYMENT DETAILS:P.Name,P.Amount.Percent,P.Amount.Sum:(TY=$1)}
{REPORT CALCULATION DETAILS:C.Name,C.X,C.CalculationAmount.Sum:(TY=$1)}
$2||{REPORT TICKET DETAILS:TX.$2.Sum:(TY=$1)}

[User Sales:1, 1] 
{REPORT ORDER DETAILS:O.User,O.ExactTotal.Sum}
@{REPORT PAYMENT DETAILS:P.User,P.Amount.Sum::{0}:,} 
[Settled by $1:1, 1, 1] 
{REPORT PAYMENT DETAILS:P.Name,P.Amount.Percent,P.Amount.Sum:(PU=$1)} 
>Total Income|{REPORT PAYMENT DETAILS:P.Amount.Sum:(PU=$1)}

[Item Sales:2, 1, 2]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent,O.ExactTotal.Sum:(ODI=True)}
Total||{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True)}

For some reason TS Status=Paid is not in the right place, or not working with account statement…

[VERKOOP 21%:2,1, 1]
{ACCOUNT TRANSACTION DETAILS:Sales Hoog}
>Sales Hoog||€ [=F(TN('{ACCOUNT CREDIT TOTAL:Sales Hoog}'),(TS Status=Paid),'#,#0.00')]
>BTW Hoog||€ [=F(TN('{ACCOUNT CREDIT TOTAL:BTW Hoog}'),(TS Status=Paid),'#,#0.00')]
[VERKOOP 6%:2,1, 1]
{ACCOUNT TRANSACTION DETAILS:Sales Laag}
>Sales Laag||€ [=F(TN('{ACCOUNT CREDIT TOTAL:Sales Laag}'),(TS Status=Paid),'#,#0.00')]
>BTW Laag||€ [=F(TN('{ACCOUNT CREDIT TOTAL:BTW Laag}'),(TS Status=Paid),'#,#0.00')]

Tnx

Try TS.Status= instead

Hey Kendash,

Nope, won’t work. Also tried with space and a dot. Also tried the ‘AND’ statement, same result.

>Sales Hoog||€ [=F(TN('{ACCOUNT CREDIT TOTAL:Sales Hoog}') and (TS Status=Paid),'#,#0.00')]

Both not working.

Oh those are accounting tags sorry those are different. Those are not tickets so ticket state wont work on that.

Instead of using preorder tickets you should consider using customer accounts. Customer can pay on account balance.

This is what customer accounts were designed for.

Yes, true. But Customer accounts are too complicated for the employees to create and manage. Owner is getting tired of explaining over and over how to create a customer account, and how to settle it (too many mistakes were made, says something about IT knowledge of the employees?). He asked me for a simpeler solution, as is this. Now they make it a pre-order, and when customer comes back in a few days, it’s complete ticket is shown when selecting that customer.

Well using preorder tickets for this will cause inaccurate reports so you will need to understand that and work around it. You will need to explain to him the difference in reports. It will also not track inventory until ticket is paid.

I’m not sure about that, because these tickets are not “Paid”
That is why I want to filter on “Paid” only.

He is not using the inventory module.

You cant filter accounts with ticket states because accounts are not tickets.

Ok thats fine but if he ever wants to track inventory he should know that.

So, to get the job done, I need to make a transaction to 4 new accounts, to “Park” the not payed money.

Or maybe on payment transfer it to a payment account? Only problem is I have 4 end accounts:

Tax- High
Tax- Low
Sales High
Sales Low

On payment

Tax- High ----> Received tax high
Tax- Low ----> Received tax low
Sales High ----> Received sales high
Sales Low ----> Received sales low

Is that possible?

Oke, looked into it, not possible.

Is it possible to edit the following string to show the two tax ammount and the balance without tax?

>>Ticket Counts per State
{REPORT TICKET STATES}

For example:

Unpaid tickets: 2

Total amount tax high:
Amount: | € 5,00
Tax High: | € 1,05
Total: | € 6,05

Total amount tax low:
Amount: | € 5,00
Tax Low: | € 0,30
Total: | € 6,05

See my example report:

Figured it out.

Now only thing i need, is the amount of the unpaid tickets.

My setup is made so customers can pay later. So I DON’T want to use the customer account thing, because te staff is not smart enough to handle this. They say its too complicated.

So I made a sort of “Pre-order” system with this post:

https://forum.sambapos.com/t/work-period-2-or-3-shifts-in-a-cafe-restaurant/1147

So I made a button to “park” a ticket.

And Finaly got the End of Workperiod correct.

1 Like