How to set a Price Quote as Invoiced after accepted?

Is it possible to change price quote status using code once customer accepts it?