Hi Mahbub, thanks for looking into this.
You’re right, and I should correct my report: the Bookings list has no Trash action, and etn-order isn’t registered as a public post type, so edit.php?post_type=etn-order doesn’t exist either. I reached the trashed state programmatically (wp post delete without –force, which is WordPress’s default behaviour for any post), not through your UI.
That said, I’d suggest the underlying issue is still worth fixing. In 4.1.22 the query in etn_get_sold_tickets_by_event_legacy() still ends at WHERE p.post_type = ‘etn-order’ with no post_status condition. Any code path that trashes an order instead of deleting it — WP-CLI, a migration or staging script, a bulk-management plugin, or a future UI change — leaves the tickets permanently locked, with no way for an admin to notice or recover the seats short of finding and permanently deleting the row.
A one-line guard (AND p.post_status != ‘trash’) would make the count correct regardless of how the order got there, and costs nothing.