title: magento join order and invoice
body: <p>Basically I want to link sales/order and sales/order_invoice table to get order_source feild from sales/order when cycling through invoices;</p>
  
  <p>This is my attmpt: </p>
  
  <pre><code>$collection = Mage::getModel('sales/order_invoice')-&gt;getCollection();
  $collection = $collection-&gt;addAttributeToFilter('order_id', array('from' =&gt;$from));
  $collection-&gt;joinAttribute('order_source', 'order/order_source', 'order_id', null, 'left');
  
  foreach($collection as $invoice){  
  
  $orderSource = $invoice-&gt;getOrderSource();
  
  //do other stuff
  
  }
  </code></pre>
  
  <p>I'm new to magento</p>