Index: uc_invoice.views.inc
===================================================================
--- uc_invoice.views.inc	(revision 9201)
+++ uc_invoice.views.inc	(working copy)
@@ -5,6 +5,12 @@
  */
 function uc_invoice_views_data_alter(&$data) {
     $invoice_schema = drupal_get_schema('uc_invoice');
+    $data['uc_invoice']['table']['base'] = array(
+        'field' => 'invoice_id',
+        'title' => t('Invoices'),
+        'help' => t("Invoices optionally generated by orders"),
+        'weight' => -10,
+    );
     $data['uc_invoice']['table']['join']['uc_orders'] = array(
         'left_field' => 'order_id',
         'field' => 'order_id',
@@ -16,6 +22,16 @@
     );
 
     $data['uc_invoice']['table']['group'] = t('Ubercart invoice number');
+    $data['uc_invoice']['order_id'] = array(
+        'title' => 'Order id',
+        'help' => t('Relationship to the order'),
+        'relationship' => array(
+            'base' => 'uc_orders',
+            'field' => 'order_id',
+            'handler' => 'views_handler_relationship',
+            'label' => t('Order'),
+        ),
+    );
     $data['uc_invoice']['invoice_nbr'] = array(
         'title' => t('Invoice number'),
         'help' => $invoice_schema['fields']['invoice_nbr']['description'],
