The current approach to invoicing tickets was kinda "bolted on". Initially it was just a button, then it actually worked, and now I think it adds an internal note with some details. This suggestion has been a long time coming!
Seems like we want an extra database field on the ticket table to indicate whether a ticket has been invoiced or not?
Something like ticket_invoiced
as an int 0/1. This would make it easy to filter.
We could store any extra useful data (like the datetime, invoice number associated, agent, etc.) in a separate table like ticket_invoices if we wanted granular details to be recorded and easily manipulated - or just stick to having it as a ticket note?