state maachine adeded to invoices