SearchKit: Totals include test, template and deleted entities, while rows do not, leading to mismatch
This one does not make accounting types happy, who really don't like it when you give them a shiny new report and it turns out the totals don't match the sum of the values in the rows. The cause is that the select for the rows excludes, by default, test and template contributions, while the select for the total does include them.
To replicate:
- Create a test contribution with date today
- Create a SK search showing contributions with date today, should be no results
- Create a SearchDisplay that shows totals
Even though you have zero rows in your table, you will have a total showing the amount from your test contribution.
So to fix this, we need the query that is being created here to be subject to the same spec modification that happens by default from here. But the mechanics of that are a little over my head.