Add Invoice hook in orderstoinvoice.php + Standardization

New context: orderstoinvoice.

Tested with CustomFields.

Also took this opportunity to standardize a bit the code as suggested by Eldy.

Signed-off-by: Stephen L. <lrq3000@gmail.com>