Fixed bug #807: Margins modules with orders2invoice does not respect cost price

Also, removed duplicated requires in orderstoinvoice.php