Quote to order method

Have a look at this post, it shows how to find and set fields on a Sales Order from a quote

You can set any header fields with this code and with a little tinkering you can set detail fields too