Work Period Report Print at close period not right v4

Got an issue at the local.
Setup print work period report on the work period closed rule but recently the print doesn’t seem to be adding up…
The payments at top are not matching the grouped sales report at bottom.
Thought it might be manual prints with unpaid tickets but it’s not…
Here is an example.


See how sales, payments, submitted and paid are all 414.30 but the grouped sales are less.
Looking back to report it balances, it just seems to be the report printed at work period close…

Any ideas?

did you modify your report template if so can you show your template

[Sales:1, 1]
{REPORT TICKET TYPES:!PreOrder && TotalAmount >= 0}

[Pre Orders:1, 1]
{REPORT TICKET TYPES:PreOrder && 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}
>Total|{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)}

this should be you original template if you dont want modifcation

V4 only has custom reports as extra module and you cannot edit default work period template.
It’s not the template, been fine for 2 years and balances fine when looking back at past reports.
There close work period time has been getting quite long and thinking it might be a processing issue given looking back at report shows all ok.

i see yh been a while that i used V4 but what i see is that either doesnt show some payment methods(like a cheque payment dont know if you use that) or the caluclation is off

All due respect the default work period report is pretty rock solid.
Cheque would be included in the dynamic report payments and we’re taking sales not payments plus the report shows fine when backdating.
Also you will see from the report no calculations in use, plus again backdated report shows ok.
Liking your enthusiasm this evening @zaka360 but maybe a little less guess work :wink: :stuck_out_tongue:

It’s an early client of mine who was the reason I origionally found sambapos when he bought a till cheap without software and asked if I could sort something less than a week before he opened LOL
I expect I’ll end up upgrading him to v5 but for his needs v4 is more than suitable so would be more of a luxury.
Tempted to try backup and clear database to see if it is a time/lag based issue on closing work period but wanted a second opinion before progressing.
He has a seccond property and have at least 30-40 clients from last 2 years on v4 who I am now worried might face same issue if cannot narrow the problem down.

lol my bad now i see, i went a bit to fast and missed couple of things tought that the settled sections also didnt add up :sweat_smile:.

okay so everything shows up just calculation is off but its only off the day itself and only the sales sections hmm strange

Additionally - interestingly it’s not every day… Which goes against the lag/history idea…

It sees the sales in full on the top part but the order details section at bottom doesn’t tally with the sales total at top which is memory serves is ticket based.
Even if it was say the manager trying to add service charge which he has asked about and setup wrong it wouldn’t explain why it is ok when looking back to that day in reports at later date…

yh thats the puzzling part that it shows correctly at a later date

That’s what makes me think it’s related to the printing on work period closed action. But the fact it’s not every day chalanging that theory and makes debugging harder.

when checking your pic again it seems that stacey user sales are higher 296,55 but when you check settled by stacey its 271,55 and with ben its reversed his user sale is 117,75 but then settled by ben is 142,75 so if my calculation is correct what stacey has more ben has less or otherway around

Yes, as expected given they can both add orders to customer or table tickets and settle them, or Ben rings in and Stacy takes payment and visa versa.
However if you check the totals for both there sales and payments it equals the 414.30 amount which is correct, it’s only the breakdown which is incorrect.

yh just did the calculation of both and totals both are 414,30 so thats fine then :slight_smile:

then for the item sales is it all ways same item that is wrong or is it all the items that are affected?

It is more than one group effected, thought origionally it was just starters after first couple of errors but also happened for mains and bottles in varying combinations of them on differ reports, again all balancing when reprinting the report.

srry gonna guess again but :joy: could it be that its the latest table that allways dont show correctly cause if so then i think its cause of a scenario like this

days it malfunctions:
last ticket closes> work period closes instantly after closed ticket>report gets printed and due to all things happening so fast report isnt fully updated

days it works fine:
last ticket closes> after couple of mins work period closes> reports gets printed and now cause it had enough time to process all it prints a correct report

Work periods are closed manually, and chances even then of food being on last ticket is slim given food till 9 and work period closed much later.
If was something like that would expect payments to be short not sales as food defiantly not rang in anywhere near work period close.
Additionally all tickets/orders are showing submitted in state details and sales showing in sales section at top.

strange very strange :confused:

one thing i noticed(this is in V5 dont know if it exist in V4) there is a before work period ends event and and a work period ended event could it be you selected before work ends (strongly doubt it will be this but who knows ;))

It looks like your sales are higher than payments received. Any item discounts in there? Refunds?

nope cause when he reprints report it gets all printed correctly so everything is correct just not the item sales part shown when printed with the work period end automation

Difference of Item Sales part of the report is it joins items with Menu Items by id to fetch the menu item groups. I don’t know if it is the case and have no idea how it would be possible but if a sale does not have a corresponding item in menu items table it won’t appear in that section. That might be a single item so there would be no difference when that item won’t have a sale on that period.

If it is only a printing issue that happens only once and if report prints fine when fetched on reports screen that might be something else. Testing database with V5 may give an idea.