Automatically create an invoice when certain criteria are met

Automatically create an invoice when certain criteria are met

I have a custom check box on the expense module, where if its true, I'd like a workflow to automatically create an invoice that is half the amount. Is it possible to do this with custom functions? If yes, how?